@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.
- package/dist/axon-server-event-store.d.ts +16 -0
- package/dist/axon-server-event-store.d.ts.map +1 -0
- package/dist/axon-server-event-store.js +282 -0
- package/dist/axon-server-event-store.js.map +1 -0
- package/dist/axon-server-snapshot-store.d.ts +12 -0
- package/dist/axon-server-snapshot-store.d.ts.map +1 -0
- package/dist/axon-server-snapshot-store.js +88 -0
- package/dist/axon-server-snapshot-store.js.map +1 -0
- package/dist/axon-server.d.ts +115 -0
- package/dist/axon-server.d.ts.map +1 -0
- package/dist/axon-server.js +986 -0
- package/dist/axon-server.js.map +1 -0
- package/dist/connection-manager.d.ts +49 -0
- package/dist/connection-manager.d.ts.map +1 -0
- package/dist/connection-manager.js +37 -0
- package/dist/connection-manager.js.map +1 -0
- package/dist/connection.d.ts +129 -0
- package/dist/connection.d.ts.map +1 -0
- package/dist/connection.js +130 -0
- package/dist/connection.js.map +1 -0
- package/dist/errors.d.ts +96 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +189 -0
- package/dist/errors.js.map +1 -0
- package/dist/event-processor-info.d.ts +35 -0
- package/dist/event-processor-info.d.ts.map +1 -0
- package/dist/event-processor-info.js +28 -0
- package/dist/event-processor-info.js.map +1 -0
- package/dist/flow-controlled-sender.d.ts +30 -0
- package/dist/flow-controlled-sender.d.ts.map +1 -0
- package/dist/flow-controlled-sender.js +60 -0
- package/dist/flow-controlled-sender.js.map +1 -0
- package/dist/generated/command.d.ts +158 -0
- package/dist/generated/command.d.ts.map +1 -0
- package/dist/generated/command.js +970 -0
- package/dist/generated/command.js.map +1 -0
- package/dist/generated/common.d.ts +130 -0
- package/dist/generated/common.d.ts.map +1 -0
- package/dist/generated/common.js +908 -0
- package/dist/generated/common.js.map +1 -0
- package/dist/generated/control.d.ts +293 -0
- package/dist/generated/control.d.ts.map +1 -0
- package/dist/generated/control.js +1938 -0
- package/dist/generated/control.js.map +1 -0
- package/dist/generated/dcb.d.ts +650 -0
- package/dist/generated/dcb.d.ts.map +1 -0
- package/dist/generated/dcb.js +2943 -0
- package/dist/generated/dcb.js.map +1 -0
- package/dist/generated/event.d.ts +667 -0
- package/dist/generated/event.d.ts.map +1 -0
- package/dist/generated/event.js +3185 -0
- package/dist/generated/event.js.map +1 -0
- package/dist/generated/google/protobuf/empty.d.ts +30 -0
- package/dist/generated/google/protobuf/empty.d.ts.map +1 -0
- package/dist/generated/google/protobuf/empty.js +46 -0
- package/dist/generated/google/protobuf/empty.js.map +1 -0
- package/dist/generated/query.d.ts +300 -0
- package/dist/generated/query.d.ts.map +1 -0
- package/dist/generated/query.js +2183 -0
- package/dist/generated/query.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/message-size.d.ts +38 -0
- package/dist/message-size.d.ts.map +1 -0
- package/dist/message-size.js +57 -0
- package/dist/message-size.js.map +1 -0
- package/dist/metadata-conversion.d.ts +11 -0
- package/dist/metadata-conversion.d.ts.map +1 -0
- package/dist/metadata-conversion.js +51 -0
- package/dist/metadata-conversion.js.map +1 -0
- package/dist/outbound-stream.d.ts +15 -0
- package/dist/outbound-stream.d.ts.map +1 -0
- package/dist/outbound-stream.js +39 -0
- package/dist/outbound-stream.js.map +1 -0
- package/dist/platform-service.d.ts +119 -0
- package/dist/platform-service.d.ts.map +1 -0
- package/dist/platform-service.js +250 -0
- package/dist/platform-service.js.map +1 -0
- package/dist/shutdown-latch.d.ts +38 -0
- package/dist/shutdown-latch.d.ts.map +1 -0
- package/dist/shutdown-latch.js +51 -0
- package/dist/shutdown-latch.js.map +1 -0
- package/package.json +69 -0
- package/src/axon-server-event-store.ts +358 -0
- package/src/axon-server-snapshot-store.ts +118 -0
- package/src/axon-server.ts +1202 -0
- package/src/connection-manager.ts +88 -0
- package/src/connection.ts +272 -0
- package/src/errors.ts +223 -0
- package/src/event-processor-info.ts +62 -0
- package/src/flow-controlled-sender.ts +91 -0
- package/src/generated/command.ts +1231 -0
- package/src/generated/common.ts +1097 -0
- package/src/generated/control.ts +2419 -0
- package/src/generated/dcb.ts +3826 -0
- package/src/generated/event.ts +4076 -0
- package/src/generated/google/protobuf/empty.ts +84 -0
- package/src/generated/query.ts +2723 -0
- package/src/index.ts +75 -0
- package/src/message-size.ts +75 -0
- package/src/metadata-conversion.ts +46 -0
- package/src/outbound-stream.ts +52 -0
- package/src/platform-service.ts +361 -0
- package/src/shutdown-latch.ts +97 -0
|
@@ -0,0 +1,3826 @@
|
|
|
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: dcb.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
import type { CallContext, CallOptions } from "nice-grpc-common";
|
|
10
|
+
import { InstructionAck } from "./common.js";
|
|
11
|
+
|
|
12
|
+
export const protobufPackage = "io.axoniq.axonserver.grpc.event.dcb";
|
|
13
|
+
|
|
14
|
+
/** Request message to schedule an event */
|
|
15
|
+
export interface ScheduleEventRequest {
|
|
16
|
+
/** timestamp when to publish the event */
|
|
17
|
+
instant: bigint;
|
|
18
|
+
/** the event to publish */
|
|
19
|
+
event: Event | undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Request message to reschedule an event */
|
|
23
|
+
export interface RescheduleEventRequest {
|
|
24
|
+
/** schedule token of the event to reschedule */
|
|
25
|
+
token: string;
|
|
26
|
+
/** timestamp when to publish the event */
|
|
27
|
+
instant: bigint;
|
|
28
|
+
/** optionally provide a new event to publish */
|
|
29
|
+
event: Event | undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Request message to cancel an event */
|
|
33
|
+
export interface CancelScheduledEventRequest {
|
|
34
|
+
/** token of scheduled event to cancel */
|
|
35
|
+
token: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Token to manage a scheduled event */
|
|
39
|
+
export interface ScheduleToken {
|
|
40
|
+
/** Field defining the token identifier */
|
|
41
|
+
token: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** The event message. */
|
|
45
|
+
export interface Event {
|
|
46
|
+
/** The unique identifier of the event. */
|
|
47
|
+
identifier: string;
|
|
48
|
+
/** The timestamp of the event. */
|
|
49
|
+
timestamp: bigint;
|
|
50
|
+
/** The name of the event. */
|
|
51
|
+
name: string;
|
|
52
|
+
/** The version of the event. */
|
|
53
|
+
version: string;
|
|
54
|
+
/** The payload of the event. */
|
|
55
|
+
payload: Uint8Array;
|
|
56
|
+
/** The metadata of the event. */
|
|
57
|
+
metadata: { [key: string]: string };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface Event_MetadataEntry {
|
|
61
|
+
key: string;
|
|
62
|
+
value: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** The tag. Describes an event with more details. Usually using concepts from the Domain. */
|
|
66
|
+
export interface Tag {
|
|
67
|
+
/** The key of the tag. */
|
|
68
|
+
key: Uint8Array;
|
|
69
|
+
/** The value of the tag. */
|
|
70
|
+
value: Uint8Array;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** The event described in more details by a list of tags. */
|
|
74
|
+
export interface TaggedEvent {
|
|
75
|
+
/** The event. */
|
|
76
|
+
event:
|
|
77
|
+
| Event
|
|
78
|
+
| undefined;
|
|
79
|
+
/** List of tags describing the given event in more details. */
|
|
80
|
+
tag: Tag[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** The event retrieved from the event store with its corresponding sequence. */
|
|
84
|
+
export interface SequencedEvent {
|
|
85
|
+
/** The sequence of the event. */
|
|
86
|
+
sequence: bigint;
|
|
87
|
+
/** The event. */
|
|
88
|
+
event: Event | undefined;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** The message representing the request to append events to the event store. */
|
|
92
|
+
export interface AppendEventsRequest {
|
|
93
|
+
/** The condition used to check the validity of this request. If omitted, events will be appended unconditionally. */
|
|
94
|
+
condition:
|
|
95
|
+
| ConsistencyCondition
|
|
96
|
+
| undefined;
|
|
97
|
+
/**
|
|
98
|
+
* A list of tagged events to be appended to the event store if the condition is met.
|
|
99
|
+
* These events are considered as a transaction - they are either all appended or none of them are appended.
|
|
100
|
+
* The event store will index the events based on provided tags for future faster retrieval.
|
|
101
|
+
*/
|
|
102
|
+
event: TaggedEvent[];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The response of a successful append events request. If there was an issue with the append events request,
|
|
107
|
+
* the stream will complete with an error.
|
|
108
|
+
*/
|
|
109
|
+
export interface AppendEventsResponse {
|
|
110
|
+
/**
|
|
111
|
+
* The sequence of the first event stored in the event store.
|
|
112
|
+
* Corresponding to the list of events (a transaction) passed in the AppendEventsRequest.
|
|
113
|
+
*/
|
|
114
|
+
sequenceOfTheFirstEvent: bigint;
|
|
115
|
+
/** The number of events appended. Matches the number of events passed in the AppendEventsRequest. */
|
|
116
|
+
transactionSize: number;
|
|
117
|
+
/**
|
|
118
|
+
* The consistency marker which may be used for a subsequent append events requests. Do note that during the time this
|
|
119
|
+
* consistency marker may get far behind the head of the event store which will increase the time needed for the append
|
|
120
|
+
* events request to be validated. If you don't plan to do subsequent append events requests in a "short" period of time,
|
|
121
|
+
* use the Source RPC to refresh the consistency marker.
|
|
122
|
+
*/
|
|
123
|
+
consistencyMarker: bigint;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The request to source events from the event store. It results in a finite stream of events completed by
|
|
128
|
+
* the event store. It may also be cancelled by the client. Only events matching the given criteria
|
|
129
|
+
* (a provided list of criterions) will be present in the stream. The stream is capped by the HEAD of the event store.
|
|
130
|
+
*/
|
|
131
|
+
export interface SourceEventsRequest {
|
|
132
|
+
/** An inclusive sequence of the first event to be included in the resulting stream. */
|
|
133
|
+
fromSequence: bigint;
|
|
134
|
+
/**
|
|
135
|
+
* The criteria consisting of the list of criterions. If at least one of these criterions is met,
|
|
136
|
+
* the criteria is met.
|
|
137
|
+
*/
|
|
138
|
+
criterion: Criterion[];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* The response to the SourceEventsRequest. It consists either of an event (with its corresponding sequence) or a
|
|
143
|
+
* consistency marker. The consistency marker should be used in a following AppendEventsRequest related to the criteria used in the SourceEventsRequest this response originates from.
|
|
144
|
+
*/
|
|
145
|
+
export interface SourceEventsResponse {
|
|
146
|
+
/** The event matching the criteria with its corresponding sequence. */
|
|
147
|
+
event?:
|
|
148
|
+
| SequencedEvent
|
|
149
|
+
| undefined;
|
|
150
|
+
/** The consistency marker to be used for the following append related to the same criteria. */
|
|
151
|
+
consistencyMarker?: bigint | undefined;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The condition for an AppendEventsRequest. Consists of the consistency marker and the criteria
|
|
156
|
+
* (a list of criterions).
|
|
157
|
+
*/
|
|
158
|
+
export interface ConsistencyCondition {
|
|
159
|
+
/**
|
|
160
|
+
* The sequence used to start checking for the consistency of an append. If there are events with a sequence greater
|
|
161
|
+
* or equal than the consistency marker and those are matching the given criteria, the condition is not met and the transaction
|
|
162
|
+
* is rejected. Otherwise, it is accepted.
|
|
163
|
+
*/
|
|
164
|
+
consistencyMarker: bigint;
|
|
165
|
+
/** The criteria. Consists of a list of criterions. If a single criterion is met, the whole criteria is met. */
|
|
166
|
+
criterion: Criterion[];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** The integral part of the criteria. */
|
|
170
|
+
export interface Criterion {
|
|
171
|
+
/** The criterion based on event tags and event names. */
|
|
172
|
+
tagsAndNames: TagsAndNamesCriterion | undefined;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* The criterion based on event tags and event names. The event meets this criterion if ALL tags from this criterion
|
|
177
|
+
* are present in the tags of the event AND if the event name is present in one of the names of the this criterion.
|
|
178
|
+
*/
|
|
179
|
+
export interface TagsAndNamesCriterion {
|
|
180
|
+
/** A list of event names. The event meets this criterion if its name is in one of the names in this list. */
|
|
181
|
+
name: string[];
|
|
182
|
+
/**
|
|
183
|
+
* A list of event tags. The event meets this criterion if it contains all the tags from this list. It meets the
|
|
184
|
+
* criterion if it contains more than provided list here, but it MUST contain all from the list.
|
|
185
|
+
*/
|
|
186
|
+
tag: Tag[];
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The request to provide an infinite stream of events from the event store. The client may cancel the stream at any
|
|
191
|
+
* time.
|
|
192
|
+
*/
|
|
193
|
+
export interface StreamEventsRequest {
|
|
194
|
+
/** The inclusive sequence to start streaming from. */
|
|
195
|
+
fromSequence: bigint;
|
|
196
|
+
/**
|
|
197
|
+
* The criteria used to filter out events. Represented by a list of criterions. If at least one is met, the whole
|
|
198
|
+
* criteria is met.
|
|
199
|
+
*/
|
|
200
|
+
criterion: Criterion[];
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/** The response to the StreamEventsRequest. */
|
|
204
|
+
export interface StreamEventsResponse {
|
|
205
|
+
/** The event with its corresponding sequence. */
|
|
206
|
+
event: SequencedEvent | undefined;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** The request to retrieve the current HEAD of the event store. */
|
|
210
|
+
export interface GetHeadRequest {
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** The current HEAD of the event store. */
|
|
214
|
+
export interface GetHeadResponse {
|
|
215
|
+
/**
|
|
216
|
+
* The sequence of the current head. Points to the position of the first event to be appended. The HEAD of an empty
|
|
217
|
+
* event store is 0.
|
|
218
|
+
*/
|
|
219
|
+
sequence: bigint;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** The request to retrieve the current TAIL of the event store. */
|
|
223
|
+
export interface GetTailRequest {
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/** The current TAIL of the event store. */
|
|
227
|
+
export interface GetTailResponse {
|
|
228
|
+
/**
|
|
229
|
+
* The sequence of the first event in the event store. 0 for an empty event store. 0 for a non-truncated event store.
|
|
230
|
+
* Non-zero for a truncated event store.
|
|
231
|
+
*/
|
|
232
|
+
sequence: bigint;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* The request to get the sequence of the event whose timestamp is the same as the timestamp provided in the request.
|
|
237
|
+
* If there are no events with the exact timestamp, then the sequence of the first one after the provided timestamp is
|
|
238
|
+
* returned. If the provided timestamp is greater that the sequence of the last event in the event store,
|
|
239
|
+
* the HEAD is returned.
|
|
240
|
+
*/
|
|
241
|
+
export interface GetSequenceAtRequest {
|
|
242
|
+
/** The timestamp. */
|
|
243
|
+
timestamp: bigint;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/** The sequence of the event approximately close to the provided timestamp. */
|
|
247
|
+
export interface GetSequenceAtResponse {
|
|
248
|
+
/** The sequence of the event. */
|
|
249
|
+
sequence: bigint;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** The request to add tags to the event. */
|
|
253
|
+
export interface AddTagsRequest {
|
|
254
|
+
/** The sequence of the event whose tags list will be expanded with the tags from the request. */
|
|
255
|
+
sequence: bigint;
|
|
256
|
+
/**
|
|
257
|
+
* The tags to be added to the event. If the event already contains a tag from the same list
|
|
258
|
+
* (with the same key and the value) the new one will be ignored.
|
|
259
|
+
*/
|
|
260
|
+
tag: Tag[];
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** The response indicating a successful addition of tags to the event. */
|
|
264
|
+
export interface AddTagsResponse {
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/** The request to remove tags from the event. */
|
|
268
|
+
export interface RemoveTagsRequest {
|
|
269
|
+
/** The sequence of the event whose tags should be removed. */
|
|
270
|
+
sequence: bigint;
|
|
271
|
+
/** Tags to be removed. If the event is not tagged with listed tags, they are skipped. */
|
|
272
|
+
tag: Tag[];
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/** The response indicating a successful removal of tags for the event. */
|
|
276
|
+
export interface RemoveTagsResponse {
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/** The request to retrieve tags of the event. */
|
|
280
|
+
export interface GetTagsRequest {
|
|
281
|
+
/** The sequence of the event whose tags should be retrieved. */
|
|
282
|
+
sequence: bigint;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/** The response containing tags of an event. */
|
|
286
|
+
export interface GetTagsResponse {
|
|
287
|
+
/** The tags associated to the event. */
|
|
288
|
+
tag: Tag[];
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/** The snapshot. */
|
|
292
|
+
export interface Snapshot {
|
|
293
|
+
/** The name of the snapshot. */
|
|
294
|
+
name: string;
|
|
295
|
+
/** The version of the snapshot. */
|
|
296
|
+
version: string;
|
|
297
|
+
/** The payload of the snapshot. */
|
|
298
|
+
payload: Uint8Array;
|
|
299
|
+
/** The timestamp of the snapshot. */
|
|
300
|
+
timestamp: bigint;
|
|
301
|
+
/** The metadata of the snapshot. */
|
|
302
|
+
metadata: { [key: string]: string };
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export interface Snapshot_MetadataEntry {
|
|
306
|
+
key: string;
|
|
307
|
+
value: string;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/** The request to add the snapshot to the snapshot store. */
|
|
311
|
+
export interface AddSnapshotRequest {
|
|
312
|
+
/** The key this snapshot is added to. */
|
|
313
|
+
key: Uint8Array;
|
|
314
|
+
/**
|
|
315
|
+
* The sequence of the snapshot. Usually linked to the sequence of the event in the event store up to which
|
|
316
|
+
* the snapshot is taken.
|
|
317
|
+
*/
|
|
318
|
+
sequence: bigint;
|
|
319
|
+
/** If set to true, older snapshots for the same key are pruned. */
|
|
320
|
+
prune: boolean;
|
|
321
|
+
/** The snapshot. */
|
|
322
|
+
snapshot: Snapshot | undefined;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/** The response indicating the successful addition of the snapshot. */
|
|
326
|
+
export interface AddSnapshotResponse {
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* The request to delete the snapshot from the snapshot store.
|
|
331
|
+
* Deletes from a sequence of `0` to the specified `to_sequence`
|
|
332
|
+
*/
|
|
333
|
+
export interface DeleteSnapshotsRequest {
|
|
334
|
+
/** The key the snapshot is identified by. */
|
|
335
|
+
key: Uint8Array;
|
|
336
|
+
/** The exclusive upper bound sequence of the snapshot to end the deletion. */
|
|
337
|
+
toSequence: bigint;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/** The response indicating the successful deletion of the snapshot. */
|
|
341
|
+
export interface DeleteSnapshotsResponse {
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/** The request to retrieve all snapshots from the snapshot store based on the key and sequence bounds. */
|
|
345
|
+
export interface ListSnapshotsRequest {
|
|
346
|
+
/** The key of the snapshot. */
|
|
347
|
+
key: Uint8Array;
|
|
348
|
+
/** The inclusive bottom bound sequence used to filter out snapshots. */
|
|
349
|
+
fromSequence: bigint;
|
|
350
|
+
/** The exclusive upper bound sequence used to filter out snapshots. */
|
|
351
|
+
toSequence: bigint;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/** The response to the ListSnapshotRequest. */
|
|
355
|
+
export interface ListSnapshotsResponse {
|
|
356
|
+
/** The key of the snapshot. */
|
|
357
|
+
key: Uint8Array;
|
|
358
|
+
/** The sequence of the snapshot. */
|
|
359
|
+
sequence: bigint;
|
|
360
|
+
/** The snapshot. */
|
|
361
|
+
snapshot: Snapshot | undefined;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/** The request to retrieve the snapshot with the highest sequence from the snapshot store. */
|
|
365
|
+
export interface GetLastSnapshotRequest {
|
|
366
|
+
/** The key of the snapshot. */
|
|
367
|
+
key: Uint8Array;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/** The response to GetLatestSnapshotRequest. */
|
|
371
|
+
export interface GetLastSnapshotResponse {
|
|
372
|
+
/** The key of the snapshot. */
|
|
373
|
+
key: Uint8Array;
|
|
374
|
+
/** The sequence of the snapshot. */
|
|
375
|
+
sequence: bigint;
|
|
376
|
+
/** The snapshot. */
|
|
377
|
+
snapshot: Snapshot | undefined;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
function createBaseScheduleEventRequest(): ScheduleEventRequest {
|
|
381
|
+
return { instant: 0n, event: undefined };
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export const ScheduleEventRequest: MessageFns<ScheduleEventRequest> = {
|
|
385
|
+
encode(message: ScheduleEventRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
386
|
+
if (message.instant !== 0n) {
|
|
387
|
+
if (BigInt.asIntN(64, message.instant) !== message.instant) {
|
|
388
|
+
throw new globalThis.Error("value provided for field message.instant of type int64 too large");
|
|
389
|
+
}
|
|
390
|
+
writer.uint32(8).int64(message.instant);
|
|
391
|
+
}
|
|
392
|
+
if (message.event !== undefined) {
|
|
393
|
+
Event.encode(message.event, writer.uint32(18).fork()).join();
|
|
394
|
+
}
|
|
395
|
+
return writer;
|
|
396
|
+
},
|
|
397
|
+
|
|
398
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ScheduleEventRequest {
|
|
399
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
400
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
401
|
+
const message = createBaseScheduleEventRequest();
|
|
402
|
+
while (reader.pos < end) {
|
|
403
|
+
const tag = reader.uint32();
|
|
404
|
+
switch (tag >>> 3) {
|
|
405
|
+
case 1: {
|
|
406
|
+
if (tag !== 8) {
|
|
407
|
+
break;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
message.instant = reader.int64() as bigint;
|
|
411
|
+
continue;
|
|
412
|
+
}
|
|
413
|
+
case 2: {
|
|
414
|
+
if (tag !== 18) {
|
|
415
|
+
break;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
message.event = Event.decode(reader, reader.uint32());
|
|
419
|
+
continue;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
423
|
+
break;
|
|
424
|
+
}
|
|
425
|
+
reader.skip(tag & 7);
|
|
426
|
+
}
|
|
427
|
+
return message;
|
|
428
|
+
},
|
|
429
|
+
|
|
430
|
+
fromJSON(object: any): ScheduleEventRequest {
|
|
431
|
+
return {
|
|
432
|
+
instant: isSet(object.instant) ? BigInt(object.instant) : 0n,
|
|
433
|
+
event: isSet(object.event) ? Event.fromJSON(object.event) : undefined,
|
|
434
|
+
};
|
|
435
|
+
},
|
|
436
|
+
|
|
437
|
+
toJSON(message: ScheduleEventRequest): unknown {
|
|
438
|
+
const obj: any = {};
|
|
439
|
+
if (message.instant !== 0n) {
|
|
440
|
+
obj.instant = message.instant.toString();
|
|
441
|
+
}
|
|
442
|
+
if (message.event !== undefined) {
|
|
443
|
+
obj.event = Event.toJSON(message.event);
|
|
444
|
+
}
|
|
445
|
+
return obj;
|
|
446
|
+
},
|
|
447
|
+
|
|
448
|
+
create(base?: DeepPartial<ScheduleEventRequest>): ScheduleEventRequest {
|
|
449
|
+
return ScheduleEventRequest.fromPartial(base ?? {});
|
|
450
|
+
},
|
|
451
|
+
fromPartial(object: DeepPartial<ScheduleEventRequest>): ScheduleEventRequest {
|
|
452
|
+
const message = createBaseScheduleEventRequest();
|
|
453
|
+
message.instant = object.instant ?? 0n;
|
|
454
|
+
message.event = (object.event !== undefined && object.event !== null) ? Event.fromPartial(object.event) : undefined;
|
|
455
|
+
return message;
|
|
456
|
+
},
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
function createBaseRescheduleEventRequest(): RescheduleEventRequest {
|
|
460
|
+
return { token: "", instant: 0n, event: undefined };
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
export const RescheduleEventRequest: MessageFns<RescheduleEventRequest> = {
|
|
464
|
+
encode(message: RescheduleEventRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
465
|
+
if (message.token !== "") {
|
|
466
|
+
writer.uint32(10).string(message.token);
|
|
467
|
+
}
|
|
468
|
+
if (message.instant !== 0n) {
|
|
469
|
+
if (BigInt.asIntN(64, message.instant) !== message.instant) {
|
|
470
|
+
throw new globalThis.Error("value provided for field message.instant of type int64 too large");
|
|
471
|
+
}
|
|
472
|
+
writer.uint32(16).int64(message.instant);
|
|
473
|
+
}
|
|
474
|
+
if (message.event !== undefined) {
|
|
475
|
+
Event.encode(message.event, writer.uint32(26).fork()).join();
|
|
476
|
+
}
|
|
477
|
+
return writer;
|
|
478
|
+
},
|
|
479
|
+
|
|
480
|
+
decode(input: BinaryReader | Uint8Array, length?: number): RescheduleEventRequest {
|
|
481
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
482
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
483
|
+
const message = createBaseRescheduleEventRequest();
|
|
484
|
+
while (reader.pos < end) {
|
|
485
|
+
const tag = reader.uint32();
|
|
486
|
+
switch (tag >>> 3) {
|
|
487
|
+
case 1: {
|
|
488
|
+
if (tag !== 10) {
|
|
489
|
+
break;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
message.token = reader.string();
|
|
493
|
+
continue;
|
|
494
|
+
}
|
|
495
|
+
case 2: {
|
|
496
|
+
if (tag !== 16) {
|
|
497
|
+
break;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
message.instant = reader.int64() as bigint;
|
|
501
|
+
continue;
|
|
502
|
+
}
|
|
503
|
+
case 3: {
|
|
504
|
+
if (tag !== 26) {
|
|
505
|
+
break;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
message.event = Event.decode(reader, reader.uint32());
|
|
509
|
+
continue;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
513
|
+
break;
|
|
514
|
+
}
|
|
515
|
+
reader.skip(tag & 7);
|
|
516
|
+
}
|
|
517
|
+
return message;
|
|
518
|
+
},
|
|
519
|
+
|
|
520
|
+
fromJSON(object: any): RescheduleEventRequest {
|
|
521
|
+
return {
|
|
522
|
+
token: isSet(object.token) ? globalThis.String(object.token) : "",
|
|
523
|
+
instant: isSet(object.instant) ? BigInt(object.instant) : 0n,
|
|
524
|
+
event: isSet(object.event) ? Event.fromJSON(object.event) : undefined,
|
|
525
|
+
};
|
|
526
|
+
},
|
|
527
|
+
|
|
528
|
+
toJSON(message: RescheduleEventRequest): unknown {
|
|
529
|
+
const obj: any = {};
|
|
530
|
+
if (message.token !== "") {
|
|
531
|
+
obj.token = message.token;
|
|
532
|
+
}
|
|
533
|
+
if (message.instant !== 0n) {
|
|
534
|
+
obj.instant = message.instant.toString();
|
|
535
|
+
}
|
|
536
|
+
if (message.event !== undefined) {
|
|
537
|
+
obj.event = Event.toJSON(message.event);
|
|
538
|
+
}
|
|
539
|
+
return obj;
|
|
540
|
+
},
|
|
541
|
+
|
|
542
|
+
create(base?: DeepPartial<RescheduleEventRequest>): RescheduleEventRequest {
|
|
543
|
+
return RescheduleEventRequest.fromPartial(base ?? {});
|
|
544
|
+
},
|
|
545
|
+
fromPartial(object: DeepPartial<RescheduleEventRequest>): RescheduleEventRequest {
|
|
546
|
+
const message = createBaseRescheduleEventRequest();
|
|
547
|
+
message.token = object.token ?? "";
|
|
548
|
+
message.instant = object.instant ?? 0n;
|
|
549
|
+
message.event = (object.event !== undefined && object.event !== null) ? Event.fromPartial(object.event) : undefined;
|
|
550
|
+
return message;
|
|
551
|
+
},
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
function createBaseCancelScheduledEventRequest(): CancelScheduledEventRequest {
|
|
555
|
+
return { token: "" };
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
export const CancelScheduledEventRequest: MessageFns<CancelScheduledEventRequest> = {
|
|
559
|
+
encode(message: CancelScheduledEventRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
560
|
+
if (message.token !== "") {
|
|
561
|
+
writer.uint32(10).string(message.token);
|
|
562
|
+
}
|
|
563
|
+
return writer;
|
|
564
|
+
},
|
|
565
|
+
|
|
566
|
+
decode(input: BinaryReader | Uint8Array, length?: number): CancelScheduledEventRequest {
|
|
567
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
568
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
569
|
+
const message = createBaseCancelScheduledEventRequest();
|
|
570
|
+
while (reader.pos < end) {
|
|
571
|
+
const tag = reader.uint32();
|
|
572
|
+
switch (tag >>> 3) {
|
|
573
|
+
case 1: {
|
|
574
|
+
if (tag !== 10) {
|
|
575
|
+
break;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
message.token = reader.string();
|
|
579
|
+
continue;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
583
|
+
break;
|
|
584
|
+
}
|
|
585
|
+
reader.skip(tag & 7);
|
|
586
|
+
}
|
|
587
|
+
return message;
|
|
588
|
+
},
|
|
589
|
+
|
|
590
|
+
fromJSON(object: any): CancelScheduledEventRequest {
|
|
591
|
+
return { token: isSet(object.token) ? globalThis.String(object.token) : "" };
|
|
592
|
+
},
|
|
593
|
+
|
|
594
|
+
toJSON(message: CancelScheduledEventRequest): unknown {
|
|
595
|
+
const obj: any = {};
|
|
596
|
+
if (message.token !== "") {
|
|
597
|
+
obj.token = message.token;
|
|
598
|
+
}
|
|
599
|
+
return obj;
|
|
600
|
+
},
|
|
601
|
+
|
|
602
|
+
create(base?: DeepPartial<CancelScheduledEventRequest>): CancelScheduledEventRequest {
|
|
603
|
+
return CancelScheduledEventRequest.fromPartial(base ?? {});
|
|
604
|
+
},
|
|
605
|
+
fromPartial(object: DeepPartial<CancelScheduledEventRequest>): CancelScheduledEventRequest {
|
|
606
|
+
const message = createBaseCancelScheduledEventRequest();
|
|
607
|
+
message.token = object.token ?? "";
|
|
608
|
+
return message;
|
|
609
|
+
},
|
|
610
|
+
};
|
|
611
|
+
|
|
612
|
+
function createBaseScheduleToken(): ScheduleToken {
|
|
613
|
+
return { token: "" };
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
export const ScheduleToken: MessageFns<ScheduleToken> = {
|
|
617
|
+
encode(message: ScheduleToken, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
618
|
+
if (message.token !== "") {
|
|
619
|
+
writer.uint32(10).string(message.token);
|
|
620
|
+
}
|
|
621
|
+
return writer;
|
|
622
|
+
},
|
|
623
|
+
|
|
624
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ScheduleToken {
|
|
625
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
626
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
627
|
+
const message = createBaseScheduleToken();
|
|
628
|
+
while (reader.pos < end) {
|
|
629
|
+
const tag = reader.uint32();
|
|
630
|
+
switch (tag >>> 3) {
|
|
631
|
+
case 1: {
|
|
632
|
+
if (tag !== 10) {
|
|
633
|
+
break;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
message.token = reader.string();
|
|
637
|
+
continue;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
641
|
+
break;
|
|
642
|
+
}
|
|
643
|
+
reader.skip(tag & 7);
|
|
644
|
+
}
|
|
645
|
+
return message;
|
|
646
|
+
},
|
|
647
|
+
|
|
648
|
+
fromJSON(object: any): ScheduleToken {
|
|
649
|
+
return { token: isSet(object.token) ? globalThis.String(object.token) : "" };
|
|
650
|
+
},
|
|
651
|
+
|
|
652
|
+
toJSON(message: ScheduleToken): unknown {
|
|
653
|
+
const obj: any = {};
|
|
654
|
+
if (message.token !== "") {
|
|
655
|
+
obj.token = message.token;
|
|
656
|
+
}
|
|
657
|
+
return obj;
|
|
658
|
+
},
|
|
659
|
+
|
|
660
|
+
create(base?: DeepPartial<ScheduleToken>): ScheduleToken {
|
|
661
|
+
return ScheduleToken.fromPartial(base ?? {});
|
|
662
|
+
},
|
|
663
|
+
fromPartial(object: DeepPartial<ScheduleToken>): ScheduleToken {
|
|
664
|
+
const message = createBaseScheduleToken();
|
|
665
|
+
message.token = object.token ?? "";
|
|
666
|
+
return message;
|
|
667
|
+
},
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
function createBaseEvent(): Event {
|
|
671
|
+
return { identifier: "", timestamp: 0n, name: "", version: "", payload: new Uint8Array(0), metadata: {} };
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
export const Event: MessageFns<Event> = {
|
|
675
|
+
encode(message: Event, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
676
|
+
if (message.identifier !== "") {
|
|
677
|
+
writer.uint32(10).string(message.identifier);
|
|
678
|
+
}
|
|
679
|
+
if (message.timestamp !== 0n) {
|
|
680
|
+
if (BigInt.asIntN(64, message.timestamp) !== message.timestamp) {
|
|
681
|
+
throw new globalThis.Error("value provided for field message.timestamp of type int64 too large");
|
|
682
|
+
}
|
|
683
|
+
writer.uint32(16).int64(message.timestamp);
|
|
684
|
+
}
|
|
685
|
+
if (message.name !== "") {
|
|
686
|
+
writer.uint32(26).string(message.name);
|
|
687
|
+
}
|
|
688
|
+
if (message.version !== "") {
|
|
689
|
+
writer.uint32(34).string(message.version);
|
|
690
|
+
}
|
|
691
|
+
if (message.payload.length !== 0) {
|
|
692
|
+
writer.uint32(42).bytes(message.payload);
|
|
693
|
+
}
|
|
694
|
+
globalThis.Object.entries(message.metadata).forEach(([key, value]: [string, string]) => {
|
|
695
|
+
Event_MetadataEntry.encode({ key: key as any, value }, writer.uint32(50).fork()).join();
|
|
696
|
+
});
|
|
697
|
+
return writer;
|
|
698
|
+
},
|
|
699
|
+
|
|
700
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Event {
|
|
701
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
702
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
703
|
+
const message = createBaseEvent();
|
|
704
|
+
while (reader.pos < end) {
|
|
705
|
+
const tag = reader.uint32();
|
|
706
|
+
switch (tag >>> 3) {
|
|
707
|
+
case 1: {
|
|
708
|
+
if (tag !== 10) {
|
|
709
|
+
break;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
message.identifier = reader.string();
|
|
713
|
+
continue;
|
|
714
|
+
}
|
|
715
|
+
case 2: {
|
|
716
|
+
if (tag !== 16) {
|
|
717
|
+
break;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
message.timestamp = reader.int64() as bigint;
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
case 3: {
|
|
724
|
+
if (tag !== 26) {
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
message.name = reader.string();
|
|
729
|
+
continue;
|
|
730
|
+
}
|
|
731
|
+
case 4: {
|
|
732
|
+
if (tag !== 34) {
|
|
733
|
+
break;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
message.version = reader.string();
|
|
737
|
+
continue;
|
|
738
|
+
}
|
|
739
|
+
case 5: {
|
|
740
|
+
if (tag !== 42) {
|
|
741
|
+
break;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
message.payload = reader.bytes();
|
|
745
|
+
continue;
|
|
746
|
+
}
|
|
747
|
+
case 6: {
|
|
748
|
+
if (tag !== 50) {
|
|
749
|
+
break;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
const entry6 = Event_MetadataEntry.decode(reader, reader.uint32());
|
|
753
|
+
if (entry6.value !== undefined) {
|
|
754
|
+
message.metadata[entry6.key] = entry6.value;
|
|
755
|
+
}
|
|
756
|
+
continue;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
760
|
+
break;
|
|
761
|
+
}
|
|
762
|
+
reader.skip(tag & 7);
|
|
763
|
+
}
|
|
764
|
+
return message;
|
|
765
|
+
},
|
|
766
|
+
|
|
767
|
+
fromJSON(object: any): Event {
|
|
768
|
+
return {
|
|
769
|
+
identifier: isSet(object.identifier) ? globalThis.String(object.identifier) : "",
|
|
770
|
+
timestamp: isSet(object.timestamp) ? BigInt(object.timestamp) : 0n,
|
|
771
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
772
|
+
version: isSet(object.version) ? globalThis.String(object.version) : "",
|
|
773
|
+
payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array(0),
|
|
774
|
+
metadata: isObject(object.metadata)
|
|
775
|
+
? (globalThis.Object.entries(object.metadata) as [string, any][]).reduce(
|
|
776
|
+
(acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
|
777
|
+
acc[key] = globalThis.String(value);
|
|
778
|
+
return acc;
|
|
779
|
+
},
|
|
780
|
+
{},
|
|
781
|
+
)
|
|
782
|
+
: {},
|
|
783
|
+
};
|
|
784
|
+
},
|
|
785
|
+
|
|
786
|
+
toJSON(message: Event): unknown {
|
|
787
|
+
const obj: any = {};
|
|
788
|
+
if (message.identifier !== "") {
|
|
789
|
+
obj.identifier = message.identifier;
|
|
790
|
+
}
|
|
791
|
+
if (message.timestamp !== 0n) {
|
|
792
|
+
obj.timestamp = message.timestamp.toString();
|
|
793
|
+
}
|
|
794
|
+
if (message.name !== "") {
|
|
795
|
+
obj.name = message.name;
|
|
796
|
+
}
|
|
797
|
+
if (message.version !== "") {
|
|
798
|
+
obj.version = message.version;
|
|
799
|
+
}
|
|
800
|
+
if (message.payload.length !== 0) {
|
|
801
|
+
obj.payload = base64FromBytes(message.payload);
|
|
802
|
+
}
|
|
803
|
+
if (message.metadata) {
|
|
804
|
+
const entries = globalThis.Object.entries(message.metadata) as [string, string][];
|
|
805
|
+
if (entries.length > 0) {
|
|
806
|
+
obj.metadata = {};
|
|
807
|
+
entries.forEach(([k, v]) => {
|
|
808
|
+
obj.metadata[k] = v;
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
return obj;
|
|
813
|
+
},
|
|
814
|
+
|
|
815
|
+
create(base?: DeepPartial<Event>): Event {
|
|
816
|
+
return Event.fromPartial(base ?? {});
|
|
817
|
+
},
|
|
818
|
+
fromPartial(object: DeepPartial<Event>): Event {
|
|
819
|
+
const message = createBaseEvent();
|
|
820
|
+
message.identifier = object.identifier ?? "";
|
|
821
|
+
message.timestamp = object.timestamp ?? 0n;
|
|
822
|
+
message.name = object.name ?? "";
|
|
823
|
+
message.version = object.version ?? "";
|
|
824
|
+
message.payload = object.payload ?? new Uint8Array(0);
|
|
825
|
+
message.metadata = (globalThis.Object.entries(object.metadata ?? {}) as [string, string][]).reduce(
|
|
826
|
+
(acc: { [key: string]: string }, [key, value]: [string, string]) => {
|
|
827
|
+
if (value !== undefined) {
|
|
828
|
+
acc[key] = globalThis.String(value);
|
|
829
|
+
}
|
|
830
|
+
return acc;
|
|
831
|
+
},
|
|
832
|
+
{},
|
|
833
|
+
);
|
|
834
|
+
return message;
|
|
835
|
+
},
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
function createBaseEvent_MetadataEntry(): Event_MetadataEntry {
|
|
839
|
+
return { key: "", value: "" };
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
export const Event_MetadataEntry: MessageFns<Event_MetadataEntry> = {
|
|
843
|
+
encode(message: Event_MetadataEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
844
|
+
if (message.key !== "") {
|
|
845
|
+
writer.uint32(10).string(message.key);
|
|
846
|
+
}
|
|
847
|
+
if (message.value !== "") {
|
|
848
|
+
writer.uint32(18).string(message.value);
|
|
849
|
+
}
|
|
850
|
+
return writer;
|
|
851
|
+
},
|
|
852
|
+
|
|
853
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Event_MetadataEntry {
|
|
854
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
855
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
856
|
+
const message = createBaseEvent_MetadataEntry();
|
|
857
|
+
while (reader.pos < end) {
|
|
858
|
+
const tag = reader.uint32();
|
|
859
|
+
switch (tag >>> 3) {
|
|
860
|
+
case 1: {
|
|
861
|
+
if (tag !== 10) {
|
|
862
|
+
break;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
message.key = reader.string();
|
|
866
|
+
continue;
|
|
867
|
+
}
|
|
868
|
+
case 2: {
|
|
869
|
+
if (tag !== 18) {
|
|
870
|
+
break;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
message.value = reader.string();
|
|
874
|
+
continue;
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
878
|
+
break;
|
|
879
|
+
}
|
|
880
|
+
reader.skip(tag & 7);
|
|
881
|
+
}
|
|
882
|
+
return message;
|
|
883
|
+
},
|
|
884
|
+
|
|
885
|
+
fromJSON(object: any): Event_MetadataEntry {
|
|
886
|
+
return {
|
|
887
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
888
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
889
|
+
};
|
|
890
|
+
},
|
|
891
|
+
|
|
892
|
+
toJSON(message: Event_MetadataEntry): unknown {
|
|
893
|
+
const obj: any = {};
|
|
894
|
+
if (message.key !== "") {
|
|
895
|
+
obj.key = message.key;
|
|
896
|
+
}
|
|
897
|
+
if (message.value !== "") {
|
|
898
|
+
obj.value = message.value;
|
|
899
|
+
}
|
|
900
|
+
return obj;
|
|
901
|
+
},
|
|
902
|
+
|
|
903
|
+
create(base?: DeepPartial<Event_MetadataEntry>): Event_MetadataEntry {
|
|
904
|
+
return Event_MetadataEntry.fromPartial(base ?? {});
|
|
905
|
+
},
|
|
906
|
+
fromPartial(object: DeepPartial<Event_MetadataEntry>): Event_MetadataEntry {
|
|
907
|
+
const message = createBaseEvent_MetadataEntry();
|
|
908
|
+
message.key = object.key ?? "";
|
|
909
|
+
message.value = object.value ?? "";
|
|
910
|
+
return message;
|
|
911
|
+
},
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
function createBaseTag(): Tag {
|
|
915
|
+
return { key: new Uint8Array(0), value: new Uint8Array(0) };
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
export const Tag: MessageFns<Tag> = {
|
|
919
|
+
encode(message: Tag, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
920
|
+
if (message.key.length !== 0) {
|
|
921
|
+
writer.uint32(10).bytes(message.key);
|
|
922
|
+
}
|
|
923
|
+
if (message.value.length !== 0) {
|
|
924
|
+
writer.uint32(18).bytes(message.value);
|
|
925
|
+
}
|
|
926
|
+
return writer;
|
|
927
|
+
},
|
|
928
|
+
|
|
929
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Tag {
|
|
930
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
931
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
932
|
+
const message = createBaseTag();
|
|
933
|
+
while (reader.pos < end) {
|
|
934
|
+
const tag = reader.uint32();
|
|
935
|
+
switch (tag >>> 3) {
|
|
936
|
+
case 1: {
|
|
937
|
+
if (tag !== 10) {
|
|
938
|
+
break;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
message.key = reader.bytes();
|
|
942
|
+
continue;
|
|
943
|
+
}
|
|
944
|
+
case 2: {
|
|
945
|
+
if (tag !== 18) {
|
|
946
|
+
break;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
message.value = reader.bytes();
|
|
950
|
+
continue;
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
954
|
+
break;
|
|
955
|
+
}
|
|
956
|
+
reader.skip(tag & 7);
|
|
957
|
+
}
|
|
958
|
+
return message;
|
|
959
|
+
},
|
|
960
|
+
|
|
961
|
+
fromJSON(object: any): Tag {
|
|
962
|
+
return {
|
|
963
|
+
key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(0),
|
|
964
|
+
value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0),
|
|
965
|
+
};
|
|
966
|
+
},
|
|
967
|
+
|
|
968
|
+
toJSON(message: Tag): unknown {
|
|
969
|
+
const obj: any = {};
|
|
970
|
+
if (message.key.length !== 0) {
|
|
971
|
+
obj.key = base64FromBytes(message.key);
|
|
972
|
+
}
|
|
973
|
+
if (message.value.length !== 0) {
|
|
974
|
+
obj.value = base64FromBytes(message.value);
|
|
975
|
+
}
|
|
976
|
+
return obj;
|
|
977
|
+
},
|
|
978
|
+
|
|
979
|
+
create(base?: DeepPartial<Tag>): Tag {
|
|
980
|
+
return Tag.fromPartial(base ?? {});
|
|
981
|
+
},
|
|
982
|
+
fromPartial(object: DeepPartial<Tag>): Tag {
|
|
983
|
+
const message = createBaseTag();
|
|
984
|
+
message.key = object.key ?? new Uint8Array(0);
|
|
985
|
+
message.value = object.value ?? new Uint8Array(0);
|
|
986
|
+
return message;
|
|
987
|
+
},
|
|
988
|
+
};
|
|
989
|
+
|
|
990
|
+
function createBaseTaggedEvent(): TaggedEvent {
|
|
991
|
+
return { event: undefined, tag: [] };
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
export const TaggedEvent: MessageFns<TaggedEvent> = {
|
|
995
|
+
encode(message: TaggedEvent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
996
|
+
if (message.event !== undefined) {
|
|
997
|
+
Event.encode(message.event, writer.uint32(10).fork()).join();
|
|
998
|
+
}
|
|
999
|
+
for (const v of message.tag) {
|
|
1000
|
+
Tag.encode(v!, writer.uint32(18).fork()).join();
|
|
1001
|
+
}
|
|
1002
|
+
return writer;
|
|
1003
|
+
},
|
|
1004
|
+
|
|
1005
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TaggedEvent {
|
|
1006
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1007
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1008
|
+
const message = createBaseTaggedEvent();
|
|
1009
|
+
while (reader.pos < end) {
|
|
1010
|
+
const tag = reader.uint32();
|
|
1011
|
+
switch (tag >>> 3) {
|
|
1012
|
+
case 1: {
|
|
1013
|
+
if (tag !== 10) {
|
|
1014
|
+
break;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
message.event = Event.decode(reader, reader.uint32());
|
|
1018
|
+
continue;
|
|
1019
|
+
}
|
|
1020
|
+
case 2: {
|
|
1021
|
+
if (tag !== 18) {
|
|
1022
|
+
break;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
message.tag.push(Tag.decode(reader, reader.uint32()));
|
|
1026
|
+
continue;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1030
|
+
break;
|
|
1031
|
+
}
|
|
1032
|
+
reader.skip(tag & 7);
|
|
1033
|
+
}
|
|
1034
|
+
return message;
|
|
1035
|
+
},
|
|
1036
|
+
|
|
1037
|
+
fromJSON(object: any): TaggedEvent {
|
|
1038
|
+
return {
|
|
1039
|
+
event: isSet(object.event) ? Event.fromJSON(object.event) : undefined,
|
|
1040
|
+
tag: globalThis.Array.isArray(object?.tag) ? object.tag.map((e: any) => Tag.fromJSON(e)) : [],
|
|
1041
|
+
};
|
|
1042
|
+
},
|
|
1043
|
+
|
|
1044
|
+
toJSON(message: TaggedEvent): unknown {
|
|
1045
|
+
const obj: any = {};
|
|
1046
|
+
if (message.event !== undefined) {
|
|
1047
|
+
obj.event = Event.toJSON(message.event);
|
|
1048
|
+
}
|
|
1049
|
+
if (message.tag?.length) {
|
|
1050
|
+
obj.tag = message.tag.map((e) => Tag.toJSON(e));
|
|
1051
|
+
}
|
|
1052
|
+
return obj;
|
|
1053
|
+
},
|
|
1054
|
+
|
|
1055
|
+
create(base?: DeepPartial<TaggedEvent>): TaggedEvent {
|
|
1056
|
+
return TaggedEvent.fromPartial(base ?? {});
|
|
1057
|
+
},
|
|
1058
|
+
fromPartial(object: DeepPartial<TaggedEvent>): TaggedEvent {
|
|
1059
|
+
const message = createBaseTaggedEvent();
|
|
1060
|
+
message.event = (object.event !== undefined && object.event !== null) ? Event.fromPartial(object.event) : undefined;
|
|
1061
|
+
message.tag = object.tag?.map((e) => Tag.fromPartial(e)) || [];
|
|
1062
|
+
return message;
|
|
1063
|
+
},
|
|
1064
|
+
};
|
|
1065
|
+
|
|
1066
|
+
function createBaseSequencedEvent(): SequencedEvent {
|
|
1067
|
+
return { sequence: 0n, event: undefined };
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
export const SequencedEvent: MessageFns<SequencedEvent> = {
|
|
1071
|
+
encode(message: SequencedEvent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1072
|
+
if (message.sequence !== 0n) {
|
|
1073
|
+
if (BigInt.asIntN(64, message.sequence) !== message.sequence) {
|
|
1074
|
+
throw new globalThis.Error("value provided for field message.sequence of type int64 too large");
|
|
1075
|
+
}
|
|
1076
|
+
writer.uint32(8).int64(message.sequence);
|
|
1077
|
+
}
|
|
1078
|
+
if (message.event !== undefined) {
|
|
1079
|
+
Event.encode(message.event, writer.uint32(18).fork()).join();
|
|
1080
|
+
}
|
|
1081
|
+
return writer;
|
|
1082
|
+
},
|
|
1083
|
+
|
|
1084
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SequencedEvent {
|
|
1085
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1086
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1087
|
+
const message = createBaseSequencedEvent();
|
|
1088
|
+
while (reader.pos < end) {
|
|
1089
|
+
const tag = reader.uint32();
|
|
1090
|
+
switch (tag >>> 3) {
|
|
1091
|
+
case 1: {
|
|
1092
|
+
if (tag !== 8) {
|
|
1093
|
+
break;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
message.sequence = reader.int64() as bigint;
|
|
1097
|
+
continue;
|
|
1098
|
+
}
|
|
1099
|
+
case 2: {
|
|
1100
|
+
if (tag !== 18) {
|
|
1101
|
+
break;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
message.event = Event.decode(reader, reader.uint32());
|
|
1105
|
+
continue;
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1109
|
+
break;
|
|
1110
|
+
}
|
|
1111
|
+
reader.skip(tag & 7);
|
|
1112
|
+
}
|
|
1113
|
+
return message;
|
|
1114
|
+
},
|
|
1115
|
+
|
|
1116
|
+
fromJSON(object: any): SequencedEvent {
|
|
1117
|
+
return {
|
|
1118
|
+
sequence: isSet(object.sequence) ? BigInt(object.sequence) : 0n,
|
|
1119
|
+
event: isSet(object.event) ? Event.fromJSON(object.event) : undefined,
|
|
1120
|
+
};
|
|
1121
|
+
},
|
|
1122
|
+
|
|
1123
|
+
toJSON(message: SequencedEvent): unknown {
|
|
1124
|
+
const obj: any = {};
|
|
1125
|
+
if (message.sequence !== 0n) {
|
|
1126
|
+
obj.sequence = message.sequence.toString();
|
|
1127
|
+
}
|
|
1128
|
+
if (message.event !== undefined) {
|
|
1129
|
+
obj.event = Event.toJSON(message.event);
|
|
1130
|
+
}
|
|
1131
|
+
return obj;
|
|
1132
|
+
},
|
|
1133
|
+
|
|
1134
|
+
create(base?: DeepPartial<SequencedEvent>): SequencedEvent {
|
|
1135
|
+
return SequencedEvent.fromPartial(base ?? {});
|
|
1136
|
+
},
|
|
1137
|
+
fromPartial(object: DeepPartial<SequencedEvent>): SequencedEvent {
|
|
1138
|
+
const message = createBaseSequencedEvent();
|
|
1139
|
+
message.sequence = object.sequence ?? 0n;
|
|
1140
|
+
message.event = (object.event !== undefined && object.event !== null) ? Event.fromPartial(object.event) : undefined;
|
|
1141
|
+
return message;
|
|
1142
|
+
},
|
|
1143
|
+
};
|
|
1144
|
+
|
|
1145
|
+
function createBaseAppendEventsRequest(): AppendEventsRequest {
|
|
1146
|
+
return { condition: undefined, event: [] };
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
export const AppendEventsRequest: MessageFns<AppendEventsRequest> = {
|
|
1150
|
+
encode(message: AppendEventsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1151
|
+
if (message.condition !== undefined) {
|
|
1152
|
+
ConsistencyCondition.encode(message.condition, writer.uint32(10).fork()).join();
|
|
1153
|
+
}
|
|
1154
|
+
for (const v of message.event) {
|
|
1155
|
+
TaggedEvent.encode(v!, writer.uint32(18).fork()).join();
|
|
1156
|
+
}
|
|
1157
|
+
return writer;
|
|
1158
|
+
},
|
|
1159
|
+
|
|
1160
|
+
decode(input: BinaryReader | Uint8Array, length?: number): AppendEventsRequest {
|
|
1161
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1162
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1163
|
+
const message = createBaseAppendEventsRequest();
|
|
1164
|
+
while (reader.pos < end) {
|
|
1165
|
+
const tag = reader.uint32();
|
|
1166
|
+
switch (tag >>> 3) {
|
|
1167
|
+
case 1: {
|
|
1168
|
+
if (tag !== 10) {
|
|
1169
|
+
break;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
message.condition = ConsistencyCondition.decode(reader, reader.uint32());
|
|
1173
|
+
continue;
|
|
1174
|
+
}
|
|
1175
|
+
case 2: {
|
|
1176
|
+
if (tag !== 18) {
|
|
1177
|
+
break;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
message.event.push(TaggedEvent.decode(reader, reader.uint32()));
|
|
1181
|
+
continue;
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1185
|
+
break;
|
|
1186
|
+
}
|
|
1187
|
+
reader.skip(tag & 7);
|
|
1188
|
+
}
|
|
1189
|
+
return message;
|
|
1190
|
+
},
|
|
1191
|
+
|
|
1192
|
+
fromJSON(object: any): AppendEventsRequest {
|
|
1193
|
+
return {
|
|
1194
|
+
condition: isSet(object.condition) ? ConsistencyCondition.fromJSON(object.condition) : undefined,
|
|
1195
|
+
event: globalThis.Array.isArray(object?.event) ? object.event.map((e: any) => TaggedEvent.fromJSON(e)) : [],
|
|
1196
|
+
};
|
|
1197
|
+
},
|
|
1198
|
+
|
|
1199
|
+
toJSON(message: AppendEventsRequest): unknown {
|
|
1200
|
+
const obj: any = {};
|
|
1201
|
+
if (message.condition !== undefined) {
|
|
1202
|
+
obj.condition = ConsistencyCondition.toJSON(message.condition);
|
|
1203
|
+
}
|
|
1204
|
+
if (message.event?.length) {
|
|
1205
|
+
obj.event = message.event.map((e) => TaggedEvent.toJSON(e));
|
|
1206
|
+
}
|
|
1207
|
+
return obj;
|
|
1208
|
+
},
|
|
1209
|
+
|
|
1210
|
+
create(base?: DeepPartial<AppendEventsRequest>): AppendEventsRequest {
|
|
1211
|
+
return AppendEventsRequest.fromPartial(base ?? {});
|
|
1212
|
+
},
|
|
1213
|
+
fromPartial(object: DeepPartial<AppendEventsRequest>): AppendEventsRequest {
|
|
1214
|
+
const message = createBaseAppendEventsRequest();
|
|
1215
|
+
message.condition = (object.condition !== undefined && object.condition !== null)
|
|
1216
|
+
? ConsistencyCondition.fromPartial(object.condition)
|
|
1217
|
+
: undefined;
|
|
1218
|
+
message.event = object.event?.map((e) => TaggedEvent.fromPartial(e)) || [];
|
|
1219
|
+
return message;
|
|
1220
|
+
},
|
|
1221
|
+
};
|
|
1222
|
+
|
|
1223
|
+
function createBaseAppendEventsResponse(): AppendEventsResponse {
|
|
1224
|
+
return { sequenceOfTheFirstEvent: 0n, transactionSize: 0, consistencyMarker: 0n };
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
export const AppendEventsResponse: MessageFns<AppendEventsResponse> = {
|
|
1228
|
+
encode(message: AppendEventsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1229
|
+
if (message.sequenceOfTheFirstEvent !== 0n) {
|
|
1230
|
+
if (BigInt.asIntN(64, message.sequenceOfTheFirstEvent) !== message.sequenceOfTheFirstEvent) {
|
|
1231
|
+
throw new globalThis.Error("value provided for field message.sequenceOfTheFirstEvent of type int64 too large");
|
|
1232
|
+
}
|
|
1233
|
+
writer.uint32(8).int64(message.sequenceOfTheFirstEvent);
|
|
1234
|
+
}
|
|
1235
|
+
if (message.transactionSize !== 0) {
|
|
1236
|
+
writer.uint32(16).int32(message.transactionSize);
|
|
1237
|
+
}
|
|
1238
|
+
if (message.consistencyMarker !== 0n) {
|
|
1239
|
+
if (BigInt.asIntN(64, message.consistencyMarker) !== message.consistencyMarker) {
|
|
1240
|
+
throw new globalThis.Error("value provided for field message.consistencyMarker of type int64 too large");
|
|
1241
|
+
}
|
|
1242
|
+
writer.uint32(24).int64(message.consistencyMarker);
|
|
1243
|
+
}
|
|
1244
|
+
return writer;
|
|
1245
|
+
},
|
|
1246
|
+
|
|
1247
|
+
decode(input: BinaryReader | Uint8Array, length?: number): AppendEventsResponse {
|
|
1248
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1249
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1250
|
+
const message = createBaseAppendEventsResponse();
|
|
1251
|
+
while (reader.pos < end) {
|
|
1252
|
+
const tag = reader.uint32();
|
|
1253
|
+
switch (tag >>> 3) {
|
|
1254
|
+
case 1: {
|
|
1255
|
+
if (tag !== 8) {
|
|
1256
|
+
break;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
message.sequenceOfTheFirstEvent = reader.int64() as bigint;
|
|
1260
|
+
continue;
|
|
1261
|
+
}
|
|
1262
|
+
case 2: {
|
|
1263
|
+
if (tag !== 16) {
|
|
1264
|
+
break;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
message.transactionSize = reader.int32();
|
|
1268
|
+
continue;
|
|
1269
|
+
}
|
|
1270
|
+
case 3: {
|
|
1271
|
+
if (tag !== 24) {
|
|
1272
|
+
break;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
message.consistencyMarker = reader.int64() as bigint;
|
|
1276
|
+
continue;
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1280
|
+
break;
|
|
1281
|
+
}
|
|
1282
|
+
reader.skip(tag & 7);
|
|
1283
|
+
}
|
|
1284
|
+
return message;
|
|
1285
|
+
},
|
|
1286
|
+
|
|
1287
|
+
fromJSON(object: any): AppendEventsResponse {
|
|
1288
|
+
return {
|
|
1289
|
+
sequenceOfTheFirstEvent: isSet(object.sequenceOfTheFirstEvent)
|
|
1290
|
+
? BigInt(object.sequenceOfTheFirstEvent)
|
|
1291
|
+
: isSet(object.sequence_of_the_first_event)
|
|
1292
|
+
? BigInt(object.sequence_of_the_first_event)
|
|
1293
|
+
: 0n,
|
|
1294
|
+
transactionSize: isSet(object.transactionSize)
|
|
1295
|
+
? globalThis.Number(object.transactionSize)
|
|
1296
|
+
: isSet(object.transaction_size)
|
|
1297
|
+
? globalThis.Number(object.transaction_size)
|
|
1298
|
+
: 0,
|
|
1299
|
+
consistencyMarker: isSet(object.consistencyMarker)
|
|
1300
|
+
? BigInt(object.consistencyMarker)
|
|
1301
|
+
: isSet(object.consistency_marker)
|
|
1302
|
+
? BigInt(object.consistency_marker)
|
|
1303
|
+
: 0n,
|
|
1304
|
+
};
|
|
1305
|
+
},
|
|
1306
|
+
|
|
1307
|
+
toJSON(message: AppendEventsResponse): unknown {
|
|
1308
|
+
const obj: any = {};
|
|
1309
|
+
if (message.sequenceOfTheFirstEvent !== 0n) {
|
|
1310
|
+
obj.sequenceOfTheFirstEvent = message.sequenceOfTheFirstEvent.toString();
|
|
1311
|
+
}
|
|
1312
|
+
if (message.transactionSize !== 0) {
|
|
1313
|
+
obj.transactionSize = Math.round(message.transactionSize);
|
|
1314
|
+
}
|
|
1315
|
+
if (message.consistencyMarker !== 0n) {
|
|
1316
|
+
obj.consistencyMarker = message.consistencyMarker.toString();
|
|
1317
|
+
}
|
|
1318
|
+
return obj;
|
|
1319
|
+
},
|
|
1320
|
+
|
|
1321
|
+
create(base?: DeepPartial<AppendEventsResponse>): AppendEventsResponse {
|
|
1322
|
+
return AppendEventsResponse.fromPartial(base ?? {});
|
|
1323
|
+
},
|
|
1324
|
+
fromPartial(object: DeepPartial<AppendEventsResponse>): AppendEventsResponse {
|
|
1325
|
+
const message = createBaseAppendEventsResponse();
|
|
1326
|
+
message.sequenceOfTheFirstEvent = object.sequenceOfTheFirstEvent ?? 0n;
|
|
1327
|
+
message.transactionSize = object.transactionSize ?? 0;
|
|
1328
|
+
message.consistencyMarker = object.consistencyMarker ?? 0n;
|
|
1329
|
+
return message;
|
|
1330
|
+
},
|
|
1331
|
+
};
|
|
1332
|
+
|
|
1333
|
+
function createBaseSourceEventsRequest(): SourceEventsRequest {
|
|
1334
|
+
return { fromSequence: 0n, criterion: [] };
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
export const SourceEventsRequest: MessageFns<SourceEventsRequest> = {
|
|
1338
|
+
encode(message: SourceEventsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1339
|
+
if (message.fromSequence !== 0n) {
|
|
1340
|
+
if (BigInt.asIntN(64, message.fromSequence) !== message.fromSequence) {
|
|
1341
|
+
throw new globalThis.Error("value provided for field message.fromSequence of type int64 too large");
|
|
1342
|
+
}
|
|
1343
|
+
writer.uint32(8).int64(message.fromSequence);
|
|
1344
|
+
}
|
|
1345
|
+
for (const v of message.criterion) {
|
|
1346
|
+
Criterion.encode(v!, writer.uint32(18).fork()).join();
|
|
1347
|
+
}
|
|
1348
|
+
return writer;
|
|
1349
|
+
},
|
|
1350
|
+
|
|
1351
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SourceEventsRequest {
|
|
1352
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1353
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1354
|
+
const message = createBaseSourceEventsRequest();
|
|
1355
|
+
while (reader.pos < end) {
|
|
1356
|
+
const tag = reader.uint32();
|
|
1357
|
+
switch (tag >>> 3) {
|
|
1358
|
+
case 1: {
|
|
1359
|
+
if (tag !== 8) {
|
|
1360
|
+
break;
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
message.fromSequence = reader.int64() as bigint;
|
|
1364
|
+
continue;
|
|
1365
|
+
}
|
|
1366
|
+
case 2: {
|
|
1367
|
+
if (tag !== 18) {
|
|
1368
|
+
break;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
message.criterion.push(Criterion.decode(reader, reader.uint32()));
|
|
1372
|
+
continue;
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1376
|
+
break;
|
|
1377
|
+
}
|
|
1378
|
+
reader.skip(tag & 7);
|
|
1379
|
+
}
|
|
1380
|
+
return message;
|
|
1381
|
+
},
|
|
1382
|
+
|
|
1383
|
+
fromJSON(object: any): SourceEventsRequest {
|
|
1384
|
+
return {
|
|
1385
|
+
fromSequence: isSet(object.fromSequence)
|
|
1386
|
+
? BigInt(object.fromSequence)
|
|
1387
|
+
: isSet(object.from_sequence)
|
|
1388
|
+
? BigInt(object.from_sequence)
|
|
1389
|
+
: 0n,
|
|
1390
|
+
criterion: globalThis.Array.isArray(object?.criterion)
|
|
1391
|
+
? object.criterion.map((e: any) => Criterion.fromJSON(e))
|
|
1392
|
+
: [],
|
|
1393
|
+
};
|
|
1394
|
+
},
|
|
1395
|
+
|
|
1396
|
+
toJSON(message: SourceEventsRequest): unknown {
|
|
1397
|
+
const obj: any = {};
|
|
1398
|
+
if (message.fromSequence !== 0n) {
|
|
1399
|
+
obj.fromSequence = message.fromSequence.toString();
|
|
1400
|
+
}
|
|
1401
|
+
if (message.criterion?.length) {
|
|
1402
|
+
obj.criterion = message.criterion.map((e) => Criterion.toJSON(e));
|
|
1403
|
+
}
|
|
1404
|
+
return obj;
|
|
1405
|
+
},
|
|
1406
|
+
|
|
1407
|
+
create(base?: DeepPartial<SourceEventsRequest>): SourceEventsRequest {
|
|
1408
|
+
return SourceEventsRequest.fromPartial(base ?? {});
|
|
1409
|
+
},
|
|
1410
|
+
fromPartial(object: DeepPartial<SourceEventsRequest>): SourceEventsRequest {
|
|
1411
|
+
const message = createBaseSourceEventsRequest();
|
|
1412
|
+
message.fromSequence = object.fromSequence ?? 0n;
|
|
1413
|
+
message.criterion = object.criterion?.map((e) => Criterion.fromPartial(e)) || [];
|
|
1414
|
+
return message;
|
|
1415
|
+
},
|
|
1416
|
+
};
|
|
1417
|
+
|
|
1418
|
+
function createBaseSourceEventsResponse(): SourceEventsResponse {
|
|
1419
|
+
return { event: undefined, consistencyMarker: undefined };
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
export const SourceEventsResponse: MessageFns<SourceEventsResponse> = {
|
|
1423
|
+
encode(message: SourceEventsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1424
|
+
if (message.event !== undefined) {
|
|
1425
|
+
SequencedEvent.encode(message.event, writer.uint32(10).fork()).join();
|
|
1426
|
+
}
|
|
1427
|
+
if (message.consistencyMarker !== undefined) {
|
|
1428
|
+
if (BigInt.asIntN(64, message.consistencyMarker) !== message.consistencyMarker) {
|
|
1429
|
+
throw new globalThis.Error("value provided for field message.consistencyMarker of type int64 too large");
|
|
1430
|
+
}
|
|
1431
|
+
writer.uint32(16).int64(message.consistencyMarker);
|
|
1432
|
+
}
|
|
1433
|
+
return writer;
|
|
1434
|
+
},
|
|
1435
|
+
|
|
1436
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SourceEventsResponse {
|
|
1437
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1438
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1439
|
+
const message = createBaseSourceEventsResponse();
|
|
1440
|
+
while (reader.pos < end) {
|
|
1441
|
+
const tag = reader.uint32();
|
|
1442
|
+
switch (tag >>> 3) {
|
|
1443
|
+
case 1: {
|
|
1444
|
+
if (tag !== 10) {
|
|
1445
|
+
break;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
message.event = SequencedEvent.decode(reader, reader.uint32());
|
|
1449
|
+
continue;
|
|
1450
|
+
}
|
|
1451
|
+
case 2: {
|
|
1452
|
+
if (tag !== 16) {
|
|
1453
|
+
break;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
message.consistencyMarker = reader.int64() as bigint;
|
|
1457
|
+
continue;
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1461
|
+
break;
|
|
1462
|
+
}
|
|
1463
|
+
reader.skip(tag & 7);
|
|
1464
|
+
}
|
|
1465
|
+
return message;
|
|
1466
|
+
},
|
|
1467
|
+
|
|
1468
|
+
fromJSON(object: any): SourceEventsResponse {
|
|
1469
|
+
return {
|
|
1470
|
+
event: isSet(object.event) ? SequencedEvent.fromJSON(object.event) : undefined,
|
|
1471
|
+
consistencyMarker: isSet(object.consistencyMarker)
|
|
1472
|
+
? BigInt(object.consistencyMarker)
|
|
1473
|
+
: isSet(object.consistency_marker)
|
|
1474
|
+
? BigInt(object.consistency_marker)
|
|
1475
|
+
: undefined,
|
|
1476
|
+
};
|
|
1477
|
+
},
|
|
1478
|
+
|
|
1479
|
+
toJSON(message: SourceEventsResponse): unknown {
|
|
1480
|
+
const obj: any = {};
|
|
1481
|
+
if (message.event !== undefined) {
|
|
1482
|
+
obj.event = SequencedEvent.toJSON(message.event);
|
|
1483
|
+
}
|
|
1484
|
+
if (message.consistencyMarker !== undefined) {
|
|
1485
|
+
obj.consistencyMarker = message.consistencyMarker.toString();
|
|
1486
|
+
}
|
|
1487
|
+
return obj;
|
|
1488
|
+
},
|
|
1489
|
+
|
|
1490
|
+
create(base?: DeepPartial<SourceEventsResponse>): SourceEventsResponse {
|
|
1491
|
+
return SourceEventsResponse.fromPartial(base ?? {});
|
|
1492
|
+
},
|
|
1493
|
+
fromPartial(object: DeepPartial<SourceEventsResponse>): SourceEventsResponse {
|
|
1494
|
+
const message = createBaseSourceEventsResponse();
|
|
1495
|
+
message.event = (object.event !== undefined && object.event !== null)
|
|
1496
|
+
? SequencedEvent.fromPartial(object.event)
|
|
1497
|
+
: undefined;
|
|
1498
|
+
message.consistencyMarker = object.consistencyMarker ?? undefined;
|
|
1499
|
+
return message;
|
|
1500
|
+
},
|
|
1501
|
+
};
|
|
1502
|
+
|
|
1503
|
+
function createBaseConsistencyCondition(): ConsistencyCondition {
|
|
1504
|
+
return { consistencyMarker: 0n, criterion: [] };
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
export const ConsistencyCondition: MessageFns<ConsistencyCondition> = {
|
|
1508
|
+
encode(message: ConsistencyCondition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1509
|
+
if (message.consistencyMarker !== 0n) {
|
|
1510
|
+
if (BigInt.asIntN(64, message.consistencyMarker) !== message.consistencyMarker) {
|
|
1511
|
+
throw new globalThis.Error("value provided for field message.consistencyMarker of type int64 too large");
|
|
1512
|
+
}
|
|
1513
|
+
writer.uint32(8).int64(message.consistencyMarker);
|
|
1514
|
+
}
|
|
1515
|
+
for (const v of message.criterion) {
|
|
1516
|
+
Criterion.encode(v!, writer.uint32(18).fork()).join();
|
|
1517
|
+
}
|
|
1518
|
+
return writer;
|
|
1519
|
+
},
|
|
1520
|
+
|
|
1521
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ConsistencyCondition {
|
|
1522
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1523
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1524
|
+
const message = createBaseConsistencyCondition();
|
|
1525
|
+
while (reader.pos < end) {
|
|
1526
|
+
const tag = reader.uint32();
|
|
1527
|
+
switch (tag >>> 3) {
|
|
1528
|
+
case 1: {
|
|
1529
|
+
if (tag !== 8) {
|
|
1530
|
+
break;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
message.consistencyMarker = reader.int64() as bigint;
|
|
1534
|
+
continue;
|
|
1535
|
+
}
|
|
1536
|
+
case 2: {
|
|
1537
|
+
if (tag !== 18) {
|
|
1538
|
+
break;
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
message.criterion.push(Criterion.decode(reader, reader.uint32()));
|
|
1542
|
+
continue;
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1546
|
+
break;
|
|
1547
|
+
}
|
|
1548
|
+
reader.skip(tag & 7);
|
|
1549
|
+
}
|
|
1550
|
+
return message;
|
|
1551
|
+
},
|
|
1552
|
+
|
|
1553
|
+
fromJSON(object: any): ConsistencyCondition {
|
|
1554
|
+
return {
|
|
1555
|
+
consistencyMarker: isSet(object.consistencyMarker)
|
|
1556
|
+
? BigInt(object.consistencyMarker)
|
|
1557
|
+
: isSet(object.consistency_marker)
|
|
1558
|
+
? BigInt(object.consistency_marker)
|
|
1559
|
+
: 0n,
|
|
1560
|
+
criterion: globalThis.Array.isArray(object?.criterion)
|
|
1561
|
+
? object.criterion.map((e: any) => Criterion.fromJSON(e))
|
|
1562
|
+
: [],
|
|
1563
|
+
};
|
|
1564
|
+
},
|
|
1565
|
+
|
|
1566
|
+
toJSON(message: ConsistencyCondition): unknown {
|
|
1567
|
+
const obj: any = {};
|
|
1568
|
+
if (message.consistencyMarker !== 0n) {
|
|
1569
|
+
obj.consistencyMarker = message.consistencyMarker.toString();
|
|
1570
|
+
}
|
|
1571
|
+
if (message.criterion?.length) {
|
|
1572
|
+
obj.criterion = message.criterion.map((e) => Criterion.toJSON(e));
|
|
1573
|
+
}
|
|
1574
|
+
return obj;
|
|
1575
|
+
},
|
|
1576
|
+
|
|
1577
|
+
create(base?: DeepPartial<ConsistencyCondition>): ConsistencyCondition {
|
|
1578
|
+
return ConsistencyCondition.fromPartial(base ?? {});
|
|
1579
|
+
},
|
|
1580
|
+
fromPartial(object: DeepPartial<ConsistencyCondition>): ConsistencyCondition {
|
|
1581
|
+
const message = createBaseConsistencyCondition();
|
|
1582
|
+
message.consistencyMarker = object.consistencyMarker ?? 0n;
|
|
1583
|
+
message.criterion = object.criterion?.map((e) => Criterion.fromPartial(e)) || [];
|
|
1584
|
+
return message;
|
|
1585
|
+
},
|
|
1586
|
+
};
|
|
1587
|
+
|
|
1588
|
+
function createBaseCriterion(): Criterion {
|
|
1589
|
+
return { tagsAndNames: undefined };
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
export const Criterion: MessageFns<Criterion> = {
|
|
1593
|
+
encode(message: Criterion, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1594
|
+
if (message.tagsAndNames !== undefined) {
|
|
1595
|
+
TagsAndNamesCriterion.encode(message.tagsAndNames, writer.uint32(10).fork()).join();
|
|
1596
|
+
}
|
|
1597
|
+
return writer;
|
|
1598
|
+
},
|
|
1599
|
+
|
|
1600
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Criterion {
|
|
1601
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1602
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1603
|
+
const message = createBaseCriterion();
|
|
1604
|
+
while (reader.pos < end) {
|
|
1605
|
+
const tag = reader.uint32();
|
|
1606
|
+
switch (tag >>> 3) {
|
|
1607
|
+
case 1: {
|
|
1608
|
+
if (tag !== 10) {
|
|
1609
|
+
break;
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
message.tagsAndNames = TagsAndNamesCriterion.decode(reader, reader.uint32());
|
|
1613
|
+
continue;
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1617
|
+
break;
|
|
1618
|
+
}
|
|
1619
|
+
reader.skip(tag & 7);
|
|
1620
|
+
}
|
|
1621
|
+
return message;
|
|
1622
|
+
},
|
|
1623
|
+
|
|
1624
|
+
fromJSON(object: any): Criterion {
|
|
1625
|
+
return {
|
|
1626
|
+
tagsAndNames: isSet(object.tagsAndNames)
|
|
1627
|
+
? TagsAndNamesCriterion.fromJSON(object.tagsAndNames)
|
|
1628
|
+
: isSet(object.tags_and_names)
|
|
1629
|
+
? TagsAndNamesCriterion.fromJSON(object.tags_and_names)
|
|
1630
|
+
: undefined,
|
|
1631
|
+
};
|
|
1632
|
+
},
|
|
1633
|
+
|
|
1634
|
+
toJSON(message: Criterion): unknown {
|
|
1635
|
+
const obj: any = {};
|
|
1636
|
+
if (message.tagsAndNames !== undefined) {
|
|
1637
|
+
obj.tagsAndNames = TagsAndNamesCriterion.toJSON(message.tagsAndNames);
|
|
1638
|
+
}
|
|
1639
|
+
return obj;
|
|
1640
|
+
},
|
|
1641
|
+
|
|
1642
|
+
create(base?: DeepPartial<Criterion>): Criterion {
|
|
1643
|
+
return Criterion.fromPartial(base ?? {});
|
|
1644
|
+
},
|
|
1645
|
+
fromPartial(object: DeepPartial<Criterion>): Criterion {
|
|
1646
|
+
const message = createBaseCriterion();
|
|
1647
|
+
message.tagsAndNames = (object.tagsAndNames !== undefined && object.tagsAndNames !== null)
|
|
1648
|
+
? TagsAndNamesCriterion.fromPartial(object.tagsAndNames)
|
|
1649
|
+
: undefined;
|
|
1650
|
+
return message;
|
|
1651
|
+
},
|
|
1652
|
+
};
|
|
1653
|
+
|
|
1654
|
+
function createBaseTagsAndNamesCriterion(): TagsAndNamesCriterion {
|
|
1655
|
+
return { name: [], tag: [] };
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
export const TagsAndNamesCriterion: MessageFns<TagsAndNamesCriterion> = {
|
|
1659
|
+
encode(message: TagsAndNamesCriterion, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1660
|
+
for (const v of message.name) {
|
|
1661
|
+
writer.uint32(10).string(v!);
|
|
1662
|
+
}
|
|
1663
|
+
for (const v of message.tag) {
|
|
1664
|
+
Tag.encode(v!, writer.uint32(18).fork()).join();
|
|
1665
|
+
}
|
|
1666
|
+
return writer;
|
|
1667
|
+
},
|
|
1668
|
+
|
|
1669
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TagsAndNamesCriterion {
|
|
1670
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1671
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1672
|
+
const message = createBaseTagsAndNamesCriterion();
|
|
1673
|
+
while (reader.pos < end) {
|
|
1674
|
+
const tag = reader.uint32();
|
|
1675
|
+
switch (tag >>> 3) {
|
|
1676
|
+
case 1: {
|
|
1677
|
+
if (tag !== 10) {
|
|
1678
|
+
break;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
message.name.push(reader.string());
|
|
1682
|
+
continue;
|
|
1683
|
+
}
|
|
1684
|
+
case 2: {
|
|
1685
|
+
if (tag !== 18) {
|
|
1686
|
+
break;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
message.tag.push(Tag.decode(reader, reader.uint32()));
|
|
1690
|
+
continue;
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1694
|
+
break;
|
|
1695
|
+
}
|
|
1696
|
+
reader.skip(tag & 7);
|
|
1697
|
+
}
|
|
1698
|
+
return message;
|
|
1699
|
+
},
|
|
1700
|
+
|
|
1701
|
+
fromJSON(object: any): TagsAndNamesCriterion {
|
|
1702
|
+
return {
|
|
1703
|
+
name: globalThis.Array.isArray(object?.name) ? object.name.map((e: any) => globalThis.String(e)) : [],
|
|
1704
|
+
tag: globalThis.Array.isArray(object?.tag) ? object.tag.map((e: any) => Tag.fromJSON(e)) : [],
|
|
1705
|
+
};
|
|
1706
|
+
},
|
|
1707
|
+
|
|
1708
|
+
toJSON(message: TagsAndNamesCriterion): unknown {
|
|
1709
|
+
const obj: any = {};
|
|
1710
|
+
if (message.name?.length) {
|
|
1711
|
+
obj.name = message.name;
|
|
1712
|
+
}
|
|
1713
|
+
if (message.tag?.length) {
|
|
1714
|
+
obj.tag = message.tag.map((e) => Tag.toJSON(e));
|
|
1715
|
+
}
|
|
1716
|
+
return obj;
|
|
1717
|
+
},
|
|
1718
|
+
|
|
1719
|
+
create(base?: DeepPartial<TagsAndNamesCriterion>): TagsAndNamesCriterion {
|
|
1720
|
+
return TagsAndNamesCriterion.fromPartial(base ?? {});
|
|
1721
|
+
},
|
|
1722
|
+
fromPartial(object: DeepPartial<TagsAndNamesCriterion>): TagsAndNamesCriterion {
|
|
1723
|
+
const message = createBaseTagsAndNamesCriterion();
|
|
1724
|
+
message.name = object.name?.map((e) => e) || [];
|
|
1725
|
+
message.tag = object.tag?.map((e) => Tag.fromPartial(e)) || [];
|
|
1726
|
+
return message;
|
|
1727
|
+
},
|
|
1728
|
+
};
|
|
1729
|
+
|
|
1730
|
+
function createBaseStreamEventsRequest(): StreamEventsRequest {
|
|
1731
|
+
return { fromSequence: 0n, criterion: [] };
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
export const StreamEventsRequest: MessageFns<StreamEventsRequest> = {
|
|
1735
|
+
encode(message: StreamEventsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1736
|
+
if (message.fromSequence !== 0n) {
|
|
1737
|
+
if (BigInt.asIntN(64, message.fromSequence) !== message.fromSequence) {
|
|
1738
|
+
throw new globalThis.Error("value provided for field message.fromSequence of type int64 too large");
|
|
1739
|
+
}
|
|
1740
|
+
writer.uint32(8).int64(message.fromSequence);
|
|
1741
|
+
}
|
|
1742
|
+
for (const v of message.criterion) {
|
|
1743
|
+
Criterion.encode(v!, writer.uint32(18).fork()).join();
|
|
1744
|
+
}
|
|
1745
|
+
return writer;
|
|
1746
|
+
},
|
|
1747
|
+
|
|
1748
|
+
decode(input: BinaryReader | Uint8Array, length?: number): StreamEventsRequest {
|
|
1749
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1750
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1751
|
+
const message = createBaseStreamEventsRequest();
|
|
1752
|
+
while (reader.pos < end) {
|
|
1753
|
+
const tag = reader.uint32();
|
|
1754
|
+
switch (tag >>> 3) {
|
|
1755
|
+
case 1: {
|
|
1756
|
+
if (tag !== 8) {
|
|
1757
|
+
break;
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
message.fromSequence = reader.int64() as bigint;
|
|
1761
|
+
continue;
|
|
1762
|
+
}
|
|
1763
|
+
case 2: {
|
|
1764
|
+
if (tag !== 18) {
|
|
1765
|
+
break;
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
message.criterion.push(Criterion.decode(reader, reader.uint32()));
|
|
1769
|
+
continue;
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1773
|
+
break;
|
|
1774
|
+
}
|
|
1775
|
+
reader.skip(tag & 7);
|
|
1776
|
+
}
|
|
1777
|
+
return message;
|
|
1778
|
+
},
|
|
1779
|
+
|
|
1780
|
+
fromJSON(object: any): StreamEventsRequest {
|
|
1781
|
+
return {
|
|
1782
|
+
fromSequence: isSet(object.fromSequence)
|
|
1783
|
+
? BigInt(object.fromSequence)
|
|
1784
|
+
: isSet(object.from_sequence)
|
|
1785
|
+
? BigInt(object.from_sequence)
|
|
1786
|
+
: 0n,
|
|
1787
|
+
criterion: globalThis.Array.isArray(object?.criterion)
|
|
1788
|
+
? object.criterion.map((e: any) => Criterion.fromJSON(e))
|
|
1789
|
+
: [],
|
|
1790
|
+
};
|
|
1791
|
+
},
|
|
1792
|
+
|
|
1793
|
+
toJSON(message: StreamEventsRequest): unknown {
|
|
1794
|
+
const obj: any = {};
|
|
1795
|
+
if (message.fromSequence !== 0n) {
|
|
1796
|
+
obj.fromSequence = message.fromSequence.toString();
|
|
1797
|
+
}
|
|
1798
|
+
if (message.criterion?.length) {
|
|
1799
|
+
obj.criterion = message.criterion.map((e) => Criterion.toJSON(e));
|
|
1800
|
+
}
|
|
1801
|
+
return obj;
|
|
1802
|
+
},
|
|
1803
|
+
|
|
1804
|
+
create(base?: DeepPartial<StreamEventsRequest>): StreamEventsRequest {
|
|
1805
|
+
return StreamEventsRequest.fromPartial(base ?? {});
|
|
1806
|
+
},
|
|
1807
|
+
fromPartial(object: DeepPartial<StreamEventsRequest>): StreamEventsRequest {
|
|
1808
|
+
const message = createBaseStreamEventsRequest();
|
|
1809
|
+
message.fromSequence = object.fromSequence ?? 0n;
|
|
1810
|
+
message.criterion = object.criterion?.map((e) => Criterion.fromPartial(e)) || [];
|
|
1811
|
+
return message;
|
|
1812
|
+
},
|
|
1813
|
+
};
|
|
1814
|
+
|
|
1815
|
+
function createBaseStreamEventsResponse(): StreamEventsResponse {
|
|
1816
|
+
return { event: undefined };
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
export const StreamEventsResponse: MessageFns<StreamEventsResponse> = {
|
|
1820
|
+
encode(message: StreamEventsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1821
|
+
if (message.event !== undefined) {
|
|
1822
|
+
SequencedEvent.encode(message.event, writer.uint32(10).fork()).join();
|
|
1823
|
+
}
|
|
1824
|
+
return writer;
|
|
1825
|
+
},
|
|
1826
|
+
|
|
1827
|
+
decode(input: BinaryReader | Uint8Array, length?: number): StreamEventsResponse {
|
|
1828
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1829
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1830
|
+
const message = createBaseStreamEventsResponse();
|
|
1831
|
+
while (reader.pos < end) {
|
|
1832
|
+
const tag = reader.uint32();
|
|
1833
|
+
switch (tag >>> 3) {
|
|
1834
|
+
case 1: {
|
|
1835
|
+
if (tag !== 10) {
|
|
1836
|
+
break;
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
message.event = SequencedEvent.decode(reader, reader.uint32());
|
|
1840
|
+
continue;
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1844
|
+
break;
|
|
1845
|
+
}
|
|
1846
|
+
reader.skip(tag & 7);
|
|
1847
|
+
}
|
|
1848
|
+
return message;
|
|
1849
|
+
},
|
|
1850
|
+
|
|
1851
|
+
fromJSON(object: any): StreamEventsResponse {
|
|
1852
|
+
return { event: isSet(object.event) ? SequencedEvent.fromJSON(object.event) : undefined };
|
|
1853
|
+
},
|
|
1854
|
+
|
|
1855
|
+
toJSON(message: StreamEventsResponse): unknown {
|
|
1856
|
+
const obj: any = {};
|
|
1857
|
+
if (message.event !== undefined) {
|
|
1858
|
+
obj.event = SequencedEvent.toJSON(message.event);
|
|
1859
|
+
}
|
|
1860
|
+
return obj;
|
|
1861
|
+
},
|
|
1862
|
+
|
|
1863
|
+
create(base?: DeepPartial<StreamEventsResponse>): StreamEventsResponse {
|
|
1864
|
+
return StreamEventsResponse.fromPartial(base ?? {});
|
|
1865
|
+
},
|
|
1866
|
+
fromPartial(object: DeepPartial<StreamEventsResponse>): StreamEventsResponse {
|
|
1867
|
+
const message = createBaseStreamEventsResponse();
|
|
1868
|
+
message.event = (object.event !== undefined && object.event !== null)
|
|
1869
|
+
? SequencedEvent.fromPartial(object.event)
|
|
1870
|
+
: undefined;
|
|
1871
|
+
return message;
|
|
1872
|
+
},
|
|
1873
|
+
};
|
|
1874
|
+
|
|
1875
|
+
function createBaseGetHeadRequest(): GetHeadRequest {
|
|
1876
|
+
return {};
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
export const GetHeadRequest: MessageFns<GetHeadRequest> = {
|
|
1880
|
+
encode(_: GetHeadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1881
|
+
return writer;
|
|
1882
|
+
},
|
|
1883
|
+
|
|
1884
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetHeadRequest {
|
|
1885
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1886
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1887
|
+
const message = createBaseGetHeadRequest();
|
|
1888
|
+
while (reader.pos < end) {
|
|
1889
|
+
const tag = reader.uint32();
|
|
1890
|
+
switch (tag >>> 3) {
|
|
1891
|
+
}
|
|
1892
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1893
|
+
break;
|
|
1894
|
+
}
|
|
1895
|
+
reader.skip(tag & 7);
|
|
1896
|
+
}
|
|
1897
|
+
return message;
|
|
1898
|
+
},
|
|
1899
|
+
|
|
1900
|
+
fromJSON(_: any): GetHeadRequest {
|
|
1901
|
+
return {};
|
|
1902
|
+
},
|
|
1903
|
+
|
|
1904
|
+
toJSON(_: GetHeadRequest): unknown {
|
|
1905
|
+
const obj: any = {};
|
|
1906
|
+
return obj;
|
|
1907
|
+
},
|
|
1908
|
+
|
|
1909
|
+
create(base?: DeepPartial<GetHeadRequest>): GetHeadRequest {
|
|
1910
|
+
return GetHeadRequest.fromPartial(base ?? {});
|
|
1911
|
+
},
|
|
1912
|
+
fromPartial(_: DeepPartial<GetHeadRequest>): GetHeadRequest {
|
|
1913
|
+
const message = createBaseGetHeadRequest();
|
|
1914
|
+
return message;
|
|
1915
|
+
},
|
|
1916
|
+
};
|
|
1917
|
+
|
|
1918
|
+
function createBaseGetHeadResponse(): GetHeadResponse {
|
|
1919
|
+
return { sequence: 0n };
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
export const GetHeadResponse: MessageFns<GetHeadResponse> = {
|
|
1923
|
+
encode(message: GetHeadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1924
|
+
if (message.sequence !== 0n) {
|
|
1925
|
+
if (BigInt.asIntN(64, message.sequence) !== message.sequence) {
|
|
1926
|
+
throw new globalThis.Error("value provided for field message.sequence of type int64 too large");
|
|
1927
|
+
}
|
|
1928
|
+
writer.uint32(8).int64(message.sequence);
|
|
1929
|
+
}
|
|
1930
|
+
return writer;
|
|
1931
|
+
},
|
|
1932
|
+
|
|
1933
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetHeadResponse {
|
|
1934
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1935
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1936
|
+
const message = createBaseGetHeadResponse();
|
|
1937
|
+
while (reader.pos < end) {
|
|
1938
|
+
const tag = reader.uint32();
|
|
1939
|
+
switch (tag >>> 3) {
|
|
1940
|
+
case 1: {
|
|
1941
|
+
if (tag !== 8) {
|
|
1942
|
+
break;
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
message.sequence = reader.int64() as bigint;
|
|
1946
|
+
continue;
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1950
|
+
break;
|
|
1951
|
+
}
|
|
1952
|
+
reader.skip(tag & 7);
|
|
1953
|
+
}
|
|
1954
|
+
return message;
|
|
1955
|
+
},
|
|
1956
|
+
|
|
1957
|
+
fromJSON(object: any): GetHeadResponse {
|
|
1958
|
+
return { sequence: isSet(object.sequence) ? BigInt(object.sequence) : 0n };
|
|
1959
|
+
},
|
|
1960
|
+
|
|
1961
|
+
toJSON(message: GetHeadResponse): unknown {
|
|
1962
|
+
const obj: any = {};
|
|
1963
|
+
if (message.sequence !== 0n) {
|
|
1964
|
+
obj.sequence = message.sequence.toString();
|
|
1965
|
+
}
|
|
1966
|
+
return obj;
|
|
1967
|
+
},
|
|
1968
|
+
|
|
1969
|
+
create(base?: DeepPartial<GetHeadResponse>): GetHeadResponse {
|
|
1970
|
+
return GetHeadResponse.fromPartial(base ?? {});
|
|
1971
|
+
},
|
|
1972
|
+
fromPartial(object: DeepPartial<GetHeadResponse>): GetHeadResponse {
|
|
1973
|
+
const message = createBaseGetHeadResponse();
|
|
1974
|
+
message.sequence = object.sequence ?? 0n;
|
|
1975
|
+
return message;
|
|
1976
|
+
},
|
|
1977
|
+
};
|
|
1978
|
+
|
|
1979
|
+
function createBaseGetTailRequest(): GetTailRequest {
|
|
1980
|
+
return {};
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
export const GetTailRequest: MessageFns<GetTailRequest> = {
|
|
1984
|
+
encode(_: GetTailRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1985
|
+
return writer;
|
|
1986
|
+
},
|
|
1987
|
+
|
|
1988
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetTailRequest {
|
|
1989
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1990
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1991
|
+
const message = createBaseGetTailRequest();
|
|
1992
|
+
while (reader.pos < end) {
|
|
1993
|
+
const tag = reader.uint32();
|
|
1994
|
+
switch (tag >>> 3) {
|
|
1995
|
+
}
|
|
1996
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1997
|
+
break;
|
|
1998
|
+
}
|
|
1999
|
+
reader.skip(tag & 7);
|
|
2000
|
+
}
|
|
2001
|
+
return message;
|
|
2002
|
+
},
|
|
2003
|
+
|
|
2004
|
+
fromJSON(_: any): GetTailRequest {
|
|
2005
|
+
return {};
|
|
2006
|
+
},
|
|
2007
|
+
|
|
2008
|
+
toJSON(_: GetTailRequest): unknown {
|
|
2009
|
+
const obj: any = {};
|
|
2010
|
+
return obj;
|
|
2011
|
+
},
|
|
2012
|
+
|
|
2013
|
+
create(base?: DeepPartial<GetTailRequest>): GetTailRequest {
|
|
2014
|
+
return GetTailRequest.fromPartial(base ?? {});
|
|
2015
|
+
},
|
|
2016
|
+
fromPartial(_: DeepPartial<GetTailRequest>): GetTailRequest {
|
|
2017
|
+
const message = createBaseGetTailRequest();
|
|
2018
|
+
return message;
|
|
2019
|
+
},
|
|
2020
|
+
};
|
|
2021
|
+
|
|
2022
|
+
function createBaseGetTailResponse(): GetTailResponse {
|
|
2023
|
+
return { sequence: 0n };
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
export const GetTailResponse: MessageFns<GetTailResponse> = {
|
|
2027
|
+
encode(message: GetTailResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2028
|
+
if (message.sequence !== 0n) {
|
|
2029
|
+
if (BigInt.asIntN(64, message.sequence) !== message.sequence) {
|
|
2030
|
+
throw new globalThis.Error("value provided for field message.sequence of type int64 too large");
|
|
2031
|
+
}
|
|
2032
|
+
writer.uint32(8).int64(message.sequence);
|
|
2033
|
+
}
|
|
2034
|
+
return writer;
|
|
2035
|
+
},
|
|
2036
|
+
|
|
2037
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetTailResponse {
|
|
2038
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2039
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2040
|
+
const message = createBaseGetTailResponse();
|
|
2041
|
+
while (reader.pos < end) {
|
|
2042
|
+
const tag = reader.uint32();
|
|
2043
|
+
switch (tag >>> 3) {
|
|
2044
|
+
case 1: {
|
|
2045
|
+
if (tag !== 8) {
|
|
2046
|
+
break;
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
message.sequence = reader.int64() as bigint;
|
|
2050
|
+
continue;
|
|
2051
|
+
}
|
|
2052
|
+
}
|
|
2053
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2054
|
+
break;
|
|
2055
|
+
}
|
|
2056
|
+
reader.skip(tag & 7);
|
|
2057
|
+
}
|
|
2058
|
+
return message;
|
|
2059
|
+
},
|
|
2060
|
+
|
|
2061
|
+
fromJSON(object: any): GetTailResponse {
|
|
2062
|
+
return { sequence: isSet(object.sequence) ? BigInt(object.sequence) : 0n };
|
|
2063
|
+
},
|
|
2064
|
+
|
|
2065
|
+
toJSON(message: GetTailResponse): unknown {
|
|
2066
|
+
const obj: any = {};
|
|
2067
|
+
if (message.sequence !== 0n) {
|
|
2068
|
+
obj.sequence = message.sequence.toString();
|
|
2069
|
+
}
|
|
2070
|
+
return obj;
|
|
2071
|
+
},
|
|
2072
|
+
|
|
2073
|
+
create(base?: DeepPartial<GetTailResponse>): GetTailResponse {
|
|
2074
|
+
return GetTailResponse.fromPartial(base ?? {});
|
|
2075
|
+
},
|
|
2076
|
+
fromPartial(object: DeepPartial<GetTailResponse>): GetTailResponse {
|
|
2077
|
+
const message = createBaseGetTailResponse();
|
|
2078
|
+
message.sequence = object.sequence ?? 0n;
|
|
2079
|
+
return message;
|
|
2080
|
+
},
|
|
2081
|
+
};
|
|
2082
|
+
|
|
2083
|
+
function createBaseGetSequenceAtRequest(): GetSequenceAtRequest {
|
|
2084
|
+
return { timestamp: 0n };
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
export const GetSequenceAtRequest: MessageFns<GetSequenceAtRequest> = {
|
|
2088
|
+
encode(message: GetSequenceAtRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2089
|
+
if (message.timestamp !== 0n) {
|
|
2090
|
+
if (BigInt.asIntN(64, message.timestamp) !== message.timestamp) {
|
|
2091
|
+
throw new globalThis.Error("value provided for field message.timestamp of type int64 too large");
|
|
2092
|
+
}
|
|
2093
|
+
writer.uint32(8).int64(message.timestamp);
|
|
2094
|
+
}
|
|
2095
|
+
return writer;
|
|
2096
|
+
},
|
|
2097
|
+
|
|
2098
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetSequenceAtRequest {
|
|
2099
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2100
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2101
|
+
const message = createBaseGetSequenceAtRequest();
|
|
2102
|
+
while (reader.pos < end) {
|
|
2103
|
+
const tag = reader.uint32();
|
|
2104
|
+
switch (tag >>> 3) {
|
|
2105
|
+
case 1: {
|
|
2106
|
+
if (tag !== 8) {
|
|
2107
|
+
break;
|
|
2108
|
+
}
|
|
2109
|
+
|
|
2110
|
+
message.timestamp = reader.int64() as bigint;
|
|
2111
|
+
continue;
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2115
|
+
break;
|
|
2116
|
+
}
|
|
2117
|
+
reader.skip(tag & 7);
|
|
2118
|
+
}
|
|
2119
|
+
return message;
|
|
2120
|
+
},
|
|
2121
|
+
|
|
2122
|
+
fromJSON(object: any): GetSequenceAtRequest {
|
|
2123
|
+
return { timestamp: isSet(object.timestamp) ? BigInt(object.timestamp) : 0n };
|
|
2124
|
+
},
|
|
2125
|
+
|
|
2126
|
+
toJSON(message: GetSequenceAtRequest): unknown {
|
|
2127
|
+
const obj: any = {};
|
|
2128
|
+
if (message.timestamp !== 0n) {
|
|
2129
|
+
obj.timestamp = message.timestamp.toString();
|
|
2130
|
+
}
|
|
2131
|
+
return obj;
|
|
2132
|
+
},
|
|
2133
|
+
|
|
2134
|
+
create(base?: DeepPartial<GetSequenceAtRequest>): GetSequenceAtRequest {
|
|
2135
|
+
return GetSequenceAtRequest.fromPartial(base ?? {});
|
|
2136
|
+
},
|
|
2137
|
+
fromPartial(object: DeepPartial<GetSequenceAtRequest>): GetSequenceAtRequest {
|
|
2138
|
+
const message = createBaseGetSequenceAtRequest();
|
|
2139
|
+
message.timestamp = object.timestamp ?? 0n;
|
|
2140
|
+
return message;
|
|
2141
|
+
},
|
|
2142
|
+
};
|
|
2143
|
+
|
|
2144
|
+
function createBaseGetSequenceAtResponse(): GetSequenceAtResponse {
|
|
2145
|
+
return { sequence: 0n };
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
export const GetSequenceAtResponse: MessageFns<GetSequenceAtResponse> = {
|
|
2149
|
+
encode(message: GetSequenceAtResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2150
|
+
if (message.sequence !== 0n) {
|
|
2151
|
+
if (BigInt.asIntN(64, message.sequence) !== message.sequence) {
|
|
2152
|
+
throw new globalThis.Error("value provided for field message.sequence of type int64 too large");
|
|
2153
|
+
}
|
|
2154
|
+
writer.uint32(8).int64(message.sequence);
|
|
2155
|
+
}
|
|
2156
|
+
return writer;
|
|
2157
|
+
},
|
|
2158
|
+
|
|
2159
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetSequenceAtResponse {
|
|
2160
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2161
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2162
|
+
const message = createBaseGetSequenceAtResponse();
|
|
2163
|
+
while (reader.pos < end) {
|
|
2164
|
+
const tag = reader.uint32();
|
|
2165
|
+
switch (tag >>> 3) {
|
|
2166
|
+
case 1: {
|
|
2167
|
+
if (tag !== 8) {
|
|
2168
|
+
break;
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2171
|
+
message.sequence = reader.int64() as bigint;
|
|
2172
|
+
continue;
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2176
|
+
break;
|
|
2177
|
+
}
|
|
2178
|
+
reader.skip(tag & 7);
|
|
2179
|
+
}
|
|
2180
|
+
return message;
|
|
2181
|
+
},
|
|
2182
|
+
|
|
2183
|
+
fromJSON(object: any): GetSequenceAtResponse {
|
|
2184
|
+
return { sequence: isSet(object.sequence) ? BigInt(object.sequence) : 0n };
|
|
2185
|
+
},
|
|
2186
|
+
|
|
2187
|
+
toJSON(message: GetSequenceAtResponse): unknown {
|
|
2188
|
+
const obj: any = {};
|
|
2189
|
+
if (message.sequence !== 0n) {
|
|
2190
|
+
obj.sequence = message.sequence.toString();
|
|
2191
|
+
}
|
|
2192
|
+
return obj;
|
|
2193
|
+
},
|
|
2194
|
+
|
|
2195
|
+
create(base?: DeepPartial<GetSequenceAtResponse>): GetSequenceAtResponse {
|
|
2196
|
+
return GetSequenceAtResponse.fromPartial(base ?? {});
|
|
2197
|
+
},
|
|
2198
|
+
fromPartial(object: DeepPartial<GetSequenceAtResponse>): GetSequenceAtResponse {
|
|
2199
|
+
const message = createBaseGetSequenceAtResponse();
|
|
2200
|
+
message.sequence = object.sequence ?? 0n;
|
|
2201
|
+
return message;
|
|
2202
|
+
},
|
|
2203
|
+
};
|
|
2204
|
+
|
|
2205
|
+
function createBaseAddTagsRequest(): AddTagsRequest {
|
|
2206
|
+
return { sequence: 0n, tag: [] };
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2209
|
+
export const AddTagsRequest: MessageFns<AddTagsRequest> = {
|
|
2210
|
+
encode(message: AddTagsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2211
|
+
if (message.sequence !== 0n) {
|
|
2212
|
+
if (BigInt.asIntN(64, message.sequence) !== message.sequence) {
|
|
2213
|
+
throw new globalThis.Error("value provided for field message.sequence of type int64 too large");
|
|
2214
|
+
}
|
|
2215
|
+
writer.uint32(8).int64(message.sequence);
|
|
2216
|
+
}
|
|
2217
|
+
for (const v of message.tag) {
|
|
2218
|
+
Tag.encode(v!, writer.uint32(18).fork()).join();
|
|
2219
|
+
}
|
|
2220
|
+
return writer;
|
|
2221
|
+
},
|
|
2222
|
+
|
|
2223
|
+
decode(input: BinaryReader | Uint8Array, length?: number): AddTagsRequest {
|
|
2224
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2225
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2226
|
+
const message = createBaseAddTagsRequest();
|
|
2227
|
+
while (reader.pos < end) {
|
|
2228
|
+
const tag = reader.uint32();
|
|
2229
|
+
switch (tag >>> 3) {
|
|
2230
|
+
case 1: {
|
|
2231
|
+
if (tag !== 8) {
|
|
2232
|
+
break;
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
message.sequence = reader.int64() as bigint;
|
|
2236
|
+
continue;
|
|
2237
|
+
}
|
|
2238
|
+
case 2: {
|
|
2239
|
+
if (tag !== 18) {
|
|
2240
|
+
break;
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
message.tag.push(Tag.decode(reader, reader.uint32()));
|
|
2244
|
+
continue;
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2248
|
+
break;
|
|
2249
|
+
}
|
|
2250
|
+
reader.skip(tag & 7);
|
|
2251
|
+
}
|
|
2252
|
+
return message;
|
|
2253
|
+
},
|
|
2254
|
+
|
|
2255
|
+
fromJSON(object: any): AddTagsRequest {
|
|
2256
|
+
return {
|
|
2257
|
+
sequence: isSet(object.sequence) ? BigInt(object.sequence) : 0n,
|
|
2258
|
+
tag: globalThis.Array.isArray(object?.tag) ? object.tag.map((e: any) => Tag.fromJSON(e)) : [],
|
|
2259
|
+
};
|
|
2260
|
+
},
|
|
2261
|
+
|
|
2262
|
+
toJSON(message: AddTagsRequest): unknown {
|
|
2263
|
+
const obj: any = {};
|
|
2264
|
+
if (message.sequence !== 0n) {
|
|
2265
|
+
obj.sequence = message.sequence.toString();
|
|
2266
|
+
}
|
|
2267
|
+
if (message.tag?.length) {
|
|
2268
|
+
obj.tag = message.tag.map((e) => Tag.toJSON(e));
|
|
2269
|
+
}
|
|
2270
|
+
return obj;
|
|
2271
|
+
},
|
|
2272
|
+
|
|
2273
|
+
create(base?: DeepPartial<AddTagsRequest>): AddTagsRequest {
|
|
2274
|
+
return AddTagsRequest.fromPartial(base ?? {});
|
|
2275
|
+
},
|
|
2276
|
+
fromPartial(object: DeepPartial<AddTagsRequest>): AddTagsRequest {
|
|
2277
|
+
const message = createBaseAddTagsRequest();
|
|
2278
|
+
message.sequence = object.sequence ?? 0n;
|
|
2279
|
+
message.tag = object.tag?.map((e) => Tag.fromPartial(e)) || [];
|
|
2280
|
+
return message;
|
|
2281
|
+
},
|
|
2282
|
+
};
|
|
2283
|
+
|
|
2284
|
+
function createBaseAddTagsResponse(): AddTagsResponse {
|
|
2285
|
+
return {};
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2288
|
+
export const AddTagsResponse: MessageFns<AddTagsResponse> = {
|
|
2289
|
+
encode(_: AddTagsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2290
|
+
return writer;
|
|
2291
|
+
},
|
|
2292
|
+
|
|
2293
|
+
decode(input: BinaryReader | Uint8Array, length?: number): AddTagsResponse {
|
|
2294
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2295
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2296
|
+
const message = createBaseAddTagsResponse();
|
|
2297
|
+
while (reader.pos < end) {
|
|
2298
|
+
const tag = reader.uint32();
|
|
2299
|
+
switch (tag >>> 3) {
|
|
2300
|
+
}
|
|
2301
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2302
|
+
break;
|
|
2303
|
+
}
|
|
2304
|
+
reader.skip(tag & 7);
|
|
2305
|
+
}
|
|
2306
|
+
return message;
|
|
2307
|
+
},
|
|
2308
|
+
|
|
2309
|
+
fromJSON(_: any): AddTagsResponse {
|
|
2310
|
+
return {};
|
|
2311
|
+
},
|
|
2312
|
+
|
|
2313
|
+
toJSON(_: AddTagsResponse): unknown {
|
|
2314
|
+
const obj: any = {};
|
|
2315
|
+
return obj;
|
|
2316
|
+
},
|
|
2317
|
+
|
|
2318
|
+
create(base?: DeepPartial<AddTagsResponse>): AddTagsResponse {
|
|
2319
|
+
return AddTagsResponse.fromPartial(base ?? {});
|
|
2320
|
+
},
|
|
2321
|
+
fromPartial(_: DeepPartial<AddTagsResponse>): AddTagsResponse {
|
|
2322
|
+
const message = createBaseAddTagsResponse();
|
|
2323
|
+
return message;
|
|
2324
|
+
},
|
|
2325
|
+
};
|
|
2326
|
+
|
|
2327
|
+
function createBaseRemoveTagsRequest(): RemoveTagsRequest {
|
|
2328
|
+
return { sequence: 0n, tag: [] };
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
export const RemoveTagsRequest: MessageFns<RemoveTagsRequest> = {
|
|
2332
|
+
encode(message: RemoveTagsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2333
|
+
if (message.sequence !== 0n) {
|
|
2334
|
+
if (BigInt.asIntN(64, message.sequence) !== message.sequence) {
|
|
2335
|
+
throw new globalThis.Error("value provided for field message.sequence of type int64 too large");
|
|
2336
|
+
}
|
|
2337
|
+
writer.uint32(8).int64(message.sequence);
|
|
2338
|
+
}
|
|
2339
|
+
for (const v of message.tag) {
|
|
2340
|
+
Tag.encode(v!, writer.uint32(18).fork()).join();
|
|
2341
|
+
}
|
|
2342
|
+
return writer;
|
|
2343
|
+
},
|
|
2344
|
+
|
|
2345
|
+
decode(input: BinaryReader | Uint8Array, length?: number): RemoveTagsRequest {
|
|
2346
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2347
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2348
|
+
const message = createBaseRemoveTagsRequest();
|
|
2349
|
+
while (reader.pos < end) {
|
|
2350
|
+
const tag = reader.uint32();
|
|
2351
|
+
switch (tag >>> 3) {
|
|
2352
|
+
case 1: {
|
|
2353
|
+
if (tag !== 8) {
|
|
2354
|
+
break;
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
message.sequence = reader.int64() as bigint;
|
|
2358
|
+
continue;
|
|
2359
|
+
}
|
|
2360
|
+
case 2: {
|
|
2361
|
+
if (tag !== 18) {
|
|
2362
|
+
break;
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
message.tag.push(Tag.decode(reader, reader.uint32()));
|
|
2366
|
+
continue;
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2370
|
+
break;
|
|
2371
|
+
}
|
|
2372
|
+
reader.skip(tag & 7);
|
|
2373
|
+
}
|
|
2374
|
+
return message;
|
|
2375
|
+
},
|
|
2376
|
+
|
|
2377
|
+
fromJSON(object: any): RemoveTagsRequest {
|
|
2378
|
+
return {
|
|
2379
|
+
sequence: isSet(object.sequence) ? BigInt(object.sequence) : 0n,
|
|
2380
|
+
tag: globalThis.Array.isArray(object?.tag) ? object.tag.map((e: any) => Tag.fromJSON(e)) : [],
|
|
2381
|
+
};
|
|
2382
|
+
},
|
|
2383
|
+
|
|
2384
|
+
toJSON(message: RemoveTagsRequest): unknown {
|
|
2385
|
+
const obj: any = {};
|
|
2386
|
+
if (message.sequence !== 0n) {
|
|
2387
|
+
obj.sequence = message.sequence.toString();
|
|
2388
|
+
}
|
|
2389
|
+
if (message.tag?.length) {
|
|
2390
|
+
obj.tag = message.tag.map((e) => Tag.toJSON(e));
|
|
2391
|
+
}
|
|
2392
|
+
return obj;
|
|
2393
|
+
},
|
|
2394
|
+
|
|
2395
|
+
create(base?: DeepPartial<RemoveTagsRequest>): RemoveTagsRequest {
|
|
2396
|
+
return RemoveTagsRequest.fromPartial(base ?? {});
|
|
2397
|
+
},
|
|
2398
|
+
fromPartial(object: DeepPartial<RemoveTagsRequest>): RemoveTagsRequest {
|
|
2399
|
+
const message = createBaseRemoveTagsRequest();
|
|
2400
|
+
message.sequence = object.sequence ?? 0n;
|
|
2401
|
+
message.tag = object.tag?.map((e) => Tag.fromPartial(e)) || [];
|
|
2402
|
+
return message;
|
|
2403
|
+
},
|
|
2404
|
+
};
|
|
2405
|
+
|
|
2406
|
+
function createBaseRemoveTagsResponse(): RemoveTagsResponse {
|
|
2407
|
+
return {};
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
export const RemoveTagsResponse: MessageFns<RemoveTagsResponse> = {
|
|
2411
|
+
encode(_: RemoveTagsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2412
|
+
return writer;
|
|
2413
|
+
},
|
|
2414
|
+
|
|
2415
|
+
decode(input: BinaryReader | Uint8Array, length?: number): RemoveTagsResponse {
|
|
2416
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2417
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2418
|
+
const message = createBaseRemoveTagsResponse();
|
|
2419
|
+
while (reader.pos < end) {
|
|
2420
|
+
const tag = reader.uint32();
|
|
2421
|
+
switch (tag >>> 3) {
|
|
2422
|
+
}
|
|
2423
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2424
|
+
break;
|
|
2425
|
+
}
|
|
2426
|
+
reader.skip(tag & 7);
|
|
2427
|
+
}
|
|
2428
|
+
return message;
|
|
2429
|
+
},
|
|
2430
|
+
|
|
2431
|
+
fromJSON(_: any): RemoveTagsResponse {
|
|
2432
|
+
return {};
|
|
2433
|
+
},
|
|
2434
|
+
|
|
2435
|
+
toJSON(_: RemoveTagsResponse): unknown {
|
|
2436
|
+
const obj: any = {};
|
|
2437
|
+
return obj;
|
|
2438
|
+
},
|
|
2439
|
+
|
|
2440
|
+
create(base?: DeepPartial<RemoveTagsResponse>): RemoveTagsResponse {
|
|
2441
|
+
return RemoveTagsResponse.fromPartial(base ?? {});
|
|
2442
|
+
},
|
|
2443
|
+
fromPartial(_: DeepPartial<RemoveTagsResponse>): RemoveTagsResponse {
|
|
2444
|
+
const message = createBaseRemoveTagsResponse();
|
|
2445
|
+
return message;
|
|
2446
|
+
},
|
|
2447
|
+
};
|
|
2448
|
+
|
|
2449
|
+
function createBaseGetTagsRequest(): GetTagsRequest {
|
|
2450
|
+
return { sequence: 0n };
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
export const GetTagsRequest: MessageFns<GetTagsRequest> = {
|
|
2454
|
+
encode(message: GetTagsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2455
|
+
if (message.sequence !== 0n) {
|
|
2456
|
+
if (BigInt.asIntN(64, message.sequence) !== message.sequence) {
|
|
2457
|
+
throw new globalThis.Error("value provided for field message.sequence of type int64 too large");
|
|
2458
|
+
}
|
|
2459
|
+
writer.uint32(8).int64(message.sequence);
|
|
2460
|
+
}
|
|
2461
|
+
return writer;
|
|
2462
|
+
},
|
|
2463
|
+
|
|
2464
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetTagsRequest {
|
|
2465
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2466
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2467
|
+
const message = createBaseGetTagsRequest();
|
|
2468
|
+
while (reader.pos < end) {
|
|
2469
|
+
const tag = reader.uint32();
|
|
2470
|
+
switch (tag >>> 3) {
|
|
2471
|
+
case 1: {
|
|
2472
|
+
if (tag !== 8) {
|
|
2473
|
+
break;
|
|
2474
|
+
}
|
|
2475
|
+
|
|
2476
|
+
message.sequence = reader.int64() as bigint;
|
|
2477
|
+
continue;
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2480
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2481
|
+
break;
|
|
2482
|
+
}
|
|
2483
|
+
reader.skip(tag & 7);
|
|
2484
|
+
}
|
|
2485
|
+
return message;
|
|
2486
|
+
},
|
|
2487
|
+
|
|
2488
|
+
fromJSON(object: any): GetTagsRequest {
|
|
2489
|
+
return { sequence: isSet(object.sequence) ? BigInt(object.sequence) : 0n };
|
|
2490
|
+
},
|
|
2491
|
+
|
|
2492
|
+
toJSON(message: GetTagsRequest): unknown {
|
|
2493
|
+
const obj: any = {};
|
|
2494
|
+
if (message.sequence !== 0n) {
|
|
2495
|
+
obj.sequence = message.sequence.toString();
|
|
2496
|
+
}
|
|
2497
|
+
return obj;
|
|
2498
|
+
},
|
|
2499
|
+
|
|
2500
|
+
create(base?: DeepPartial<GetTagsRequest>): GetTagsRequest {
|
|
2501
|
+
return GetTagsRequest.fromPartial(base ?? {});
|
|
2502
|
+
},
|
|
2503
|
+
fromPartial(object: DeepPartial<GetTagsRequest>): GetTagsRequest {
|
|
2504
|
+
const message = createBaseGetTagsRequest();
|
|
2505
|
+
message.sequence = object.sequence ?? 0n;
|
|
2506
|
+
return message;
|
|
2507
|
+
},
|
|
2508
|
+
};
|
|
2509
|
+
|
|
2510
|
+
function createBaseGetTagsResponse(): GetTagsResponse {
|
|
2511
|
+
return { tag: [] };
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
export const GetTagsResponse: MessageFns<GetTagsResponse> = {
|
|
2515
|
+
encode(message: GetTagsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2516
|
+
for (const v of message.tag) {
|
|
2517
|
+
Tag.encode(v!, writer.uint32(10).fork()).join();
|
|
2518
|
+
}
|
|
2519
|
+
return writer;
|
|
2520
|
+
},
|
|
2521
|
+
|
|
2522
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetTagsResponse {
|
|
2523
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2524
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2525
|
+
const message = createBaseGetTagsResponse();
|
|
2526
|
+
while (reader.pos < end) {
|
|
2527
|
+
const tag = reader.uint32();
|
|
2528
|
+
switch (tag >>> 3) {
|
|
2529
|
+
case 1: {
|
|
2530
|
+
if (tag !== 10) {
|
|
2531
|
+
break;
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2534
|
+
message.tag.push(Tag.decode(reader, reader.uint32()));
|
|
2535
|
+
continue;
|
|
2536
|
+
}
|
|
2537
|
+
}
|
|
2538
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2539
|
+
break;
|
|
2540
|
+
}
|
|
2541
|
+
reader.skip(tag & 7);
|
|
2542
|
+
}
|
|
2543
|
+
return message;
|
|
2544
|
+
},
|
|
2545
|
+
|
|
2546
|
+
fromJSON(object: any): GetTagsResponse {
|
|
2547
|
+
return { tag: globalThis.Array.isArray(object?.tag) ? object.tag.map((e: any) => Tag.fromJSON(e)) : [] };
|
|
2548
|
+
},
|
|
2549
|
+
|
|
2550
|
+
toJSON(message: GetTagsResponse): unknown {
|
|
2551
|
+
const obj: any = {};
|
|
2552
|
+
if (message.tag?.length) {
|
|
2553
|
+
obj.tag = message.tag.map((e) => Tag.toJSON(e));
|
|
2554
|
+
}
|
|
2555
|
+
return obj;
|
|
2556
|
+
},
|
|
2557
|
+
|
|
2558
|
+
create(base?: DeepPartial<GetTagsResponse>): GetTagsResponse {
|
|
2559
|
+
return GetTagsResponse.fromPartial(base ?? {});
|
|
2560
|
+
},
|
|
2561
|
+
fromPartial(object: DeepPartial<GetTagsResponse>): GetTagsResponse {
|
|
2562
|
+
const message = createBaseGetTagsResponse();
|
|
2563
|
+
message.tag = object.tag?.map((e) => Tag.fromPartial(e)) || [];
|
|
2564
|
+
return message;
|
|
2565
|
+
},
|
|
2566
|
+
};
|
|
2567
|
+
|
|
2568
|
+
function createBaseSnapshot(): Snapshot {
|
|
2569
|
+
return { name: "", version: "", payload: new Uint8Array(0), timestamp: 0n, metadata: {} };
|
|
2570
|
+
}
|
|
2571
|
+
|
|
2572
|
+
export const Snapshot: MessageFns<Snapshot> = {
|
|
2573
|
+
encode(message: Snapshot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2574
|
+
if (message.name !== "") {
|
|
2575
|
+
writer.uint32(10).string(message.name);
|
|
2576
|
+
}
|
|
2577
|
+
if (message.version !== "") {
|
|
2578
|
+
writer.uint32(18).string(message.version);
|
|
2579
|
+
}
|
|
2580
|
+
if (message.payload.length !== 0) {
|
|
2581
|
+
writer.uint32(26).bytes(message.payload);
|
|
2582
|
+
}
|
|
2583
|
+
if (message.timestamp !== 0n) {
|
|
2584
|
+
if (BigInt.asIntN(64, message.timestamp) !== message.timestamp) {
|
|
2585
|
+
throw new globalThis.Error("value provided for field message.timestamp of type int64 too large");
|
|
2586
|
+
}
|
|
2587
|
+
writer.uint32(32).int64(message.timestamp);
|
|
2588
|
+
}
|
|
2589
|
+
globalThis.Object.entries(message.metadata).forEach(([key, value]: [string, string]) => {
|
|
2590
|
+
Snapshot_MetadataEntry.encode({ key: key as any, value }, writer.uint32(42).fork()).join();
|
|
2591
|
+
});
|
|
2592
|
+
return writer;
|
|
2593
|
+
},
|
|
2594
|
+
|
|
2595
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Snapshot {
|
|
2596
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2597
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2598
|
+
const message = createBaseSnapshot();
|
|
2599
|
+
while (reader.pos < end) {
|
|
2600
|
+
const tag = reader.uint32();
|
|
2601
|
+
switch (tag >>> 3) {
|
|
2602
|
+
case 1: {
|
|
2603
|
+
if (tag !== 10) {
|
|
2604
|
+
break;
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
message.name = reader.string();
|
|
2608
|
+
continue;
|
|
2609
|
+
}
|
|
2610
|
+
case 2: {
|
|
2611
|
+
if (tag !== 18) {
|
|
2612
|
+
break;
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
message.version = reader.string();
|
|
2616
|
+
continue;
|
|
2617
|
+
}
|
|
2618
|
+
case 3: {
|
|
2619
|
+
if (tag !== 26) {
|
|
2620
|
+
break;
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2623
|
+
message.payload = reader.bytes();
|
|
2624
|
+
continue;
|
|
2625
|
+
}
|
|
2626
|
+
case 4: {
|
|
2627
|
+
if (tag !== 32) {
|
|
2628
|
+
break;
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
message.timestamp = reader.int64() as bigint;
|
|
2632
|
+
continue;
|
|
2633
|
+
}
|
|
2634
|
+
case 5: {
|
|
2635
|
+
if (tag !== 42) {
|
|
2636
|
+
break;
|
|
2637
|
+
}
|
|
2638
|
+
|
|
2639
|
+
const entry5 = Snapshot_MetadataEntry.decode(reader, reader.uint32());
|
|
2640
|
+
if (entry5.value !== undefined) {
|
|
2641
|
+
message.metadata[entry5.key] = entry5.value;
|
|
2642
|
+
}
|
|
2643
|
+
continue;
|
|
2644
|
+
}
|
|
2645
|
+
}
|
|
2646
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2647
|
+
break;
|
|
2648
|
+
}
|
|
2649
|
+
reader.skip(tag & 7);
|
|
2650
|
+
}
|
|
2651
|
+
return message;
|
|
2652
|
+
},
|
|
2653
|
+
|
|
2654
|
+
fromJSON(object: any): Snapshot {
|
|
2655
|
+
return {
|
|
2656
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
2657
|
+
version: isSet(object.version) ? globalThis.String(object.version) : "",
|
|
2658
|
+
payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array(0),
|
|
2659
|
+
timestamp: isSet(object.timestamp) ? BigInt(object.timestamp) : 0n,
|
|
2660
|
+
metadata: isObject(object.metadata)
|
|
2661
|
+
? (globalThis.Object.entries(object.metadata) as [string, any][]).reduce(
|
|
2662
|
+
(acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
|
2663
|
+
acc[key] = globalThis.String(value);
|
|
2664
|
+
return acc;
|
|
2665
|
+
},
|
|
2666
|
+
{},
|
|
2667
|
+
)
|
|
2668
|
+
: {},
|
|
2669
|
+
};
|
|
2670
|
+
},
|
|
2671
|
+
|
|
2672
|
+
toJSON(message: Snapshot): unknown {
|
|
2673
|
+
const obj: any = {};
|
|
2674
|
+
if (message.name !== "") {
|
|
2675
|
+
obj.name = message.name;
|
|
2676
|
+
}
|
|
2677
|
+
if (message.version !== "") {
|
|
2678
|
+
obj.version = message.version;
|
|
2679
|
+
}
|
|
2680
|
+
if (message.payload.length !== 0) {
|
|
2681
|
+
obj.payload = base64FromBytes(message.payload);
|
|
2682
|
+
}
|
|
2683
|
+
if (message.timestamp !== 0n) {
|
|
2684
|
+
obj.timestamp = message.timestamp.toString();
|
|
2685
|
+
}
|
|
2686
|
+
if (message.metadata) {
|
|
2687
|
+
const entries = globalThis.Object.entries(message.metadata) as [string, string][];
|
|
2688
|
+
if (entries.length > 0) {
|
|
2689
|
+
obj.metadata = {};
|
|
2690
|
+
entries.forEach(([k, v]) => {
|
|
2691
|
+
obj.metadata[k] = v;
|
|
2692
|
+
});
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2695
|
+
return obj;
|
|
2696
|
+
},
|
|
2697
|
+
|
|
2698
|
+
create(base?: DeepPartial<Snapshot>): Snapshot {
|
|
2699
|
+
return Snapshot.fromPartial(base ?? {});
|
|
2700
|
+
},
|
|
2701
|
+
fromPartial(object: DeepPartial<Snapshot>): Snapshot {
|
|
2702
|
+
const message = createBaseSnapshot();
|
|
2703
|
+
message.name = object.name ?? "";
|
|
2704
|
+
message.version = object.version ?? "";
|
|
2705
|
+
message.payload = object.payload ?? new Uint8Array(0);
|
|
2706
|
+
message.timestamp = object.timestamp ?? 0n;
|
|
2707
|
+
message.metadata = (globalThis.Object.entries(object.metadata ?? {}) as [string, string][]).reduce(
|
|
2708
|
+
(acc: { [key: string]: string }, [key, value]: [string, string]) => {
|
|
2709
|
+
if (value !== undefined) {
|
|
2710
|
+
acc[key] = globalThis.String(value);
|
|
2711
|
+
}
|
|
2712
|
+
return acc;
|
|
2713
|
+
},
|
|
2714
|
+
{},
|
|
2715
|
+
);
|
|
2716
|
+
return message;
|
|
2717
|
+
},
|
|
2718
|
+
};
|
|
2719
|
+
|
|
2720
|
+
function createBaseSnapshot_MetadataEntry(): Snapshot_MetadataEntry {
|
|
2721
|
+
return { key: "", value: "" };
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2724
|
+
export const Snapshot_MetadataEntry: MessageFns<Snapshot_MetadataEntry> = {
|
|
2725
|
+
encode(message: Snapshot_MetadataEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2726
|
+
if (message.key !== "") {
|
|
2727
|
+
writer.uint32(10).string(message.key);
|
|
2728
|
+
}
|
|
2729
|
+
if (message.value !== "") {
|
|
2730
|
+
writer.uint32(18).string(message.value);
|
|
2731
|
+
}
|
|
2732
|
+
return writer;
|
|
2733
|
+
},
|
|
2734
|
+
|
|
2735
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Snapshot_MetadataEntry {
|
|
2736
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2737
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2738
|
+
const message = createBaseSnapshot_MetadataEntry();
|
|
2739
|
+
while (reader.pos < end) {
|
|
2740
|
+
const tag = reader.uint32();
|
|
2741
|
+
switch (tag >>> 3) {
|
|
2742
|
+
case 1: {
|
|
2743
|
+
if (tag !== 10) {
|
|
2744
|
+
break;
|
|
2745
|
+
}
|
|
2746
|
+
|
|
2747
|
+
message.key = reader.string();
|
|
2748
|
+
continue;
|
|
2749
|
+
}
|
|
2750
|
+
case 2: {
|
|
2751
|
+
if (tag !== 18) {
|
|
2752
|
+
break;
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2755
|
+
message.value = reader.string();
|
|
2756
|
+
continue;
|
|
2757
|
+
}
|
|
2758
|
+
}
|
|
2759
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2760
|
+
break;
|
|
2761
|
+
}
|
|
2762
|
+
reader.skip(tag & 7);
|
|
2763
|
+
}
|
|
2764
|
+
return message;
|
|
2765
|
+
},
|
|
2766
|
+
|
|
2767
|
+
fromJSON(object: any): Snapshot_MetadataEntry {
|
|
2768
|
+
return {
|
|
2769
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
2770
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
2771
|
+
};
|
|
2772
|
+
},
|
|
2773
|
+
|
|
2774
|
+
toJSON(message: Snapshot_MetadataEntry): unknown {
|
|
2775
|
+
const obj: any = {};
|
|
2776
|
+
if (message.key !== "") {
|
|
2777
|
+
obj.key = message.key;
|
|
2778
|
+
}
|
|
2779
|
+
if (message.value !== "") {
|
|
2780
|
+
obj.value = message.value;
|
|
2781
|
+
}
|
|
2782
|
+
return obj;
|
|
2783
|
+
},
|
|
2784
|
+
|
|
2785
|
+
create(base?: DeepPartial<Snapshot_MetadataEntry>): Snapshot_MetadataEntry {
|
|
2786
|
+
return Snapshot_MetadataEntry.fromPartial(base ?? {});
|
|
2787
|
+
},
|
|
2788
|
+
fromPartial(object: DeepPartial<Snapshot_MetadataEntry>): Snapshot_MetadataEntry {
|
|
2789
|
+
const message = createBaseSnapshot_MetadataEntry();
|
|
2790
|
+
message.key = object.key ?? "";
|
|
2791
|
+
message.value = object.value ?? "";
|
|
2792
|
+
return message;
|
|
2793
|
+
},
|
|
2794
|
+
};
|
|
2795
|
+
|
|
2796
|
+
function createBaseAddSnapshotRequest(): AddSnapshotRequest {
|
|
2797
|
+
return { key: new Uint8Array(0), sequence: 0n, prune: false, snapshot: undefined };
|
|
2798
|
+
}
|
|
2799
|
+
|
|
2800
|
+
export const AddSnapshotRequest: MessageFns<AddSnapshotRequest> = {
|
|
2801
|
+
encode(message: AddSnapshotRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2802
|
+
if (message.key.length !== 0) {
|
|
2803
|
+
writer.uint32(10).bytes(message.key);
|
|
2804
|
+
}
|
|
2805
|
+
if (message.sequence !== 0n) {
|
|
2806
|
+
if (BigInt.asIntN(64, message.sequence) !== message.sequence) {
|
|
2807
|
+
throw new globalThis.Error("value provided for field message.sequence of type int64 too large");
|
|
2808
|
+
}
|
|
2809
|
+
writer.uint32(16).int64(message.sequence);
|
|
2810
|
+
}
|
|
2811
|
+
if (message.prune !== false) {
|
|
2812
|
+
writer.uint32(24).bool(message.prune);
|
|
2813
|
+
}
|
|
2814
|
+
if (message.snapshot !== undefined) {
|
|
2815
|
+
Snapshot.encode(message.snapshot, writer.uint32(34).fork()).join();
|
|
2816
|
+
}
|
|
2817
|
+
return writer;
|
|
2818
|
+
},
|
|
2819
|
+
|
|
2820
|
+
decode(input: BinaryReader | Uint8Array, length?: number): AddSnapshotRequest {
|
|
2821
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2822
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2823
|
+
const message = createBaseAddSnapshotRequest();
|
|
2824
|
+
while (reader.pos < end) {
|
|
2825
|
+
const tag = reader.uint32();
|
|
2826
|
+
switch (tag >>> 3) {
|
|
2827
|
+
case 1: {
|
|
2828
|
+
if (tag !== 10) {
|
|
2829
|
+
break;
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
message.key = reader.bytes();
|
|
2833
|
+
continue;
|
|
2834
|
+
}
|
|
2835
|
+
case 2: {
|
|
2836
|
+
if (tag !== 16) {
|
|
2837
|
+
break;
|
|
2838
|
+
}
|
|
2839
|
+
|
|
2840
|
+
message.sequence = reader.int64() as bigint;
|
|
2841
|
+
continue;
|
|
2842
|
+
}
|
|
2843
|
+
case 3: {
|
|
2844
|
+
if (tag !== 24) {
|
|
2845
|
+
break;
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2848
|
+
message.prune = reader.bool();
|
|
2849
|
+
continue;
|
|
2850
|
+
}
|
|
2851
|
+
case 4: {
|
|
2852
|
+
if (tag !== 34) {
|
|
2853
|
+
break;
|
|
2854
|
+
}
|
|
2855
|
+
|
|
2856
|
+
message.snapshot = Snapshot.decode(reader, reader.uint32());
|
|
2857
|
+
continue;
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2861
|
+
break;
|
|
2862
|
+
}
|
|
2863
|
+
reader.skip(tag & 7);
|
|
2864
|
+
}
|
|
2865
|
+
return message;
|
|
2866
|
+
},
|
|
2867
|
+
|
|
2868
|
+
fromJSON(object: any): AddSnapshotRequest {
|
|
2869
|
+
return {
|
|
2870
|
+
key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(0),
|
|
2871
|
+
sequence: isSet(object.sequence) ? BigInt(object.sequence) : 0n,
|
|
2872
|
+
prune: isSet(object.prune) ? globalThis.Boolean(object.prune) : false,
|
|
2873
|
+
snapshot: isSet(object.snapshot) ? Snapshot.fromJSON(object.snapshot) : undefined,
|
|
2874
|
+
};
|
|
2875
|
+
},
|
|
2876
|
+
|
|
2877
|
+
toJSON(message: AddSnapshotRequest): unknown {
|
|
2878
|
+
const obj: any = {};
|
|
2879
|
+
if (message.key.length !== 0) {
|
|
2880
|
+
obj.key = base64FromBytes(message.key);
|
|
2881
|
+
}
|
|
2882
|
+
if (message.sequence !== 0n) {
|
|
2883
|
+
obj.sequence = message.sequence.toString();
|
|
2884
|
+
}
|
|
2885
|
+
if (message.prune !== false) {
|
|
2886
|
+
obj.prune = message.prune;
|
|
2887
|
+
}
|
|
2888
|
+
if (message.snapshot !== undefined) {
|
|
2889
|
+
obj.snapshot = Snapshot.toJSON(message.snapshot);
|
|
2890
|
+
}
|
|
2891
|
+
return obj;
|
|
2892
|
+
},
|
|
2893
|
+
|
|
2894
|
+
create(base?: DeepPartial<AddSnapshotRequest>): AddSnapshotRequest {
|
|
2895
|
+
return AddSnapshotRequest.fromPartial(base ?? {});
|
|
2896
|
+
},
|
|
2897
|
+
fromPartial(object: DeepPartial<AddSnapshotRequest>): AddSnapshotRequest {
|
|
2898
|
+
const message = createBaseAddSnapshotRequest();
|
|
2899
|
+
message.key = object.key ?? new Uint8Array(0);
|
|
2900
|
+
message.sequence = object.sequence ?? 0n;
|
|
2901
|
+
message.prune = object.prune ?? false;
|
|
2902
|
+
message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
|
|
2903
|
+
? Snapshot.fromPartial(object.snapshot)
|
|
2904
|
+
: undefined;
|
|
2905
|
+
return message;
|
|
2906
|
+
},
|
|
2907
|
+
};
|
|
2908
|
+
|
|
2909
|
+
function createBaseAddSnapshotResponse(): AddSnapshotResponse {
|
|
2910
|
+
return {};
|
|
2911
|
+
}
|
|
2912
|
+
|
|
2913
|
+
export const AddSnapshotResponse: MessageFns<AddSnapshotResponse> = {
|
|
2914
|
+
encode(_: AddSnapshotResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2915
|
+
return writer;
|
|
2916
|
+
},
|
|
2917
|
+
|
|
2918
|
+
decode(input: BinaryReader | Uint8Array, length?: number): AddSnapshotResponse {
|
|
2919
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2920
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2921
|
+
const message = createBaseAddSnapshotResponse();
|
|
2922
|
+
while (reader.pos < end) {
|
|
2923
|
+
const tag = reader.uint32();
|
|
2924
|
+
switch (tag >>> 3) {
|
|
2925
|
+
}
|
|
2926
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2927
|
+
break;
|
|
2928
|
+
}
|
|
2929
|
+
reader.skip(tag & 7);
|
|
2930
|
+
}
|
|
2931
|
+
return message;
|
|
2932
|
+
},
|
|
2933
|
+
|
|
2934
|
+
fromJSON(_: any): AddSnapshotResponse {
|
|
2935
|
+
return {};
|
|
2936
|
+
},
|
|
2937
|
+
|
|
2938
|
+
toJSON(_: AddSnapshotResponse): unknown {
|
|
2939
|
+
const obj: any = {};
|
|
2940
|
+
return obj;
|
|
2941
|
+
},
|
|
2942
|
+
|
|
2943
|
+
create(base?: DeepPartial<AddSnapshotResponse>): AddSnapshotResponse {
|
|
2944
|
+
return AddSnapshotResponse.fromPartial(base ?? {});
|
|
2945
|
+
},
|
|
2946
|
+
fromPartial(_: DeepPartial<AddSnapshotResponse>): AddSnapshotResponse {
|
|
2947
|
+
const message = createBaseAddSnapshotResponse();
|
|
2948
|
+
return message;
|
|
2949
|
+
},
|
|
2950
|
+
};
|
|
2951
|
+
|
|
2952
|
+
function createBaseDeleteSnapshotsRequest(): DeleteSnapshotsRequest {
|
|
2953
|
+
return { key: new Uint8Array(0), toSequence: 0n };
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
export const DeleteSnapshotsRequest: MessageFns<DeleteSnapshotsRequest> = {
|
|
2957
|
+
encode(message: DeleteSnapshotsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2958
|
+
if (message.key.length !== 0) {
|
|
2959
|
+
writer.uint32(10).bytes(message.key);
|
|
2960
|
+
}
|
|
2961
|
+
if (message.toSequence !== 0n) {
|
|
2962
|
+
if (BigInt.asIntN(64, message.toSequence) !== message.toSequence) {
|
|
2963
|
+
throw new globalThis.Error("value provided for field message.toSequence of type int64 too large");
|
|
2964
|
+
}
|
|
2965
|
+
writer.uint32(24).int64(message.toSequence);
|
|
2966
|
+
}
|
|
2967
|
+
return writer;
|
|
2968
|
+
},
|
|
2969
|
+
|
|
2970
|
+
decode(input: BinaryReader | Uint8Array, length?: number): DeleteSnapshotsRequest {
|
|
2971
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2972
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2973
|
+
const message = createBaseDeleteSnapshotsRequest();
|
|
2974
|
+
while (reader.pos < end) {
|
|
2975
|
+
const tag = reader.uint32();
|
|
2976
|
+
switch (tag >>> 3) {
|
|
2977
|
+
case 1: {
|
|
2978
|
+
if (tag !== 10) {
|
|
2979
|
+
break;
|
|
2980
|
+
}
|
|
2981
|
+
|
|
2982
|
+
message.key = reader.bytes();
|
|
2983
|
+
continue;
|
|
2984
|
+
}
|
|
2985
|
+
case 3: {
|
|
2986
|
+
if (tag !== 24) {
|
|
2987
|
+
break;
|
|
2988
|
+
}
|
|
2989
|
+
|
|
2990
|
+
message.toSequence = reader.int64() as bigint;
|
|
2991
|
+
continue;
|
|
2992
|
+
}
|
|
2993
|
+
}
|
|
2994
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2995
|
+
break;
|
|
2996
|
+
}
|
|
2997
|
+
reader.skip(tag & 7);
|
|
2998
|
+
}
|
|
2999
|
+
return message;
|
|
3000
|
+
},
|
|
3001
|
+
|
|
3002
|
+
fromJSON(object: any): DeleteSnapshotsRequest {
|
|
3003
|
+
return {
|
|
3004
|
+
key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(0),
|
|
3005
|
+
toSequence: isSet(object.toSequence)
|
|
3006
|
+
? BigInt(object.toSequence)
|
|
3007
|
+
: isSet(object.to_sequence)
|
|
3008
|
+
? BigInt(object.to_sequence)
|
|
3009
|
+
: 0n,
|
|
3010
|
+
};
|
|
3011
|
+
},
|
|
3012
|
+
|
|
3013
|
+
toJSON(message: DeleteSnapshotsRequest): unknown {
|
|
3014
|
+
const obj: any = {};
|
|
3015
|
+
if (message.key.length !== 0) {
|
|
3016
|
+
obj.key = base64FromBytes(message.key);
|
|
3017
|
+
}
|
|
3018
|
+
if (message.toSequence !== 0n) {
|
|
3019
|
+
obj.toSequence = message.toSequence.toString();
|
|
3020
|
+
}
|
|
3021
|
+
return obj;
|
|
3022
|
+
},
|
|
3023
|
+
|
|
3024
|
+
create(base?: DeepPartial<DeleteSnapshotsRequest>): DeleteSnapshotsRequest {
|
|
3025
|
+
return DeleteSnapshotsRequest.fromPartial(base ?? {});
|
|
3026
|
+
},
|
|
3027
|
+
fromPartial(object: DeepPartial<DeleteSnapshotsRequest>): DeleteSnapshotsRequest {
|
|
3028
|
+
const message = createBaseDeleteSnapshotsRequest();
|
|
3029
|
+
message.key = object.key ?? new Uint8Array(0);
|
|
3030
|
+
message.toSequence = object.toSequence ?? 0n;
|
|
3031
|
+
return message;
|
|
3032
|
+
},
|
|
3033
|
+
};
|
|
3034
|
+
|
|
3035
|
+
function createBaseDeleteSnapshotsResponse(): DeleteSnapshotsResponse {
|
|
3036
|
+
return {};
|
|
3037
|
+
}
|
|
3038
|
+
|
|
3039
|
+
export const DeleteSnapshotsResponse: MessageFns<DeleteSnapshotsResponse> = {
|
|
3040
|
+
encode(_: DeleteSnapshotsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
3041
|
+
return writer;
|
|
3042
|
+
},
|
|
3043
|
+
|
|
3044
|
+
decode(input: BinaryReader | Uint8Array, length?: number): DeleteSnapshotsResponse {
|
|
3045
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3046
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
3047
|
+
const message = createBaseDeleteSnapshotsResponse();
|
|
3048
|
+
while (reader.pos < end) {
|
|
3049
|
+
const tag = reader.uint32();
|
|
3050
|
+
switch (tag >>> 3) {
|
|
3051
|
+
}
|
|
3052
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3053
|
+
break;
|
|
3054
|
+
}
|
|
3055
|
+
reader.skip(tag & 7);
|
|
3056
|
+
}
|
|
3057
|
+
return message;
|
|
3058
|
+
},
|
|
3059
|
+
|
|
3060
|
+
fromJSON(_: any): DeleteSnapshotsResponse {
|
|
3061
|
+
return {};
|
|
3062
|
+
},
|
|
3063
|
+
|
|
3064
|
+
toJSON(_: DeleteSnapshotsResponse): unknown {
|
|
3065
|
+
const obj: any = {};
|
|
3066
|
+
return obj;
|
|
3067
|
+
},
|
|
3068
|
+
|
|
3069
|
+
create(base?: DeepPartial<DeleteSnapshotsResponse>): DeleteSnapshotsResponse {
|
|
3070
|
+
return DeleteSnapshotsResponse.fromPartial(base ?? {});
|
|
3071
|
+
},
|
|
3072
|
+
fromPartial(_: DeepPartial<DeleteSnapshotsResponse>): DeleteSnapshotsResponse {
|
|
3073
|
+
const message = createBaseDeleteSnapshotsResponse();
|
|
3074
|
+
return message;
|
|
3075
|
+
},
|
|
3076
|
+
};
|
|
3077
|
+
|
|
3078
|
+
function createBaseListSnapshotsRequest(): ListSnapshotsRequest {
|
|
3079
|
+
return { key: new Uint8Array(0), fromSequence: 0n, toSequence: 0n };
|
|
3080
|
+
}
|
|
3081
|
+
|
|
3082
|
+
export const ListSnapshotsRequest: MessageFns<ListSnapshotsRequest> = {
|
|
3083
|
+
encode(message: ListSnapshotsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
3084
|
+
if (message.key.length !== 0) {
|
|
3085
|
+
writer.uint32(10).bytes(message.key);
|
|
3086
|
+
}
|
|
3087
|
+
if (message.fromSequence !== 0n) {
|
|
3088
|
+
if (BigInt.asIntN(64, message.fromSequence) !== message.fromSequence) {
|
|
3089
|
+
throw new globalThis.Error("value provided for field message.fromSequence of type int64 too large");
|
|
3090
|
+
}
|
|
3091
|
+
writer.uint32(16).int64(message.fromSequence);
|
|
3092
|
+
}
|
|
3093
|
+
if (message.toSequence !== 0n) {
|
|
3094
|
+
if (BigInt.asIntN(64, message.toSequence) !== message.toSequence) {
|
|
3095
|
+
throw new globalThis.Error("value provided for field message.toSequence of type int64 too large");
|
|
3096
|
+
}
|
|
3097
|
+
writer.uint32(24).int64(message.toSequence);
|
|
3098
|
+
}
|
|
3099
|
+
return writer;
|
|
3100
|
+
},
|
|
3101
|
+
|
|
3102
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ListSnapshotsRequest {
|
|
3103
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3104
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
3105
|
+
const message = createBaseListSnapshotsRequest();
|
|
3106
|
+
while (reader.pos < end) {
|
|
3107
|
+
const tag = reader.uint32();
|
|
3108
|
+
switch (tag >>> 3) {
|
|
3109
|
+
case 1: {
|
|
3110
|
+
if (tag !== 10) {
|
|
3111
|
+
break;
|
|
3112
|
+
}
|
|
3113
|
+
|
|
3114
|
+
message.key = reader.bytes();
|
|
3115
|
+
continue;
|
|
3116
|
+
}
|
|
3117
|
+
case 2: {
|
|
3118
|
+
if (tag !== 16) {
|
|
3119
|
+
break;
|
|
3120
|
+
}
|
|
3121
|
+
|
|
3122
|
+
message.fromSequence = reader.int64() as bigint;
|
|
3123
|
+
continue;
|
|
3124
|
+
}
|
|
3125
|
+
case 3: {
|
|
3126
|
+
if (tag !== 24) {
|
|
3127
|
+
break;
|
|
3128
|
+
}
|
|
3129
|
+
|
|
3130
|
+
message.toSequence = reader.int64() as bigint;
|
|
3131
|
+
continue;
|
|
3132
|
+
}
|
|
3133
|
+
}
|
|
3134
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3135
|
+
break;
|
|
3136
|
+
}
|
|
3137
|
+
reader.skip(tag & 7);
|
|
3138
|
+
}
|
|
3139
|
+
return message;
|
|
3140
|
+
},
|
|
3141
|
+
|
|
3142
|
+
fromJSON(object: any): ListSnapshotsRequest {
|
|
3143
|
+
return {
|
|
3144
|
+
key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(0),
|
|
3145
|
+
fromSequence: isSet(object.fromSequence)
|
|
3146
|
+
? BigInt(object.fromSequence)
|
|
3147
|
+
: isSet(object.from_sequence)
|
|
3148
|
+
? BigInt(object.from_sequence)
|
|
3149
|
+
: 0n,
|
|
3150
|
+
toSequence: isSet(object.toSequence)
|
|
3151
|
+
? BigInt(object.toSequence)
|
|
3152
|
+
: isSet(object.to_sequence)
|
|
3153
|
+
? BigInt(object.to_sequence)
|
|
3154
|
+
: 0n,
|
|
3155
|
+
};
|
|
3156
|
+
},
|
|
3157
|
+
|
|
3158
|
+
toJSON(message: ListSnapshotsRequest): unknown {
|
|
3159
|
+
const obj: any = {};
|
|
3160
|
+
if (message.key.length !== 0) {
|
|
3161
|
+
obj.key = base64FromBytes(message.key);
|
|
3162
|
+
}
|
|
3163
|
+
if (message.fromSequence !== 0n) {
|
|
3164
|
+
obj.fromSequence = message.fromSequence.toString();
|
|
3165
|
+
}
|
|
3166
|
+
if (message.toSequence !== 0n) {
|
|
3167
|
+
obj.toSequence = message.toSequence.toString();
|
|
3168
|
+
}
|
|
3169
|
+
return obj;
|
|
3170
|
+
},
|
|
3171
|
+
|
|
3172
|
+
create(base?: DeepPartial<ListSnapshotsRequest>): ListSnapshotsRequest {
|
|
3173
|
+
return ListSnapshotsRequest.fromPartial(base ?? {});
|
|
3174
|
+
},
|
|
3175
|
+
fromPartial(object: DeepPartial<ListSnapshotsRequest>): ListSnapshotsRequest {
|
|
3176
|
+
const message = createBaseListSnapshotsRequest();
|
|
3177
|
+
message.key = object.key ?? new Uint8Array(0);
|
|
3178
|
+
message.fromSequence = object.fromSequence ?? 0n;
|
|
3179
|
+
message.toSequence = object.toSequence ?? 0n;
|
|
3180
|
+
return message;
|
|
3181
|
+
},
|
|
3182
|
+
};
|
|
3183
|
+
|
|
3184
|
+
function createBaseListSnapshotsResponse(): ListSnapshotsResponse {
|
|
3185
|
+
return { key: new Uint8Array(0), sequence: 0n, snapshot: undefined };
|
|
3186
|
+
}
|
|
3187
|
+
|
|
3188
|
+
export const ListSnapshotsResponse: MessageFns<ListSnapshotsResponse> = {
|
|
3189
|
+
encode(message: ListSnapshotsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
3190
|
+
if (message.key.length !== 0) {
|
|
3191
|
+
writer.uint32(10).bytes(message.key);
|
|
3192
|
+
}
|
|
3193
|
+
if (message.sequence !== 0n) {
|
|
3194
|
+
if (BigInt.asIntN(64, message.sequence) !== message.sequence) {
|
|
3195
|
+
throw new globalThis.Error("value provided for field message.sequence of type int64 too large");
|
|
3196
|
+
}
|
|
3197
|
+
writer.uint32(16).int64(message.sequence);
|
|
3198
|
+
}
|
|
3199
|
+
if (message.snapshot !== undefined) {
|
|
3200
|
+
Snapshot.encode(message.snapshot, writer.uint32(26).fork()).join();
|
|
3201
|
+
}
|
|
3202
|
+
return writer;
|
|
3203
|
+
},
|
|
3204
|
+
|
|
3205
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ListSnapshotsResponse {
|
|
3206
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3207
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
3208
|
+
const message = createBaseListSnapshotsResponse();
|
|
3209
|
+
while (reader.pos < end) {
|
|
3210
|
+
const tag = reader.uint32();
|
|
3211
|
+
switch (tag >>> 3) {
|
|
3212
|
+
case 1: {
|
|
3213
|
+
if (tag !== 10) {
|
|
3214
|
+
break;
|
|
3215
|
+
}
|
|
3216
|
+
|
|
3217
|
+
message.key = reader.bytes();
|
|
3218
|
+
continue;
|
|
3219
|
+
}
|
|
3220
|
+
case 2: {
|
|
3221
|
+
if (tag !== 16) {
|
|
3222
|
+
break;
|
|
3223
|
+
}
|
|
3224
|
+
|
|
3225
|
+
message.sequence = reader.int64() as bigint;
|
|
3226
|
+
continue;
|
|
3227
|
+
}
|
|
3228
|
+
case 3: {
|
|
3229
|
+
if (tag !== 26) {
|
|
3230
|
+
break;
|
|
3231
|
+
}
|
|
3232
|
+
|
|
3233
|
+
message.snapshot = Snapshot.decode(reader, reader.uint32());
|
|
3234
|
+
continue;
|
|
3235
|
+
}
|
|
3236
|
+
}
|
|
3237
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3238
|
+
break;
|
|
3239
|
+
}
|
|
3240
|
+
reader.skip(tag & 7);
|
|
3241
|
+
}
|
|
3242
|
+
return message;
|
|
3243
|
+
},
|
|
3244
|
+
|
|
3245
|
+
fromJSON(object: any): ListSnapshotsResponse {
|
|
3246
|
+
return {
|
|
3247
|
+
key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(0),
|
|
3248
|
+
sequence: isSet(object.sequence) ? BigInt(object.sequence) : 0n,
|
|
3249
|
+
snapshot: isSet(object.snapshot) ? Snapshot.fromJSON(object.snapshot) : undefined,
|
|
3250
|
+
};
|
|
3251
|
+
},
|
|
3252
|
+
|
|
3253
|
+
toJSON(message: ListSnapshotsResponse): unknown {
|
|
3254
|
+
const obj: any = {};
|
|
3255
|
+
if (message.key.length !== 0) {
|
|
3256
|
+
obj.key = base64FromBytes(message.key);
|
|
3257
|
+
}
|
|
3258
|
+
if (message.sequence !== 0n) {
|
|
3259
|
+
obj.sequence = message.sequence.toString();
|
|
3260
|
+
}
|
|
3261
|
+
if (message.snapshot !== undefined) {
|
|
3262
|
+
obj.snapshot = Snapshot.toJSON(message.snapshot);
|
|
3263
|
+
}
|
|
3264
|
+
return obj;
|
|
3265
|
+
},
|
|
3266
|
+
|
|
3267
|
+
create(base?: DeepPartial<ListSnapshotsResponse>): ListSnapshotsResponse {
|
|
3268
|
+
return ListSnapshotsResponse.fromPartial(base ?? {});
|
|
3269
|
+
},
|
|
3270
|
+
fromPartial(object: DeepPartial<ListSnapshotsResponse>): ListSnapshotsResponse {
|
|
3271
|
+
const message = createBaseListSnapshotsResponse();
|
|
3272
|
+
message.key = object.key ?? new Uint8Array(0);
|
|
3273
|
+
message.sequence = object.sequence ?? 0n;
|
|
3274
|
+
message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
|
|
3275
|
+
? Snapshot.fromPartial(object.snapshot)
|
|
3276
|
+
: undefined;
|
|
3277
|
+
return message;
|
|
3278
|
+
},
|
|
3279
|
+
};
|
|
3280
|
+
|
|
3281
|
+
function createBaseGetLastSnapshotRequest(): GetLastSnapshotRequest {
|
|
3282
|
+
return { key: new Uint8Array(0) };
|
|
3283
|
+
}
|
|
3284
|
+
|
|
3285
|
+
export const GetLastSnapshotRequest: MessageFns<GetLastSnapshotRequest> = {
|
|
3286
|
+
encode(message: GetLastSnapshotRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
3287
|
+
if (message.key.length !== 0) {
|
|
3288
|
+
writer.uint32(10).bytes(message.key);
|
|
3289
|
+
}
|
|
3290
|
+
return writer;
|
|
3291
|
+
},
|
|
3292
|
+
|
|
3293
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetLastSnapshotRequest {
|
|
3294
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3295
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
3296
|
+
const message = createBaseGetLastSnapshotRequest();
|
|
3297
|
+
while (reader.pos < end) {
|
|
3298
|
+
const tag = reader.uint32();
|
|
3299
|
+
switch (tag >>> 3) {
|
|
3300
|
+
case 1: {
|
|
3301
|
+
if (tag !== 10) {
|
|
3302
|
+
break;
|
|
3303
|
+
}
|
|
3304
|
+
|
|
3305
|
+
message.key = reader.bytes();
|
|
3306
|
+
continue;
|
|
3307
|
+
}
|
|
3308
|
+
}
|
|
3309
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3310
|
+
break;
|
|
3311
|
+
}
|
|
3312
|
+
reader.skip(tag & 7);
|
|
3313
|
+
}
|
|
3314
|
+
return message;
|
|
3315
|
+
},
|
|
3316
|
+
|
|
3317
|
+
fromJSON(object: any): GetLastSnapshotRequest {
|
|
3318
|
+
return { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(0) };
|
|
3319
|
+
},
|
|
3320
|
+
|
|
3321
|
+
toJSON(message: GetLastSnapshotRequest): unknown {
|
|
3322
|
+
const obj: any = {};
|
|
3323
|
+
if (message.key.length !== 0) {
|
|
3324
|
+
obj.key = base64FromBytes(message.key);
|
|
3325
|
+
}
|
|
3326
|
+
return obj;
|
|
3327
|
+
},
|
|
3328
|
+
|
|
3329
|
+
create(base?: DeepPartial<GetLastSnapshotRequest>): GetLastSnapshotRequest {
|
|
3330
|
+
return GetLastSnapshotRequest.fromPartial(base ?? {});
|
|
3331
|
+
},
|
|
3332
|
+
fromPartial(object: DeepPartial<GetLastSnapshotRequest>): GetLastSnapshotRequest {
|
|
3333
|
+
const message = createBaseGetLastSnapshotRequest();
|
|
3334
|
+
message.key = object.key ?? new Uint8Array(0);
|
|
3335
|
+
return message;
|
|
3336
|
+
},
|
|
3337
|
+
};
|
|
3338
|
+
|
|
3339
|
+
function createBaseGetLastSnapshotResponse(): GetLastSnapshotResponse {
|
|
3340
|
+
return { key: new Uint8Array(0), sequence: 0n, snapshot: undefined };
|
|
3341
|
+
}
|
|
3342
|
+
|
|
3343
|
+
export const GetLastSnapshotResponse: MessageFns<GetLastSnapshotResponse> = {
|
|
3344
|
+
encode(message: GetLastSnapshotResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
3345
|
+
if (message.key.length !== 0) {
|
|
3346
|
+
writer.uint32(10).bytes(message.key);
|
|
3347
|
+
}
|
|
3348
|
+
if (message.sequence !== 0n) {
|
|
3349
|
+
if (BigInt.asIntN(64, message.sequence) !== message.sequence) {
|
|
3350
|
+
throw new globalThis.Error("value provided for field message.sequence of type int64 too large");
|
|
3351
|
+
}
|
|
3352
|
+
writer.uint32(16).int64(message.sequence);
|
|
3353
|
+
}
|
|
3354
|
+
if (message.snapshot !== undefined) {
|
|
3355
|
+
Snapshot.encode(message.snapshot, writer.uint32(26).fork()).join();
|
|
3356
|
+
}
|
|
3357
|
+
return writer;
|
|
3358
|
+
},
|
|
3359
|
+
|
|
3360
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetLastSnapshotResponse {
|
|
3361
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3362
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
3363
|
+
const message = createBaseGetLastSnapshotResponse();
|
|
3364
|
+
while (reader.pos < end) {
|
|
3365
|
+
const tag = reader.uint32();
|
|
3366
|
+
switch (tag >>> 3) {
|
|
3367
|
+
case 1: {
|
|
3368
|
+
if (tag !== 10) {
|
|
3369
|
+
break;
|
|
3370
|
+
}
|
|
3371
|
+
|
|
3372
|
+
message.key = reader.bytes();
|
|
3373
|
+
continue;
|
|
3374
|
+
}
|
|
3375
|
+
case 2: {
|
|
3376
|
+
if (tag !== 16) {
|
|
3377
|
+
break;
|
|
3378
|
+
}
|
|
3379
|
+
|
|
3380
|
+
message.sequence = reader.int64() as bigint;
|
|
3381
|
+
continue;
|
|
3382
|
+
}
|
|
3383
|
+
case 3: {
|
|
3384
|
+
if (tag !== 26) {
|
|
3385
|
+
break;
|
|
3386
|
+
}
|
|
3387
|
+
|
|
3388
|
+
message.snapshot = Snapshot.decode(reader, reader.uint32());
|
|
3389
|
+
continue;
|
|
3390
|
+
}
|
|
3391
|
+
}
|
|
3392
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3393
|
+
break;
|
|
3394
|
+
}
|
|
3395
|
+
reader.skip(tag & 7);
|
|
3396
|
+
}
|
|
3397
|
+
return message;
|
|
3398
|
+
},
|
|
3399
|
+
|
|
3400
|
+
fromJSON(object: any): GetLastSnapshotResponse {
|
|
3401
|
+
return {
|
|
3402
|
+
key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(0),
|
|
3403
|
+
sequence: isSet(object.sequence) ? BigInt(object.sequence) : 0n,
|
|
3404
|
+
snapshot: isSet(object.snapshot) ? Snapshot.fromJSON(object.snapshot) : undefined,
|
|
3405
|
+
};
|
|
3406
|
+
},
|
|
3407
|
+
|
|
3408
|
+
toJSON(message: GetLastSnapshotResponse): unknown {
|
|
3409
|
+
const obj: any = {};
|
|
3410
|
+
if (message.key.length !== 0) {
|
|
3411
|
+
obj.key = base64FromBytes(message.key);
|
|
3412
|
+
}
|
|
3413
|
+
if (message.sequence !== 0n) {
|
|
3414
|
+
obj.sequence = message.sequence.toString();
|
|
3415
|
+
}
|
|
3416
|
+
if (message.snapshot !== undefined) {
|
|
3417
|
+
obj.snapshot = Snapshot.toJSON(message.snapshot);
|
|
3418
|
+
}
|
|
3419
|
+
return obj;
|
|
3420
|
+
},
|
|
3421
|
+
|
|
3422
|
+
create(base?: DeepPartial<GetLastSnapshotResponse>): GetLastSnapshotResponse {
|
|
3423
|
+
return GetLastSnapshotResponse.fromPartial(base ?? {});
|
|
3424
|
+
},
|
|
3425
|
+
fromPartial(object: DeepPartial<GetLastSnapshotResponse>): GetLastSnapshotResponse {
|
|
3426
|
+
const message = createBaseGetLastSnapshotResponse();
|
|
3427
|
+
message.key = object.key ?? new Uint8Array(0);
|
|
3428
|
+
message.sequence = object.sequence ?? 0n;
|
|
3429
|
+
message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
|
|
3430
|
+
? Snapshot.fromPartial(object.snapshot)
|
|
3431
|
+
: undefined;
|
|
3432
|
+
return message;
|
|
3433
|
+
},
|
|
3434
|
+
};
|
|
3435
|
+
|
|
3436
|
+
/** Service providing Event Store RPCs supporting DCB. */
|
|
3437
|
+
export type DcbEventStoreDefinition = typeof DcbEventStoreDefinition;
|
|
3438
|
+
export const DcbEventStoreDefinition = {
|
|
3439
|
+
name: "DcbEventStore",
|
|
3440
|
+
fullName: "io.axoniq.axonserver.grpc.event.dcb.DcbEventStore",
|
|
3441
|
+
methods: {
|
|
3442
|
+
/** Appends new events to the store. */
|
|
3443
|
+
append: {
|
|
3444
|
+
name: "Append",
|
|
3445
|
+
requestType: AppendEventsRequest as typeof AppendEventsRequest,
|
|
3446
|
+
requestStream: true,
|
|
3447
|
+
responseType: AppendEventsResponse as typeof AppendEventsResponse,
|
|
3448
|
+
responseStream: false,
|
|
3449
|
+
options: {},
|
|
3450
|
+
},
|
|
3451
|
+
/** Provides a finite stream of events based on the passed SourceEventsRequest. */
|
|
3452
|
+
source: {
|
|
3453
|
+
name: "Source",
|
|
3454
|
+
requestType: SourceEventsRequest as typeof SourceEventsRequest,
|
|
3455
|
+
requestStream: false,
|
|
3456
|
+
responseType: SourceEventsResponse as typeof SourceEventsResponse,
|
|
3457
|
+
responseStream: true,
|
|
3458
|
+
options: {},
|
|
3459
|
+
},
|
|
3460
|
+
/** Provides an infinite stream of events based on the passed StreamEventsRequest. */
|
|
3461
|
+
stream: {
|
|
3462
|
+
name: "Stream",
|
|
3463
|
+
requestType: StreamEventsRequest as typeof StreamEventsRequest,
|
|
3464
|
+
requestStream: false,
|
|
3465
|
+
responseType: StreamEventsResponse as typeof StreamEventsResponse,
|
|
3466
|
+
responseStream: true,
|
|
3467
|
+
options: {},
|
|
3468
|
+
},
|
|
3469
|
+
/** Gets the current _head_ of the Event Store. The _head_ points to the sequence of the first event to be appended. */
|
|
3470
|
+
getHead: {
|
|
3471
|
+
name: "GetHead",
|
|
3472
|
+
requestType: GetHeadRequest as typeof GetHeadRequest,
|
|
3473
|
+
requestStream: false,
|
|
3474
|
+
responseType: GetHeadResponse as typeof GetHeadResponse,
|
|
3475
|
+
responseStream: false,
|
|
3476
|
+
options: {},
|
|
3477
|
+
},
|
|
3478
|
+
/** Gets the current _tail_ of the Event Store. The _tail_ points to the sequence of the first event stored. */
|
|
3479
|
+
getTail: {
|
|
3480
|
+
name: "GetTail",
|
|
3481
|
+
requestType: GetTailRequest as typeof GetTailRequest,
|
|
3482
|
+
requestStream: false,
|
|
3483
|
+
responseType: GetTailResponse as typeof GetTailResponse,
|
|
3484
|
+
responseStream: false,
|
|
3485
|
+
options: {},
|
|
3486
|
+
},
|
|
3487
|
+
/**
|
|
3488
|
+
* Returns the lowest sequence of an event with a timestamp equal to or higher than the given timestamp. The HEAD is
|
|
3489
|
+
* returned if no events exist with a timestamp equal to or higher than the given timestamp.
|
|
3490
|
+
*
|
|
3491
|
+
* N.B. Axon Server does not assign timestamps to events. The timestamps used for fulfilling this RPC are timestamps
|
|
3492
|
+
* provided by the client. It could happen that there are events after the returned sequence that have an earlier
|
|
3493
|
+
* timestamp. Axon Server does not reject appends if timestamps of events are not monotonically increasing.
|
|
3494
|
+
*/
|
|
3495
|
+
getSequenceAt: {
|
|
3496
|
+
name: "GetSequenceAt",
|
|
3497
|
+
requestType: GetSequenceAtRequest as typeof GetSequenceAtRequest,
|
|
3498
|
+
requestStream: false,
|
|
3499
|
+
responseType: GetSequenceAtResponse as typeof GetSequenceAtResponse,
|
|
3500
|
+
responseStream: false,
|
|
3501
|
+
options: {},
|
|
3502
|
+
},
|
|
3503
|
+
/** Assigns tags to the event identified by its sequence. */
|
|
3504
|
+
addTags: {
|
|
3505
|
+
name: "AddTags",
|
|
3506
|
+
requestType: AddTagsRequest as typeof AddTagsRequest,
|
|
3507
|
+
requestStream: false,
|
|
3508
|
+
responseType: AddTagsResponse as typeof AddTagsResponse,
|
|
3509
|
+
responseStream: false,
|
|
3510
|
+
options: {},
|
|
3511
|
+
},
|
|
3512
|
+
/** Removes tags from the event identified by its sequence. */
|
|
3513
|
+
removeTags: {
|
|
3514
|
+
name: "RemoveTags",
|
|
3515
|
+
requestType: RemoveTagsRequest as typeof RemoveTagsRequest,
|
|
3516
|
+
requestStream: false,
|
|
3517
|
+
responseType: RemoveTagsResponse as typeof RemoveTagsResponse,
|
|
3518
|
+
responseStream: false,
|
|
3519
|
+
options: {},
|
|
3520
|
+
},
|
|
3521
|
+
/** Gets tags for the event identified by its sequence. */
|
|
3522
|
+
getTags: {
|
|
3523
|
+
name: "GetTags",
|
|
3524
|
+
requestType: GetTagsRequest as typeof GetTagsRequest,
|
|
3525
|
+
requestStream: false,
|
|
3526
|
+
responseType: GetTagsResponse as typeof GetTagsResponse,
|
|
3527
|
+
responseStream: false,
|
|
3528
|
+
options: {},
|
|
3529
|
+
},
|
|
3530
|
+
},
|
|
3531
|
+
} as const;
|
|
3532
|
+
|
|
3533
|
+
export interface DcbEventStoreServiceImplementation<CallContextExt = {}> {
|
|
3534
|
+
/** Appends new events to the store. */
|
|
3535
|
+
append(
|
|
3536
|
+
request: AsyncIterable<AppendEventsRequest>,
|
|
3537
|
+
context: CallContext & CallContextExt,
|
|
3538
|
+
): Promise<DeepPartial<AppendEventsResponse>>;
|
|
3539
|
+
/** Provides a finite stream of events based on the passed SourceEventsRequest. */
|
|
3540
|
+
source(
|
|
3541
|
+
request: SourceEventsRequest,
|
|
3542
|
+
context: CallContext & CallContextExt,
|
|
3543
|
+
): ServerStreamingMethodResult<DeepPartial<SourceEventsResponse>>;
|
|
3544
|
+
/** Provides an infinite stream of events based on the passed StreamEventsRequest. */
|
|
3545
|
+
stream(
|
|
3546
|
+
request: StreamEventsRequest,
|
|
3547
|
+
context: CallContext & CallContextExt,
|
|
3548
|
+
): ServerStreamingMethodResult<DeepPartial<StreamEventsResponse>>;
|
|
3549
|
+
/** Gets the current _head_ of the Event Store. The _head_ points to the sequence of the first event to be appended. */
|
|
3550
|
+
getHead(request: GetHeadRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetHeadResponse>>;
|
|
3551
|
+
/** Gets the current _tail_ of the Event Store. The _tail_ points to the sequence of the first event stored. */
|
|
3552
|
+
getTail(request: GetTailRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetTailResponse>>;
|
|
3553
|
+
/**
|
|
3554
|
+
* Returns the lowest sequence of an event with a timestamp equal to or higher than the given timestamp. The HEAD is
|
|
3555
|
+
* returned if no events exist with a timestamp equal to or higher than the given timestamp.
|
|
3556
|
+
*
|
|
3557
|
+
* N.B. Axon Server does not assign timestamps to events. The timestamps used for fulfilling this RPC are timestamps
|
|
3558
|
+
* provided by the client. It could happen that there are events after the returned sequence that have an earlier
|
|
3559
|
+
* timestamp. Axon Server does not reject appends if timestamps of events are not monotonically increasing.
|
|
3560
|
+
*/
|
|
3561
|
+
getSequenceAt(
|
|
3562
|
+
request: GetSequenceAtRequest,
|
|
3563
|
+
context: CallContext & CallContextExt,
|
|
3564
|
+
): Promise<DeepPartial<GetSequenceAtResponse>>;
|
|
3565
|
+
/** Assigns tags to the event identified by its sequence. */
|
|
3566
|
+
addTags(request: AddTagsRequest, context: CallContext & CallContextExt): Promise<DeepPartial<AddTagsResponse>>;
|
|
3567
|
+
/** Removes tags from the event identified by its sequence. */
|
|
3568
|
+
removeTags(
|
|
3569
|
+
request: RemoveTagsRequest,
|
|
3570
|
+
context: CallContext & CallContextExt,
|
|
3571
|
+
): Promise<DeepPartial<RemoveTagsResponse>>;
|
|
3572
|
+
/** Gets tags for the event identified by its sequence. */
|
|
3573
|
+
getTags(request: GetTagsRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetTagsResponse>>;
|
|
3574
|
+
}
|
|
3575
|
+
|
|
3576
|
+
export interface DcbEventStoreClient<CallOptionsExt = {}> {
|
|
3577
|
+
/** Appends new events to the store. */
|
|
3578
|
+
append(
|
|
3579
|
+
request: AsyncIterable<DeepPartial<AppendEventsRequest>>,
|
|
3580
|
+
options?: CallOptions & CallOptionsExt,
|
|
3581
|
+
): Promise<AppendEventsResponse>;
|
|
3582
|
+
/** Provides a finite stream of events based on the passed SourceEventsRequest. */
|
|
3583
|
+
source(
|
|
3584
|
+
request: DeepPartial<SourceEventsRequest>,
|
|
3585
|
+
options?: CallOptions & CallOptionsExt,
|
|
3586
|
+
): AsyncIterable<SourceEventsResponse>;
|
|
3587
|
+
/** Provides an infinite stream of events based on the passed StreamEventsRequest. */
|
|
3588
|
+
stream(
|
|
3589
|
+
request: DeepPartial<StreamEventsRequest>,
|
|
3590
|
+
options?: CallOptions & CallOptionsExt,
|
|
3591
|
+
): AsyncIterable<StreamEventsResponse>;
|
|
3592
|
+
/** Gets the current _head_ of the Event Store. The _head_ points to the sequence of the first event to be appended. */
|
|
3593
|
+
getHead(request: DeepPartial<GetHeadRequest>, options?: CallOptions & CallOptionsExt): Promise<GetHeadResponse>;
|
|
3594
|
+
/** Gets the current _tail_ of the Event Store. The _tail_ points to the sequence of the first event stored. */
|
|
3595
|
+
getTail(request: DeepPartial<GetTailRequest>, options?: CallOptions & CallOptionsExt): Promise<GetTailResponse>;
|
|
3596
|
+
/**
|
|
3597
|
+
* Returns the lowest sequence of an event with a timestamp equal to or higher than the given timestamp. The HEAD is
|
|
3598
|
+
* returned if no events exist with a timestamp equal to or higher than the given timestamp.
|
|
3599
|
+
*
|
|
3600
|
+
* N.B. Axon Server does not assign timestamps to events. The timestamps used for fulfilling this RPC are timestamps
|
|
3601
|
+
* provided by the client. It could happen that there are events after the returned sequence that have an earlier
|
|
3602
|
+
* timestamp. Axon Server does not reject appends if timestamps of events are not monotonically increasing.
|
|
3603
|
+
*/
|
|
3604
|
+
getSequenceAt(
|
|
3605
|
+
request: DeepPartial<GetSequenceAtRequest>,
|
|
3606
|
+
options?: CallOptions & CallOptionsExt,
|
|
3607
|
+
): Promise<GetSequenceAtResponse>;
|
|
3608
|
+
/** Assigns tags to the event identified by its sequence. */
|
|
3609
|
+
addTags(request: DeepPartial<AddTagsRequest>, options?: CallOptions & CallOptionsExt): Promise<AddTagsResponse>;
|
|
3610
|
+
/** Removes tags from the event identified by its sequence. */
|
|
3611
|
+
removeTags(
|
|
3612
|
+
request: DeepPartial<RemoveTagsRequest>,
|
|
3613
|
+
options?: CallOptions & CallOptionsExt,
|
|
3614
|
+
): Promise<RemoveTagsResponse>;
|
|
3615
|
+
/** Gets tags for the event identified by its sequence. */
|
|
3616
|
+
getTags(request: DeepPartial<GetTagsRequest>, options?: CallOptions & CallOptionsExt): Promise<GetTagsResponse>;
|
|
3617
|
+
}
|
|
3618
|
+
|
|
3619
|
+
/** Service providing Snapshot Store RPCs. */
|
|
3620
|
+
export type DcbSnapshotStoreDefinition = typeof DcbSnapshotStoreDefinition;
|
|
3621
|
+
export const DcbSnapshotStoreDefinition = {
|
|
3622
|
+
name: "DcbSnapshotStore",
|
|
3623
|
+
fullName: "io.axoniq.axonserver.grpc.event.dcb.DcbSnapshotStore",
|
|
3624
|
+
methods: {
|
|
3625
|
+
/** Adds a snapshot to the snapshot store. */
|
|
3626
|
+
add: {
|
|
3627
|
+
name: "Add",
|
|
3628
|
+
requestType: AddSnapshotRequest as typeof AddSnapshotRequest,
|
|
3629
|
+
requestStream: false,
|
|
3630
|
+
responseType: AddSnapshotResponse as typeof AddSnapshotResponse,
|
|
3631
|
+
responseStream: false,
|
|
3632
|
+
options: {},
|
|
3633
|
+
},
|
|
3634
|
+
/** Deletes a snapshot from the snapshot store. */
|
|
3635
|
+
delete: {
|
|
3636
|
+
name: "Delete",
|
|
3637
|
+
requestType: DeleteSnapshotsRequest as typeof DeleteSnapshotsRequest,
|
|
3638
|
+
requestStream: false,
|
|
3639
|
+
responseType: DeleteSnapshotsResponse as typeof DeleteSnapshotsResponse,
|
|
3640
|
+
responseStream: false,
|
|
3641
|
+
options: {},
|
|
3642
|
+
},
|
|
3643
|
+
/** Retrieves snapshots from the snapshot store. */
|
|
3644
|
+
list: {
|
|
3645
|
+
name: "List",
|
|
3646
|
+
requestType: ListSnapshotsRequest as typeof ListSnapshotsRequest,
|
|
3647
|
+
requestStream: false,
|
|
3648
|
+
responseType: ListSnapshotsResponse as typeof ListSnapshotsResponse,
|
|
3649
|
+
responseStream: true,
|
|
3650
|
+
options: {},
|
|
3651
|
+
},
|
|
3652
|
+
/** Gets the latest snapshot based on the request from the snapshot store. */
|
|
3653
|
+
getLast: {
|
|
3654
|
+
name: "GetLast",
|
|
3655
|
+
requestType: GetLastSnapshotRequest as typeof GetLastSnapshotRequest,
|
|
3656
|
+
requestStream: false,
|
|
3657
|
+
responseType: GetLastSnapshotResponse as typeof GetLastSnapshotResponse,
|
|
3658
|
+
responseStream: false,
|
|
3659
|
+
options: {},
|
|
3660
|
+
},
|
|
3661
|
+
},
|
|
3662
|
+
} as const;
|
|
3663
|
+
|
|
3664
|
+
export interface DcbSnapshotStoreServiceImplementation<CallContextExt = {}> {
|
|
3665
|
+
/** Adds a snapshot to the snapshot store. */
|
|
3666
|
+
add(request: AddSnapshotRequest, context: CallContext & CallContextExt): Promise<DeepPartial<AddSnapshotResponse>>;
|
|
3667
|
+
/** Deletes a snapshot from the snapshot store. */
|
|
3668
|
+
delete(
|
|
3669
|
+
request: DeleteSnapshotsRequest,
|
|
3670
|
+
context: CallContext & CallContextExt,
|
|
3671
|
+
): Promise<DeepPartial<DeleteSnapshotsResponse>>;
|
|
3672
|
+
/** Retrieves snapshots from the snapshot store. */
|
|
3673
|
+
list(
|
|
3674
|
+
request: ListSnapshotsRequest,
|
|
3675
|
+
context: CallContext & CallContextExt,
|
|
3676
|
+
): ServerStreamingMethodResult<DeepPartial<ListSnapshotsResponse>>;
|
|
3677
|
+
/** Gets the latest snapshot based on the request from the snapshot store. */
|
|
3678
|
+
getLast(
|
|
3679
|
+
request: GetLastSnapshotRequest,
|
|
3680
|
+
context: CallContext & CallContextExt,
|
|
3681
|
+
): Promise<DeepPartial<GetLastSnapshotResponse>>;
|
|
3682
|
+
}
|
|
3683
|
+
|
|
3684
|
+
export interface DcbSnapshotStoreClient<CallOptionsExt = {}> {
|
|
3685
|
+
/** Adds a snapshot to the snapshot store. */
|
|
3686
|
+
add(request: DeepPartial<AddSnapshotRequest>, options?: CallOptions & CallOptionsExt): Promise<AddSnapshotResponse>;
|
|
3687
|
+
/** Deletes a snapshot from the snapshot store. */
|
|
3688
|
+
delete(
|
|
3689
|
+
request: DeepPartial<DeleteSnapshotsRequest>,
|
|
3690
|
+
options?: CallOptions & CallOptionsExt,
|
|
3691
|
+
): Promise<DeleteSnapshotsResponse>;
|
|
3692
|
+
/** Retrieves snapshots from the snapshot store. */
|
|
3693
|
+
list(
|
|
3694
|
+
request: DeepPartial<ListSnapshotsRequest>,
|
|
3695
|
+
options?: CallOptions & CallOptionsExt,
|
|
3696
|
+
): AsyncIterable<ListSnapshotsResponse>;
|
|
3697
|
+
/** Gets the latest snapshot based on the request from the snapshot store. */
|
|
3698
|
+
getLast(
|
|
3699
|
+
request: DeepPartial<GetLastSnapshotRequest>,
|
|
3700
|
+
options?: CallOptions & CallOptionsExt,
|
|
3701
|
+
): Promise<GetLastSnapshotResponse>;
|
|
3702
|
+
}
|
|
3703
|
+
|
|
3704
|
+
/** Service to use AxonServer as a provider of an EventScheduler */
|
|
3705
|
+
export type DcbEventSchedulerDefinition = typeof DcbEventSchedulerDefinition;
|
|
3706
|
+
export const DcbEventSchedulerDefinition = {
|
|
3707
|
+
name: "DcbEventScheduler",
|
|
3708
|
+
fullName: "io.axoniq.axonserver.grpc.event.dcb.DcbEventScheduler",
|
|
3709
|
+
methods: {
|
|
3710
|
+
/** Schedule the given event for publication at the given time}. The returned ScheduleToken can be used to reschedule or cancel the planned publication. */
|
|
3711
|
+
scheduleEvent: {
|
|
3712
|
+
name: "ScheduleEvent",
|
|
3713
|
+
requestType: ScheduleEventRequest as typeof ScheduleEventRequest,
|
|
3714
|
+
requestStream: false,
|
|
3715
|
+
responseType: ScheduleToken as typeof ScheduleToken,
|
|
3716
|
+
responseStream: false,
|
|
3717
|
+
options: {},
|
|
3718
|
+
},
|
|
3719
|
+
/** Reschedule a scheduled event and optionally replace it by a new event. */
|
|
3720
|
+
rescheduleEvent: {
|
|
3721
|
+
name: "RescheduleEvent",
|
|
3722
|
+
requestType: RescheduleEventRequest as typeof RescheduleEventRequest,
|
|
3723
|
+
requestStream: false,
|
|
3724
|
+
responseType: ScheduleToken as typeof ScheduleToken,
|
|
3725
|
+
responseStream: false,
|
|
3726
|
+
options: {},
|
|
3727
|
+
},
|
|
3728
|
+
/** Cancel the publication of a scheduled event. If the events has already been published, this method does nothing. */
|
|
3729
|
+
cancelScheduledEvent: {
|
|
3730
|
+
name: "CancelScheduledEvent",
|
|
3731
|
+
requestType: CancelScheduledEventRequest as typeof CancelScheduledEventRequest,
|
|
3732
|
+
requestStream: false,
|
|
3733
|
+
responseType: InstructionAck as typeof InstructionAck,
|
|
3734
|
+
responseStream: false,
|
|
3735
|
+
options: {},
|
|
3736
|
+
},
|
|
3737
|
+
},
|
|
3738
|
+
} as const;
|
|
3739
|
+
|
|
3740
|
+
export interface DcbEventSchedulerServiceImplementation<CallContextExt = {}> {
|
|
3741
|
+
/** Schedule the given event for publication at the given time}. The returned ScheduleToken can be used to reschedule or cancel the planned publication. */
|
|
3742
|
+
scheduleEvent(
|
|
3743
|
+
request: ScheduleEventRequest,
|
|
3744
|
+
context: CallContext & CallContextExt,
|
|
3745
|
+
): Promise<DeepPartial<ScheduleToken>>;
|
|
3746
|
+
/** Reschedule a scheduled event and optionally replace it by a new event. */
|
|
3747
|
+
rescheduleEvent(
|
|
3748
|
+
request: RescheduleEventRequest,
|
|
3749
|
+
context: CallContext & CallContextExt,
|
|
3750
|
+
): Promise<DeepPartial<ScheduleToken>>;
|
|
3751
|
+
/** Cancel the publication of a scheduled event. If the events has already been published, this method does nothing. */
|
|
3752
|
+
cancelScheduledEvent(
|
|
3753
|
+
request: CancelScheduledEventRequest,
|
|
3754
|
+
context: CallContext & CallContextExt,
|
|
3755
|
+
): Promise<DeepPartial<InstructionAck>>;
|
|
3756
|
+
}
|
|
3757
|
+
|
|
3758
|
+
export interface DcbEventSchedulerClient<CallOptionsExt = {}> {
|
|
3759
|
+
/** Schedule the given event for publication at the given time}. The returned ScheduleToken can be used to reschedule or cancel the planned publication. */
|
|
3760
|
+
scheduleEvent(
|
|
3761
|
+
request: DeepPartial<ScheduleEventRequest>,
|
|
3762
|
+
options?: CallOptions & CallOptionsExt,
|
|
3763
|
+
): Promise<ScheduleToken>;
|
|
3764
|
+
/** Reschedule a scheduled event and optionally replace it by a new event. */
|
|
3765
|
+
rescheduleEvent(
|
|
3766
|
+
request: DeepPartial<RescheduleEventRequest>,
|
|
3767
|
+
options?: CallOptions & CallOptionsExt,
|
|
3768
|
+
): Promise<ScheduleToken>;
|
|
3769
|
+
/** Cancel the publication of a scheduled event. If the events has already been published, this method does nothing. */
|
|
3770
|
+
cancelScheduledEvent(
|
|
3771
|
+
request: DeepPartial<CancelScheduledEventRequest>,
|
|
3772
|
+
options?: CallOptions & CallOptionsExt,
|
|
3773
|
+
): Promise<InstructionAck>;
|
|
3774
|
+
}
|
|
3775
|
+
|
|
3776
|
+
function bytesFromBase64(b64: string): Uint8Array {
|
|
3777
|
+
if ((globalThis as any).Buffer) {
|
|
3778
|
+
return Uint8Array.from((globalThis as any).Buffer.from(b64, "base64"));
|
|
3779
|
+
} else {
|
|
3780
|
+
const bin = globalThis.atob(b64);
|
|
3781
|
+
const arr = new Uint8Array(bin.length);
|
|
3782
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
3783
|
+
arr[i] = bin.charCodeAt(i);
|
|
3784
|
+
}
|
|
3785
|
+
return arr;
|
|
3786
|
+
}
|
|
3787
|
+
}
|
|
3788
|
+
|
|
3789
|
+
function base64FromBytes(arr: Uint8Array): string {
|
|
3790
|
+
if ((globalThis as any).Buffer) {
|
|
3791
|
+
return (globalThis as any).Buffer.from(arr).toString("base64");
|
|
3792
|
+
} else {
|
|
3793
|
+
const bin: string[] = [];
|
|
3794
|
+
arr.forEach((byte) => {
|
|
3795
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
3796
|
+
});
|
|
3797
|
+
return globalThis.btoa(bin.join(""));
|
|
3798
|
+
}
|
|
3799
|
+
}
|
|
3800
|
+
|
|
3801
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
3802
|
+
|
|
3803
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
3804
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
3805
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
3806
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
3807
|
+
: Partial<T>;
|
|
3808
|
+
|
|
3809
|
+
function isObject(value: any): boolean {
|
|
3810
|
+
return typeof value === "object" && value !== null;
|
|
3811
|
+
}
|
|
3812
|
+
|
|
3813
|
+
function isSet(value: any): boolean {
|
|
3814
|
+
return value !== null && value !== undefined;
|
|
3815
|
+
}
|
|
3816
|
+
|
|
3817
|
+
export type ServerStreamingMethodResult<Response> = { [Symbol.asyncIterator](): AsyncIterator<Response, void> };
|
|
3818
|
+
|
|
3819
|
+
export interface MessageFns<T> {
|
|
3820
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
3821
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
3822
|
+
fromJSON(object: any): T;
|
|
3823
|
+
toJSON(message: T): unknown;
|
|
3824
|
+
create(base?: DeepPartial<T>): T;
|
|
3825
|
+
fromPartial(object: DeepPartial<T>): T;
|
|
3826
|
+
}
|