@cratis/chronicle.contracts 19.110.1 → 19.111.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/cjs/generated/descriptorSet.js +1 -1
- package/dist/cjs/generated/descriptorSet.js.map +1 -1
- package/dist/cjs/generated/index.d.ts +2 -0
- package/dist/cjs/generated/index.d.ts.map +1 -1
- package/dist/cjs/generated/readmodellookups.d.ts +96 -0
- package/dist/cjs/generated/readmodellookups.d.ts.map +1 -0
- package/dist/cjs/generated/readmodellookups.js +707 -0
- package/dist/cjs/generated/readmodellookups.js.map +1 -0
- package/dist/cjs/index.js +12 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/generated/descriptorSet.js +1 -1
- package/dist/esm/generated/descriptorSet.js.map +1 -1
- package/dist/esm/generated/index.d.ts +2 -0
- package/dist/esm/generated/index.d.ts.map +1 -1
- package/dist/esm/generated/readmodellookups.d.ts +96 -0
- package/dist/esm/generated/readmodellookups.d.ts.map +1 -0
- package/dist/esm/generated/readmodellookups.js +696 -0
- package/dist/esm/generated/readmodellookups.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/generated/descriptorSet.js +1 -1
- package/dist/generated/descriptorSet.js.map +1 -1
- package/dist/generated/index.d.ts +2 -0
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +1 -0
- package/dist/generated/index.js.map +1 -1
- package/dist/generated/readmodellookups.d.ts +96 -0
- package/dist/generated/readmodellookups.d.ts.map +1 -0
- package/dist/generated/readmodellookups.js +695 -0
- package/dist/generated/readmodellookups.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/generated/descriptorSet.ts +1 -1
- package/generated/index.ts +3 -0
- package/generated/readmodellookups.ts +831 -0
- package/package.json +1 -1
|
@@ -0,0 +1,831 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.18.3
|
|
4
|
+
// protoc v5.28.3
|
|
5
|
+
// source: readmodellookups.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
import type { CallContext, CallOptions } from "nice-grpc-common";
|
|
10
|
+
import { Guid } from "./protobuf-net/bcl";
|
|
11
|
+
|
|
12
|
+
export const protobufPackage = "Cratis.Chronicle.Contracts.ReadModelLookups";
|
|
13
|
+
|
|
14
|
+
export const protobufFileName = "readmodellookups.proto";
|
|
15
|
+
|
|
16
|
+
export enum ReadModelLookupOutcome {
|
|
17
|
+
NotFound = 0,
|
|
18
|
+
Found = 1,
|
|
19
|
+
AmbiguousLegacyKey = 2,
|
|
20
|
+
KeyCollision = 3,
|
|
21
|
+
InvalidKey = 4,
|
|
22
|
+
NotSupported = 5,
|
|
23
|
+
UNRECOGNIZED = -1,
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function readModelLookupOutcomeFromJSON(object: any): ReadModelLookupOutcome {
|
|
27
|
+
switch (object) {
|
|
28
|
+
case 0:
|
|
29
|
+
case "NotFound":
|
|
30
|
+
return ReadModelLookupOutcome.NotFound;
|
|
31
|
+
case 1:
|
|
32
|
+
case "Found":
|
|
33
|
+
return ReadModelLookupOutcome.Found;
|
|
34
|
+
case 2:
|
|
35
|
+
case "AmbiguousLegacyKey":
|
|
36
|
+
return ReadModelLookupOutcome.AmbiguousLegacyKey;
|
|
37
|
+
case 3:
|
|
38
|
+
case "KeyCollision":
|
|
39
|
+
return ReadModelLookupOutcome.KeyCollision;
|
|
40
|
+
case 4:
|
|
41
|
+
case "InvalidKey":
|
|
42
|
+
return ReadModelLookupOutcome.InvalidKey;
|
|
43
|
+
case 5:
|
|
44
|
+
case "NotSupported":
|
|
45
|
+
return ReadModelLookupOutcome.NotSupported;
|
|
46
|
+
case -1:
|
|
47
|
+
case "UNRECOGNIZED":
|
|
48
|
+
default:
|
|
49
|
+
return ReadModelLookupOutcome.UNRECOGNIZED;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function readModelLookupOutcomeToJSON(object: ReadModelLookupOutcome): string {
|
|
54
|
+
switch (object) {
|
|
55
|
+
case ReadModelLookupOutcome.NotFound:
|
|
56
|
+
return "NotFound";
|
|
57
|
+
case ReadModelLookupOutcome.Found:
|
|
58
|
+
return "Found";
|
|
59
|
+
case ReadModelLookupOutcome.AmbiguousLegacyKey:
|
|
60
|
+
return "AmbiguousLegacyKey";
|
|
61
|
+
case ReadModelLookupOutcome.KeyCollision:
|
|
62
|
+
return "KeyCollision";
|
|
63
|
+
case ReadModelLookupOutcome.InvalidKey:
|
|
64
|
+
return "InvalidKey";
|
|
65
|
+
case ReadModelLookupOutcome.NotSupported:
|
|
66
|
+
return "NotSupported";
|
|
67
|
+
case ReadModelLookupOutcome.UNRECOGNIZED:
|
|
68
|
+
default:
|
|
69
|
+
return "UNRECOGNIZED";
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export enum ValidationResultSeverity {
|
|
74
|
+
Unknown = 0,
|
|
75
|
+
Information = 1,
|
|
76
|
+
Warning = 2,
|
|
77
|
+
Error = 3,
|
|
78
|
+
UNRECOGNIZED = -1,
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function validationResultSeverityFromJSON(object: any): ValidationResultSeverity {
|
|
82
|
+
switch (object) {
|
|
83
|
+
case 0:
|
|
84
|
+
case "Unknown":
|
|
85
|
+
return ValidationResultSeverity.Unknown;
|
|
86
|
+
case 1:
|
|
87
|
+
case "Information":
|
|
88
|
+
return ValidationResultSeverity.Information;
|
|
89
|
+
case 2:
|
|
90
|
+
case "Warning":
|
|
91
|
+
return ValidationResultSeverity.Warning;
|
|
92
|
+
case 3:
|
|
93
|
+
case "Error":
|
|
94
|
+
return ValidationResultSeverity.Error;
|
|
95
|
+
case -1:
|
|
96
|
+
case "UNRECOGNIZED":
|
|
97
|
+
default:
|
|
98
|
+
return ValidationResultSeverity.UNRECOGNIZED;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function validationResultSeverityToJSON(object: ValidationResultSeverity): string {
|
|
103
|
+
switch (object) {
|
|
104
|
+
case ValidationResultSeverity.Unknown:
|
|
105
|
+
return "Unknown";
|
|
106
|
+
case ValidationResultSeverity.Information:
|
|
107
|
+
return "Information";
|
|
108
|
+
case ValidationResultSeverity.Warning:
|
|
109
|
+
return "Warning";
|
|
110
|
+
case ValidationResultSeverity.Error:
|
|
111
|
+
return "Error";
|
|
112
|
+
case ValidationResultSeverity.UNRECOGNIZED:
|
|
113
|
+
default:
|
|
114
|
+
return "UNRECOGNIZED";
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface FindByCompositeKeyRequest {
|
|
119
|
+
EventStore: string;
|
|
120
|
+
Namespace: string;
|
|
121
|
+
ReadModel: string;
|
|
122
|
+
Parts: { [key: string]: string };
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface FindByCompositeKeyRequest_PartsEntry {
|
|
126
|
+
key: string;
|
|
127
|
+
value: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface QueryResultReadModelLookupResponse {
|
|
131
|
+
/** default value could not be applied: 00000000-0000-0000-0000-000000000000 */
|
|
132
|
+
CorrelationId: Guid | undefined;
|
|
133
|
+
IsAuthorized: boolean;
|
|
134
|
+
ValidationResults: ValidationResult[];
|
|
135
|
+
ExceptionMessages: string[];
|
|
136
|
+
ExceptionStackTrace: string;
|
|
137
|
+
Data: ReadModelLookupResponse | undefined;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface ReadModelLookupResponse {
|
|
141
|
+
Outcome: ReadModelLookupOutcome;
|
|
142
|
+
ReadModel: string;
|
|
143
|
+
LastHandledEventSequenceNumber: bigint;
|
|
144
|
+
Message: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface ValidationResult {
|
|
148
|
+
/** default value could not be applied: Error */
|
|
149
|
+
Severity: ValidationResultSeverity;
|
|
150
|
+
Message: string;
|
|
151
|
+
Members: string[];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function createBaseFindByCompositeKeyRequest(): FindByCompositeKeyRequest {
|
|
155
|
+
return { EventStore: "", Namespace: "", ReadModel: "", Parts: {} };
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export const FindByCompositeKeyRequest: MessageFns<FindByCompositeKeyRequest> = {
|
|
159
|
+
encode(message: FindByCompositeKeyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
160
|
+
if (message.EventStore !== "") {
|
|
161
|
+
writer.uint32(10).string(message.EventStore);
|
|
162
|
+
}
|
|
163
|
+
if (message.Namespace !== "") {
|
|
164
|
+
writer.uint32(18).string(message.Namespace);
|
|
165
|
+
}
|
|
166
|
+
if (message.ReadModel !== "") {
|
|
167
|
+
writer.uint32(26).string(message.ReadModel);
|
|
168
|
+
}
|
|
169
|
+
globalThis.Object.entries(message.Parts).forEach(([key, value]: [string, string]) => {
|
|
170
|
+
FindByCompositeKeyRequest_PartsEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join();
|
|
171
|
+
});
|
|
172
|
+
return writer;
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
decode(input: BinaryReader | Uint8Array, length?: number): FindByCompositeKeyRequest {
|
|
176
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
177
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
178
|
+
if (previousRecursionDepth >= 100) {
|
|
179
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
180
|
+
}
|
|
181
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
182
|
+
try {
|
|
183
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
184
|
+
const message = createBaseFindByCompositeKeyRequest();
|
|
185
|
+
while (reader.pos < end) {
|
|
186
|
+
const tag = reader.uint32();
|
|
187
|
+
switch (tag >>> 3) {
|
|
188
|
+
case 1: {
|
|
189
|
+
if (tag !== 10) {
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
message.EventStore = reader.string();
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
case 2: {
|
|
197
|
+
if (tag !== 18) {
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
message.Namespace = reader.string();
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
case 3: {
|
|
205
|
+
if (tag !== 26) {
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
message.ReadModel = reader.string();
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
case 4: {
|
|
213
|
+
if (tag !== 34) {
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const entry4 = FindByCompositeKeyRequest_PartsEntry.decode(reader, reader.uint32());
|
|
218
|
+
if (entry4.value !== undefined) {
|
|
219
|
+
message.Parts[entry4.key] = entry4.value;
|
|
220
|
+
}
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
reader.skip(tag & 7);
|
|
228
|
+
}
|
|
229
|
+
return message;
|
|
230
|
+
} finally {
|
|
231
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
|
|
235
|
+
fromJSON(object: any): FindByCompositeKeyRequest {
|
|
236
|
+
return {
|
|
237
|
+
EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
|
|
238
|
+
Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
|
|
239
|
+
ReadModel: isSet(object.ReadModel) ? globalThis.String(object.ReadModel) : "",
|
|
240
|
+
Parts: isObject(object.Parts)
|
|
241
|
+
? (globalThis.Object.entries(object.Parts) as [string, any][]).reduce(
|
|
242
|
+
(acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
|
243
|
+
globalThis.Object.defineProperty(acc, key, {
|
|
244
|
+
value: globalThis.String(value),
|
|
245
|
+
enumerable: true,
|
|
246
|
+
configurable: true,
|
|
247
|
+
writable: true,
|
|
248
|
+
});
|
|
249
|
+
return acc;
|
|
250
|
+
},
|
|
251
|
+
{},
|
|
252
|
+
)
|
|
253
|
+
: {},
|
|
254
|
+
};
|
|
255
|
+
},
|
|
256
|
+
|
|
257
|
+
toJSON(message: FindByCompositeKeyRequest): unknown {
|
|
258
|
+
const obj: any = {};
|
|
259
|
+
if (message.EventStore !== "") {
|
|
260
|
+
obj.EventStore = message.EventStore;
|
|
261
|
+
}
|
|
262
|
+
if (message.Namespace !== "") {
|
|
263
|
+
obj.Namespace = message.Namespace;
|
|
264
|
+
}
|
|
265
|
+
if (message.ReadModel !== "") {
|
|
266
|
+
obj.ReadModel = message.ReadModel;
|
|
267
|
+
}
|
|
268
|
+
if (message.Parts) {
|
|
269
|
+
const entries = globalThis.Object.entries(message.Parts) as [string, string][];
|
|
270
|
+
if (entries.length > 0) {
|
|
271
|
+
obj.Parts = {};
|
|
272
|
+
entries.forEach(([k, v]) => {
|
|
273
|
+
obj.Parts[k] = v;
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return obj;
|
|
278
|
+
},
|
|
279
|
+
|
|
280
|
+
create(base?: DeepPartial<FindByCompositeKeyRequest>): FindByCompositeKeyRequest {
|
|
281
|
+
return FindByCompositeKeyRequest.fromPartial(base ?? {});
|
|
282
|
+
},
|
|
283
|
+
fromPartial(object: DeepPartial<FindByCompositeKeyRequest>): FindByCompositeKeyRequest {
|
|
284
|
+
const message = createBaseFindByCompositeKeyRequest();
|
|
285
|
+
message.EventStore = object.EventStore ?? "";
|
|
286
|
+
message.Namespace = object.Namespace ?? "";
|
|
287
|
+
message.ReadModel = object.ReadModel ?? "";
|
|
288
|
+
message.Parts = (globalThis.Object.entries(object.Parts ?? {}) as [string, string][]).reduce(
|
|
289
|
+
(acc: { [key: string]: string }, [key, value]: [string, string]) => {
|
|
290
|
+
if (value !== undefined) {
|
|
291
|
+
acc[key] = globalThis.String(value);
|
|
292
|
+
}
|
|
293
|
+
return acc;
|
|
294
|
+
},
|
|
295
|
+
{},
|
|
296
|
+
);
|
|
297
|
+
return message;
|
|
298
|
+
},
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
function createBaseFindByCompositeKeyRequest_PartsEntry(): FindByCompositeKeyRequest_PartsEntry {
|
|
302
|
+
return { key: "", value: "" };
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export const FindByCompositeKeyRequest_PartsEntry: MessageFns<FindByCompositeKeyRequest_PartsEntry> = {
|
|
306
|
+
encode(message: FindByCompositeKeyRequest_PartsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
307
|
+
if (message.key !== "") {
|
|
308
|
+
writer.uint32(10).string(message.key);
|
|
309
|
+
}
|
|
310
|
+
if (message.value !== "") {
|
|
311
|
+
writer.uint32(18).string(message.value);
|
|
312
|
+
}
|
|
313
|
+
return writer;
|
|
314
|
+
},
|
|
315
|
+
|
|
316
|
+
decode(input: BinaryReader | Uint8Array, length?: number): FindByCompositeKeyRequest_PartsEntry {
|
|
317
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
318
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
319
|
+
if (previousRecursionDepth >= 100) {
|
|
320
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
321
|
+
}
|
|
322
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
323
|
+
try {
|
|
324
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
325
|
+
const message = createBaseFindByCompositeKeyRequest_PartsEntry();
|
|
326
|
+
while (reader.pos < end) {
|
|
327
|
+
const tag = reader.uint32();
|
|
328
|
+
switch (tag >>> 3) {
|
|
329
|
+
case 1: {
|
|
330
|
+
if (tag !== 10) {
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
message.key = reader.string();
|
|
335
|
+
continue;
|
|
336
|
+
}
|
|
337
|
+
case 2: {
|
|
338
|
+
if (tag !== 18) {
|
|
339
|
+
break;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
message.value = reader.string();
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
347
|
+
break;
|
|
348
|
+
}
|
|
349
|
+
reader.skip(tag & 7);
|
|
350
|
+
}
|
|
351
|
+
return message;
|
|
352
|
+
} finally {
|
|
353
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
|
|
357
|
+
fromJSON(object: any): FindByCompositeKeyRequest_PartsEntry {
|
|
358
|
+
return {
|
|
359
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
360
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
361
|
+
};
|
|
362
|
+
},
|
|
363
|
+
|
|
364
|
+
toJSON(message: FindByCompositeKeyRequest_PartsEntry): unknown {
|
|
365
|
+
const obj: any = {};
|
|
366
|
+
if (message.key !== "") {
|
|
367
|
+
obj.key = message.key;
|
|
368
|
+
}
|
|
369
|
+
if (message.value !== "") {
|
|
370
|
+
obj.value = message.value;
|
|
371
|
+
}
|
|
372
|
+
return obj;
|
|
373
|
+
},
|
|
374
|
+
|
|
375
|
+
create(base?: DeepPartial<FindByCompositeKeyRequest_PartsEntry>): FindByCompositeKeyRequest_PartsEntry {
|
|
376
|
+
return FindByCompositeKeyRequest_PartsEntry.fromPartial(base ?? {});
|
|
377
|
+
},
|
|
378
|
+
fromPartial(object: DeepPartial<FindByCompositeKeyRequest_PartsEntry>): FindByCompositeKeyRequest_PartsEntry {
|
|
379
|
+
const message = createBaseFindByCompositeKeyRequest_PartsEntry();
|
|
380
|
+
message.key = object.key ?? "";
|
|
381
|
+
message.value = object.value ?? "";
|
|
382
|
+
return message;
|
|
383
|
+
},
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
function createBaseQueryResultReadModelLookupResponse(): QueryResultReadModelLookupResponse {
|
|
387
|
+
return {
|
|
388
|
+
CorrelationId: undefined,
|
|
389
|
+
IsAuthorized: false,
|
|
390
|
+
ValidationResults: [],
|
|
391
|
+
ExceptionMessages: [],
|
|
392
|
+
ExceptionStackTrace: "",
|
|
393
|
+
Data: undefined,
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
export const QueryResultReadModelLookupResponse: MessageFns<QueryResultReadModelLookupResponse> = {
|
|
398
|
+
encode(message: QueryResultReadModelLookupResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
399
|
+
if (message.CorrelationId !== undefined) {
|
|
400
|
+
Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join();
|
|
401
|
+
}
|
|
402
|
+
if (message.IsAuthorized !== false) {
|
|
403
|
+
writer.uint32(16).bool(message.IsAuthorized);
|
|
404
|
+
}
|
|
405
|
+
for (const v of message.ValidationResults) {
|
|
406
|
+
ValidationResult.encode(v!, writer.uint32(26).fork()).join();
|
|
407
|
+
}
|
|
408
|
+
for (const v of message.ExceptionMessages) {
|
|
409
|
+
writer.uint32(34).string(v!);
|
|
410
|
+
}
|
|
411
|
+
if (message.ExceptionStackTrace !== "") {
|
|
412
|
+
writer.uint32(42).string(message.ExceptionStackTrace);
|
|
413
|
+
}
|
|
414
|
+
if (message.Data !== undefined) {
|
|
415
|
+
ReadModelLookupResponse.encode(message.Data, writer.uint32(50).fork()).join();
|
|
416
|
+
}
|
|
417
|
+
return writer;
|
|
418
|
+
},
|
|
419
|
+
|
|
420
|
+
decode(input: BinaryReader | Uint8Array, length?: number): QueryResultReadModelLookupResponse {
|
|
421
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
422
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
423
|
+
if (previousRecursionDepth >= 100) {
|
|
424
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
425
|
+
}
|
|
426
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
427
|
+
try {
|
|
428
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
429
|
+
const message = createBaseQueryResultReadModelLookupResponse();
|
|
430
|
+
while (reader.pos < end) {
|
|
431
|
+
const tag = reader.uint32();
|
|
432
|
+
switch (tag >>> 3) {
|
|
433
|
+
case 1: {
|
|
434
|
+
if (tag !== 10) {
|
|
435
|
+
break;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
message.CorrelationId = Guid.decode(reader, reader.uint32());
|
|
439
|
+
continue;
|
|
440
|
+
}
|
|
441
|
+
case 2: {
|
|
442
|
+
if (tag !== 16) {
|
|
443
|
+
break;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
message.IsAuthorized = reader.bool();
|
|
447
|
+
continue;
|
|
448
|
+
}
|
|
449
|
+
case 3: {
|
|
450
|
+
if (tag !== 26) {
|
|
451
|
+
break;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32()));
|
|
455
|
+
continue;
|
|
456
|
+
}
|
|
457
|
+
case 4: {
|
|
458
|
+
if (tag !== 34) {
|
|
459
|
+
break;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
message.ExceptionMessages.push(reader.string());
|
|
463
|
+
continue;
|
|
464
|
+
}
|
|
465
|
+
case 5: {
|
|
466
|
+
if (tag !== 42) {
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
message.ExceptionStackTrace = reader.string();
|
|
471
|
+
continue;
|
|
472
|
+
}
|
|
473
|
+
case 6: {
|
|
474
|
+
if (tag !== 50) {
|
|
475
|
+
break;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
message.Data = ReadModelLookupResponse.decode(reader, reader.uint32());
|
|
479
|
+
continue;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
483
|
+
break;
|
|
484
|
+
}
|
|
485
|
+
reader.skip(tag & 7);
|
|
486
|
+
}
|
|
487
|
+
return message;
|
|
488
|
+
} finally {
|
|
489
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
|
|
493
|
+
fromJSON(object: any): QueryResultReadModelLookupResponse {
|
|
494
|
+
return {
|
|
495
|
+
CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined,
|
|
496
|
+
IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false,
|
|
497
|
+
ValidationResults: globalThis.Array.isArray(object?.ValidationResults)
|
|
498
|
+
? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e))
|
|
499
|
+
: [],
|
|
500
|
+
ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages)
|
|
501
|
+
? object.ExceptionMessages.map((e: any) => globalThis.String(e))
|
|
502
|
+
: [],
|
|
503
|
+
ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "",
|
|
504
|
+
Data: isSet(object.Data) ? ReadModelLookupResponse.fromJSON(object.Data) : undefined,
|
|
505
|
+
};
|
|
506
|
+
},
|
|
507
|
+
|
|
508
|
+
toJSON(message: QueryResultReadModelLookupResponse): unknown {
|
|
509
|
+
const obj: any = {};
|
|
510
|
+
if (message.CorrelationId !== undefined) {
|
|
511
|
+
obj.CorrelationId = Guid.toJSON(message.CorrelationId);
|
|
512
|
+
}
|
|
513
|
+
if (message.IsAuthorized !== false) {
|
|
514
|
+
obj.IsAuthorized = message.IsAuthorized;
|
|
515
|
+
}
|
|
516
|
+
if (message.ValidationResults?.length) {
|
|
517
|
+
obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e));
|
|
518
|
+
}
|
|
519
|
+
if (message.ExceptionMessages?.length) {
|
|
520
|
+
obj.ExceptionMessages = message.ExceptionMessages;
|
|
521
|
+
}
|
|
522
|
+
if (message.ExceptionStackTrace !== "") {
|
|
523
|
+
obj.ExceptionStackTrace = message.ExceptionStackTrace;
|
|
524
|
+
}
|
|
525
|
+
if (message.Data !== undefined) {
|
|
526
|
+
obj.Data = ReadModelLookupResponse.toJSON(message.Data);
|
|
527
|
+
}
|
|
528
|
+
return obj;
|
|
529
|
+
},
|
|
530
|
+
|
|
531
|
+
create(base?: DeepPartial<QueryResultReadModelLookupResponse>): QueryResultReadModelLookupResponse {
|
|
532
|
+
return QueryResultReadModelLookupResponse.fromPartial(base ?? {});
|
|
533
|
+
},
|
|
534
|
+
fromPartial(object: DeepPartial<QueryResultReadModelLookupResponse>): QueryResultReadModelLookupResponse {
|
|
535
|
+
const message = createBaseQueryResultReadModelLookupResponse();
|
|
536
|
+
message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
|
|
537
|
+
? Guid.fromPartial(object.CorrelationId)
|
|
538
|
+
: undefined;
|
|
539
|
+
message.IsAuthorized = object.IsAuthorized ?? false;
|
|
540
|
+
message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || [];
|
|
541
|
+
message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || [];
|
|
542
|
+
message.ExceptionStackTrace = object.ExceptionStackTrace ?? "";
|
|
543
|
+
message.Data = (object.Data !== undefined && object.Data !== null)
|
|
544
|
+
? ReadModelLookupResponse.fromPartial(object.Data)
|
|
545
|
+
: undefined;
|
|
546
|
+
return message;
|
|
547
|
+
},
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
function createBaseReadModelLookupResponse(): ReadModelLookupResponse {
|
|
551
|
+
return { Outcome: 0, ReadModel: "", LastHandledEventSequenceNumber: 0n, Message: "" };
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
export const ReadModelLookupResponse: MessageFns<ReadModelLookupResponse> = {
|
|
555
|
+
encode(message: ReadModelLookupResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
556
|
+
if (message.Outcome !== 0) {
|
|
557
|
+
writer.uint32(8).int32(message.Outcome);
|
|
558
|
+
}
|
|
559
|
+
if (message.ReadModel !== "") {
|
|
560
|
+
writer.uint32(18).string(message.ReadModel);
|
|
561
|
+
}
|
|
562
|
+
if (message.LastHandledEventSequenceNumber !== 0n) {
|
|
563
|
+
if (BigInt.asUintN(64, message.LastHandledEventSequenceNumber) !== message.LastHandledEventSequenceNumber) {
|
|
564
|
+
throw new globalThis.Error(
|
|
565
|
+
"value provided for field message.LastHandledEventSequenceNumber of type uint64 too large",
|
|
566
|
+
);
|
|
567
|
+
}
|
|
568
|
+
writer.uint32(24).uint64(message.LastHandledEventSequenceNumber);
|
|
569
|
+
}
|
|
570
|
+
if (message.Message !== "") {
|
|
571
|
+
writer.uint32(34).string(message.Message);
|
|
572
|
+
}
|
|
573
|
+
return writer;
|
|
574
|
+
},
|
|
575
|
+
|
|
576
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ReadModelLookupResponse {
|
|
577
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
578
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
579
|
+
if (previousRecursionDepth >= 100) {
|
|
580
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
581
|
+
}
|
|
582
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
583
|
+
try {
|
|
584
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
585
|
+
const message = createBaseReadModelLookupResponse();
|
|
586
|
+
while (reader.pos < end) {
|
|
587
|
+
const tag = reader.uint32();
|
|
588
|
+
switch (tag >>> 3) {
|
|
589
|
+
case 1: {
|
|
590
|
+
if (tag !== 8) {
|
|
591
|
+
break;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
message.Outcome = reader.int32() as any;
|
|
595
|
+
continue;
|
|
596
|
+
}
|
|
597
|
+
case 2: {
|
|
598
|
+
if (tag !== 18) {
|
|
599
|
+
break;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
message.ReadModel = reader.string();
|
|
603
|
+
continue;
|
|
604
|
+
}
|
|
605
|
+
case 3: {
|
|
606
|
+
if (tag !== 24) {
|
|
607
|
+
break;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
message.LastHandledEventSequenceNumber = reader.uint64() as bigint;
|
|
611
|
+
continue;
|
|
612
|
+
}
|
|
613
|
+
case 4: {
|
|
614
|
+
if (tag !== 34) {
|
|
615
|
+
break;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
message.Message = reader.string();
|
|
619
|
+
continue;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
623
|
+
break;
|
|
624
|
+
}
|
|
625
|
+
reader.skip(tag & 7);
|
|
626
|
+
}
|
|
627
|
+
return message;
|
|
628
|
+
} finally {
|
|
629
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
630
|
+
}
|
|
631
|
+
},
|
|
632
|
+
|
|
633
|
+
fromJSON(object: any): ReadModelLookupResponse {
|
|
634
|
+
return {
|
|
635
|
+
Outcome: isSet(object.Outcome) ? readModelLookupOutcomeFromJSON(object.Outcome) : 0,
|
|
636
|
+
ReadModel: isSet(object.ReadModel) ? globalThis.String(object.ReadModel) : "",
|
|
637
|
+
LastHandledEventSequenceNumber: isSet(object.LastHandledEventSequenceNumber)
|
|
638
|
+
? BigInt(object.LastHandledEventSequenceNumber)
|
|
639
|
+
: 0n,
|
|
640
|
+
Message: isSet(object.Message) ? globalThis.String(object.Message) : "",
|
|
641
|
+
};
|
|
642
|
+
},
|
|
643
|
+
|
|
644
|
+
toJSON(message: ReadModelLookupResponse): unknown {
|
|
645
|
+
const obj: any = {};
|
|
646
|
+
if (message.Outcome !== 0) {
|
|
647
|
+
obj.Outcome = readModelLookupOutcomeToJSON(message.Outcome);
|
|
648
|
+
}
|
|
649
|
+
if (message.ReadModel !== "") {
|
|
650
|
+
obj.ReadModel = message.ReadModel;
|
|
651
|
+
}
|
|
652
|
+
if (message.LastHandledEventSequenceNumber !== 0n) {
|
|
653
|
+
obj.LastHandledEventSequenceNumber = message.LastHandledEventSequenceNumber.toString();
|
|
654
|
+
}
|
|
655
|
+
if (message.Message !== "") {
|
|
656
|
+
obj.Message = message.Message;
|
|
657
|
+
}
|
|
658
|
+
return obj;
|
|
659
|
+
},
|
|
660
|
+
|
|
661
|
+
create(base?: DeepPartial<ReadModelLookupResponse>): ReadModelLookupResponse {
|
|
662
|
+
return ReadModelLookupResponse.fromPartial(base ?? {});
|
|
663
|
+
},
|
|
664
|
+
fromPartial(object: DeepPartial<ReadModelLookupResponse>): ReadModelLookupResponse {
|
|
665
|
+
const message = createBaseReadModelLookupResponse();
|
|
666
|
+
message.Outcome = object.Outcome ?? 0;
|
|
667
|
+
message.ReadModel = object.ReadModel ?? "";
|
|
668
|
+
message.LastHandledEventSequenceNumber =
|
|
669
|
+
(object.LastHandledEventSequenceNumber !== undefined && object.LastHandledEventSequenceNumber !== null)
|
|
670
|
+
? BigInt(object.LastHandledEventSequenceNumber)
|
|
671
|
+
: 0n;
|
|
672
|
+
message.Message = object.Message ?? "";
|
|
673
|
+
return message;
|
|
674
|
+
},
|
|
675
|
+
};
|
|
676
|
+
|
|
677
|
+
function createBaseValidationResult(): ValidationResult {
|
|
678
|
+
return { Severity: 0, Message: "", Members: [] };
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
export const ValidationResult: MessageFns<ValidationResult> = {
|
|
682
|
+
encode(message: ValidationResult, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
683
|
+
if (message.Severity !== 0) {
|
|
684
|
+
writer.uint32(8).int32(message.Severity);
|
|
685
|
+
}
|
|
686
|
+
if (message.Message !== "") {
|
|
687
|
+
writer.uint32(18).string(message.Message);
|
|
688
|
+
}
|
|
689
|
+
for (const v of message.Members) {
|
|
690
|
+
writer.uint32(26).string(v!);
|
|
691
|
+
}
|
|
692
|
+
return writer;
|
|
693
|
+
},
|
|
694
|
+
|
|
695
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ValidationResult {
|
|
696
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
697
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
698
|
+
if (previousRecursionDepth >= 100) {
|
|
699
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
700
|
+
}
|
|
701
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
702
|
+
try {
|
|
703
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
704
|
+
const message = createBaseValidationResult();
|
|
705
|
+
while (reader.pos < end) {
|
|
706
|
+
const tag = reader.uint32();
|
|
707
|
+
switch (tag >>> 3) {
|
|
708
|
+
case 1: {
|
|
709
|
+
if (tag !== 8) {
|
|
710
|
+
break;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
message.Severity = reader.int32() as any;
|
|
714
|
+
continue;
|
|
715
|
+
}
|
|
716
|
+
case 2: {
|
|
717
|
+
if (tag !== 18) {
|
|
718
|
+
break;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
message.Message = reader.string();
|
|
722
|
+
continue;
|
|
723
|
+
}
|
|
724
|
+
case 3: {
|
|
725
|
+
if (tag !== 26) {
|
|
726
|
+
break;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
message.Members.push(reader.string());
|
|
730
|
+
continue;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
734
|
+
break;
|
|
735
|
+
}
|
|
736
|
+
reader.skip(tag & 7);
|
|
737
|
+
}
|
|
738
|
+
return message;
|
|
739
|
+
} finally {
|
|
740
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
741
|
+
}
|
|
742
|
+
},
|
|
743
|
+
|
|
744
|
+
fromJSON(object: any): ValidationResult {
|
|
745
|
+
return {
|
|
746
|
+
Severity: isSet(object.Severity) ? validationResultSeverityFromJSON(object.Severity) : 0,
|
|
747
|
+
Message: isSet(object.Message) ? globalThis.String(object.Message) : "",
|
|
748
|
+
Members: globalThis.Array.isArray(object?.Members) ? object.Members.map((e: any) => globalThis.String(e)) : [],
|
|
749
|
+
};
|
|
750
|
+
},
|
|
751
|
+
|
|
752
|
+
toJSON(message: ValidationResult): unknown {
|
|
753
|
+
const obj: any = {};
|
|
754
|
+
if (message.Severity !== 0) {
|
|
755
|
+
obj.Severity = validationResultSeverityToJSON(message.Severity);
|
|
756
|
+
}
|
|
757
|
+
if (message.Message !== "") {
|
|
758
|
+
obj.Message = message.Message;
|
|
759
|
+
}
|
|
760
|
+
if (message.Members?.length) {
|
|
761
|
+
obj.Members = message.Members;
|
|
762
|
+
}
|
|
763
|
+
return obj;
|
|
764
|
+
},
|
|
765
|
+
|
|
766
|
+
create(base?: DeepPartial<ValidationResult>): ValidationResult {
|
|
767
|
+
return ValidationResult.fromPartial(base ?? {});
|
|
768
|
+
},
|
|
769
|
+
fromPartial(object: DeepPartial<ValidationResult>): ValidationResult {
|
|
770
|
+
const message = createBaseValidationResult();
|
|
771
|
+
message.Severity = object.Severity ?? 0;
|
|
772
|
+
message.Message = object.Message ?? "";
|
|
773
|
+
message.Members = object.Members?.map((e) => e) || [];
|
|
774
|
+
return message;
|
|
775
|
+
},
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
export type ReadModelLookupsDefinition = typeof ReadModelLookupsDefinition;
|
|
779
|
+
export const ReadModelLookupsDefinition = {
|
|
780
|
+
name: "ReadModelLookups",
|
|
781
|
+
fullName: "Cratis.Chronicle.Contracts.ReadModelLookups.ReadModelLookups",
|
|
782
|
+
methods: {
|
|
783
|
+
findByCompositeKey: {
|
|
784
|
+
name: "FindByCompositeKey",
|
|
785
|
+
requestType: FindByCompositeKeyRequest as typeof FindByCompositeKeyRequest,
|
|
786
|
+
requestStream: false,
|
|
787
|
+
responseType: QueryResultReadModelLookupResponse as typeof QueryResultReadModelLookupResponse,
|
|
788
|
+
responseStream: false,
|
|
789
|
+
options: {},
|
|
790
|
+
},
|
|
791
|
+
},
|
|
792
|
+
} as const;
|
|
793
|
+
|
|
794
|
+
export interface ReadModelLookupsServiceImplementation<CallContextExt = {}> {
|
|
795
|
+
findByCompositeKey(
|
|
796
|
+
request: FindByCompositeKeyRequest,
|
|
797
|
+
context: CallContext & CallContextExt,
|
|
798
|
+
): Promise<DeepPartial<QueryResultReadModelLookupResponse>>;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
export interface ReadModelLookupsClient<CallOptionsExt = {}> {
|
|
802
|
+
findByCompositeKey(
|
|
803
|
+
request: DeepPartial<FindByCompositeKeyRequest>,
|
|
804
|
+
options?: CallOptions & CallOptionsExt,
|
|
805
|
+
): Promise<QueryResultReadModelLookupResponse>;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
809
|
+
|
|
810
|
+
export type DeepPartial<T> = T extends bigint ? string | number | bigint
|
|
811
|
+
: T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
812
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
813
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
814
|
+
: Partial<T>;
|
|
815
|
+
|
|
816
|
+
function isObject(value: any): boolean {
|
|
817
|
+
return typeof value === "object" && value !== null;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
function isSet(value: any): boolean {
|
|
821
|
+
return value !== null && value !== undefined;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
export interface MessageFns<T> {
|
|
825
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
826
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
827
|
+
fromJSON(object: any): T;
|
|
828
|
+
toJSON(message: T): unknown;
|
|
829
|
+
create(base?: DeepPartial<T>): T;
|
|
830
|
+
fromPartial(object: DeepPartial<T>): T;
|
|
831
|
+
}
|