// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.12.4 // protoc v5.28.3 // source: readmodelexplorer.proto /* eslint-disable */ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import type { CallContext, CallOptions } from "nice-grpc-common"; import { Guid } from "./protobuf-net/bcl"; export const protobufPackage = "Cratis.Chronicle.Contracts.ReadModelExplorer"; export enum EventObservationState { None = 0, Initial = 1, Replay = 2, UNRECOGNIZED = -1, } export function eventObservationStateFromJSON(object: any): EventObservationState { switch (object) { case 0: case "None": return EventObservationState.None; case 1: case "Initial": return EventObservationState.Initial; case 2: case "Replay": return EventObservationState.Replay; case -1: case "UNRECOGNIZED": default: return EventObservationState.UNRECOGNIZED; } } export function eventObservationStateToJSON(object: EventObservationState): string { switch (object) { case EventObservationState.None: return "None"; case EventObservationState.Initial: return "Initial"; case EventObservationState.Replay: return "Replay"; case EventObservationState.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum ValidationResultSeverity { Unknown = 0, Information = 1, Warning = 2, Error = 3, UNRECOGNIZED = -1, } export function validationResultSeverityFromJSON(object: any): ValidationResultSeverity { switch (object) { case 0: case "Unknown": return ValidationResultSeverity.Unknown; case 1: case "Information": return ValidationResultSeverity.Information; case 2: case "Warning": return ValidationResultSeverity.Warning; case 3: case "Error": return ValidationResultSeverity.Error; case -1: case "UNRECOGNIZED": default: return ValidationResultSeverity.UNRECOGNIZED; } } export function validationResultSeverityToJSON(object: ValidationResultSeverity): string { switch (object) { case ValidationResultSeverity.Unknown: return "Unknown"; case ValidationResultSeverity.Information: return "Information"; case ValidationResultSeverity.Warning: return "Warning"; case ValidationResultSeverity.Error: return "Error"; case ValidationResultSeverity.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export interface AllSnapshotsForReadModelRequest { EventStore: string; Namespace: string; ReadModel: string; ReadModelKey: string; EventSequenceId: string; Grouping: string; } export interface Causation { Occurred: SerializableDateTimeOffset | undefined; Type: string; Properties: { [key: string]: string }; } export interface Causation_PropertiesEntry { key: string; value: string; } export interface Event { Context: EventContext | undefined; Content: string; } export interface EventContext { EventType: EventType | undefined; EventSourceType: string; EventSourceId: string; SequenceNumber: bigint; EventStreamType: string; EventStreamId: string; Occurred: | SerializableDateTimeOffset | undefined; /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; Causation: Causation[]; CausedBy: Identity | undefined; Tags: string[]; Hash: string; ObservationState: EventObservationState; Subject: string; } export interface EventType { Id: string; Generation: number; Tombstone: boolean; } export interface Identity { Subject: string; Name: string; UserName: string; OnBehalfOf: Identity | undefined; } export interface QueryResultIEnumerableReadModelSnapshotResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: ReadModelSnapshotResponse[]; } export interface ReadModelSnapshotResponse { Occurred: | SerializableDateTimeOffset | undefined; /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; Instance: string; Events: Event[]; } /** Represents a DateTimeOffset value as an ISO 8601 string (e.g., "2024-01-15T12:30:00.0000000+02:00"). */ export interface SerializableDateTimeOffset { Value: string; } export interface ValidationResult { /** default value could not be applied: Error */ Severity: ValidationResultSeverity; Message: string; Members: string[]; } function createBaseAllSnapshotsForReadModelRequest(): AllSnapshotsForReadModelRequest { return { EventStore: "", Namespace: "", ReadModel: "", ReadModelKey: "", EventSequenceId: "", Grouping: "" }; } export const AllSnapshotsForReadModelRequest: MessageFns = { encode(message: AllSnapshotsForReadModelRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.ReadModel !== "") { writer.uint32(26).string(message.ReadModel); } if (message.ReadModelKey !== "") { writer.uint32(34).string(message.ReadModelKey); } if (message.EventSequenceId !== "") { writer.uint32(42).string(message.EventSequenceId); } if (message.Grouping !== "") { writer.uint32(50).string(message.Grouping); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AllSnapshotsForReadModelRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAllSnapshotsForReadModelRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.ReadModel = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.ReadModelKey = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.EventSequenceId = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.Grouping = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): AllSnapshotsForReadModelRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", ReadModel: isSet(object.ReadModel) ? globalThis.String(object.ReadModel) : "", ReadModelKey: isSet(object.ReadModelKey) ? globalThis.String(object.ReadModelKey) : "", EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", Grouping: isSet(object.Grouping) ? globalThis.String(object.Grouping) : "", }; }, toJSON(message: AllSnapshotsForReadModelRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.ReadModel !== "") { obj.ReadModel = message.ReadModel; } if (message.ReadModelKey !== "") { obj.ReadModelKey = message.ReadModelKey; } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.Grouping !== "") { obj.Grouping = message.Grouping; } return obj; }, create(base?: DeepPartial): AllSnapshotsForReadModelRequest { return AllSnapshotsForReadModelRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AllSnapshotsForReadModelRequest { const message = createBaseAllSnapshotsForReadModelRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.ReadModel = object.ReadModel ?? ""; message.ReadModelKey = object.ReadModelKey ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.Grouping = object.Grouping ?? ""; return message; }, }; function createBaseCausation(): Causation { return { Occurred: undefined, Type: "", Properties: {} }; } export const Causation: MessageFns = { encode(message: Causation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(10).fork()).join(); } if (message.Type !== "") { writer.uint32(18).string(message.Type); } globalThis.Object.entries(message.Properties).forEach(([key, value]: [string, string]) => { Causation_PropertiesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join(); }); return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Causation { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCausation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.Type = reader.string(); continue; } case 3: { if (tag !== 26) { break; } const entry3 = Causation_PropertiesEntry.decode(reader, reader.uint32()); if (entry3.value !== undefined) { message.Properties[entry3.key] = entry3.value; } continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): Causation { return { Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined, Type: isSet(object.Type) ? globalThis.String(object.Type) : "", Properties: isObject(object.Properties) ? (globalThis.Object.entries(object.Properties) as [string, any][]).reduce( (acc: { [key: string]: string }, [key, value]: [string, any]) => { globalThis.Object.defineProperty(acc, key, { value: globalThis.String(value), enumerable: true, configurable: true, writable: true, }); return acc; }, {}, ) : {}, }; }, toJSON(message: Causation): unknown { const obj: any = {}; if (message.Occurred !== undefined) { obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred); } if (message.Type !== "") { obj.Type = message.Type; } if (message.Properties) { const entries = globalThis.Object.entries(message.Properties) as [string, string][]; if (entries.length > 0) { obj.Properties = {}; entries.forEach(([k, v]) => { obj.Properties[k] = v; }); } } return obj; }, create(base?: DeepPartial): Causation { return Causation.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): Causation { const message = createBaseCausation(); message.Occurred = (object.Occurred !== undefined && object.Occurred !== null) ? SerializableDateTimeOffset.fromPartial(object.Occurred) : undefined; message.Type = object.Type ?? ""; message.Properties = (globalThis.Object.entries(object.Properties ?? {}) as [string, string][]).reduce( (acc: { [key: string]: string }, [key, value]: [string, string]) => { if (value !== undefined) { acc[key] = globalThis.String(value); } return acc; }, {}, ); return message; }, }; function createBaseCausation_PropertiesEntry(): Causation_PropertiesEntry { return { key: "", value: "" }; } export const Causation_PropertiesEntry: MessageFns = { encode(message: Causation_PropertiesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.key !== "") { writer.uint32(10).string(message.key); } if (message.value !== "") { writer.uint32(18).string(message.value); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Causation_PropertiesEntry { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCausation_PropertiesEntry(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.key = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.value = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): Causation_PropertiesEntry { return { key: isSet(object.key) ? globalThis.String(object.key) : "", value: isSet(object.value) ? globalThis.String(object.value) : "", }; }, toJSON(message: Causation_PropertiesEntry): unknown { const obj: any = {}; if (message.key !== "") { obj.key = message.key; } if (message.value !== "") { obj.value = message.value; } return obj; }, create(base?: DeepPartial): Causation_PropertiesEntry { return Causation_PropertiesEntry.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): Causation_PropertiesEntry { const message = createBaseCausation_PropertiesEntry(); message.key = object.key ?? ""; message.value = object.value ?? ""; return message; }, }; function createBaseEvent(): Event { return { Context: undefined, Content: "" }; } export const Event: MessageFns = { encode(message: Event, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Context !== undefined) { EventContext.encode(message.Context, writer.uint32(10).fork()).join(); } if (message.Content !== "") { writer.uint32(18).string(message.Content); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Event { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEvent(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Context = EventContext.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.Content = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): Event { return { Context: isSet(object.Context) ? EventContext.fromJSON(object.Context) : undefined, Content: isSet(object.Content) ? globalThis.String(object.Content) : "", }; }, toJSON(message: Event): unknown { const obj: any = {}; if (message.Context !== undefined) { obj.Context = EventContext.toJSON(message.Context); } if (message.Content !== "") { obj.Content = message.Content; } return obj; }, create(base?: DeepPartial): Event { return Event.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): Event { const message = createBaseEvent(); message.Context = (object.Context !== undefined && object.Context !== null) ? EventContext.fromPartial(object.Context) : undefined; message.Content = object.Content ?? ""; return message; }, }; function createBaseEventContext(): EventContext { return { EventType: undefined, EventSourceType: "", EventSourceId: "", SequenceNumber: 0n, EventStreamType: "", EventStreamId: "", Occurred: undefined, CorrelationId: undefined, Causation: [], CausedBy: undefined, Tags: [], Hash: "", ObservationState: 0, Subject: "", }; } export const EventContext: MessageFns = { encode(message: EventContext, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventType !== undefined) { EventType.encode(message.EventType, writer.uint32(10).fork()).join(); } if (message.EventSourceType !== "") { writer.uint32(18).string(message.EventSourceType); } if (message.EventSourceId !== "") { writer.uint32(26).string(message.EventSourceId); } if (message.SequenceNumber !== 0n) { if (BigInt.asUintN(64, message.SequenceNumber) !== message.SequenceNumber) { throw new globalThis.Error("value provided for field message.SequenceNumber of type uint64 too large"); } writer.uint32(32).uint64(message.SequenceNumber); } if (message.EventStreamType !== "") { writer.uint32(42).string(message.EventStreamType); } if (message.EventStreamId !== "") { writer.uint32(50).string(message.EventStreamId); } if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(58).fork()).join(); } if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(66).fork()).join(); } for (const v of message.Causation) { Causation.encode(v!, writer.uint32(74).fork()).join(); } if (message.CausedBy !== undefined) { Identity.encode(message.CausedBy, writer.uint32(82).fork()).join(); } for (const v of message.Tags) { writer.uint32(90).string(v!); } if (message.Hash !== "") { writer.uint32(98).string(message.Hash); } if (message.ObservationState !== 0) { writer.uint32(104).int32(message.ObservationState); } if (message.Subject !== "") { writer.uint32(114).string(message.Subject); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventContext { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventContext(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventType = EventType.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.EventSourceType = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.EventSourceId = reader.string(); continue; } case 4: { if (tag !== 32) { break; } message.SequenceNumber = reader.uint64() as bigint; continue; } case 5: { if (tag !== 42) { break; } message.EventStreamType = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.EventStreamId = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 8: { if (tag !== 66) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 9: { if (tag !== 74) { break; } message.Causation.push(Causation.decode(reader, reader.uint32())); continue; } case 10: { if (tag !== 82) { break; } message.CausedBy = Identity.decode(reader, reader.uint32()); continue; } case 11: { if (tag !== 90) { break; } message.Tags.push(reader.string()); continue; } case 12: { if (tag !== 98) { break; } message.Hash = reader.string(); continue; } case 13: { if (tag !== 104) { break; } message.ObservationState = reader.int32() as any; continue; } case 14: { if (tag !== 114) { break; } message.Subject = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): EventContext { return { EventType: isSet(object.EventType) ? EventType.fromJSON(object.EventType) : undefined, EventSourceType: isSet(object.EventSourceType) ? globalThis.String(object.EventSourceType) : "", EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", SequenceNumber: isSet(object.SequenceNumber) ? BigInt(object.SequenceNumber) : 0n, EventStreamType: isSet(object.EventStreamType) ? globalThis.String(object.EventStreamType) : "", EventStreamId: isSet(object.EventStreamId) ? globalThis.String(object.EventStreamId) : "", Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined, CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, Causation: globalThis.Array.isArray(object?.Causation) ? object.Causation.map((e: any) => Causation.fromJSON(e)) : [], CausedBy: isSet(object.CausedBy) ? Identity.fromJSON(object.CausedBy) : undefined, Tags: globalThis.Array.isArray(object?.Tags) ? object.Tags.map((e: any) => globalThis.String(e)) : [], Hash: isSet(object.Hash) ? globalThis.String(object.Hash) : "", ObservationState: isSet(object.ObservationState) ? eventObservationStateFromJSON(object.ObservationState) : 0, Subject: isSet(object.Subject) ? globalThis.String(object.Subject) : "", }; }, toJSON(message: EventContext): unknown { const obj: any = {}; if (message.EventType !== undefined) { obj.EventType = EventType.toJSON(message.EventType); } if (message.EventSourceType !== "") { obj.EventSourceType = message.EventSourceType; } if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.SequenceNumber !== 0n) { obj.SequenceNumber = message.SequenceNumber.toString(); } if (message.EventStreamType !== "") { obj.EventStreamType = message.EventStreamType; } if (message.EventStreamId !== "") { obj.EventStreamId = message.EventStreamId; } if (message.Occurred !== undefined) { obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred); } if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.Causation?.length) { obj.Causation = message.Causation.map((e) => Causation.toJSON(e)); } if (message.CausedBy !== undefined) { obj.CausedBy = Identity.toJSON(message.CausedBy); } if (message.Tags?.length) { obj.Tags = message.Tags; } if (message.Hash !== "") { obj.Hash = message.Hash; } if (message.ObservationState !== 0) { obj.ObservationState = eventObservationStateToJSON(message.ObservationState); } if (message.Subject !== "") { obj.Subject = message.Subject; } return obj; }, create(base?: DeepPartial): EventContext { return EventContext.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EventContext { const message = createBaseEventContext(); message.EventType = (object.EventType !== undefined && object.EventType !== null) ? EventType.fromPartial(object.EventType) : undefined; message.EventSourceType = object.EventSourceType ?? ""; message.EventSourceId = object.EventSourceId ?? ""; message.SequenceNumber = (object.SequenceNumber !== undefined && object.SequenceNumber !== null) ? BigInt(object.SequenceNumber) : 0n; message.EventStreamType = object.EventStreamType ?? ""; message.EventStreamId = object.EventStreamId ?? ""; message.Occurred = (object.Occurred !== undefined && object.Occurred !== null) ? SerializableDateTimeOffset.fromPartial(object.Occurred) : undefined; message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.Causation = object.Causation?.map((e) => Causation.fromPartial(e)) || []; message.CausedBy = (object.CausedBy !== undefined && object.CausedBy !== null) ? Identity.fromPartial(object.CausedBy) : undefined; message.Tags = object.Tags?.map((e) => e) || []; message.Hash = object.Hash ?? ""; message.ObservationState = object.ObservationState ?? 0; message.Subject = object.Subject ?? ""; return message; }, }; function createBaseEventType(): EventType { return { Id: "", Generation: 0, Tombstone: false }; } export const EventType: MessageFns = { encode(message: EventType, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== "") { writer.uint32(10).string(message.Id); } if (message.Generation !== 0) { writer.uint32(16).uint32(message.Generation); } if (message.Tombstone !== false) { writer.uint32(24).bool(message.Tombstone); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventType { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventType(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Id = reader.string(); continue; } case 2: { if (tag !== 16) { break; } message.Generation = reader.uint32(); continue; } case 3: { if (tag !== 24) { break; } message.Tombstone = reader.bool(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): EventType { return { Id: isSet(object.Id) ? globalThis.String(object.Id) : "", Generation: isSet(object.Generation) ? globalThis.Number(object.Generation) : 0, Tombstone: isSet(object.Tombstone) ? globalThis.Boolean(object.Tombstone) : false, }; }, toJSON(message: EventType): unknown { const obj: any = {}; if (message.Id !== "") { obj.Id = message.Id; } if (message.Generation !== 0) { obj.Generation = Math.round(message.Generation); } if (message.Tombstone !== false) { obj.Tombstone = message.Tombstone; } return obj; }, create(base?: DeepPartial): EventType { return EventType.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EventType { const message = createBaseEventType(); message.Id = object.Id ?? ""; message.Generation = object.Generation ?? 0; message.Tombstone = object.Tombstone ?? false; return message; }, }; function createBaseIdentity(): Identity { return { Subject: "", Name: "", UserName: "", OnBehalfOf: undefined }; } export const Identity: MessageFns = { encode(message: Identity, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Subject !== "") { writer.uint32(10).string(message.Subject); } if (message.Name !== "") { writer.uint32(18).string(message.Name); } if (message.UserName !== "") { writer.uint32(26).string(message.UserName); } if (message.OnBehalfOf !== undefined) { Identity.encode(message.OnBehalfOf, writer.uint32(34).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Identity { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIdentity(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Subject = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Name = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.UserName = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.OnBehalfOf = Identity.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): Identity { return { Subject: isSet(object.Subject) ? globalThis.String(object.Subject) : "", Name: isSet(object.Name) ? globalThis.String(object.Name) : "", UserName: isSet(object.UserName) ? globalThis.String(object.UserName) : "", OnBehalfOf: isSet(object.OnBehalfOf) ? Identity.fromJSON(object.OnBehalfOf) : undefined, }; }, toJSON(message: Identity): unknown { const obj: any = {}; if (message.Subject !== "") { obj.Subject = message.Subject; } if (message.Name !== "") { obj.Name = message.Name; } if (message.UserName !== "") { obj.UserName = message.UserName; } if (message.OnBehalfOf !== undefined) { obj.OnBehalfOf = Identity.toJSON(message.OnBehalfOf); } return obj; }, create(base?: DeepPartial): Identity { return Identity.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): Identity { const message = createBaseIdentity(); message.Subject = object.Subject ?? ""; message.Name = object.Name ?? ""; message.UserName = object.UserName ?? ""; message.OnBehalfOf = (object.OnBehalfOf !== undefined && object.OnBehalfOf !== null) ? Identity.fromPartial(object.OnBehalfOf) : undefined; return message; }, }; function createBaseQueryResultIEnumerableReadModelSnapshotResponse(): QueryResultIEnumerableReadModelSnapshotResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: [], }; } export const QueryResultIEnumerableReadModelSnapshotResponse: MessageFns< QueryResultIEnumerableReadModelSnapshotResponse > = { encode( message: QueryResultIEnumerableReadModelSnapshotResponse, writer: BinaryWriter = new BinaryWriter(), ): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } for (const v of message.Data) { ReadModelSnapshotResponse.encode(v!, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultIEnumerableReadModelSnapshotResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryResultIEnumerableReadModelSnapshotResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.IsAuthorized = reader.bool(); continue; } case 3: { if (tag !== 26) { break; } message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { break; } message.ExceptionMessages.push(reader.string()); continue; } case 5: { if (tag !== 42) { break; } message.ExceptionStackTrace = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.Data.push(ReadModelSnapshotResponse.decode(reader, reader.uint32())); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): QueryResultIEnumerableReadModelSnapshotResponse { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", Data: globalThis.Array.isArray(object?.Data) ? object.Data.map((e: any) => ReadModelSnapshotResponse.fromJSON(e)) : [], }; }, toJSON(message: QueryResultIEnumerableReadModelSnapshotResponse): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.Data?.length) { obj.Data = message.Data.map((e) => ReadModelSnapshotResponse.toJSON(e)); } return obj; }, create( base?: DeepPartial, ): QueryResultIEnumerableReadModelSnapshotResponse { return QueryResultIEnumerableReadModelSnapshotResponse.fromPartial(base ?? {}); }, fromPartial( object: DeepPartial, ): QueryResultIEnumerableReadModelSnapshotResponse { const message = createBaseQueryResultIEnumerableReadModelSnapshotResponse(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.Data = object.Data?.map((e) => ReadModelSnapshotResponse.fromPartial(e)) || []; return message; }, }; function createBaseReadModelSnapshotResponse(): ReadModelSnapshotResponse { return { Occurred: undefined, CorrelationId: undefined, Instance: "", Events: [] }; } export const ReadModelSnapshotResponse: MessageFns = { encode(message: ReadModelSnapshotResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(10).fork()).join(); } if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(18).fork()).join(); } if (message.Instance !== "") { writer.uint32(26).string(message.Instance); } for (const v of message.Events) { Event.encode(v!, writer.uint32(34).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ReadModelSnapshotResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseReadModelSnapshotResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 3: { if (tag !== 26) { break; } message.Instance = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.Events.push(Event.decode(reader, reader.uint32())); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): ReadModelSnapshotResponse { return { Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined, CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, Instance: isSet(object.Instance) ? globalThis.String(object.Instance) : "", Events: globalThis.Array.isArray(object?.Events) ? object.Events.map((e: any) => Event.fromJSON(e)) : [], }; }, toJSON(message: ReadModelSnapshotResponse): unknown { const obj: any = {}; if (message.Occurred !== undefined) { obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred); } if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.Instance !== "") { obj.Instance = message.Instance; } if (message.Events?.length) { obj.Events = message.Events.map((e) => Event.toJSON(e)); } return obj; }, create(base?: DeepPartial): ReadModelSnapshotResponse { return ReadModelSnapshotResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ReadModelSnapshotResponse { const message = createBaseReadModelSnapshotResponse(); message.Occurred = (object.Occurred !== undefined && object.Occurred !== null) ? SerializableDateTimeOffset.fromPartial(object.Occurred) : undefined; message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.Instance = object.Instance ?? ""; message.Events = object.Events?.map((e) => Event.fromPartial(e)) || []; return message; }, }; function createBaseSerializableDateTimeOffset(): SerializableDateTimeOffset { return { Value: "" }; } export const SerializableDateTimeOffset: MessageFns = { encode(message: SerializableDateTimeOffset, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Value !== "") { writer.uint32(10).string(message.Value); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): SerializableDateTimeOffset { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSerializableDateTimeOffset(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Value = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): SerializableDateTimeOffset { return { Value: isSet(object.Value) ? globalThis.String(object.Value) : "" }; }, toJSON(message: SerializableDateTimeOffset): unknown { const obj: any = {}; if (message.Value !== "") { obj.Value = message.Value; } return obj; }, create(base?: DeepPartial): SerializableDateTimeOffset { return SerializableDateTimeOffset.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): SerializableDateTimeOffset { const message = createBaseSerializableDateTimeOffset(); message.Value = object.Value ?? ""; return message; }, }; function createBaseValidationResult(): ValidationResult { return { Severity: 0, Message: "", Members: [] }; } export const ValidationResult: MessageFns = { encode(message: ValidationResult, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Severity !== 0) { writer.uint32(8).int32(message.Severity); } if (message.Message !== "") { writer.uint32(18).string(message.Message); } for (const v of message.Members) { writer.uint32(26).string(v!); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ValidationResult { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidationResult(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.Severity = reader.int32() as any; continue; } case 2: { if (tag !== 18) { break; } message.Message = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Members.push(reader.string()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): ValidationResult { return { Severity: isSet(object.Severity) ? validationResultSeverityFromJSON(object.Severity) : 0, Message: isSet(object.Message) ? globalThis.String(object.Message) : "", Members: globalThis.Array.isArray(object?.Members) ? object.Members.map((e: any) => globalThis.String(e)) : [], }; }, toJSON(message: ValidationResult): unknown { const obj: any = {}; if (message.Severity !== 0) { obj.Severity = validationResultSeverityToJSON(message.Severity); } if (message.Message !== "") { obj.Message = message.Message; } if (message.Members?.length) { obj.Members = message.Members; } return obj; }, create(base?: DeepPartial): ValidationResult { return ValidationResult.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ValidationResult { const message = createBaseValidationResult(); message.Severity = object.Severity ?? 0; message.Message = object.Message ?? ""; message.Members = object.Members?.map((e) => e) || []; return message; }, }; export type ReadModelExplorerDefinition = typeof ReadModelExplorerDefinition; export const ReadModelExplorerDefinition = { name: "ReadModelExplorer", fullName: "Cratis.Chronicle.Contracts.ReadModelExplorer.ReadModelExplorer", methods: { allSnapshotsForReadModel: { name: "AllSnapshotsForReadModel", requestType: AllSnapshotsForReadModelRequest as typeof AllSnapshotsForReadModelRequest, requestStream: false, responseType: QueryResultIEnumerableReadModelSnapshotResponse as typeof QueryResultIEnumerableReadModelSnapshotResponse, responseStream: false, options: {}, }, }, } as const; export interface ReadModelExplorerServiceImplementation { allSnapshotsForReadModel( request: AllSnapshotsForReadModelRequest, context: CallContext & CallContextExt, ): Promise>; } export interface ReadModelExplorerClient { allSnapshotsForReadModel( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; } type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; export type DeepPartial = T extends bigint ? string | number | bigint : T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; function isObject(value: any): boolean { return typeof value === "object" && value !== null; } function isSet(value: any): boolean { return value !== null && value !== undefined; } export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; fromJSON(object: any): T; toJSON(message: T): unknown; create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; }