@redocly/cli 0.0.0-snapshot.1786099785 → 0.0.0-snapshot.1786199735

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 (76) hide show
  1. package/lib/chunks/25GSVUWJ.js +15 -0
  2. package/lib/chunks/2VVGA7JY.js +7 -0
  3. package/lib/chunks/3GFYSU6P.js +7 -0
  4. package/lib/chunks/{OWX6ZXBF.js → 3IIQ4P4P.js} +1 -1
  5. package/lib/chunks/3XBPOSEL.js +9 -0
  6. package/lib/chunks/{RWNIJPWR.js → 45VSHDYY.js} +1 -1
  7. package/lib/chunks/5KALNFRG.js +8 -0
  8. package/lib/chunks/6ATAJMOK.js +25 -0
  9. package/lib/chunks/{56HNXA5D.js → 6P5CEWFQ.js} +1 -1
  10. package/lib/chunks/{BHB5KKAL.js → 7UNXSP4X.js} +1 -1
  11. package/lib/chunks/{73ESCNNF.js → AYXBQ5ZL.js} +1 -1
  12. package/lib/chunks/BDG6IUCF.js +12 -0
  13. package/lib/chunks/BDIXGM4J.js +7 -0
  14. package/lib/chunks/{WRQU5JSI.js → C65SIVY5.js} +114 -114
  15. package/lib/chunks/CDIETNM7.js +7 -0
  16. package/lib/chunks/DDSMAYCX.js +517 -0
  17. package/lib/chunks/DQWFUOGC.js +25 -0
  18. package/lib/chunks/{EGUJTMV2.js → DU3CIMSU.js} +1 -1
  19. package/lib/chunks/{DECM5F24.js → DUPX7PYY.js} +1 -1
  20. package/lib/chunks/EG5RJVOK.js +7 -0
  21. package/lib/chunks/FGZLHC6B.js +16 -0
  22. package/lib/chunks/G332MANL.js +897 -0
  23. package/lib/chunks/{HG6WQXIG.js → HKJZLCBH.js} +1 -1
  24. package/lib/chunks/HLD5FTSQ.js +12 -0
  25. package/lib/chunks/HU2IUTZL.js +875 -0
  26. package/lib/chunks/HY6IQ5MU.js +10 -0
  27. package/lib/chunks/IWSGIYUF.js +7 -0
  28. package/lib/chunks/{U3KLQFIU.js → JXLOSJZ3.js} +1 -1
  29. package/lib/chunks/JZMDULX5.js +8 -0
  30. package/lib/chunks/L5QMCITI.js +460 -0
  31. package/lib/chunks/LBCASDYY.js +9 -0
  32. package/lib/chunks/LUHMTQUR.js +41 -0
  33. package/lib/chunks/{YYU64ISN.js → M3VQCD77.js} +1 -1
  34. package/lib/chunks/MK4LHZVA.js +176 -0
  35. package/lib/chunks/{TW722U72.js → NIXODD2W.js} +1 -1
  36. package/lib/chunks/{T76C3QOE.js → O42EGUEU.js} +1 -1
  37. package/lib/chunks/OAHVR5VG.js +7 -0
  38. package/lib/chunks/{LZKLJG2M.js → OBMFFMGK.js} +1 -1
  39. package/lib/chunks/P3HJG5ZU.js +9 -0
  40. package/lib/chunks/PYCIZVAB.js +21 -0
  41. package/lib/chunks/SQTDATOG.js +53 -0
  42. package/lib/chunks/{R2YRGZTG.js → TXPH3EQR.js} +1 -1
  43. package/lib/chunks/{Y2LAA5JV.js → V6VQXQSU.js} +1 -1
  44. package/lib/chunks/{VG3F52NL.js → WI4DHPSB.js} +1 -1
  45. package/lib/chunks/YSMUBJCG.js +7 -0
  46. package/lib/chunks/ZGQWJITG.js +9 -0
  47. package/lib/chunks/ZLT4SN3P.js +7 -0
  48. package/lib/chunks/ZXLNDDJH.js +2346 -0
  49. package/lib/eject-assets/AGENTS.md +123 -0
  50. package/lib/eject-assets/generators/cli-docs.mjs +593 -0
  51. package/lib/eject-assets/generators/cli.mjs +461 -0
  52. package/lib/eject-assets/generators/go.mjs +831 -0
  53. package/lib/eject-assets/generators/mock.mjs +689 -0
  54. package/lib/eject-assets/generators/php.mjs +805 -0
  55. package/lib/eject-assets/generators/python.mjs +670 -0
  56. package/lib/eject-assets/generators/sdk.mjs +1615 -0
  57. package/lib/eject-assets/generators/swr.mjs +267 -0
  58. package/lib/eject-assets/generators/tanstack-query.mjs +632 -0
  59. package/lib/eject-assets/generators/transformers.mjs +403 -0
  60. package/lib/eject-assets/generators/zod.mjs +520 -0
  61. package/lib/eject-assets/skills/cli-docs-generator/SKILL.md +58 -0
  62. package/lib/eject-assets/skills/cli-generator/SKILL.md +68 -0
  63. package/lib/eject-assets/skills/client-generators/SKILL.md +128 -0
  64. package/lib/eject-assets/skills/go-generator/SKILL.md +81 -0
  65. package/lib/eject-assets/skills/mock-generator/SKILL.md +45 -0
  66. package/lib/eject-assets/skills/php-generator/SKILL.md +97 -0
  67. package/lib/eject-assets/skills/python-generator/SKILL.md +70 -0
  68. package/lib/eject-assets/skills/sdk-generator/SKILL.md +65 -0
  69. package/lib/eject-assets/skills/swr-generator/SKILL.md +44 -0
  70. package/lib/eject-assets/skills/tanstack-query-generator/SKILL.md +48 -0
  71. package/lib/eject-assets/skills/transformers-generator/SKILL.md +43 -0
  72. package/lib/eject-assets/skills/zod-generator/SKILL.md +49 -0
  73. package/lib/index.js +225 -191
  74. package/package.json +1 -1
  75. package/lib/chunks/HUKAUXQL.js +0 -2542
  76. package/lib/chunks/Y2JC7LON.js +0 -8
@@ -0,0 +1,15 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ import{a as f,b as i,c,d as u,e as m,f as y}from"./LBCASDYY.js";import"./EG5RJVOK.js";import"./C65SIVY5.js";import"./NEWT5A6S.js";import"./3GFYSU6P.js";import{c as $,f as g}from"./BDG6IUCF.js";import{g as l}from"./3XBPOSEL.js";import"./RFWIIJFG.js";import{join as v}from"node:path";function k(t,n){let r=f(t,"swr");if(r.length===0)return"";let e=r.some(i),s=r.some(o=>!i(o));return[...e?['import useSWR from "swr";']:[],...s?['import useSWRMutation from "swr/mutation";']:[],y(r,n.sdkModule,e),...r.flatMap(o=>i(o)?w(o,n):[M(o,n)])].join(`
8
+
9
+ `)}function S(t,n,r){return`export function use${l(t.name)}(${n}) {
10
+ return ${r};
11
+ }`}function w(t,n){let r=c(t),e=r?`vars: ${u(t)}`:"",s=r?`[${JSON.stringify(t.name)}, vars]`:`[${JSON.stringify(t.name)}]`,a=`export const ${t.name}Key = (${e}) => ${s} as const;`,d=`useSWR(${`${t.name}Key(${r?"vars":""})`}, () => ${m(t,n.argsStyle,"vars",!0)})`,p=r?`vars: ${u(t)}, init?: Omit<RequestOptions, "envelope">`:'init?: Omit<RequestOptions, "envelope">';return[a,S(t,p,d)]}function M(t,n){let r=c(t)?`(_key: string, { arg }: {
12
+ arg: ${u(t)};
13
+ }) => ${m(t,n.argsStyle,"arg",!1)}`:`() => ${m(t,n.argsStyle,"arg",!1)}`,e=`useSWRMutation(${JSON.stringify(t.name)}, ${r})`;return S(t,"",e)}var E=({model:t,outputPath:n,emit:r})=>{let{dir:e,stem:s}=g(n),a=k(t,{argsStyle:r.argsStyle??"flat",sdkModule:`./${s}.${r.importExt??"js"}`});return a===""?[]:[{path:v(e,`${s}.swr.ts`),content:`${$}
14
+
15
+ ${a}`}]};export{E as swrGenerator};
@@ -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
+ var U={"server-url":{key:"serverUrl"},format:{key:"format"},"dry-run":{key:"dryRun",boolean:!0},"page-all":{key:"pageAll",boolean:!0},output:{key:"output"},token:{key:"token"},json:{key:"json"}};function O(n){return n.trim().replace(/[^A-Za-z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()}function A(n){return n.replace(/\s+/g," ").trim()}function x(n,e){if(e.length===0||e[0]==="--help")return{kind:"help"};if(e[0]==="schema"){let t=n.find(o=>o.name===e[1]);return t?{kind:"schema",command:t}:{kind:"usage-error",message:`Unknown command: schema ${e[1]??""}`.trim()}}let y=new Set(n.filter(t=>t.group).map(t=>O(t.group))),s,f;if(y.has(e[0])){if(e[1]==="--help"||e[1]===void 0)return{kind:"help",topic:e[0]};if(s=n.find(t=>t.group&&O(t.group)===e[0]&&t.name===e[1]),!s)return{kind:"usage-error",message:`Unknown command: ${e[0]} ${e[1]}`};f=e.slice(2)}else{let t=n.filter(o=>o.name===e[0]);if(s=t.find(o=>o.group===void 0)??(t.length===1?t[0]:void 0),!s)return{kind:"usage-error",message:t.length>1?`Ambiguous command: ${e[0]} \u2014 prefix it with its group (${t.map(r=>O(r.group)).join(", ")})`:`Unknown command: ${e[0]}`};f=e.slice(1)}if(f.includes("--help"))return{kind:"help",topic:s};let u={},a={},d={},j=0;for(let t=0;t<f.length;t++){let o=f[t];if(!o.startsWith("--")){let c=s.positionals[j++];if(!c)return{kind:"usage-error",message:`Unexpected argument: ${o}`};u[c.name]=o;continue}let r=o.indexOf("="),m=r===-1?o.slice(2):o.slice(2,r),l=r===-1?void 0:o.slice(r+1),h=()=>l!==void 0?l:f[++t],b=U[m];if(b){if(b.boolean){d[b.key]=!0;continue}let c=h();if(c===void 0)return{kind:"usage-error",message:`Flag --${m} expects a value`};if(b.key==="format"&&c!=="json"&&c!=="ndjson")return{kind:"usage-error",message:"--format must be one of: json, ndjson"};d[b.key]=c;continue}let p=s.flags.find(c=>c.name===m);if(!p)return{kind:"usage-error",message:`Unknown flag: --${m}`};if(p.type==="boolean"){a[p.param]=!0;continue}let k=h();if(k===void 0)return{kind:"usage-error",message:`Flag --${m} expects a value`};if(p.enum&&!p.enum.includes(k))return{kind:"usage-error",message:`--${m} must be one of: ${p.enum.join(", ")}`};if(p.type==="number"){let c=Number(k);if(Number.isNaN(c))return{kind:"usage-error",message:`--${m} expects a number, got "${k}"`};a[p.param]=c}else if(p.type==="array"){let c=a[p.param];a[p.param]=Array.isArray(c)?[...c,k]:[k]}else a[p.param]=k}for(let t of s.positionals)if(!(t.name in u))return{kind:"usage-error",message:`Missing required argument: <${t.name}>`};for(let t of s.flags)if(t.required&&!(t.param in a))return{kind:"usage-error",message:`Missing required flag: --${t.name}`};return d.json!==void 0&&!s.body?{kind:"usage-error",message:`${s.name} does not accept a request body`}:s.body?.required&&d.json===void 0?{kind:"usage-error",message:`${s.name} requires a request body: pass --json '<json>', --json @file.json, or --json @-`}:d.pageAll&&!s.paginated?{kind:"usage-error",message:`${s.name} is not paginated; --page-all only applies to paginated operations`}:{kind:"run",command:s,positionals:u,params:a,globals:d}}function S(n){return n.replace(/[^A-Za-z0-9]+/g,"_").replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()}function N(n,e){let y=n.env??{},s=S(n.binName),f={};for(let u of n.schemes??[])if(u.kind==="bearer"){let a=e??y[`${s}_TOKEN`];a!==void 0&&(f.bearer=a)}else if(u.kind==="basic"){let a=y[`${s}_USERNAME`],d=y[`${s}_PASSWORD`];a!==void 0&&d!==void 0&&(f.basic={username:a,password:d})}else{let a=y[`${s}_API_KEY_${S(u.key)}`];a!==void 0&&(f.apiKey={...f.apiKey,[u.key]:a})}return f}function _(n){return{operationId:n.name,...n.group===void 0?{}:{group:O(n.group)},...n.summary===void 0?{}:{summary:A(n.summary)},method:n.method,path:n.path,parameters:{path:n.positionals.map(e=>({name:e.name,type:e.type??"string",required:!0,...e.description===void 0?{}:{description:A(e.description)}})),query:n.flags.map(e=>({name:e.name,param:e.param,type:e.type,required:e.required,...e.enum===void 0?{}:{enum:e.enum},...e.description===void 0?{}:{description:A(e.description)}}))},...n.body===void 0?{}:{body:n.body},...n.unsupportedBody===void 0?{}:{unsupportedBody:n.unsupportedBody},...n.paginated===!0?{paginated:!0}:{},...n.sse===!0?{sse:!0}:{},...n.blob===!0?{blob:!0}:{},...n.schemas??{}}}function E(n,e,y,s){if(s!==void 0&&typeof s!="string"){let r=s,l=[`Usage: ${[e,...r.group?[O(r.group)]:[],r.name,...r.positionals.map(h=>`<${h.name}>`),...r.flags.length>0?["[flags]"]:[],...r.body?["--json '<json>' | @file | @-"]:[]].join(" ")}`];if(r.summary&&l.push("",r.summary),r.unsupportedBody!==void 0&&l.push("",`This operation takes a ${r.unsupportedBody} body, which the CLI cannot build \u2014 call it through the generated client instead.`),r.flags.length>0){l.push("","Flags:");for(let h of r.flags){let b=h.enum?` (one of: ${h.enum.join(", ")})`:"",p=h.required?" [required]":"";l.push(` --${h.name} <${h.type}>${b}${p} ${A(h.description??"")}`.trimEnd())}}return l}let f=typeof s=="string"?n.filter(r=>r.group&&O(r.group)===s):n,u=typeof s=="string"?[`Usage: ${e} ${s} <command> \u2026`,"","Commands:"]:[`Usage: ${e} [group] <command> \u2026`,"","Commands:"],a=new Set,d=n.some(r=>r.group);for(let r of f){if(typeof s!="string"&&r.group){let m=O(r.group);if(a.has(m))continue;a.add(m);let l=m===r.group?"":` (${r.group})`;u.push(` ${m} <command>${l}`);continue}u.push(` ${[r.group===void 0?void 0:O(r.group),r.name].filter(Boolean).join(" ")} ${A(r.summary??"")}`.trimEnd())}let j=S(e),t=new Set(y.map(r=>r.kind)),o=[...t.has("bearer")?[`${j}_TOKEN`]:[],...t.has("basic")?[`${j}_USERNAME`,`${j}_PASSWORD`]:[],...y.filter(r=>r.kind==="apiKey").map(r=>`${j}_API_KEY_${S(r.key)}`)];return u.push("","Global flags:"," --server-url <url> Override the baked server URL"," --format <json|ndjson> Output format"," --dry-run Print the prepared request without sending it"," --page-all Follow pagination, one JSON page per line"," --output <path> Write the response body to a file (required for binary)",...t.has("bearer")?[" --token <token> Bearer token"]:[]," --json <json|@file|@-> Request body",...o.length>0?["","Environment:",` ${o.join(", ")}`]:[],"",`Run ${e} ${d?"<group> <command>":"<command>"} --help for command details; ${e} schema <command> prints its schemas.`),u}function I(n,e){let y=n==="@-"?(e.stdin??(()=>""))():n.startsWith("@")?(e.readFile??(()=>""))(n.slice(1)):n;return JSON.parse(y)}function R(n,e){let y={};for(let[s,f]of Object.entries(n))y[s]=e.some(u=>u!==""&&f.includes(u))?"***":f;return y}async function w(n,e,y){let{stdout:s,stderr:f}=e,u=(g,i)=>(f(JSON.stringify({error:{code:g,...i}})),g),a=x(n,y);if(a.kind==="usage-error")return u(4,{message:a.message});if(a.kind==="help"){for(let g of E(n,e.binName,e.schemes??[],a.topic))s(g);return 0}if(a.kind==="schema")return s(JSON.stringify(_(a.command),null,2)),0;let{command:d,positionals:j,params:t,globals:o}=a,r=e.schemes??[];if(o.token!==void 0&&!r.some(g=>g.kind==="bearer")){let g=r.map(i=>`${i.key} (${i.kind})`).join(", ");return u(4,{message:"--token is a bearer credential, and this API declares no bearer scheme. "+(g===""?"It declares no security schemes at all.":`It accepts: ${g}.`)})}if(d.blob&&o.output===void 0)return u(4,{message:`${d.name} downloads a file: pass --output <path>`,operationId:d.name});let m;if(o.json!==void 0)try{m=I(o.json,e)}catch(g){return u(4,{message:`Invalid --json body: ${g.message}`,operationId:d.name})}let l=N(e,o.token);Object.keys(l).length>0&&e.configure({auth:l}),o.serverUrl!==void 0&&e.configure({serverUrl:o.serverUrl});let h=[...typeof l.bearer=="string"?[l.bearer]:[],...l.basic?[l.basic.password]:[],...Object.values(l.apiKey??{})],b;o.dryRun&&e.configure({fetch:async(g,i)=>(b={url:g,method:i.method,headers:R(i.headers??{},h),...i.body!==void 0&&i.body!==null?{body:String(i.body)}:{}},new Response("{}",{status:200,headers:{"content-type":"application/json"}}))});let p={...j};Object.keys(t).length>0&&(p.params=t),m!==void 0&&(p.body=m);let k=Object.keys(p).length>0?p:void 0,c=e.client;try{if(o.pageAll&&!o.dryRun){let $=c[d.name];for await(let q of $.pages(k))s(JSON.stringify(q));return 0}let g=c[d.name],i=await g(k);if(o.dryRun)return s(JSON.stringify(b,null,2)),0;if(d.sse){for await(let $ of i)s(JSON.stringify($));return 0}if(d.blob){let $=new Uint8Array(await i.arrayBuffer());return(e.writeFile??(()=>{}))(o.output,$),s(JSON.stringify({saved:o.output,bytes:$.length})),0}return i!=null&&s(JSON.stringify(i,null,2)),0}catch(g){let i=g,$={message:i.message,operationId:d.name,...i.status!==void 0?{status:i.status}:{},...i.issues!==void 0?{issues:i.issues}:{}};return i.name==="ZodValidationError"?u(3,$):i.name==="ApiError"&&(i.status===401||i.status===403)?u(2,$):u(1,$)}}export{O as a,S as b,w as c};
@@ -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
+ var i="text/event-stream";function t(n){return n.successResponses.find(e=>e.contentType.split(";")[0].trim().toLowerCase()===i)}function s(n){return t(n)!==void 0}function r(n){let e=t(n);if(e){if(e.itemSchema&&e.itemSchema.kind!=="unknown")return e.itemSchema;if(e.schema.kind!=="unknown")return e.schema}}function o(n){let e=r(n);return e&&(e.kind==="object"||e.kind==="ref"||e.kind==="array"||e.kind==="record"||e.kind==="union"||e.kind==="intersection")?"json":"text"}export{s as a,r as b,o as c};
@@ -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{ma as e}from"./WRQU5JSI.js";var t=class extends Error{};function o(r){throw new e(r)}export{t as a,o as b};
7
+ import{la as e}from"./C65SIVY5.js";var t=class extends Error{};function o(r){throw new e(r)}export{t as a,o as b};
@@ -0,0 +1,9 @@
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
+ var o=/^[A-Za-z_$][A-Za-z0-9_$]*$/,s=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","await","implements","interface","let","package","private","protected","public","static"]);function u(e){return o.test(e)}function p(e){return o.test(e)&&!s.has(e)}function a(e){let t=e.replace(/[^A-Za-z0-9_$]/g,"_");return(t===""||/^[0-9]/.test(t)||s.has(t))&&(t=`_${t}`),t}function c(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function l(e){return o.test(e)&&!s.has(e)?e:c(e)}function f(e,t){let r=a(e),n=r,i=2;for(;t.has(n);)n=`${r}_${i++}`;return t.add(n),n}function x(e){return e[0].toUpperCase()+e.slice(1)}function g(e){let t=e.split(/[-_]/).filter(r=>r.length>0).map((r,n)=>{let i=r.toLowerCase();return n===0?i:i.charAt(0).toUpperCase()+i.slice(1)}).join("");return a(t)}function w(e){return e.replace(/\r\n/g,`
8
+ `).split(`
9
+ `).map(t=>t.trimEnd())}export{u as a,p as b,a as c,c as d,l as e,f,x as g,g as h,w as i};
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a,b,c,d,e,f,g}from"./T76C3QOE.js";import"./O6PRCLSV.js";import"./32XCOMOR.js";import"./WRQU5JSI.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{d as RESET_ESCAPE_CODE,c as calculateTotals,f as conditionallyMaskSecrets,b as generate,e as maskSecrets,a as parseRuntimeExpression,g as run};
7
+ import{a,b,c,d,e,f,g}from"./O42EGUEU.js";import"./O6PRCLSV.js";import"./32XCOMOR.js";import"./C65SIVY5.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{d as RESET_ESCAPE_CODE,c as calculateTotals,f as conditionallyMaskSecrets,b as generate,e as maskSecrets,a as parseRuntimeExpression,g as run};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ import{a as m,c as l}from"./DQWFUOGC.js";import"./6ATAJMOK.js";import"./ZXLNDDJH.js";import"./P3HJG5ZU.js";import"./OAHVR5VG.js";import"./YSMUBJCG.js";import"./C65SIVY5.js";import"./NEWT5A6S.js";import"./3GFYSU6P.js";import{f as a}from"./BDG6IUCF.js";import"./3XBPOSEL.js";import"./RFWIIJFG.js";import{join as s}from"node:path";function p(o){return o.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()||"client"}var g=({model:o,outputPath:i,emit:n,selected:r})=>{let{dir:e,stem:t}=a(i),c=l(o,{stem:t,importExt:n.importExt??"js",runtime:n.runtime??"inline",zodSelected:r?.includes("zod")??!1,binName:n.binName??p(t),pagination:n.pagination});return[{path:s(e,`${t}.cli.ts`),content:c}]};function $(o,i){let n=m(i.model,{pagination:i.emit.pagination}).find(e=>e.name===o.name);return n===void 0?void 0:{lang:"shell",label:"CLI",source:`npx tsx client.cli.ts ${["client",...n.group?[n.group]:[],n.name,...n.positionals.map(e=>`<${e.name}>`),...n.flags.filter(e=>e.required).map(e=>`--${e.name} <${e.type}>`),...n.body?["--json '<json>'"]:[]].slice(1).join(" ")}
8
+ `}}export{g as cliGenerator,$ as cliSample};
@@ -0,0 +1,25 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ import{a as i}from"./ZXLNDDJH.js";var s="// \u2500\u2500\u2500 Embedded runtime (@redocly/client-generator, assembled per this API's needs) \u2500\u2500\u2500";function o(t){let e=["types.ts","errors.ts","url.ts","parse.ts","retry.ts"];return t.multipart&&e.push("multipart.ts"),t.auth&&e.push("auth.ts"),t.setup&&e.push("setup.ts"),t.paginate&&e.push("paginate.ts"),e.push("send.ts"),t.sse&&e.push("sse.ts"),e.push("create-client.ts"),[s,...e.map(n=>i[n]),r(t)].join(`
8
+
9
+ `)}function p(){return i["cli.ts"]}function r(t){let e=[...t.multipart?["serializeMultipart: toFormData"]:[],...t.auth?["resolveAuth"]:[],...t.sse?["sse"]:[],...t.paginate?["paginate: { pages, items, pagesByLink, itemsByLink }"]:[]];return`/**
10
+ * The client factory: \`createClientCore\` wired with the capabilities this API needs.
11
+ * Exported so apps can build additional instances (per-tenant, per-environment) over
12
+ * the same \`OPERATIONS\`/\`Ops\`. The trailing string params carry the wiring's literal
13
+ * unions (\`OperationId\`/\`OperationPath\`/\`OperationTag\`) into \`ctx.operation\`.
14
+ */
15
+ export function createClient<
16
+ Ops extends OpsShape,
17
+ Id extends string = string,
18
+ Path extends string = string,
19
+ Tag extends string = string,
20
+ >(
21
+ operations: Record<string, OperationDescriptor>,
22
+ config?: ClientConfig<OperationContext<Id, Path, Tag>>
23
+ ): Client<Ops, OperationContext<Id, Path, Tag>> {
24
+ return createClientCore<Ops, Id, Path, Tag>(operations, config, ${e.length>0?`{ ${e.join(", ")} }`:"{}"});
25
+ }`}export{o as a,p as b};
@@ -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{h as a}from"./U3KLQFIU.js";import"./P26PQ2RU.js";import"./RS5PUOTT.js";import"./73ESCNNF.js";import"./BXI4SF2U.js";import"./32XCOMOR.js";import"./WRQU5JSI.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{a as RedoclyOAuthClient};
7
+ import{h as a}from"./JXLOSJZ3.js";import"./RS5PUOTT.js";import"./BXI4SF2U.js";import"./32XCOMOR.js";import"./P26PQ2RU.js";import"./AYXBQ5ZL.js";import"./C65SIVY5.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{a as RedoclyOAuthClient};
@@ -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 oe,e as ae,f as ue,g as ce,h as b,i as de,k as H,l as V,m as pe,n as le,v as he,w as me}from"./HG6WQXIG.js";import{$ as se,E as X,F as g,G as O,H as Z,I as $,J as C,L as S,N as y,P as w,R as ee,S as te,T as Je,X as ne,Z as re,ba as ie,c as l,p as Y,u as Q,x as We}from"./WRQU5JSI.js";import{e as J}from"./RFWIIJFG.js";import fe from"node:path";function R(t){return t?t.trim():""}function T(t){let e=R(t.operationId)||R(t.path);return[R(t.ruleId),R(t.severity),R(t.message),e,R(t.target),R(t.schemaPath)].join("")}var F=t=>X(S(t));function Ye(t){return t==="error"?"error":t==="warning"?"warning":"note"}function Qe(t){if(t==null)return"";let e=String(t);return!e.includes(",")&&!e.includes('"')&&!e.includes(`
7
+ import{a as oe,e as ae,f as ue,g as ce,h as b,i as de,k as H,l as V,m as pe,n as le,v as he,w as me}from"./HKJZLCBH.js";import{D as X,E as g,F as O,G as Z,H as $,I as C,K as S,M as y,O as w,Q as ee,R as te,S as Je,W as ne,Y as re,_ as se,aa as ie,c as l,p as Y,u as Q,x as We}from"./C65SIVY5.js";import{e as J}from"./RFWIIJFG.js";import fe from"node:path";function R(t){return t?t.trim():""}function T(t){let e=R(t.operationId)||R(t.path);return[R(t.ruleId),R(t.severity),R(t.message),e,R(t.target),R(t.schemaPath)].join("")}var F=t=>X(S(t));function Ye(t){return t==="error"?"error":t==="warning"?"warning":"note"}function Qe(t){if(t==null)return"";let e=String(t);return!e.includes(",")&&!e.includes('"')&&!e.includes(`
8
8
  `)?e:`"${e.replace(/"/g,'""')}"`}function Xe(t){return fe.isAbsolute(t)?fe.relative(process.cwd(),t)||".":t}function Ze(t){if(!t)return null;let e=t.operationPathTemplate;return typeof e=="string"&&e.length>0?e:null}function et(t){return Object.entries(t).sort((e,r)=>{let n=r[1]-e[1];return n!==0?n:e[0].localeCompare(r[0])})}function tt(t){let e=[],r=new Map;for(let n of t){let s=T({ruleId:n.ruleId,severity:n.severity,message:n.message,operationId:n.operationId,path:n.path,target:n.target,schemaPath:n.schemaPath}),i=r.get(s);if(i!==void 0){e[i].occurrences+=1;continue}r.set(s,e.length),e.push({finding:n,occurrences:1})}return e}function nt(t){let e=tt(t.findings).map(n=>({occurrences:n.occurrences,exchangeIndex:n.finding.exchangeIndex,ruleId:n.finding.ruleId,severity:n.finding.severity,category:n.finding.category,message:n.finding.message,operationId:n.finding.operationId,specSource:n.finding.specSource,target:n.finding.target,schemaPath:n.finding.schemaPath,dataPath:n.finding.dataPath,details:n.finding.details,method:n.finding.method,url:n.finding.url,path:n.finding.path,status:n.finding.status})),r={run:{id:t.runId,specSource:t.meta.specSource,trafficPath:t.meta.trafficPath,format:t.meta.format,matchMode:t.meta.matchMode,server:t.meta.server,totalExchanges:t.summary.totalExchanges,documentedExchanges:t.summary.documentedExchanges,undocumentedExchanges:t.summary.undocumentedExchanges,skippedExchanges:t.summary.skippedExchanges,findingsBySeverity:t.summary.findingsBySeverity,findingsByRule:t.summary.findingsByRule,totalProblems:t.summary.totalProblemGroups,durationMs:t.summary.durationMs},problems:e};return`${JSON.stringify(r,null,2)}
9
9
  `}function rt(t){let e=["run_id","finding_id","exchange_index","severity","category","rule_id","message","method","path","url","status","operation_id","spec_source","target","schema_path","data_path"],r=t.findings.map(s=>[t.runId,s.id,s.exchangeIndex,s.severity,s.category,s.ruleId,s.message,s.method,s.path,s.url,s.status,s.operationId,s.specSource,s.target,s.schemaPath,s.dataPath]);return`${[e,...r].map(s=>s.map(Qe).join(",")).join(`
10
10
  `)}
@@ -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
- var e={name:"@redocly/cli",version:"0.0.0-snapshot.1786099785",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:"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:{"@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.5","@redocly/client-generator":"0.0.0-snapshot.1786099785","@redocly/openapi-core":"0.0.0-snapshot.1786099785","@redocly/respect-core":"0.0.0-snapshot.1786099785","@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.9","https-proxy-agent":"^7.0.5",react:"^17.0.0 || ^18.2.0 || ^19.2.7","react-dom":"^17.0.0 || ^18.2.0 || ^19.2.7",redoc:"2.5.3",semver:"^7.5.2","set-cookie-parser":"^2.3.5","styled-components":"6.4.2",typescript:"6.0.2",ulid:"^3.0.1",undici:"^6.28.0",yargs:"17.0.1"}};var{version:s,name:i,engines:n}=e,p=e.devDependencies.redoc,c="sha384-xiEssMQFSpSfLbzRZCGfxxIM5QDb2DTrU6vyoZdp2sV1L6pmOMy6MpTtUoLbpC96";export{s as a,i as b,n as c,p as d,c as e};
7
+ var e={name:"@redocly/cli",version:"0.0.0-snapshot.1786199735",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:"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:{"@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.5","@redocly/client-generator":"0.0.0-snapshot.1786199735","@redocly/openapi-core":"0.0.0-snapshot.1786199735","@redocly/respect-core":"0.0.0-snapshot.1786199735","@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.9","https-proxy-agent":"^7.0.5",react:"^17.0.0 || ^18.2.0 || ^19.2.7","react-dom":"^17.0.0 || ^18.2.0 || ^19.2.7",redoc:"2.5.3",semver:"^7.5.2","set-cookie-parser":"^2.3.5","styled-components":"6.4.2",typescript:"6.0.2",ulid:"^3.0.1",undici:"^6.28.0",yargs:"17.0.1"}};var{version:s,name:i,engines:n}=e,p=e.devDependencies.redoc,c="sha384-xiEssMQFSpSfLbzRZCGfxxIM5QDb2DTrU6vyoZdp2sV1L6pmOMy6MpTtUoLbpC96";export{s as a,i as b,n as c,p as d,c as e};
@@ -0,0 +1,12 @@
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{i as r}from"./3XBPOSEL.js";function u(n){return n.replace(/\*\//g,"*\\/")}function l(n,i){let e=f(n,i);return e.length===0?void 0:e.join(`
8
+ `)}function f(n,i){let e=[];return n&&n.trim()&&e.push(...m(r(n))),i&&e.push(...t(i)),e}function t(n){let i=[],e=(o,s)=>{s===void 0?i.push(`@${o}`):i.push(`@${o} ${s}`)};return n.minimum!==void 0&&e("minimum",n.minimum),n.maximum!==void 0&&e("maximum",n.maximum),n.exclusiveMinimum!==void 0&&e("exclusiveMinimum",n.exclusiveMinimum),n.exclusiveMaximum!==void 0&&e("exclusiveMaximum",n.exclusiveMaximum),n.minLength!==void 0&&e("minLength",n.minLength),n.maxLength!==void 0&&e("maxLength",n.maxLength),n.pattern!==void 0&&e("pattern",u(n.pattern)),n.minItems!==void 0&&e("minItems",n.minItems),n.maxItems!==void 0&&e("maxItems",n.maxItems),n.uniqueItems===!0&&e("uniqueItems"),n.format!==void 0&&e("format",n.format),n.deprecated===!0&&e("deprecated"),i}function m(n){let i=0,e=n.length;for(;i<e&&n[i]==="";)i++;for(;e>i&&n[e-1]==="";)e--;return n.slice(i,e)}var g="// Generated by @redocly/client-generator \u2014 do not edit by hand.\n// Source: OpenAPI description. Re-run `redocly generate-client` to update.";function L(n){return n.filter(i=>i.length>0).join(`
9
+
10
+ `)+`
11
+ `}function I(n){let i=["/**",` * ${u(`${n.title} (v${n.version})`)}`];if(n.description)for(let e of r(u(n.description)))i.push(` * ${e}`.replace(/ +$/,""));return i.push(" */"),i.join(`
12
+ `)}import{parse as c}from"node:path";function M(n){let{dir:i,name:e}=c(n);return{dir:i,stem:e}}export{u as a,l as b,g as c,L as d,I as e,M as f};
@@ -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
+ var c={name:"@redocly/client-generator",version:"0.0.0-snapshot.1786199735",description:"Generate typed, zero-dependency TypeScript clients (fetch, auth, retries, middleware, SSE) from OpenAPI descriptions.",type:"module",types:"lib/index.d.ts",sideEffects:!1,exports:{".":{types:"./lib/index.d.ts",import:"./lib/index.js",default:"./lib/index.js"},"./generate":{types:"./lib/generate.d.ts",import:"./lib/generate.js",default:"./lib/generate.js"},"./runtime-sources":{types:"./lib/runtime-sources.d.ts",import:"./lib/runtime-sources.js",default:"./lib/runtime-sources.js"},"./package.json":"./package.json"},engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,publishConfig:{access:"public"},scripts:{"examples:regen":"node scripts/regenerate-examples.mjs",prepare:"node scripts/generate-runtime-sources.mjs && node scripts/generate-eject-assets.mjs","typecheck:examples":"node scripts/typecheck-examples.mjs"},license:"MIT",repository:{type:"git",url:"git+https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["OpenAPI","Swagger","TypeScript","client","generator","codegen","fetch"],contributors:["Roman Marshevskyi <roman.marshevskyy@redocly.com> (https://redocly.com/)"],dependencies:{"@redocly/openapi-core":"0.0.0-snapshot.1786199735"},peerDependencies:{typescript:">=5.5.0"},peerDependenciesMeta:{typescript:{optional:!0}},devDependencies:{typescript:"6.0.2"},files:["lib","eject-assets"]};var u=c.version;function o(s){let e=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(s.trim());return e===null?void 0:[Number(e[1]),Number(e[2]),Number(e[3])]}function i(s,e){return s[0]-e[0]||s[1]-e[1]||s[2]-e[2]}function l(s,e){let n=/^[\^~]|^>=/.exec(e.trim())?.[0]??"",t=o(e.trim().slice(n.length)),r=o(s);if(!(t===void 0||r===void 0))return i(r,t)<0?!1:n===">="?!0:n===""?i(r,t)===0:n==="~"?r[0]===t[0]&&r[1]===t[1]:t[0]!==0?r[0]===t[0]:t[1]!==0?r[0]===0&&r[1]===t[1]:i(r,t)===0}export{u as a,l as b};