// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.12.4 // protoc v5.28.3 // source: seeding.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.Seeding"; 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 AddSeedEntryRequest { EventStore: string; Namespace: string; EventSourceId: string; EventTypeId: string; Content: string; IsGlobal: boolean; } export interface CommandResult { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; AuthorizationFailureReason: string; } export interface EventSourceSeedEntries { EventSourceId: string; Entries: SeedingEntry[]; } export interface EventTypeSeedEntries { EventTypeId: string; Entries: SeedingEntry[]; } export interface GetGlobalSeedDataRequest { EventStore: string; } export interface GetNamespaceSeedDataRequest { EventStore: string; Namespace: string; } export interface NamespacedSeedEntries { Namespace: string; ByEventType: EventTypeSeedEntries[]; ByEventSource: EventSourceSeedEntries[]; } export interface QueryResultSeedDataResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: SeedDataResponse | undefined; } export interface SeedDataResponse { ByEventType: EventTypeSeedEntries[]; ByEventSource: EventSourceSeedEntries[]; } export interface SeedEventsRequest { EventStore: string; GlobalByEventType: EventTypeSeedEntries[]; GlobalByEventSource: EventSourceSeedEntries[]; NamespacedEntries: NamespacedSeedEntries[]; } export interface SeedingEntry { EventSourceId: string; EventTypeId: string; Content: string; Tags: string[]; } export interface ValidationResult { /** default value could not be applied: Error */ Severity: ValidationResultSeverity; Message: string; Members: string[]; } function createBaseAddSeedEntryRequest(): AddSeedEntryRequest { return { EventStore: "", Namespace: "", EventSourceId: "", EventTypeId: "", Content: "", IsGlobal: false }; } export const AddSeedEntryRequest: MessageFns = { encode(message: AddSeedEntryRequest, 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.EventSourceId !== "") { writer.uint32(26).string(message.EventSourceId); } if (message.EventTypeId !== "") { writer.uint32(34).string(message.EventTypeId); } if (message.Content !== "") { writer.uint32(42).string(message.Content); } if (message.IsGlobal !== false) { writer.uint32(48).bool(message.IsGlobal); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AddSeedEntryRequest { 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 = createBaseAddSeedEntryRequest(); 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.EventSourceId = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.EventTypeId = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.Content = reader.string(); continue; } case 6: { if (tag !== 48) { break; } message.IsGlobal = 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): AddSeedEntryRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", EventTypeId: isSet(object.EventTypeId) ? globalThis.String(object.EventTypeId) : "", Content: isSet(object.Content) ? globalThis.String(object.Content) : "", IsGlobal: isSet(object.IsGlobal) ? globalThis.Boolean(object.IsGlobal) : false, }; }, toJSON(message: AddSeedEntryRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.EventTypeId !== "") { obj.EventTypeId = message.EventTypeId; } if (message.Content !== "") { obj.Content = message.Content; } if (message.IsGlobal !== false) { obj.IsGlobal = message.IsGlobal; } return obj; }, create(base?: DeepPartial): AddSeedEntryRequest { return AddSeedEntryRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AddSeedEntryRequest { const message = createBaseAddSeedEntryRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSourceId = object.EventSourceId ?? ""; message.EventTypeId = object.EventTypeId ?? ""; message.Content = object.Content ?? ""; message.IsGlobal = object.IsGlobal ?? false; return message; }, }; function createBaseCommandResult(): CommandResult { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", }; } export const CommandResult: MessageFns = { encode(message: CommandResult, 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); } if (message.AuthorizationFailureReason !== "") { writer.uint32(50).string(message.AuthorizationFailureReason); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResult { 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 = createBaseCommandResult(); 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.AuthorizationFailureReason = 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): CommandResult { 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) : "", AuthorizationFailureReason: isSet(object.AuthorizationFailureReason) ? globalThis.String(object.AuthorizationFailureReason) : "", }; }, toJSON(message: CommandResult): 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.AuthorizationFailureReason !== "") { obj.AuthorizationFailureReason = message.AuthorizationFailureReason; } return obj; }, create(base?: DeepPartial): CommandResult { return CommandResult.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CommandResult { const message = createBaseCommandResult(); 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.AuthorizationFailureReason = object.AuthorizationFailureReason ?? ""; return message; }, }; function createBaseEventSourceSeedEntries(): EventSourceSeedEntries { return { EventSourceId: "", Entries: [] }; } export const EventSourceSeedEntries: MessageFns = { encode(message: EventSourceSeedEntries, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventSourceId !== "") { writer.uint32(10).string(message.EventSourceId); } for (const v of message.Entries) { SeedingEntry.encode(v!, writer.uint32(18).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventSourceSeedEntries { 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 = createBaseEventSourceSeedEntries(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventSourceId = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Entries.push(SeedingEntry.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): EventSourceSeedEntries { return { EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", Entries: globalThis.Array.isArray(object?.Entries) ? object.Entries.map((e: any) => SeedingEntry.fromJSON(e)) : [], }; }, toJSON(message: EventSourceSeedEntries): unknown { const obj: any = {}; if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.Entries?.length) { obj.Entries = message.Entries.map((e) => SeedingEntry.toJSON(e)); } return obj; }, create(base?: DeepPartial): EventSourceSeedEntries { return EventSourceSeedEntries.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EventSourceSeedEntries { const message = createBaseEventSourceSeedEntries(); message.EventSourceId = object.EventSourceId ?? ""; message.Entries = object.Entries?.map((e) => SeedingEntry.fromPartial(e)) || []; return message; }, }; function createBaseEventTypeSeedEntries(): EventTypeSeedEntries { return { EventTypeId: "", Entries: [] }; } export const EventTypeSeedEntries: MessageFns = { encode(message: EventTypeSeedEntries, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventTypeId !== "") { writer.uint32(10).string(message.EventTypeId); } for (const v of message.Entries) { SeedingEntry.encode(v!, writer.uint32(18).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventTypeSeedEntries { 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 = createBaseEventTypeSeedEntries(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventTypeId = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Entries.push(SeedingEntry.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): EventTypeSeedEntries { return { EventTypeId: isSet(object.EventTypeId) ? globalThis.String(object.EventTypeId) : "", Entries: globalThis.Array.isArray(object?.Entries) ? object.Entries.map((e: any) => SeedingEntry.fromJSON(e)) : [], }; }, toJSON(message: EventTypeSeedEntries): unknown { const obj: any = {}; if (message.EventTypeId !== "") { obj.EventTypeId = message.EventTypeId; } if (message.Entries?.length) { obj.Entries = message.Entries.map((e) => SeedingEntry.toJSON(e)); } return obj; }, create(base?: DeepPartial): EventTypeSeedEntries { return EventTypeSeedEntries.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EventTypeSeedEntries { const message = createBaseEventTypeSeedEntries(); message.EventTypeId = object.EventTypeId ?? ""; message.Entries = object.Entries?.map((e) => SeedingEntry.fromPartial(e)) || []; return message; }, }; function createBaseGetGlobalSeedDataRequest(): GetGlobalSeedDataRequest { return { EventStore: "" }; } export const GetGlobalSeedDataRequest: MessageFns = { encode(message: GetGlobalSeedDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GetGlobalSeedDataRequest { 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 = createBaseGetGlobalSeedDataRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = 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): GetGlobalSeedDataRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "" }; }, toJSON(message: GetGlobalSeedDataRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } return obj; }, create(base?: DeepPartial): GetGlobalSeedDataRequest { return GetGlobalSeedDataRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): GetGlobalSeedDataRequest { const message = createBaseGetGlobalSeedDataRequest(); message.EventStore = object.EventStore ?? ""; return message; }, }; function createBaseGetNamespaceSeedDataRequest(): GetNamespaceSeedDataRequest { return { EventStore: "", Namespace: "" }; } export const GetNamespaceSeedDataRequest: MessageFns = { encode(message: GetNamespaceSeedDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GetNamespaceSeedDataRequest { 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 = createBaseGetNamespaceSeedDataRequest(); 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; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): GetNamespaceSeedDataRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", }; }, toJSON(message: GetNamespaceSeedDataRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } return obj; }, create(base?: DeepPartial): GetNamespaceSeedDataRequest { return GetNamespaceSeedDataRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): GetNamespaceSeedDataRequest { const message = createBaseGetNamespaceSeedDataRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; return message; }, }; function createBaseNamespacedSeedEntries(): NamespacedSeedEntries { return { Namespace: "", ByEventType: [], ByEventSource: [] }; } export const NamespacedSeedEntries: MessageFns = { encode(message: NamespacedSeedEntries, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Namespace !== "") { writer.uint32(10).string(message.Namespace); } for (const v of message.ByEventType) { EventTypeSeedEntries.encode(v!, writer.uint32(18).fork()).join(); } for (const v of message.ByEventSource) { EventSourceSeedEntries.encode(v!, writer.uint32(26).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): NamespacedSeedEntries { 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 = createBaseNamespacedSeedEntries(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Namespace = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.ByEventType.push(EventTypeSeedEntries.decode(reader, reader.uint32())); continue; } case 3: { if (tag !== 26) { break; } message.ByEventSource.push(EventSourceSeedEntries.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): NamespacedSeedEntries { return { Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", ByEventType: globalThis.Array.isArray(object?.ByEventType) ? object.ByEventType.map((e: any) => EventTypeSeedEntries.fromJSON(e)) : [], ByEventSource: globalThis.Array.isArray(object?.ByEventSource) ? object.ByEventSource.map((e: any) => EventSourceSeedEntries.fromJSON(e)) : [], }; }, toJSON(message: NamespacedSeedEntries): unknown { const obj: any = {}; if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.ByEventType?.length) { obj.ByEventType = message.ByEventType.map((e) => EventTypeSeedEntries.toJSON(e)); } if (message.ByEventSource?.length) { obj.ByEventSource = message.ByEventSource.map((e) => EventSourceSeedEntries.toJSON(e)); } return obj; }, create(base?: DeepPartial): NamespacedSeedEntries { return NamespacedSeedEntries.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): NamespacedSeedEntries { const message = createBaseNamespacedSeedEntries(); message.Namespace = object.Namespace ?? ""; message.ByEventType = object.ByEventType?.map((e) => EventTypeSeedEntries.fromPartial(e)) || []; message.ByEventSource = object.ByEventSource?.map((e) => EventSourceSeedEntries.fromPartial(e)) || []; return message; }, }; function createBaseQueryResultSeedDataResponse(): QueryResultSeedDataResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: undefined, }; } export const QueryResultSeedDataResponse: MessageFns = { encode(message: QueryResultSeedDataResponse, 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); } if (message.Data !== undefined) { SeedDataResponse.encode(message.Data, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultSeedDataResponse { 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 = createBaseQueryResultSeedDataResponse(); 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 = SeedDataResponse.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): QueryResultSeedDataResponse { 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: isSet(object.Data) ? SeedDataResponse.fromJSON(object.Data) : undefined, }; }, toJSON(message: QueryResultSeedDataResponse): 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 !== undefined) { obj.Data = SeedDataResponse.toJSON(message.Data); } return obj; }, create(base?: DeepPartial): QueryResultSeedDataResponse { return QueryResultSeedDataResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): QueryResultSeedDataResponse { const message = createBaseQueryResultSeedDataResponse(); 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 !== undefined && object.Data !== null) ? SeedDataResponse.fromPartial(object.Data) : undefined; return message; }, }; function createBaseSeedDataResponse(): SeedDataResponse { return { ByEventType: [], ByEventSource: [] }; } export const SeedDataResponse: MessageFns = { encode(message: SeedDataResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { for (const v of message.ByEventType) { EventTypeSeedEntries.encode(v!, writer.uint32(10).fork()).join(); } for (const v of message.ByEventSource) { EventSourceSeedEntries.encode(v!, writer.uint32(18).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): SeedDataResponse { 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 = createBaseSeedDataResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.ByEventType.push(EventTypeSeedEntries.decode(reader, reader.uint32())); continue; } case 2: { if (tag !== 18) { break; } message.ByEventSource.push(EventSourceSeedEntries.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): SeedDataResponse { return { ByEventType: globalThis.Array.isArray(object?.ByEventType) ? object.ByEventType.map((e: any) => EventTypeSeedEntries.fromJSON(e)) : [], ByEventSource: globalThis.Array.isArray(object?.ByEventSource) ? object.ByEventSource.map((e: any) => EventSourceSeedEntries.fromJSON(e)) : [], }; }, toJSON(message: SeedDataResponse): unknown { const obj: any = {}; if (message.ByEventType?.length) { obj.ByEventType = message.ByEventType.map((e) => EventTypeSeedEntries.toJSON(e)); } if (message.ByEventSource?.length) { obj.ByEventSource = message.ByEventSource.map((e) => EventSourceSeedEntries.toJSON(e)); } return obj; }, create(base?: DeepPartial): SeedDataResponse { return SeedDataResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): SeedDataResponse { const message = createBaseSeedDataResponse(); message.ByEventType = object.ByEventType?.map((e) => EventTypeSeedEntries.fromPartial(e)) || []; message.ByEventSource = object.ByEventSource?.map((e) => EventSourceSeedEntries.fromPartial(e)) || []; return message; }, }; function createBaseSeedEventsRequest(): SeedEventsRequest { return { EventStore: "", GlobalByEventType: [], GlobalByEventSource: [], NamespacedEntries: [] }; } export const SeedEventsRequest: MessageFns = { encode(message: SeedEventsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } for (const v of message.GlobalByEventType) { EventTypeSeedEntries.encode(v!, writer.uint32(18).fork()).join(); } for (const v of message.GlobalByEventSource) { EventSourceSeedEntries.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.NamespacedEntries) { NamespacedSeedEntries.encode(v!, writer.uint32(34).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): SeedEventsRequest { 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 = createBaseSeedEventsRequest(); 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.GlobalByEventType.push(EventTypeSeedEntries.decode(reader, reader.uint32())); continue; } case 3: { if (tag !== 26) { break; } message.GlobalByEventSource.push(EventSourceSeedEntries.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { break; } message.NamespacedEntries.push(NamespacedSeedEntries.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): SeedEventsRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", GlobalByEventType: globalThis.Array.isArray(object?.GlobalByEventType) ? object.GlobalByEventType.map((e: any) => EventTypeSeedEntries.fromJSON(e)) : [], GlobalByEventSource: globalThis.Array.isArray(object?.GlobalByEventSource) ? object.GlobalByEventSource.map((e: any) => EventSourceSeedEntries.fromJSON(e)) : [], NamespacedEntries: globalThis.Array.isArray(object?.NamespacedEntries) ? object.NamespacedEntries.map((e: any) => NamespacedSeedEntries.fromJSON(e)) : [], }; }, toJSON(message: SeedEventsRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.GlobalByEventType?.length) { obj.GlobalByEventType = message.GlobalByEventType.map((e) => EventTypeSeedEntries.toJSON(e)); } if (message.GlobalByEventSource?.length) { obj.GlobalByEventSource = message.GlobalByEventSource.map((e) => EventSourceSeedEntries.toJSON(e)); } if (message.NamespacedEntries?.length) { obj.NamespacedEntries = message.NamespacedEntries.map((e) => NamespacedSeedEntries.toJSON(e)); } return obj; }, create(base?: DeepPartial): SeedEventsRequest { return SeedEventsRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): SeedEventsRequest { const message = createBaseSeedEventsRequest(); message.EventStore = object.EventStore ?? ""; message.GlobalByEventType = object.GlobalByEventType?.map((e) => EventTypeSeedEntries.fromPartial(e)) || []; message.GlobalByEventSource = object.GlobalByEventSource?.map((e) => EventSourceSeedEntries.fromPartial(e)) || []; message.NamespacedEntries = object.NamespacedEntries?.map((e) => NamespacedSeedEntries.fromPartial(e)) || []; return message; }, }; function createBaseSeedingEntry(): SeedingEntry { return { EventSourceId: "", EventTypeId: "", Content: "", Tags: [] }; } export const SeedingEntry: MessageFns = { encode(message: SeedingEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventSourceId !== "") { writer.uint32(10).string(message.EventSourceId); } if (message.EventTypeId !== "") { writer.uint32(18).string(message.EventTypeId); } if (message.Content !== "") { writer.uint32(26).string(message.Content); } for (const v of message.Tags) { writer.uint32(34).string(v!); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): SeedingEntry { 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 = createBaseSeedingEntry(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventSourceId = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.EventTypeId = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Content = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.Tags.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): SeedingEntry { return { EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", EventTypeId: isSet(object.EventTypeId) ? globalThis.String(object.EventTypeId) : "", Content: isSet(object.Content) ? globalThis.String(object.Content) : "", Tags: globalThis.Array.isArray(object?.Tags) ? object.Tags.map((e: any) => globalThis.String(e)) : [], }; }, toJSON(message: SeedingEntry): unknown { const obj: any = {}; if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.EventTypeId !== "") { obj.EventTypeId = message.EventTypeId; } if (message.Content !== "") { obj.Content = message.Content; } if (message.Tags?.length) { obj.Tags = message.Tags; } return obj; }, create(base?: DeepPartial): SeedingEntry { return SeedingEntry.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): SeedingEntry { const message = createBaseSeedingEntry(); message.EventSourceId = object.EventSourceId ?? ""; message.EventTypeId = object.EventTypeId ?? ""; message.Content = object.Content ?? ""; message.Tags = object.Tags?.map((e) => e) || []; 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 EventSeedingDefinition = typeof EventSeedingDefinition; export const EventSeedingDefinition = { name: "EventSeeding", fullName: "Cratis.Chronicle.Contracts.Seeding.EventSeeding", methods: { addSeedEntry: { name: "AddSeedEntry", requestType: AddSeedEntryRequest as typeof AddSeedEntryRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, getGlobalSeedData: { name: "GetGlobalSeedData", requestType: GetGlobalSeedDataRequest as typeof GetGlobalSeedDataRequest, requestStream: false, responseType: QueryResultSeedDataResponse as typeof QueryResultSeedDataResponse, responseStream: false, options: {}, }, getNamespaceSeedData: { name: "GetNamespaceSeedData", requestType: GetNamespaceSeedDataRequest as typeof GetNamespaceSeedDataRequest, requestStream: false, responseType: QueryResultSeedDataResponse as typeof QueryResultSeedDataResponse, responseStream: false, options: {}, }, seedEvents: { name: "SeedEvents", requestType: SeedEventsRequest as typeof SeedEventsRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, }, } as const; export interface EventSeedingServiceImplementation { addSeedEntry( request: AddSeedEntryRequest, context: CallContext & CallContextExt, ): Promise>; getGlobalSeedData( request: GetGlobalSeedDataRequest, context: CallContext & CallContextExt, ): Promise>; getNamespaceSeedData( request: GetNamespaceSeedDataRequest, context: CallContext & CallContextExt, ): Promise>; seedEvents(request: SeedEventsRequest, context: CallContext & CallContextExt): Promise>; } export interface EventSeedingClient { addSeedEntry( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; getGlobalSeedData( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; getNamespaceSeedData( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; seedEvents(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 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; }