import z from "zod/v4"; import { APIScoreV2 } from "../api/v2/schemas"; import { APIScoreV1 } from "../api/v1/schemas"; import { ScoreDomain } from "../../../../domain"; type ValidatedAPIScore = APIScoreV2 & { hasMetadata: IncludeHasMetadata extends true ? boolean : never; }; type InputScore = ScoreDomain & { hasMetadata?: boolean; }; /** * Use this function when pulling a single score from the database before using in the application to ensure type safety. * The score is expected to pass the validation. If a score fails validation, an error will be thrown. * @param score * @returns validated score * @throws error if score fails validation */ export declare const validateDbScore: (score: ScoreDomain) => APIScoreV2; /** * Use this function when pulling a list of scores from the database before using in the application to ensure type safety. * All scores are expected to pass the validation. If a score fails validation, it will be logged to Otel. * @param scores * @returns list of validated scores */ export declare const filterAndValidateDbScoreList: ({ scores, includeHasMetadata, onParseError, }: { scores: InputScore[]; includeHasMetadata?: IncludeHasMetadata; onParseError?: (error: z.ZodError) => void; }) => ValidatedAPIScore[]; type ValidatedAPITraceScore = APIScoreV1 & { hasMetadata: IncludeHasMetadata extends true ? boolean : never; }; /** * @deprecated * Use `filterAndValidateDbScoreList` instead. This function is only used for the legacy v1 API where scores were only associated with traces. * Use this function when pulling a list of scores from the database before using in the application to ensure type safety. * All scores are expected to pass the validation. If a score fails validation, it will be logged to Otel. * @param scores * @returns list of validated scores */ export declare const filterAndValidateDbTraceScoreList: ({ scores, includeHasMetadata, onParseError, }: { scores: InputScore[]; includeHasMetadata?: IncludeHasMetadata; onParseError?: (error: z.ZodError) => void; }) => ValidatedAPITraceScore[]; export {}; //# sourceMappingURL=validation.d.ts.map