@jsfsi-core/ts-crossplatform 1.1.28 → 1.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -36,4 +36,4 @@
36
36
 
37
37
  `)}p.write("payload.value = newResult;"),p.write("return payload;");const rn=p.compile();return(P,O)=>rn(d,P,O)};let i;const s=L,u=!je.jitless,a=u&&Sn.value,l=n.catchall;let h;e._zod.parse=(d,p)=>{h??(h=r.value);const w=d.value;return s(w)?u&&a&&p?.async===!1&&p.jitless!==!0?(i||(i=o(n.shape)),d=i(d,p),l?Ge([],w,d,p,h,e):d):t(d,p):(d.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),d)}});function le(e,n,t,r){for(const i of e)if(i.issues.length===0)return n.value=i.value,n;const o=e.filter(i=>!D(i));return o.length===1?(n.value=o[0].value,o[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:t,errors:e.map(i=>i.issues.map(s=>I(s,r,j())))}),n)}const dt=f("$ZodUnion",(e,n)=>{g.init(e,n),m(e._zod,"optin",()=>n.options.some(o=>o._zod.optin==="optional")?"optional":void 0),m(e._zod,"optout",()=>n.options.some(o=>o._zod.optout==="optional")?"optional":void 0),m(e._zod,"values",()=>{if(n.options.every(o=>o._zod.values))return new Set(n.options.flatMap(o=>Array.from(o._zod.values)))}),m(e._zod,"pattern",()=>{if(n.options.every(o=>o._zod.pattern)){const o=n.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>re(i.source)).join("|")})$`)}});const t=n.options.length===1,r=n.options[0]._zod.run;e._zod.parse=(o,i)=>{if(t)return r(o,i);let s=!1;const u=[];for(const c of n.options){const a=c._zod.run({value:o.value,issues:[]},i);if(a instanceof Promise)u.push(a),s=!0;else{if(a.issues.length===0)return a;u.push(a)}}return s?Promise.all(u).then(c=>le(c,o,e,i)):le(u,o,e,i)}}),pt=f("$ZodIntersection",(e,n)=>{g.init(e,n),e._zod.parse=(t,r)=>{const o=t.value,i=n.left._zod.run({value:o,issues:[]},r),s=n.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,a])=>de(t,c,a)):de(t,i,s)}});function Q(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(J(e)&&J(n)){const t=Object.keys(n),r=Object.keys(e).filter(i=>t.indexOf(i)!==-1),o={...e,...n};for(const i of r){const s=Q(e[i],n[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let r=0;r<e.length;r++){const o=e[r],i=n[r],s=Q(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};t.push(s.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function de(e,n,t){const r=new Map;let o;for(const u of n.issues)if(u.code==="unrecognized_keys"){o??(o=u);for(const c of u.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(u);for(const u of t.issues)if(u.code==="unrecognized_keys")for(const c of u.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(u);const i=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(i.length&&o&&e.issues.push({...o,keys:i}),D(e))return e;const s=Q(n.value,t.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const ht=f("$ZodEnum",(e,n)=>{g.init(e,n);const t=Ie(n.entries),r=new Set(t);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.filter(o=>Pn.has(typeof o)).map(o=>typeof o=="string"?En(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:t,input:s,inst:e}),o}}),mt=f("$ZodTransform",(e,n)=>{g.init(e,n),e._zod.parse=(t,r)=>{if(r.direction==="backward")throw new Ze(e.constructor.name);const o=n.transform(t.value,t);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(t.value=s,t));if(o instanceof Promise)throw new C;return t.value=o,t}});function pe(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const Ke=f("$ZodOptional",(e,n)=>{g.init(e,n),e._zod.optin="optional",e._zod.optout="optional",m(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),m(e._zod,"pattern",()=>{const t=n.innerType._zod.pattern;return t?new RegExp(`^(${re(t.source)})?$`):void 0}),e._zod.parse=(t,r)=>{if(n.innerType._zod.optin==="optional"){const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(i=>pe(i,t.value)):pe(o,t.value)}return t.value===void 0?t:n.innerType._zod.run(t,r)}}),_t=f("$ZodExactOptional",(e,n)=>{Ke.init(e,n),m(e._zod,"values",()=>n.innerType._zod.values),m(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(t,r)=>n.innerType._zod.run(t,r)}),gt=f("$ZodNullable",(e,n)=>{g.init(e,n),m(e._zod,"optin",()=>n.innerType._zod.optin),m(e._zod,"optout",()=>n.innerType._zod.optout),m(e._zod,"pattern",()=>{const t=n.innerType._zod.pattern;return t?new RegExp(`^(${re(t.source)}|null)$`):void 0}),m(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(t,r)=>t.value===null?t:n.innerType._zod.run(t,r)}),yt=f("$ZodDefault",(e,n)=>{g.init(e,n),e._zod.optin="optional",m(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(t,r);if(t.value===void 0)return t.value=n.defaultValue,t;const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(i=>he(i,n)):he(o,n)}});function he(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const vt=f("$ZodPrefault",(e,n)=>{g.init(e,n),e._zod.optin="optional",m(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>(r.direction==="backward"||t.value===void 0&&(t.value=n.defaultValue),n.innerType._zod.run(t,r))}),zt=f("$ZodNonOptional",(e,n)=>{g.init(e,n),m(e._zod,"values",()=>{const t=n.innerType._zod.values;return t?new Set([...t].filter(r=>r!==void 0)):void 0}),e._zod.parse=(t,r)=>{const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(i=>me(i,e)):me(o,e)}});function me(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const bt=f("$ZodCatch",(e,n)=>{g.init(e,n),m(e._zod,"optin",()=>n.innerType._zod.optin),m(e._zod,"optout",()=>n.innerType._zod.optout),m(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(t,r);const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(i=>(t.value=i.value,i.issues.length&&(t.value=n.catchValue({...t,error:{issues:i.issues.map(s=>I(s,r,j()))},input:t.value}),t.issues=[]),t)):(t.value=o.value,o.issues.length&&(t.value=n.catchValue({...t,error:{issues:o.issues.map(i=>I(i,r,j()))},input:t.value}),t.issues=[]),t)}}),wt=f("$ZodPipe",(e,n)=>{g.init(e,n),m(e._zod,"values",()=>n.in._zod.values),m(e._zod,"optin",()=>n.in._zod.optin),m(e._zod,"optout",()=>n.out._zod.optout),m(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(t,r)=>{if(r.direction==="backward"){const i=n.out._zod.run(t,r);return i instanceof Promise?i.then(s=>V(s,n.in,r)):V(i,n.in,r)}const o=n.in._zod.run(t,r);return o instanceof Promise?o.then(i=>V(i,n.out,r)):V(o,n.out,r)}});function V(e,n,t){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},t)}const kt=f("$ZodReadonly",(e,n)=>{g.init(e,n),m(e._zod,"propValues",()=>n.innerType._zod.propValues),m(e._zod,"values",()=>n.innerType._zod.values),m(e._zod,"optin",()=>n.innerType?._zod?.optin),m(e._zod,"optout",()=>n.innerType?._zod?.optout),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(t,r);const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(_e):_e(o)}});function _e(e){return e.value=Object.freeze(e.value),e}const Ot=f("$ZodCustom",(e,n)=>{E.init(e,n),g.init(e,n),e._zod.parse=(t,r)=>t,e._zod.check=t=>{const r=t.value,o=n.fn(r);if(o instanceof Promise)return o.then(i=>ge(i,t,r,e));ge(o,t,r,e)}});function ge(e,n,t,r){if(!e){const o={code:"custom",input:t,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),n.issues.push(x(o))}}var ye;class $t{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...t){const r=t[0];return this._map.set(n,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const t=this._map.get(n);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(n),this}get(n){const t=n._zod.parent;if(t){const r={...this.get(t)??{}};delete r.id;const o={...r,...this._map.get(n)};return Object.keys(o).length?o:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function St(){return new $t}(ye=globalThis).__zod_globalRegistry??(ye.__zod_globalRegistry=St());const M=globalThis.__zod_globalRegistry;function Pt(e,n){return new e({type:"number",checks:[],..._(n)})}function Et(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",..._(n)})}function Nt(e){return new e({type:"unknown"})}function Tt(e,n){return new e({type:"never",..._(n)})}function ve(e,n){return new Ue({check:"less_than",..._(n),value:e,inclusive:!1})}function B(e,n){return new Ue({check:"less_than",..._(n),value:e,inclusive:!0})}function ze(e,n){return new Fe({check:"greater_than",..._(n),value:e,inclusive:!1})}function X(e,n){return new Fe({check:"greater_than",..._(n),value:e,inclusive:!0})}function be(e,n){return new Wn({check:"multiple_of",..._(n),value:e})}function Zt(e,n){return new et({check:"max_length",..._(n),maximum:e})}function we(e,n){return new nt({check:"min_length",..._(n),minimum:e})}function jt(e,n){return new tt({check:"length_equals",..._(n),length:e})}function It(e){return new rt({check:"overwrite",tx:e})}function At(e,n,t){return new e({type:"array",element:n,..._(t)})}function Rt(e,n,t){return new e({type:"custom",check:"custom",fn:n,..._(t)})}function Dt(e){const n=Ct(t=>(t.addIssue=r=>{if(typeof r=="string")t.issues.push(x(r,t.value,n._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=t.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),t.issues.push(x(o))}},e(t.value,t)));return n}function Ct(e,n){const t=new E({check:"custom",..._(n)});return t._zod.check=e,t}function qe(e){let n=e?.target??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??M,target:n,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function b(e,n,t={path:[],schemaPath:[]}){var r;const o=e._zod.def,i=n.seen.get(e);if(i)return i.count++,t.schemaPath.includes(e)&&(i.cycle=t.path),i.schema;const s={schema:{},count:1,cycle:void 0,path:t.path};n.seen.set(e,s);const u=e._zod.toJSONSchema?.();if(u)s.schema=u;else{const l={...t,schemaPath:[...t.schemaPath,e],path:t.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,s.schema,l);else{const d=s.schema,p=n.processors[o.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);p(e,n,d,l)}const h=e._zod.parent;h&&(s.ref||(s.ref=h),b(h,n,l),n.seen.get(h).isParent=!0)}const c=n.metadataRegistry.get(e);return c&&Object.assign(s.schema,c),n.io==="input"&&k(e)&&(delete s.schema.examples,delete s.schema.default),n.io==="input"&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,n.seen.get(e).schema}function Ye(e,n){const t=e.seen.get(n);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const s of e.seen.entries()){const u=e.metadataRegistry.get(s[0])?.id;if(u){const c=r.get(u);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(u,s[0])}}const o=s=>{const u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(s[0])?.id,d=e.external.uri??(w=>w);if(h)return{ref:d(h)};const p=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=p,{defId:p,ref:`${d("__shared")}#/${u}/${p}`}}if(s[1]===t)return{ref:"#"};const a=`#/${u}/`,l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:a+l}},i=s=>{if(s[1].schema.$ref)return;const u=s[1],{ref:c,defId:a}=o(s);u.def={...u.schema},a&&(u.defId=a);const l=u.schema;for(const h in l)delete l[h];l.$ref=c};if(e.cycles==="throw")for(const s of e.seen.entries()){const u=s[1];if(u.cycle)throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
38
38
 
39
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of e.seen.entries()){const u=s[1];if(n===s[0]){i(s);continue}if(e.external){const a=e.external.registry.get(s[0])?.id;if(n!==s[0]&&a){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(u.cycle){i(s);continue}if(u.count>1&&e.reused==="ref"){i(s);continue}}}function He(e,n){const t=e.seen.get(n);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=s=>{const u=e.seen.get(s);if(u.ref===null)return;const c=u.def??u.schema,a={...c},l=u.ref;if(u.ref=null,l){r(l);const d=e.seen.get(l),p=d.schema;if(p.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(p)):Object.assign(c,p),Object.assign(c,a),s._zod.parent===l)for(const v in c)v==="$ref"||v==="allOf"||v in a||delete c[v];if(p.$ref&&d.def)for(const v in c)v==="$ref"||v==="allOf"||v in d.def&&JSON.stringify(c[v])===JSON.stringify(d.def[v])&&delete c[v]}const h=s._zod.parent;if(h&&h!==l){r(h);const d=e.seen.get(h);if(d?.schema.$ref&&(c.$ref=d.schema.$ref,d.def))for(const p in c)p==="$ref"||p==="allOf"||p in d.def&&JSON.stringify(c[p])===JSON.stringify(d.def[p])&&delete c[p]}e.override({zodSchema:s,jsonSchema:c,path:u.path??[]})};for(const s of[...e.seen.entries()].reverse())r(s[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const s=e.external.registry.get(n)?.id;if(!s)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(s)}Object.assign(o,t.def??t.schema);const i=e.external?.defs??{};for(const s of e.seen.entries()){const u=s[1];u.def&&u.defId&&(i[u.defId]=u.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const s=JSON.parse(JSON.stringify(o));return Object.defineProperty(s,"~standard",{value:{...n["~standard"],jsonSchema:{input:K(n,"input",e.processors),output:K(n,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function k(e,n){const t=n??{seen:new Set};if(t.seen.has(e))return!1;t.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return k(r.element,t);if(r.type==="set")return k(r.valueType,t);if(r.type==="lazy")return k(r.getter(),t);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return k(r.innerType,t);if(r.type==="intersection")return k(r.left,t)||k(r.right,t);if(r.type==="record"||r.type==="map")return k(r.keyType,t)||k(r.valueType,t);if(r.type==="pipe")return k(r.in,t)||k(r.out,t);if(r.type==="object"){for(const o in r.shape)if(k(r.shape[o],t))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(k(o,t))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(k(o,t))return!0;return!!(r.rest&&k(r.rest,t))}return!1}const Mt=(e,n={})=>t=>{const r=qe({...t,processors:n});return b(e,r),Ye(r,e),He(r,e)},K=(e,n,t={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=qe({...o??{},target:i,io:n,processors:t});return b(e,s),Ye(s,e),He(s,e)},Jt=(e,n,t,r)=>{const o=t,{minimum:i,maximum:s,format:u,multipleOf:c,exclusiveMaximum:a,exclusiveMinimum:l}=e._zod.bag;typeof u=="string"&&u.includes("int")?o.type="integer":o.type="number",typeof l=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(o.minimum=l,o.exclusiveMinimum=!0):o.exclusiveMinimum=l),typeof i=="number"&&(o.minimum=i,typeof l=="number"&&n.target!=="draft-04"&&(l>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof a=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(o.maximum=a,o.exclusiveMaximum=!0):o.exclusiveMaximum=a),typeof s=="number"&&(o.maximum=s,typeof a=="number"&&n.target!=="draft-04"&&(a<=s?delete o.maximum:delete o.exclusiveMaximum)),typeof c=="number"&&(o.multipleOf=c)},xt=(e,n,t,r)=>{t.not={}},Ut=(e,n,t,r)=>{},Ft=(e,n,t,r)=>{const o=e._zod.def,i=Ie(o.entries);i.every(s=>typeof s=="number")&&(t.type="number"),i.every(s=>typeof s=="string")&&(t.type="string"),t.enum=i},Vt=(e,n,t,r)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Lt=(e,n,t,r)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Gt=(e,n,t,r)=>{const o=t,i=e._zod.def,{minimum:s,maximum:u}=e._zod.bag;typeof s=="number"&&(o.minItems=s),typeof u=="number"&&(o.maxItems=u),o.type="array",o.items=b(i.element,n,{...r,path:[...r.path,"items"]})},Kt=(e,n,t,r)=>{const o=t,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const a in s)o.properties[a]=b(s[a],n,{...r,path:[...r.path,"properties",a]});const u=new Set(Object.keys(s)),c=new Set([...u].filter(a=>{const l=i.shape[a]._zod;return n.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(o.required=Array.from(c)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=b(i.catchall,n,{...r,path:[...r.path,"additionalProperties"]})):n.io==="output"&&(o.additionalProperties=!1)},qt=(e,n,t,r)=>{const o=e._zod.def,i=o.inclusive===!1,s=o.options.map((u,c)=>b(u,n,{...r,path:[...r.path,i?"oneOf":"anyOf",c]}));i?t.oneOf=s:t.anyOf=s},Yt=(e,n,t,r)=>{const o=e._zod.def,i=b(o.left,n,{...r,path:[...r.path,"allOf",0]}),s=b(o.right,n,{...r,path:[...r.path,"allOf",1]}),u=a=>"allOf"in a&&Object.keys(a).length===1,c=[...u(i)?i.allOf:[i],...u(s)?s.allOf:[s]];t.allOf=c},Ht=(e,n,t,r)=>{const o=e._zod.def,i=b(o.innerType,n,r),s=n.seen.get(e);n.target==="openapi-3.0"?(s.ref=o.innerType,t.nullable=!0):t.anyOf=[i,{type:"null"}]},Bt=(e,n,t,r)=>{const o=e._zod.def;b(o.innerType,n,r);const i=n.seen.get(e);i.ref=o.innerType},Xt=(e,n,t,r)=>{const o=e._zod.def;b(o.innerType,n,r);const i=n.seen.get(e);i.ref=o.innerType,t.default=JSON.parse(JSON.stringify(o.defaultValue))},Wt=(e,n,t,r)=>{const o=e._zod.def;b(o.innerType,n,r);const i=n.seen.get(e);i.ref=o.innerType,n.io==="input"&&(t._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},Qt=(e,n,t,r)=>{const o=e._zod.def;b(o.innerType,n,r);const i=n.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=s},er=(e,n,t,r)=>{const o=e._zod.def,i=n.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;b(i,n,r);const s=n.seen.get(e);s.ref=i},nr=(e,n,t,r)=>{const o=e._zod.def;b(o.innerType,n,r);const i=n.seen.get(e);i.ref=o.innerType,t.readOnly=!0},Be=(e,n,t,r)=>{const o=e._zod.def;b(o.innerType,n,r);const i=n.seen.get(e);i.ref=o.innerType},tr=(e,n)=>{Me.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>Jn(e,t)},flatten:{value:t=>Mn(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,W,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,W,2)}},isEmpty:{get(){return e.issues.length===0}}})},$=f("ZodError",tr,{Parent:Error}),rr=se($),or=ie($),sr=q($),ir=Y($),ur=Fn($),cr=Vn($),ar=Ln($),fr=Gn($),lr=Kn($),dr=qn($),pr=Yn($),hr=Hn($),y=f("ZodType",(e,n)=>(g.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:K(e,"input"),output:K(e,"output")}}),e.toJSONSchema=Mt(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...t)=>e.clone(N(n,{checks:[...n.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(t,r)=>T(e,t,r),e.brand=()=>e,e.register=((t,r)=>(t.add(e,r),e)),e.parse=(t,r)=>rr(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>sr(e,t,r),e.parseAsync=async(t,r)=>or(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>ir(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>ur(e,t,r),e.decode=(t,r)=>cr(e,t,r),e.encodeAsync=async(t,r)=>ar(e,t,r),e.decodeAsync=async(t,r)=>fr(e,t,r),e.safeEncode=(t,r)=>lr(e,t,r),e.safeDecode=(t,r)=>dr(e,t,r),e.safeEncodeAsync=async(t,r)=>pr(e,t,r),e.safeDecodeAsync=async(t,r)=>hr(e,t,r),e.refine=(t,r)=>e.check(Fr(t,r)),e.superRefine=t=>e.check(Vr(t)),e.overwrite=t=>e.check(It(t)),e.optional=()=>$e(e),e.exactOptional=()=>Nr(e),e.nullable=()=>Se(e),e.nullish=()=>$e(Se(e)),e.nonoptional=t=>Rr(e,t),e.array=()=>We(e),e.or=t=>wr([e,t]),e.and=t=>Or(e,t),e.transform=t=>Pe(e,Pr(t)),e.default=t=>jr(e,t),e.prefault=t=>Ar(e,t),e.catch=t=>Cr(e,t),e.pipe=t=>Pe(e,t),e.readonly=()=>xr(e),e.describe=t=>{const r=e.clone();return M.add(r,{description:t}),r},Object.defineProperty(e,"description",{get(){return M.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return M.get(e);const r=e.clone();return M.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Xe=f("ZodNumber",(e,n)=>{Ve.init(e,n),y.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Jt(e,r,o),e.gt=(r,o)=>e.check(ze(r,o)),e.gte=(r,o)=>e.check(X(r,o)),e.min=(r,o)=>e.check(X(r,o)),e.lt=(r,o)=>e.check(ve(r,o)),e.lte=(r,o)=>e.check(B(r,o)),e.max=(r,o)=>e.check(B(r,o)),e.int=r=>e.check(ke(r)),e.safe=r=>e.check(ke(r)),e.positive=r=>e.check(ze(0,r)),e.nonnegative=r=>e.check(X(0,r)),e.negative=r=>e.check(ve(0,r)),e.nonpositive=r=>e.check(B(0,r)),e.multipleOf=(r,o)=>e.check(be(r,o)),e.step=(r,o)=>e.check(be(r,o)),e.finite=()=>e;const t=e._zod.bag;e.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),e.isFinite=!0,e.format=t.format??null});function Z(e){return Pt(Xe,e)}const mr=f("ZodNumberFormat",(e,n)=>{it.init(e,n),Xe.init(e,n)});function ke(e){return Et(mr,e)}const _r=f("ZodUnknown",(e,n)=>{ut.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Ut()});function Oe(){return Nt(_r)}const gr=f("ZodNever",(e,n)=>{ct.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>xt(e,t,r)});function yr(e){return Tt(gr,e)}const vr=f("ZodArray",(e,n)=>{at.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Gt(e,t,r,o),e.element=n.element,e.min=(t,r)=>e.check(we(t,r)),e.nonempty=t=>e.check(we(1,t)),e.max=(t,r)=>e.check(Zt(t,r)),e.length=(t,r)=>e.check(jt(t,r)),e.unwrap=()=>e.element});function We(e,n){return At(vr,e,n)}const zr=f("ZodObject",(e,n)=>{lt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Kt(e,t,r,o),m(e,"shape",()=>n.shape),e.keyof=()=>$r(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Oe()}),e.loose=()=>e.clone({...e._zod.def,catchall:Oe()}),e.strict=()=>e.clone({...e._zod.def,catchall:yr()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>In(e,t),e.safeExtend=t=>An(e,t),e.merge=t=>Rn(e,t),e.pick=t=>Zn(e,t),e.omit=t=>jn(e,t),e.partial=(...t)=>Dn(en,e,t[0]),e.required=(...t)=>Cn(nn,e,t[0])});function Qe(e,n){const t={type:"object",shape:e??{},..._(n)};return new zr(t)}const br=f("ZodUnion",(e,n)=>{dt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>qt(e,t,r,o),e.options=n.options});function wr(e,n){return new br({type:"union",options:e,..._(n)})}const kr=f("ZodIntersection",(e,n)=>{pt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Yt(e,t,r,o)});function Or(e,n){return new kr({type:"intersection",left:e,right:n})}const ee=f("ZodEnum",(e,n)=>{ht.init(e,n),y.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Ft(e,r,o),e.enum=n.entries,e.options=Object.values(n.entries);const t=new Set(Object.keys(n.entries));e.extract=(r,o)=>{const i={};for(const s of r)if(t.has(s))i[s]=n.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ee({...n,checks:[],..._(o),entries:i})},e.exclude=(r,o)=>{const i={...n.entries};for(const s of r)if(t.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new ee({...n,checks:[],..._(o),entries:i})}});function $r(e,n){const t=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ee({type:"enum",entries:t,..._(n)})}const Sr=f("ZodTransform",(e,n)=>{mt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Lt(e,t),e._zod.parse=(t,r)=>{if(r.direction==="backward")throw new Ze(e.constructor.name);t.addIssue=i=>{if(typeof i=="string")t.issues.push(x(i,t.value,n));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=t.value),s.inst??(s.inst=e),t.issues.push(x(s))}};const o=n.transform(t.value,t);return o instanceof Promise?o.then(i=>(t.value=i,t)):(t.value=o,t)}});function Pr(e){return new Sr({type:"transform",transform:e})}const en=f("ZodOptional",(e,n)=>{Ke.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Be(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function $e(e){return new en({type:"optional",innerType:e})}const Er=f("ZodExactOptional",(e,n)=>{_t.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Be(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function Nr(e){return new Er({type:"optional",innerType:e})}const Tr=f("ZodNullable",(e,n)=>{gt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Ht(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function Se(e){return new Tr({type:"nullable",innerType:e})}const Zr=f("ZodDefault",(e,n)=>{yt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Xt(e,t,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function jr(e,n){return new Zr({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():Re(n)}})}const Ir=f("ZodPrefault",(e,n)=>{vt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Wt(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function Ar(e,n){return new Ir({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():Re(n)}})}const nn=f("ZodNonOptional",(e,n)=>{zt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Bt(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function Rr(e,n){return new nn({type:"nonoptional",innerType:e,..._(n)})}const Dr=f("ZodCatch",(e,n)=>{bt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Qt(e,t,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Cr(e,n){return new Dr({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const Mr=f("ZodPipe",(e,n)=>{wt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>er(e,t,r,o),e.in=n.in,e.out=n.out});function Pe(e,n){return new Mr({type:"pipe",in:e,out:n})}const Jr=f("ZodReadonly",(e,n)=>{kt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>nr(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function xr(e){return new Jr({type:"readonly",innerType:e})}const Ur=f("ZodCustom",(e,n)=>{Ot.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Vt(e,t)});function Fr(e,n={}){return Rt(Ur,e,n)}function Vr(e){return Dt(e)}const Lr=e=>Qe({pages:Z(),nextPage:Z().optional(),totalElements:Z(),currentPage:Z(),pageSize:Z(),elements:We(e)}),Gr=Qe({page:Z(),pageSize:Z()});exports.Fail=cn;exports.Failure=an;exports.Guid=R;exports.Ok=un;exports.PageQuery=Gr;exports.convertDateInfoToDateRange=mn;exports.createPageSchema=Lr;exports.formatDate=Ee;exports.formatDateTime=hn;exports.formatTime=Ne;exports.isFailure=ln;exports.mock=sn;exports.notFailure=fn;exports.parseConfig=dn;exports.sleep=pn;
39
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of e.seen.entries()){const u=s[1];if(n===s[0]){i(s);continue}if(e.external){const a=e.external.registry.get(s[0])?.id;if(n!==s[0]&&a){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(u.cycle){i(s);continue}if(u.count>1&&e.reused==="ref"){i(s);continue}}}function He(e,n){const t=e.seen.get(n);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=s=>{const u=e.seen.get(s);if(u.ref===null)return;const c=u.def??u.schema,a={...c},l=u.ref;if(u.ref=null,l){r(l);const d=e.seen.get(l),p=d.schema;if(p.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(p)):Object.assign(c,p),Object.assign(c,a),s._zod.parent===l)for(const v in c)v==="$ref"||v==="allOf"||v in a||delete c[v];if(p.$ref&&d.def)for(const v in c)v==="$ref"||v==="allOf"||v in d.def&&JSON.stringify(c[v])===JSON.stringify(d.def[v])&&delete c[v]}const h=s._zod.parent;if(h&&h!==l){r(h);const d=e.seen.get(h);if(d?.schema.$ref&&(c.$ref=d.schema.$ref,d.def))for(const p in c)p==="$ref"||p==="allOf"||p in d.def&&JSON.stringify(c[p])===JSON.stringify(d.def[p])&&delete c[p]}e.override({zodSchema:s,jsonSchema:c,path:u.path??[]})};for(const s of[...e.seen.entries()].reverse())r(s[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const s=e.external.registry.get(n)?.id;if(!s)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(s)}Object.assign(o,t.def??t.schema);const i=e.external?.defs??{};for(const s of e.seen.entries()){const u=s[1];u.def&&u.defId&&(i[u.defId]=u.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const s=JSON.parse(JSON.stringify(o));return Object.defineProperty(s,"~standard",{value:{...n["~standard"],jsonSchema:{input:K(n,"input",e.processors),output:K(n,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function k(e,n){const t=n??{seen:new Set};if(t.seen.has(e))return!1;t.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return k(r.element,t);if(r.type==="set")return k(r.valueType,t);if(r.type==="lazy")return k(r.getter(),t);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return k(r.innerType,t);if(r.type==="intersection")return k(r.left,t)||k(r.right,t);if(r.type==="record"||r.type==="map")return k(r.keyType,t)||k(r.valueType,t);if(r.type==="pipe")return k(r.in,t)||k(r.out,t);if(r.type==="object"){for(const o in r.shape)if(k(r.shape[o],t))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(k(o,t))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(k(o,t))return!0;return!!(r.rest&&k(r.rest,t))}return!1}const Mt=(e,n={})=>t=>{const r=qe({...t,processors:n});return b(e,r),Ye(r,e),He(r,e)},K=(e,n,t={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=qe({...o??{},target:i,io:n,processors:t});return b(e,s),Ye(s,e),He(s,e)},Jt=(e,n,t,r)=>{const o=t,{minimum:i,maximum:s,format:u,multipleOf:c,exclusiveMaximum:a,exclusiveMinimum:l}=e._zod.bag;typeof u=="string"&&u.includes("int")?o.type="integer":o.type="number",typeof l=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(o.minimum=l,o.exclusiveMinimum=!0):o.exclusiveMinimum=l),typeof i=="number"&&(o.minimum=i,typeof l=="number"&&n.target!=="draft-04"&&(l>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof a=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(o.maximum=a,o.exclusiveMaximum=!0):o.exclusiveMaximum=a),typeof s=="number"&&(o.maximum=s,typeof a=="number"&&n.target!=="draft-04"&&(a<=s?delete o.maximum:delete o.exclusiveMaximum)),typeof c=="number"&&(o.multipleOf=c)},xt=(e,n,t,r)=>{t.not={}},Ut=(e,n,t,r)=>{},Ft=(e,n,t,r)=>{const o=e._zod.def,i=Ie(o.entries);i.every(s=>typeof s=="number")&&(t.type="number"),i.every(s=>typeof s=="string")&&(t.type="string"),t.enum=i},Vt=(e,n,t,r)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Lt=(e,n,t,r)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Gt=(e,n,t,r)=>{const o=t,i=e._zod.def,{minimum:s,maximum:u}=e._zod.bag;typeof s=="number"&&(o.minItems=s),typeof u=="number"&&(o.maxItems=u),o.type="array",o.items=b(i.element,n,{...r,path:[...r.path,"items"]})},Kt=(e,n,t,r)=>{const o=t,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const a in s)o.properties[a]=b(s[a],n,{...r,path:[...r.path,"properties",a]});const u=new Set(Object.keys(s)),c=new Set([...u].filter(a=>{const l=i.shape[a]._zod;return n.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(o.required=Array.from(c)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=b(i.catchall,n,{...r,path:[...r.path,"additionalProperties"]})):n.io==="output"&&(o.additionalProperties=!1)},qt=(e,n,t,r)=>{const o=e._zod.def,i=o.inclusive===!1,s=o.options.map((u,c)=>b(u,n,{...r,path:[...r.path,i?"oneOf":"anyOf",c]}));i?t.oneOf=s:t.anyOf=s},Yt=(e,n,t,r)=>{const o=e._zod.def,i=b(o.left,n,{...r,path:[...r.path,"allOf",0]}),s=b(o.right,n,{...r,path:[...r.path,"allOf",1]}),u=a=>"allOf"in a&&Object.keys(a).length===1,c=[...u(i)?i.allOf:[i],...u(s)?s.allOf:[s]];t.allOf=c},Ht=(e,n,t,r)=>{const o=e._zod.def,i=b(o.innerType,n,r),s=n.seen.get(e);n.target==="openapi-3.0"?(s.ref=o.innerType,t.nullable=!0):t.anyOf=[i,{type:"null"}]},Bt=(e,n,t,r)=>{const o=e._zod.def;b(o.innerType,n,r);const i=n.seen.get(e);i.ref=o.innerType},Xt=(e,n,t,r)=>{const o=e._zod.def;b(o.innerType,n,r);const i=n.seen.get(e);i.ref=o.innerType,t.default=JSON.parse(JSON.stringify(o.defaultValue))},Wt=(e,n,t,r)=>{const o=e._zod.def;b(o.innerType,n,r);const i=n.seen.get(e);i.ref=o.innerType,n.io==="input"&&(t._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},Qt=(e,n,t,r)=>{const o=e._zod.def;b(o.innerType,n,r);const i=n.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=s},er=(e,n,t,r)=>{const o=e._zod.def,i=n.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;b(i,n,r);const s=n.seen.get(e);s.ref=i},nr=(e,n,t,r)=>{const o=e._zod.def;b(o.innerType,n,r);const i=n.seen.get(e);i.ref=o.innerType,t.readOnly=!0},Be=(e,n,t,r)=>{const o=e._zod.def;b(o.innerType,n,r);const i=n.seen.get(e);i.ref=o.innerType},tr=(e,n)=>{Me.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>Jn(e,t)},flatten:{value:t=>Mn(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,W,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,W,2)}},isEmpty:{get(){return e.issues.length===0}}})},$=f("ZodError",tr,{Parent:Error}),rr=se($),or=ie($),sr=q($),ir=Y($),ur=Fn($),cr=Vn($),ar=Ln($),fr=Gn($),lr=Kn($),dr=qn($),pr=Yn($),hr=Hn($),y=f("ZodType",(e,n)=>(g.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:K(e,"input"),output:K(e,"output")}}),e.toJSONSchema=Mt(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...t)=>e.clone(N(n,{checks:[...n.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(t,r)=>T(e,t,r),e.brand=()=>e,e.register=((t,r)=>(t.add(e,r),e)),e.parse=(t,r)=>rr(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>sr(e,t,r),e.parseAsync=async(t,r)=>or(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>ir(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>ur(e,t,r),e.decode=(t,r)=>cr(e,t,r),e.encodeAsync=async(t,r)=>ar(e,t,r),e.decodeAsync=async(t,r)=>fr(e,t,r),e.safeEncode=(t,r)=>lr(e,t,r),e.safeDecode=(t,r)=>dr(e,t,r),e.safeEncodeAsync=async(t,r)=>pr(e,t,r),e.safeDecodeAsync=async(t,r)=>hr(e,t,r),e.refine=(t,r)=>e.check(Fr(t,r)),e.superRefine=t=>e.check(Vr(t)),e.overwrite=t=>e.check(It(t)),e.optional=()=>$e(e),e.exactOptional=()=>Nr(e),e.nullable=()=>Se(e),e.nullish=()=>$e(Se(e)),e.nonoptional=t=>Rr(e,t),e.array=()=>We(e),e.or=t=>wr([e,t]),e.and=t=>Or(e,t),e.transform=t=>Pe(e,Pr(t)),e.default=t=>jr(e,t),e.prefault=t=>Ar(e,t),e.catch=t=>Cr(e,t),e.pipe=t=>Pe(e,t),e.readonly=()=>xr(e),e.describe=t=>{const r=e.clone();return M.add(r,{description:t}),r},Object.defineProperty(e,"description",{get(){return M.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return M.get(e);const r=e.clone();return M.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Xe=f("ZodNumber",(e,n)=>{Ve.init(e,n),y.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Jt(e,r,o),e.gt=(r,o)=>e.check(ze(r,o)),e.gte=(r,o)=>e.check(X(r,o)),e.min=(r,o)=>e.check(X(r,o)),e.lt=(r,o)=>e.check(ve(r,o)),e.lte=(r,o)=>e.check(B(r,o)),e.max=(r,o)=>e.check(B(r,o)),e.int=r=>e.check(ke(r)),e.safe=r=>e.check(ke(r)),e.positive=r=>e.check(ze(0,r)),e.nonnegative=r=>e.check(X(0,r)),e.negative=r=>e.check(ve(0,r)),e.nonpositive=r=>e.check(B(0,r)),e.multipleOf=(r,o)=>e.check(be(r,o)),e.step=(r,o)=>e.check(be(r,o)),e.finite=()=>e;const t=e._zod.bag;e.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),e.isFinite=!0,e.format=t.format??null});function Z(e){return Pt(Xe,e)}const mr=f("ZodNumberFormat",(e,n)=>{it.init(e,n),Xe.init(e,n)});function ke(e){return Et(mr,e)}const _r=f("ZodUnknown",(e,n)=>{ut.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Ut()});function Oe(){return Nt(_r)}const gr=f("ZodNever",(e,n)=>{ct.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>xt(e,t,r)});function yr(e){return Tt(gr,e)}const vr=f("ZodArray",(e,n)=>{at.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Gt(e,t,r,o),e.element=n.element,e.min=(t,r)=>e.check(we(t,r)),e.nonempty=t=>e.check(we(1,t)),e.max=(t,r)=>e.check(Zt(t,r)),e.length=(t,r)=>e.check(jt(t,r)),e.unwrap=()=>e.element});function We(e,n){return At(vr,e,n)}const zr=f("ZodObject",(e,n)=>{lt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Kt(e,t,r,o),m(e,"shape",()=>n.shape),e.keyof=()=>$r(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Oe()}),e.loose=()=>e.clone({...e._zod.def,catchall:Oe()}),e.strict=()=>e.clone({...e._zod.def,catchall:yr()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>In(e,t),e.safeExtend=t=>An(e,t),e.merge=t=>Rn(e,t),e.pick=t=>Zn(e,t),e.omit=t=>jn(e,t),e.partial=(...t)=>Dn(en,e,t[0]),e.required=(...t)=>Cn(nn,e,t[0])});function Qe(e,n){const t={type:"object",shape:e??{},..._(n)};return new zr(t)}const br=f("ZodUnion",(e,n)=>{dt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>qt(e,t,r,o),e.options=n.options});function wr(e,n){return new br({type:"union",options:e,..._(n)})}const kr=f("ZodIntersection",(e,n)=>{pt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Yt(e,t,r,o)});function Or(e,n){return new kr({type:"intersection",left:e,right:n})}const ee=f("ZodEnum",(e,n)=>{ht.init(e,n),y.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Ft(e,r,o),e.enum=n.entries,e.options=Object.values(n.entries);const t=new Set(Object.keys(n.entries));e.extract=(r,o)=>{const i={};for(const s of r)if(t.has(s))i[s]=n.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ee({...n,checks:[],..._(o),entries:i})},e.exclude=(r,o)=>{const i={...n.entries};for(const s of r)if(t.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new ee({...n,checks:[],..._(o),entries:i})}});function $r(e,n){const t=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ee({type:"enum",entries:t,..._(n)})}const Sr=f("ZodTransform",(e,n)=>{mt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Lt(e,t),e._zod.parse=(t,r)=>{if(r.direction==="backward")throw new Ze(e.constructor.name);t.addIssue=i=>{if(typeof i=="string")t.issues.push(x(i,t.value,n));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=t.value),s.inst??(s.inst=e),t.issues.push(x(s))}};const o=n.transform(t.value,t);return o instanceof Promise?o.then(i=>(t.value=i,t)):(t.value=o,t)}});function Pr(e){return new Sr({type:"transform",transform:e})}const en=f("ZodOptional",(e,n)=>{Ke.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Be(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function $e(e){return new en({type:"optional",innerType:e})}const Er=f("ZodExactOptional",(e,n)=>{_t.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Be(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function Nr(e){return new Er({type:"optional",innerType:e})}const Tr=f("ZodNullable",(e,n)=>{gt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Ht(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function Se(e){return new Tr({type:"nullable",innerType:e})}const Zr=f("ZodDefault",(e,n)=>{yt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Xt(e,t,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function jr(e,n){return new Zr({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():Re(n)}})}const Ir=f("ZodPrefault",(e,n)=>{vt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Wt(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function Ar(e,n){return new Ir({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():Re(n)}})}const nn=f("ZodNonOptional",(e,n)=>{zt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Bt(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function Rr(e,n){return new nn({type:"nonoptional",innerType:e,..._(n)})}const Dr=f("ZodCatch",(e,n)=>{bt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Qt(e,t,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Cr(e,n){return new Dr({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const Mr=f("ZodPipe",(e,n)=>{wt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>er(e,t,r,o),e.in=n.in,e.out=n.out});function Pe(e,n){return new Mr({type:"pipe",in:e,out:n})}const Jr=f("ZodReadonly",(e,n)=>{kt.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>nr(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function xr(e){return new Jr({type:"readonly",innerType:e})}const Ur=f("ZodCustom",(e,n)=>{Ot.init(e,n),y.init(e,n),e._zod.processJSONSchema=(t,r,o)=>Vt(e,t)});function Fr(e,n={}){return Rt(Ur,e,n)}function Vr(e){return Dt(e)}const Lr=e=>Qe({pages:Z(),nextPage:Z().optional(),totalElements:Z(),currentPage:Z(),pageSize:Z(),elements:We(e)}),Gr=Qe({page:Z().optional(),pageSize:Z().optional()});exports.Fail=cn;exports.Failure=an;exports.Guid=R;exports.Ok=un;exports.PageQuery=Gr;exports.convertDateInfoToDateRange=mn;exports.createPageSchema=Lr;exports.formatDate=Ee;exports.formatDateTime=hn;exports.formatTime=Ne;exports.isFailure=ln;exports.mock=sn;exports.notFailure=fn;exports.parseConfig=dn;exports.sleep=pn;
package/dist/index.mjs CHANGED
@@ -2116,8 +2116,8 @@ const Kr = (e) => Xe({
2116
2116
  pageSize: Z(),
2117
2117
  elements: Be(e)
2118
2118
  }), Gr = Xe({
2119
- page: Z(),
2120
- pageSize: Z()
2119
+ page: Z().optional(),
2120
+ pageSize: Z().optional()
2121
2121
  });
2122
2122
  export {
2123
2123
  Dr as Fail,
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  export declare const PageQuery: z.ZodObject<{
3
- page: z.ZodNumber;
4
- pageSize: z.ZodNumber;
3
+ page: z.ZodOptional<z.ZodNumber>;
4
+ pageSize: z.ZodOptional<z.ZodNumber>;
5
5
  }, z.core.$strip>;
6
6
  export type PageQuery = z.infer<typeof PageQuery>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsfsi-core/ts-crossplatform",
3
- "version": "1.1.28",
3
+ "version": "1.1.30",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",