Documentation IndexFetch the complete documentation index at: /docs/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
export declare function validateDataUsingSchema(input: { data: Record<string, any>[] | Record<string, any>; schema: Record<string, any>; }): void;
import { validateDataUsingSchema } from "@intuned/browser"; import { BrowserContext, Page } from "playwright"; interface Params {} export default async function handler( params: Params, page: Page, context: BrowserContext ) { const uploadData = { file: { fileName: "documents/report.pdf", bucket: "my-bucket", region: "us-east-1", key: "documents/report.pdf", endpoint: null, suggestedFileName: "Monthly Report.pdf", fileType: "document", }, name: "Test File Upload", }; const uploadSchema = { type: "object", required: ["file", "name"], properties: { file: { type: "attachment" }, name: { type: "string" }, }, }; validateDataUsingSchema({ data: uploadData, schema: uploadSchema }); // Validation passes with Attachment type console.log("Validation passed"); return "Validation passed"; }
import { validateDataUsingSchema } from "@intuned/browser"; import { BrowserContext, Page } from "playwright"; interface Params {} export default async function handler( params: Params, page: Page, context: BrowserContext ) { const userData = { name: "John Doe", email: "john@example.com", }; const userSchema = { type: "object", required: ["name", "email", "age"], properties: { name: { type: "string", minLength: 1 }, email: { type: "string", format: "email" }, age: { type: "number", minimum: 0 }, }, }; validateDataUsingSchema({ data: userData, schema: userSchema }); // this will throw // Validation fails, throws ValidationError console.log("Never reached"); return "Never reached"; }
Hide properties
void