@redocly/cli 0.0.0-snapshot.1793292082 → 0.0.0-snapshot.1793345699
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/lib/chunks/{OVEEYP4V.js → 27JBY2LG.js} +1 -1
- package/lib/chunks/{TUTUP63W.js → 2EVLFD7C.js} +2 -2
- package/lib/chunks/{V367SXKL.js → 2MLV5RIV.js} +1 -1
- package/lib/chunks/{2QFXACSL.js → 2QPGLBWZ.js} +1 -1
- package/lib/chunks/{NLYEY4IL.js → 37AWHVNL.js} +1 -1
- package/lib/chunks/{F33X4K7Y.js → 3CTUPCPU.js} +1 -1
- package/lib/chunks/{QLQF3OUM.js → 54N6XEVM.js} +1 -1
- package/lib/chunks/{U726U3UN.js → 5JIUCNER.js} +1 -1
- package/lib/chunks/{IN47YLQJ.js → 6HBMA77O.js} +1 -1
- package/lib/chunks/{NZ5COIWY.js → 7TFIHSMN.js} +1 -1
- package/lib/chunks/{UXUKLGZR.js → 7YNT3GTR.js} +1 -1
- package/lib/chunks/{LEBGLQKH.js → AQ34YLFO.js} +1 -1
- package/lib/chunks/{6NILUA6J.js → B7I2SJQ2.js} +1 -1
- package/lib/chunks/{3YBIOOA6.js → B7U3CPK6.js} +1 -1
- package/lib/chunks/{E3BNTXPC.js → BAS4KF6Q.js} +2 -2
- package/lib/chunks/{37RELIYJ.js → BC6MJ5ZP.js} +1 -1
- package/lib/chunks/{NTB45IEG.js → BGVPRP6S.js} +1 -1
- package/lib/chunks/{5GVSCEJ7.js → BLS75RIK.js} +1 -1
- package/lib/chunks/{ICTRWWYT.js → CDTVGJXP.js} +1 -1
- package/lib/chunks/{UK2DGEOO.js → CHV6XZ36.js} +1 -1
- package/lib/chunks/{OSVWRMWJ.js → CS4YD254.js} +2 -2
- package/lib/chunks/{UL6N25OW.js → DJASRYRA.js} +1 -1
- package/lib/chunks/{5L4SM54P.js → DQUC6VQ4.js} +1 -1
- package/lib/chunks/{7UR2KEAB.js → EB3WXZ4Z.js} +2 -2
- package/lib/chunks/{OVV6HEUY.js → EIEHWTHU.js} +1 -1
- package/lib/chunks/{7PNYBTKP.js → ERA63FIS.js} +1 -1
- package/lib/chunks/{KOXTIULA.js → ETT7L7GS.js} +1 -1
- package/lib/chunks/{HLWNHCUH.js → F5SGG6AT.js} +1 -1
- package/lib/chunks/{5QFA4TPC.js → FFQCFKOA.js} +1 -1
- package/lib/chunks/{UWQV4OSC.js → FQ5TX7OY.js} +1 -1
- package/lib/chunks/{NYOQOAZH.js → FWPO34ZN.js} +1 -1
- package/lib/chunks/{X6GKJRFL.js → FXFFEZKA.js} +1 -1
- package/lib/chunks/{67O2EDGS.js → G67FKJED.js} +1 -1
- package/lib/chunks/{OAY6JQKH.js → G7Y2V5YZ.js} +1 -1
- package/lib/chunks/{GUQSTT7X.js → GFIJRHH4.js} +1 -1
- package/lib/chunks/{Y6P63Z5O.js → GV7CJGK5.js} +1 -1
- package/lib/chunks/{6726YS6C.js → HW6QCOKE.js} +1 -1
- package/lib/chunks/{SWIZKNJF.js → JTBMOMS7.js} +1 -1
- package/lib/chunks/{Y754ED4U.js → K66EVS2A.js} +1 -1
- package/lib/chunks/{TUXCORFP.js → K6OECLXK.js} +1 -1
- package/lib/chunks/{SCZ5N5HK.js → KCGKYOSZ.js} +1 -1
- package/lib/chunks/{LWRI6ORR.js → KLERVVY7.js} +1 -1
- package/lib/chunks/{URDFOYHX.js → L7MR4XRI.js} +1 -1
- package/lib/chunks/{FTKR6QTZ.js → M6MMLWOW.js} +1 -1
- package/lib/chunks/{5AVJQEQ2.js → O4JC5ZYW.js} +1 -1
- package/lib/chunks/{LB2R5NEZ.js → OBOPBF6L.js} +1 -1
- package/lib/chunks/{STFCOCLI.js → OM2R7PIP.js} +1 -1
- package/lib/chunks/{RFDFRLEN.js → OMJ4IGXU.js} +1 -1
- package/lib/chunks/{HOMOEDCV.js → P77ZDSK5.js} +1 -1
- package/lib/chunks/{HNTRA4CQ.js → PGEE6NGB.js} +1 -1
- package/lib/chunks/{QWUJZWBB.js → PM72YBPD.js} +94 -94
- package/lib/chunks/{Q7IGM4PZ.js → PRHQSL5Q.js} +1 -1
- package/lib/chunks/{LSTWD3RY.js → PVJOPNGB.js} +2 -2
- package/lib/chunks/{OLJNHXD3.js → PXLG2O2D.js} +1 -1
- package/lib/chunks/{SSOX4Q2G.js → QLPRBVQH.js} +1 -1
- package/lib/chunks/{A4H2VAI2.js → QZEU67O7.js} +1 -1
- package/lib/chunks/{GJORXHVL.js → REZOG2EB.js} +1 -1
- package/lib/chunks/{AGOP747K.js → RHG7IHFB.js} +1 -1
- package/lib/chunks/{QN2B3LBN.js → S7FLBVL7.js} +1 -1
- package/lib/chunks/{4MKRIAOV.js → SBHLM3D2.js} +1 -1
- package/lib/chunks/{O36ZTP4J.js → SCIKLUY2.js} +1 -1
- package/lib/chunks/{4E7KOQ4D.js → SFXXNB2A.js} +1 -1
- package/lib/chunks/{QJ6KSKQN.js → SNQBAVWK.js} +1 -1
- package/lib/chunks/{D34FD4Y7.js → TC3NWSEQ.js} +1 -1
- package/lib/chunks/{O64JZRAI.js → TMHC44IS.js} +1 -1
- package/lib/chunks/{JUXBVRHT.js → UPUBGGGR.js} +1 -1
- package/lib/chunks/{MB7Q3EBG.js → WBMPXF3E.js} +1 -1
- package/lib/chunks/{P4G2PB3T.js → WGMHBODA.js} +3 -3
- package/lib/chunks/{IK4B3PXO.js → WJB6E2CD.js} +1 -1
- package/lib/chunks/{IPULJ5CS.js → WWETFZG7.js} +1 -1
- package/lib/chunks/{MMEVJY4T.js → WZXF2LUO.js} +1 -1
- package/lib/chunks/{B7KJFY65.js → XBUTD5N3.js} +1 -1
- package/lib/chunks/{Q7ZKWTSX.js → XETS7OLS.js} +1 -1
- package/lib/chunks/{AZLWVYNQ.js → Y4GRIERP.js} +1 -1
- package/lib/chunks/{2WQ6N4LV.js → YBVEBHD7.js} +1 -1
- package/lib/chunks/{UGCHQ6YG.js → YZGGKIJC.js} +1 -1
- package/lib/chunks/{3OPXSVVF.js → Z5UY6T4Q.js} +1 -1
- package/lib/chunks/{KMUII76V.js → ZGAEFEFM.js} +1 -1
- package/lib/eject-assets/generators/cli/docs.ts +1 -1
- package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
- package/lib/eject-assets/generators/cli/index.ts +2 -2
- package/lib/eject-assets/generators/cli/render.ts +1 -1
- package/lib/eject-assets/generators/go/client.ts +1 -1
- package/lib/eject-assets/generators/go/descriptor.ts +1 -1
- package/lib/eject-assets/generators/go/index.ts +2 -2
- package/lib/eject-assets/generators/go/models.ts +1 -1
- package/lib/eject-assets/generators/go/naming.ts +1 -1
- package/lib/eject-assets/generators/go/operations.ts +1 -1
- package/lib/eject-assets/generators/go/pagination.ts +1 -1
- package/lib/eject-assets/generators/go/types.ts +1 -1
- package/lib/eject-assets/generators/java/client.ts +1 -1
- package/lib/eject-assets/generators/java/descriptor.ts +1 -1
- package/lib/eject-assets/generators/java/index.ts +2 -2
- package/lib/eject-assets/generators/java/models.ts +1 -1
- package/lib/eject-assets/generators/java/naming.ts +1 -1
- package/lib/eject-assets/generators/java/operations.ts +1 -1
- package/lib/eject-assets/generators/java/pagination.ts +1 -1
- package/lib/eject-assets/generators/java/types.ts +1 -1
- package/lib/eject-assets/generators/mock/faker.ts +1 -1
- package/lib/eject-assets/generators/mock/index.ts +2 -2
- package/lib/eject-assets/generators/mock/render.ts +1 -1
- package/lib/eject-assets/generators/mock/sample.ts +1 -1
- package/lib/eject-assets/generators/mock/values.ts +1 -1
- package/lib/eject-assets/generators/php/client.ts +1 -1
- package/lib/eject-assets/generators/php/descriptor.ts +1 -1
- package/lib/eject-assets/generators/php/index.ts +2 -2
- package/lib/eject-assets/generators/php/models.ts +1 -1
- package/lib/eject-assets/generators/php/naming.ts +1 -1
- package/lib/eject-assets/generators/php/operations.ts +1 -1
- package/lib/eject-assets/generators/php/pagination.ts +1 -1
- package/lib/eject-assets/generators/php/types.ts +1 -1
- package/lib/eject-assets/generators/python/client.ts +1 -1
- package/lib/eject-assets/generators/python/descriptor.ts +1 -1
- package/lib/eject-assets/generators/python/index.ts +2 -2
- package/lib/eject-assets/generators/python/models.ts +1 -1
- package/lib/eject-assets/generators/python/naming.ts +1 -1
- package/lib/eject-assets/generators/python/operations.ts +1 -1
- package/lib/eject-assets/generators/python/pagination.ts +1 -1
- package/lib/eject-assets/generators/python/types.ts +1 -1
- package/lib/eject-assets/generators/swr/index.ts +2 -2
- package/lib/eject-assets/generators/swr/render.ts +1 -1
- package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
- package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
- package/lib/eject-assets/generators/transformers/index.ts +2 -2
- package/lib/eject-assets/generators/transformers/render.ts +1 -1
- package/lib/eject-assets/generators/typescript/banner.ts +1 -1
- package/lib/eject-assets/generators/typescript/client.ts +1 -1
- package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
- package/lib/eject-assets/generators/typescript/index.ts +2 -2
- package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
- package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
- package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
- package/lib/eject-assets/generators/typescript/operations.ts +1 -1
- package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
- package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
- package/lib/eject-assets/generators/typescript/types.ts +1 -1
- package/lib/eject-assets/generators/zod/index.ts +2 -2
- package/lib/eject-assets/generators/zod/schemas.ts +1 -1
- package/lib/index.js +4 -4
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a as $,b as a,c,d as i,e as m,f}from"./
|
|
7
|
+
import{a as $,b as a,c,d as i,e as m,f}from"./FQ5TX7OY.js";import{k as l}from"./PXLG2O2D.js";import{join as p}from"node:path";function k(t,n){let e=$(t,"swr");if(e.length===0)return"";let s=e.some(a),o=e.some(r=>!a(r));return[...s?['import useSWR from "swr";']:[],...o?['import useSWRMutation from "swr/mutation";']:[],f(e,n.sdkModule,s),...e.flatMap(r=>a(r)?g(r):[S(r)])].join(`
|
|
8
8
|
|
|
9
9
|
`)}function y(t,n,e){return`export function use${l(t.name)}(${n}) {
|
|
10
10
|
return ${e};
|
|
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{c as S,ka as A}from"./
|
|
7
|
+
import{c as S,ka as A}from"./PM72YBPD.js";var E=class{indentUnit;lines=[];depth=0;constructor(n=" "){this.indentUnit=n}line(n=""){return this.lines.push(n===""?"":this.indentUnit.repeat(this.depth)+n),this}blank(){return this.line()}indent(n){return this.depth++,n(),this.depth--,this}block(n,t,r){return this.line(n),this.indent(t),r===void 0?this:this.line(r)}toString(){return this.lines.join(`
|
|
8
8
|
`)+`
|
|
9
9
|
`}};function b(e){return e.replace(/^\+(?=\d)/,"plus ").replace(/^-(?=\d)/,"minus ").replace(/([A-Z]{2,})s(?![a-z])/g,"$1S").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).filter(n=>n!=="").map(n=>n.toLowerCase())}var T=e=>e.charAt(0).toUpperCase()+e.slice(1),w={camel:e=>{let[n,...t]=b(e);return(n??"")+t.map(T).join("")},pascal:e=>b(e).map(T).join(""),snake:e=>b(e).join("_"),screaming:e=>b(e).join("_").toUpperCase()},Y={typescript:new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","implements","interface","let","package","private","protected","public","static","yield","await"]),python:new Set(["false","none","true","and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield","match","case","type"]),go:new Set(["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"]),php:new Set(["abstract","and","array","as","break","callable","case","catch","class","clone","const","continue","declare","default","die","do","echo","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","exit","extends","final","finally","fn","for","foreach","function","global","goto","if","implements","include","instanceof","insteadof","interface","isset","list","match","namespace","new","or","print","private","protected","public","readonly","require","return","static","switch","throw","trait","try","unset","use","var","while","xor","yield","true","false","null","int","float","bool","string","void","iterable","object","mixed","never","self","parent"]),java:new Set(["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instanceof","int","interface","long","native","new","package","private","protected","public","return","short","static","strictfp","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while","true","false","null","var","yield","record","sealed","permits","non-sealed"])};function U(e,n={}){let t=w[n.style??"camel"](e),r=t===""?"_":/^[0-9]/.test(t)?`_${t}`:t;return n.reserved?.has(r.toLowerCase())?`${r}_`:r}function P(e,n={}){let t=new Set(n.taken??[]),r=n.style==="snake"||n.style==="screaming"?"_":"";return e.map(a=>{let s=U(a,n),i=s;for(let o=2;t.has(i);o++)i=`${s}${r}${o}`;return t.add(i),i})}function m(e,n){let t=new Set,r=e;for(;r.kind==="ref";){let{name:a}=r;if(t.has(a))return;t.add(a);let s=n.schemas.find(i=>i.name===a);if(s===void 0)return;r=s.schema}return r}function F(e,n){let t=m(e,n);if(t===void 0)return;if(t.kind==="object")return{properties:t.properties,description:t.description};if(t.kind!=="intersection")return;let r=new Map;for(let a of t.members){let s=F(a,n);if(s===void 0)return;for(let i of s.properties)r.set(i.name,i)}return{properties:[...r.values()],description:t.description}}function ee(e,n){let t=m(e,n);if(t?.kind!=="union"||t.discriminator===void 0)return;let r=[];for(let{value:a,schemaName:s}of t.discriminator.mapping){let i=m({kind:"ref",name:s},n);if(i===void 0)return;r.push({value:a,schemaName:s,schema:i})}return{property:t.discriminator.propertyName,cases:r}}function K(e){return e.kind==="union"&&e.members.some(n=>n.kind==="null")}function ne(e){if(e.kind!=="union"||!K(e))return e;let n=e.members.filter(t=>t.kind!=="null");return n.length===1?n[0]:{...e,members:n}}function te(e){if(e.kind!=="enum")return;let n=P(e.values.map(t=>typeof t=="string"?w.screaming(t):`VALUE_${w.screaming(String(t))}`),{style:"screaming"});return{values:e.values,scalar:e.scalar,memberNames:n}}function re(e){if(!e)return[];let n=e.split(/\r\n|\n|\r/).map(t=>t.trim());for(;n.length>0&&n[0]==="";)n.shift();for(;n.length>0&&n[n.length-1]==="";)n.pop();return n}function q(e,n,t){if(e.kind==="object")return e.properties.find(r=>r.name===n)?.schema;if(e.kind==="record")return e.value;if(e.kind==="array"&&/^(0|[1-9]\d*)$/.test(n))return e.items;if(e.kind==="intersection"){let r;for(let a of e.members){let s=m(a,t);s!==void 0&&(r=q(s,n,t)??r)}return r}}function g(e,n,t){let r=e.kind==="omit"?{kind:"ref",name:e.base}:e,a=m(r,t);if(!(a===void 0||n!==""&&!n.startsWith("/"))){if(n==="")return a;for(let s of n.slice(1).split("/")){let i=s.replaceAll("~1","/").replaceAll("~0","~"),o=q(a,i,t);if(o===void 0||(a=m(o,t),a===void 0))return}return a}}function v(e,n,t=new Set){if(e.kind==="ref"){if(t.has(e.name))return"string";t.add(e.name);let r=n.schemas.find(a=>a.name===e.name);return r===void 0?"string":v(r.schema,n,t)}if(e.kind==="intersection"){let r=e.members.filter(s=>s.kind!=="unknown");if(r.length===1)return v(r[0],n,t);let a=[...new Set(r.map(s=>v(s,n,new Set(t))))];return a.length===1?a[0]:a.every(s=>s==="integer"||s==="number")?"number":"string"}if(e.kind==="union"){let r=e.members.filter(a=>a.kind!=="null");return r.length===1?v(r[0],n,t):"string"}if(e.kind==="scalar"||e.kind==="enum"){if(e.scalar==="integer")return"integer";if(e.scalar==="number")return"number";if(e.scalar==="boolean")return"boolean"}if(e.kind==="literal"){if(typeof e.value=="number")return Number.isInteger(e.value)?"integer":"number";if(typeof e.value=="boolean")return"boolean"}return"string"}function I(e){return e.flatMap(n=>n.operations)}function M(e,n,t){let r=e.specName??e.name;if(t?.exclude?.includes(r))return{};let a=t?.operations?.[r];if(a!==void 0)return x(e,n,a,`pagination.operations["${r}"]`,!0);if(e.paginationExtension!==void 0)return x(e,n,e.paginationExtension,"x-redoclyPagination",!0);if(t?.style!==void 0){let{exclude:s,operations:i,...o}=t;return x(e,n,o,"pagination convention",!1)}return{}}function le(e,n){let t=new Map,r=[];for(let a of I(e.services)){let s=M(a,e,n);s.error!==void 0?r.push(s.error):s.spec!==void 0&&t.set(a.name,{spec:s.spec,itemSchema:s.itemSchema})}if(r.length>0)throw new Error(["Invalid pagination configuration:",...r].join(`
|
|
10
10
|
- `));return t}function x(e,n,t,r,a){let s=`Pagination for operation "${e.name}" (${r})`,i=B(t);if(i!==void 0)return{error:`${s}: ${i}`};let o=t,d=l=>a?{error:`${s}: ${l}`}:{};if(e.sse!==void 0)return d("the operation is a Server-Sent Events stream");if(o.style!=="link"&&o.style!=="body-link"){let l=o.style==="cursor"?"cursorParam":"offsetParam",c=o.style==="cursor"?o.cursorParam:o.offsetParam,O=e.queryParams.find(u=>u.name===c);if(!O){let u=e.queryParams.map(D=>D.name).join(", ");return d(`query parameter "${c}" is not declared on the operation`+(u===""?"":` (declared: ${u})`))}let p=j(O.schema,n);if(!(p!==void 0&&(o.style==="cursor"?k(p,n):p.kind==="scalar"&&(p.scalar==="number"||p.scalar==="integer")))){let u=o.style==="cursor"?"a string":"a number";return d(`the "${l}" query parameter "${c}" must accept ${u} (got ${H(p)})`)}}let h=e.successResponses.find(l=>l.contentType.toLowerCase().includes("json"));if(!h)return d("the operation has no JSON success response");if(o.style==="link"){let l=e.successResponseHeaders?.some(c=>c.name==="link")===!0;if(!l&&!a)return{};l||A.warn(`generate-client: ${s.toLowerCase()} follows the Link header, but the success response does not document one.
|
|
@@ -5684,4 +5684,4 @@ async function runSingle(
|
|
|
5684
5684
|
}
|
|
5685
5685
|
return fail(1, detail);
|
|
5686
5686
|
}
|
|
5687
|
-
}`},$=["ApiError","ApiErrorLike","AuthCredentials","BodyMethod","Capabilities","CliAuthScheme","CliCommand","CliFlag","CliGlobals","CliInvocation","CliWiring","Client","ClientConfig","ClientCore","CommandContext","CommandSource","CustomCommand","Envelope","EnvelopeResult","EnvelopeResultForKnownInit","FRAME_DELIMITER","GLOBAL_FLAGS","HeadersOf","IDEMPOTENT_METHODS","LAYERS","LAYER_OF","LinkPageCall","Middleware","NoRequiredKeys","OperationArgs","OperationContext","OperationDescriptor","OperationMethodIdentity","OpsShape","PageOf","Paginated","PaginationSpec","ParamSpec","ParseAs","QueryStyle","QueryValue","RequestContext","RequestOptions","ResolvedCommand","ResponseHeaderSpec","Result","RetryConfig","RetryContext","RetryStrategy","SecuritySpec","SendCapabilities","ServerSentEvent","SettledCall","SseOptions","SseParseError","TRANSIENT_STATUS","ThrowMethod","TimeoutError","TokenProvider","abortError","acceptFor","anySignal","buildUrl","callInputs","coerceResponseHeader","commandContract","constantCase","createClientCore","defaultRetryOn","encodeBase64","encodeReserved","execute","groupSlug","inputOf","invokedName","isConfigured","items","itemsByLink","kindFor","linkNext","linkPageCall","loadBody","mergeSetup","middlewareChain","namespaceArgs","normalizeCommands","oneLine","pageCall","pages","pagesByLink","paginateCapability","parse","parseInvocation","parseSseFrame","prepareRequest","queryStyles","readEnvelopeHeaders","readError","redactHeaders","renderComposedHelp","renderHelp","resolveAuth","resolvePointer","resolveToken","retryDelay","runCli","runSingle","runSources","send","shadowedCommandName","sleep","splitArgs","sse","stringHeaders","substitutePath","timeoutSignal","toFormData","toHeaderRecord"];var z=["client","OPERATIONS","Ops","OperationId","OperationPath","OperationTag","createClient","mergeSetup","ApiError","TimeoutError","configure","use","auth","defaultRetryOn","ClientConfig","RequestOptions","SseOptions","Middleware","OperationDescriptor","ServerSentEvent","Result","Envelope","EnvelopeResult","TokenProvider","__redoclySetup"],_=["z","http","HttpResponse","handlers","faker","queryOptions","useSWR","useSWRMutation","__Writable"],G=["AbortController","AbortSignal","Array","ArrayBuffer","ArrayBufferView","AsyncGenerator","AsyncIterable","Blob","BodyInit","Boolean","DOMException","Date","Error","Extract","FormData","Headers","HeadersInit","JSON","Map","Math","NonNullable","Number","Object","Omit","Partial","Promise","ReadableStream","Record","RegExp","RegExpExecArray","Request","RequestInit","Response","Set","String","Symbol","TextDecoder","TextEncoder","TypeError","Uint8Array","URL","URLSearchParams","btoa","clearTimeout","crypto","decodeURIComponent","document","encodeURIComponent","fetch","globalThis","setTimeout","undefined"],R;function fe(){return R===void 0&&(R=new Set([...z,..._,...G,...$])),R}var L={name:"@redocly/client-generator",version:"0.0.0-snapshot.
|
|
5687
|
+
}`},$=["ApiError","ApiErrorLike","AuthCredentials","BodyMethod","Capabilities","CliAuthScheme","CliCommand","CliFlag","CliGlobals","CliInvocation","CliWiring","Client","ClientConfig","ClientCore","CommandContext","CommandSource","CustomCommand","Envelope","EnvelopeResult","EnvelopeResultForKnownInit","FRAME_DELIMITER","GLOBAL_FLAGS","HeadersOf","IDEMPOTENT_METHODS","LAYERS","LAYER_OF","LinkPageCall","Middleware","NoRequiredKeys","OperationArgs","OperationContext","OperationDescriptor","OperationMethodIdentity","OpsShape","PageOf","Paginated","PaginationSpec","ParamSpec","ParseAs","QueryStyle","QueryValue","RequestContext","RequestOptions","ResolvedCommand","ResponseHeaderSpec","Result","RetryConfig","RetryContext","RetryStrategy","SecuritySpec","SendCapabilities","ServerSentEvent","SettledCall","SseOptions","SseParseError","TRANSIENT_STATUS","ThrowMethod","TimeoutError","TokenProvider","abortError","acceptFor","anySignal","buildUrl","callInputs","coerceResponseHeader","commandContract","constantCase","createClientCore","defaultRetryOn","encodeBase64","encodeReserved","execute","groupSlug","inputOf","invokedName","isConfigured","items","itemsByLink","kindFor","linkNext","linkPageCall","loadBody","mergeSetup","middlewareChain","namespaceArgs","normalizeCommands","oneLine","pageCall","pages","pagesByLink","paginateCapability","parse","parseInvocation","parseSseFrame","prepareRequest","queryStyles","readEnvelopeHeaders","readError","redactHeaders","renderComposedHelp","renderHelp","resolveAuth","resolvePointer","resolveToken","retryDelay","runCli","runSingle","runSources","send","shadowedCommandName","sleep","splitArgs","sse","stringHeaders","substitutePath","timeoutSignal","toFormData","toHeaderRecord"];var z=["client","OPERATIONS","Ops","OperationId","OperationPath","OperationTag","createClient","mergeSetup","ApiError","TimeoutError","configure","use","auth","defaultRetryOn","ClientConfig","RequestOptions","SseOptions","Middleware","OperationDescriptor","ServerSentEvent","Result","Envelope","EnvelopeResult","TokenProvider","__redoclySetup"],_=["z","http","HttpResponse","handlers","faker","queryOptions","useSWR","useSWRMutation","__Writable"],G=["AbortController","AbortSignal","Array","ArrayBuffer","ArrayBufferView","AsyncGenerator","AsyncIterable","Blob","BodyInit","Boolean","DOMException","Date","Error","Extract","FormData","Headers","HeadersInit","JSON","Map","Math","NonNullable","Number","Object","Omit","Partial","Promise","ReadableStream","Record","RegExp","RegExpExecArray","Request","RequestInit","Response","Set","String","Symbol","TextDecoder","TextEncoder","TypeError","Uint8Array","URL","URLSearchParams","btoa","clearTimeout","crypto","decodeURIComponent","document","encodeURIComponent","fetch","globalThis","setTimeout","undefined"],R;function fe(){return R===void 0&&(R=new Set([...z,..._,...G,...$])),R}var L={name:"@redocly/client-generator",version:"0.0.0-snapshot.1793345699",description:"Generate typed, zero-dependency TypeScript clients (fetch, auth, retries, middleware, SSE) from OpenAPI descriptions.",type:"module",types:"lib/index.d.ts",sideEffects:!1,exports:{".":{types:"./lib/index.d.ts",import:"./lib/index.js",default:"./lib/index.js"},"./generate":{types:"./lib/generate.d.ts",import:"./lib/generate.js",default:"./lib/generate.js"},"./printers/python":{types:"./lib/printers/python.d.ts",import:"./lib/printers/python.js",default:"./lib/printers/python.js"},"./printers/go":{types:"./lib/printers/go.d.ts",import:"./lib/printers/go.js",default:"./lib/printers/go.js"},"./printers/php":{types:"./lib/printers/php.d.ts",import:"./lib/printers/php.js",default:"./lib/printers/php.js"},"./printers/java":{types:"./lib/printers/java.d.ts",import:"./lib/printers/java.js",default:"./lib/printers/java.js"},"./printers/typescript":{types:"./lib/printers/typescript.d.ts",import:"./lib/printers/typescript.js",default:"./lib/printers/typescript.js"},"./printers":{types:"./lib/printers/index.d.ts",import:"./lib/printers/index.js",default:"./lib/printers/index.js"},"./contracts/typescript":{types:"./lib/contracts/typescript.d.ts",import:"./lib/contracts/typescript.js",default:"./lib/contracts/typescript.js"},"./runtime-sources":{types:"./lib/runtime-sources.d.ts",import:"./lib/runtime-sources.js",default:"./lib/runtime-sources.js"},"./package.json":"./package.json"},engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,scripts:{"examples:regen":"node scripts/regenerate-examples.mjs",prepare:"node scripts/generate-runtime-sources.mjs && node scripts/generate-eject-assets.mjs","typecheck:examples":"node scripts/typecheck-examples.mjs"},license:"MIT",repository:{type:"git",url:"git+https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["OpenAPI","Swagger","TypeScript","client","generator","codegen","fetch"],contributors:["Roman Marshevskyi <roman.marshevskyy@redocly.com> (https://redocly.com/)"],dependencies:{"@redocly/openapi-core":"0.0.0-snapshot.1793345699"},peerDependencies:{typescript:">=5.5.0"},peerDependenciesMeta:{typescript:{optional:!0}},devDependencies:{typescript:"6.0.2"},files:["lib","eject-assets"]};var ve=L.version;function N(e){let n=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(e.trim());return n===null?void 0:[Number(n[1]),Number(n[2]),Number(n[3])]}function C(e,n){return e[0]-n[0]||e[1]-n[1]||e[2]-n[2]}function ke(e,n){let t=/^[\^~]|^>=/.exec(n.trim())?.[0]??"",r=N(n.trim().slice(t.length)),a=N(e);if(!(r===void 0||a===void 0))return C(a,r)<0?!1:t===">="?!0:t===""?C(a,r)===0:t==="~"?a[0]===r[0]&&a[1]===r[1]:r[0]!==0?a[0]===r[0]:r[1]!==0?a[0]===0&&a[1]===r[1]:C(a,r)===0}export{E as a,w as b,Y as c,U as d,P as e,m as f,F as g,ee as h,K as i,ne as j,te as k,re as l,g as m,v as n,I as o,le as p,ue as q,me as r,z as s,fe as t,ve as u,ke as v};
|
|
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a,b}from"./
|
|
7
|
+
import{a,b}from"./PGEE6NGB.js";import"./B7U3CPK6.js";import"./PM72YBPD.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{a as bundleTelemetry,b as handleBundle};
|
|
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{c as a,d as b}from"./
|
|
7
|
+
import{c as a,d as b}from"./WZXF2LUO.js";import"./PXLG2O2D.js";import"./2EVLFD7C.js";import"./WZXA5XPB.js";import"./PM72YBPD.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{b as generateClient,a as runGenerators};
|
|
@@ -4,6 +4,6 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{b as xe,f as Pe}from"./3YBIOOA6.js";import{$ as b,A as ue,X as le,Y as he,ba as fe,c as L,ca as de,da as j,f as ie,fa as ye,ga as U,ha as A,ka as k,la as Se,ma as ge,na as Q,oa as K,p as ae,q as pe,qa as Ce,r as ce,ta as be,v as me}from"./QWUJZWBB.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";import{performance as mt}from"perf_hooks";var D={thresholds:{maxParamsGood:5,maxDepthGood:4,maxPolymorphismGood:2,maxDependencyDepthGood:3,maxAmbiguousGood:0,maxOperationsForDiscoverability:1e3},weights:{parameterSimplicity:.1,schemaSimplicity:.1,documentationQuality:.18,constraintClarity:.12,exampleCoverage:.18,errorClarity:.12,dependencyClarity:.1,identifierClarity:.05,polymorphismClarity:.05,anyOfPenaltyMultiplier:2,discoverabilityWeight:.1},hotspotLimit:10},Oe=new Set(["id","name","type","value","data","key","status","state","code","result","item","object","resource","entity","input","output","payload","body","content","info"]);function B(e){if(e.length===0)return 0;let r=[...e].sort((o,n)=>o-n),t=Math.floor(r.length/2);return r.length%2!==0?r[t]:(r[t-1]+r[t])/2}function He(e,r,t=D){let{thresholds:o,weights:n}=t,s=x(1-e.parameterCount/(o.maxParamsGood*2)),a=Math.max(e.maxRequestSchemaDepth,e.maxResponseSchemaDepth)/(o.maxDepthGood*2),c=De(e,n.anyOfPenaltyMultiplier)/(o.maxPolymorphismGood*3),h=x(1-a-c),u=(e.operationDescriptionPresent?1:0)+e.paramsWithDescription+e.schemaPropertiesWithDescription,f=1+e.parameterCount+e.totalSchemaProperties,$=f>0?x(u/f):1,O=e.totalSchemaProperties>0?x(e.constraintCount/e.totalSchemaProperties):1,y=(e.requestExamplePresent?1:0)+(e.responseExamplePresent?1:0),g=(e.requestBodyPresent?1:0)+1,M=x(y/g),T=e.totalErrorResponses>0?x(e.structuredErrorResponseCount/e.totalErrorResponses):1,I=x(1-r/(o.maxDependencyDepthGood*2)),l=x(1-e.ambiguousIdentifierCount/Math.max(o.maxAmbiguousGood+3,1)),m=De(e,n.anyOfPenaltyMultiplier),d=m===0?1:e.hasDiscriminator?x(1-m/(o.maxPolymorphismGood*4)):x(1-m/(o.maxPolymorphismGood*2));return{parameterSimplicity:s,schemaSimplicity:h,documentationQuality:$,constraintClarity:O,exampleCoverage:M,errorClarity:T,dependencyClarity:I,identifierClarity:l,polymorphismClarity:d}}function ze(e,r=D){let t=r.weights,o=e.parameterSimplicity*t.parameterSimplicity+e.schemaSimplicity*t.schemaSimplicity+e.documentationQuality*t.documentationQuality+e.constraintClarity*t.constraintClarity+e.exampleCoverage*t.exampleCoverage+e.errorClarity*t.errorClarity+e.dependencyClarity*t.dependencyClarity+e.identifierClarity*t.identifierClarity+e.polymorphismClarity*t.polymorphismClarity;return $e(x(o)*100)}function Re(e,r,t=D){let o=new Map;for(let[n,s]of e.operations){let i=r.get(n)??0,a=He(s,i,t);o.set(n,{agentReadiness:ze(a,t),subscores:a})}return o}function Me(e,r=D){return x(1-e/r.thresholds.maxOperationsForDiscoverability)}function ve(e,r,t=D){if(e.size===0)return{agentReadiness:100};let o=[];for(let i of e.values())o.push(i.agentReadiness);let n=t.weights.discoverabilityWeight,s=r*100;return{agentReadiness:$e(B(o)*(1-n)+s*n)}}function J(e,r,t){return e-r+r*t}function De(e,r){return J(e.polymorphismCount,e.anyOfCount,r)}function x(e){return Math.max(0,Math.min(1,e))}function Ee(e){let r=e.size||1,t={parameterSimplicity:0,schemaSimplicity:0,documentationQuality:0,constraintClarity:0,exampleCoverage:0,errorClarity:0,dependencyClarity:0,identifierClarity:0,polymorphismClarity:0};for(let o of e.values())t.parameterSimplicity+=o.subscores.parameterSimplicity,t.schemaSimplicity+=o.subscores.schemaSimplicity,t.documentationQuality+=o.subscores.documentationQuality,t.constraintClarity+=o.subscores.constraintClarity,t.exampleCoverage+=o.subscores.exampleCoverage,t.errorClarity+=o.subscores.errorClarity,t.dependencyClarity+=o.subscores.dependencyClarity,t.identifierClarity+=o.subscores.identifierClarity,t.polymorphismClarity+=o.subscores.polymorphismClarity;return t.parameterSimplicity/=r,t.schemaSimplicity/=r,t.documentationQuality/=r,t.constraintClarity/=r,t.exampleCoverage/=r,t.errorClarity/=r,t.dependencyClarity/=r,t.identifierClarity/=r,t.polymorphismClarity/=r,t}function $e(e){return Math.round(e*10)/10}function we(e,r,t){let o=Math.max(1,e);return r/o+t/o}function Qe(e,r){return r.totalSchemaProperties>e.totalSchemaProperties?!0:r.totalSchemaProperties<e.totalSchemaProperties?!1:we(r.totalSchemaProperties,r.schemaPropertiesWithDescription,r.constraintCount)>we(e.totalSchemaProperties,e.schemaPropertiesWithDescription,e.constraintCount)}var Ke=["enum","const","format","pattern","minimum","maximum","minLength","maxLength","minItems","maxItems","minProperties","maxProperties","multipleOf","exclusiveMinimum","exclusiveMaximum","uniqueItems"];function Y(){return{depth:-1,maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[],debugEntries:null,pendingRef:null}}function Ie(e){Object.assign(e,Y())}function Le(e){return{ref:{enter(r){typeof r?.$ref=="string"&&(e.refsUsed.push(r.$ref),e.pendingRef=r.$ref)}},Schema:{enter(r,t){e.depth++,e.maxDepth=Math.max(e.maxDepth,e.depth);let o=0;for(let i of Ke)r[i]!==void 0&&(e.constraintCount++,o++);r.discriminator?.propertyName&&(e.hasDiscriminator=!0);let n={};for(let i of["oneOf","anyOf","allOf"]){let a=r[i];Array.isArray(a)&&(e.polymorphismCount+=a.length,i==="anyOf"&&(e.anyOfCount+=a.length),n[i]=a.length)}let s=[];if(L(r.properties)){let i=Object.entries(r.properties);e.totalSchemaProperties+=i.length;for(let[a,c]of i){s.push(a);let h=c&&"$ref"in c&&c.$ref?t.resolve(c)?.node??c:c;h?.description&&e.schemaPropertiesWithDescription++,(h?.example!==void 0||h?.examples)&&(e.hasPropertyExamples=!0),h?.readOnly||e.writableTopLevelFields++}}e.debugEntries!==null&&e.debugEntries.push({ref:e.pendingRef,depth:e.depth,propertyNames:s,polymorphism:Object.keys(n).length>0?n:{},constraintCount:o}),e.pendingRef=null},leave(){e.depth--}}}}function qe(e,r,t){return{operations:new Map,currentPath:"",pathLevelParams:[],current:null,walkSchema:e,anyOfPenaltyMultiplier:r,debugOperationId:t,debugLogs:[]}}function Je(e,r,t){return{path:e,method:r,operationId:t.operationId,operationDescriptionPresent:!!t.description,parameterCount:0,requiredParameterCount:0,paramsWithDescription:0,ambiguousIdentifierCount:0,maxRequestSchemaDepth:0,maxResponseSchemaDepth:0,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,topLevelWritableFieldCount:0,requestBodyPresent:!1,requestExamplePresent:!1,responseExamplePresent:!1,structuredErrorResponseCount:0,totalErrorResponses:0,inRequestBody:!1,inResponse:!1,currentResponseCode:"",errorStructuredCounted:!1,maxEffectivePolymorphism:-1,refsUsed:new Set}}function Ye(e){let{inRequestBody:r,inResponse:t,currentResponseCode:o,errorStructuredCounted:n,maxEffectivePolymorphism:s,...i}=e;return i}function We(e){return{RequestBody:{enter(){e.current&&(e.current.requestBodyPresent=!0,e.current.inRequestBody=!0)},leave(){e.current&&(e.current.inRequestBody=!1)}},Response:{enter(r,t){let o=e.current;if(!o)return;let n=String(t.key);o.inResponse=!0,o.currentResponseCode=n,o.errorStructuredCounted=!1,Te(n)&&(o.totalErrorResponses++,!r.content&&r.description&&(o.structuredErrorResponseCount++,o.errorStructuredCounted=!0))},leave(){e.current&&(e.current.inResponse=!1)}},MediaType:{enter(r){let t=e.current;if(t&&(Ze(r)&&(t.inRequestBody&&(t.requestExamplePresent=!0),t.inResponse&&(t.responseExamplePresent=!0)),t.inResponse&&Te(t.currentResponseCode)&&!t.errorStructuredCounted&&(t.structuredErrorResponseCount++,t.errorStructuredCounted=!0),r.schema)){let o=!!e.debugOperationId&&(t.operationId===e.debugOperationId||`${t.method.toUpperCase()} ${t.path}`===e.debugOperationId),n=e.walkSchema(r.schema,o);Qe(t,n)&&(t.totalSchemaProperties=n.totalSchemaProperties,t.schemaPropertiesWithDescription=n.schemaPropertiesWithDescription,t.constraintCount=n.constraintCount);let s=J(n.polymorphismCount,n.anyOfCount,e.anyOfPenaltyMultiplier);s>t.maxEffectivePolymorphism&&(t.maxEffectivePolymorphism=s,t.polymorphismCount=n.polymorphismCount,t.anyOfCount=n.anyOfCount),n.hasDiscriminator&&(t.hasDiscriminator=!0);for(let i of n.refsUsed)t.refsUsed.add(i);if(n.hasPropertyExamples&&(t.inRequestBody&&(t.requestExamplePresent=!0),t.inResponse&&(t.responseExamplePresent=!0)),t.inRequestBody&&(t.maxRequestSchemaDepth=Math.max(t.maxRequestSchemaDepth,n.maxDepth),t.topLevelWritableFieldCount=Math.max(t.topLevelWritableFieldCount,n.writableTopLevelFields)),t.inResponse&&(t.maxResponseSchemaDepth=Math.max(t.maxResponseSchemaDepth,n.maxDepth)),o&&n.debugEntries){let i=t.inRequestBody?"REQUEST BODY":`RESPONSE ${t.currentResponseCode}`;e.debugLogs.push({context:i,entries:n.debugEntries,totalProperties:n.totalSchemaProperties,totalPolymorphism:n.polymorphismCount,totalConstraints:n.constraintCount,maxDepth:n.maxDepth})}}}},Paths:{PathItem:{enter(r,t){e.currentPath=String(t.key),e.pathLevelParams=r.parameters??[]},Operation:{enter(r,t){let o=String(t.key),n=Je(e.currentPath,o,r);e.current=n;let s=Xe(e.pathLevelParams,r.parameters??[],t.resolve);for(let i of s.values())n.parameterCount++,i.required&&n.requiredParameterCount++,i.description&&n.paramsWithDescription++,et(i)&&n.ambiguousIdentifierCount++},leave(r){let t=e.current;if(!t)return;let o=r.operationId??`${t.method.toUpperCase()} ${t.path}`;e.operations.set(o,Ye(t)),e.current=null}}}}}}function Ue(e){return{operationCount:e.operations.size,operations:e.operations}}function Ae(e,r){return r(e).node}function Xe(e,r,t){let o=new Map;for(let n of e){let s=Ae(n,t);s?.name&&s.in&&o.set(`${s.in}:${s.name}`,s)}for(let n of r){let s=Ae(n,t);s?.name&&s.in&&o.set(`${s.in}:${s.name}`,s)}return o}function Ze(e){return e.example!==void 0||ie(e.examples)}function et(e){if(e.description)return!1;let r=(e.name??"").toLowerCase();return Oe.has(r)}function Te(e){if(e==="default"||/^4xx$/i.test(e)||/^5xx$/i.test(e))return!0;let r=parseInt(e,10);return r>=400&&r<600}function tt(e,r){if(!r.startsWith("#/"))return;let t=e;for(let o of r.slice(2).split("/"))t=t?.[ce(o)];return t}function ke({document:e,types:r,resolvedRefMap:t,ctx:o,debugOperationId:n,scoringConstants:s}){let i=s?.weights.anyOfPenaltyMultiplier??D.weights.anyOfPenaltyMultiplier,a=Y(),c=Le(a),h=Q([{severity:"warn",ruleId:"score-schema",visitor:c}],r),u=(l,m)=>{Ie(a),m&&(a.debugEntries=[]),K({document:{...e,parsed:l},rootType:r.Schema,normalizedVisitors:h,resolvedRefMap:t,ctx:o});let{depth:d,pendingRef:w,debugEntries:_,...N}=a;return{...N,refsUsed:[...a.refsUsed],debugEntries:m?a.debugEntries??void 0:void 0}},f=new Map,$=new WeakSet,O={maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[]};function y(l,m){return{maxDepth:Math.max(l.maxDepth,m.maxDepth),polymorphismCount:l.polymorphismCount+m.polymorphismCount,anyOfCount:l.anyOfCount+m.anyOfCount,hasDiscriminator:l.hasDiscriminator||m.hasDiscriminator,totalSchemaProperties:l.totalSchemaProperties+m.totalSchemaProperties,schemaPropertiesWithDescription:l.schemaPropertiesWithDescription+m.schemaPropertiesWithDescription,constraintCount:l.constraintCount+m.constraintCount,hasPropertyExamples:l.hasPropertyExamples||m.hasPropertyExamples,writableTopLevelFields:l.writableTopLevelFields+m.writableTopLevelFields,refsUsed:[...l.refsUsed,...m.refsUsed],debugEntries:l.debugEntries||m.debugEntries?[...l.debugEntries??[],...m.debugEntries??[]]:void 0}}let g=(l,m=!1)=>{let d=l,w=pe(l)?l.$ref:void 0;if(w){if(!m){let S=f.get(w);if(S)return S}d=tt(e.parsed,w)??l}if(L(d)&&$.has(d))return{...O};L(d)&&$.add(d);let _=d?.oneOf,N=d?.anyOf,Z=Array.isArray(_)&&_.length>1,ee=Array.isArray(N)&&N.length>1,G=Z||ee,te=Array.isArray(d?.allOf)&&d.allOf.length>0,V=d?.discriminator,q=!G&&L(V?.mapping)?Object.values(V.mapping).filter(S=>typeof S=="string"&&me(S)).map(S=>({$ref:S})):null,re=Array.isArray(q)&&q.length>0,C;if(G||te||re){let S={...d},F=null,oe=P=>{F=F?y(F,P):P},ne=(P,v)=>{let E=g(v[0],m);for(let z=1;z<v.length;z++){let se=g(v[z],m);se.totalSchemaProperties>E.totalSchemaProperties&&(E=se)}return{...E,polymorphismCount:E.polymorphismCount+v.length,anyOfCount:E.anyOfCount+(P==="anyOf"?v.length:0),hasDiscriminator:E.hasDiscriminator||!!V}};G&&delete S.discriminator,Z&&(delete S.oneOf,oe(ne("oneOf",_))),ee&&(delete S.anyOf,oe(ne("anyOf",N)));let H=null;if(re){delete S.discriminator;let P=g(q[0],m);for(let v=1;v<q.length;v++){let E=g(q[v],m);E.totalSchemaProperties>P.totalSchemaProperties&&(P=E)}H={...P,polymorphismCount:P.polymorphismCount+q.length,hasDiscriminator:!0}}let W=null;if(te){delete S.allOf,W={...O};for(let P of d.allOf)W=y(W,g(P,m));W.polymorphismCount+=d.allOf.length}C=u(S,m),W&&(C=y(C,W)),F&&(C=y(C,F)),H&&(C=y(C,H)),w&&(C={...C,refsUsed:[w,...C.refsUsed]})}else C=u(l,m);return L(d)&&$.delete(d),w&&!m&&f.set(w,C),C},M=qe(g,i,n),T=We(M),I=Q([{severity:"warn",ruleId:"score",visitor:T}],r);return K({document:e,rootType:r.Root,normalizedVisitors:I,resolvedRefMap:t,ctx:o}),{metrics:Ue(M),debugLogs:M.debugLogs}}function Ne(e){let r=new Map;for(let[n,s]of e)for(let i of s.refsUsed){let a=r.get(i);a||(a=new Set,r.set(i,a)),a.add(n)}let t=new Map;for(let n of e.keys())t.set(n,new Set);for(let n of r.values()){if(n.size<2)continue;let s=Array.from(n);for(let i=0;i<s.length;i++)for(let a=i+1;a<s.length;a++)t.get(s[i]).add(s[a]),t.get(s[a]).add(s[i])}let o=new Map;for(let n of e.keys()){let s=rt(n,t);o.set(n,s)}return o}function rt(e,r){let t=new Set([e]),o=[e],n=0;for(;o.length>0;){let s=[];for(let i of o)for(let a of r.get(i)??[])t.has(a)||(t.add(a),s.push(a));s.length>0&&n++,o=s}return n}function Fe(e){let r={agentReadiness:e.agentReadiness,discoverability:Math.round(e.discoverability*100),subscores:e.subscores,rawMetrics:{operationCount:e.rawMetrics.operationCount,operations:Object.fromEntries(Array.from(e.rawMetrics.operations.entries()).map(([t,o])=>{let{refsUsed:n,...s}=o;return[t,s]}))},operationScores:Object.fromEntries(e.operationScores),dependencyDepths:Object.fromEntries(e.dependencyDepths),hotspots:e.hotspots};k.output(JSON.stringify(r,null,2))}function je(e,r=!1){ot(e),nt(e),it(e),r&&at(e),pt(e)}function _e(e){return e>=80?de:e>=50?j:fe}function Be(e){return _e(e)(b(e.toFixed(1)))}function p(e){k.output(e+`
|
|
7
|
+
import{b as xe,f as Pe}from"./B7U3CPK6.js";import{$ as b,A as ue,X as le,Y as he,ba as fe,c as L,ca as de,da as j,f as ie,fa as ye,ga as U,ha as A,ka as k,la as Se,ma as ge,na as Q,oa as K,p as ae,q as pe,qa as Ce,r as ce,ta as be,v as me}from"./PM72YBPD.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";import{performance as mt}from"perf_hooks";var D={thresholds:{maxParamsGood:5,maxDepthGood:4,maxPolymorphismGood:2,maxDependencyDepthGood:3,maxAmbiguousGood:0,maxOperationsForDiscoverability:1e3},weights:{parameterSimplicity:.1,schemaSimplicity:.1,documentationQuality:.18,constraintClarity:.12,exampleCoverage:.18,errorClarity:.12,dependencyClarity:.1,identifierClarity:.05,polymorphismClarity:.05,anyOfPenaltyMultiplier:2,discoverabilityWeight:.1},hotspotLimit:10},Oe=new Set(["id","name","type","value","data","key","status","state","code","result","item","object","resource","entity","input","output","payload","body","content","info"]);function B(e){if(e.length===0)return 0;let r=[...e].sort((o,n)=>o-n),t=Math.floor(r.length/2);return r.length%2!==0?r[t]:(r[t-1]+r[t])/2}function He(e,r,t=D){let{thresholds:o,weights:n}=t,s=x(1-e.parameterCount/(o.maxParamsGood*2)),a=Math.max(e.maxRequestSchemaDepth,e.maxResponseSchemaDepth)/(o.maxDepthGood*2),c=De(e,n.anyOfPenaltyMultiplier)/(o.maxPolymorphismGood*3),h=x(1-a-c),u=(e.operationDescriptionPresent?1:0)+e.paramsWithDescription+e.schemaPropertiesWithDescription,f=1+e.parameterCount+e.totalSchemaProperties,$=f>0?x(u/f):1,O=e.totalSchemaProperties>0?x(e.constraintCount/e.totalSchemaProperties):1,y=(e.requestExamplePresent?1:0)+(e.responseExamplePresent?1:0),g=(e.requestBodyPresent?1:0)+1,M=x(y/g),T=e.totalErrorResponses>0?x(e.structuredErrorResponseCount/e.totalErrorResponses):1,I=x(1-r/(o.maxDependencyDepthGood*2)),l=x(1-e.ambiguousIdentifierCount/Math.max(o.maxAmbiguousGood+3,1)),m=De(e,n.anyOfPenaltyMultiplier),d=m===0?1:e.hasDiscriminator?x(1-m/(o.maxPolymorphismGood*4)):x(1-m/(o.maxPolymorphismGood*2));return{parameterSimplicity:s,schemaSimplicity:h,documentationQuality:$,constraintClarity:O,exampleCoverage:M,errorClarity:T,dependencyClarity:I,identifierClarity:l,polymorphismClarity:d}}function ze(e,r=D){let t=r.weights,o=e.parameterSimplicity*t.parameterSimplicity+e.schemaSimplicity*t.schemaSimplicity+e.documentationQuality*t.documentationQuality+e.constraintClarity*t.constraintClarity+e.exampleCoverage*t.exampleCoverage+e.errorClarity*t.errorClarity+e.dependencyClarity*t.dependencyClarity+e.identifierClarity*t.identifierClarity+e.polymorphismClarity*t.polymorphismClarity;return $e(x(o)*100)}function Re(e,r,t=D){let o=new Map;for(let[n,s]of e.operations){let i=r.get(n)??0,a=He(s,i,t);o.set(n,{agentReadiness:ze(a,t),subscores:a})}return o}function Me(e,r=D){return x(1-e/r.thresholds.maxOperationsForDiscoverability)}function ve(e,r,t=D){if(e.size===0)return{agentReadiness:100};let o=[];for(let i of e.values())o.push(i.agentReadiness);let n=t.weights.discoverabilityWeight,s=r*100;return{agentReadiness:$e(B(o)*(1-n)+s*n)}}function J(e,r,t){return e-r+r*t}function De(e,r){return J(e.polymorphismCount,e.anyOfCount,r)}function x(e){return Math.max(0,Math.min(1,e))}function Ee(e){let r=e.size||1,t={parameterSimplicity:0,schemaSimplicity:0,documentationQuality:0,constraintClarity:0,exampleCoverage:0,errorClarity:0,dependencyClarity:0,identifierClarity:0,polymorphismClarity:0};for(let o of e.values())t.parameterSimplicity+=o.subscores.parameterSimplicity,t.schemaSimplicity+=o.subscores.schemaSimplicity,t.documentationQuality+=o.subscores.documentationQuality,t.constraintClarity+=o.subscores.constraintClarity,t.exampleCoverage+=o.subscores.exampleCoverage,t.errorClarity+=o.subscores.errorClarity,t.dependencyClarity+=o.subscores.dependencyClarity,t.identifierClarity+=o.subscores.identifierClarity,t.polymorphismClarity+=o.subscores.polymorphismClarity;return t.parameterSimplicity/=r,t.schemaSimplicity/=r,t.documentationQuality/=r,t.constraintClarity/=r,t.exampleCoverage/=r,t.errorClarity/=r,t.dependencyClarity/=r,t.identifierClarity/=r,t.polymorphismClarity/=r,t}function $e(e){return Math.round(e*10)/10}function we(e,r,t){let o=Math.max(1,e);return r/o+t/o}function Qe(e,r){return r.totalSchemaProperties>e.totalSchemaProperties?!0:r.totalSchemaProperties<e.totalSchemaProperties?!1:we(r.totalSchemaProperties,r.schemaPropertiesWithDescription,r.constraintCount)>we(e.totalSchemaProperties,e.schemaPropertiesWithDescription,e.constraintCount)}var Ke=["enum","const","format","pattern","minimum","maximum","minLength","maxLength","minItems","maxItems","minProperties","maxProperties","multipleOf","exclusiveMinimum","exclusiveMaximum","uniqueItems"];function Y(){return{depth:-1,maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[],debugEntries:null,pendingRef:null}}function Ie(e){Object.assign(e,Y())}function Le(e){return{ref:{enter(r){typeof r?.$ref=="string"&&(e.refsUsed.push(r.$ref),e.pendingRef=r.$ref)}},Schema:{enter(r,t){e.depth++,e.maxDepth=Math.max(e.maxDepth,e.depth);let o=0;for(let i of Ke)r[i]!==void 0&&(e.constraintCount++,o++);r.discriminator?.propertyName&&(e.hasDiscriminator=!0);let n={};for(let i of["oneOf","anyOf","allOf"]){let a=r[i];Array.isArray(a)&&(e.polymorphismCount+=a.length,i==="anyOf"&&(e.anyOfCount+=a.length),n[i]=a.length)}let s=[];if(L(r.properties)){let i=Object.entries(r.properties);e.totalSchemaProperties+=i.length;for(let[a,c]of i){s.push(a);let h=c&&"$ref"in c&&c.$ref?t.resolve(c)?.node??c:c;h?.description&&e.schemaPropertiesWithDescription++,(h?.example!==void 0||h?.examples)&&(e.hasPropertyExamples=!0),h?.readOnly||e.writableTopLevelFields++}}e.debugEntries!==null&&e.debugEntries.push({ref:e.pendingRef,depth:e.depth,propertyNames:s,polymorphism:Object.keys(n).length>0?n:{},constraintCount:o}),e.pendingRef=null},leave(){e.depth--}}}}function qe(e,r,t){return{operations:new Map,currentPath:"",pathLevelParams:[],current:null,walkSchema:e,anyOfPenaltyMultiplier:r,debugOperationId:t,debugLogs:[]}}function Je(e,r,t){return{path:e,method:r,operationId:t.operationId,operationDescriptionPresent:!!t.description,parameterCount:0,requiredParameterCount:0,paramsWithDescription:0,ambiguousIdentifierCount:0,maxRequestSchemaDepth:0,maxResponseSchemaDepth:0,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,topLevelWritableFieldCount:0,requestBodyPresent:!1,requestExamplePresent:!1,responseExamplePresent:!1,structuredErrorResponseCount:0,totalErrorResponses:0,inRequestBody:!1,inResponse:!1,currentResponseCode:"",errorStructuredCounted:!1,maxEffectivePolymorphism:-1,refsUsed:new Set}}function Ye(e){let{inRequestBody:r,inResponse:t,currentResponseCode:o,errorStructuredCounted:n,maxEffectivePolymorphism:s,...i}=e;return i}function We(e){return{RequestBody:{enter(){e.current&&(e.current.requestBodyPresent=!0,e.current.inRequestBody=!0)},leave(){e.current&&(e.current.inRequestBody=!1)}},Response:{enter(r,t){let o=e.current;if(!o)return;let n=String(t.key);o.inResponse=!0,o.currentResponseCode=n,o.errorStructuredCounted=!1,Te(n)&&(o.totalErrorResponses++,!r.content&&r.description&&(o.structuredErrorResponseCount++,o.errorStructuredCounted=!0))},leave(){e.current&&(e.current.inResponse=!1)}},MediaType:{enter(r){let t=e.current;if(t&&(Ze(r)&&(t.inRequestBody&&(t.requestExamplePresent=!0),t.inResponse&&(t.responseExamplePresent=!0)),t.inResponse&&Te(t.currentResponseCode)&&!t.errorStructuredCounted&&(t.structuredErrorResponseCount++,t.errorStructuredCounted=!0),r.schema)){let o=!!e.debugOperationId&&(t.operationId===e.debugOperationId||`${t.method.toUpperCase()} ${t.path}`===e.debugOperationId),n=e.walkSchema(r.schema,o);Qe(t,n)&&(t.totalSchemaProperties=n.totalSchemaProperties,t.schemaPropertiesWithDescription=n.schemaPropertiesWithDescription,t.constraintCount=n.constraintCount);let s=J(n.polymorphismCount,n.anyOfCount,e.anyOfPenaltyMultiplier);s>t.maxEffectivePolymorphism&&(t.maxEffectivePolymorphism=s,t.polymorphismCount=n.polymorphismCount,t.anyOfCount=n.anyOfCount),n.hasDiscriminator&&(t.hasDiscriminator=!0);for(let i of n.refsUsed)t.refsUsed.add(i);if(n.hasPropertyExamples&&(t.inRequestBody&&(t.requestExamplePresent=!0),t.inResponse&&(t.responseExamplePresent=!0)),t.inRequestBody&&(t.maxRequestSchemaDepth=Math.max(t.maxRequestSchemaDepth,n.maxDepth),t.topLevelWritableFieldCount=Math.max(t.topLevelWritableFieldCount,n.writableTopLevelFields)),t.inResponse&&(t.maxResponseSchemaDepth=Math.max(t.maxResponseSchemaDepth,n.maxDepth)),o&&n.debugEntries){let i=t.inRequestBody?"REQUEST BODY":`RESPONSE ${t.currentResponseCode}`;e.debugLogs.push({context:i,entries:n.debugEntries,totalProperties:n.totalSchemaProperties,totalPolymorphism:n.polymorphismCount,totalConstraints:n.constraintCount,maxDepth:n.maxDepth})}}}},Paths:{PathItem:{enter(r,t){e.currentPath=String(t.key),e.pathLevelParams=r.parameters??[]},Operation:{enter(r,t){let o=String(t.key),n=Je(e.currentPath,o,r);e.current=n;let s=Xe(e.pathLevelParams,r.parameters??[],t.resolve);for(let i of s.values())n.parameterCount++,i.required&&n.requiredParameterCount++,i.description&&n.paramsWithDescription++,et(i)&&n.ambiguousIdentifierCount++},leave(r){let t=e.current;if(!t)return;let o=r.operationId??`${t.method.toUpperCase()} ${t.path}`;e.operations.set(o,Ye(t)),e.current=null}}}}}}function Ue(e){return{operationCount:e.operations.size,operations:e.operations}}function Ae(e,r){return r(e).node}function Xe(e,r,t){let o=new Map;for(let n of e){let s=Ae(n,t);s?.name&&s.in&&o.set(`${s.in}:${s.name}`,s)}for(let n of r){let s=Ae(n,t);s?.name&&s.in&&o.set(`${s.in}:${s.name}`,s)}return o}function Ze(e){return e.example!==void 0||ie(e.examples)}function et(e){if(e.description)return!1;let r=(e.name??"").toLowerCase();return Oe.has(r)}function Te(e){if(e==="default"||/^4xx$/i.test(e)||/^5xx$/i.test(e))return!0;let r=parseInt(e,10);return r>=400&&r<600}function tt(e,r){if(!r.startsWith("#/"))return;let t=e;for(let o of r.slice(2).split("/"))t=t?.[ce(o)];return t}function ke({document:e,types:r,resolvedRefMap:t,ctx:o,debugOperationId:n,scoringConstants:s}){let i=s?.weights.anyOfPenaltyMultiplier??D.weights.anyOfPenaltyMultiplier,a=Y(),c=Le(a),h=Q([{severity:"warn",ruleId:"score-schema",visitor:c}],r),u=(l,m)=>{Ie(a),m&&(a.debugEntries=[]),K({document:{...e,parsed:l},rootType:r.Schema,normalizedVisitors:h,resolvedRefMap:t,ctx:o});let{depth:d,pendingRef:w,debugEntries:_,...N}=a;return{...N,refsUsed:[...a.refsUsed],debugEntries:m?a.debugEntries??void 0:void 0}},f=new Map,$=new WeakSet,O={maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[]};function y(l,m){return{maxDepth:Math.max(l.maxDepth,m.maxDepth),polymorphismCount:l.polymorphismCount+m.polymorphismCount,anyOfCount:l.anyOfCount+m.anyOfCount,hasDiscriminator:l.hasDiscriminator||m.hasDiscriminator,totalSchemaProperties:l.totalSchemaProperties+m.totalSchemaProperties,schemaPropertiesWithDescription:l.schemaPropertiesWithDescription+m.schemaPropertiesWithDescription,constraintCount:l.constraintCount+m.constraintCount,hasPropertyExamples:l.hasPropertyExamples||m.hasPropertyExamples,writableTopLevelFields:l.writableTopLevelFields+m.writableTopLevelFields,refsUsed:[...l.refsUsed,...m.refsUsed],debugEntries:l.debugEntries||m.debugEntries?[...l.debugEntries??[],...m.debugEntries??[]]:void 0}}let g=(l,m=!1)=>{let d=l,w=pe(l)?l.$ref:void 0;if(w){if(!m){let S=f.get(w);if(S)return S}d=tt(e.parsed,w)??l}if(L(d)&&$.has(d))return{...O};L(d)&&$.add(d);let _=d?.oneOf,N=d?.anyOf,Z=Array.isArray(_)&&_.length>1,ee=Array.isArray(N)&&N.length>1,G=Z||ee,te=Array.isArray(d?.allOf)&&d.allOf.length>0,V=d?.discriminator,q=!G&&L(V?.mapping)?Object.values(V.mapping).filter(S=>typeof S=="string"&&me(S)).map(S=>({$ref:S})):null,re=Array.isArray(q)&&q.length>0,C;if(G||te||re){let S={...d},F=null,oe=P=>{F=F?y(F,P):P},ne=(P,v)=>{let E=g(v[0],m);for(let z=1;z<v.length;z++){let se=g(v[z],m);se.totalSchemaProperties>E.totalSchemaProperties&&(E=se)}return{...E,polymorphismCount:E.polymorphismCount+v.length,anyOfCount:E.anyOfCount+(P==="anyOf"?v.length:0),hasDiscriminator:E.hasDiscriminator||!!V}};G&&delete S.discriminator,Z&&(delete S.oneOf,oe(ne("oneOf",_))),ee&&(delete S.anyOf,oe(ne("anyOf",N)));let H=null;if(re){delete S.discriminator;let P=g(q[0],m);for(let v=1;v<q.length;v++){let E=g(q[v],m);E.totalSchemaProperties>P.totalSchemaProperties&&(P=E)}H={...P,polymorphismCount:P.polymorphismCount+q.length,hasDiscriminator:!0}}let W=null;if(te){delete S.allOf,W={...O};for(let P of d.allOf)W=y(W,g(P,m));W.polymorphismCount+=d.allOf.length}C=u(S,m),W&&(C=y(C,W)),F&&(C=y(C,F)),H&&(C=y(C,H)),w&&(C={...C,refsUsed:[w,...C.refsUsed]})}else C=u(l,m);return L(d)&&$.delete(d),w&&!m&&f.set(w,C),C},M=qe(g,i,n),T=We(M),I=Q([{severity:"warn",ruleId:"score",visitor:T}],r);return K({document:e,rootType:r.Root,normalizedVisitors:I,resolvedRefMap:t,ctx:o}),{metrics:Ue(M),debugLogs:M.debugLogs}}function Ne(e){let r=new Map;for(let[n,s]of e)for(let i of s.refsUsed){let a=r.get(i);a||(a=new Set,r.set(i,a)),a.add(n)}let t=new Map;for(let n of e.keys())t.set(n,new Set);for(let n of r.values()){if(n.size<2)continue;let s=Array.from(n);for(let i=0;i<s.length;i++)for(let a=i+1;a<s.length;a++)t.get(s[i]).add(s[a]),t.get(s[a]).add(s[i])}let o=new Map;for(let n of e.keys()){let s=rt(n,t);o.set(n,s)}return o}function rt(e,r){let t=new Set([e]),o=[e],n=0;for(;o.length>0;){let s=[];for(let i of o)for(let a of r.get(i)??[])t.has(a)||(t.add(a),s.push(a));s.length>0&&n++,o=s}return n}function Fe(e){let r={agentReadiness:e.agentReadiness,discoverability:Math.round(e.discoverability*100),subscores:e.subscores,rawMetrics:{operationCount:e.rawMetrics.operationCount,operations:Object.fromEntries(Array.from(e.rawMetrics.operations.entries()).map(([t,o])=>{let{refsUsed:n,...s}=o;return[t,s]}))},operationScores:Object.fromEntries(e.operationScores),dependencyDepths:Object.fromEntries(e.dependencyDepths),hotspots:e.hotspots};k.output(JSON.stringify(r,null,2))}function je(e,r=!1){ot(e),nt(e),it(e),r&&at(e),pt(e)}function _e(e){return e>=80?de:e>=50?j:fe}function Be(e){return _e(e)(b(e.toFixed(1)))}function p(e){k.output(e+`
|
|
8
8
|
`)}function ot(e){p(""),p(b(A(" Scores"))),p(""),p(` Agent Readiness: ${Be(e.agentReadiness)}/100`),p("")}function nt(e){p(b(A(" Subscores"))),p("");let r=e.subscores;R("Parameter Simplicity",r.parameterSimplicity),R("Schema Simplicity",r.schemaSimplicity),R("Documentation Quality",r.documentationQuality),R("Constraint Clarity",r.constraintClarity),R("Example Coverage",r.exampleCoverage),R("Error Clarity",r.errorClarity),R("Dependency Clarity",r.dependencyClarity),R("Identifier Clarity",r.identifierClarity),R("Polymorphism Clarity",r.polymorphismClarity),R("Discoverability",e.discoverability),p("")}function R(e,r){let t=Math.round(r*100),o=st(r);p(` ${e.padEnd(24)} ${o} ${_e(t)(t+"%")}`)}function st(e){let t=Math.round(e*20);return U("["+"\u2588".repeat(t)+"\u2591".repeat(20-t)+"]")}function it(e){if(p(b(A(" Raw Metrics Summary"))),p(""),p(` Total operations: ${e.rawMetrics.operationCount}`),e.rawMetrics.operationCount===0){p("");return}let r=[],t=[],o=[],n=[],s=0,i=0,a=0;for(let u of e.rawMetrics.operations.values())r.push(u.parameterCount),t.push(Math.max(u.maxRequestSchemaDepth,u.maxResponseSchemaDepth)),o.push(u.polymorphismCount),n.push(u.totalSchemaProperties),u.requestExamplePresent&&s++,u.responseExamplePresent&&i++,u.operationDescriptionPresent&&a++;let c=e.rawMetrics.operationCount;function h(u,f){let O=(f.reduce((T,I)=>T+I,0)/c).toFixed(1),y=B(f).toFixed(1),g=Math.min(...f),M=Math.max(...f);p(` ${u.padEnd(26)} avg ${O.padStart(6)} median ${y.padStart(6)} min ${String(g).padStart(5)} max ${String(M).padStart(5)}`)}h("Parameters/operation:",r),h("Schema depth:",t),h("Polymorphism/operation:",o),h("Properties/operation:",n),p(` Operations with request examples: ${s}/${c} (${X(s,c)})`),p(` Operations with response examples: ${i}/${c} (${X(i,c)})`),p(` Operations with description: ${a}/${c} (${X(a,c)})`),p("")}function X(e,r){return r>0?`${Math.round(e/r*100)}%`:"N/A"}function at(e){p(b(A(" Per-Operation Metrics"))),p("");let r=" "+"Operation".padEnd(50)+"Props".padStart(7)+"Poly".padStart(7)+"Depth".padStart(7)+"Params".padStart(8)+"Constr".padStart(8);p(U(r)),p(U(" "+"\u2500".repeat(r.length-2)));let t=[...e.rawMetrics.operations.entries()].sort(([,o],[,n])=>n.totalSchemaProperties-o.totalSchemaProperties);for(let[,o]of t){let n=(o.operationId??`${o.method.toUpperCase()} ${o.path}`).slice(0,48),s=Math.max(o.maxRequestSchemaDepth,o.maxResponseSchemaDepth),i=" "+n.padEnd(50)+String(o.totalSchemaProperties).padStart(7)+String(o.polymorphismCount).padStart(7)+String(s).padStart(7)+String(o.parameterCount).padStart(8)+String(o.constraintCount).padStart(8);p(i)}p("")}function Ge(e,r){if(p(""),p(b(A(` Debug: ${e} schema breakdown`))),p(""),r.length===0){p(j(` No schemas found for operation "${e}".`)),p(j(' Make sure the value matches an operationId or "METHOD /path" exactly.')),p("");return}for(let t of r){p(b(U(` ${t.context}`))),p(U(" "+"\u2500".repeat(70)));let o=new Map;for(let s of t.entries){let i=s.ref??`(inline depth ${s.depth})`,a=o.get(i);if(a){a.count++,a.totalProps+=s.propertyNames.length;for(let c of s.propertyNames)a.propNames.includes(c)||a.propNames.push(c)}else o.set(i,{count:1,totalProps:s.propertyNames.length,propNames:[...s.propertyNames]})}for(let s of t.entries){let i=s.ref??"(inline)",a=" ".repeat(Math.min(s.depth,6)),c=s.propertyNames.length,h=` ${a}${i}`;c>0&&(h+=` (${c} properties)`);let u=[];if(s.polymorphism.oneOf&&u.push(`oneOf:${s.polymorphism.oneOf}`),s.polymorphism.anyOf&&u.push(`anyOf:${s.polymorphism.anyOf}`),s.polymorphism.allOf&&u.push(`allOf:${s.polymorphism.allOf}`),u.length>0&&(h+=` [${u.join(", ")}]`),s.constraintCount>0&&(h+=` {${s.constraintCount} constraints}`),p(h),c>0&&c<=20)p(` ${a} properties: ${s.propertyNames.join(", ")}`);else if(c>20){let f=s.propertyNames.slice(0,15).join(", ");p(` ${a} properties: ${f}, ... +${c-15} more`)}}p(""),p(` Totals: ${t.totalProperties} properties, ${t.totalPolymorphism} polymorphism items, ${t.totalConstraints} constraints, max depth ${t.maxDepth}`);let n=[...o.entries()].filter(([,s])=>s.totalProps>0).sort(([,s],[,i])=>i.totalProps-s.totalProps).slice(0,10);if(n.length>0){p(""),p(b(" Top schemas by property count:"));for(let[s,i]of n)p(` ${s}: ${i.totalProps} properties`)}p("")}}function pt(e){if(e.hotspots.length===0){p(b(A(" No hotspot operations found."))),p("");return}p(b(A(` Top ${e.hotspots.length} Hotspot Operations`))),p("");for(let r of e.hotspots){let t=r.operationId?`${r.method.toUpperCase()} ${r.path} (${r.operationId})`:`${r.method.toUpperCase()} ${r.path}`;p(b(` ${t}`)),p(` Agent Readiness: ${Be(r.agentReadinessScore)}`);for(let o of r.reasons)p(j(` - ${o}`));p("")}}function Ve(e,r,t,o=D){let n=[];for(let[s,i]of r){let a=e.operations.get(s);if(!a)continue;let c=ct(a,t.get(s)??0,o);c.length!==0&&n.push({path:a.path,method:a.method,operationId:a.operationId,agentReadinessScore:i.agentReadiness,reasons:c})}return n.sort((s,i)=>s.reasons.length!==i.reasons.length?i.reasons.length-s.reasons.length:s.agentReadinessScore-i.agentReadinessScore),n.slice(0,o.hotspotLimit)}function ct(e,r,t){let{thresholds:o}=t,n=[];e.parameterCount>o.maxParamsGood&&n.push(`High parameter count (${e.parameterCount})`);let s=Math.max(e.maxRequestSchemaDepth,e.maxResponseSchemaDepth);s>o.maxDepthGood&&n.push(`Deep schema nesting (depth ${s})`),e.anyOfCount>0&&!e.hasDiscriminator?n.push(`Polymorphism (anyOf) without discriminator (${e.anyOfCount} anyOf)`):e.polymorphismCount>o.maxPolymorphismGood&&n.push(`High polymorphism count (${e.polymorphismCount})`);let i=e.requestBodyPresent&&!e.requestExamplePresent,a=!e.responseExamplePresent;return i&&a?n.push("Missing request and response examples"):i?n.push("Missing request body examples"):a&&n.push("Missing response examples"),e.totalErrorResponses>0&&e.structuredErrorResponseCount===0&&n.push("No structured error responses (4xx/5xx)"),e.operationDescriptionPresent||n.push("Missing operation description"),e.parameterCount>0&&e.paramsWithDescription===0&&n.push("No parameter descriptions"),r>o.maxDependencyDepthGood&&n.push(`High dependency depth (${r})`),e.ambiguousIdentifierCount>o.maxAmbiguousGood&&n.push(`Ambiguous identifiers (${e.ambiguousIdentifierCount})`),n}async function Vt({argv:e,config:r,collectSpecData:t}){let[{path:o}]=await xe(e.api?[e.api]:[],r),n=new le(r.resolve),{bundle:s}=await be({config:r,ref:o});t?.(s);let i=ge(s.parsed);if(Se(i)!=="oas3")throw new Ce(`The score command currently supports only OpenAPI 3.x. Detected: ${i}`);let a=mt.now(),c=ae(r.extendTypes(ue(i),i),r),h=await he({rootDocument:s,rootType:c.Root,externalRefResolver:n}),u=e["debug-operation-id"],{metrics:f,debugLogs:$}=ke({document:s,types:c,resolvedRefMap:h,ctx:{problems:[],specVersion:i,config:r,visitorsData:{}},debugOperationId:u}),O=Ne(f.operations),y=Re(f,O),g=Me(f.operationCount),{agentReadiness:M}=ve(y,g),T=Ve(f,y,O),I={agentReadiness:M,discoverability:g,subscores:Ee(y),rawMetrics:f,hotspots:T,operationScores:y,dependencyDepths:O};ut(I,o,a,e.format,!!e["operation-details"],u?{operationId:u,logs:$}:void 0)}function ut(e,r,t,o,n,s){k.info(`Document: ${ye(r)} score:
|
|
9
9
|
`),o==="json"?Fe(e):je(e,n),s&&Ge(s.operationId,s.logs),Pe("score",t,r)}export{Vt as handleScore};
|
|
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{Q as wi,R as zi,Z as rf,_ as nf,c as Te,da as eo,ea as to,ia as Cr,ka as xe,qa as we,ra as bi}from"./QWUJZWBB.js";import"./6RTITFQA.js";import{a as De,c as ce,d as Qn,e as Or}from"./RFWIIJFG.js";var ud=ce((r$,cd)=>{cd.exports=ad;ad.sync=H_;var sd=De("fs");function B_(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function id(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:B_(t,r)}function ad(e,t,r){sd.stat(e,function(n,o){r(n,n?!1:id(o,e,t))})}function H_(e,t){return id(sd.statSync(e),e,t)}});var md=ce((n$,fd)=>{fd.exports=pd;pd.sync=J_;var ld=De("fs");function pd(e,t,r){ld.stat(e,function(n,o){r(n,n?!1:dd(o,t))})}function J_(e,t){return dd(ld.statSync(e),t)}function dd(e,t){return e.isFile()&&W_(e,t)}function W_(e,t){var r=e.mode,n=e.uid,o=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),i=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),l=a|c,d=r&u||r&c&&o===i||r&a&&n===s||r&l&&s===0;return d}});var gd=ce((s$,hd)=>{var o$=De("fs"),Jn;process.platform==="win32"||global.TESTING_WINDOWS?Jn=ud():Jn=md();hd.exports=ai;ai.sync=K_;function ai(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){ai(e,t||{},function(s,i){s?o(s):n(i)})})}Jn(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function K_(e,t){try{return Jn.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var vd=ce((i$,bd)=>{var Nt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",_d=De("path"),G_=Nt?";":":",yd=gd(),xd=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),wd=(e,t)=>{let r=t.colon||G_,n=e.match(/\//)||Nt&&e.match(/\\/)?[""]:[...Nt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=Nt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Nt?o.split(r):[""];return Nt&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},zd=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:s}=wd(e,t),i=[],a=u=>new Promise((l,d)=>{if(u===n.length)return t.all&&i.length?l(i):d(xd(e));let f=n[u],m=/^".*"$/.test(f)?f.slice(1,-1):f,h=_d.join(m,e),_=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;l(c(_,u,0))}),c=(u,l,d)=>new Promise((f,m)=>{if(d===o.length)return f(a(l+1));let h=o[d];yd(u+h,{pathExt:s},(_,x)=>{if(!_&&x)if(t.all)i.push(u+h);else return f(u+h);return f(c(u,l,d+1))})});return r?a(0).then(u=>r(null,u),r):a(0)},X_=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=wd(e,t),s=[];for(let i=0;i<r.length;i++){let a=r[i],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=_d.join(c,e),l=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let d=0;d<n.length;d++){let f=l+n[d];try{if(yd.sync(f,{pathExt:o}))if(t.all)s.push(f);else return f}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw xd(e)};bd.exports=zd;zd.sync=X_});var kd=ce((a$,ci)=>{"use strict";var Sd=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};ci.exports=Sd;ci.exports.default=Sd});var Rd=ce((c$,Td)=>{"use strict";var $d=De("path"),Y_=vd(),Q_=kd();function Pd(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let i;try{i=Y_.sync(e.command,{path:r[Q_({env:r})],pathExt:t?$d.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return i&&(i=$d.resolve(o?e.options.cwd:"",i)),i}function ey(e){return Pd(e)||Pd(e,!0)}Td.exports=ey});var Ed=ce((u$,li)=>{"use strict";var ui=/([()\][%!^"`<>&|;, *?])/g;function ty(e){return e=e.replace(ui,"^$1"),e}function ry(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(ui,"^$1"),t&&(e=e.replace(ui,"^$1")),e}li.exports.command=ty;li.exports.argument=ry});var Cd=ce((l$,Od)=>{"use strict";Od.exports=/^#!(.*)/});var Ad=ce((p$,Id)=>{"use strict";var ny=Cd();Id.exports=(e="")=>{let t=e.match(ny);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Nd=ce((d$,Zd)=>{"use strict";var pi=De("fs"),oy=Ad();function sy(e){let r=Buffer.alloc(150),n;try{n=pi.openSync(e,"r"),pi.readSync(n,r,0,150,0),pi.closeSync(n)}catch{}return oy(r.toString())}Zd.exports=sy});var Ld=ce((f$,Dd)=>{"use strict";var iy=De("path"),Md=Rd(),jd=Ed(),ay=Nd(),cy=process.platform==="win32",uy=/\.(?:com|exe)$/i,ly=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function py(e){e.file=Md(e);let t=e.file&&ay(e.file);return t?(e.args.unshift(e.file),e.command=t,Md(e)):e.file}function dy(e){if(!cy)return e;let t=py(e),r=!uy.test(t);if(e.options.forceShell||r){let n=ly.test(t);e.command=iy.normalize(e.command),e.command=jd.command(e.command),e.args=e.args.map(s=>jd.argument(s,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function fy(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:dy(n)}Dd.exports=fy});var Fd=ce((m$,qd)=>{"use strict";var di=process.platform==="win32";function fi(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function my(e,t){if(!di)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let s=Ud(o,t);if(s)return r.call(e,"error",s)}return r.apply(e,arguments)}}function Ud(e,t){return di&&e===1&&!t.file?fi(t.original,"spawn"):null}function hy(e,t){return di&&e===1&&!t.file?fi(t.original,"spawnSync"):null}qd.exports={hookChildProcess:my,verifyENOENT:Ud,verifyENOENTSync:hy,notFoundError:fi}});var Hd=ce((h$,Mt)=>{"use strict";var Vd=De("child_process"),mi=Ld(),hi=Fd();function Bd(e,t,r){let n=mi(e,t,r),o=Vd.spawn(n.command,n.args,n.options);return hi.hookChildProcess(o,n),o}function gy(e,t,r){let n=mi(e,t,r),o=Vd.spawnSync(n.command,n.args,n.options);return o.error=o.error||hi.verifyENOENTSync(o.status,n),o}Mt.exports=Bd;Mt.exports.spawn=Bd;Mt.exports.sync=gy;Mt.exports._parse=mi;Mt.exports._enoent=hi});var Yd=ce(_i=>{"use strict";var Kd=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,by=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,Gd=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,vy=/\\([\u000b\u0020-\u00ff])/g,Sy=/([\\"])/g,Xd=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;_i.format=ky;_i.parse=$y;function ky(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!Xd.test(r))throw new TypeError("invalid type");var n=r;if(t&&typeof t=="object")for(var o,s=Object.keys(t).sort(),i=0;i<s.length;i++){if(o=s[i],!Gd.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+Ty(t[o])}return n}function $y(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?Py(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=r!==-1?t.slice(0,r).trim():t.trim();if(!Xd.test(n))throw new TypeError("invalid media type");var o=new Ry(n.toLowerCase());if(r!==-1){var s,i,a;for(Kd.lastIndex=r;i=Kd.exec(t);){if(i.index!==r)throw new TypeError("invalid parameter format");r+=i[0].length,s=i[1].toLowerCase(),a=i[2],a.charCodeAt(0)===34&&(a=a.slice(1,-1),a.indexOf("\\")!==-1&&(a=a.replace(vy,"$1"))),o.parameters[s]=a}if(r!==t.length)throw new TypeError("invalid parameter format")}return o}function Py(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function Ty(e){var t=String(e);if(Gd.test(t))return t;if(t.length>0&&!by.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(Sy,"\\$1")+'"'}function Ry(e){this.parameters=Object.create(null),this.type=e}});import{existsSync as Zy,mkdirSync as Ny,readFileSync as My,writeFileSync as jy}from"node:fs";import{dirname as Dy}from"node:path";import{isDeepStrictEqual as Lt}from"node:util";function Dt(e){let t=new Map;for(let r of Array.isArray(e)?e:[])Te(r)&&t.set(r.name,r);return t}function Ir(e,t,r){let n=Dt(t);return e.map(o=>{let s=n.get(o.name),i={};for(let a of r)s&&s[a]!==void 0&&(i[a]=s[a]);return{...o,...i}})}function of(e,t){let r=Dt(t);return Ir(e,t,["tags","security"]).map(n=>{if(!n.arguments)return n;let o=r.get(n.name)?.arguments;return{...n,arguments:Ir(n.arguments,o,["example"])}})}function ro(e,t,r){let n=e??{openapi:"3.1.0",info:{title:t.serverInfo?.title||t.serverInfo?.name||"MCP API",...t.instructions?{description:t.instructions}:{},version:t.serverInfo?.version||"1.0.0"},paths:{}},o=Te(n["x-mcp"])?n["x-mcp"]:{},s={...o};if(t.protocolVersion&&(s.protocolVersion=t.protocolVersion),r){let i=Array.isArray(s.servers)?s.servers:[];i.some(a=>Te(a)&&a.url===r)||i.push({url:r}),s.servers=i}return t.capabilities&&(s.capabilities=t.capabilities),t.capabilities?.tools?s.tools=Ir(t.tools,o.tools,["tags","security"]):delete s.tools,t.capabilities?.prompts?s.prompts=of(t.prompts,o.prompts):delete s.prompts,t.capabilities?.resources?s.resources=Ir(t.resources,o.resources,["tags","security"]):delete s.resources,n["x-mcp"]=s,n}function sf(e,t){let r=Dt(e),n=Dt(t),o=[...n.keys()].filter(c=>!r.has(c)),s=[...r.keys()].filter(c=>!n.has(c)),i=[...n.keys()].filter(c=>r.has(c)&&!Lt(r.get(c),n.get(c))),a=[];return o.length>0&&a.push(`added: ${o.join(", ")}`),s.length>0&&a.push(`removed: ${s.join(", ")}`),i.length>0&&a.push(`changed: ${i.join(", ")}`),a.length>0?a.join("; "):void 0}function vi(e,t){if(Lt(e,t))return[];let r=Te(e["x-mcp"])?e["x-mcp"]:{},n=Te(t["x-mcp"])?t["x-mcp"]:{},o=[];for(let s of["tools","prompts","resources"]){let i=sf(r[s],n[s]);i&&o.push(`${s} - ${i}`)}return Lt(r.protocolVersion,n.protocolVersion)||o.push(`protocolVersion - ${r.protocolVersion??"not set"} -> ${n.protocolVersion}`),Lt(r.capabilities,n.capabilities)||o.push("capabilities changed"),Lt(r.servers,n.servers)||o.push("servers - the MCP server URL is not listed"),o.length===0&&o.push("x-mcp changed"),o}var P={};Qn(P,{BIGINT_FORMAT_RANGES:()=>Mr,CONSTANT_CATCH:()=>Zi,Class:()=>so,NUMBER_FORMAT_RANGES:()=>qt,aborted:()=>ze,allowsEval:()=>lo,assert:()=>pf,assertEqual:()=>af,assertIs:()=>uf,assertNever:()=>lf,assertNotEqual:()=>cf,assignProp:()=>fe,attachSchema:()=>Ft,base64ToUint8Array:()=>Ii,base64urlToUint8Array:()=>Ef,cached:()=>dt,captureStackTrace:()=>Zr,cleanEnum:()=>Rf,cleanRegex:()=>Ut,clone:()=>ge,cloneDef:()=>mf,codePointLength:()=>Vt,constantCatch:()=>Ni,createTransparentProxy:()=>wf,defineLazy:()=>$i,defineLazyInternal:()=>I,derived:()=>Af,esc:()=>co,escapeRegex:()=>Oe,explicitlyAborted:()=>mo,extend:()=>vf,finalizeIssue:()=>be,floatSafeRemainder:()=>ao,getElementAtPath:()=>hf,getEnumValues:()=>lt,getLengthableOrigin:()=>Bt,getParsedType:()=>xf,getSizableOrigin:()=>Ci,hexToUint8Array:()=>Cf,hide:()=>Lr,installLazyProp:()=>jf,isObject:()=>Xe,isPlainObject:()=>qe,issue:()=>mt,joinValues:()=>Ar,jsonStringifyReplacer:()=>pt,members:()=>go,merge:()=>kf,mergeDefs:()=>Ee,normalizeParams:()=>S,nullish:()=>io,numKeys:()=>yf,objectClone:()=>df,omit:()=>bf,optionalKeys:()=>fo,own:()=>Ue,parsedType:()=>ho,partial:()=>$f,pick:()=>zf,prefixIssues:()=>Ce,primitiveTypes:()=>Ei,promiseAllObject:()=>gf,propertyKeyTypes:()=>po,randomString:()=>_f,rawShape:()=>ft,required:()=>Pf,safeExtend:()=>Sf,shallowClone:()=>Ri,sizeCaps:()=>Dr,slugify:()=>uo,stringifyPrimitive:()=>Nr,toZod:()=>ki,uint8ArrayToBase64:()=>Ai,uint8ArrayToBase64url:()=>Of,uint8ArrayToHex:()=>If,unwrapMessage:()=>ut});function af(e){return e}function cf(e){return e}function ki(){return e=>e}function uf(e){}function lf(e){throw new Error("Unexpected value in exhaustive check")}function pf(e){}function lt(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Ar(e,t="|"){return e.map(r=>Nr(r)).join(t)}function pt(e,t){return typeof t=="bigint"?t.toString():t}var oo=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function dt(e){return new oo(e)}function io(e){return e==null}function Ut(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ao(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var Si=Symbol("evaluating");function $i(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Si)return n===void 0&&(n=Si,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function df(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function fe(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ft(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Re(e){return ft(e._zod.def)??e._zod.def.shape}function Pi(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return fe(this,t,n),n},enumerable:!0,configurable:!0})}function Ti(e,t,r){t in e?fe(e,t,r):e[t]=r}function Ge(e,t,r,n){let o=Re(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(o,s);i.enumerable&&(i.get?Pi(e,s,()=>{let a=t._zod.def.shape[s];return n?n(a,s):a}):Ti(e,s,n?n(i.value,s):i.value))}}function ff(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?Pi(e,r,()=>t[r]):Ti(e,r,n.value))}}function Ee(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function mf(e){return Ee(e._zod.def)}function hf(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function gf(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s<t.length;s++)o[t[s]]=n[s];return o})}function _f(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function co(e){return JSON.stringify(e)}function uo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Zr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var lo=dt(()=>{if(ue.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function qe(e){if(Xe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Xe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ri(e){return qe(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function yf(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var xf=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},po=new Set(["string","number","symbol"]),Ei=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ge(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function S(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function wf(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,s){return t??(t=e()),Reflect.set(t,n,o,s)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function Nr(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function fo(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var qt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Mr={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function zf(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return Ge(s,e,jr(e,t)),ge(e,Ee(r,{shape:s,checks:[]}))}function jr(e,t){let r=Re(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o)}return n}function bf(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(jr(e,t)),i={};return Ge(i,e,Reflect.ownKeys(Re(e)).filter(a=>!s.has(a))),ge(e,Ee(r,{shape:i,checks:[]}))}function vf(e,t){if(!qe(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=Re(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ge(e,Ee(e._zod.def,{shape:Oi(e,t)}))}function Oi(e,t){let r={};return Ge(r,e,Reflect.ownKeys(Re(e))),ff(r,t),r}function Sf(e,t){if(!qe(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ge(e,Ee(e._zod.def,{shape:Oi(e,t)}))}function kf(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Ge(r,e,Reflect.ownKeys(Re(e))),Ge(r,t,Reflect.ownKeys(Re(t)));let n=Ee(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ge(e,n)}function $f(e,t,r,n="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let a=r?new Set(jr(t,r)):void 0,c={};return Ge(c,t,Reflect.ownKeys(Re(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),ge(t,Ee(t._zod.def,{shape:c,checks:[]}))}function Pf(e,t,r){let n=r?new Set(jr(t,r)):void 0,o={};return Ge(o,t,Reflect.ownKeys(Re(t)),(s,i)=>n&&!n.has(i)?s:new e({type:"nonoptional",innerType:s})),ge(t,Ee(t._zod.def,{shape:o}))}function ze(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function mo(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Ce(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function ut(e){return typeof e=="string"?e:e?.message}function Dr(e){let t=[];for(let r of e??[]){let n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;let o=n.maximum??n.length??n.size;o>=0&&t.push([o,r])}return t}function Ft(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function be(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:ut(e.inst?._zod.def?.error?.(e))??ut(s?.(e))??ut(t?.error?.(e))??ut(r.customError?.(e))??ut(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=e[c]);return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=e.input),a}function Ci(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Tf=/[\uD800-\uDBFF]/;function Vt(e){let t=e.length;if(!Tf.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function Bt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ho(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function mt(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function Rf(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Ii(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function Ai(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Ef(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Ii(t+r)}function Of(e){return Ai(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Cf(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function If(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var so=class{constructor(...t){}};function go(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):Zf(e,r,n.value)}}function Ue(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function Lr(e,t,r){return Ue(e,t,r,!1)}function Af(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return Ue(this,r,n(this))},set(o){Ue(this,r,o)}})}return t}function Zf(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Ue(this,t,r.bind(this))},set(n){Ue(this,t,n)}})}function Nf(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var no,Le=!1,Mf={configurable:!0,get(){Le=!0}};function I(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&no!==e._zod){no=void 0;return}no=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,Mf);let o=Le;Le=!1;try{let s=r(this);return Le?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),Le=Le||o,s}catch(s){throw delete this[t],Le=Le||o,s}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function jf(e,t,r,n){let o=Nf(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:s})}})}var Zi="~constantCatch";function Ni(e){let t=()=>e;return t[Zi]=!0,t}var Mi,yo=Object.freeze({status:"aborted"}),_o={value:void 0,enumerable:!1},ji="captureStackTrace"in Error?Error:null;function Df(e){let t=ji;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return ji=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function g(e,t,r,n){let o={};function s(f){this.def=f,this.constr=d,this.traits=new Set}s.prototype=o;let i=r,a=i&&new WeakSet;function c(f,m){if(f._zod){if(f._zod.traits.has(e))return}else{_o.value=new s(m);try{Object.defineProperty(f,"_zod",_o)}finally{_o.value=void 0}}if(f._zod.traits.add(e),t(f,m),a){let _=Object.getPrototypeOf(f),x=f._zod.constr.prototype,$=_;for(;$&&$!==x;)$=Object.getPrototypeOf($);let R=$??_;a.has(R)||(a.add(R),go(R,i))}let h=d.prototype;for(let _ in h)Object.prototype.hasOwnProperty.call(h,_)&&(_ in f||(f[_]=h[_].bind(f)))}let u=n?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(f){let m=n?.Parent?Df(l):this;c(m,f);let h=m._zod.deferred;if(h){for(let x of h)x();m._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(m),m}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>n?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var ve=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ht=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Mi=globalThis).__zod_globalConfig??(Mi.__zod_globalConfig={});var ue=globalThis.__zod_globalConfig;function le(e){return e&&Object.assign(ue,e),ue}function Lf(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,pt,2)),e.message}function Uf(e){this._zod.message=e}var qf={get:Lf,set:Uf,enumerable:!0,configurable:!0},wo={value:void 0,enumerable:!1},Di=new WeakSet([Object.prototype,Error.prototype]),Li=(e,t)=>{e.name="$ZodError",wo.value=t,Object.defineProperty(e,"issues",wo),wo.value=void 0,Object.defineProperty(e,"message",qf);let r=Object.getPrototypeOf(e);Di.has(r)||(Di.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},Ui=g("$ZodError",Li),qi=g("$ZodError",Li,void 0,{Parent:Error});function Ff(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function zo(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?Ff(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return{formErrors:n,fieldErrors:r}}function bo(e,t=r=>r.message){let r={_errors:[]},n=(o,s=[])=>{for(let i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>n({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;for(;u<a.length;){let l=a[u],d=u===a.length-1;if(l==="_errors"){d&&c._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=c[l];d&&f._errors.push(t(i)),c=f,u++}}}};return n(e),r}function Ur(e,t){return{callee:t?.callee??e,Err:t?.Err}}var qr=e=>{let t=(r,n,o,s)=>{let i=o?{...o,async:!1}:{async:!1},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ve;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map(u=>be(u,i,le())));throw Zr(c,s?.callee??t),c}return a.value};return t};var Fr=e=>{let t=async(r,n,o,s)=>{let i=o?{...o,async:!0}:{async:!0},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(s?.Err??e)(a.issues.map(u=>be(u,i,le())));throw Zr(c,s?.callee??t),c}return a.value};return t};var Ht=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new ve;return s.issues.length?Fi(e,s.issues,o):{success:!0,data:s.value}},vo=Ht(qi);function Fi(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(o=>be(o,r,le()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0}}}var Vr=e=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?Fi(e,s.issues,o):{success:!0,data:s.value}};var Bf=Symbol.for("zod.compile.invalid"),Hf=Symbol.for("zod.compile.fallback"),Br=((e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==Bf)return!0;if(n.definite===!0&&r===void 0)return!1}return Jf(e,t,r)});function Jf(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,s;if(o?(n[Hf]=!0,s=o({value:t,issues:[]},n)):s=e._zod.run({value:t,issues:[]},n),s instanceof Promise)throw new ve;return s.issues.length===0}var Hr=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},Vi=e=>{let t=qr(e),r=(n,o,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return t(n,o,a,Ur(r,i))};return r};var Bi=e=>{let t=qr(e),r=(n,o,s,i)=>t(n,o,s,Ur(r,i));return r};var Hi=e=>{let t=Fr(e),r=async(n,o,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(n,o,a,Ur(r,i))};return r};var Ji=e=>{let t=Fr(e),r=async(n,o,s,i)=>await t(n,o,s,Ur(r,i));return r};var Wi=e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Ht(e)(t,r,o)};var Ki=e=>(t,r,n)=>Ht(e)(t,r,n);var Gi=e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Vr(e)(t,r,o)};var Xi=e=>async(t,r,n)=>Vr(e)(t,r,n);var Yi=/^[cC][0-9a-z]{6,}$/,Qi=/^[0-9a-z]+$/,ea=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ta=/^[0-9a-vA-V]{20}$/,ra=/^[A-Za-z0-9]{27}$/,na=/^[a-zA-Z0-9_-]{21}$/;function oa(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var sa=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var ia=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ko=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var aa=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Wf="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function ca(){return new RegExp(Wf,"u")}var ua=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,la=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var pa=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,da=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,fa=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ma=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var ha=/^https?$/,ga=/^\+[1-9]\d{6,14}$/;var _a="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function Kf(e){return new RegExp(`^${e}$`)}var ya=Kf(_a);function So(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function xa(e){return new RegExp(`^${So(e)}$`)}function wa(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${So({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${So({precision:e.precision})}`:r;return new RegExp(`^${_a}T(?:${n})$`)}var za=/^[\s\S]{0,}$/;var ba=/^-?\d+n?$/,$o=/^-?\d+$/,Jt=/^-?\d+(?:\.\d+)?$/,va=/^(?:true|false)$/i,Sa=/^null$/i;var ka=/^[^A-Z]*$/,$a=/^[^a-z]*$/;var Q=g("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Po=e=>{let t=e.value;return!io(t)&&t.length!==void 0},Jr={number:"number",bigint:"bigint",object:"date"},To=g("$ZodCheckLessThan",(e,t)=>{Q.init(e,t);let r=Jr[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:Jr[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ro=g("$ZodCheckGreaterThan",(e,t)=>{Q.init(e,t);let r=Jr[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:Jr[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pa=g("$ZodCheckMultipleOf",(e,t)=>{Q.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):ao(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Ta=g("$ZodCheckNumberFormat",(e,t)=>{Q.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=qt[t.format];e._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Ra=g("$ZodCheckMaxLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=Po),e._zod.check=n=>{let o=n.value,s=o.length;if((typeof o=="string"&&s>t.maximum?Vt(o):s)<=t.maximum)return;let a=Bt(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ea=g("$ZodCheckMinLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=Po),e._zod.check=n=>{let o=n.value,s=o.length;if((typeof o=="string"&&s>=t.minimum&&s<t.minimum*2?Vt(o):s)>=t.minimum)return;let a=Bt(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Oa=g("$ZodCheckLengthEquals",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=Po),e._zod.check=n=>{let o=n.value,s=o.length,i=typeof o=="string"&&s>=t.length&&s<=t.length*2?Vt(o):s;if(i===t.length)return;let a=Bt(o),c=i>t.length;n.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Wt=g("$ZodCheckStringFormat",(e,t)=>{var r,n;Q.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Ca=g("$ZodCheckRegex",(e,t)=>{Wt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ia=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ka),Wt.init(e,t)}),Aa=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=$a),Wt.init(e,t)}),Za=g("$ZodCheckIncludes",(e,t)=>{Q.init(e,t);let r=Oe(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Na=g("$ZodCheckStartsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`^${Oe(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ma=g("$ZodCheckEndsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`.*${Oe(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var ja=g("$ZodCheckOverwrite",(e,t)=>{Q.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Wr=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
|
|
7
|
+
import{Q as wi,R as zi,Z as rf,_ as nf,c as Te,da as eo,ea as to,ia as Cr,ka as xe,qa as we,ra as bi}from"./PM72YBPD.js";import"./6RTITFQA.js";import{a as De,c as ce,d as Qn,e as Or}from"./RFWIIJFG.js";var ud=ce((r$,cd)=>{cd.exports=ad;ad.sync=H_;var sd=De("fs");function B_(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function id(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:B_(t,r)}function ad(e,t,r){sd.stat(e,function(n,o){r(n,n?!1:id(o,e,t))})}function H_(e,t){return id(sd.statSync(e),e,t)}});var md=ce((n$,fd)=>{fd.exports=pd;pd.sync=J_;var ld=De("fs");function pd(e,t,r){ld.stat(e,function(n,o){r(n,n?!1:dd(o,t))})}function J_(e,t){return dd(ld.statSync(e),t)}function dd(e,t){return e.isFile()&&W_(e,t)}function W_(e,t){var r=e.mode,n=e.uid,o=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),i=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),l=a|c,d=r&u||r&c&&o===i||r&a&&n===s||r&l&&s===0;return d}});var gd=ce((s$,hd)=>{var o$=De("fs"),Jn;process.platform==="win32"||global.TESTING_WINDOWS?Jn=ud():Jn=md();hd.exports=ai;ai.sync=K_;function ai(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){ai(e,t||{},function(s,i){s?o(s):n(i)})})}Jn(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function K_(e,t){try{return Jn.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var vd=ce((i$,bd)=>{var Nt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",_d=De("path"),G_=Nt?";":":",yd=gd(),xd=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),wd=(e,t)=>{let r=t.colon||G_,n=e.match(/\//)||Nt&&e.match(/\\/)?[""]:[...Nt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=Nt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Nt?o.split(r):[""];return Nt&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},zd=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:s}=wd(e,t),i=[],a=u=>new Promise((l,d)=>{if(u===n.length)return t.all&&i.length?l(i):d(xd(e));let f=n[u],m=/^".*"$/.test(f)?f.slice(1,-1):f,h=_d.join(m,e),_=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;l(c(_,u,0))}),c=(u,l,d)=>new Promise((f,m)=>{if(d===o.length)return f(a(l+1));let h=o[d];yd(u+h,{pathExt:s},(_,x)=>{if(!_&&x)if(t.all)i.push(u+h);else return f(u+h);return f(c(u,l,d+1))})});return r?a(0).then(u=>r(null,u),r):a(0)},X_=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=wd(e,t),s=[];for(let i=0;i<r.length;i++){let a=r[i],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=_d.join(c,e),l=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let d=0;d<n.length;d++){let f=l+n[d];try{if(yd.sync(f,{pathExt:o}))if(t.all)s.push(f);else return f}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw xd(e)};bd.exports=zd;zd.sync=X_});var kd=ce((a$,ci)=>{"use strict";var Sd=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};ci.exports=Sd;ci.exports.default=Sd});var Rd=ce((c$,Td)=>{"use strict";var $d=De("path"),Y_=vd(),Q_=kd();function Pd(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let i;try{i=Y_.sync(e.command,{path:r[Q_({env:r})],pathExt:t?$d.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return i&&(i=$d.resolve(o?e.options.cwd:"",i)),i}function ey(e){return Pd(e)||Pd(e,!0)}Td.exports=ey});var Ed=ce((u$,li)=>{"use strict";var ui=/([()\][%!^"`<>&|;, *?])/g;function ty(e){return e=e.replace(ui,"^$1"),e}function ry(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(ui,"^$1"),t&&(e=e.replace(ui,"^$1")),e}li.exports.command=ty;li.exports.argument=ry});var Cd=ce((l$,Od)=>{"use strict";Od.exports=/^#!(.*)/});var Ad=ce((p$,Id)=>{"use strict";var ny=Cd();Id.exports=(e="")=>{let t=e.match(ny);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Nd=ce((d$,Zd)=>{"use strict";var pi=De("fs"),oy=Ad();function sy(e){let r=Buffer.alloc(150),n;try{n=pi.openSync(e,"r"),pi.readSync(n,r,0,150,0),pi.closeSync(n)}catch{}return oy(r.toString())}Zd.exports=sy});var Ld=ce((f$,Dd)=>{"use strict";var iy=De("path"),Md=Rd(),jd=Ed(),ay=Nd(),cy=process.platform==="win32",uy=/\.(?:com|exe)$/i,ly=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function py(e){e.file=Md(e);let t=e.file&&ay(e.file);return t?(e.args.unshift(e.file),e.command=t,Md(e)):e.file}function dy(e){if(!cy)return e;let t=py(e),r=!uy.test(t);if(e.options.forceShell||r){let n=ly.test(t);e.command=iy.normalize(e.command),e.command=jd.command(e.command),e.args=e.args.map(s=>jd.argument(s,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function fy(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:dy(n)}Dd.exports=fy});var Fd=ce((m$,qd)=>{"use strict";var di=process.platform==="win32";function fi(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function my(e,t){if(!di)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let s=Ud(o,t);if(s)return r.call(e,"error",s)}return r.apply(e,arguments)}}function Ud(e,t){return di&&e===1&&!t.file?fi(t.original,"spawn"):null}function hy(e,t){return di&&e===1&&!t.file?fi(t.original,"spawnSync"):null}qd.exports={hookChildProcess:my,verifyENOENT:Ud,verifyENOENTSync:hy,notFoundError:fi}});var Hd=ce((h$,Mt)=>{"use strict";var Vd=De("child_process"),mi=Ld(),hi=Fd();function Bd(e,t,r){let n=mi(e,t,r),o=Vd.spawn(n.command,n.args,n.options);return hi.hookChildProcess(o,n),o}function gy(e,t,r){let n=mi(e,t,r),o=Vd.spawnSync(n.command,n.args,n.options);return o.error=o.error||hi.verifyENOENTSync(o.status,n),o}Mt.exports=Bd;Mt.exports.spawn=Bd;Mt.exports.sync=gy;Mt.exports._parse=mi;Mt.exports._enoent=hi});var Yd=ce(_i=>{"use strict";var Kd=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,by=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,Gd=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,vy=/\\([\u000b\u0020-\u00ff])/g,Sy=/([\\"])/g,Xd=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;_i.format=ky;_i.parse=$y;function ky(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!Xd.test(r))throw new TypeError("invalid type");var n=r;if(t&&typeof t=="object")for(var o,s=Object.keys(t).sort(),i=0;i<s.length;i++){if(o=s[i],!Gd.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+Ty(t[o])}return n}function $y(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?Py(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=r!==-1?t.slice(0,r).trim():t.trim();if(!Xd.test(n))throw new TypeError("invalid media type");var o=new Ry(n.toLowerCase());if(r!==-1){var s,i,a;for(Kd.lastIndex=r;i=Kd.exec(t);){if(i.index!==r)throw new TypeError("invalid parameter format");r+=i[0].length,s=i[1].toLowerCase(),a=i[2],a.charCodeAt(0)===34&&(a=a.slice(1,-1),a.indexOf("\\")!==-1&&(a=a.replace(vy,"$1"))),o.parameters[s]=a}if(r!==t.length)throw new TypeError("invalid parameter format")}return o}function Py(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function Ty(e){var t=String(e);if(Gd.test(t))return t;if(t.length>0&&!by.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(Sy,"\\$1")+'"'}function Ry(e){this.parameters=Object.create(null),this.type=e}});import{existsSync as Zy,mkdirSync as Ny,readFileSync as My,writeFileSync as jy}from"node:fs";import{dirname as Dy}from"node:path";import{isDeepStrictEqual as Lt}from"node:util";function Dt(e){let t=new Map;for(let r of Array.isArray(e)?e:[])Te(r)&&t.set(r.name,r);return t}function Ir(e,t,r){let n=Dt(t);return e.map(o=>{let s=n.get(o.name),i={};for(let a of r)s&&s[a]!==void 0&&(i[a]=s[a]);return{...o,...i}})}function of(e,t){let r=Dt(t);return Ir(e,t,["tags","security"]).map(n=>{if(!n.arguments)return n;let o=r.get(n.name)?.arguments;return{...n,arguments:Ir(n.arguments,o,["example"])}})}function ro(e,t,r){let n=e??{openapi:"3.1.0",info:{title:t.serverInfo?.title||t.serverInfo?.name||"MCP API",...t.instructions?{description:t.instructions}:{},version:t.serverInfo?.version||"1.0.0"},paths:{}},o=Te(n["x-mcp"])?n["x-mcp"]:{},s={...o};if(t.protocolVersion&&(s.protocolVersion=t.protocolVersion),r){let i=Array.isArray(s.servers)?s.servers:[];i.some(a=>Te(a)&&a.url===r)||i.push({url:r}),s.servers=i}return t.capabilities&&(s.capabilities=t.capabilities),t.capabilities?.tools?s.tools=Ir(t.tools,o.tools,["tags","security"]):delete s.tools,t.capabilities?.prompts?s.prompts=of(t.prompts,o.prompts):delete s.prompts,t.capabilities?.resources?s.resources=Ir(t.resources,o.resources,["tags","security"]):delete s.resources,n["x-mcp"]=s,n}function sf(e,t){let r=Dt(e),n=Dt(t),o=[...n.keys()].filter(c=>!r.has(c)),s=[...r.keys()].filter(c=>!n.has(c)),i=[...n.keys()].filter(c=>r.has(c)&&!Lt(r.get(c),n.get(c))),a=[];return o.length>0&&a.push(`added: ${o.join(", ")}`),s.length>0&&a.push(`removed: ${s.join(", ")}`),i.length>0&&a.push(`changed: ${i.join(", ")}`),a.length>0?a.join("; "):void 0}function vi(e,t){if(Lt(e,t))return[];let r=Te(e["x-mcp"])?e["x-mcp"]:{},n=Te(t["x-mcp"])?t["x-mcp"]:{},o=[];for(let s of["tools","prompts","resources"]){let i=sf(r[s],n[s]);i&&o.push(`${s} - ${i}`)}return Lt(r.protocolVersion,n.protocolVersion)||o.push(`protocolVersion - ${r.protocolVersion??"not set"} -> ${n.protocolVersion}`),Lt(r.capabilities,n.capabilities)||o.push("capabilities changed"),Lt(r.servers,n.servers)||o.push("servers - the MCP server URL is not listed"),o.length===0&&o.push("x-mcp changed"),o}var P={};Qn(P,{BIGINT_FORMAT_RANGES:()=>Mr,CONSTANT_CATCH:()=>Zi,Class:()=>so,NUMBER_FORMAT_RANGES:()=>qt,aborted:()=>ze,allowsEval:()=>lo,assert:()=>pf,assertEqual:()=>af,assertIs:()=>uf,assertNever:()=>lf,assertNotEqual:()=>cf,assignProp:()=>fe,attachSchema:()=>Ft,base64ToUint8Array:()=>Ii,base64urlToUint8Array:()=>Ef,cached:()=>dt,captureStackTrace:()=>Zr,cleanEnum:()=>Rf,cleanRegex:()=>Ut,clone:()=>ge,cloneDef:()=>mf,codePointLength:()=>Vt,constantCatch:()=>Ni,createTransparentProxy:()=>wf,defineLazy:()=>$i,defineLazyInternal:()=>I,derived:()=>Af,esc:()=>co,escapeRegex:()=>Oe,explicitlyAborted:()=>mo,extend:()=>vf,finalizeIssue:()=>be,floatSafeRemainder:()=>ao,getElementAtPath:()=>hf,getEnumValues:()=>lt,getLengthableOrigin:()=>Bt,getParsedType:()=>xf,getSizableOrigin:()=>Ci,hexToUint8Array:()=>Cf,hide:()=>Lr,installLazyProp:()=>jf,isObject:()=>Xe,isPlainObject:()=>qe,issue:()=>mt,joinValues:()=>Ar,jsonStringifyReplacer:()=>pt,members:()=>go,merge:()=>kf,mergeDefs:()=>Ee,normalizeParams:()=>S,nullish:()=>io,numKeys:()=>yf,objectClone:()=>df,omit:()=>bf,optionalKeys:()=>fo,own:()=>Ue,parsedType:()=>ho,partial:()=>$f,pick:()=>zf,prefixIssues:()=>Ce,primitiveTypes:()=>Ei,promiseAllObject:()=>gf,propertyKeyTypes:()=>po,randomString:()=>_f,rawShape:()=>ft,required:()=>Pf,safeExtend:()=>Sf,shallowClone:()=>Ri,sizeCaps:()=>Dr,slugify:()=>uo,stringifyPrimitive:()=>Nr,toZod:()=>ki,uint8ArrayToBase64:()=>Ai,uint8ArrayToBase64url:()=>Of,uint8ArrayToHex:()=>If,unwrapMessage:()=>ut});function af(e){return e}function cf(e){return e}function ki(){return e=>e}function uf(e){}function lf(e){throw new Error("Unexpected value in exhaustive check")}function pf(e){}function lt(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Ar(e,t="|"){return e.map(r=>Nr(r)).join(t)}function pt(e,t){return typeof t=="bigint"?t.toString():t}var oo=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function dt(e){return new oo(e)}function io(e){return e==null}function Ut(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ao(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var Si=Symbol("evaluating");function $i(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Si)return n===void 0&&(n=Si,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function df(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function fe(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ft(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Re(e){return ft(e._zod.def)??e._zod.def.shape}function Pi(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return fe(this,t,n),n},enumerable:!0,configurable:!0})}function Ti(e,t,r){t in e?fe(e,t,r):e[t]=r}function Ge(e,t,r,n){let o=Re(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(o,s);i.enumerable&&(i.get?Pi(e,s,()=>{let a=t._zod.def.shape[s];return n?n(a,s):a}):Ti(e,s,n?n(i.value,s):i.value))}}function ff(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?Pi(e,r,()=>t[r]):Ti(e,r,n.value))}}function Ee(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function mf(e){return Ee(e._zod.def)}function hf(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function gf(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s<t.length;s++)o[t[s]]=n[s];return o})}function _f(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function co(e){return JSON.stringify(e)}function uo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Zr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var lo=dt(()=>{if(ue.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function qe(e){if(Xe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Xe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ri(e){return qe(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function yf(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var xf=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},po=new Set(["string","number","symbol"]),Ei=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ge(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function S(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function wf(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,s){return t??(t=e()),Reflect.set(t,n,o,s)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function Nr(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function fo(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var qt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Mr={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function zf(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return Ge(s,e,jr(e,t)),ge(e,Ee(r,{shape:s,checks:[]}))}function jr(e,t){let r=Re(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o)}return n}function bf(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(jr(e,t)),i={};return Ge(i,e,Reflect.ownKeys(Re(e)).filter(a=>!s.has(a))),ge(e,Ee(r,{shape:i,checks:[]}))}function vf(e,t){if(!qe(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=Re(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ge(e,Ee(e._zod.def,{shape:Oi(e,t)}))}function Oi(e,t){let r={};return Ge(r,e,Reflect.ownKeys(Re(e))),ff(r,t),r}function Sf(e,t){if(!qe(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ge(e,Ee(e._zod.def,{shape:Oi(e,t)}))}function kf(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Ge(r,e,Reflect.ownKeys(Re(e))),Ge(r,t,Reflect.ownKeys(Re(t)));let n=Ee(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ge(e,n)}function $f(e,t,r,n="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let a=r?new Set(jr(t,r)):void 0,c={};return Ge(c,t,Reflect.ownKeys(Re(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),ge(t,Ee(t._zod.def,{shape:c,checks:[]}))}function Pf(e,t,r){let n=r?new Set(jr(t,r)):void 0,o={};return Ge(o,t,Reflect.ownKeys(Re(t)),(s,i)=>n&&!n.has(i)?s:new e({type:"nonoptional",innerType:s})),ge(t,Ee(t._zod.def,{shape:o}))}function ze(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function mo(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Ce(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function ut(e){return typeof e=="string"?e:e?.message}function Dr(e){let t=[];for(let r of e??[]){let n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;let o=n.maximum??n.length??n.size;o>=0&&t.push([o,r])}return t}function Ft(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function be(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:ut(e.inst?._zod.def?.error?.(e))??ut(s?.(e))??ut(t?.error?.(e))??ut(r.customError?.(e))??ut(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=e[c]);return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=e.input),a}function Ci(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Tf=/[\uD800-\uDBFF]/;function Vt(e){let t=e.length;if(!Tf.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function Bt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ho(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function mt(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function Rf(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Ii(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function Ai(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Ef(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Ii(t+r)}function Of(e){return Ai(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Cf(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function If(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var so=class{constructor(...t){}};function go(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):Zf(e,r,n.value)}}function Ue(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function Lr(e,t,r){return Ue(e,t,r,!1)}function Af(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return Ue(this,r,n(this))},set(o){Ue(this,r,o)}})}return t}function Zf(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Ue(this,t,r.bind(this))},set(n){Ue(this,t,n)}})}function Nf(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var no,Le=!1,Mf={configurable:!0,get(){Le=!0}};function I(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&no!==e._zod){no=void 0;return}no=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,Mf);let o=Le;Le=!1;try{let s=r(this);return Le?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),Le=Le||o,s}catch(s){throw delete this[t],Le=Le||o,s}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function jf(e,t,r,n){let o=Nf(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:s})}})}var Zi="~constantCatch";function Ni(e){let t=()=>e;return t[Zi]=!0,t}var Mi,yo=Object.freeze({status:"aborted"}),_o={value:void 0,enumerable:!1},ji="captureStackTrace"in Error?Error:null;function Df(e){let t=ji;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return ji=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function g(e,t,r,n){let o={};function s(f){this.def=f,this.constr=d,this.traits=new Set}s.prototype=o;let i=r,a=i&&new WeakSet;function c(f,m){if(f._zod){if(f._zod.traits.has(e))return}else{_o.value=new s(m);try{Object.defineProperty(f,"_zod",_o)}finally{_o.value=void 0}}if(f._zod.traits.add(e),t(f,m),a){let _=Object.getPrototypeOf(f),x=f._zod.constr.prototype,$=_;for(;$&&$!==x;)$=Object.getPrototypeOf($);let R=$??_;a.has(R)||(a.add(R),go(R,i))}let h=d.prototype;for(let _ in h)Object.prototype.hasOwnProperty.call(h,_)&&(_ in f||(f[_]=h[_].bind(f)))}let u=n?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(f){let m=n?.Parent?Df(l):this;c(m,f);let h=m._zod.deferred;if(h){for(let x of h)x();m._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(m),m}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>n?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var ve=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ht=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Mi=globalThis).__zod_globalConfig??(Mi.__zod_globalConfig={});var ue=globalThis.__zod_globalConfig;function le(e){return e&&Object.assign(ue,e),ue}function Lf(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,pt,2)),e.message}function Uf(e){this._zod.message=e}var qf={get:Lf,set:Uf,enumerable:!0,configurable:!0},wo={value:void 0,enumerable:!1},Di=new WeakSet([Object.prototype,Error.prototype]),Li=(e,t)=>{e.name="$ZodError",wo.value=t,Object.defineProperty(e,"issues",wo),wo.value=void 0,Object.defineProperty(e,"message",qf);let r=Object.getPrototypeOf(e);Di.has(r)||(Di.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},Ui=g("$ZodError",Li),qi=g("$ZodError",Li,void 0,{Parent:Error});function Ff(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function zo(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?Ff(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return{formErrors:n,fieldErrors:r}}function bo(e,t=r=>r.message){let r={_errors:[]},n=(o,s=[])=>{for(let i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>n({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;for(;u<a.length;){let l=a[u],d=u===a.length-1;if(l==="_errors"){d&&c._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=c[l];d&&f._errors.push(t(i)),c=f,u++}}}};return n(e),r}function Ur(e,t){return{callee:t?.callee??e,Err:t?.Err}}var qr=e=>{let t=(r,n,o,s)=>{let i=o?{...o,async:!1}:{async:!1},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ve;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map(u=>be(u,i,le())));throw Zr(c,s?.callee??t),c}return a.value};return t};var Fr=e=>{let t=async(r,n,o,s)=>{let i=o?{...o,async:!0}:{async:!0},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(s?.Err??e)(a.issues.map(u=>be(u,i,le())));throw Zr(c,s?.callee??t),c}return a.value};return t};var Ht=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new ve;return s.issues.length?Fi(e,s.issues,o):{success:!0,data:s.value}},vo=Ht(qi);function Fi(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(o=>be(o,r,le()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0}}}var Vr=e=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?Fi(e,s.issues,o):{success:!0,data:s.value}};var Bf=Symbol.for("zod.compile.invalid"),Hf=Symbol.for("zod.compile.fallback"),Br=((e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==Bf)return!0;if(n.definite===!0&&r===void 0)return!1}return Jf(e,t,r)});function Jf(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,s;if(o?(n[Hf]=!0,s=o({value:t,issues:[]},n)):s=e._zod.run({value:t,issues:[]},n),s instanceof Promise)throw new ve;return s.issues.length===0}var Hr=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},Vi=e=>{let t=qr(e),r=(n,o,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return t(n,o,a,Ur(r,i))};return r};var Bi=e=>{let t=qr(e),r=(n,o,s,i)=>t(n,o,s,Ur(r,i));return r};var Hi=e=>{let t=Fr(e),r=async(n,o,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(n,o,a,Ur(r,i))};return r};var Ji=e=>{let t=Fr(e),r=async(n,o,s,i)=>await t(n,o,s,Ur(r,i));return r};var Wi=e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Ht(e)(t,r,o)};var Ki=e=>(t,r,n)=>Ht(e)(t,r,n);var Gi=e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Vr(e)(t,r,o)};var Xi=e=>async(t,r,n)=>Vr(e)(t,r,n);var Yi=/^[cC][0-9a-z]{6,}$/,Qi=/^[0-9a-z]+$/,ea=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ta=/^[0-9a-vA-V]{20}$/,ra=/^[A-Za-z0-9]{27}$/,na=/^[a-zA-Z0-9_-]{21}$/;function oa(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var sa=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var ia=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ko=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var aa=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Wf="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function ca(){return new RegExp(Wf,"u")}var ua=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,la=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var pa=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,da=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,fa=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ma=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var ha=/^https?$/,ga=/^\+[1-9]\d{6,14}$/;var _a="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function Kf(e){return new RegExp(`^${e}$`)}var ya=Kf(_a);function So(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function xa(e){return new RegExp(`^${So(e)}$`)}function wa(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${So({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${So({precision:e.precision})}`:r;return new RegExp(`^${_a}T(?:${n})$`)}var za=/^[\s\S]{0,}$/;var ba=/^-?\d+n?$/,$o=/^-?\d+$/,Jt=/^-?\d+(?:\.\d+)?$/,va=/^(?:true|false)$/i,Sa=/^null$/i;var ka=/^[^A-Z]*$/,$a=/^[^a-z]*$/;var Q=g("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Po=e=>{let t=e.value;return!io(t)&&t.length!==void 0},Jr={number:"number",bigint:"bigint",object:"date"},To=g("$ZodCheckLessThan",(e,t)=>{Q.init(e,t);let r=Jr[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:Jr[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ro=g("$ZodCheckGreaterThan",(e,t)=>{Q.init(e,t);let r=Jr[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:Jr[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pa=g("$ZodCheckMultipleOf",(e,t)=>{Q.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):ao(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Ta=g("$ZodCheckNumberFormat",(e,t)=>{Q.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=qt[t.format];e._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Ra=g("$ZodCheckMaxLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=Po),e._zod.check=n=>{let o=n.value,s=o.length;if((typeof o=="string"&&s>t.maximum?Vt(o):s)<=t.maximum)return;let a=Bt(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ea=g("$ZodCheckMinLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=Po),e._zod.check=n=>{let o=n.value,s=o.length;if((typeof o=="string"&&s>=t.minimum&&s<t.minimum*2?Vt(o):s)>=t.minimum)return;let a=Bt(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Oa=g("$ZodCheckLengthEquals",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=Po),e._zod.check=n=>{let o=n.value,s=o.length,i=typeof o=="string"&&s>=t.length&&s<=t.length*2?Vt(o):s;if(i===t.length)return;let a=Bt(o),c=i>t.length;n.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Wt=g("$ZodCheckStringFormat",(e,t)=>{var r,n;Q.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Ca=g("$ZodCheckRegex",(e,t)=>{Wt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ia=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ka),Wt.init(e,t)}),Aa=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=$a),Wt.init(e,t)}),Za=g("$ZodCheckIncludes",(e,t)=>{Q.init(e,t);let r=Oe(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Na=g("$ZodCheckStartsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`^${Oe(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ma=g("$ZodCheckEndsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`.*${Oe(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var ja=g("$ZodCheckOverwrite",(e,t)=>{Q.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Wr=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
|
|
8
8
|
`).filter(i=>i),o=Math.min(...n.map(i=>i.length-i.trimStart().length)),s=n.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
9
9
|
${r.join(`
|
|
10
10
|
`)}
|
|
@@ -4,5 +4,5 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{ka as t}from"./
|
|
7
|
+
import{ka as t}from"./PM72YBPD.js";import*as e from"node:process";var o=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],n=class{frames;currentFrame;intervalId;message;constructor(){this.frames=o,this.currentFrame=0,this.intervalId=null,this.message=""}showFrame(){t.info("\r"+this.frames[this.currentFrame]+" "+this.message),this.currentFrame=(this.currentFrame+1)%this.frames.length}start(r){if(this.message!==r){if(this.message=r,!e.stderr.isTTY){t.info(`${r}...
|
|
8
8
|
`);return}this.intervalId===null&&(this.intervalId=setInterval(()=>{this.showFrame()},100))}}stop(){this.intervalId!==null&&(clearInterval(this.intervalId),this.intervalId=null,t.info("\r")),this.message=""}};function h(i){i.stop(),e.stderr.isTTY&&t.info("\x1B[2K")}function m(i,r){let[s]=r.inFlight;if(!s)return;let a=r.inFlight.size>1?` (+${r.inFlight.size-1} more)`:"";i.start(`[${r.position}/${r.total}] ${r.action} ${s}${a}`)}export{n as a,h as b,m as c};
|
|
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{b as A,c as F,d as S,e as l}from"./
|
|
7
|
+
import{b as A,c as F,d as S,e as l}from"./OBOPBF6L.js";import"./54N6XEVM.js";import{e as $,g as x,r as I,s as P}from"./YZGGKIJC.js";import"./KFQC57GK.js";import{f as p}from"./B7U3CPK6.js";import{ca as w,k as u,ka as n}from"./PM72YBPD.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";async function O({argv:t,config:o,version:c}){let h=performance.now(),j=Date.now(),{organization:g,project:d,"mount-path":z,verbose:D}=t,f=t.domain||x(),e,r,y,b,s=[];try{let i=$();if(e=P(t.files,(a,T)=>{n.warn(`File ${a} is overwritten by ${T}
|
|
8
8
|
`)}),!e.length)return p("push",h,"No files to upload");let m=await I({domain:f,apiKey:i,organization:g,project:d,mountPath:z,files:e,defaultBranch:t["default-branch"],commit:{message:t.message,branchName:t.branch,sha:t["commit-sha"],url:t["commit-url"],createdAt:t["created-at"],namespace:t.namespace,repository:t.repository,author:U(t.author)},version:c,replace:t.replace,onUploadStart:a=>{n.info(`Uploading to ${a.mountPath} ${e.length} ${u("file",e.length)}:
|
|
9
9
|
`)},onSunsetWarning:a=>s.push(a),onSlugDeprecated:S});r=m.pushId,y=m.organizationId,b=m.projectId}catch(i){l("push",s),F("\u2717 File upload failed.",i)}for(let i of e)n.info(w(`\u2713 ${i.name}
|
|
10
10
|
`));return n.info(`
|
|
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{b as a,c as b,d as c}from"./
|
|
7
|
+
import{b as a,c as b,d as c}from"./K66EVS2A.js";import"./TFPMT2XD.js";import"./FQ5TX7OY.js";import"./ETT7L7GS.js";import"./EB3WXZ4Z.js";import"./PXLG2O2D.js";import"./2EVLFD7C.js";import"./WZXA5XPB.js";import"./PM72YBPD.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{b as cliDocs,a as cliGenerator,c as cliSample};
|
|
@@ -4,5 +4,5 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a as p,b as a}from"./
|
|
7
|
+
import{a as p,b as a}from"./AQ34YLFO.js";import{h as c,m as l}from"./YZGGKIJC.js";import"./KFQC57GK.js";import{ka as i,qa as n}from"./PM72YBPD.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";async function w({argv:e,config:s,version:f}){let[r,o,...g]=e.project.split("/");if(!r||!o||g.length>0)throw new n(`Specify the project as \`<organization>/<project>\`, for example \`acme/developer-portal\`. Got: \`${e.project}\`.`);let t=c(s,e.residency),m=l(t,r,o),d=p(t,f);i.info(`Cloning ${r}/${o} from ${t}
|
|
8
8
|
`);let{code:j}=await a(["clone",...d.flatMap(C=>["--config",C]),"--",m,e.directory??o]);if(j!==0)throw new n("git clone failed.")}export{w as handleProjectClone};
|
|
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a as o,c as n}from"./HBUZKWXC.js";import{ka as t}from"./
|
|
7
|
+
import{a as o,c as n}from"./HBUZKWXC.js";import{ka as t}from"./PM72YBPD.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";import{spawn as m}from"node:child_process";var j=async({argv:e})=>{t.info(`
|
|
8
8
|
Launching eject using NPX.
|
|
9
9
|
|
|
10
10
|
`);let{npxExecutableName:c,sanitize:r,shell:i}=n(),p=r(e.path,o),a=r(e["project-dir"],o);m(c,["-y","@redocly/realm","eject",`${e.type}`,p,`-d=${a}`,e.force?`--force=${e.force}`:""],{stdio:"inherit",shell:i}).on("error",s=>{throw t.info(`Eject launch failed: ${s.message}`),new Error("Eject launch failed.")})};export{j as handleEject};
|
|
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{qa as p}from"./
|
|
7
|
+
import{qa as p}from"./PM72YBPD.js";import{spawn as l}from"node:child_process";import{existsSync as a}from"node:fs";import*as s from"node:path";var m=/[\\/](_npx|dlx)[\\/]/;function T(t,r){let o=`credential.${t}/.helper`,e=!m.test(process.argv[1]??"")&&d("redocly")?"redocly":`npx --yes @redocly/cli@${r}`;return[`${o}=`,`${o}=!REDOCLY_SUPPRESS_NOTIFICATIONS=true ${e} project git-credentials`]}async function x(t,{capture:r=!1}={}){return new Promise((o,i)=>{let e=l("git",t,{stdio:r?["ignore","pipe","ignore"]:"inherit",env:{...process.env,GIT_TERMINAL_PROMPT:"0"}}),c="";e.stdout?.on("data",n=>c+=n.toString()),e.on("error",n=>i(u(n))),e.on("close",n=>o({code:n??1,output:c.trim()}))})}function d(t){let r=process.platform==="win32"?[".cmd",".exe"]:[""];return(process.env.PATH??"").split(s.delimiter).some(o=>o&&r.some(i=>a(s.join(o,t+i))))}function u(t){return t.code==="ENOENT"?new p("git is not installed or not on PATH."):t}export{T as a,x as b};
|
|
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a as fe}from"./BJ6Z66KZ.js";import{b as B,f as U,v as m}from"./
|
|
7
|
+
import{a as fe}from"./BJ6Z66KZ.js";import{b as B,f as U,v as m}from"./B7U3CPK6.js";import{$ as S,Ea as I,Fa as G,X as M,ba as V,ca as w,ea as _,ia as y,k as F,ka as l,qa as R,ra as q,t as T,w as g,wa as H,x as k,xa as A,y as x,ya as C,z as b}from"./PM72YBPD.js";import"./6RTITFQA.js";import{e as ae}from"./RFWIIJFG.js";import{writeFileSync as ye}from"node:fs";var P=ae(fe(),1);function E(e){let o=P.default.parse(e);return o?`${o.major}.${o.minor}.${o.patch}`:void 0}function Y(e,o){return P.default.major(e)===0&&o==="major"?"minor":o}function J(e,o){let n=E(e);return!n||o===void 0?n:P.default.inc(n,Y(n,o))}function Q(e){let{required:o}=e;if(o===void 0)return;let n=E(e.base),i=E(e.revision);if(!n||!i)return"\u274C info.version is not a semver string, so --check-version cannot compare it.";let r=Y(n,o),t=J(n,o);return P.default.gte(i,t)?void 0:`\u274C info.version ${n===i?`stayed ${n}`:`went ${n} \u2192 ${i}`}, but these changes require a ${r} bump (${t})${r===o?"":" while below 1.0"}.`}function W(e,o){if(o==="none")return;let n=[...x].reverse().filter(t=>b(t)>=b(o)&&e[t]>0);if(!n.length)return;let i=n.reduce((t,s)=>t+e[s],0);return`\u274C Diff failed with ${n.map(t=>`${e[t]} ${t}`).join(" and ")} ${F("change",i)}.`}var pe={major:"error"};function K(e){let o=e.changes.flatMap(n=>n.verdicts.flatMap(({ruleId:i,impact:r,message:t,location:s})=>{let a=pe[r];return a?[{message:t,ruleId:i,severity:a,location:[s],suggest:[]}]:[]}));C(o,{format:"github-actions",totals:A(o),maxProblems:o.length})}function $(e){let{start:o}=H(e);return{file:m(e.source.absoluteRef),line:o.line,col:o.col}}function Z(e){let{file:o,line:n,col:i}=$(e);return{file:o,pointer:e.pointer,line:n,col:i}}function X({location:e,value:o}){return{...Z(e),value:o}}function N(e){return{path:e.path,typeName:g(e.node),kind:e.kind,impact:e.impact,verdicts:e.verdicts.map(({location:o,...n})=>({...n,location:Z(o)})),property:e.kind==="modified"?e.property:void 0,base:"base"in e?X(e.base):void 0,revision:"revision"in e?X(e.revision):void 0}}function ee(e){let o={reportVersion:"1",files:{base:m(e.files.base),revision:m(e.files.revision)},specVersions:e.specVersions,infoVersions:e.infoVersions,summary:e.summary,bump:e.bump,changes:e.changes.map(N)};return JSON.stringify(o,null,2)}var L={oas2:"OpenAPI 2.0",oas3_0:"OpenAPI 3.0",oas3_1:"OpenAPI 3.1",oas3_2:"OpenAPI 3.2",async2:"AsyncAPI 2",async3:"AsyncAPI 3",arazzo1:"Arazzo 1.0",arazzo1_1:"Arazzo 1.1",overlay1:"Overlay 1",openrpc1:"OpenRPC 1",graphql:"GraphQL"};function c(e){return String(e).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function me(e){let o=e.kind==="modified"?`${e.path} \xB7 ${e.property}`:e.path,{base:n,revision:i}=N(e);return`
|
|
8
8
|
<details class="change ${e.impact}">
|
|
9
9
|
<summary>
|
|
10
10
|
<span class="badge">${c(e.impact)}</span>
|
|
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{Q as D,R as h,S as O,W as C,ba as P,ca as j,d as E,da as S,e as x,ea as f,f as $,ia as b,k as l,ka as o,qa as a,u}from"./
|
|
7
|
+
import{Q as D,R as h,S as O,W as C,ba as P,ca as j,d as E,da as S,e as x,ea as f,f as $,ia as b,k as l,ka as o,qa as a,u}from"./PM72YBPD.js";var y=["json","yaml","yml"];import*as i from"node:fs";import{basename as k,dirname as d,extname as g,join as T,resolve as m,relative as R}from"node:path";import*as p from"node:process";import{performance as F}from"perf_hooks";async function te(e,n){let r=!x(e)&&$(n.resolvedConfig.apis)?G(n):await W(e,n),c=r.filter(({path:s})=>!z(s));if(x(c)){for(let{path:s}of c)o.warn(`
|
|
8
8
|
${q(s)} ${P(`does not exist or is invalid.
|
|
9
9
|
|
|
10
10
|
`)}`);throw new a("Please provide a valid path.")}if(r.length===0)throw new a("No APIs were provided. Specify an API via the command argument or define one in your config.");return r}function w(e){return e.configPath?d(e.configPath):p.cwd()}function z(e){if(!e.trim())throw new a("Path cannot be empty.");return i.existsSync(e)||u(e)?e:void 0}function G(e){return Object.entries(e.resolvedConfig.apis||{}).map(([n,{root:t,output:r}])=>({path:u(t)?t:m(w(e),t),alias:n,output:r&&m(w(e),r)}))}function N(e,n){let t=w(e),r=e.resolvedConfig.apis?.[n];return r?{path:u(r.root)?r.root:m(t,r.root),alias:n,output:r.output&&m(t,r.output)}:{path:n,alias:Object.entries(e.resolvedConfig.apis||{}).find(([c,s])=>m(t,s.root)===m(n))?.[0]??void 0}}async function W(e,n){let{hasMagic:t,glob:r}=await import("./SJHPKWSD.js");return(await Promise.all(e.map(async c=>t(c)&&!u(c)?(await r(c,{cwd:w(n)})).map(I=>N(n,I)):N(n,c)))).flat()}function L(e){return p.env.NODE_ENV==="test"?"<test>ms":`${Math.ceil(F.now()-e)}ms`}function oe(e,n,t){let r=L(n);o.info(b(`
|