UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

1 lines 2.45 kB
{"version":3,"file":"cdn.mjs","names":[],"sources":["../../src/schemas/cdn.ts"],"sourcesContent":["import z from \"zod\";\nimport type { ControllerSchema } from \"../types.js\";\n\nexport const controllerSchemas = {\n\tstreamSingle: {\n\t\tbody: undefined,\n\t\tquery: {\n\t\t\tstring: z.object({\n\t\t\t\tpreset: z\n\t\t\t\t\t.string()\n\t\t\t\t\t.trim()\n\t\t\t\t\t.meta({\n\t\t\t\t\t\tdescription: \"The preset to use for the image\",\n\t\t\t\t\t\texample: \"thumbnail-small\",\n\t\t\t\t\t})\n\t\t\t\t\t.optional(),\n\t\t\t\tformat: z\n\t\t\t\t\t.enum([\"jpeg\", \"png\", \"webp\", \"avif\"])\n\t\t\t\t\t.meta({\n\t\t\t\t\t\tdescription: \"If requesting an image, the format to convert it to\",\n\t\t\t\t\t\texample: \"webp\",\n\t\t\t\t\t})\n\t\t\t\t\t.optional(),\n\t\t\t\tfallback: z\n\t\t\t\t\t.enum([\"true\", \"false\"])\n\t\t\t\t\t.meta({\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Determines if the fallback image should be returned when the requested one cannot be found\",\n\t\t\t\t\t\texample: true,\n\t\t\t\t\t})\n\t\t\t\t\t.optional(),\n\t\t\t}),\n\t\t\tformatted: z.object({\n\t\t\t\tpreset: z.string().trim().optional(),\n\t\t\t\tformat: z.enum([\"jpeg\", \"png\", \"webp\", \"avif\"]).optional(),\n\t\t\t\tfallback: z.enum([\"true\", \"false\"]).optional(),\n\t\t\t}),\n\t\t},\n\t\tparams: z.object({\n\t\t\tkey: z.string().trim().meta({\n\t\t\t\tdescription: \"The media key you wish to stream\",\n\t\t\t\texample: \"public/123e4567e89b12d3a456426614174000/placeholder-image\",\n\t\t\t}),\n\t\t}),\n\t\tresponse: undefined,\n\t} satisfies ControllerSchema,\n};\n\nexport type StreamSingleQueryParams = z.infer<\n\ttypeof controllerSchemas.streamSingle.query.formatted\n>;\n"],"mappings":"mBAGA,MAAa,EAAoB,CAChC,aAAc,CACb,KAAM,IAAA,GACN,MAAO,CACN,OAAQ,EAAE,OAAO,CAChB,OAAQ,EACN,OAAO,CAAC,CACR,KAAK,CAAC,CACN,KAAK,CACL,YAAa,kCACb,QAAS,iBACV,CAAC,CAAC,CACD,SAAS,EACX,OAAQ,EACN,KAAK,CAAC,OAAQ,MAAO,OAAQ,MAAM,CAAC,CAAC,CACrC,KAAK,CACL,YAAa,sDACb,QAAS,MACV,CAAC,CAAC,CACD,SAAS,EACX,SAAU,EACR,KAAK,CAAC,OAAQ,OAAO,CAAC,CAAC,CACvB,KAAK,CACL,YACC,6FACD,QAAS,EACV,CAAC,CAAC,CACD,SAAS,CACZ,CAAC,EACD,UAAW,EAAE,OAAO,CACnB,OAAQ,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,EACnC,OAAQ,EAAE,KAAK,CAAC,OAAQ,MAAO,OAAQ,MAAM,CAAC,CAAC,CAAC,SAAS,EACzD,SAAU,EAAE,KAAK,CAAC,OAAQ,OAAO,CAAC,CAAC,CAAC,SAAS,CAC9C,CAAC,CACF,EACA,OAAQ,EAAE,OAAO,CAChB,IAAK,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAC3B,YAAa,mCACb,QAAS,2DACV,CAAC,CACF,CAAC,EACD,SAAU,IAAA,EACX,CACD"}