/** * Shape of a validation result carried by Chronicle command and query results. */ export interface CallValidationResult { Message: string; Members: string[]; } /** * Structural shape shared by every Chronicle command and query result envelope. * * Kernels from 18.4.1 transmit authorization verdicts explicitly, including true values. * Older kernels omitted true values; the connection compatibility check must reject those kernels * before operations rather than ignoring an authorization failure. */ export interface CallResultLike { IsAuthorized?: boolean; ValidationResults: CallValidationResult[]; ExceptionMessages: string[]; AuthorizationFailureReason?: string; } /** * Structural shape shared by every Chronicle query result envelope. */ export interface QueryResultLike extends CallResultLike { Data: TData; } /** * Structural shape shared by every Chronicle command result envelope that carries a response payload. */ export interface CommandResultLike extends CallResultLike { Response: TResponse | undefined; } /** * Error thrown when a Chronicle command or query did not succeed. */ export declare class ChronicleCallFailed extends Error { /** * Creates a new {@link ChronicleCallFailed}. * @param operation - The operation that failed. * @param result - The result envelope returned by the kernel. */ constructor(operation: string, result: CallResultLike); } /** * Determines whether a Chronicle result envelope represents success: no authorization * failure reason, no validation results, and no exceptions. * @param result - The result envelope to check. * @returns True when the call succeeded, false otherwise. */ export declare function isCallSuccess(result: CallResultLike): boolean; /** * Ensures a Chronicle command executed successfully, throwing when it did not. * @param operation - The operation the result belongs to, used for error reporting. * @param result - The command result envelope returned by the kernel. */ export declare function ensureCommandSuccess(operation: string, result: CallResultLike): void; /** * Ensures a Chronicle command executed successfully, returning its response or throwing when it did not. * @param operation - The operation the result belongs to, used for error reporting. * @param result - The command result envelope returned by the kernel. * @returns The response produced by the command. */ export declare function ensureCommandResponse(operation: string, result: CommandResultLike): TResponse; /** * Ensures a Chronicle query executed successfully, returning its data or throwing when it did not. * @param operation - The operation the result belongs to, used for error reporting. * @param result - The query result envelope returned by the kernel. * @returns The data produced by the query. */ export declare function ensureQuerySuccess(operation: string, result: QueryResultLike): TData; /** * Takes the first result from a server-streaming Chronicle query and cancels the stream. * Chronicle streams queries so they can also be observed; one-shot callers only need the * first snapshot. * @param operation - The operation the stream belongs to, used for error reporting. * @param stream - The server-streaming query response. * @returns The first result produced by the stream. */ export declare function firstQueryResult(operation: string, stream: AsyncIterable): Promise; //# sourceMappingURL=callResults.d.ts.map