import s from"@redocly/ajv";const a=new s({coerceTypes:!1,removeAdditional:!0,strictSchema:!1,allowUnionTypes:!0,useDefaults:!0,allErrors:!0,strictTypes:!1}),n=t=>t?.map(e=>`${e.instancePath} ${e.message}`.trim())||["Validation failed"],r={title:"KV key",type:"array",items:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"}]},minItems:1},l={title:"KV list options",type:"object",properties:{limit:{type:"number",minimum:1,maximum:1e3},reverse:{type:"boolean"},cursor:{type:"string"}},additionalProperties:!1,required:[]},p={title:"KV list selector",type:"object",properties:{prefix:r,start:r,end:r},anyOf:[{required:["prefix"]},{required:["start","end"]}],additionalProperties:!1},c={title:"KV set arguments",type:"object",properties:{ttlInSeconds:{type:"number",minimum:1}},additionalProperties:!1,required:[]};function i(t){const e=a.compile(t);return{parse:o=>{if(!e(o))throw new Error(`Invalid ${t.title}: ${n(e.errors).join(", ")}`);return o}}}const u=i(r),y=i(l),f=i(p),v=i(c);export{u as kvKeyValidator,y as kvListOptionsValidator,f as kvListSelectorValidator,v as kvSetOptionsValidator};
