donobu
Version:
Create browser automations with an LLM agent and replay them as Playwright scripts.
37 lines • 1.53 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BrowserStorageStateSchema = void 0;
const v4_1 = require("zod/v4");
/* ------------------------------------------------------------------------- *
* 2. Schema pieces
* ------------------------------------------------------------------------- */
// — cookie —
const CookieSchema = v4_1.z.looseObject({
name: v4_1.z.string(),
value: v4_1.z.string(),
domain: v4_1.z.string(),
path: v4_1.z.string(),
expires: v4_1.z.number(), // epoch seconds (-1 for “session”)
httpOnly: v4_1.z.boolean(),
secure: v4_1.z.boolean(),
sameSite: v4_1.z.enum(['Strict', 'Lax', 'None']),
}); // guards us if Playwright adds fields
// — simple {name,value} pair used in local and session storage —
const NameValueSchema = v4_1.z.object({
name: v4_1.z.string(),
value: v4_1.z.string(),
});
// — origin (Playwright shape + optional sessionStorage) —
const OriginSchema = v4_1.z.looseObject({
origin: v4_1.z.string(),
localStorage: v4_1.z.array(NameValueSchema),
sessionStorage: v4_1.z.array(NameValueSchema).optional(),
});
/* ------------------------------------------------------------------------- *
* 3. Top-level schema & inferred type
* ------------------------------------------------------------------------- */
exports.BrowserStorageStateSchema = v4_1.z.object({
cookies: v4_1.z.array(CookieSchema),
origins: v4_1.z.array(OriginSchema),
});
//# sourceMappingURL=BrowserStorageState.js.map