UNPKG

@syngrisi/syngrisi

Version:
56 lines (55 loc) 2.15 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/server/schemas/GetBaseline.shema.ts var GetBaseline_shema_exports = {}; __export(GetBaseline_shema_exports, { IdentJSONStringSchema: () => IdentJSONStringSchema, RequiredIdentOptionsSchema: () => RequiredIdentOptionsSchema }); module.exports = __toCommonJS(GetBaseline_shema_exports); var import_zod = require("zod"); var RequiredIdentOptionsSchema = import_zod.z.object({ name: import_zod.z.string().min(1), viewport: import_zod.z.string().min(3), browserName: import_zod.z.string().min(1), os: import_zod.z.string().min(1), app: import_zod.z.string().min(1), branch: import_zod.z.string().min(1) }); var IdentJSONStringSchema = import_zod.z.string().optional().refine((data) => { if (!data) return false; try { const parsed = JSON.parse(data); RequiredIdentOptionsSchema.parse(parsed); return true; } catch (e) { return false; } }, { message: "Invalid JSON string or does not match the required schema" }).openapi({ description: "baseline filter based on ident", example: '{"name": "Login page", "viewport": "1366x768", "browserName": "chrome", "os": "macOS", "app": "My App", "branch": "master"}' }); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { IdentJSONStringSchema, RequiredIdentOptionsSchema }); //# sourceMappingURL=GetBaseline.shema.js.map