import { z } from "zod";

const cookieAttributesSchema = z.object({
  secure: z.boolean().optional(),
  path: z.string().optional(),
  domain: z.string().optional(),
  sameSite: z.enum(["lax", "strict", "none"]).optional(),
  httpOnly: z.boolean().optional(),
  maxAge: z.number().optional(),
  expires: z.date().optional(),
});

export const cookieSchema = z.object({
  name: z.string(),
  value: z.string(),
  attributes: cookieAttributesSchema,
});

export type Cookie = z.infer<typeof cookieSchema>;
