@redocly/cli 2.71.0 → 2.71.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.
Files changed (156) hide show
  1. package/THIRD_PARTY_NOTICES +3 -3
  2. package/lib/chunks/{SXIMN47K.js → 25RSTUQA.js} +1 -1
  3. package/lib/chunks/{N37OGNC4.js → 2IUGP2IH.js} +3 -3
  4. package/lib/chunks/{STAMDB3P.js → 2NYYNBAC.js} +1 -1
  5. package/lib/chunks/{YDGFDJ2K.js → 3N7LKSDD.js} +1 -1
  6. package/lib/chunks/4DUOPCYP.js +7 -0
  7. package/lib/chunks/{QAPQYNI3.js → 54EKLNNI.js} +1 -1
  8. package/lib/chunks/5BQNATJZ.js +20 -0
  9. package/lib/chunks/{PF43QQZA.js → 5DW3QRJB.js} +2 -2
  10. package/lib/chunks/{E4MPGN3Z.js → 5SSWNONM.js} +1 -1
  11. package/lib/chunks/{B5KSRXXW.js → 6TCEQRVX.js} +1 -1
  12. package/lib/chunks/{G2M6SQCS.js → 6ZNJ7RDX.js} +2 -2
  13. package/lib/chunks/{YLRH4RVF.js → 7HFLPQAB.js} +2 -2
  14. package/lib/chunks/{JCP37EY3.js → ACAPGKSR.js} +59 -25
  15. package/lib/chunks/ACECCMWJ.js +14 -0
  16. package/lib/chunks/{O37B7ABT.js → AH6ANNYP.js} +1 -1
  17. package/lib/chunks/{EHQY7ZOF.js → B5SUTVG4.js} +1 -1
  18. package/lib/chunks/{HAOBCQWB.js → BE4Z5FOC.js} +10 -8
  19. package/lib/chunks/{TXSBWL3Y.js → BOWZV5S6.js} +1 -1
  20. package/lib/chunks/{IULINGO6.js → BPSWCUZE.js} +1 -1
  21. package/lib/chunks/{V6VNRABV.js → BXXX3ZCV.js} +1 -1
  22. package/lib/chunks/{QMS4UKIK.js → CHX7O5AM.js} +5 -5
  23. package/lib/chunks/{2NVGTELR.js → CJWIDJTB.js} +1 -1
  24. package/lib/chunks/{L4F2ERUL.js → CX76LEFC.js} +1 -1
  25. package/lib/chunks/{WBWCX3LS.js → DORXGE7Z.js} +93 -93
  26. package/lib/chunks/{LD5MEXEL.js → DP3T6VZX.js} +1 -1
  27. package/lib/chunks/{FKKC7G6X.js → DURXFJ7H.js} +1 -1
  28. package/lib/chunks/DVLD4FET.js +20 -0
  29. package/lib/chunks/{MV3ZJ5HR.js → EAFZ6DNQ.js} +1 -1
  30. package/lib/chunks/{LS3G7CUH.js → EBHQXW6Z.js} +1 -1
  31. package/lib/chunks/{RIGQPR2I.js → EO65RJ4Z.js} +1 -1
  32. package/lib/chunks/{T55LQK2H.js → EQOFXQKD.js} +1 -1
  33. package/lib/chunks/FBEEMKTB.js +7 -0
  34. package/lib/chunks/{BU4AMVHN.js → FGJDZKD2.js} +1 -1
  35. package/lib/chunks/G6SB4ZP5.js +7 -0
  36. package/lib/chunks/{LRMOPAZ4.js → GAKWND4S.js} +1 -1
  37. package/lib/chunks/HAGYQ4BK.js +20 -0
  38. package/lib/chunks/{LNEXTJNF.js → HBWCMTP3.js} +1 -1
  39. package/lib/chunks/{2R2CXBRH.js → HWOL3HHR.js} +1 -1
  40. package/lib/chunks/{2UAA6O26.js → ILYXMZRT.js} +1 -1
  41. package/lib/chunks/{NBMSBQEL.js → INGAWMLB.js} +1 -1
  42. package/lib/chunks/{3DMXMP4K.js → IYV7EO2J.js} +1 -1
  43. package/lib/chunks/IZMDARCL.js +22 -0
  44. package/lib/chunks/JOWPA3MJ.js +7 -0
  45. package/lib/chunks/KFQC57GK.js +145 -0
  46. package/lib/chunks/{CZS2ZXJ7.js → KJIUDCYZ.js} +1 -1
  47. package/lib/chunks/{QB6CQ2CV.js → L2O63VRM.js} +1 -1
  48. package/lib/chunks/{MYSYBBIO.js → MH5X2EVH.js} +1 -1
  49. package/lib/chunks/{RLJVKAOL.js → NLAPR7D4.js} +1 -1
  50. package/lib/chunks/O53IFFP3.js +98 -0
  51. package/lib/chunks/{MQUZ5IJ2.js → PBQOGZ5C.js} +1 -1
  52. package/lib/chunks/{BCRM4BTA.js → Q3IJURM3.js} +1 -1
  53. package/lib/chunks/{HHCU6T2V.js → QXBSAWH3.js} +1 -1
  54. package/lib/chunks/QXHFS5G6.js +7 -0
  55. package/lib/chunks/{E3FBSKNS.js → QZJAXPYF.js} +1 -1
  56. package/lib/chunks/{QTGTCBFK.js → RBJCAITC.js} +1 -1
  57. package/lib/chunks/{CN2ZOHYL.js → RBNQC5ZB.js} +1 -1
  58. package/lib/chunks/{2CMKIFTE.js → RNA6JDRC.js} +1 -1
  59. package/lib/chunks/{DHP4BBTH.js → RNL7TC2W.js} +1 -1
  60. package/lib/chunks/{WKDC6LN3.js → RUPTJCF5.js} +1 -1
  61. package/lib/chunks/{YDQCJP4F.js → S6W63XAS.js} +1 -1
  62. package/lib/chunks/{B3GE7EIX.js → TN3JQHMS.js} +1 -1
  63. package/lib/chunks/TNRIBQHV.js +7 -0
  64. package/lib/chunks/TZROZMVE.js +20 -0
  65. package/lib/chunks/{TR67FYLT.js → U7KIB7CD.js} +1 -1
  66. package/lib/chunks/{EFB2YVY2.js → UMN7TKTH.js} +2 -2
  67. package/lib/chunks/{VXD5O25A.js → V34D5CUU.js} +1 -1
  68. package/lib/chunks/{SBHCUK5I.js → W2CABGMW.js} +1 -1
  69. package/lib/chunks/{MYOQDPQZ.js → WCJ2HAN3.js} +1 -1
  70. package/lib/chunks/{5ECOOGVW.js → WJ3YDHQA.js} +1 -1
  71. package/lib/chunks/{6TE6AFQ3.js → WLI2XLEP.js} +1 -1
  72. package/lib/chunks/{NCDX4IGX.js → X7C43UBI.js} +1 -1
  73. package/lib/chunks/{EH6VW7JO.js → XGPGFZMH.js} +1 -1
  74. package/lib/chunks/{YUEIHUPX.js → XZIK3H6V.js} +1 -1
  75. package/lib/chunks/{P7LM57HK.js → Y3LDWYZD.js} +1 -1
  76. package/lib/chunks/{VJHJJBVN.js → Y5DDX2MU.js} +1 -1
  77. package/lib/chunks/{MT4W54PL.js → YL3LVBZF.js} +1 -1
  78. package/lib/chunks/{O6NMXFEP.js → ZBB6PS6I.js} +1 -1
  79. package/lib/chunks/{NZE22F7Q.js → ZQTHHPK3.js} +2 -2
  80. package/lib/eject-assets/generators/cli/docs.ts +1 -1
  81. package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
  82. package/lib/eject-assets/generators/cli/index.ts +2 -2
  83. package/lib/eject-assets/generators/cli/render.ts +1 -1
  84. package/lib/eject-assets/generators/go/client.ts +1 -1
  85. package/lib/eject-assets/generators/go/descriptor.ts +1 -1
  86. package/lib/eject-assets/generators/go/index.ts +2 -2
  87. package/lib/eject-assets/generators/go/models.ts +7 -2
  88. package/lib/eject-assets/generators/go/naming.ts +1 -1
  89. package/lib/eject-assets/generators/go/operations.ts +1 -1
  90. package/lib/eject-assets/generators/go/pagination.ts +1 -1
  91. package/lib/eject-assets/generators/go/types.ts +1 -1
  92. package/lib/eject-assets/generators/mock/faker.ts +17 -9
  93. package/lib/eject-assets/generators/mock/index.ts +4 -3
  94. package/lib/eject-assets/generators/mock/render.ts +128 -9
  95. package/lib/eject-assets/generators/mock/sample.ts +87 -4
  96. package/lib/eject-assets/generators/mock/values.ts +1 -1
  97. package/lib/eject-assets/generators/php/client.ts +1 -1
  98. package/lib/eject-assets/generators/php/descriptor.ts +10 -1
  99. package/lib/eject-assets/generators/php/index.ts +2 -2
  100. package/lib/eject-assets/generators/php/models.ts +8 -3
  101. package/lib/eject-assets/generators/php/naming.ts +1 -1
  102. package/lib/eject-assets/generators/php/operations.ts +11 -6
  103. package/lib/eject-assets/generators/php/pagination.ts +3 -2
  104. package/lib/eject-assets/generators/php/types.ts +12 -2
  105. package/lib/eject-assets/generators/python/client.ts +1 -1
  106. package/lib/eject-assets/generators/python/descriptor.ts +1 -1
  107. package/lib/eject-assets/generators/python/index.ts +3 -3
  108. package/lib/eject-assets/generators/python/models.ts +9 -3
  109. package/lib/eject-assets/generators/python/naming.ts +1 -1
  110. package/lib/eject-assets/generators/python/operations.ts +6 -5
  111. package/lib/eject-assets/generators/python/pagination.ts +1 -1
  112. package/lib/eject-assets/generators/python/types.ts +1 -1
  113. package/lib/eject-assets/generators/swr/index.ts +2 -2
  114. package/lib/eject-assets/generators/swr/render.ts +1 -1
  115. package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
  116. package/lib/eject-assets/generators/tanstack-query/render.ts +6 -5
  117. package/lib/eject-assets/generators/transformers/index.ts +2 -2
  118. package/lib/eject-assets/generators/transformers/render.ts +34 -7
  119. package/lib/eject-assets/generators/typescript/banner.ts +1 -1
  120. package/lib/eject-assets/generators/typescript/client.ts +1 -1
  121. package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
  122. package/lib/eject-assets/generators/typescript/index.ts +2 -2
  123. package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
  124. package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
  125. package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
  126. package/lib/eject-assets/generators/typescript/operations.ts +1 -1
  127. package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
  128. package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
  129. package/lib/eject-assets/generators/typescript/types.ts +1 -1
  130. package/lib/eject-assets/generators/zod/index.ts +2 -2
  131. package/lib/eject-assets/generators/zod/schemas.ts +1 -1
  132. package/lib/eject-assets/skills/go-generator/SKILL.md +3 -0
  133. package/lib/eject-assets/skills/mock-generator/SKILL.md +22 -0
  134. package/lib/eject-assets/skills/php-generator/SKILL.md +9 -2
  135. package/lib/eject-assets/skills/python-generator/SKILL.md +6 -0
  136. package/lib/eject-assets/skills/tanstack-query-generator/SKILL.md +2 -1
  137. package/lib/eject-assets/skills/transformers-generator/SKILL.md +4 -0
  138. package/lib/eject-assets/skills/typescript-generator/SKILL.md +5 -0
  139. package/lib/index.js +5 -5
  140. package/lib/skills/redocly-cli/SKILL.md +20 -1
  141. package/package.json +1 -1
  142. package/lib/chunks/2Y7MGFQS.js +0 -105
  143. package/lib/chunks/BPDHBW3N.js +0 -7
  144. package/lib/chunks/EWU57NBY.js +0 -20
  145. package/lib/chunks/GKXY6U4S.js +0 -145
  146. package/lib/chunks/GMGZQR6Q.js +0 -7
  147. package/lib/chunks/JM7BMZLD.js +0 -13
  148. package/lib/chunks/K6VR5YNF.js +0 -22
  149. package/lib/chunks/M6UVHV6D.js +0 -7
  150. package/lib/chunks/O72R3AD4.js +0 -20
  151. package/lib/chunks/RZ3FGCBT.js +0 -20
  152. package/lib/chunks/SBT63VHF.js +0 -7
  153. package/lib/chunks/UW4UC7ZI.js +0 -9
  154. package/lib/chunks/VQRJE4I2.js +0 -7
  155. package/lib/chunks/WACZWFKN.js +0 -19
  156. package/lib/chunks/WJXIZZA6.js +0 -7
@@ -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"./NCDX4IGX.js";import{h as c,m as l}from"./O37B7ABT.js";import"./GKXY6U4S.js";import{fa as i,la as n}from"./WBWCX3LS.js";import"./NEWT5A6S.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}
7
+ import{a as p,b as a}from"./X7C43UBI.js";import{h as c,m as l}from"./AH6ANNYP.js";import"./KFQC57GK.js";import{fa as i,la as n}from"./DORXGE7Z.js";import"./NEWT5A6S.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,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"./QAPQYNI3.js";import"./QMS4UKIK.js";import"./WBWCX3LS.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{a as bundleTelemetry,b as handleBundle};
7
+ import{a,b}from"./54EKLNNI.js";import"./CHX7O5AM.js";import"./DORXGE7Z.js";import"./NEWT5A6S.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{a as s,b as a}from"./VOLUJUI5.js";import{a as p}from"./GKXY6U4S.js";import{e as d}from"./RFWIIJFG.js";var t=d(p(),1);var h=async(i,{timeout:e,...c}={})=>{let o=s(),y=o&&!a(i),n;y?n=new t.ProxyAgent({uri:o}):e&&(n=new t.Agent({connect:{timeout:e}}));try{return await(0,t.fetch)(i,{signal:e?AbortSignal.timeout(e):void 0,...c,dispatcher:n})}catch(r){throw await n?.destroy(),r}};export{h as fetchWithTimeout};
7
+ import{a as s,b as a}from"./VOLUJUI5.js";import{a as p}from"./KFQC57GK.js";import{e as d}from"./RFWIIJFG.js";var t=d(p(),1);var h=async(i,{timeout:e,...c}={})=>{let o=s(),y=o&&!a(i),n;y?n=new t.ProxyAgent({uri:o}):e&&(n=new t.Agent({connect:{timeout:e}}));try{return await(0,t.fetch)(i,{signal:e?AbortSignal.timeout(e):void 0,...c,dispatcher:n})}catch(r){throw await n?.destroy(),r}};export{h as fetchWithTimeout};
@@ -0,0 +1,7 @@
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{c as a,d as b}from"./TZROZMVE.js";import"./DP3T6VZX.js";import"./ACAPGKSR.js";import"./WZXA5XPB.js";import"./DORXGE7Z.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{b as generateClient,a as runGenerators};
@@ -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{h as g}from"./3DMXMP4K.js";import{f as C,m as u,n as p}from"./EFB2YVY2.js";import{c as j,d as v}from"./JCP37EY3.js";import{fa as b}from"./WBWCX3LS.js";import{a as S,b as k}from"./UW4UC7ZI.js";import{join as $}from"node:path";function h(r){return(r??"").replace(/\s+/g," ").trim().replace(/\\/g,"\\\\").replace(/\|/g,"\\|")}function w(r){return[r.group===void 0?void 0:u(r.group),r.name].filter(Boolean).join(" ")}function T(r,e){return[r,w(e),...e.positionals.map(o=>`<${o.name}>`),...e.flags.filter(o=>o.required).map(o=>`--${o.name} <${o.type}>`),...e.body?[e.body.required?"--json '<json>'":"[--json '<json>']"]:[]].filter(o=>o!=="").join(" ")}function B(r,e){r.line("| Flag | Type | Required | Description |"),r.line("| ---- | ---- | -------- | ----------- |");for(let n of e){let o=[h(n.description),n.enum===void 0?"":`One of ${n.enum.map(t=>`\`${t}\``).join(", ")}.`,n.type==="array"?"Repeat the flag for multiple values.":""].filter(t=>t!=="").join(" ");r.line(`| \`--${n.name}\` | ${n.type} | ${n.required?"yes":"no"} | ${o} |`)}r.blank()}function D(r,e,n){if(r.line(`### \`${w(e)}\``),r.blank(),e.summary!==void 0&&(r.line(h(e.summary)),r.blank()),r.line(`\`${e.method} ${e.path}\``),r.blank(),r.line("```sh"),r.line(T(n.name,e)),r.line("```"),r.blank(),e.positionals.length>0){r.line("| Argument | Description |"),r.line("| -------- | ----------- |");for(let t of e.positionals)r.line(`| \`<${t.name}>\` | ${h(t.description)} |`);r.blank()}e.flags.length>0&&B(r,e.flags);let o=[e.body===void 0?"":`Takes a JSON body${e.body.required?" (required)":""}: \`--json '<json>'\`, \`--json @file.json\`, or \`--json @-\` for stdin.`,e.unsupportedBody===void 0?"":`Takes a \`${e.unsupportedBody}\` body, which the CLI cannot build \u2014 call this operation through the generated client instead.`,e.paginated===!0?"Paginated: `--page-all` follows every page, printing one JSON page per line.":"",e.sse===!0?"Streams server-sent events as one JSON object per line.":"",e.blob===!0?"Returns binary content, so `--output <path>` is required.":""].filter(t=>t!=="");for(let t of o)r.line(t);o.length>0&&r.blank()}function R(r,e){let n=new S;e.frontmatter&&(n.line("---"),n.line(`title: ${e.title}`),n.line("---"),n.blank()),n.line(`# ${e.title}`),n.blank(),n.line(`Generated command-line reference for \`${e.name}\`, produced from the API description by \`redocly generate-client\`.`),n.line("Re-run generation to update it \u2014 this file is not hand-edited."),n.blank(),n.line("## Usage"),n.blank(),n.line("```sh"),n.line(`${e.name} <command> [flags]`),n.line(`${e.name} --help`),n.line(`${e.name} schema <command> # request/response schemas`),n.line("```"),n.blank(),n.line("Install the file under any `bin` name: the command takes that name, and the credential variables below do not change."),n.blank(),n.line("## Global flags"),n.blank(),n.line("| Flag | Description |"),n.line("| ---- | ----------- |");let o=e.schemes.some(i=>i.kind==="bearer");for(let[i,s]of[["--server-url <url>","Override the server URL included in the client."],["--format <json\\|ndjson>","Output format."],["--dry-run","Print the prepared request, credentials redacted, without sending it."],["--page-all","Follow pagination, printing one JSON page per line."],["--output <path>","Write the response body to a file. Required for binary responses."],...o?[["--token <token>","Bearer token, overriding the environment."]]:[],["--json <json\\|@file\\|@->","Request body, inline or from a file or stdin."]])n.line(`| \`${i}\` | ${s} |`);n.blank();let t=p(e.name);if(n.line("## Credentials"),n.blank(),e.schemes.length===0)n.line("The description declares no security schemes, so no credentials are read.");else{n.line("Credentials come from the environment:"),n.blank(),n.line("| Scheme | Variable |"),n.line("| ------ | -------- |");for(let i of e.schemes){let s=i.kind==="bearer"?`\`${t}_TOKEN\` (or \`--token\`)`:i.kind==="basic"?`\`${t}_USERNAME\` and \`${t}_PASSWORD\``:`\`${t}_API_KEY_${p(i.key)}\``;n.line(`| ${i.kind} (\`${i.key}\`) | ${s} |`)}}n.blank(),n.line("## Exit codes"),n.blank(),n.line("| Code | Meaning |"),n.line("| ---- | ------- |");for(let[i,s]of[[0,"success"],[1,"API error (status other than 401 or 403)"],[2,"auth error (401 or 403)"],[3,"validation error"],[4,"usage error (unknown command or flag, bad `--json`)"]])n.line(`| ${i} | ${s} |`);n.blank(),n.line("Errors print one JSON object to stderr, so stdout stays clean for piping."),n.blank();let a=[...new Set(r.map(i=>i.group))];for(let i of a){let s=r.filter(l=>l.group===i);i===void 0?(n.line("## Commands"),n.blank()):(n.line(`## ${i}`),n.blank(),n.line(`Addressed as \`${e.name} ${u(i)} <command>\`.`),n.blank());for(let l of s)D(n,l,e)}return n.toString().replace(/\n{3,}/g,`
7
+ import{h as g}from"./IYV7EO2J.js";import{f as C,m as u,n as p}from"./UMN7TKTH.js";import{a as S,b as k,q as j,r as v}from"./ACAPGKSR.js";import{fa as b}from"./DORXGE7Z.js";import{join as $}from"node:path";function h(r){return(r??"").replace(/\s+/g," ").trim().replace(/\\/g,"\\\\").replace(/\|/g,"\\|")}function w(r){return[r.group===void 0?void 0:u(r.group),r.name].filter(Boolean).join(" ")}function T(r,e){return[r,w(e),...e.positionals.map(o=>`<${o.name}>`),...e.flags.filter(o=>o.required).map(o=>`--${o.name} <${o.type}>`),...e.body?[e.body.required?"--json '<json>'":"[--json '<json>']"]:[]].filter(o=>o!=="").join(" ")}function B(r,e){r.line("| Flag | Type | Required | Description |"),r.line("| ---- | ---- | -------- | ----------- |");for(let n of e){let o=[h(n.description),n.enum===void 0?"":`One of ${n.enum.map(t=>`\`${t}\``).join(", ")}.`,n.type==="array"?"Repeat the flag for multiple values.":""].filter(t=>t!=="").join(" ");r.line(`| \`--${n.name}\` | ${n.type} | ${n.required?"yes":"no"} | ${o} |`)}r.blank()}function D(r,e,n){if(r.line(`### \`${w(e)}\``),r.blank(),e.summary!==void 0&&(r.line(h(e.summary)),r.blank()),r.line(`\`${e.method} ${e.path}\``),r.blank(),r.line("```sh"),r.line(T(n.name,e)),r.line("```"),r.blank(),e.positionals.length>0){r.line("| Argument | Description |"),r.line("| -------- | ----------- |");for(let t of e.positionals)r.line(`| \`<${t.name}>\` | ${h(t.description)} |`);r.blank()}e.flags.length>0&&B(r,e.flags);let o=[e.body===void 0?"":`Takes a JSON body${e.body.required?" (required)":""}: \`--json '<json>'\`, \`--json @file.json\`, or \`--json @-\` for stdin.`,e.unsupportedBody===void 0?"":`Takes a \`${e.unsupportedBody}\` body, which the CLI cannot build \u2014 call this operation through the generated client instead.`,e.paginated===!0?"Paginated: `--page-all` follows every page, printing one JSON page per line.":"",e.sse===!0?"Streams server-sent events as one JSON object per line.":"",e.blob===!0?"Returns binary content, so `--output <path>` is required.":""].filter(t=>t!=="");for(let t of o)r.line(t);o.length>0&&r.blank()}function R(r,e){let n=new S;e.frontmatter&&(n.line("---"),n.line(`title: ${e.title}`),n.line("---"),n.blank()),n.line(`# ${e.title}`),n.blank(),n.line(`Generated command-line reference for \`${e.name}\`, produced from the API description by \`redocly generate-client\`.`),n.line("Re-run generation to update it \u2014 this file is not hand-edited."),n.blank(),n.line("## Usage"),n.blank(),n.line("```sh"),n.line(`${e.name} <command> [flags]`),n.line(`${e.name} --help`),n.line(`${e.name} schema <command> # request/response schemas`),n.line("```"),n.blank(),n.line("Install the file under any `bin` name: the command takes that name, and the credential variables below do not change."),n.blank(),n.line("## Global flags"),n.blank(),n.line("| Flag | Description |"),n.line("| ---- | ----------- |");let o=e.schemes.some(i=>i.kind==="bearer");for(let[i,s]of[["--server-url <url>","Override the server URL included in the client."],["--format <json\\|ndjson>","Output format."],["--dry-run","Print the prepared request, credentials redacted, without sending it."],["--page-all","Follow pagination, printing one JSON page per line."],["--output <path>","Write the response body to a file. Required for binary responses."],...o?[["--token <token>","Bearer token, overriding the environment."]]:[],["--json <json\\|@file\\|@->","Request body, inline or from a file or stdin."]])n.line(`| \`${i}\` | ${s} |`);n.blank();let t=p(e.name);if(n.line("## Credentials"),n.blank(),e.schemes.length===0)n.line("The description declares no security schemes, so no credentials are read.");else{n.line("Credentials come from the environment:"),n.blank(),n.line("| Scheme | Variable |"),n.line("| ------ | -------- |");for(let i of e.schemes){let s=i.kind==="bearer"?`\`${t}_TOKEN\` (or \`--token\`)`:i.kind==="basic"?`\`${t}_USERNAME\` and \`${t}_PASSWORD\``:`\`${t}_API_KEY_${p(i.key)}\``;n.line(`| ${i.kind} (\`${i.key}\`) | ${s} |`)}}n.blank(),n.line("## Exit codes"),n.blank(),n.line("| Code | Meaning |"),n.line("| ---- | ------- |");for(let[i,s]of[[0,"success"],[1,"API error (status other than 401 or 403)"],[2,"auth error (401 or 403)"],[3,"validation error"],[4,"usage error (unknown command or flag, bad `--json`)"]])n.line(`| ${i} | ${s} |`);n.blank(),n.line("Errors print one JSON object to stderr, so stdout stays clean for piping."),n.blank();let a=[...new Set(r.map(i=>i.group))];for(let i of a){let s=r.filter(l=>l.group===i);i===void 0?(n.line("## Commands"),n.blank()):(n.line(`## ${i}`),n.blank(),n.line(`Addressed as \`${e.name} ${u(i)} <command>\`.`),n.blank());for(let l of s)D(n,l,e)}return n.toString().replace(/\n{3,}/g,`
8
8
 
9
9
  `).trimEnd()+`
10
10
  `}function x(){return v["cli.ts"]}function E(){return j["cli.ts"]}var q="// Generated by @redocly/client-generator \u2014 do not edit by hand.\n// Source: OpenAPI description. Re-run `redocly generate-client` to update.";function P(r){return k.snake(r).replace(/_/g,"-")}function O(r){let e=r.schema,n=e.kind==="array"?"array":e.kind==="scalar"&&(e.scalar==="integer"||e.scalar==="number")?"number":e.kind==="scalar"&&e.scalar==="boolean"?"boolean":"string";return{name:P(r.name),param:r.name,type:n,required:r.required,...e.kind==="enum"?{enum:e.values.map(String)}:{},...r.description!==void 0?{description:r.description}:{}}}function F(r){let e=r.successResponses;return e.some(n=>n.contentType.toLowerCase().includes("json"))?!1:e.some(n=>C(n.contentType))}function M(r){return r.successResponses.find(e=>e.contentType.toLowerCase().includes("json"))?.schema}function U(r,e,n){if(n!=="flat")return{};let o=g(r,e.schemas);return"mergeBody"in o&&o.mergeBody?{merged:!0}:{}}function _(r,e,n){return n!=="flat"?{}:"collisions"in g(r,e.schemas)?{argsStyle:"grouped"}:{}}function f(r,e){let n=[];for(let o of r.services)for(let t of o.operations){let a=t.requestBody?.contentType.toLowerCase().includes("json")?t.requestBody:void 0,i=M(t);n.push({...t.tags.length>0?{group:t.tags[0]}:{},name:t.name,...t.summary!==void 0?{summary:t.summary}:{},method:t.method.toUpperCase(),path:t.path,positionals:t.pathParams.map(s=>({name:s.name,type:O(s).type,...s.description!==void 0?{description:s.description}:{}})),flags:t.queryParams.map(O),...a?{body:{required:a.required,...U(t,r,e.argsStyle)}}:{},...a===void 0&&t.requestBody!==void 0?{unsupportedBody:t.requestBody.contentType}:{},...e.pagination?.has(t.name)===!0?{paginated:!0}:{},..._(t,r,e.argsStyle),...t.sse!==void 0?{sse:!0}:{},...F(t)?{blob:!0}:{},...a!==void 0||i!==void 0?{schemas:{...a?{request:a.schema}:{},...i!==void 0?{response:i}:{}}}:{}})}return n}var A=`function isProcessEntry(): boolean {
@@ -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"./QMS4UKIK.js";import{S as le,T as he,W as b,Y as fe,Z as de,_ as j,aa as ye,ba as U,c as L,ca as A,f as ie,fa as k,ga as Se,ha as ge,ia as Q,ja as K,la as Ce,oa as be,p as ae,q as pe,r as ce,u as me,v as ue}from"./WBWCX3LS.js";import"./NEWT5A6S.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"./CHX7O5AM.js";import{S as le,T as he,W as b,Y as fe,Z as de,_ as j,aa as ye,ba as U,c as L,ca as A,f as ie,fa as k,ga as Se,ha as ge,ia as Q,ja as K,la as Ce,oa as be,p as ae,q as pe,r as ce,u as me,v as ue}from"./DORXGE7Z.js";import"./NEWT5A6S.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{b as D}from"./QMS4UKIK.js";import{S as C,T as j,fa as $,ha as k,ia as M,ja as S,la as b,p as F,t as R,v as x}from"./WBWCX3LS.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{relative as I,resolve as U}from"node:path";var A=20;async function B({argv:o,config:t,collectSpecData:r}){let[{path:s}]=await D([o.api],t),n=new C(t.resolve),e=await n.resolveDocument(null,s,!0);r?.(e);let i=k(e.parsed),d=F(t.extendTypes(x(i),i),t),p=new Map,u=({source:l,pointer:c},f,N)=>{let v=`${l.absoluteRef}${c}`,y=p.get(v);if(!y){p.set(v,{absoluteRef:l.absoluteRef,pointer:c,types:[f],resolvesTo:N});return}y.types.includes(f)||y.types.push(f),y.resolvesTo||(y.resolvesTo=N)},m={any:{enter(l,{location:c,type:f}){u(c,f.name)}},ref(l,{location:c,type:f},N){u(c,f.name,N.location)}},h={problems:[],specVersion:i,config:t,visitorsData:{}},a=await j({rootDocument:e,rootType:d.Root,externalRefResolver:n});if(S({document:e,rootType:d.Root,normalizedVisitors:M([{severity:"warn",ruleId:"inspect-node-types",visitor:m}],d),resolvedRefMap:a,ctx:h}),o.pointer){let l=W(p,o.pointer,e.source.absoluteRef);o.parents?L(w(p,l,e.source.absoluteRef)):$.output(`${l.types.join(`
7
+ import{b as D}from"./CHX7O5AM.js";import{S as C,T as j,fa as $,ha as k,ia as M,ja as S,la as b,p as F,t as R,v as x}from"./DORXGE7Z.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{relative as I,resolve as U}from"node:path";var A=20;async function B({argv:o,config:t,collectSpecData:r}){let[{path:s}]=await D([o.api],t),n=new C(t.resolve),e=await n.resolveDocument(null,s,!0);r?.(e);let i=k(e.parsed),d=F(t.extendTypes(x(i),i),t),p=new Map,u=({source:l,pointer:c},f,N)=>{let v=`${l.absoluteRef}${c}`,y=p.get(v);if(!y){p.set(v,{absoluteRef:l.absoluteRef,pointer:c,types:[f],resolvesTo:N});return}y.types.includes(f)||y.types.push(f),y.resolvesTo||(y.resolvesTo=N)},m={any:{enter(l,{location:c,type:f}){u(c,f.name)}},ref(l,{location:c,type:f},N){u(c,f.name,N.location)}},h={problems:[],specVersion:i,config:t,visitorsData:{}},a=await j({rootDocument:e,rootType:d.Root,externalRefResolver:n});if(S({document:e,rootType:d.Root,normalizedVisitors:M([{severity:"warn",ruleId:"inspect-node-types",visitor:m}],d),resolvedRefMap:a,ctx:h}),o.pointer){let l=W(p,o.pointer,e.source.absoluteRef);o.parents?L(w(p,l,e.source.absoluteRef)):$.output(`${l.types.join(`
8
8
  `)}
9
9
  `);return}let g=[...p.values()];if(o.summary)V(g);else if(o.type){let l=o.type,c=g.filter(({types:f})=>f.includes(l));if(c.length===0)throw new b(`No nodes of type '${l}'. Run the command with --summary to see the types used in this description.`);o.parents?L(c.flatMap(f=>w(p,f,e.source.absoluteRef)),l):E(c)}else E(g)}function w(o,t,r,s=new Set){let n=`${t.absoluteRef}${t.pointer}`;if(s.has(n))return[[t]];s.add(n);let e=[],i=t.pointer.split("/");for(let p=1;p<i.length;p++){let u=p===1?"#/":i.slice(0,p).join("/");if(u===t.pointer)continue;let m=o.get(`${t.absoluteRef}${u}`);m&&e.push(m)}e.push(t);let d=[];e[0].absoluteRef===r&&e[0].pointer==="#/"&&d.push(e);for(let[p,u]of e.entries()){let m=[...o.values()].filter(a=>a.resolvesTo?.source.absoluteRef===u.absoluteRef&&a.resolvesTo.pointer===u.pointer),h=e.slice(p+1);for(let a of m)d.push(...w(o,a,r,s).map(g=>[...g,...h]))}return d.length?d:[e]}function L(o,t){let r=new Set(o.map(s=>s.map(({types:n})=>t&&n.includes(t)?t:n.join(", ")).join(" \u2192 ")));for(let s of r)$.output(`${s}
10
10
  `)}function W(o,t,r){let[s,n]=t.split("#"),e=s?R(s)?s:U(process.cwd(),s):r,i=o.get(`${e}#${n||"/"}`);if(!i)throw new b(`No node at ${t}. ${z(o,e,`#${n||"/"}`,s)??`Check the pointer, and make sure the file is referenced from ${T(r)}.`}`);return i}function z(o,t,r,s){let n=r.split("/");for(let e=n.length-1;e>=1;e--){let i=e===1?"#/":n.slice(0,e).join("/"),d=o.get(`${t}${i}`);if(!d)continue;let p=n[e].toLowerCase(),u=e===1?"#/":`${i}/`,m=[...o.values()].filter(c=>c.absoluteRef===t&&c.pointer.startsWith(u)&&!c.pointer.slice(u.length).includes("/")),h=m.filter(c=>c.pointer.slice(u.length).toLowerCase().includes(p)),a=(h.length?h:m).map(c=>` ${s}${c.pointer}`),g=a.length-A;g>0&&(a.length=A,a.push(` \u2026and ${g} more`));let l=`The closest node is ${d.types.join(", ")} at ${s}${i}.`;return a.length?`${l} Did you mean:
@@ -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,b as t,c as e}from"./HBUZKWXC.js";import{fa as r}from"./WBWCX3LS.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{spawn as p}from"node:child_process";var u=async({argv:n})=>{r.info(`
7
+ import{a as o,b as t,c as e}from"./HBUZKWXC.js";import{fa as r}from"./DORXGE7Z.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{spawn as p}from"node:child_process";var u=async({argv:n})=>{r.info(`
8
8
  Launching translate using NPX.
9
9
 
10
10
  `);let{npxExecutableName:s,sanitize:a,shell:i}=e(),l=a(n["project-dir"],o),c=a(n.locale,t);p(s,["-y","@redocly/realm","translate",c,`-d=${l}`],{stdio:"inherit",shell:i}).on("error",m=>{throw r.info(`Translate launch failed: ${m.message}`),new Error("Translate launch failed.")})};export{u as handleTranslations};
@@ -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 A}from"./LS3G7CUH.js";import{a as F,b as O,c as k,d as g}from"./2R2CXBRH.js";import{c as d,d as M}from"./LRMOPAZ4.js";import{W as y,Y as C,Z as R,_ as $,ba as S,fa as s,la as l,ma as b}from"./WBWCX3LS.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{mkdir as z,writeFile as J}from"node:fs/promises";import V from"node:path";var E=20;function D(e){return e.total===0?void 0:Math.floor(e.covered/e.total*100)}function H(e){return e===void 0?"n/a":`${e}%`}function B(e,o){let t=e===void 0?0:Math.floor(e/100*E),r=`${"\u2588".repeat(t)}${"\u2591".repeat(E-t)}`;return!o||e===void 0?r:e>=80?R(r):e>=50?$(r):C(r)}function I(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(([,i])=>`${i.covered}/${i.total}`.length)),n="API coverage",a=[o?y(S(n)):n];for(let[i,c]of t){let f=D(c);a.push(` ${i.padEnd(18)} ${B(f,o)} ${H(f).padStart(5)} ${`${c.covered}/${c.total}`.padStart(r+3)}`)}return`${a.join(`
7
+ import{a as A}from"./EBHQXW6Z.js";import{a as F,b as O,c as k,d as g}from"./HWOL3HHR.js";import{c as d,d as M}from"./GAKWND4S.js";import{W as y,Y as C,Z as R,_ as $,ba as S,fa as s,la as l,ma as b}from"./DORXGE7Z.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{mkdir as z,writeFile as J}from"node:fs/promises";import V from"node:path";var E=20;function D(e){return e.total===0?void 0:Math.floor(e.covered/e.total*100)}function H(e){return e===void 0?"n/a":`${e}%`}function B(e,o){let t=e===void 0?0:Math.floor(e/100*E),r=`${"\u2588".repeat(t)}${"\u2591".repeat(E-t)}`;return!o||e===void 0?r:e>=80?R(r):e>=50?$(r):C(r)}function I(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(([,i])=>`${i.covered}/${i.total}`.length)),n="API coverage",a=[o?y(S(n)):n];for(let[i,c]of t){let f=D(c);a.push(` ${i.padEnd(18)} ${B(f,o)} ${H(f).padStart(5)} ${`${c.covered}/${c.total}`.padStart(r+3)}`)}return`${a.join(`
8
8
  `)}
9
9
  `}function T(e,o){let t={version:1,meta:{...o,exchanges:e.exchanges},totals:e.totals,operations:e.operations};return`${JSON.stringify(t,null,2)}
10
10
  `}async function P(e){let o=await M(e.trafficPath);if(o.length===0)throw new Error("No traffic files found in the provided traffic path.");let t=O.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 i=await A(a,e.format);if(!i){s.warn(`Skipping traffic file with unrecognized format: ${a}
@@ -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"./WBWCX3LS.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};
7
+ import{c as r}from"./DORXGE7Z.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,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 F}from"./RLJVKAOL.js";import{a as b,d as A,e as E,g as O,t as B,u as h}from"./O37B7ABT.js";import{f as I}from"./QMS4UKIK.js";import{Y as v,Z as j,_ as u,aa as c,ba as d,fa as a,l,la as m}from"./WBWCX3LS.js";var y=class extends Error{};async function Z({argv:t,version:e}){let n=performance.now(),o=new F,{organization:s,project:p,pushId:w,wait:g}=t,U=t.domain||O(),S=t["continue-on-deploy-failures"]||!1,M=t["start-time"]||Date.now(),R=[],f={organization:s,project:p};try{let $=E(),P={domain:U,apiKey:$,...f,pushId:w,version:e,onSunsetWarning:i=>R.push(i),onSlugDeprecated:i=>{K(i),f={organization:i.organizationId,project:i.projectId}}},D={...P,maxExecutionTime:t["max-execution-time"],retryIntervalMs:t["retry-interval"]?t["retry-interval"]*1e3:void 0,startTime:M},x=i=>T=>{let{status:C,url:N}=T.status[i].deploy;o.start(L({status:C,url:N,buildType:i,wait:g}))},r=g?await h({...D,buildType:"preview",onRetry:x("preview")}):await B(P);return W({buildType:"preview",spinner:o,push:r,continueOnDeployFailures:S}),z(r.status.preview.scorecard),g&&r.isMainBranch&&r.status.preview.deploy.status==="success"&&(r=await h({...D,...f,buildType:"production",onRetry:x("production")})),r.isMainBranch&&(W({buildType:"production",spinner:o,push:r,continueOnDeployFailures:S}),z(r.status.production.scorecard)),V({organization:s,project:p,pushId:w,startedAt:n}),{preview:r.status.preview,production:r.isMainBranch?r.status.production:null,commit:r.commit}}catch($){o.stop(),k("\u2717 Failed to get push status.",$)}finally{o.stop(),H("push-status",R)}}function k(t,e){throw e instanceof y?new m(e.message):e instanceof b?new m(`${t} Reason: ${e.message} (status: ${e.status})
7
+ import{a as F}from"./NLAPR7D4.js";import{a as b,d as A,e as E,g as O,t as B,u as h}from"./AH6ANNYP.js";import{f as I}from"./CHX7O5AM.js";import{Y as v,Z as j,_ as u,aa as c,ba as d,fa as a,l,la as m}from"./DORXGE7Z.js";var y=class extends Error{};async function Z({argv:t,version:e}){let n=performance.now(),o=new F,{organization:s,project:p,pushId:w,wait:g}=t,U=t.domain||O(),S=t["continue-on-deploy-failures"]||!1,M=t["start-time"]||Date.now(),R=[],f={organization:s,project:p};try{let $=E(),P={domain:U,apiKey:$,...f,pushId:w,version:e,onSunsetWarning:i=>R.push(i),onSlugDeprecated:i=>{K(i),f={organization:i.organizationId,project:i.projectId}}},D={...P,maxExecutionTime:t["max-execution-time"],retryIntervalMs:t["retry-interval"]?t["retry-interval"]*1e3:void 0,startTime:M},x=i=>T=>{let{status:C,url:N}=T.status[i].deploy;o.start(L({status:C,url:N,buildType:i,wait:g}))},r=g?await h({...D,buildType:"preview",onRetry:x("preview")}):await B(P);return W({buildType:"preview",spinner:o,push:r,continueOnDeployFailures:S}),z(r.status.preview.scorecard),g&&r.isMainBranch&&r.status.preview.deploy.status==="success"&&(r=await h({...D,...f,buildType:"production",onRetry:x("production")})),r.isMainBranch&&(W({buildType:"production",spinner:o,push:r,continueOnDeployFailures:S}),z(r.status.production.scorecard)),V({organization:s,project:p,pushId:w,startedAt:n}),{preview:r.status.preview,production:r.isMainBranch?r.status.production:null,commit:r.commit}}catch($){o.stop(),k("\u2717 Failed to get push status.",$)}finally{o.stop(),H("push-status",R)}}function k(t,e){throw e instanceof y?new m(e.message):e instanceof b?new m(`${t} Reason: ${e.message} (status: ${e.status})
8
8
  `):new m(`${t} Reason: ${e.message}
9
9
  `)}function K({organizationId:t,projectId:e}){a.warn(`Organization and project slugs are deprecated. Use the ids instead: --organization ${t} --project ${e}
10
10
  `)}function H(t,e){let n=A(e);if(!n)return;let o='Update to the latest version by running "npm install @redocly/cli@latest".';n.isSunsetExpired?a.error(`The "${t}" command is not compatible with your version of Redocly CLI. ${o}
@@ -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"./2R2CXBRH.js";import{c as m,k as C,r as $}from"./LRMOPAZ4.js";import{a as q}from"./GKXY6U4S.js";import{c as H,fa as u,la as y,ma as R}from"./WBWCX3LS.js";import"./NEWT5A6S.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)}
7
+ import{a as T,b as O,c as A,d as E}from"./HWOL3HHR.js";import{c as m,k as C,r as $}from"./GAKWND4S.js";import{a as q}from"./KFQC57GK.js";import{c as H,fa as u,la as y,ma as R}from"./DORXGE7Z.js";import"./NEWT5A6S.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,7 @@
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,b,c,d,e}from"./DVLD4FET.js";import"./BE4Z5FOC.js";import"./UMN7TKTH.js";import"./ACAPGKSR.js";import"./WZXA5XPB.js";import"./DORXGE7Z.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{e as goDocs,c as goGenerator,d as goSample,a as goType,b as renderGoModels};
@@ -0,0 +1,20 @@
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{b as M,c as D,k as U}from"./DP3T6VZX.js";import{o as te,p as ne,t as re,u as R,v as oe}from"./ACAPGKSR.js";import{a as y}from"./WZXA5XPB.js";import{M as V,S as Q,c as x,fa as b,ha as Y,oa as Z,q as v,qa as G,r as J,t as W,xa as ee}from"./DORXGE7Z.js";import{mkdir as ct,readFile as ut,writeFile as pt}from"node:fs/promises";import{dirname as ve,parse as ft,resolve as E,sep as dt}from"node:path";function I(e){return{requires:["typescript"],errorModes:["throw"],load:()=>import("./G6SB4ZP5.js").then(t=>({run:t.tanstackQueryGenerator(e)}))}}var C={outputMode:"it always emits one self-contained file",runtime:"the runtime is always embedded in the generated file",argsStyle:"inputs follow the target language's own idiom",importExt:"the generated file has no relative imports"},T={typescript:{load:()=>import("./B5SUTVG4.js").then(e=>({run:e.typescriptGenerator,sample:e.typescriptSample,docs:e.typescriptDocs}))},zod:{load:()=>import("./BPSWCUZE.js").then(e=>({run:e.zodGenerator}))},transformers:{requires:["typescript"],dateTypes:["Date"],load:()=>import("./EO65RJ4Z.js").then(e=>({run:e.transformersGenerator}))},"tanstack-query":I("react"),"tanstack-query-vue":I("vue"),"tanstack-query-svelte":I("svelte"),"tanstack-query-solid":I("solid"),swr:{requires:["typescript"],errorModes:["throw"],load:()=>import("./U7KIB7CD.js").then(e=>({run:e.swrGenerator}))},mock:{requires:["typescript"],load:()=>import("./BOWZV5S6.js").then(e=>({run:e.mockGenerator}))},cli:{requires:["typescript","zod"],errorModes:["throw"],load:()=>import("./4DUOPCYP.js").then(e=>({run:e.cliGenerator,sample:e.cliSample,docs:e.cliDocs}))},python:{notApplicable:C,load:()=>import("./KJIUDCYZ.js").then(e=>({run:e.pythonGenerator,sample:e.pythonSample,docs:e.pythonDocs,options:e.pythonOptions}))},go:{errorModes:["throw"],notApplicable:C,load:()=>import("./TNRIBQHV.js").then(e=>({run:e.goGenerator,sample:e.goSample,docs:e.goDocs}))},php:{errorModes:["throw"],notApplicable:C,load:()=>import("./MH5X2EVH.js").then(e=>({run:e.phpGenerator,sample:e.phpSample,docs:e.phpDocs}))}};function se(e,t,n,r){let o=new Set(e);t.goPackage!==void 0&&!o.has("go")&&b.warn(`generate-client: goPackage is ignored \u2014 it declares the Go package clause, and no selected generator uses it (add --generator go).
8
+ `),t.telemetry==="on"&&!o.has("typescript")&&b.warn(`generate-client: telemetry is ignored \u2014 the typescript generator writes the telemetry module, and it is not selected (add --generator typescript).
9
+ `);let s=t.errorMode??"throw",a=t.dateType??"string";for(let i of e){let c=n.get(i);if(!c)throw new y(`Unknown generator: ${i}`);for(let p of c.requires??[])if(!o.has(p)){let f=[...new Set([p,...e])].map(m=>`--generator ${m}`).join(" ");throw new y(`The "${i}" generator requires the "${p}" generator. Add it, e.g. ${f}.`)}if(c.errorModes&&!c.errorModes.includes(s))throw new y(`The "${i}" generator does not support --error-mode "${s}" (supported: ${c.errorModes.join(", ")}).`);if(c.dateTypes&&!c.dateTypes.includes(a))throw new y(`The "${i}" generator requires --date-type ${c.dateTypes.join(" or ")} (got "${a}") so the runtime values match the generated types.`);let u={...t,outputMode:r};for(let[p,f]of Object.entries(c.notApplicable??{}))u[p]!==void 0&&b.warn(`generate-client: the "${i}" generator ignores ${p} \u2014 ${f}.
10
+ `)}}function ie(e,t,n){let r=new Map;for(let o of e){let s=t.get(o)?.options,a=n?.[o];if(s===void 0){a!==void 0&&b.warn(`generate-client: the "${o}" generator declares no options, so client.options.${o} is ignored.
11
+ `),r.set(o,{});continue}r.set(o,Se(o,s,a))}return r}function Se(e,t,n){if(n!==void 0&&!x(n))throw new y(`The "${e}" generator's options must be a map of option names to values.`);let r=n??{},o=Object.keys(t.properties);if(t.additionalProperties!==!0){for(let a of Object.keys(r))if(!o.includes(a))throw new y(`The "${e}" generator got an unknown option "${a}". Declared options: ${o.join(", ")||"(none)"}.`)}for(let a of t.required??[])if(r[a]===void 0)throw new y(`The "${e}" generator requires the "${a}" option.`);let s={...r};for(let[a,i]of Object.entries(t.properties)){if(s[a]===void 0){i.default!==void 0&&(s[a]=i.default);continue}let c=Oe(i,s[a]);if(c!==void 0)throw new y(`The "${e}" generator's "${a}" ${c}.`)}return s}function Oe(e,t){if("enum"in e)return e.enum.includes(t)?void 0:`must be one of: ${e.enum.join(", ")}`;if(e.type==="array"){let n=e.items.type;return Array.isArray(t)&&t.every(r=>typeof r===n)?void 0:`must be an array of ${n}`}return typeof t===e.type?void 0:`must be a ${e.type}`}import{isAbsolute as qe,resolve as Pe}from"node:path";import{pathToFileURL as je}from"node:url";var xe=function(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,o,s,a){return r?t?".jsx":".js":o&&(!s||!a)?n:o+s+"."+a.toLowerCase()+"js"}):e};async function ce(e,t={}){let n=new Map;for(let i of t.customGenerators??[])ue(n,i);let r=[];for(let i of e)r.push(await ae(i,n,t.configDir));let o=[],s=new Set,a=async i=>{if(!(o.includes(i)||s.has(i))){s.add(i);for(let c of n.get(i).requires??[])(n.has(c)||c in T)&&await a(await ae(c,n,t.configDir));s.delete(i),o.push(i)}};for(let i of r)await a(i);return{selected:o,registry:n}}async function ae(e,t,n){if(t.has(e))return e;let r=T[e];if(r!==void 0){let{load:s,...a}=r;return t.set(e,{...a,...await s()}),e}if(e==="sdk")throw new y('The "sdk" generator is now named "typescript". Update the `generators` list or the --generator flag.');let o=await Ae(e,n??process.cwd());return ue(t,o),o.name}function ue(e,t){if(!x(t)||typeof t.name!="string"||t.name===""||typeof t.run!="function")throw new y("Invalid custom generator: expected an object with a non-empty string `name` and a `run` function (build one with `defineGenerator`).");if(e.has(t.name))throw new y(`Generator name "${t.name}" collides with an existing generator. Rename the custom generator.`);if(t.requiresGenerator!==void 0){let n=oe(R,t.requiresGenerator);if(n===void 0)throw new y(`Generator "${t.name}" declares requiresGenerator "${t.requiresGenerator}", which is not a range we read. Use ^1.2.0, ~1.2.0, >=1.2.0, or an exact version.`);if(!n)throw new y(`Generator "${t.name}" needs @redocly/client-generator ${t.requiresGenerator}; this CLI ships ${R}. Upgrade @redocly/cli if the generator is newer, or update the generator \u2014 \`redocly eject-generator <name> --update\` for an ejected file, or upgrade its package.`)}t.name in T&&b.warn(`generate-client: custom generator "${t.name}" takes over the built-in generator of the same name.
12
+ `),e.set(t.name,{run:t.run,sample:t.sample,docs:t.docs,notApplicable:t.notApplicable,options:t.options,requires:t.requires,errorModes:t.errorModes,dateTypes:t.dateTypes})}async function Ae(e,t){if(W(e))throw new y(`Remote generator modules are not supported \u2014 use a local path or a package name. Got: ${e}`);let n=e.startsWith(".")||qe(e),r=n?je(Pe(t,e)).href:e;if(n&&e.endsWith(".ts")&&!process.features.typescript)throw new y(`Generator "${e}" is TypeScript, which this Node cannot run directly \u2014 use Node 22.18, 23.6, or newer.`);let o;try{o=await import(xe(r))}catch(a){throw new y(`Could not load generator "${e}": ${a.message}`)}let s=o.default??o.generator;if(s===void 0)throw new y(`Generator module "${e}" must export a generator (a default export or a \`generator\` export built with \`defineGenerator\`).`);return s}function de(e){let t=new Set,n=new Set,r=new Map;for(let l of e.securitySchemes){let h=B(l.key,t,n);h!==l.key&&(r.set(l.key,h),z("security scheme",l.key,h,fe(l.key,t)),l.key=h)}let o=new Set(re()),s=new Set(o),a=new Set,i=new Map;for(let l of e.schemas){let h=B(l.name,s,a);h!==l.name&&(i.set(l.name,h),z("schema",l.name,h,fe(l.name,o)),l.name=h)}let c=l=>i.get(l)??pe(l),u=l=>r.get(l)??pe(l);for(let l of e.schemas)$(l.schema,c);let p=new Set(s),f=new Set,m=new Set;for(let l of e.services)for(let h of l.operations){let d=m.has(h.name);m.add(h.name);let g=h.name,P=B(h.name,p,f);if(P!==h.name){let j=d?{kind:"duplicate-operation-id"}:o.has(g)?{kind:"reserved"}:s.has(g)?{kind:"schema-collision"}:{kind:"unusable"};z("operation",g,P,j),h.specName=h.name,h.name=P}Ne(h,c),h.security=h.security.map(j=>j.map(u))}}function B(e,t,n){let r=D(e),o=r,s=2;for(;t.has(o)||n.has(U(o));)o=`${r}_${s++}`;return t.add(o),n.add(U(o)),o}function le(e){for(let t of e.schemas)if(!M(t.name))throw L("schema",t.name);for(let t of e.securitySchemes)if(!M(t.key))throw L("security scheme",t.key);for(let t of e.services)for(let n of t.operations)if(!M(n.name))throw L("operation",n.name)}function L(e,t){return new Error(`Internal error: ${e} name ${JSON.stringify(t)} is not a safe identifier after sanitization.`)}function pe(e){return D(e)}function z(e,t,n,r){let o=JSON.stringify(t),s=JSON.stringify(n),a=r.kind==="duplicate-operation-id"?`two operations share the operationId ${o}; the second is emitted as ${s} \u2014 give each operation a unique operationId to control its method name`:r.kind==="schema-collision"?`${e} ${o} collides with the schema of the same name, so it is emitted as ${s} \u2014 rename the operation or the schema in the description to control its name`:r.kind==="reserved"?`${e} ${o} is a name a generated client already declares, so it is emitted as ${s} \u2014 the reserved set spans every target language, so one schema keeps one name across the SDKs you generate`:`${e} ${o} is not a usable identifier, so it is emitted as ${s}`;b.warn(`generate-client: ${a}.
13
+ `)}function fe(e,t){return t.has(e)?{kind:"reserved"}:{kind:"unusable"}}function $(e,t){switch(e.kind){case"ref":e.name=t(e.name);break;case"omit":e.base=t(e.base);break;case"array":$(e.items,t);break;case"record":$(e.value,t);break;case"object":for(let n of e.properties)$(n.schema,t);break;case"union":for(let n of e.members)$(n,t);if(e.discriminator)for(let n of e.discriminator.mapping)n.schemaName=t(n.schemaName);break;case"intersection":for(let n of e.members)$(n,t);break}}function Ne(e,t){for(let n of e.pathParams)$(n.schema,t);for(let n of e.queryParams)$(n.schema,t);for(let n of e.headerParams)$(n.schema,t);for(let n of e.cookieParams)$(n.schema,t);e.requestBody&&$(e.requestBody.schema,t);for(let n of[...e.successResponses,...e.errorResponses])$(n.schema,t),n.itemSchema&&$(n.itemSchema,t)}var Me=["get","post","put","delete","patch","head","options"];function he(e,t){if(!t.startsWith("#/"))throw new y(`External $ref not supported: ${t}`);let n=t.slice(2).split("/").map(o=>o.replace(/~1/g,"/").replace(/~0/g,"~")),r=e;for(let o of n){if(!x(r)&&!Array.isArray(r))throw new y(`Cannot resolve $ref: ${t}`);r=r[o]}if(r===void 0)throw new y(`Cannot resolve $ref: ${t}`);return r}function S(e,t){return v(t)?he(e,t.$ref):t}function N(e){let t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function Ie(e){let t=e,n={};return typeof t.minimum=="number"&&(n.minimum=t.minimum),typeof t.maximum=="number"&&(n.maximum=t.maximum),typeof t.exclusiveMinimum=="number"?n.exclusiveMinimum=t.exclusiveMinimum:t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(n.exclusiveMinimum=t.minimum,delete n.minimum),typeof t.exclusiveMaximum=="number"?n.exclusiveMaximum=t.exclusiveMaximum:t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(n.exclusiveMaximum=t.maximum,delete n.maximum),typeof t.multipleOf=="number"&&(n.multipleOf=t.multipleOf),typeof t.minLength=="number"&&(n.minLength=t.minLength),typeof t.maxLength=="number"&&(n.maxLength=t.maxLength),typeof t.pattern=="string"&&(n.pattern=t.pattern),typeof t.minItems=="number"&&(n.minItems=t.minItems),typeof t.maxItems=="number"&&(n.maxItems=t.maxItems),t.uniqueItems===!0&&(n.uniqueItems=!0),typeof t.format=="string"&&(n.format=t.format),t.deprecated===!0&&(n.deprecated=!0),t.example!==void 0?n.example=t.example:Array.isArray(t.examples)&&t.examples.length>0&&(n.example=t.examples[0]),t.default!==void 0&&(n.default=t.default),Object.keys(n).length>0?n:void 0}function Te(e,t){let n=e.discriminator;if(!n||typeof n.propertyName!="string")return;let r=[];if(n.mapping)for(let[o,s]of Object.entries(n.mapping))r.push({value:o,schemaName:N(s)});else for(let o of t)if(v(o)){let s=N(o.$ref);r.push({value:s,schemaName:s})}if(r.length!==0)return{propertyName:n.propertyName,mapping:r}}function k(e,t){return t?{...e,metadata:t}:e}function K(e,t){return e?t?{...e,...t}:e:t}function Ee(e){return e?e.url.replace(/\{([^{}]+)\}/g,(t,n)=>e.variables?.[n]?.default??t):""}function ye(e){let t=e.info?.title??"Api",n=e.info?.version??"0.0.0",r=e.info?.description,o=Ee(e.servers?.[0]),s=(e.servers??[]).map(p=>({url:p.url,description:p.description,variables:Object.entries(p.variables??{}).map(([f,m])=>({name:f,default:m.default,description:m.description}))})),a=Be(e),i=Ue(e),c=Le(e,i),u={title:t,version:n,description:r,serverUrl:o,servers:s,services:c,schemas:a,securitySchemes:i};return de(u),Ge(c,a),le(u),u}function Ge(e,t){let n=new Map(t.map(r=>[r.name,r.schema]));for(let r of e)for(let o of r.operations){o.requestBody&&(o.requestBody.schema=A(o.requestBody.schema,"readOnly",n));for(let s of o.successResponses)s.schema=A(s.schema,"writeOnly",n)}}function Re(e){let t=e.filter(n=>n.kind!=="unknown");return t.length>0?t:[{kind:"unknown"}]}function A(e,t,n){if(e.kind==="ref"){let r=De(e,t,n,new Set);return r.length>0?{kind:"omit",base:e.name,keys:r}:e}if(e.kind==="array")return{...e,items:A(e.items,t,n)};if(e.kind==="record")return{...e,value:A(e.value,t,n)};if(e.kind==="object"){let r=e.properties.filter(o=>!o[t]).map(o=>({...o,schema:A(o.schema,t,n)}));return{...e,properties:r}}return e}function De(e,t,n,r){let o=[],s=a=>{if(a.kind==="ref"){if(r.has(a.name))return;r.add(a.name);let i=n.get(a.name);i&&s(i)}else if(a.kind==="object")for(let i of a.properties)i[t]&&!o.includes(i.name)&&o.push(i.name);else if(a.kind==="intersection")for(let i of a.members)s(i)};return s(e),o}function Ue(e){let t=e.components?.securitySchemes;if(!t)return[];let n=[];for(let[r,o]of Object.entries(t)){let s=S(e,o),a=s.type;a==="oauth2"||a==="openIdConnect"?n.push({kind:"bearer",key:r}):a==="http"&&(s.scheme??"").toLowerCase()==="bearer"?n.push({kind:"bearer",key:r}):a==="http"&&(s.scheme??"").toLowerCase()==="basic"?n.push({kind:"basic",key:r}):a==="apiKey"&&s.in==="header"&&typeof s.name=="string"?n.push({kind:"apiKeyHeader",key:r,headerName:s.name}):a==="apiKey"&&s.in==="query"&&typeof s.name=="string"?n.push({kind:"apiKeyQuery",key:r,paramName:s.name}):a==="apiKey"&&s.in==="cookie"&&typeof s.name=="string"&&(b.warn(`generate-client: security scheme "${r}" sends its credential in the Cookie header, which browsers ignore \u2014 cookie auth works only in server-side clients.
14
+ `),n.push({kind:"apiKeyCookie",key:r,cookieName:s.name}))}return n}function Ce(e,t,n){let r=e.security??t.security;if(!r)return[];let o=[];for(let s of r){let a=Object.keys(s);a.length!==0&&a.every(i=>n.has(i))&&o.push([...new Set(a)])}return o}function Be(e){let t=e.components?.schemas;return t?Object.entries(t).map(([n,r])=>{if(v(r)){let s=he(e,r.$ref);return{name:n,schema:q(s,`components.schemas.${n}`,e),description:s.description}}let o=q(r,`components.schemas.${n}`,e);return{name:n,schema:o,description:r.description}}):[]}function Le(e,t){let n=new Set(t.map(a=>a.key)),r=[],o=new Set;for(let[a,i]of Object.entries(e.paths??{})){if(!i)continue;let c=S(e,i),u=(c.parameters??[]).map(p=>ge(S(e,p),`paths.${a}.parameters`,e));for(let p of Me){let f=c[p];f&&(r.push({method:p,path:a,operation:f,pathLevelParams:u}),f.operationId&&o.add(f.operationId))}}return[{name:"Default",operations:r.map(a=>{let i=a.operation.operationId??_e(ze(a.method,a.path),o);return Fe(a.method,a.path,a.operation,i,a.pathLevelParams,e,n)})}]}function ze(e,t){let n=t.split("/").filter(Boolean).map(r=>Ke(r.replace(/[{}]/g,"")));return`${e}${n.join("")}`}function Ke(e){return e.split(/[^A-Za-z0-9]+/).filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function _e(e,t){let n=e,r=2;for(;t.has(n);)n=`${e}${r++}`;return t.add(n),n}function Fe(e,t,n,r,o,s,a){let i=(n.parameters??[]).map(w=>ge(S(s,w),`paths.${t}.${e}.parameters`,s)),c=new Set,u=[];for(let w of i)c.add(`${w.in}:${w.name}`),u.push(w);for(let w of o)c.has(`${w.in}:${w.name}`)||u.push(w);let p=u.filter(w=>w.in==="path"),f=u.filter(w=>w.in==="query"),m=u.filter(w=>w.in==="header"),l=u.filter(w=>w.in==="cookie"),h=n.requestBody?He(S(s,n.requestBody),`${e} ${t}`,s):void 0,{successResponses:d,successResponseHeaders:g}=Je(n,t,s),P=Ve(n,t,s),j=Ce(n,s,a),X=n["x-redoclyPagination"],H=Xe(d);return{name:r,method:e,path:t,summary:n.summary,description:n.description,pathParams:p,queryParams:f,headerParams:m,cookieParams:l,requestBody:h,successResponses:d,...g===void 0?{}:{successResponseHeaders:g},errorResponses:P,security:j,tags:Array.isArray(n.tags)?n.tags.filter(w=>typeof w=="string"):[],...X!==void 0?{paginationExtension:X}:{},...H===void 0?{}:{sse:H}}}function Xe(e){let t=e.find(o=>o.contentType.split(";")[0].trim().toLowerCase()==="text/event-stream");if(t===void 0)return;let n=t.itemSchema&&t.itemSchema.kind!=="unknown"?t.itemSchema:t.schema.kind!=="unknown"?t.schema:void 0;if(n===void 0)return{dataKind:"text"};let r=n.kind==="object"||n.kind==="ref"||n.kind==="array"||n.kind==="record"||n.kind==="union"||n.kind==="intersection";return{eventSchema:n,dataKind:r?"json":"text"}}function ge(e,t,n){if(!e.in)throw new y(`Parameter ${e.name} at ${t} is missing "in"`);if(!["path","query","header","cookie"].includes(e.in))throw new y(`Unsupported parameter location "${e.in}" for ${e.name} at ${t}`);let r=O(e.schema,`${t}.${e.name}`,n);e.deprecated===!0&&(r={...r,metadata:K(r.metadata,{deprecated:!0})});let o={name:e.name,in:e.in,schema:r,required:!!e.required,description:e.description};if(o.in==="query"){let s=e;(s.style==="form"||s.style==="spaceDelimited"||s.style==="pipeDelimited"||s.style==="deepObject")&&(o.style=s.style),typeof s.explode=="boolean"&&(o.explode=s.explode),typeof s.allowReserved=="boolean"&&(o.allowReserved=s.allowReserved)}return o}function He(e,t,n){let r=e.content??{},o=r["application/json"]??r["application/merge-patch+json"]??r["application/x-www-form-urlencoded"]??r["multipart/form-data"]??Object.values(r)[0];if(!o)return;let s=Object.keys(r).find(i=>r[i]===o),a=O(o.schema,`${t}.requestBody`,n);return{contentType:s,schema:a,required:!!e.required,description:e.description}}function Je(e,t,n){let r=e.responses??{},o=Object.keys(r).filter(m=>/^2\d\d$/.test(m));o.length===0&&(r["2XX"]?o.push("2XX"):r.default&&o.push("default"));let s=o[0];if(!s)return{successResponses:[]};let a=r[s];if(!a)return{successResponses:[]};let i=S(n,a),c=We(i.headers,`paths.${t}.response.${s}`,n),u=i.content;if(!u)return{successResponses:[],...c===void 0?{}:{successResponseHeaders:c}};let p=s==="default"||s==="2XX"?s:Number(s),f=[];for(let[m,l]of Object.entries(u)){let h=O(l.schema,`paths.${t}.response.${s}.${m}`,n),d=l.itemSchema,g=d!==void 0?O(d,`paths.${t}.response.${s}.${m}.itemSchema`,n):void 0;f.push({contentType:m,schema:h,status:p,...g===void 0?{}:{itemSchema:g}})}return{successResponses:f,...c===void 0?{}:{successResponseHeaders:c}}}function We(e,t,n){if(!e)return;let r=[];for(let[o,s]of Object.entries(e)){let a=S(n,s),i={name:o.toLowerCase(),schema:O(a.schema===void 0?void 0:S(n,a.schema),`${t}.headers.${o}`,n)};a.required===!0&&(i.required=!0),r.push(i)}return r.length>0?r:void 0}function Ve(e,t,n){let r=e.responses??{},o=Object.keys(r).filter(i=>/^([45]\d\d|4XX|5XX)$/.test(i));Object.keys(r).some(i=>/^(2\d\d|2XX)$/.test(i))&&r.default&&o.push("default");let a=[];for(let i of o){let c=r[i];if(!c)continue;let p=S(n,c).content;if(!p)continue;let f=i==="default"||i==="4XX"||i==="5XX"?i:Number(i);for(let[m,l]of Object.entries(p)){let h=O(l.schema,`paths.${t}.response.${i}.${m}`,n);a.push({contentType:m,schema:h,status:f})}}return a}function O(e,t,n){return e===void 0||typeof e=="boolean"?{kind:"unknown"}:v(e)?{kind:"ref",name:N(e.$ref)}:q(e,t,n)}function q(e,t,n){let r=Ie(e),o=e.oneOf??e.anyOf;if(o){let i=o.map((p,f)=>v(p)?{kind:"ref",name:N(p.$ref)}:q(p,`${t}.[${f}]`,n)),c=Re(i);if(c.length===1&&c.length<i.length){let p=c[0];return{...p,description:p.description??e.description,metadata:K(r,p.metadata)}}let u=Te(e,o);return k({kind:"union",members:c,discriminator:u,description:e.description},r)}if(e.allOf){let i=e.allOf.map((u,p)=>v(u)?{kind:"ref",name:N(u.$ref)}:q(u,`${t}.allOf[${p}]`,n)),c=me(e,t,n);if(c.length>0&&i.unshift({kind:"object",properties:c}),i.length===1){let u=i[0];return{...u,description:u.description??e.description,metadata:K(r,u.metadata)}}return k({kind:"intersection",members:i,description:e.description},r)}let s=e.type;if(Array.isArray(s)){let i=s.filter(p=>p!=="null"),c=s.includes("null"),u=i.map(p=>{let f={...e,type:p};if(Array.isArray(f.enum)){let m=f.enum.filter(l=>l!==null);f.enum=m.length>0?m:void 0}return q(f,t,n)});return c&&u.push({kind:"null"}),u.length===1?u[0]:k({kind:"union",members:u,description:e.description},r)}if(e.nullable)return{kind:"union",members:[q({...e,nullable:void 0},t,n),{kind:"null"}],description:e.description};if(e.const!==void 0){let i=e.const;if(typeof i!="string"&&typeof i!="number"&&typeof i!="boolean")throw new y(`Unsupported const value at ${t}: ${JSON.stringify(i)}`);return k({kind:"literal",value:i,description:e.description},r)}if(e.enum){let i=e.enum,c=i.filter(m=>m!==null),u=c.length!==i.length;if(c.length===0)return k({kind:"null",description:e.description},r);let p=Qe(c,t),f=p==="boolean"?{kind:"scalar",scalar:"boolean",description:e.description}:{kind:"enum",values:c,scalar:p,description:e.description};return k(u?{kind:"union",members:[f,{kind:"null"}],description:e.description}:f,r)}let a=s;if(a==="null")return k({kind:"null",description:e.description},r);if(a==="array"){let i=e.items,c=O(i,`${t}.items`,n);return k({kind:"array",items:c,description:e.description},r)}if(a==="object"||e.properties||e.additionalProperties){let i=me(e,t,n),c=e.additionalProperties;if(i.length===0&&c!==!1){let u=O(c,`${t}.additionalProperties`,n);return k({kind:"record",value:u,description:e.description},r)}return k({kind:"object",properties:i,description:e.description},r)}return k(a==="string"||a==="number"||a==="integer"||a==="boolean"?{kind:"scalar",scalar:a,description:e.description}:{kind:"unknown",description:e.description},r)}function Qe(e,t){let n=!1,r=!1,o=!1;for(let s of e)if(typeof s=="string")n=!0;else if(typeof s=="number")r=!0;else if(typeof s=="boolean")o=!0;else throw new y(`Unsupported enum value type at ${t}: ${JSON.stringify(s)}`);return n&&!r&&!o?"string":r&&!n&&!o?"number":o&&!n&&!r?"boolean":"string"}function Ye(e){return!(e.openapi??"").startsWith("3.0")}function me(e,t,n){let r=e.properties??{},o=new Set(e.required??[]),s=Ye(n);return Object.entries(r).map(([a,i])=>{let c=i,u=v(i)&&!s;return u&&c.readOnly===!0&&b.warn(`generate-client: "${a}" declares readOnly beside a $ref, which OpenAPI ${n.openapi} ignores \u2014 the property stays in request bodies. Inline the schema, wrap the $ref in allOf, or move the description to OpenAPI 3.1.
15
+ `),u&&c.writeOnly===!0&&b.warn(`generate-client: "${a}" declares writeOnly beside a $ref, which OpenAPI ${n.openapi} ignores \u2014 the property stays in responses. Inline the schema, wrap the $ref in allOf, or move the description to OpenAPI 3.1.
16
+ `),{name:a,schema:O(i,`${t}.${a}`,n),required:o.has(a),description:i.description,...c.readOnly===!0&&!u?{readOnly:!0}:{},...c.writeOnly===!0&&!u?{writeOnly:!0}:{}}})}function we(e){let t=_(e),n={...t};delete n.swagger,delete n.host,delete n.basePath,delete n.schemes,delete n.definitions,delete n.securityDefinitions,delete n.consumes,delete n.produces,delete n.parameters,delete n.responses,n.openapi="3.0.3";let r=Ze(t);return r&&(n.servers=r),n.components=et(t),n.paths=ot(t.paths??{},t.consumes??void 0,t.produces??void 0),n}function Ze(e){let t=e.host,n=e.basePath??"",r=(e.schemes??["https"])[0]??"https";if(t)return[{url:`${r}://${t}${n}`}]}function et(e){let t={};e.definitions&&(t.schemas=e.definitions),e.parameters&&(t.parameters=Object.fromEntries(Object.entries(e.parameters).map(([r,o])=>[r,F(o)]))),e.responses&&(t.responses=$e(e.responses,void 0));let n=e.securityDefinitions;if(n){let r={};for(let[o,s]of Object.entries(n))r[o]=tt(s);t.securitySchemes=r}return t}function tt(e){switch(e.type){case"basic":return{type:"http",scheme:"basic"};case"apiKey":return{type:"apiKey",name:e.name,in:e.in};case"oauth2":{let t=e.flow==="accessCode"?"authorizationCode":e.flow==="application"?"clientCredentials":e.flow,n={scopes:e.scopes??{}};return e.authorizationUrl&&(n.authorizationUrl=e.authorizationUrl),e.tokenUrl&&(n.tokenUrl=e.tokenUrl),{type:"oauth2",flows:{[t]:n}}}default:return e}}function _(e){if(Array.isArray(e))return e.map(_);if(x(e)){let t={};for(let[n,r]of Object.entries(e))n==="$ref"&&typeof r=="string"?t.$ref=r.replace("#/definitions/","#/components/schemas/").replace("#/parameters/","#/components/parameters/").replace("#/responses/","#/components/responses/"):t[n]=_(r);return t}return e}var nt="application/json",rt="application/json",be=new Set(["name","in","required","description","deprecated","allowEmptyValue","collectionFormat"]);function ot(e,t,n){let r={};for(let[o,s]of Object.entries(e)){let a=s,i={};for(let[c,u]of Object.entries(a)){if(c==="parameters"&&Array.isArray(u)){i.parameters=u.map(F);continue}if(!st(c)){i[c]=u;continue}i[c]=it(u,t,n)}r[o]=i}return r}function st(e){return["get","put","post","delete","options","head","patch"].includes(e.toLowerCase())}function it(e,t,n){let r=e.consumes??t,o=e.produces??n,s=e.parameters??[],a=s.find(f=>f.in==="body"),i=s.filter(f=>f.in==="formData"),c=s.filter(f=>f.in!=="body"&&f.in!=="formData").map(F),u={...e,parameters:c};delete u.consumes,delete u.produces;let p=r?.[0]??nt;if(a)u.requestBody={required:!!a.required,content:{[p]:{schema:a.schema}}};else if(i.length>0){let f={},m=[];for(let d of i)f[d.name]=at(d),d.required&&m.push(d.name);let l={type:"object",properties:f};m.length>0&&(l.required=m);let h=r?.find(d=>d==="multipart/form-data")??r?.[0]??"application/x-www-form-urlencoded";u.requestBody={required:m.length>0,content:{[h]:{schema:l}}}}return e.responses&&(u.responses=$e(e.responses,o)),u}function F(e){if(e.$ref!==void 0||e.in==="body"||e.in==="formData")return e;let t={},n={};for(let[r,o]of Object.entries(e))be.has(r)?t[r]=o:n[r]=o;if(t.schema=n,delete t.collectionFormat,e.in==="query"&&n.type==="array"){let r=e.collectionFormat??"csv";r!=="multi"&&(t.style=r==="ssv"?"spaceDelimited":r==="pipes"?"pipeDelimited":"form",t.explode=!1)}return t}function at(e){let t={};for(let[n,r]of Object.entries(e))be.has(n)||(t[n]=r);return t}function $e(e,t){let n=t?.[0]??rt,r={};for(let[o,s]of Object.entries(e)){let a=s;if(a.schema===void 0){r[o]=a;continue}let{schema:i,...c}=a;r[o]={...c,content:{[n]:{schema:i}}}}return r}async function ke(e,t,n){let r=t??await G({}),o=await Z({ref:e,config:r,collectSpecData:n}),s=await G({rules:{struct:"error"}}),a=await ee({externalRefResolver:new Q,document:o.bundle,config:s}),i=[...o.problems,...a].filter(u=>u.severity==="error");if(i.length>0){let u=i.map(p=>`- ${p.message} (at ${p.location?.[0]?.pointer??e})`).join(`
17
+ `);throw new Error(`The API description has ${i.length} error(s):
18
+ ${u}`)}let c=o.bundle.parsed;return{document:c,version:Y(c)}}var lt=["Generated by @redocly/client-generator \u2014 do not edit by hand.","Source: OpenAPI description. Re-run `redocly generate-client` to update."];function mt(e,t){let n=[],r=new Set,o=E(ve(t.outputPath)),{dir:s,name:a,ext:i}=ft(t.outputPath),c={path:t.outputPath,dir:s,stem:a,ext:i},u=lt,p=!1;for(let f of t.generators){let m=t.registry.get(f),l={model:e,output:c,banner:u,outputMode:t.outputMode,emit:t.emit,pagination:t.pagination,selected:t.generators,options:t.generatorOptions?.get(f)??{}},h;try{t.emit.docs===!0&&m.docs!==void 0?(h=[...m.run(l),...m.docs(l)],p=!0):h=m.run(l)}catch(d){let g=d instanceof Error?d.message:String(d);throw new Error(`Generator "${f}" failed: ${g}`)}if(!Array.isArray(h)||h.some(d=>typeof d?.path!="string"||d.path===""||typeof d.content!="string"))throw new Error(`Generator "${f}" failed: run() must return an array of { path, content } files.`);for(let d of h){let g=E(o,d.path);if(g!==o&&!g.startsWith(o+dt))throw new Error(`Generator "${f}" failed: file path escapes the output directory: ${d.path}`);if(r.has(g))throw new Error(`Generator conflict: ${d.path} already emitted by an earlier generator`);r.add(g),n.push({path:g,content:d.content})}}return t.emit.docs===!0&&!p&&b.warn(`generate-client: docs is on, but no selected generator writes documentation (${t.generators.join(", ")}).
19
+ `),n}function ht(e){for(let t of e.services)for(let n of t.operations){let r=new Set,o=new Set;for(let s of[...n.pathParams,...n.queryParams,...n.headerParams,...n.cookieParams])r.has(s.name)&&o.add(s.name),r.add(s.name);o.size!==0&&b.warn(`generate-client: operation "${n.specName??n.name}" uses ${[...o].map(s=>`"${s}"`).join(", ")} in more than one parameter location. Every SDK sends both, and the SDKs whose methods take one argument per parameter give the later one a suffixed name \u2014 rename it in the description to choose the name yourself.
20
+ `)}}function yt(e,t,n,r,o,s,a){let i=[],c=new Set;for(let u of te(t.services)){let p=gt(e,u.path,u.method);if(c.has(p))continue;c.add(p);let f=r.map(m=>o.get(m)?.sample?.(u,{model:t,emit:n,outputPath:s,pagination:a})).filter(m=>m!==void 0);f.length>0&&i.push({target:p,update:{"x-codeSamples":f}})}if(i.length!==0)return V({overlay:"1.0.0",info:{title:`Code samples for ${t.title}`,version:t.version},actions:i})}function gt(e,t,n){let r=a=>`['${a.replaceAll("\\","\\\\").replaceAll("'","\\'")}']`,o=e.paths?.[t];return`${v(o)&&o.$ref.startsWith("#/")?"$"+o.$ref.slice(2).split("/").map(J).map(r).join(""):`$.paths${r(t)}`}.${n}`}async function nn(e){if(e.output.split(/[\\/]/).some(d=>d==="undefined"||d==="null"))throw new Error(`output path "${e.output}" contains a literal "undefined" or "null" segment \u2014 this looks like an interpolation bug in the caller`);if(e.setup&&/^[a-z][a-z0-9+.-]+:/i.test(e.setup))throw new y(`setup must be a local file path \u2014 remote setup modules are not supported (got: ${e.setup})`);let t=E(e.output),{document:n,version:r}=await ke(e.api,e.config,e.collectSpecData),o=r==="oas2"?we(n):n,s=ye(o);ht(s);let a;if(e.setup){let{bakeSetup:d}=await import("./CQMMUWIJ.js"),g=E(e.configDir??process.cwd(),e.setup);a=d(await ut(g,"utf-8"))}let i=e.generators?.length?e.generators:["typescript"],{selected:c,registry:u}=await ce(i,{customGenerators:e.customGenerators,configDir:e.configDir}),p=ne(s,e.pagination),f={serverUrl:e.serverUrl,argsStyle:e.argsStyle,errorMode:e.errorMode,dateType:e.dateType,mockData:e.mockData,mockSeed:e.mockSeed,queryKeyPrefix:e.queryKeyPrefix,telemetry:e.telemetry,setup:a,runtime:e.runtime,importExt:e.importExt,goPackage:e.goPackage,pagination:p,docs:e.docs,docsFrontmatter:e.docsFrontmatter};se(c,f,u,e.outputMode);let m=ie(c,u,e.options),l=mt(s,{outputPath:t,outputMode:e.outputMode??"single",emit:f,pagination:p,generators:c,generatorOptions:m,registry:u});if(e.codeSamples===!0){let d=yt(n,s,f,c,u,t,p);d!==void 0&&l.push({path:t.replace(/\.[^.]+$/,".code-samples.yaml"),content:d})}let h=[];for(let d of l)await ct(ve(d.path),{recursive:!0}),await pt(d.path,d.content,"utf-8"),h.push({path:d.path,bytes:Buffer.byteLength(d.content,"utf-8")});return{outputPath:t,bytes:h.reduce((d,g)=>d+g.bytes,0),files:h}}export{T as a,se as b,mt as c,nn 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 a,d as b}from"./WACZWFKN.js";import"./JCP37EY3.js";import"./WZXA5XPB.js";import"./WBWCX3LS.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{b as generateClient,a as runGenerators};
7
+ import{a}from"./ILYXMZRT.js";import"./L2O63VRM.js";import"./IYV7EO2J.js";import"./DP3T6VZX.js";import"./UMN7TKTH.js";import"./ACAPGKSR.js";import"./WZXA5XPB.js";import"./DORXGE7Z.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{a as swrGenerator};
@@ -4,8 +4,8 @@ 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,f,j as d,m as u}from"./UW4UC7ZI.js";function m(e,t,n){let i=t??{},a=e.specName??e.name;if(Array.isArray(i.exclude)&&i.exclude.includes(a))return;let r=(i.operations??{})[a]??e.paginationExtension;if(r===void 0&&typeof i.style=="string"){let{exclude:l,operations:I,...h}=i;k(e,h,n)&&(r=h)}if(r===void 0||typeof r.style!="string")return;let o=r.style==="cursor"?r.cursorParam:r.offsetParam;return{style:r.style,...typeof o=="string"?{param:o}:{},...typeof r.nextCursor=="string"?{nextCursor:r.nextCursor}:{},...typeof r.hasMore=="string"?{hasMore:r.hasMore}:{},...typeof r.nextLink=="string"?{nextLink:r.nextLink}:{},...typeof r.limitParam=="string"?{limitParam:r.limitParam}:{},...typeof r.items=="string"?{items:r.items}:{}}}function k(e,t,n){if(t.style==="link")return e.successResponseHeaders?.some(a=>a.name==="link")===!0;if(t.style==="body-link"){if(typeof t.nextLink!="string"||n===void 0)return!1;let a=e.successResponses.find(o=>o.contentType.toLowerCase().includes("json"));if(a===void 0)return!1;let s=u(a.schema,t.nextLink,n);if(s===void 0)return!1;let r=f(d(s),n);return(r?.kind==="scalar"||r?.kind==="enum")&&r.scalar==="string"}let i=t.style==="cursor"?t.cursorParam:t.offsetParam;return typeof i=="string"&&e.queryParams.some(a=>a.name===i)}function b(e){return e.successResponses.find(t=>t.contentType.toLowerCase().includes("json"))?.schema}function R(e){return e.successResponses.find(t=>t.contentType.toLowerCase().includes("text/event-stream"))}function x(e){return e.requestBody?.contentType.toLowerCase().includes("multipart")??!1}function S(e){let t=e.requestBody?.schema.kind;return x(e)&&t!=="object"&&t!=="ref"}var $=["application/octet-stream","application/pdf","image/","audio/","video/","font/","application/x-font-","application/zip","application/x-zip-compressed","application/gzip","application/x-gzip","application/x-bzip2","application/x-tar","application/x-rar-compressed","application/x-7z-compressed","application/vnd.openxmlformats-officedocument","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/msword","application/x-shockwave-flash"];function y(e){let t=e.split(";")[0].trim().toLowerCase();return $.some(n=>t.startsWith(n))}function P(e){let t=new Set(e.variables.map(r=>r.name)),n=[],i="",a=e.url,s=/\{([^{}]+)\}/;for(let r=s.exec(a);r!==null;r=s.exec(a))i+=a.slice(0,r.index),t.has(r[1])?(i!==""&&n.push({kind:"literal",value:i}),i="",n.push({kind:"variable",name:r[1]})):i+=r[0],a=a.slice(r.index+r[0].length);return i+=a,(i!==""||n.length===0)&&n.push({kind:"literal",value:i}),n}function T(e,t){return e.security.map(n=>n.flatMap(i=>{let a=t.securitySchemes.find(s=>s.key===i);return a===void 0?[]:a.kind==="bearer"||a.kind==="basic"?[{scheme:i,kind:a.kind}]:a.kind==="apiKeyHeader"?[{scheme:i,kind:"apiKey",name:a.headerName,in:"header"}]:a.kind==="apiKeyQuery"?[{scheme:i,kind:"apiKey",name:a.paramName,in:"query"}]:[{scheme:i,kind:"apiKey",name:a.cookieName,in:"cookie"}]})).filter(n=>n.length>0)}function C(e,t,n){if(e===void 0||t===void 0)return;let i=u(e,t,n);return i?.kind==="array"?i.items:void 0}function g(e){return(e??"").replace(/\s+/g," ").trim().replace(/\\/g,"\\\\").replace(/\|/g,"\\|")}function c(e){switch(e.kind){case"ref":return e.name;case"omit":return e.base;case"scalar":return e.scalar;case"array":return`array of ${c(e.items)}`;case"record":return`map of ${c(e.value)}`;case"enum":{let t=e.values.map(String),n=t.slice(0,6).join(", ");return t.length>6?`enum: ${n}, and ${t.length-6} more`:`enum: ${n}`}case"literal":return String(e.value);case"union":return e.members.map(c).join(" or ");case"intersection":return e.members.map(c).join(" and ");case"object":return"object";case"null":return"null";case"unknown":return"any"}}function N(e){return e.successResponses.some(t=>t.contentType.toLowerCase().includes("json"))?!1:e.successResponses.some(t=>y(t.contentType))}function w(e,t){e.line("| Parameter | In | Type | Required | Description |"),e.line("| --------- | -- | ---- | -------- | ----------- |");for(let n of t)e.line(`| \`${n.name}\` | ${n.in} | ${g(c(n.schema))} | ${n.required?"yes":"no"} | ${g(n.description)} |`);e.blank()}function B(e,t,n,i){e.line(`### \`${n.specName??n.name}\``),e.blank(),n.summary!==void 0&&(e.line(g(n.summary)),e.blank()),e.line(`\`${n.method.toUpperCase()} ${n.path}\``),e.blank();let a=i.sample(n);if(a!==void 0){e.line("```"+i.language.fence);for(let l of a.source.replace(/\n+$/,"").split(`
7
+ import{a as p,f,j as d,m as u}from"./ACAPGKSR.js";function m(e,t,n){let i=t??{},a=e.specName??e.name;if(Array.isArray(i.exclude)&&i.exclude.includes(a))return;let r=(i.operations??{})[a]??e.paginationExtension;if(r===void 0&&typeof i.style=="string"){let{exclude:l,operations:I,...h}=i;k(e,h,n)&&(r=h)}if(r===void 0||typeof r.style!="string")return;let o=r.style==="cursor"?r.cursorParam:r.offsetParam;return{style:r.style,...typeof o=="string"?{param:o}:{},...typeof r.nextCursor=="string"?{nextCursor:r.nextCursor}:{},...typeof r.hasMore=="string"?{hasMore:r.hasMore}:{},...typeof r.nextLink=="string"?{nextLink:r.nextLink}:{},...typeof r.limitParam=="string"?{limitParam:r.limitParam}:{},...typeof r.items=="string"?{items:r.items}:{}}}function k(e,t,n){if(t.style==="link")return e.successResponseHeaders?.some(a=>a.name==="link")===!0;if(t.style==="body-link"){if(typeof t.nextLink!="string"||n===void 0)return!1;let a=e.successResponses.find(o=>o.contentType.toLowerCase().includes("json"));if(a===void 0)return!1;let s=u(a.schema,t.nextLink,n);if(s===void 0)return!1;let r=f(d(s),n);return(r?.kind==="scalar"||r?.kind==="enum")&&r.scalar==="string"}let i=t.style==="cursor"?t.cursorParam:t.offsetParam;return typeof i=="string"&&e.queryParams.some(a=>a.name===i)}function b(e){return e.successResponses.find(t=>t.contentType.toLowerCase().includes("json"))?.schema}function R(e){return e.successResponses.find(t=>t.contentType.toLowerCase().includes("text/event-stream"))}function x(e){return e.requestBody?.contentType.toLowerCase().includes("multipart")??!1}function S(e){let t=e.requestBody?.schema.kind;return x(e)&&t!=="object"&&t!=="ref"}var $=["application/octet-stream","application/pdf","image/","audio/","video/","font/","application/x-font-","application/zip","application/x-zip-compressed","application/gzip","application/x-gzip","application/x-bzip2","application/x-tar","application/x-rar-compressed","application/x-7z-compressed","application/vnd.openxmlformats-officedocument","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/msword","application/x-shockwave-flash"];function y(e){let t=e.split(";")[0].trim().toLowerCase();return $.some(n=>t.startsWith(n))}function P(e){let t=new Set(e.variables.map(r=>r.name)),n=[],i="",a=e.url,s=/\{([^{}]+)\}/;for(let r=s.exec(a);r!==null;r=s.exec(a))i+=a.slice(0,r.index),t.has(r[1])?(i!==""&&n.push({kind:"literal",value:i}),i="",n.push({kind:"variable",name:r[1]})):i+=r[0],a=a.slice(r.index+r[0].length);return i+=a,(i!==""||n.length===0)&&n.push({kind:"literal",value:i}),n}function T(e,t){return e.security.map(n=>n.flatMap(i=>{let a=t.securitySchemes.find(s=>s.key===i);return a===void 0?[]:a.kind==="bearer"||a.kind==="basic"?[{scheme:i,kind:a.kind}]:a.kind==="apiKeyHeader"?[{scheme:i,kind:"apiKey",name:a.headerName,in:"header"}]:a.kind==="apiKeyQuery"?[{scheme:i,kind:"apiKey",name:a.paramName,in:"query"}]:[{scheme:i,kind:"apiKey",name:a.cookieName,in:"cookie"}]})).filter(n=>n.length>0)}function C(e,t,n){if(e===void 0||t===void 0)return;let i=u(e,t,n);return i?.kind==="array"?i.items:void 0}function g(e){return(e??"").replace(/\s+/g," ").trim().replace(/\\/g,"\\\\").replace(/\|/g,"\\|")}function c(e){switch(e.kind){case"ref":return e.name;case"omit":return e.base;case"scalar":return e.scalar;case"array":return`array of ${c(e.items)}`;case"record":return`map of ${c(e.value)}`;case"enum":{let t=e.values.map(String),n=t.slice(0,6).join(", ");return t.length>6?`enum: ${n}, and ${t.length-6} more`:`enum: ${n}`}case"literal":return String(e.value);case"union":return e.members.map(c).join(" or ");case"intersection":return e.members.map(c).join(" and ");case"object":return"object";case"null":return"null";case"unknown":return"any"}}function N(e){return e.successResponses.some(t=>t.contentType.toLowerCase().includes("json"))?!1:e.successResponses.some(t=>y(t.contentType))}function w(e,t){e.line("| Parameter | In | Type | Required | Description |"),e.line("| --------- | -- | ---- | -------- | ----------- |");for(let n of t)e.line(`| \`${n.name}\` | ${n.in} | ${g(c(n.schema))} | ${n.required?"yes":"no"} | ${g(n.description)} |`);e.blank()}function B(e,t,n,i){e.line(`### \`${n.specName??n.name}\``),e.blank(),n.summary!==void 0&&(e.line(g(n.summary)),e.blank()),e.line(`\`${n.method.toUpperCase()} ${n.path}\``),e.blank();let a=i.sample(n);if(a!==void 0){e.line("```"+i.language.fence);for(let l of a.source.replace(/\n+$/,"").split(`
8
8
  `))e.line(l);e.line("```"),e.blank()}let s=[...n.pathParams,...n.queryParams,...n.headerParams];s.length>0&&w(e,s),n.requestBody!==void 0&&e.line(`Body: \`${n.requestBody.contentType}\`${n.requestBody.required?", required":", optional"}, of type ${c(n.requestBody.schema)}.`);let r=n.successResponses[0];e.line(r===void 0?"Returns no content.":`Returns \`${r.contentType}\`, of type ${c(r.schema)}.`),(i.paginated!==void 0?i.paginated.has(n.name):m(n,i.pagination,t)!==void 0)&&e.line("This operation is paginated, so the SDK gives it page and item iterators."),n.successResponses.some(l=>l.contentType==="text/event-stream")&&e.line("This operation streams server-sent events, so the SDK iterates the events."),N(n)&&e.line("This operation returns binary content."),e.blank()}function E(e,t){let n=new p;if(t.frontmatter&&(n.line("---"),n.line(`title: ${t.title}`),n.line("---"),n.blank()),n.line(`# ${t.title}`),n.blank(),n.line(`Generated reference for the ${t.language.label} SDK, produced from the API description by \`redocly generate-client\`.`),n.line("Re-run generation to update it \u2014 this file is not hand-edited."),n.blank(),n.line(t.language.requires),n.blank(),n.line("## Authentication"),n.blank(),e.securitySchemes.length===0)n.line("The description declares no security schemes.");else{n.line("The description declares these schemes, which you pass to the client:"),n.blank(),n.line("| Scheme | Kind | Sent as |"),n.line("| ------ | ---- | ------- |");for(let s of e.securitySchemes){let r=s.kind==="bearer"?"`Authorization: Bearer <token>`":s.kind==="basic"?"`Authorization: Basic <base64>`":s.kind==="apiKeyHeader"?`the \`${s.headerName}\` header`:s.kind==="apiKeyQuery"?`the \`${s.paramName}\` query parameter`:`the \`${s.cookieName}\` cookie`;n.line(`| \`${s.key}\` | ${s.kind} | ${r} |`)}}n.blank();let i=e.services.flatMap(s=>s.operations),a=[...new Set(i.map(s=>s.tags[0]))];for(let s of a){n.line(s===void 0?"## Operations":`## ${s}`),n.blank();for(let r of i.filter(o=>o.tags[0]===s))B(n,e,r,t)}return n.toString().replace(/\n{3,}/g,`
9
9
 
10
10
  `).trimEnd()+`
11
- `}var ne=["Printer","casing","identifierFor","uniqueIdentifiers","RESERVED_WORDS","flattenAllOf","deref","discriminatorCases","jsonSuccessSchema","sseResponse","isMultipartBody","isUntypedMultipartBody","isBinaryContentType","serverUrlParts","securityRequirements","paginationItemSchema","isNullable","unwrapNullable","enumValues","docText","headerCoerceType","schemaAtPointer","paginationRuleFor","renderReferencePage","NotSupportedError"];function A(e){return e}function q(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-")}function j(e){return e.replace(/[^A-Za-z0-9]+/g,"_").replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()}function L(e,t){let n={...e};for(let[i,a]of Object.entries(t))a!==void 0&&(n[i]=a);return n}function ye(e){return e}async function be(e){return(await import("./TR67FYLT.js")).generateClient(e)}export{m as a,b,R as c,x as d,S as e,y as f,P as g,T as h,C as i,E as j,ne as k,A as l,q as m,j as n,L as o,ye as p,be as q};
11
+ `}var ne=["Printer","casing","identifierFor","uniqueIdentifiers","RESERVED_WORDS","flattenAllOf","deref","discriminatorCases","jsonSuccessSchema","sseResponse","isMultipartBody","isUntypedMultipartBody","isBinaryContentType","serverUrlParts","securityRequirements","paginationItemSchema","isNullable","unwrapNullable","enumValues","docText","headerCoerceType","schemaAtPointer","paginationRuleFor","renderReferencePage","NotSupportedError"];function A(e){return e}function q(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-")}function j(e){return e.replace(/[^A-Za-z0-9]+/g,"_").replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()}function L(e,t){let n={...e};for(let[i,a]of Object.entries(t))a!==void 0&&(n[i]=a);return n}function ye(e){return e}async function be(e){return(await import("./QXHFS5G6.js")).generateClient(e)}export{m as a,b,R as c,x as d,S as e,y as f,P as g,T as h,C as i,E as j,ne as k,A as l,q as m,j as n,L as o,ye as p,be as q};
@@ -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 as ee,c as te,e as ne}from"./RFWIIJFG.js";var F=te((N,k)=>{(function(e,t){typeof N=="object"&&typeof k<"u"?t(N):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.ULID={}))})(N,(function(e){"use strict";function t(r){let c=new Error(r);return c.source="ulid",c}let n="0123456789ABCDEFGHJKMNPQRSTVWXYZ",o=n.length,i=Math.pow(2,48)-1,a=10,u=16;function m(r,c,s){return c>r.length-1?r:r.substr(0,c)+s+r.substr(c+1)}function p(r){let c,s=r.length,d,l,g=o-1;for(;!c&&s-->=0;){if(d=r[s],l=n.indexOf(d),l===-1)throw t("incorrectly encoded string");if(l===g){r=m(r,s,n[0]);continue}c=m(r,s,n[l+1])}if(typeof c=="string")return c;throw t("cannot increment this string")}function f(r){let c=Math.floor(r()*o);return c===o&&(c=o-1),n.charAt(c)}function v(r,c){if(isNaN(r))throw new Error(r+" must be a number");if(r>i)throw t("cannot encode time greater than "+i);if(r<0)throw t("time must be positive");if(Number.isInteger(Number(r))===!1)throw t("time must be an integer");let s,d="";for(;c>0;c--)s=r%o,d=n.charAt(s)+d,r=(r-s)/o;return d}function y(r,c){let s="";for(;r>0;r--)s=f(c)+s;return s}function E(r){if(r.length!==a+u)throw t("malformed ulid");var c=r.substr(0,a).split("").reverse().reduce((s,d,l)=>{let g=n.indexOf(d);if(g===-1)throw t("invalid character found: "+d);return s+=g*Math.pow(o,l)},0);if(c>i)throw t("malformed ulid, timestamp too large");return c}function I(r=!1,c){c||(c=typeof window<"u"?window:null);let s=c&&(c.crypto||c.msCrypto);if(s)return()=>{let d=new Uint8Array(1);return s.getRandomValues(d),d[0]/255};try{let d=ee("crypto");return()=>d.randomBytes(1).readUInt8()/255}catch{}if(r){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return()=>Math.random()}throw t("secure crypto unusable, insecure Math.random not allowed")}function j(r){return r||(r=I()),function(s){return isNaN(s)&&(s=Date.now()),v(s,a)+y(u,r)}}function R(r){r||(r=I());let c=0,s;return function(l){if(isNaN(l)&&(l=Date.now()),l<=c){let A=s=p(s);return v(c,a)+A}c=l;let g=s=y(u,r);return v(l,a)+g}}let M=j();e.decodeTime=E,e.detectPrng=I,e.encodeRandom=y,e.encodeTime=v,e.factory=j,e.incrementBase32=p,e.monotonicFactory=R,e.randomChar=f,e.replaceCharAt=m,e.ulid=M}))});var $={name:"@redocly/cli",version:"2.71.0",description:"",license:"MIT",bin:{redocly:"bin/cli.js",openapi:"bin/cli.js"},type:"module",engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,scripts:{build:"node ./scripts/build.mjs","prepare:publish-dir":"node ./scripts/prepare-publish-dir.mjs","clean:publish-dir":`node -e "require('fs').rmSync('.publish', {recursive:true, force:true})"`},publishConfig:{directory:".publish"},repository:{type:"git",url:"git+https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["linter","OpenAPI","Swagger","OpenAPI linter","Swagger linter","AsyncAPI linter","Arazzo linter","oas"],contributors:["Roman Hotsiy <roman@redocly.com> (https://redocly.com/)"],devDependencies:{"@modelcontextprotocol/sdk":"^1.32.1","@opentelemetry/exporter-trace-otlp-http":"0.219.0","@opentelemetry/resources":"2.8.0","@opentelemetry/sdk-trace-node":"2.8.0","@opentelemetry/semantic-conventions":"1.41.1","@redocly/cli-otel":"0.3.7","@redocly/client-generator":"0.7.11","@redocly/openapi-core":"2.71.0","@redocly/recheck":"2.71.0","@redocly/respect-core":"2.71.0","@redocly/reunite-integration":"2.71.0","@types/cookie":"0.6.0","@types/har-format":"^1.2.16","@types/react":"^17.0.0 || ^18.2.21 || ^19.2.16","@types/react-dom":"^17.0.0 || ^18.2.7 || ^19.2.3","@types/semver":"^7.5.0","@types/set-cookie-parser":"2.4.10","@types/yargs":"17.0.32",colorette:"^1.2.0",cookie:"^0.7.2",dotenv:"16.4.7",esbuild:"^0.28.0",glob:"^13.0.5",handlebars:"^4.7.10",react:"^18.3.0 || ^19.2.7","react-dom":"^18.3.0 || ^19.2.7","react-router":"^7.18.4",redoc:"3.0.1",semver:"^7.5.2","set-cookie-parser":"^2.3.5","styled-components":"6.4.2",typescript:"6.0.2",ulid:"^3.0.1",undici:"^7.30.0",yargs:"17.0.1"}};var{version:we,name:De,engines:Te}=$,Ue=$.devDependencies.redoc;var re="https://otel.cloud.redocly.com",Re=process.env.OTEL_TRACES_URL||`${re}/v1/traces`,Me=6e3,Oe="redocly-cli-anonymous-id";var Z=ne(F(),1),ie=Object.defineProperty,ce=(e,t)=>{for(var n in t)ie(e,n,{get:t[n],enumerable:!0})},se={};ce(se,{CLOUD_EVENT_STANDARD_KEYS:()=>X,mapToCloudEvent:()=>ae});var X=["id","specversion","object","datacontenttype","type","time","origin","env","category","signal","source","subject","subjects","data","actor","requestId","clientIp","organizationId","organizationSlug","projectId","projectSlug","osPlatform","userAgent","sessionId"];function ae(e){let{type:t,data:n,actor:o,requestId:i,clientIp:a,origin:u,env:m,source:p,organizationId:f,organizationSlug:v,projectId:y,projectSlug:E,category:I="product",signal:j="log",osPlatform:R,userAgent:M,sessionId:r}=e,c=!!(n&&Array.isArray(n)),s=o?{id:o.id??`ann_${(0,Z.ulid)()}`,object:o.object??"user",uri:o.uri??""}:null,d=`evt_${(0,Z.ulid)()}`.toLowerCase(),l=new Date,g=p??s?.uri??null,A={...f!==void 0&&{organizationId:f},...v!==void 0&&{organizationSlug:v},...y!==void 0&&{projectId:y},...E!==void 0&&{projectSlug:E}},O={specversion:"1.0",object:"event",datacontenttype:"application/json; charset=utf-8",origin:u,env:m,category:I,signal:j,osPlatform:R,userAgent:M,clientIp:a,sessionId:r};if(c){let _=n,Y=_.map(S=>({id:S.id??"",object:S.object??"",uri:S.uri??""})),Q=_[0]?.id??null;Object.assign(O,{...A,id:d,type:t,time:l,source:g,actor:s,subject:Q,subjects:Y,data:_,requestId:i??""})}else{let _=(Array.isArray(n)?n[0]:n)?.id??null;Object.assign(O,{...A,id:d,type:t,time:l,source:g,actor:s,subject:_,requestId:i??"",data:n,...p!=null&&{request:{source:p}}})}return O}function T(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase()}function L(e){return e!=null}function x(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function G(e,t,n,o=!0,i){let a=i?.length?new Set(i):null;for(let[u,m]of Object.entries(e))if(!a?.has(u)&&m!==void 0){let p=o?T(u):u;n[`${t}${p}`]=m}}function w(e,t,n,o){let i=o?.currentDepth??0,a=o?.useSnakeCase??!0,u=o?.maxNestingLevels??3,m=t.endsWith(".")?t.slice(0,-1):t;for(let[p,f]of Object.entries(e)){if(!L(f))continue;let v=a?T(p):p,y=`${m}.${v}`;typeof f=="object"&&!Array.isArray(f)?i<u&&w(f,y,n,{currentDepth:i+1,useSnakeCase:a,maxNestingLevels:u}):x(f)&&(n[y]=f)}}var V="context",P=[V];function q(e){let t={updated:[],notUpdated:[]};for(let n of e){if(!n||typeof n!="object")continue;let o=n.object;if(typeof o!="string")continue;let i=n,a=t.notUpdated.find(u=>u.object===o);a?(t.updated=[a,i],t.notUpdated=t.notUpdated.filter(u=>u.object!==o)):t.updated.some(u=>u.object===o)||t.notUpdated.push(i)}return t}function D(e,t,n){let o=n?`${n}.`:"",i=t===""?"":`${T(t)}.`;return`${e}.${o}${i}`}function H(e,t){let n=e[V];return n==="before"||n==="after"?n:t===0?"after":"before"}function B(e){let{[V]:t,...n}=e;return n}function z(e){return e.endsWith(".")?e:`${e}.`}function ue(e,t,n){let o=t instanceof Date?t.toISOString():new Date(t).toISOString();return{"cloudevents.event_id":e.id,"cloudevents.event_type":e.type,"cloudevents.event_source":e.source??void 0,"cloudevents.event_spec_version":e.specversion,"cloudevents.event_data_content_type":e.datacontenttype??"application/json; charset=utf-8","cloudevents.event_time":o,"cloudevents.event_subject":e.subject??"","cloudevents.event_version":n?.version,"cloudevents.event_origin":e.origin??n?.serviceName,"cloudevents.event_env":e.env,"cloudevents.event_client_ip":e.clientIp,"cloudevents.event_object":e.object||"event","cloudevents.event_category":e.category,"cloudevents.event_signal":e.signal,"cloudevents.event_actor.id":e.actor?.id??void 0,"cloudevents.event_actor.object":e.actor?.object??void 0,"cloudevents.event_actor.uri":e.actor?.uri??void 0,"cloudevents.event_organization_id":e.organizationId,"cloudevents.event_organization_slug":e.organizationSlug,"cloudevents.event_project_id":e.projectId,"cloudevents.event_project_slug":e.projectSlug,"cloudevents.event_request_id":e.requestId,"cloudevents.event_os_platform":e.osPlatform,"cloudevents.event_user_agent":e.userAgent,"cloudevents.event_session_id":e.sessionId}}function $e(e,t,n){let o=e.data,i={...ue(e,t,n)};return de(o,i),ve(e,i),ye(e,i),i}function de(e,t){!e||typeof e!="object"||(Array.isArray(e)?le(e,t):me(e,t))}function le(e,t){e.some(n=>n&&typeof n=="object"&&typeof n.object=="string")?fe(e,t):pe(e,t)}function fe(e,t){let n=q(e);n.updated.forEach((o,i)=>{let a=D("cloudevents.event_data",o.object,H(o,i));w(B(o),z(a),t)}),n.notUpdated.forEach(o=>{let i=D("cloudevents.event_data",o.object,void 0);w(B(o),z(i),t)})}function pe(e,t){for(let n of e)!n||typeof n!="object"||w(n,"cloudevents.event_data.",t)}function me(e,t){for(let[n,o]of Object.entries(e)){if(!L(o))continue;let i=T(n);if(typeof o=="object"&&!Array.isArray(o))for(let[a,u]of Object.entries(o))L(u)&&x(u)&&(t[`cloudevents.event_data.${i}.${a}`]=u);else x(o)&&(t[`cloudevents.event_data.${i}`]=o)}}function ve(e,t){if(!e.subjects||!Array.isArray(e.subjects))return;let n=q(e.subjects);n.updated.forEach((o,i)=>{let a=D("cloudevents.event_subjects",o.object,H(o,i));G(o,a,t,!1,P)}),n.notUpdated.forEach(o=>{let i=D("cloudevents.event_subjects",o.object,void 0);G(o,i,t,!1,P)})}function ye(e,t){for(let[n,o]of Object.entries(e))if(!(X.includes(n)||o===void 0))if(o instanceof Object)for(let[i,a]of Object.entries(o))a!==void 0&&(t[`cloudevents.${n}.${i}`]=a);else t[`cloudevents.${n}`]=o}import U from"node:crypto";var J="0123456789ABCDEFGHJKMNPQRSTVWXYZ",C=32;var ge=16,K=10,W=0xffffffffffff;var b;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(b||(b={}));var h=class extends Error{constructor(t,n){super(`${n} (${t})`),this.name="ULIDError",this.code=t}};function be(e){let t=Math.floor(e()*C)%C;return J.charAt(t)}function he(e){let t=Ie(),n=t&&(t.crypto||t.msCrypto)||(typeof U<"u"?U:null);if(typeof n?.getRandomValues=="function")return()=>{let o=new Uint8Array(1);return n.getRandomValues(o),o[0]/256};if(typeof n?.randomBytes=="function")return()=>n.randomBytes(1).readUInt8()/256;if(U?.randomBytes)return()=>U.randomBytes(1).readUInt8()/256;throw new h(b.PRNGDetectFailure,"Failed to find a reliable PRNG")}function Ie(){return je()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function _e(e,t){let n="";for(;e>0;e--)n=be(t)+n;return n}function Ee(e,t=K){if(isNaN(e))throw new h(b.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>W)throw new h(b.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${W}: ${e}`);if(e<0)throw new h(b.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new h(b.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let n,o="";for(let i=t;i>0;i--)n=e%C,o=J.charAt(n)+o,e=(e-n)/C;return o}function je(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function xe(e,t){let n=t||he(),o=!e||isNaN(e)?Date.now():e;return Ee(o,K)+_e(ge,n)}export{we as a,De as b,Te as c,Ue as d,re as e,Re as f,Me as g,Oe as h,se as i,$e as j,xe as k};
7
+ import{a as ee,c as te,e as ne}from"./RFWIIJFG.js";var F=te((N,k)=>{(function(e,t){typeof N=="object"&&typeof k<"u"?t(N):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.ULID={}))})(N,(function(e){"use strict";function t(r){let c=new Error(r);return c.source="ulid",c}let n="0123456789ABCDEFGHJKMNPQRSTVWXYZ",o=n.length,i=Math.pow(2,48)-1,a=10,u=16;function m(r,c,s){return c>r.length-1?r:r.substr(0,c)+s+r.substr(c+1)}function p(r){let c,s=r.length,d,l,g=o-1;for(;!c&&s-->=0;){if(d=r[s],l=n.indexOf(d),l===-1)throw t("incorrectly encoded string");if(l===g){r=m(r,s,n[0]);continue}c=m(r,s,n[l+1])}if(typeof c=="string")return c;throw t("cannot increment this string")}function f(r){let c=Math.floor(r()*o);return c===o&&(c=o-1),n.charAt(c)}function v(r,c){if(isNaN(r))throw new Error(r+" must be a number");if(r>i)throw t("cannot encode time greater than "+i);if(r<0)throw t("time must be positive");if(Number.isInteger(Number(r))===!1)throw t("time must be an integer");let s,d="";for(;c>0;c--)s=r%o,d=n.charAt(s)+d,r=(r-s)/o;return d}function y(r,c){let s="";for(;r>0;r--)s=f(c)+s;return s}function E(r){if(r.length!==a+u)throw t("malformed ulid");var c=r.substr(0,a).split("").reverse().reduce((s,d,l)=>{let g=n.indexOf(d);if(g===-1)throw t("invalid character found: "+d);return s+=g*Math.pow(o,l)},0);if(c>i)throw t("malformed ulid, timestamp too large");return c}function I(r=!1,c){c||(c=typeof window<"u"?window:null);let s=c&&(c.crypto||c.msCrypto);if(s)return()=>{let d=new Uint8Array(1);return s.getRandomValues(d),d[0]/255};try{let d=ee("crypto");return()=>d.randomBytes(1).readUInt8()/255}catch{}if(r){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return()=>Math.random()}throw t("secure crypto unusable, insecure Math.random not allowed")}function j(r){return r||(r=I()),function(s){return isNaN(s)&&(s=Date.now()),v(s,a)+y(u,r)}}function R(r){r||(r=I());let c=0,s;return function(l){if(isNaN(l)&&(l=Date.now()),l<=c){let A=s=p(s);return v(c,a)+A}c=l;let g=s=y(u,r);return v(l,a)+g}}let M=j();e.decodeTime=E,e.detectPrng=I,e.encodeRandom=y,e.encodeTime=v,e.factory=j,e.incrementBase32=p,e.monotonicFactory=R,e.randomChar=f,e.replaceCharAt=m,e.ulid=M}))});var $={name:"@redocly/cli",version:"2.71.1",description:"",license:"MIT",bin:{redocly:"bin/cli.js",openapi:"bin/cli.js"},type:"module",engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,scripts:{build:"node ./scripts/build.mjs","prepare:publish-dir":"node ./scripts/prepare-publish-dir.mjs","clean:publish-dir":`node -e "require('fs').rmSync('.publish', {recursive:true, force:true})"`},publishConfig:{directory:".publish"},repository:{type:"git",url:"git+https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["linter","OpenAPI","Swagger","OpenAPI linter","Swagger linter","AsyncAPI linter","Arazzo linter","oas"],contributors:["Roman Hotsiy <roman@redocly.com> (https://redocly.com/)"],devDependencies:{"@modelcontextprotocol/sdk":"^1.32.1","@opentelemetry/exporter-trace-otlp-http":"0.219.0","@opentelemetry/resources":"2.8.0","@opentelemetry/sdk-trace-node":"2.8.0","@opentelemetry/semantic-conventions":"1.41.1","@redocly/cli-otel":"0.3.7","@redocly/client-generator":"0.7.12","@redocly/openapi-core":"2.71.1","@redocly/recheck":"2.71.1","@redocly/respect-core":"2.71.1","@redocly/reunite-integration":"2.71.1","@types/cookie":"0.6.0","@types/har-format":"^1.2.16","@types/react":"^17.0.0 || ^18.2.21 || ^19.2.16","@types/react-dom":"^17.0.0 || ^18.2.7 || ^19.2.3","@types/semver":"^7.5.0","@types/set-cookie-parser":"2.4.10","@types/yargs":"17.0.32",colorette:"^1.2.0",cookie:"^0.7.2",dotenv:"16.4.7",esbuild:"^0.28.0",glob:"^13.0.5",handlebars:"^4.7.10",react:"^18.3.0 || ^19.2.7","react-dom":"^18.3.0 || ^19.2.7","react-router":"^7.18.4",redoc:"3.0.1",semver:"^7.5.2","set-cookie-parser":"^2.3.5","styled-components":"6.4.2",typescript:"6.0.2",ulid:"^3.0.1",undici:"^7.30.0",yargs:"17.0.1"}};var{version:we,name:De,engines:Te}=$,Ue=$.devDependencies.redoc;var re="https://otel.cloud.redocly.com",Re=process.env.OTEL_TRACES_URL||`${re}/v1/traces`,Me=6e3,Oe="redocly-cli-anonymous-id";var Z=ne(F(),1),ie=Object.defineProperty,ce=(e,t)=>{for(var n in t)ie(e,n,{get:t[n],enumerable:!0})},se={};ce(se,{CLOUD_EVENT_STANDARD_KEYS:()=>X,mapToCloudEvent:()=>ae});var X=["id","specversion","object","datacontenttype","type","time","origin","env","category","signal","source","subject","subjects","data","actor","requestId","clientIp","organizationId","organizationSlug","projectId","projectSlug","osPlatform","userAgent","sessionId"];function ae(e){let{type:t,data:n,actor:o,requestId:i,clientIp:a,origin:u,env:m,source:p,organizationId:f,organizationSlug:v,projectId:y,projectSlug:E,category:I="product",signal:j="log",osPlatform:R,userAgent:M,sessionId:r}=e,c=!!(n&&Array.isArray(n)),s=o?{id:o.id??`ann_${(0,Z.ulid)()}`,object:o.object??"user",uri:o.uri??""}:null,d=`evt_${(0,Z.ulid)()}`.toLowerCase(),l=new Date,g=p??s?.uri??null,A={...f!==void 0&&{organizationId:f},...v!==void 0&&{organizationSlug:v},...y!==void 0&&{projectId:y},...E!==void 0&&{projectSlug:E}},O={specversion:"1.0",object:"event",datacontenttype:"application/json; charset=utf-8",origin:u,env:m,category:I,signal:j,osPlatform:R,userAgent:M,clientIp:a,sessionId:r};if(c){let _=n,Y=_.map(S=>({id:S.id??"",object:S.object??"",uri:S.uri??""})),Q=_[0]?.id??null;Object.assign(O,{...A,id:d,type:t,time:l,source:g,actor:s,subject:Q,subjects:Y,data:_,requestId:i??""})}else{let _=(Array.isArray(n)?n[0]:n)?.id??null;Object.assign(O,{...A,id:d,type:t,time:l,source:g,actor:s,subject:_,requestId:i??"",data:n,...p!=null&&{request:{source:p}}})}return O}function T(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase()}function L(e){return e!=null}function x(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function G(e,t,n,o=!0,i){let a=i?.length?new Set(i):null;for(let[u,m]of Object.entries(e))if(!a?.has(u)&&m!==void 0){let p=o?T(u):u;n[`${t}${p}`]=m}}function w(e,t,n,o){let i=o?.currentDepth??0,a=o?.useSnakeCase??!0,u=o?.maxNestingLevels??3,m=t.endsWith(".")?t.slice(0,-1):t;for(let[p,f]of Object.entries(e)){if(!L(f))continue;let v=a?T(p):p,y=`${m}.${v}`;typeof f=="object"&&!Array.isArray(f)?i<u&&w(f,y,n,{currentDepth:i+1,useSnakeCase:a,maxNestingLevels:u}):x(f)&&(n[y]=f)}}var V="context",P=[V];function q(e){let t={updated:[],notUpdated:[]};for(let n of e){if(!n||typeof n!="object")continue;let o=n.object;if(typeof o!="string")continue;let i=n,a=t.notUpdated.find(u=>u.object===o);a?(t.updated=[a,i],t.notUpdated=t.notUpdated.filter(u=>u.object!==o)):t.updated.some(u=>u.object===o)||t.notUpdated.push(i)}return t}function D(e,t,n){let o=n?`${n}.`:"",i=t===""?"":`${T(t)}.`;return`${e}.${o}${i}`}function H(e,t){let n=e[V];return n==="before"||n==="after"?n:t===0?"after":"before"}function B(e){let{[V]:t,...n}=e;return n}function z(e){return e.endsWith(".")?e:`${e}.`}function ue(e,t,n){let o=t instanceof Date?t.toISOString():new Date(t).toISOString();return{"cloudevents.event_id":e.id,"cloudevents.event_type":e.type,"cloudevents.event_source":e.source??void 0,"cloudevents.event_spec_version":e.specversion,"cloudevents.event_data_content_type":e.datacontenttype??"application/json; charset=utf-8","cloudevents.event_time":o,"cloudevents.event_subject":e.subject??"","cloudevents.event_version":n?.version,"cloudevents.event_origin":e.origin??n?.serviceName,"cloudevents.event_env":e.env,"cloudevents.event_client_ip":e.clientIp,"cloudevents.event_object":e.object||"event","cloudevents.event_category":e.category,"cloudevents.event_signal":e.signal,"cloudevents.event_actor.id":e.actor?.id??void 0,"cloudevents.event_actor.object":e.actor?.object??void 0,"cloudevents.event_actor.uri":e.actor?.uri??void 0,"cloudevents.event_organization_id":e.organizationId,"cloudevents.event_organization_slug":e.organizationSlug,"cloudevents.event_project_id":e.projectId,"cloudevents.event_project_slug":e.projectSlug,"cloudevents.event_request_id":e.requestId,"cloudevents.event_os_platform":e.osPlatform,"cloudevents.event_user_agent":e.userAgent,"cloudevents.event_session_id":e.sessionId}}function $e(e,t,n){let o=e.data,i={...ue(e,t,n)};return de(o,i),ve(e,i),ye(e,i),i}function de(e,t){!e||typeof e!="object"||(Array.isArray(e)?le(e,t):me(e,t))}function le(e,t){e.some(n=>n&&typeof n=="object"&&typeof n.object=="string")?fe(e,t):pe(e,t)}function fe(e,t){let n=q(e);n.updated.forEach((o,i)=>{let a=D("cloudevents.event_data",o.object,H(o,i));w(B(o),z(a),t)}),n.notUpdated.forEach(o=>{let i=D("cloudevents.event_data",o.object,void 0);w(B(o),z(i),t)})}function pe(e,t){for(let n of e)!n||typeof n!="object"||w(n,"cloudevents.event_data.",t)}function me(e,t){for(let[n,o]of Object.entries(e)){if(!L(o))continue;let i=T(n);if(typeof o=="object"&&!Array.isArray(o))for(let[a,u]of Object.entries(o))L(u)&&x(u)&&(t[`cloudevents.event_data.${i}.${a}`]=u);else x(o)&&(t[`cloudevents.event_data.${i}`]=o)}}function ve(e,t){if(!e.subjects||!Array.isArray(e.subjects))return;let n=q(e.subjects);n.updated.forEach((o,i)=>{let a=D("cloudevents.event_subjects",o.object,H(o,i));G(o,a,t,!1,P)}),n.notUpdated.forEach(o=>{let i=D("cloudevents.event_subjects",o.object,void 0);G(o,i,t,!1,P)})}function ye(e,t){for(let[n,o]of Object.entries(e))if(!(X.includes(n)||o===void 0))if(o instanceof Object)for(let[i,a]of Object.entries(o))a!==void 0&&(t[`cloudevents.${n}.${i}`]=a);else t[`cloudevents.${n}`]=o}import U from"node:crypto";var J="0123456789ABCDEFGHJKMNPQRSTVWXYZ",C=32;var ge=16,K=10,W=0xffffffffffff;var b;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(b||(b={}));var h=class extends Error{constructor(t,n){super(`${n} (${t})`),this.name="ULIDError",this.code=t}};function be(e){let t=Math.floor(e()*C)%C;return J.charAt(t)}function he(e){let t=Ie(),n=t&&(t.crypto||t.msCrypto)||(typeof U<"u"?U:null);if(typeof n?.getRandomValues=="function")return()=>{let o=new Uint8Array(1);return n.getRandomValues(o),o[0]/256};if(typeof n?.randomBytes=="function")return()=>n.randomBytes(1).readUInt8()/256;if(U?.randomBytes)return()=>U.randomBytes(1).readUInt8()/256;throw new h(b.PRNGDetectFailure,"Failed to find a reliable PRNG")}function Ie(){return je()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function _e(e,t){let n="";for(;e>0;e--)n=be(t)+n;return n}function Ee(e,t=K){if(isNaN(e))throw new h(b.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>W)throw new h(b.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${W}: ${e}`);if(e<0)throw new h(b.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new h(b.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let n,o="";for(let i=t;i>0;i--)n=e%C,o=J.charAt(n)+o,e=(e-n)/C;return o}function je(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function xe(e,t){let n=t||he(),o=!e||isNaN(e)?Date.now():e;return Ee(o,K)+_e(ge,n)}export{we as a,De as b,Te as c,Ue as d,re as e,Re as f,Me as g,Oe as h,se as i,$e as j,xe as k};