@unkey/api
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.
42 lines • 1.75 kB
TypeScript
import * as z from "zod";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type ValidationError = {
/**
* Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'
*/
location: string;
/**
* Error message text
*/
message: string;
/**
* A human-readable message describing how to fix the error.
*/
fix?: string | undefined;
};
/** @internal */
export declare const ValidationError$inboundSchema: z.ZodType<ValidationError, z.ZodTypeDef, unknown>;
/** @internal */
export type ValidationError$Outbound = {
location: string;
message: string;
fix?: string | undefined;
};
/** @internal */
export declare const ValidationError$outboundSchema: z.ZodType<ValidationError$Outbound, z.ZodTypeDef, ValidationError>;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export declare namespace ValidationError$ {
/** @deprecated use `ValidationError$inboundSchema` instead. */
const inboundSchema: z.ZodType<ValidationError, z.ZodTypeDef, unknown>;
/** @deprecated use `ValidationError$outboundSchema` instead. */
const outboundSchema: z.ZodType<ValidationError$Outbound, z.ZodTypeDef, ValidationError>;
/** @deprecated use `ValidationError$Outbound` instead. */
type Outbound = ValidationError$Outbound;
}
export declare function validationErrorToJSON(validationError: ValidationError): string;
export declare function validationErrorFromJSON(jsonString: string): SafeParseResult<ValidationError, SDKValidationError>;
//# sourceMappingURL=validationerror.d.ts.map