// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.12.4 // protoc v5.28.3 // source: clients.proto /* eslint-disable */ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import type { CallContext, CallOptions } from "nice-grpc-common"; import { Empty } from "./google/protobuf/empty"; export const protobufPackage = "Cratis.Chronicle.Contracts.Clients"; export interface CompatibilityRequest { ClientType: string; ClientVersion: string; ProtocolVersion: string; DescriptorSet: Buffer; } export interface CompatibilityResponse { IsCompatible: boolean; Incompatibilities: string[]; ServerVersion: string; ServerProtocolVersion: string; } export interface ConnectRequest { ConnectionId: string; ClientVersion: string; IsRunningWithDebugger: boolean; ProcessId: number; ProcessPath: string; MachineName: string; ClientType: string; } export interface ConnectedClient { ConnectionId: string; Version: string; LastSeen: SerializableDateTimeOffset | undefined; IsRunningWithDebugger: boolean; SiloAddress: string; ProcessId: number; ProcessPath: string; MachineName: string; ClientType: string; } export interface ConnectionKeepAlive { ConnectionId: string; } export interface DescriptorSetResponse { SchemaDefinition: string; } export interface IEnumerableConnectedClient { items: ConnectedClient[]; } /** Represents a DateTimeOffset value as an ISO 8601 string (e.g., "2024-01-15T12:30:00.0000000+02:00"). */ export interface SerializableDateTimeOffset { Value: string; } function createBaseCompatibilityRequest(): CompatibilityRequest { return { ClientType: "", ClientVersion: "", ProtocolVersion: "", DescriptorSet: Buffer.alloc(0) }; } export const CompatibilityRequest: MessageFns = { encode(message: CompatibilityRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.ClientType !== "") { writer.uint32(10).string(message.ClientType); } if (message.ClientVersion !== "") { writer.uint32(18).string(message.ClientVersion); } if (message.ProtocolVersion !== "") { writer.uint32(26).string(message.ProtocolVersion); } if (message.DescriptorSet.length !== 0) { writer.uint32(34).bytes(message.DescriptorSet); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CompatibilityRequest { 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 = createBaseCompatibilityRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.ClientType = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.ClientVersion = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.ProtocolVersion = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.DescriptorSet = Buffer.from(reader.bytes()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): CompatibilityRequest { return { ClientType: isSet(object.ClientType) ? globalThis.String(object.ClientType) : "", ClientVersion: isSet(object.ClientVersion) ? globalThis.String(object.ClientVersion) : "", ProtocolVersion: isSet(object.ProtocolVersion) ? globalThis.String(object.ProtocolVersion) : "", DescriptorSet: isSet(object.DescriptorSet) ? Buffer.from(bytesFromBase64(object.DescriptorSet)) : Buffer.alloc(0), }; }, toJSON(message: CompatibilityRequest): unknown { const obj: any = {}; if (message.ClientType !== "") { obj.ClientType = message.ClientType; } if (message.ClientVersion !== "") { obj.ClientVersion = message.ClientVersion; } if (message.ProtocolVersion !== "") { obj.ProtocolVersion = message.ProtocolVersion; } if (message.DescriptorSet.length !== 0) { obj.DescriptorSet = base64FromBytes(message.DescriptorSet); } return obj; }, create(base?: DeepPartial): CompatibilityRequest { return CompatibilityRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CompatibilityRequest { const message = createBaseCompatibilityRequest(); message.ClientType = object.ClientType ?? ""; message.ClientVersion = object.ClientVersion ?? ""; message.ProtocolVersion = object.ProtocolVersion ?? ""; message.DescriptorSet = object.DescriptorSet ?? Buffer.alloc(0); return message; }, }; function createBaseCompatibilityResponse(): CompatibilityResponse { return { IsCompatible: false, Incompatibilities: [], ServerVersion: "", ServerProtocolVersion: "" }; } export const CompatibilityResponse: MessageFns = { encode(message: CompatibilityResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.IsCompatible !== false) { writer.uint32(8).bool(message.IsCompatible); } for (const v of message.Incompatibilities) { writer.uint32(18).string(v!); } if (message.ServerVersion !== "") { writer.uint32(26).string(message.ServerVersion); } if (message.ServerProtocolVersion !== "") { writer.uint32(34).string(message.ServerProtocolVersion); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CompatibilityResponse { 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 = createBaseCompatibilityResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.IsCompatible = reader.bool(); continue; } case 2: { if (tag !== 18) { break; } message.Incompatibilities.push(reader.string()); continue; } case 3: { if (tag !== 26) { break; } message.ServerVersion = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.ServerProtocolVersion = 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): CompatibilityResponse { return { IsCompatible: isSet(object.IsCompatible) ? globalThis.Boolean(object.IsCompatible) : false, Incompatibilities: globalThis.Array.isArray(object?.Incompatibilities) ? object.Incompatibilities.map((e: any) => globalThis.String(e)) : [], ServerVersion: isSet(object.ServerVersion) ? globalThis.String(object.ServerVersion) : "", ServerProtocolVersion: isSet(object.ServerProtocolVersion) ? globalThis.String(object.ServerProtocolVersion) : "", }; }, toJSON(message: CompatibilityResponse): unknown { const obj: any = {}; if (message.IsCompatible !== false) { obj.IsCompatible = message.IsCompatible; } if (message.Incompatibilities?.length) { obj.Incompatibilities = message.Incompatibilities; } if (message.ServerVersion !== "") { obj.ServerVersion = message.ServerVersion; } if (message.ServerProtocolVersion !== "") { obj.ServerProtocolVersion = message.ServerProtocolVersion; } return obj; }, create(base?: DeepPartial): CompatibilityResponse { return CompatibilityResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CompatibilityResponse { const message = createBaseCompatibilityResponse(); message.IsCompatible = object.IsCompatible ?? false; message.Incompatibilities = object.Incompatibilities?.map((e) => e) || []; message.ServerVersion = object.ServerVersion ?? ""; message.ServerProtocolVersion = object.ServerProtocolVersion ?? ""; return message; }, }; function createBaseConnectRequest(): ConnectRequest { return { ConnectionId: "", ClientVersion: "", IsRunningWithDebugger: false, ProcessId: 0, ProcessPath: "", MachineName: "", ClientType: "", }; } export const ConnectRequest: MessageFns = { encode(message: ConnectRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.ConnectionId !== "") { writer.uint32(10).string(message.ConnectionId); } if (message.ClientVersion !== "") { writer.uint32(18).string(message.ClientVersion); } if (message.IsRunningWithDebugger !== false) { writer.uint32(24).bool(message.IsRunningWithDebugger); } if (message.ProcessId !== 0) { writer.uint32(32).int32(message.ProcessId); } if (message.ProcessPath !== "") { writer.uint32(42).string(message.ProcessPath); } if (message.MachineName !== "") { writer.uint32(50).string(message.MachineName); } if (message.ClientType !== "") { writer.uint32(58).string(message.ClientType); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ConnectRequest { 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 = createBaseConnectRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.ConnectionId = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.ClientVersion = reader.string(); continue; } case 3: { if (tag !== 24) { break; } message.IsRunningWithDebugger = reader.bool(); continue; } case 4: { if (tag !== 32) { break; } message.ProcessId = reader.int32(); continue; } case 5: { if (tag !== 42) { break; } message.ProcessPath = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.MachineName = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.ClientType = 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): ConnectRequest { return { ConnectionId: isSet(object.ConnectionId) ? globalThis.String(object.ConnectionId) : "", ClientVersion: isSet(object.ClientVersion) ? globalThis.String(object.ClientVersion) : "", IsRunningWithDebugger: isSet(object.IsRunningWithDebugger) ? globalThis.Boolean(object.IsRunningWithDebugger) : false, ProcessId: isSet(object.ProcessId) ? globalThis.Number(object.ProcessId) : 0, ProcessPath: isSet(object.ProcessPath) ? globalThis.String(object.ProcessPath) : "", MachineName: isSet(object.MachineName) ? globalThis.String(object.MachineName) : "", ClientType: isSet(object.ClientType) ? globalThis.String(object.ClientType) : "", }; }, toJSON(message: ConnectRequest): unknown { const obj: any = {}; if (message.ConnectionId !== "") { obj.ConnectionId = message.ConnectionId; } if (message.ClientVersion !== "") { obj.ClientVersion = message.ClientVersion; } if (message.IsRunningWithDebugger !== false) { obj.IsRunningWithDebugger = message.IsRunningWithDebugger; } if (message.ProcessId !== 0) { obj.ProcessId = Math.round(message.ProcessId); } if (message.ProcessPath !== "") { obj.ProcessPath = message.ProcessPath; } if (message.MachineName !== "") { obj.MachineName = message.MachineName; } if (message.ClientType !== "") { obj.ClientType = message.ClientType; } return obj; }, create(base?: DeepPartial): ConnectRequest { return ConnectRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ConnectRequest { const message = createBaseConnectRequest(); message.ConnectionId = object.ConnectionId ?? ""; message.ClientVersion = object.ClientVersion ?? ""; message.IsRunningWithDebugger = object.IsRunningWithDebugger ?? false; message.ProcessId = object.ProcessId ?? 0; message.ProcessPath = object.ProcessPath ?? ""; message.MachineName = object.MachineName ?? ""; message.ClientType = object.ClientType ?? ""; return message; }, }; function createBaseConnectedClient(): ConnectedClient { return { ConnectionId: "", Version: "", LastSeen: undefined, IsRunningWithDebugger: false, SiloAddress: "", ProcessId: 0, ProcessPath: "", MachineName: "", ClientType: "", }; } export const ConnectedClient: MessageFns = { encode(message: ConnectedClient, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.ConnectionId !== "") { writer.uint32(10).string(message.ConnectionId); } if (message.Version !== "") { writer.uint32(18).string(message.Version); } if (message.LastSeen !== undefined) { SerializableDateTimeOffset.encode(message.LastSeen, writer.uint32(26).fork()).join(); } if (message.IsRunningWithDebugger !== false) { writer.uint32(32).bool(message.IsRunningWithDebugger); } if (message.SiloAddress !== "") { writer.uint32(42).string(message.SiloAddress); } if (message.ProcessId !== 0) { writer.uint32(48).int32(message.ProcessId); } if (message.ProcessPath !== "") { writer.uint32(58).string(message.ProcessPath); } if (message.MachineName !== "") { writer.uint32(66).string(message.MachineName); } if (message.ClientType !== "") { writer.uint32(74).string(message.ClientType); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ConnectedClient { 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 = createBaseConnectedClient(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.ConnectionId = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Version = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.LastSeen = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 4: { if (tag !== 32) { break; } message.IsRunningWithDebugger = reader.bool(); continue; } case 5: { if (tag !== 42) { break; } message.SiloAddress = reader.string(); continue; } case 6: { if (tag !== 48) { break; } message.ProcessId = reader.int32(); continue; } case 7: { if (tag !== 58) { break; } message.ProcessPath = reader.string(); continue; } case 8: { if (tag !== 66) { break; } message.MachineName = reader.string(); continue; } case 9: { if (tag !== 74) { break; } message.ClientType = 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): ConnectedClient { return { ConnectionId: isSet(object.ConnectionId) ? globalThis.String(object.ConnectionId) : "", Version: isSet(object.Version) ? globalThis.String(object.Version) : "", LastSeen: isSet(object.LastSeen) ? SerializableDateTimeOffset.fromJSON(object.LastSeen) : undefined, IsRunningWithDebugger: isSet(object.IsRunningWithDebugger) ? globalThis.Boolean(object.IsRunningWithDebugger) : false, SiloAddress: isSet(object.SiloAddress) ? globalThis.String(object.SiloAddress) : "", ProcessId: isSet(object.ProcessId) ? globalThis.Number(object.ProcessId) : 0, ProcessPath: isSet(object.ProcessPath) ? globalThis.String(object.ProcessPath) : "", MachineName: isSet(object.MachineName) ? globalThis.String(object.MachineName) : "", ClientType: isSet(object.ClientType) ? globalThis.String(object.ClientType) : "", }; }, toJSON(message: ConnectedClient): unknown { const obj: any = {}; if (message.ConnectionId !== "") { obj.ConnectionId = message.ConnectionId; } if (message.Version !== "") { obj.Version = message.Version; } if (message.LastSeen !== undefined) { obj.LastSeen = SerializableDateTimeOffset.toJSON(message.LastSeen); } if (message.IsRunningWithDebugger !== false) { obj.IsRunningWithDebugger = message.IsRunningWithDebugger; } if (message.SiloAddress !== "") { obj.SiloAddress = message.SiloAddress; } if (message.ProcessId !== 0) { obj.ProcessId = Math.round(message.ProcessId); } if (message.ProcessPath !== "") { obj.ProcessPath = message.ProcessPath; } if (message.MachineName !== "") { obj.MachineName = message.MachineName; } if (message.ClientType !== "") { obj.ClientType = message.ClientType; } return obj; }, create(base?: DeepPartial): ConnectedClient { return ConnectedClient.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ConnectedClient { const message = createBaseConnectedClient(); message.ConnectionId = object.ConnectionId ?? ""; message.Version = object.Version ?? ""; message.LastSeen = (object.LastSeen !== undefined && object.LastSeen !== null) ? SerializableDateTimeOffset.fromPartial(object.LastSeen) : undefined; message.IsRunningWithDebugger = object.IsRunningWithDebugger ?? false; message.SiloAddress = object.SiloAddress ?? ""; message.ProcessId = object.ProcessId ?? 0; message.ProcessPath = object.ProcessPath ?? ""; message.MachineName = object.MachineName ?? ""; message.ClientType = object.ClientType ?? ""; return message; }, }; function createBaseConnectionKeepAlive(): ConnectionKeepAlive { return { ConnectionId: "" }; } export const ConnectionKeepAlive: MessageFns = { encode(message: ConnectionKeepAlive, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.ConnectionId !== "") { writer.uint32(10).string(message.ConnectionId); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ConnectionKeepAlive { 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 = createBaseConnectionKeepAlive(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.ConnectionId = 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): ConnectionKeepAlive { return { ConnectionId: isSet(object.ConnectionId) ? globalThis.String(object.ConnectionId) : "" }; }, toJSON(message: ConnectionKeepAlive): unknown { const obj: any = {}; if (message.ConnectionId !== "") { obj.ConnectionId = message.ConnectionId; } return obj; }, create(base?: DeepPartial): ConnectionKeepAlive { return ConnectionKeepAlive.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ConnectionKeepAlive { const message = createBaseConnectionKeepAlive(); message.ConnectionId = object.ConnectionId ?? ""; return message; }, }; function createBaseDescriptorSetResponse(): DescriptorSetResponse { return { SchemaDefinition: "" }; } export const DescriptorSetResponse: MessageFns = { encode(message: DescriptorSetResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.SchemaDefinition !== "") { writer.uint32(10).string(message.SchemaDefinition); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): DescriptorSetResponse { 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 = createBaseDescriptorSetResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.SchemaDefinition = 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): DescriptorSetResponse { return { SchemaDefinition: isSet(object.SchemaDefinition) ? globalThis.String(object.SchemaDefinition) : "" }; }, toJSON(message: DescriptorSetResponse): unknown { const obj: any = {}; if (message.SchemaDefinition !== "") { obj.SchemaDefinition = message.SchemaDefinition; } return obj; }, create(base?: DeepPartial): DescriptorSetResponse { return DescriptorSetResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): DescriptorSetResponse { const message = createBaseDescriptorSetResponse(); message.SchemaDefinition = object.SchemaDefinition ?? ""; return message; }, }; function createBaseIEnumerableConnectedClient(): IEnumerableConnectedClient { return { items: [] }; } export const IEnumerableConnectedClient: MessageFns = { encode(message: IEnumerableConnectedClient, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { for (const v of message.items) { ConnectedClient.encode(v!, writer.uint32(10).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): IEnumerableConnectedClient { 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 = createBaseIEnumerableConnectedClient(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.items.push(ConnectedClient.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): IEnumerableConnectedClient { return { items: globalThis.Array.isArray(object?.items) ? object.items.map((e: any) => ConnectedClient.fromJSON(e)) : [], }; }, toJSON(message: IEnumerableConnectedClient): unknown { const obj: any = {}; if (message.items?.length) { obj.items = message.items.map((e) => ConnectedClient.toJSON(e)); } return obj; }, create(base?: DeepPartial): IEnumerableConnectedClient { return IEnumerableConnectedClient.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): IEnumerableConnectedClient { const message = createBaseIEnumerableConnectedClient(); message.items = object.items?.map((e) => ConnectedClient.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; }, }; export type ConnectionServiceDefinition = typeof ConnectionServiceDefinition; export const ConnectionServiceDefinition = { name: "ConnectionService", fullName: "Cratis.Chronicle.Contracts.Clients.ConnectionService", methods: { checkCompatibility: { name: "CheckCompatibility", requestType: CompatibilityRequest as typeof CompatibilityRequest, requestStream: false, responseType: CompatibilityResponse as typeof CompatibilityResponse, responseStream: false, options: {}, }, connect: { name: "Connect", requestType: ConnectRequest as typeof ConnectRequest, requestStream: false, responseType: ConnectionKeepAlive as typeof ConnectionKeepAlive, responseStream: true, options: {}, }, connectionKeepAlive: { name: "ConnectionKeepAlive", requestType: ConnectionKeepAlive as typeof ConnectionKeepAlive, requestStream: false, responseType: Empty as typeof Empty, responseStream: false, options: {}, }, getConnectedClients: { name: "GetConnectedClients", requestType: Empty as typeof Empty, requestStream: false, responseType: IEnumerableConnectedClient as typeof IEnumerableConnectedClient, responseStream: false, options: {}, }, getDescriptorSet: { name: "GetDescriptorSet", requestType: Empty as typeof Empty, requestStream: false, responseType: DescriptorSetResponse as typeof DescriptorSetResponse, responseStream: false, options: {}, }, observeConnectedClients: { name: "ObserveConnectedClients", requestType: Empty as typeof Empty, requestStream: false, responseType: IEnumerableConnectedClient as typeof IEnumerableConnectedClient, responseStream: true, options: {}, }, }, } as const; export interface ConnectionServiceImplementation { checkCompatibility( request: CompatibilityRequest, context: CallContext & CallContextExt, ): Promise>; connect( request: ConnectRequest, context: CallContext & CallContextExt, ): ServerStreamingMethodResult>; connectionKeepAlive(request: ConnectionKeepAlive, context: CallContext & CallContextExt): Promise>; getConnectedClients( request: Empty, context: CallContext & CallContextExt, ): Promise>; getDescriptorSet(request: Empty, context: CallContext & CallContextExt): Promise>; observeConnectedClients( request: Empty, context: CallContext & CallContextExt, ): ServerStreamingMethodResult>; } export interface ConnectionServiceClient { checkCompatibility( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; connect( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): AsyncIterable; connectionKeepAlive( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; getConnectedClients( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; getDescriptorSet(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; observeConnectedClients( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): AsyncIterable; } function bytesFromBase64(b64: string): Uint8Array { return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); } function base64FromBytes(arr: Uint8Array): string { return globalThis.Buffer.from(arr).toString("base64"); } 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 type ServerStreamingMethodResult = { [Symbol.asyncIterator](): AsyncIterator }; 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; }