@redocly/cli 2.71.2 → 2.72.1
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/README.md +1 -1
- package/THIRD_PARTY_NOTICES +29 -7
- package/lib/chunks/{EHJ3FMW6.js → 2AW4F6ZZ.js} +1 -1
- package/lib/chunks/{3EQNI6CT.js → 2MF3MKAD.js} +1 -1
- package/lib/chunks/{UYZXI3NO.js → 2X2KHSF3.js} +1 -1
- package/lib/chunks/{YF4FMOTE.js → 3FA5W77S.js} +1 -1
- package/lib/chunks/{VPTYPV6P.js → 3FVHXIZN.js} +1 -1
- package/lib/chunks/{P5T6BIKW.js → 3N53VPSU.js} +1 -1
- package/lib/chunks/{KLGUZBJO.js → 3N73A66H.js} +1 -1
- package/lib/chunks/{JO76DPXR.js → 3WOXO2JS.js} +1 -1
- package/lib/chunks/{ORWIUECT.js → 4A5R4H5W.js} +1 -1
- package/lib/chunks/{NXREEI2S.js → 4LTPQZBP.js} +1 -1
- package/lib/chunks/{L325HIGK.js → 4QC7OVHI.js} +1 -1
- package/lib/chunks/{FDKY4PGX.js → 542GVIYM.js} +1 -1
- package/lib/chunks/5JF6EUWW.js +9 -0
- package/lib/chunks/{6X42UQ3O.js → 5MZU5MHZ.js} +1 -1
- package/lib/chunks/{DZT5NLUB.js → 5UPBGRBZ.js} +1 -1
- package/lib/chunks/{WO6IIVA3.js → 6LZX65VY.js} +8 -8
- package/lib/chunks/{NEWT5A6S.js → 6RTITFQA.js} +1 -1
- package/lib/chunks/{IQLQH23V.js → 6Y6B2SKE.js} +1 -1
- package/lib/chunks/765BYRQR.js +7 -0
- package/lib/chunks/{2TG3DP4I.js → 7NZS5HXU.js} +1 -1
- package/lib/chunks/{5CR6AOLY.js → A65OW7M7.js} +3 -3
- package/lib/chunks/ARUYNQHA.js +7 -0
- package/lib/chunks/BJ6Z66KZ.js +7 -0
- package/lib/chunks/{T77BOGYV.js → BWGBTYNU.js} +1 -1
- package/lib/chunks/{DM4EUYBB.js → BZTZIEWS.js} +2 -2
- package/lib/chunks/{4S6LRPCX.js → CBFNHKDJ.js} +1 -1
- package/lib/chunks/{OFIQ2EST.js → CYCPHJNX.js} +33 -33
- package/lib/chunks/DSBDKSRR.js +53 -0
- package/lib/chunks/E2CEKR6N.js +22 -0
- package/lib/chunks/{HRZLSSOF.js → EMWHLZB6.js} +1 -1
- package/lib/chunks/{DWXDCKZ7.js → ENIFTFYK.js} +1 -1
- package/lib/chunks/{BIS2ZFGS.js → ETJMQLWJ.js} +1 -1
- package/lib/chunks/{ADACRYTN.js → EU5WR2O3.js} +1 -1
- package/lib/chunks/{FAFMGLT6.js → FLQQ3VRQ.js} +1 -1
- package/lib/chunks/{BPJTNQBC.js → FZZACVYL.js} +1 -1
- package/lib/chunks/{N4GCIKY4.js → G7A4OE2M.js} +1 -1
- package/lib/chunks/{HP7UD4BA.js → GCAL2PYM.js} +1 -1
- package/lib/chunks/{MJ2NI6MR.js → GGHLD27S.js} +1 -1
- package/lib/chunks/{U4MI7HDM.js → GMPHU6KM.js} +1 -1
- package/lib/chunks/{HTFKP5HH.js → GWBLS542.js} +1 -1
- package/lib/chunks/{U2F3JOT2.js → GXILNSWK.js} +1 -1
- package/lib/chunks/{5AVTCY6F.js → HM7M6465.js} +1 -1
- package/lib/chunks/{5HPO77VR.js → I2JZXLJ6.js} +2 -2
- package/lib/chunks/I3YF3GEY.js +13 -0
- package/lib/chunks/{YWRFPTTI.js → IIQW437Z.js} +1 -1
- package/lib/chunks/{4H3DPQDW.js → IM4YIUUN.js} +1 -1
- package/lib/chunks/{LET2MPMU.js → JDMRVD45.js} +1 -1
- package/lib/chunks/{XVS7B4RZ.js → KIFXQTTL.js} +1 -1
- package/lib/chunks/{UVKUPD4U.js → L4VSY42B.js} +1 -1
- package/lib/chunks/LH3ONQEX.js +17 -0
- package/lib/chunks/{SSEMMWPY.js → LUNR7GV4.js} +1 -1
- package/lib/chunks/{LY6BDOEF.js → LY5MGNMA.js} +1 -1
- package/lib/chunks/{XQEXWC5L.js → MAACTVYP.js} +1 -1
- package/lib/chunks/{GFSMOHUE.js → MTKICX4T.js} +1 -1
- package/lib/chunks/{ZXOX7NF2.js → NMAWU5S4.js} +1 -1
- package/lib/chunks/{I4TK6NG7.js → PJHQKG7X.js} +1 -1
- package/lib/chunks/PTBPNZRZ.js +7 -0
- package/lib/chunks/{CZX7WE2R.js → PUZ5QSL3.js} +1 -1
- package/lib/chunks/{JRVXIEVC.js → PW2XFZOB.js} +1 -1
- package/lib/chunks/{TH44RKLO.js → QAT3DPT3.js} +1 -1
- package/lib/chunks/{QXXAC25O.js → R67IVFZH.js} +1 -1
- package/lib/chunks/RA4FAJM3.js +59 -0
- package/lib/chunks/{AZ5LIJEO.js → RF5LL2UZ.js} +1 -1
- package/lib/chunks/{JOUEVI3E.js → RQPH22PV.js} +1 -1
- package/lib/chunks/S3B562IT.js +7 -0
- package/lib/chunks/{3FR3456Q.js → S43EG4DB.js} +1 -1
- package/lib/chunks/{CER2D6ZD.js → S7VIXBKD.js} +7 -7
- package/lib/chunks/{VJZDR6KS.js → TFPMT2XD.js} +1529 -4
- package/lib/chunks/{AXGFQS75.js → U56BQ2BR.js} +2 -2
- package/lib/chunks/{KJNBOXDI.js → UOTHMCTM.js} +3 -3
- package/lib/chunks/{CR5TYFBN.js → VHZJNDWE.js} +2 -2
- package/lib/chunks/{BOTTA3HA.js → VOYPXV3Z.js} +1 -1
- package/lib/chunks/{UTEOWLD5.js → VS4MTPCM.js} +1 -1
- package/lib/chunks/{QTSECOQB.js → WEPGHS5R.js} +2 -2
- package/lib/chunks/{LKNL5LEV.js → WRKMMY3F.js} +1 -1
- package/lib/chunks/{7JS7JGWP.js → WTJ3S4D7.js} +1 -1
- package/lib/chunks/X22IMAJK.js +199 -0
- package/lib/chunks/{W7TN2XCW.js → X3FFOCXC.js} +1 -1
- package/lib/chunks/{CRJEY7P3.js → XTI7EXWX.js} +1 -1
- package/lib/chunks/{BH4FA7AH.js → YA5KTHFN.js} +1 -1
- package/lib/chunks/{Z6GFQV2Y.js → YA6D5EUI.js} +1 -1
- package/lib/chunks/{HMYFTLS7.js → ZFET6WME.js} +1 -1
- package/lib/chunks/{R32HBYOH.js → ZXB5O6JQ.js} +1 -1
- package/lib/eject-assets/AGENTS.md +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 +66 -0
- package/lib/eject-assets/generators/java/descriptor.ts +72 -0
- package/lib/eject-assets/generators/java/index.ts +245 -0
- package/lib/eject-assets/generators/java/models.ts +362 -0
- package/lib/eject-assets/generators/java/naming.ts +135 -0
- package/lib/eject-assets/generators/java/operations.ts +300 -0
- package/lib/eject-assets/generators/java/pagination.ts +94 -0
- package/lib/eject-assets/generators/java/types.ts +103 -0
- 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/eject-assets/skills/client-generators/SKILL.md +1 -1
- package/lib/eject-assets/skills/java-generator/SKILL.md +161 -0
- package/lib/index.js +91 -90
- package/lib/skills/redocly-cli/SKILL.md +3 -1
- package/package.json +1 -1
- package/lib/chunks/2ZEKFWJQ.js +0 -13
- package/lib/chunks/3VOQMXIZ.js +0 -7
- package/lib/chunks/7GADNOVY.js +0 -9
- package/lib/chunks/FRQHCFKP.js +0 -199
- package/lib/chunks/J2EPFEBO.js +0 -17
- package/lib/chunks/JZATGVUO.js +0 -53
- package/lib/chunks/KNMNSDHR.js +0 -7
- package/lib/chunks/U5DIFWGH.js +0 -7
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
var __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as $,b as y,c as I}from"./MAACTVYP.js";import{e as P}from"./YA5KTHFN.js";import{Ba as x,ka as h}from"./X22IMAJK.js";function F(t){let e=t.trim(),n=e.match(/^```(?:ya?ml|json)?\s*\n([\s\S]*?)\n```$/);return n?n[1]:e}async function M(t,e){let r=(await x({source:t,config:e})).filter(o=>o.severity==="error");if(r.length>0){let o=r.slice(0,5).map(s=>`${s.ruleId}: ${s.message}`).join("; ");throw new Error(`the result has ${r.length} validation problem(s): ${o}`)}}import{spawn as v}from"node:child_process";import{mkdtemp as R}from"node:fs/promises";import{tmpdir as S}from"node:os";import L from"node:path";var E=3e5,m=class extends Error{},C;function A(){return C??=R(L.join(S(),"redocly-ai-")),C}async function w(t,e,n,r){let o=await A();return new Promise((s,u)=>{let i=v(t,e,{stdio:["pipe","pipe","pipe"],cwd:o,env:{...process.env,...r}}),l="",f="",g=!1,d=setTimeout(()=>{g=!0,i.kill("SIGKILL")},E);i.stdout.on("data",c=>{l+=c.toString()}),i.stderr.on("data",c=>{f+=c.toString()}),i.on("error",c=>{if(clearTimeout(d),c.code==="ENOENT"){u(new m(`Could not find the "${t}" CLI on PATH. Is it installed?`));return}u(c)}),i.on("close",c=>{if(clearTimeout(d),g){u(new Error(`The "${t}" CLI did not respond within ${E/1e3} seconds.`));return}s({stdout:l,stderr:f,code:c})}),i.stdin.on("error",()=>{}),i.stdin.end(n)})}async function b(t){let e=["-p","--output-format","text","--tools","","--strict-mcp-config","--setting-sources","","--no-session-persistence","--append-system-prompt",t.system];t.model&&e.push("--model",t.model);let{stdout:n,stderr:r,code:o}=await w("claude",e,t.user,{CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1"});if(o!==0)throw new Error(`claude CLI exited with code ${o}: ${r.trim()||n.trim()}`);if(!n.trim())throw new Error("claude CLI returned no output.");return{text:n}}async function _(t){let e=["exec","--skip-git-repo-check","--sandbox","read-only","-c","mcp_servers={}","-c","project_doc_max_bytes=0"];t.model&&e.push("--model",t.model),e.push("-");let n=`${t.system}
|
|
8
|
+
|
|
9
|
+
${t.user}`,{stdout:r,stderr:o,code:s}=await w("codex",e,n);if(s!==0)throw new Error(`codex CLI exited with code ${s}: ${o.trim()||r.trim()}`);if(!r.trim())throw new Error("codex CLI returned no output.");return{text:r}}async function k(t){let e=["-p","--output-format","text","--trust"];t.model&&e.push("--model",t.model);let n=`${t.system}
|
|
10
|
+
|
|
11
|
+
${t.user}`,r;try{r=await w("cursor-agent",e,n)}catch(i){if(!(i instanceof m))throw i;try{r=await w("agent",e,n)}catch(l){throw l instanceof m?new m('Could not find the Cursor CLI ("cursor-agent" or "agent") on PATH. Is it installed?'):l}}let{stdout:o,stderr:s,code:u}=r;if(u!==0)throw new Error(`cursor CLI exited with code ${u}: ${s.trim()||o.trim()}`);if(!o.trim())throw new Error("cursor CLI returned no output.");return{text:o}}async function H(t,e){switch(t){case"claude":return b(e);case"codex":return _(e);case"cursor":return k(e);default:throw new Error(`Unknown AI provider: ${t}`)}}import{performance as N}from"node:perf_hooks";async function X(t){let{items:e}=t,n=new Array(e.length).fill(null),r=new $,o=new Set,s=0,u=0,i=!1,l=()=>I(r,{action:t.action,inFlight:o,position:s+1,total:e.length}),f=async()=>{for(;!i&&u<e.length;){let d=u++,c=e[d],a=t.label(c),T=N.now();o.add(a),l();try{n[d]=await t.run(c,d),s+=1,o.delete(a),y(r),h.info(`[${s}/${e.length}] ${a} \u2014 ${t.successNote} (${P(T)})
|
|
12
|
+
`)}catch(p){if(s+=1,o.delete(a),y(r),p instanceof m)throw i=!0,p;h.warn(`[${s}/${e.length}] ${a} \u2014 ${t.failureNote}: ${p instanceof Error?p.message:String(p)}
|
|
13
|
+
`)}l()}},g=Math.max(1,Math.min(t.concurrency,e.length));for(let d of await Promise.allSettled(Array.from({length:g},f)))if(d.status==="rejected")throw d.reason;return n}export{F as a,M as b,H as c,X as d};
|
|
@@ -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 r}from"./
|
|
7
|
+
import{c as r}from"./X22IMAJK.js";var s="components",p="paths",i="webhooks",O="x-webhooks",c="channels",f="operations";function e(o,n){if(r(o)){n(o);for(let t of Object.keys(o))e(o[t],n)}else if(Array.isArray(o))for(let t of o)e(t,n)}function S(o){return o.startsWith(`#/${s}/`)}export{s as a,p as b,i as c,O as d,c as e,f,e as g,S as h};
|
|
@@ -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,c,d,e}from"./
|
|
7
|
+
import{a,b,c,d,e}from"./GGHLD27S.js";import"./TFPMT2XD.js";import"./BZTZIEWS.js";import"./A65OW7M7.js";import"./WZXA5XPB.js";import"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{e as goDocs,c as goGenerator,d as goSample,a as goType,b as renderGoModels};
|
|
@@ -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{
|
|
7
|
+
import{a as o,c as n}from"./HBUZKWXC.js";import{ka as t}from"./X22IMAJK.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,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 k,f as v}from"./
|
|
7
|
+
import{b as k,f as v}from"./YA5KTHFN.js";import{A as p,N as A,O as S,P as y,X as f,Y as w,fa as d,ja as l,ka as n,ma as x,na as h,oa as O,p as u,qa as g,ta as b}from"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";import{performance as F}from"perf_hooks";function I(o){let t=Object.fromEntries(Object.entries(o).map(([s,{metric:e,total:r,counts:a}])=>[s,{metric:e,total:r,counts:a}]));n.output(JSON.stringify(t,null,2))}function P(o){let t=`| Feature | Count |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
`,s=[];for(let{metric:e,total:r,counts:a}of Object.values(o)){t+=`| ${e} | ${r} |
|
|
10
10
|
`;let c=Object.entries(a??{});c.length&&s.push(`
|
|
@@ -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 T,b as O,c as A,d as E}from"./
|
|
7
|
+
import{a as T,b as O,c as A,d as E}from"./6LZX65VY.js";import{c as m,k as C,r as $}from"./G7A4OE2M.js";import{a as q}from"./KFQC57GK.js";import{c as H,ka as u,qa as y,ra as R}from"./X22IMAJK.js";import"./6RTITFQA.js";import{e as z}from"./RFWIIJFG.js";import{createReadStream as F,createWriteStream as k,existsSync as N}from"node:fs";import{appendFile as V,mkdir as _,rm as j,writeFile as W}from"node:fs/promises";import B from"node:path";import{createInterface as G}from"node:readline";var w=class{outputPath;entriesPath;creatorVersion;writeChain=Promise.resolve();directoryEnsured=!1;started=!1;count=0;constructor(t,r){this.outputPath=B.resolve(process.cwd(),t),this.entriesPath=`${this.outputPath}.entries.tmp`,this.creatorVersion=r}get entryCount(){return this.count}add(t){let r=`${JSON.stringify(t)}
|
|
8
8
|
`,n=this.writeChain.catch(()=>{}).then(()=>this.append(r)).then(()=>{this.count+=1});return this.writeChain=n.catch(()=>{}),n}async finalize(){await this.writeChain.catch(()=>{}),await this.ensureDirectory(),await this.writeDocument(),await j(this.entriesPath,{force:!0})}async append(t){if(await this.ensureDirectory(),!this.started){await W(this.entriesPath,t,"utf8"),this.started=!0;return}await V(this.entriesPath,t,"utf8")}async ensureDirectory(){this.directoryEnsured||(await _(B.dirname(this.outputPath),{recursive:!0}),this.directoryEnsured=!0)}async writeDocument(){let t=k(this.outputPath,{encoding:"utf8"}),r=n=>new Promise((o,s)=>{t.write(n,i=>i?s(i):o())});try{let n=JSON.stringify({name:"redocly-cli proxy",version:this.creatorVersion});await r(`{
|
|
9
9
|
"log": {
|
|
10
10
|
"version": "1.2",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
var __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as k,b as E,c as I,d as v}from"./6LZX65VY.js";import{a as O}from"./2MF3MKAD.js";import{c as d,d as F}from"./G7A4OE2M.js";import{f as A}from"./YA5KTHFN.js";import{$ as C,ba as R,ca as $,da as S,ga as b,ka as s,qa as g,ra as M}from"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";import{mkdir as V,writeFile as W}from"node:fs/promises";import _ from"node:path";import{performance as q}from"node:perf_hooks";var T=20;function B(e){return e.total===0?void 0:Math.floor(e.covered/e.total*100)}function z(e){return e===void 0?"n/a":`${e}%`}function J(e,o){let t=e===void 0?0:Math.floor(e/100*T),r=`${"\u2588".repeat(t)}${"\u2591".repeat(T-t)}`;return!o||e===void 0?r:e>=80?$(r):e>=50?S(r):R(r)}function P(e,o){let t=[["operations",e.totals.operations],["parameters",e.totals.parameters],["schema properties",e.totals.properties],["response codes",e.totals.responses]],r=Math.max(...t.map(([,c])=>`${c.covered}/${c.total}`.length)),n="API coverage",a=[o?C(b(n)):n];for(let[c,i]of t){let f=B(i);a.push(` ${c.padEnd(18)} ${J(f,o)} ${z(f).padStart(5)} ${`${i.covered}/${i.total}`.padStart(r+3)}`)}return`${a.join(`
|
|
8
|
+
`)}
|
|
9
|
+
`}function L(e,o){let t={version:1,meta:{...o,exchanges:e.exchanges},totals:e.totals,operations:e.operations};return`${JSON.stringify(t,null,2)}
|
|
10
|
+
`}async function j(e){let o=await F(e.trafficPath);if(o.length===0)throw new Error("No traffic files found in the provided traffic path.");let t=E.create({openApiIndex:e.openApiIndex,matchMode:e.matchMode,ignoreCookies:e.ignoreCookies,ignoreHeaders:e.ignoreHeaders,previewFindingsLimit:e.previewFindingsLimit,activeRules:e.activeRules,server:e.server,minSeverity:e.minSeverity,coverage:e.coverage}),r=0,n=0;for(let a of o){let c=await O(a,e.format);if(!c){s.warn(`Skipping traffic file with unrecognized format: ${a}
|
|
11
|
+
`);continue}r+=1;for await(let i of c.parse(a))await t.process({...i,index:n}),n+=1}if(r===0)throw new Error("No supported traffic files found. In auto mode, files must match built-in traffic parser signatures.");if(n===0)throw new Error("No HTTP exchanges were parsed from the provided traffic files.");return t.finalize()}var N=!!process.stdout.isTTY&&process.env.NO_COLOR===void 0;function Y(e){let o=new Set;for(let t of e.operationsByMethod.values())for(let r of t)for(let n of r.servers)o.add(n.rawUrl);return Array.from(o).sort()}function G(e,o,t){let r=e.totalExchanges-e.skippedExchanges;if(r===0&&e.skippedExchanges>0){s.warn(`All ${e.skippedExchanges} exchange(s) were outside the --server "${t}" and were skipped. Check that the server matches the traffic URLs.
|
|
12
|
+
`);return}if(e.documentedExchanges>0||r===0)return;let n=Y(o),a=t?`Check that the --server "${t}" matches the traffic URLs and that the description paths align with the remainder.`:e.hostCompatibleExchanges===r?`The traffic hosts are compatible with the description servers (${n.join(", ")}), so the endpoints are likely undocumented; if they should be documented, check that the description base paths and paths align with the traffic URLs, or use --server to declare the server the traffic was captured against.`:`Check that the traffic host and base path match the description servers (${n.join(", ")}), or use --server to declare the server the traffic was captured against.`;s.warn(`None of the ${r} validated exchange(s) matched a documented operation. ${a}
|
|
13
|
+
`)}async function U(e,o){let t=d(e);await V(_.dirname(t),{recursive:!0}),await W(t,o,"utf8")}async function ue({argv:e,config:o}){let t=q.now(),r=d(e.traffic),n=e["traffic-format"],a=e.rules?v(e.rules):void 0,c=e["ignore-headers"]?v(e["ignore-headers"]):void 0,i=e.server;if(i&&e["match-mode"])throw new g("The --server and --match-mode options are mutually exclusive: --match-mode controls how requests are located via the description servers, while --server replaces the description servers with the one the traffic was captured against.");let f=e["match-mode"]??"strict-host",p=d(e.api),u=await I(p,o);if(u.loadedOperations===0)throw new g(`No OpenAPI operations were loaded from: ${p}`);let h=e["coverage-output"],{runId:D,summary:l,findings:H,coverage:m}=await j({trafficPath:r,format:n,matchMode:f,ignoreCookies:e["ignore-cookies"],ignoreHeaders:c,previewFindingsLimit:e["max-findings"],activeRules:a,openApiIndex:u,server:i,minSeverity:e["min-severity"],coverage:e.coverage||h!==void 0});G(l,u,i);let w=k({runId:D,summary:l,findings:H,meta:{specSource:p,trafficPath:r,format:n,matchMode:f,server:i}},{format:e["report-format"],color:N&&e["report-format"]==="pretty"&&!e.output,maxFindings:e["max-findings"]});e.output?(await U(e.output,w),s.info(`Drift report written to: ${d(e.output)}
|
|
14
|
+
`)):s.output(w);let x=e["report-format"]!=="pretty"&&!e.output;if(e.coverage&&m){let y=P(m,N&&!x);x?s.info(`
|
|
15
|
+
${y}`):s.output(`
|
|
16
|
+
${y}`)}if(h&&m&&(await U(h,L(m,{spec:p,traffic:r,matchMode:f,server:i})),s.info(`Coverage report written to: ${d(h)}
|
|
17
|
+
`)),A("drift",t,e.api),l.findingsBySeverity.error>0)throw new M("Drift detected.")}export{ue as handleDrift};
|
|
@@ -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"./PJHQKG7X.js";import"./TFPMT2XD.js";import"./HM7M6465.js";import"./4QC7OVHI.js";import"./BZTZIEWS.js";import"./ZXB5O6JQ.js";import"./A65OW7M7.js";import"./WZXA5XPB.js";import"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{b as cliDocs,a as cliGenerator,c as cliSample};
|
|
@@ -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"./S7VIXBKD.js";import"./ZXB5O6JQ.js";import"./A65OW7M7.js";import"./WZXA5XPB.js";import"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{b as generateClient,a as runGenerators};
|
|
@@ -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{
|
|
7
|
+
import{ka as t}from"./X22IMAJK.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};
|