unstructured-client
Version:
<h3 align="center"> <img src="https://raw.githubusercontent.com/Unstructured-IO/unstructured/main/img/unstructured_logo.png" height="200" > </h3>
57 lines • 2.29 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { safeParse } from "../../../lib/schemas.js";
/** @internal */
export const Loc$inboundSchema = z.union([z.string(), z.number().int()]);
/** @internal */
export const Loc$outboundSchema = z
.union([z.string(), z.number().int()]);
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var Loc$;
(function (Loc$) {
/** @deprecated use `Loc$inboundSchema` instead. */
Loc$.inboundSchema = Loc$inboundSchema;
/** @deprecated use `Loc$outboundSchema` instead. */
Loc$.outboundSchema = Loc$outboundSchema;
})(Loc$ || (Loc$ = {}));
export function locToJSON(loc) {
return JSON.stringify(Loc$outboundSchema.parse(loc));
}
export function locFromJSON(jsonString) {
return safeParse(jsonString, (x) => Loc$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Loc' from JSON`);
}
/** @internal */
export const ValidationError$inboundSchema = z.object({
loc: z.array(z.union([z.string(), z.number().int()])),
msg: z.string(),
type: z.string(),
});
/** @internal */
export const ValidationError$outboundSchema = z.object({
loc: z.array(z.union([z.string(), z.number().int()])),
msg: z.string(),
type: z.string(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var ValidationError$;
(function (ValidationError$) {
/** @deprecated use `ValidationError$inboundSchema` instead. */
ValidationError$.inboundSchema = ValidationError$inboundSchema;
/** @deprecated use `ValidationError$outboundSchema` instead. */
ValidationError$.outboundSchema = ValidationError$outboundSchema;
})(ValidationError$ || (ValidationError$ = {}));
export function validationErrorToJSON(validationError) {
return JSON.stringify(ValidationError$outboundSchema.parse(validationError));
}
export function validationErrorFromJSON(jsonString) {
return safeParse(jsonString, (x) => ValidationError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ValidationError' from JSON`);
}
//# sourceMappingURL=validationerror.js.map