@redocly/cli 2.54.2 → 2.54.3

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 (103) hide show
  1. package/THIRD_PARTY_NOTICES +1 -1
  2. package/lib/chunks/{LY6HM2BD.js → 2FXTKF3U.js} +1 -1
  3. package/lib/chunks/{EPBAZUU2.js → 3TYRUZAW.js} +4 -4
  4. package/lib/chunks/{ZRACBTMS.js → 4R5G4SNU.js} +1 -1
  5. package/lib/chunks/5OBAGRRJ.js +78 -0
  6. package/lib/chunks/{VQVISWBJ.js → 77KV43X2.js} +1 -1
  7. package/lib/chunks/B6JQC3AM.js +30 -0
  8. package/lib/chunks/{26SMEC4W.js → BABBSLVN.js} +1 -1
  9. package/lib/chunks/{M5WLF4GV.js → BZWFV3MX.js} +1 -1
  10. package/lib/chunks/{73UEREUT.js → DE4ZFTDG.js} +1 -1
  11. package/lib/chunks/{BV72RZCF.js → DFVJG4OO.js} +1 -1
  12. package/lib/chunks/{AQQVMAUF.js → FDI3NUCB.js} +1 -1
  13. package/lib/chunks/{T3U6D4C3.js → GKBR6HC7.js} +1 -1
  14. package/lib/chunks/GTBZLPVY.js +7 -0
  15. package/lib/chunks/{RBL3UMVK.js → HPJKQNL7.js} +1 -1
  16. package/lib/chunks/HYALAA3H.js +7 -0
  17. package/lib/chunks/{WCMZCZST.js → I44GHHET.js} +1 -1
  18. package/lib/chunks/K2PGWUA3.js +9 -0
  19. package/lib/chunks/{G5RGUPPT.js → KCRCWPLX.js} +3 -3
  20. package/lib/chunks/KPWZVETN.js +11 -0
  21. package/lib/chunks/{3UYF5CLP.js → KZPCQAG3.js} +1 -1
  22. package/lib/chunks/{QHPWFCD2.js → LFQ7H446.js} +1 -1
  23. package/lib/chunks/LWDUZ2W4.js +7 -0
  24. package/lib/chunks/{5KKTVK6L.js → NRAZJDJM.js} +1 -1
  25. package/lib/chunks/{ZIP2B7BB.js → NRCWSDXN.js} +1 -1
  26. package/lib/chunks/{AWIBN2J5.js → OA5XCUEZ.js} +1 -1
  27. package/lib/chunks/OJUJ2R6B.js +20 -0
  28. package/lib/chunks/{CWYADEAF.js → OW3COOIS.js} +1 -1
  29. package/lib/chunks/{LW5V3SVS.js → OYAP4QAE.js} +1 -1
  30. package/lib/chunks/{42DSSM4F.js → PZLKJXIF.js} +1 -1
  31. package/lib/chunks/{UUIZXPYS.js → PZTYMEH7.js} +1 -1
  32. package/lib/chunks/{42HL7XQH.js → SN3OGJPW.js} +1 -1
  33. package/lib/chunks/{BR3C2ZRO.js → TH4J5VUW.js} +33 -33
  34. package/lib/chunks/{ICLFVPDF.js → UJ6WQ2OD.js} +5 -7
  35. package/lib/chunks/UNBNSCWN.js +20 -0
  36. package/lib/chunks/{SZH6RAZB.js → XY2QUSMZ.js} +1 -1
  37. package/lib/chunks/{FSTHNUTZ.js → XZM2ITNF.js} +1 -1
  38. package/lib/chunks/{VUQEVFSD.js → Z2BI77LK.js} +1 -1
  39. package/lib/eject-assets/AGENTS.md +1 -0
  40. package/lib/eject-assets/generators/cli/docs.ts +1 -1
  41. package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
  42. package/lib/eject-assets/generators/cli/index.ts +2 -2
  43. package/lib/eject-assets/generators/cli/render.ts +3 -6
  44. package/lib/eject-assets/generators/go/client.ts +1 -1
  45. package/lib/eject-assets/generators/go/descriptor.ts +1 -1
  46. package/lib/eject-assets/generators/go/index.ts +2 -2
  47. package/lib/eject-assets/generators/go/models.ts +1 -1
  48. package/lib/eject-assets/generators/go/naming.ts +1 -1
  49. package/lib/eject-assets/generators/go/operations.ts +1 -1
  50. package/lib/eject-assets/generators/go/pagination.ts +1 -1
  51. package/lib/eject-assets/generators/go/types.ts +1 -1
  52. package/lib/eject-assets/generators/mock/faker.ts +1 -1
  53. package/lib/eject-assets/generators/mock/index.ts +2 -2
  54. package/lib/eject-assets/generators/mock/render.ts +1 -1
  55. package/lib/eject-assets/generators/mock/sample.ts +1 -1
  56. package/lib/eject-assets/generators/mock/values.ts +1 -1
  57. package/lib/eject-assets/generators/php/client.ts +1 -1
  58. package/lib/eject-assets/generators/php/descriptor.ts +1 -1
  59. package/lib/eject-assets/generators/php/index.ts +2 -2
  60. package/lib/eject-assets/generators/php/models.ts +1 -1
  61. package/lib/eject-assets/generators/php/naming.ts +1 -1
  62. package/lib/eject-assets/generators/php/operations.ts +1 -1
  63. package/lib/eject-assets/generators/php/pagination.ts +1 -1
  64. package/lib/eject-assets/generators/php/types.ts +1 -1
  65. package/lib/eject-assets/generators/python/client.ts +1 -1
  66. package/lib/eject-assets/generators/python/descriptor.ts +1 -1
  67. package/lib/eject-assets/generators/python/index.ts +2 -2
  68. package/lib/eject-assets/generators/python/models.ts +1 -1
  69. package/lib/eject-assets/generators/python/naming.ts +1 -1
  70. package/lib/eject-assets/generators/python/operations.ts +1 -1
  71. package/lib/eject-assets/generators/python/pagination.ts +1 -1
  72. package/lib/eject-assets/generators/python/types.ts +1 -1
  73. package/lib/eject-assets/generators/swr/index.ts +2 -2
  74. package/lib/eject-assets/generators/swr/render.ts +1 -1
  75. package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
  76. package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
  77. package/lib/eject-assets/generators/transformers/index.ts +2 -2
  78. package/lib/eject-assets/generators/transformers/render.ts +1 -1
  79. package/lib/eject-assets/generators/typescript/banner.ts +1 -1
  80. package/lib/eject-assets/generators/typescript/client.ts +1 -1
  81. package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
  82. package/lib/eject-assets/generators/typescript/index.ts +2 -2
  83. package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
  84. package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
  85. package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
  86. package/lib/eject-assets/generators/typescript/operations.ts +3 -5
  87. package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
  88. package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
  89. package/lib/eject-assets/generators/typescript/types.ts +1 -1
  90. package/lib/eject-assets/generators/zod/index.ts +2 -2
  91. package/lib/eject-assets/generators/zod/schemas.ts +1 -1
  92. package/lib/eject-assets/skills/client-generators/SKILL.md +1 -0
  93. package/lib/index.js +7 -7
  94. package/package.json +2 -2
  95. package/lib/chunks/4UWA75AV.js +0 -9
  96. package/lib/chunks/5H5SOEIM.js +0 -20
  97. package/lib/chunks/7GJ7DF3O.js +0 -20
  98. package/lib/chunks/7X6ZJPG4.js +0 -78
  99. package/lib/chunks/CGBDHCS4.js +0 -30
  100. package/lib/chunks/F645HTKX.js +0 -7
  101. package/lib/chunks/IWS3O2SM.js +0 -7
  102. package/lib/chunks/NSK6GPZU.js +0 -7
  103. package/lib/chunks/RSOM77DA.js +0 -11
@@ -618,7 +618,7 @@ Packages:
618
618
  semver@7.8.5 — Copyright (c) Isaac Z. Schlueter and Contributors
619
619
  which@2.0.2 — Copyright (c) Isaac Z. Schlueter and Contributors
620
620
  y18n@5.0.8 — Copyright (c) 2015, Contributors
621
- yaml@2.9.0 — Copyright Eemeli Aro <eemeli@gmail.com>
621
+ yaml@2.9.1 — Copyright Eemeli Aro <eemeli@gmail.com>
622
622
  yargs-parser@20.2.9 — Copyright (c) 2016, Contributors
623
623
  zod-to-json-schema@3.25.2 — Copyright (c) 2020, Stefan Terdell
624
624
 
@@ -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}from"./SZH6RAZB.js";import"./RSOM77DA.js";import"./BV72RZCF.js";import"./WZXA5XPB.js";import"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as zodGenerator};
7
+ import{a}from"./XY2QUSMZ.js";import"./KPWZVETN.js";import"./DFVJG4OO.js";import"./WZXA5XPB.js";import"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as zodGenerator};
@@ -4,17 +4,17 @@ 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}from"./2U6O26CV.js";import{b as B,c as j,d as N,e as V,f as Q,g as Z,h as Y}from"./RSOM77DA.js";import{a as H}from"./WZXA5XPB.js";import{a as F,b as T,c as C,d as P,e as W,g as _,h as M,i as A,j as z,k as K,l as U,n as J}from"./UW4UC7ZI.js";var G=C.go,S=class extends F{constructor(){super(" ")}typeName(t){return d(t)}memberName(t){return d(t)}identifier(t){return P(t,{style:"camel",reserved:G})}identifiers(t,n){let r=new Set(n??[]);return t.map(o=>{let s=d(o),a=s;for(let i=2;r.has(a);i++)a=`${s}${i}`;return r.add(a),a})}packageName(t){let n=t.toLowerCase().replace(/[^a-z0-9]/g,"");return n===""||/^[0-9]/.test(n)?"client":n}string(t){let n='"';for(let r of t){let o=r.codePointAt(0);r==="\\"?n+="\\\\":r==='"'?n+='\\"':r===`
7
+ import{a as O}from"./2U6O26CV.js";import{b as j,c as N,d as J,f as V,g as Q,h as Z,i as Y}from"./KPWZVETN.js";import{a as H}from"./WZXA5XPB.js";import{a as F,b as T,c as C,d as P,e as W,g as B,h as M,i as _,j as A,k as z,l as U,n as K}from"./UW4UC7ZI.js";var G=C.go,S=class extends F{constructor(){super(" ")}typeName(t){return d(t)}memberName(t){return d(t)}identifier(t){return P(t,{style:"camel",reserved:G})}identifiers(t,n){let r=new Set(n??[]);return t.map(o=>{let s=d(o),a=s;for(let i=2;r.has(a);i++)a=`${s}${i}`;return r.add(a),a})}packageName(t){let n=t.toLowerCase().replace(/[^a-z0-9]/g,"");return n===""||/^[0-9]/.test(n)?"client":n}string(t){let n='"';for(let r of t){let o=r.codePointAt(0);r==="\\"?n+="\\\\":r==='"'?n+='\\"':r===`
8
8
  `?n+="\\n":r==="\r"?n+="\\r":r===" "?n+="\\t":o<32||o===127?n+=`\\x${o.toString(16).padStart(2,"0")}`:o>=55296&&o<=57343?n+="\\uFFFD":n+=r}return n+'"'}literal(t){return t==null?"nil":typeof t=="boolean"||typeof t=="number"?String(t):typeof t=="string"?this.string(t):Array.isArray(t)?`[]any{${t.map(r=>this.literal(r)).join(", ")}}`:`map[string]any{${Object.entries(t).map(([r,o])=>`${this.string(r)}: ${this.literal(o)}`).join(", ")}}`}comment(t){for(let n of U(t))this.line(n===""?"//":`// ${n}`);return this}doc(t,n){let r=U(n);if(r.length===0)return this;this.line(`// ${t} \u2014 ${r[0]}`);let o=!1;for(let s of r.slice(1)){if(s===""){o||this.line("//"),o=!0;continue}this.line(`// ${s}`),o=!1}return this}layout(t){return ie(le(t))}toString(){return this.layout(super.toString())}};function d(e){let t=P(e,{style:"pascal",reserved:G});return t.startsWith("_")?`N${t.slice(1)}`:t}function ie(e){return`${e.replace(/\n{3,}/g,`
9
9
 
10
10
  `).trimEnd()}
11
11
  `}function le(e){let t=e.split(`
12
12
  `),n=[...t],r=/^(\t+)([A-Za-z_]\w*) (\S+)( `[^`]*`)?$/,o=/^(\t+)([A-Za-z_]\w*) (\S+) = (.+)$/,s=/^(\t+)("(?:[^"\\]|\\.)*":) (.+)$/,a=l=>{if(l.length<2)return;let m=[];for(let{parts:f}of l)f.forEach((g,b)=>{b<f.length-1&&(m[b]=Math.max(m[b]??0,g.length))});for(let{index:f,parts:g,indent:b}of l){let $=g.map((y,h)=>h<g.length-1?y.padEnd(m[h]??0):y);n[f]=b+$.join(" ").trimEnd()}},i=[],c;return t.forEach((l,m)=>{let f=s.exec(l),g=f===null?o.exec(l):null,b=f===null&&g===null?r.exec(l):null,$=b!==null&&!G.has(b[2])?b:null,y=f!==null?"entry":g!==null?"const":$!==null?"field":void 0;if((y===void 0||y!==c)&&(a(i),i=[],c=y),f!==null){i.push({index:m,indent:f[1],parts:[f[2],f[3]]});return}if(g!==null){i.push({index:m,indent:g[1],parts:[g[2],g[3],"=",g[4]]});return}if($!==null){let h=[$[2],$[3]];$[4]!==void 0&&h.push($[4].trimStart()),i.push({index:m,indent:$[1],parts:h})}}),a(i),n.join(`
13
- `)}var u=new S,w=C.go;function X(e){if(e===void 0)return"client";if(!/^[a-z_][a-z0-9_]*$/.test(e)||w.has(e))throw new H(`goPackage "${e}" is not a valid Go package name: use lowercase letters, digits, and underscores, don't start with a digit, and avoid Go keywords.`);return e}function v(e){let t=new Set,n=[];for(let r of e.services)for(let o of r.operations){let s=d(o.name),a=2;for(;t.has(s);)s=`${d(o.name)}${a++}`;t.add(s),n.push({op:o,ident:s})}return n}function ce(e){return Q(e).map(n=>n.kind==="literal"?u.string(n.value):P(n.name,{style:"camel",reserved:w})).join(" + ")}function ee(e,t){let n=t.servers??[];if(n.length===0)return;let r=new Set;n.forEach((o,s)=>{let a=`${d(o.description??`server${s+1}`)}URL`;r.has(a)&&(a=`${a}${s+1}`),r.add(a);let i=o.variables.map(l=>`${P(l.name,{style:"camel",reserved:w})} string`),c=o.variables.map(l=>`${P(l.name,{style:"camel",reserved:w})} default: ${u.string(l.default)}`).join(", ");e.line(`// ${a} returns the ${u.string(o.description??o.url)} base URL${c===""?".":` (${c}).`}`),e.block(`func ${a}(${i.join(", ")}) string {`,()=>{e.line(`return ${ce(o)}`)},"}"),e.blank()})}function ne(e,t){let n=Z(e,t).map(r=>r.map(o=>o.kind==="apiKey"?`{Scheme: ${u.string(o.scheme)}, Kind: "apiKey", Name: ${u.string(o.name)}, In: ${u.string(o.in)}}`:`{Scheme: ${u.string(o.scheme)}, Kind: ${u.string(o.kind)}}`));if(n.length!==0)return`[][]SecuritySpec{${n.map(r=>`{${r.join(", ")}}`).join(", ")}}`}function te(e){return`&PaginationSpec{${[`Style: ${u.string(e.style)}`,...e.param!==void 0?[`Param: ${u.string(e.param)}`]:[],...e.nextCursor!==void 0?[`NextCursor: ${u.string(e.nextCursor)}`]:[],...e.hasMore!==void 0?[`HasMore: ${u.string(e.hasMore)}`]:[],...e.limitParam!==void 0?[`LimitParam: ${u.string(e.limitParam)}`]:[],...e.items!==void 0?[`Items: ${u.string(e.items)}`]:[]].join(", ")}}`}function p(e,t="string"){if(A(e)){let n=p(z(e),t);return n.startsWith("*")||n==="any"?n:`*${n}`}switch(e.kind){case"scalar":if(t==="Date"&&e.scalar==="string"){if(e.metadata?.format==="date-time")return"time.Time";if(e.metadata?.format==="date")return"Date"}return{string:"string",integer:"int64",number:"float64",boolean:"bool"}[e.scalar];case"array":return`[]${p(e.items,t)}`;case"record":return`map[string]${p(e.value,t)}`;case"ref":return d(e.name);case"literal":return typeof e.value=="string"?"string":typeof e.value=="boolean"?"bool":"float64";case"enum":return{string:"string",integer:"int64",number:"float64",boolean:"bool"}[e.scalar];case"omit":return d(e.base);case"union":case"null":case"object":case"intersection":case"unknown":return"any"}}function ue(e,t,n,r,o){e.doc(d(t),o),e.block(`type ${d(t)} struct {`,()=>{for(let s of n){let a=d(s.name),i=p(s.schema,r),c=`\`json:"${s.name}"\``;s.required||(!i.startsWith("*")&&!i.startsWith("[]")&&!i.startsWith("map[")&&i!=="any"&&(i=`*${i}`),c=`\`json:"${s.name},omitempty"\``),e.line(`${a} ${i} ${c}`)}},"}"),e.blank()}function L(e,t="string"){let n=new S;n.line("package client"),n.blank(),e.schemas.some(({schema:s})=>M(s,e)!==void 0)&&(n.line('import "encoding/json"'),n.blank());let o=fe(e,t);return t==="Date"&&o.includes("time.Time")&&(n.line('import "time"'),n.blank()),n.line(o),n.toString()}function fe(e,t){let n=new S;for(let{name:r,schema:o}of e.schemas){let s=K(o);if(s!==void 0){let i=s.scalar==="string"?"string":"int64";n.doc(d(r),o.description),n.line(`type ${d(r)} ${i}`),n.blank(),n.block("const (",()=>{let c=new Set;s.values.forEach(l=>{let m=T.pascal(String(l))||"Value",f="";for(let b=2;c.has(m+f);b++)f=String(b);c.add(m+f);let g=d(r)+m+f;n.line(`${g} ${d(r)} = ${u.literal(l)}`)})},")"),n.blank();continue}if(o.kind==="object"||o.kind==="intersection"){let i=_(o,e);if(i!==void 0){ue(n,r,i.properties,t,i.description??o.description);continue}}let a=M(o,e);if(a!==void 0){let i=d(r),c=a.cases.map(l=>`${l.value} -> ${d(l.schemaName)}`).join(", ");n.line(`// ${i} is a discriminated union ("${a.property}"): ${c}.`),n.line(`type ${i} = any`),n.blank(),n.line(`// Unmarshal${i} decodes into the member selected by "${a.property}".`),n.block(`func Unmarshal${i}(data []byte) (${i}, error) {`,()=>{n.block("var probe struct {",()=>{n.line(`Discriminant string \`json:"${a.property}"\``)},"}"),n.block("if err := json.Unmarshal(data, &probe); err != nil {",()=>{n.line("return nil, err")},"}"),n.line("switch probe.Discriminant {");for(let l of a.cases)n.block(`case ${u.string(l.value)}:`,()=>{n.line(`var value ${d(l.schemaName)}`),n.line("err := json.Unmarshal(data, &value)"),n.line("return value, err")});n.line("}"),n.line("var fallback any"),n.line("err := json.Unmarshal(data, &fallback)"),n.line("return fallback, err")},"}"),n.blank();continue}n.doc(d(r),o.description),n.line(`type ${d(r)} = ${p(o,t)}`),n.blank()}return n.toString()}function R(e,t){if(t==="string")return e;let n=e.startsWith("*")?`(${e})`:e;return t==="time.Time"?`${n}.Format(time.RFC3339)`:t==="Date"?`${n}.Format("2006-01-02")`:t==="int64"?`strconv.FormatInt(${e}, 10)`:t==="float64"?`strconv.FormatFloat(${e}, 'f', -1, 64)`:t==="bool"?`strconv.FormatBool(${e})`:`fmt.Sprint(${e})`}var de=["c","ctx","body","params","out","op"];function I(e,t){let n=W(e.pathParams.map(r=>r.name),{style:"camel",reserved:w,taken:de});return e.pathParams.map((r,o)=>({param:r,go:n[o],type:p(r.schema,t)}))}function me(e,t){let n=new Set;return(e.successResponseHeaders??[]).map(r=>{let o=d(r.name),s=o,a=2;for(;n.has(s);)s=`${o}${a++}`;n.add(s);let i=J(r.schema,t),c={integer:{goType:"*int64",helper:"headerInt64"},number:{goType:"*float64",helper:"headerFloat64"},boolean:{goType:"*bool",helper:"headerBool"},string:{goType:"*string",helper:"headerString"}}[i];return{field:s,name:r.name,...c}})}function E(e,t,n,r,o,s=!1){let a=I(t,r),i=t.queryParams.length>0,c=j(t),l=c===void 0?void 0:p(c,r),m=s?me(t,o):[];s&&(e.line(`// ${n}Headers carries the declared response headers of ${n}WithHeaders (nil when absent or unparsable).`),e.block(`type ${n}Headers struct {`,()=>{for(let h of m)e.line(`${h.field} ${h.goType}`)},"}"),e.blank());let f=["ctx context.Context",...a.map(({go:h,type:x})=>`${h} ${x}`),...t.requestBody?[`body ${p(t.requestBody.schema,r)}`]:[],...i?[`params *${n}Params`]:[]],g=N(t),b=s?l===void 0?`(${n}Headers, error)`:`(${l}, ${n}Headers, error)`:g!==void 0?"func(yield func(ServerSentEvent, error) bool)":l===void 0?"error":`(${l}, error)`,$=h=>s?l===void 0?`return headers, ${h}`:`return out, headers, ${h}`:l===void 0?`return ${h}`:`return out, ${h}`,y=s?`${n}WithHeaders`:n;e.doc(y,s?`Like ${n}, also returning the declared response headers.`:t.summary),e.block(`func (c *Client) ${y}(${f.join(", ")}) ${b} {`,()=>{g===void 0&&l!==void 0&&e.line(`var out ${l}`),s&&e.line(`var headers ${n}Headers`),e.line(`op := operations[${u.string(t.specName??t.name)}]`),e.line("authHeaders, query := resolveAuth(op.Security, c.config.Auth)"),i&&e.block("if params != nil {",()=>{for(let k of t.queryParams){let q=d(k.name);e.block(`if params.${q} != nil {`,()=>{if(k.schema.kind==="array"){let D=p(k.schema.items,r);e.block(`for _, item := range *params.${q} {`,()=>{e.line(`query.Add(${u.string(k.name)}, ${R("item",D)})`)},"}")}else e.line(`query.Set(${u.string(k.name)}, ${R(`*params.${q}`,p(k.schema,r))})`)},"}")}},"}");let h=a.map(({param:k,go:q,type:D})=>`${u.string(k.name)}: ${R(q,D)}`).join(", ");if(e.line(`requestURL := buildURL(c.config.ServerURL, op.Path, map[string]string{${h}})`),g!==void 0){e.block("open := func(extraHeaders map[string]string) (*http.Response, error) {",()=>{e.line("merged := map[string]string{}"),e.block("for key, value := range authHeaders {",()=>{e.line("merged[key] = value")},"}"),e.block("for key, value := range extraHeaders {",()=>{e.line("merged[key] = value")},"}"),e.line("return send(ctx, &c.config, requestSpec{OperationID: op.ID, Method: op.Method, URL: requestURL, Headers: merged, Query: query})")},"}"),e.line(`return iterSSE(open, ${g.schema!==void 0&&g.schema.kind!=="unknown"})`);return}let x=["OperationID: op.ID","Method: op.Method","URL: requestURL","Headers: authHeaders","Query: query"];if(t.requestBody&&V(t)?(e.line("contentType, reader, err := toMultipart(body)"),e.block("if err != nil {",()=>{e.line($("err"))},"}"),x.push("Body: reader"),x.push("ContentType: contentType")):t.requestBody&&(e.line("payload, err := json.Marshal(body)"),e.block("if err != nil {",()=>{e.line($("err"))},"}"),x.push("Body: bytes.NewReader(payload)"),x.push(`ContentType: ${u.string(t.requestBody.contentType)}`)),e.line(`resp, err := send(ctx, &c.config, requestSpec{${x.join(", ")}})`),e.block("if err != nil {",()=>{e.line($("err"))},"}"),e.block("if resp.StatusCode >= 400 {",()=>{e.line($("apiErrorFrom(resp, requestURL)"))},"}"),s){e.block(`if err := decodeJSON(resp, ${l===void 0?"nil":"&out"}); err != nil {`,()=>{e.line($("err"))},"}");for(let k of m)e.line(`headers.${k.field} = ${k.helper}(resp.Header, ${u.string(k.name)})`);e.line(l===void 0?"return headers, nil":"return out, headers, nil")}else l===void 0?e.line("return decodeJSON(resp, nil)"):(e.block("if err := decodeJSON(resp, &out); err != nil {",()=>{e.line("return out, err")},"}"),e.line("return out, nil"))},"}"),e.blank()}function re(e,t,n,r,o,s){let a=I(t,r),i=t.queryParams.length>0,c=["ctx context.Context",...a.map(({go:m,type:f})=>`${m} ${f}`),...i?[`params *${n}Params`]:[]].join(", "),l=()=>{e.line(`op := operations[${u.string(t.specName??t.name)}]`),e.line("base := url.Values{}"),i&&e.block("if params != nil {",()=>{for(let m of t.queryParams){let f=d(m.name);e.block(`if params.${f} != nil {`,()=>{e.line(`base.Set(${u.string(m.name)}, ${R(`*params.${f}`,p(m.schema,r))})`)},"}")}},"}"),e.block("call := func(pageParams url.Values) (any, *http.Response, error) {",()=>{e.line("authHeaders, query := resolveAuth(op.Security, c.config.Auth)"),e.block("for key, values := range pageParams {",()=>{e.block("for _, value := range values {",()=>{e.line("query.Set(key, value)")},"}")},"}");let m=a.map(({param:f,go:g,type:b})=>`${u.string(f.name)}: ${R(g,b)}`).join(", ");e.line(`requestURL := buildURL(c.config.ServerURL, op.Path, map[string]string{${m}})`),e.line("resp, err := send(ctx, &c.config, requestSpec{OperationID: op.ID, Method: op.Method, URL: requestURL, Headers: authHeaders, Query: query})"),e.block("if err != nil {",()=>{e.line("return nil, nil, err")},"}"),e.block("if resp.StatusCode >= 400 {",()=>{e.line("return nil, resp, apiErrorFrom(resp, requestURL)")},"}"),e.line("var raw any"),e.block("if err := decodeJSON(resp, &raw); err != nil {",()=>{e.line("return nil, resp, err")},"}"),e.line("return raw, resp, nil")},"}"),e.line("pages := iterPages(call, *op.Pagination, base)")};e.line(`// ${n}Pages iterates ${n} response pages; use with \`for page, err := range\`.`),e.block(`func (c *Client) ${n}Pages(${c}) func(yield func(${o}, error) bool) {`,()=>{l(),e.block(`return func(yield func(${o}, error) bool) {`,()=>{e.block("pages(func(raw any, err error) bool {",()=>{e.line(`var page ${o}`),e.block("if err == nil {",()=>{e.line("err = reencode(raw, &page)")},"}"),e.line("return yield(page, err)")},"})")},"}")},"}"),e.blank(),e.line(`// ${n}Items iterates the items of every ${n} page.`),e.block(`func (c *Client) ${n}Items(${c}) func(yield func(${s}, error) bool) {`,()=>{l(),e.block(`return func(yield func(${s}, error) bool) {`,()=>{e.block("pages(func(raw any, err error) bool {",()=>{e.block("if err != nil {",()=>{e.line(`var zero ${s}`),e.line("return yield(zero, err)")},"}"),e.line("pageItems, _ := resolvePointer(raw, op.Pagination.Items).([]any)"),e.block("for _, item := range pageItems {",()=>{e.line(`var typed ${s}`),e.block("if err := reencode(item, &typed); err != nil {",()=>{e.line("return yield(typed, err)")},"}"),e.block("if !yield(typed, nil) {",()=>{e.line("return false")},"}")},"}"),e.line("return true")},"})")},"}")},"}"),e.blank()}function oe(e){let t=e.split(`
13
+ `)}var u=new S,w=C.go;function X(e){if(e===void 0)return"client";if(!/^[a-z_][a-z0-9_]*$/.test(e)||w.has(e))throw new H(`goPackage "${e}" is not a valid Go package name: use lowercase letters, digits, and underscores, don't start with a digit, and avoid Go keywords.`);return e}function v(e){let t=new Set,n=[];for(let r of e.services)for(let o of r.operations){let s=d(o.name),a=2;for(;t.has(s);)s=`${d(o.name)}${a++}`;t.add(s),n.push({op:o,ident:s})}return n}function ce(e){return V(e).map(n=>n.kind==="literal"?u.string(n.value):P(n.name,{style:"camel",reserved:w})).join(" + ")}function ee(e,t){let n=t.servers??[];if(n.length===0)return;let r=new Set;n.forEach((o,s)=>{let a=`${d(o.description??`server${s+1}`)}URL`;r.has(a)&&(a=`${a}${s+1}`),r.add(a);let i=o.variables.map(l=>`${P(l.name,{style:"camel",reserved:w})} string`),c=o.variables.map(l=>`${P(l.name,{style:"camel",reserved:w})} default: ${u.string(l.default)}`).join(", ");e.line(`// ${a} returns the ${u.string(o.description??o.url)} base URL${c===""?".":` (${c}).`}`),e.block(`func ${a}(${i.join(", ")}) string {`,()=>{e.line(`return ${ce(o)}`)},"}"),e.blank()})}function ne(e,t){let n=Q(e,t).map(r=>r.map(o=>o.kind==="apiKey"?`{Scheme: ${u.string(o.scheme)}, Kind: "apiKey", Name: ${u.string(o.name)}, In: ${u.string(o.in)}}`:`{Scheme: ${u.string(o.scheme)}, Kind: ${u.string(o.kind)}}`));if(n.length!==0)return`[][]SecuritySpec{${n.map(r=>`{${r.join(", ")}}`).join(", ")}}`}function te(e){return`&PaginationSpec{${[`Style: ${u.string(e.style)}`,...e.param!==void 0?[`Param: ${u.string(e.param)}`]:[],...e.nextCursor!==void 0?[`NextCursor: ${u.string(e.nextCursor)}`]:[],...e.hasMore!==void 0?[`HasMore: ${u.string(e.hasMore)}`]:[],...e.limitParam!==void 0?[`LimitParam: ${u.string(e.limitParam)}`]:[],...e.items!==void 0?[`Items: ${u.string(e.items)}`]:[]].join(", ")}}`}function p(e,t="string"){if(_(e)){let n=p(A(e),t);return n.startsWith("*")||n==="any"?n:`*${n}`}switch(e.kind){case"scalar":if(t==="Date"&&e.scalar==="string"){if(e.metadata?.format==="date-time")return"time.Time";if(e.metadata?.format==="date")return"Date"}return{string:"string",integer:"int64",number:"float64",boolean:"bool"}[e.scalar];case"array":return`[]${p(e.items,t)}`;case"record":return`map[string]${p(e.value,t)}`;case"ref":return d(e.name);case"literal":return typeof e.value=="string"?"string":typeof e.value=="boolean"?"bool":"float64";case"enum":return{string:"string",integer:"int64",number:"float64",boolean:"bool"}[e.scalar];case"omit":return d(e.base);case"union":case"null":case"object":case"intersection":case"unknown":return"any"}}function ue(e,t,n,r,o){e.doc(d(t),o),e.block(`type ${d(t)} struct {`,()=>{for(let s of n){let a=d(s.name),i=p(s.schema,r),c=`\`json:"${s.name}"\``;s.required||(!i.startsWith("*")&&!i.startsWith("[]")&&!i.startsWith("map[")&&i!=="any"&&(i=`*${i}`),c=`\`json:"${s.name},omitempty"\``),e.line(`${a} ${i} ${c}`)}},"}"),e.blank()}function L(e,t="string"){let n=new S;n.line("package client"),n.blank(),e.schemas.some(({schema:s})=>M(s,e)!==void 0)&&(n.line('import "encoding/json"'),n.blank());let o=fe(e,t);return t==="Date"&&o.includes("time.Time")&&(n.line('import "time"'),n.blank()),n.line(o),n.toString()}function fe(e,t){let n=new S;for(let{name:r,schema:o}of e.schemas){let s=z(o);if(s!==void 0){let i=s.scalar==="string"?"string":"int64";n.doc(d(r),o.description),n.line(`type ${d(r)} ${i}`),n.blank(),n.block("const (",()=>{let c=new Set;s.values.forEach(l=>{let m=T.pascal(String(l))||"Value",f="";for(let b=2;c.has(m+f);b++)f=String(b);c.add(m+f);let g=d(r)+m+f;n.line(`${g} ${d(r)} = ${u.literal(l)}`)})},")"),n.blank();continue}if(o.kind==="object"||o.kind==="intersection"){let i=B(o,e);if(i!==void 0){ue(n,r,i.properties,t,i.description??o.description);continue}}let a=M(o,e);if(a!==void 0){let i=d(r),c=a.cases.map(l=>`${l.value} -> ${d(l.schemaName)}`).join(", ");n.line(`// ${i} is a discriminated union ("${a.property}"): ${c}.`),n.line(`type ${i} = any`),n.blank(),n.line(`// Unmarshal${i} decodes into the member selected by "${a.property}".`),n.block(`func Unmarshal${i}(data []byte) (${i}, error) {`,()=>{n.block("var probe struct {",()=>{n.line(`Discriminant string \`json:"${a.property}"\``)},"}"),n.block("if err := json.Unmarshal(data, &probe); err != nil {",()=>{n.line("return nil, err")},"}"),n.line("switch probe.Discriminant {");for(let l of a.cases)n.block(`case ${u.string(l.value)}:`,()=>{n.line(`var value ${d(l.schemaName)}`),n.line("err := json.Unmarshal(data, &value)"),n.line("return value, err")});n.line("}"),n.line("var fallback any"),n.line("err := json.Unmarshal(data, &fallback)"),n.line("return fallback, err")},"}"),n.blank();continue}n.doc(d(r),o.description),n.line(`type ${d(r)} = ${p(o,t)}`),n.blank()}return n.toString()}function R(e,t){if(t==="string")return e;let n=e.startsWith("*")?`(${e})`:e;return t==="time.Time"?`${n}.Format(time.RFC3339)`:t==="Date"?`${n}.Format("2006-01-02")`:t==="int64"?`strconv.FormatInt(${e}, 10)`:t==="float64"?`strconv.FormatFloat(${e}, 'f', -1, 64)`:t==="bool"?`strconv.FormatBool(${e})`:`fmt.Sprint(${e})`}var de=["c","ctx","body","params","out","op"];function I(e,t){let n=W(e.pathParams.map(r=>r.name),{style:"camel",reserved:w,taken:de});return e.pathParams.map((r,o)=>({param:r,go:n[o],type:p(r.schema,t)}))}function me(e,t){let n=new Set;return(e.successResponseHeaders??[]).map(r=>{let o=d(r.name),s=o,a=2;for(;n.has(s);)s=`${o}${a++}`;n.add(s);let i=K(r.schema,t),c={integer:{goType:"*int64",helper:"headerInt64"},number:{goType:"*float64",helper:"headerFloat64"},boolean:{goType:"*bool",helper:"headerBool"},string:{goType:"*string",helper:"headerString"}}[i];return{field:s,name:r.name,...c}})}function E(e,t,n,r,o,s=!1){let a=I(t,r),i=t.queryParams.length>0,c=j(t),l=c===void 0?void 0:p(c,r),m=s?me(t,o):[];s&&(e.line(`// ${n}Headers carries the declared response headers of ${n}WithHeaders (nil when absent or unparsable).`),e.block(`type ${n}Headers struct {`,()=>{for(let h of m)e.line(`${h.field} ${h.goType}`)},"}"),e.blank());let f=["ctx context.Context",...a.map(({go:h,type:x})=>`${h} ${x}`),...t.requestBody?[`body ${p(t.requestBody.schema,r)}`]:[],...i?[`params *${n}Params`]:[]],g=N(t),b=s?l===void 0?`(${n}Headers, error)`:`(${l}, ${n}Headers, error)`:g!==void 0?"func(yield func(ServerSentEvent, error) bool)":l===void 0?"error":`(${l}, error)`,$=h=>s?l===void 0?`return headers, ${h}`:`return out, headers, ${h}`:l===void 0?`return ${h}`:`return out, ${h}`,y=s?`${n}WithHeaders`:n;e.doc(y,s?`Like ${n}, also returning the declared response headers.`:t.summary),e.block(`func (c *Client) ${y}(${f.join(", ")}) ${b} {`,()=>{g===void 0&&l!==void 0&&e.line(`var out ${l}`),s&&e.line(`var headers ${n}Headers`),e.line(`op := operations[${u.string(t.specName??t.name)}]`),e.line("authHeaders, query := resolveAuth(op.Security, c.config.Auth)"),i&&e.block("if params != nil {",()=>{for(let k of t.queryParams){let q=d(k.name);e.block(`if params.${q} != nil {`,()=>{if(k.schema.kind==="array"){let D=p(k.schema.items,r);e.block(`for _, item := range *params.${q} {`,()=>{e.line(`query.Add(${u.string(k.name)}, ${R("item",D)})`)},"}")}else e.line(`query.Set(${u.string(k.name)}, ${R(`*params.${q}`,p(k.schema,r))})`)},"}")}},"}");let h=a.map(({param:k,go:q,type:D})=>`${u.string(k.name)}: ${R(q,D)}`).join(", ");if(e.line(`requestURL := buildURL(c.config.ServerURL, op.Path, map[string]string{${h}})`),g!==void 0){e.block("open := func(extraHeaders map[string]string) (*http.Response, error) {",()=>{e.line("merged := map[string]string{}"),e.block("for key, value := range authHeaders {",()=>{e.line("merged[key] = value")},"}"),e.block("for key, value := range extraHeaders {",()=>{e.line("merged[key] = value")},"}"),e.line("return send(ctx, &c.config, requestSpec{OperationID: op.ID, Method: op.Method, URL: requestURL, Headers: merged, Query: query})")},"}"),e.line(`return iterSSE(open, ${g.schema!==void 0&&g.schema.kind!=="unknown"})`);return}let x=["OperationID: op.ID","Method: op.Method","URL: requestURL","Headers: authHeaders","Query: query"];if(t.requestBody&&J(t)?(e.line("contentType, reader, err := toMultipart(body)"),e.block("if err != nil {",()=>{e.line($("err"))},"}"),x.push("Body: reader"),x.push("ContentType: contentType")):t.requestBody&&(e.line("payload, err := json.Marshal(body)"),e.block("if err != nil {",()=>{e.line($("err"))},"}"),x.push("Body: bytes.NewReader(payload)"),x.push(`ContentType: ${u.string(t.requestBody.contentType)}`)),e.line(`resp, err := send(ctx, &c.config, requestSpec{${x.join(", ")}})`),e.block("if err != nil {",()=>{e.line($("err"))},"}"),e.block("if resp.StatusCode >= 400 {",()=>{e.line($("apiErrorFrom(resp, requestURL)"))},"}"),s){e.block(`if err := decodeJSON(resp, ${l===void 0?"nil":"&out"}); err != nil {`,()=>{e.line($("err"))},"}");for(let k of m)e.line(`headers.${k.field} = ${k.helper}(resp.Header, ${u.string(k.name)})`);e.line(l===void 0?"return headers, nil":"return out, headers, nil")}else l===void 0?e.line("return decodeJSON(resp, nil)"):(e.block("if err := decodeJSON(resp, &out); err != nil {",()=>{e.line("return out, err")},"}"),e.line("return out, nil"))},"}"),e.blank()}function re(e,t,n,r,o,s){let a=I(t,r),i=t.queryParams.length>0,c=["ctx context.Context",...a.map(({go:m,type:f})=>`${m} ${f}`),...i?[`params *${n}Params`]:[]].join(", "),l=()=>{e.line(`op := operations[${u.string(t.specName??t.name)}]`),e.line("base := url.Values{}"),i&&e.block("if params != nil {",()=>{for(let m of t.queryParams){let f=d(m.name);e.block(`if params.${f} != nil {`,()=>{e.line(`base.Set(${u.string(m.name)}, ${R(`*params.${f}`,p(m.schema,r))})`)},"}")}},"}"),e.block("call := func(pageParams url.Values) (any, *http.Response, error) {",()=>{e.line("authHeaders, query := resolveAuth(op.Security, c.config.Auth)"),e.block("for key, values := range pageParams {",()=>{e.block("for _, value := range values {",()=>{e.line("query.Set(key, value)")},"}")},"}");let m=a.map(({param:f,go:g,type:b})=>`${u.string(f.name)}: ${R(g,b)}`).join(", ");e.line(`requestURL := buildURL(c.config.ServerURL, op.Path, map[string]string{${m}})`),e.line("resp, err := send(ctx, &c.config, requestSpec{OperationID: op.ID, Method: op.Method, URL: requestURL, Headers: authHeaders, Query: query})"),e.block("if err != nil {",()=>{e.line("return nil, nil, err")},"}"),e.block("if resp.StatusCode >= 400 {",()=>{e.line("return nil, resp, apiErrorFrom(resp, requestURL)")},"}"),e.line("var raw any"),e.block("if err := decodeJSON(resp, &raw); err != nil {",()=>{e.line("return nil, resp, err")},"}"),e.line("return raw, resp, nil")},"}"),e.line("pages := iterPages(call, *op.Pagination, base)")};e.line(`// ${n}Pages iterates ${n} response pages; use with \`for page, err := range\`.`),e.block(`func (c *Client) ${n}Pages(${c}) func(yield func(${o}, error) bool) {`,()=>{l(),e.block(`return func(yield func(${o}, error) bool) {`,()=>{e.block("pages(func(raw any, err error) bool {",()=>{e.line(`var page ${o}`),e.block("if err == nil {",()=>{e.line("err = reencode(raw, &page)")},"}"),e.line("return yield(page, err)")},"})")},"}")},"}"),e.blank(),e.line(`// ${n}Items iterates the items of every ${n} page.`),e.block(`func (c *Client) ${n}Items(${c}) func(yield func(${s}, error) bool) {`,()=>{l(),e.block(`return func(yield func(${s}, error) bool) {`,()=>{e.block("pages(func(raw any, err error) bool {",()=>{e.block("if err != nil {",()=>{e.line(`var zero ${s}`),e.line("return yield(zero, err)")},"}"),e.line("pageItems, _ := resolvePointer(raw, op.Pagination.Items).([]any)"),e.block("for _, item := range pageItems {",()=>{e.line(`var typed ${s}`),e.block("if err := reencode(item, &typed); err != nil {",()=>{e.line("return yield(typed, err)")},"}"),e.block("if !yield(typed, nil) {",()=>{e.line("return false")},"}")},"}"),e.line("return true")},"})")},"}")},"}"),e.blank()}function oe(e){let t=e.split(`
14
14
  `),n=[],r=!1;for(let o of t)if(!o.startsWith("package ")){if(o.startsWith("import (")){r=!0;continue}if(r){o.startsWith(")")&&(r=!1);continue}o.startsWith("import ")||n.push(o)}return n.join(`
15
- `).trim()}var se=["bytes","context","encoding/base64","encoding/json","errors","fmt","io","math/rand","mime/multipart","net/http","net/url","strconv","strings","time"];function ae(e,t,n,r,o,s){e.line(oe(L(t,r))),e.blank(),ee(e,t),s&&(e.line("// \u2500\u2500\u2500 Embedded runtime (@redocly/client-generator go runtime) \u2500\u2500\u2500"),e.line(oe(O)),e.blank()),e.block("type operationMeta struct {",()=>{e.line("ID string"),e.line("Method string"),e.line("Path string"),e.line("Security [][]SecuritySpec"),e.line("Pagination *PaginationSpec")},"}"),e.blank(),e.block("var operations = map[string]operationMeta{",()=>{for(let{op:a,ident:i}of v(t)){let c=a.specName??a.name,l=ne(a,t),m=o.get(i),f=[`ID: ${u.string(c)}`,`Method: ${u.string(a.method.toUpperCase())}`,`Path: ${u.string(a.path)}`,...l!==void 0?[`Security: ${l}`]:[],...m!==void 0?[`Pagination: ${te(m)}`]:[]];e.line(`${u.string(c)}: {${f.join(", ")}},`)}},"}"),e.blank();for(let{op:a,ident:i}of v(t))a.queryParams.length!==0&&(e.block(`type ${i}Params struct {`,()=>{for(let c of a.queryParams){let l=p(c.schema,r);e.line(`${d(c.name)} ${l.startsWith("*")?l:`*${l}`}`)}},"}"),e.blank());e.doc("Client",`Client for ${t.title} (${t.version}).`),e.block("type Client struct {",()=>{e.line("config Config")},"}"),e.blank(),e.block("func New(config Config) *Client {",()=>{e.block('if config.ServerURL == "" {',()=>{e.line(`config.ServerURL = ${u.string(n.serverUrl??t.serverUrl??"")}`)},"}"),e.line("return &Client{config: config}")},"}"),e.blank();for(let{op:a,ident:i}of v(t)){E(e,a,i,r),N(a)===void 0&&(a.successResponseHeaders?.length??0)>0&&E(e,a,i,r,t,!0);let c=o.get(i);if(c===void 0)continue;let l=j(a),m=l===void 0?"any":p(l,r),f=Y(l,c.items,t);re(e,a,i,r,m,f===void 0?"any":p(f,r))}}var rn=({model:e,output:t,banner:n,emit:r,pagination:o})=>{let s=new S,a=r.dateType??"string",i=X(r.goPackage),c=new Map;for(let{op:$,ident:y}of v(e)){let h=o?.get($.name)?.spec;h!==void 0&&c.set(y,h)}s.line(`// Code generated by @redocly/client-generator (go) from "${e.title}" ${e.version}. DO NOT EDIT.`),s.line("// Regenerate with `redocly generate-client`. Standard library only \u2014 zero dependencies."),s.line(`package ${i}`),s.blank();let l=r.runtime!=="module",m=l?se:(()=>{let $=new S;ae($,e,r,a,c,!1);let y=$.toString();return se.filter(h=>new RegExp(`\\b${h.split("/").pop()}\\.`).test(y))})();s.block("import (",()=>{for(let $ of m)s.line(u.string($))},")"),s.blank(),ae(s,e,r,a,c,l);let f={path:t.path.replace(/\.[^.\\/]+$/,".go"),content:s.toString()};if(l)return[f];let g=n.map($=>`// ${$}`).join(`
15
+ `).trim()}var se=["bytes","context","encoding/base64","encoding/json","errors","fmt","io","math/rand","mime/multipart","net/http","net/url","strconv","strings","time"];function ae(e,t,n,r,o,s){e.line(oe(L(t,r))),e.blank(),ee(e,t),s&&(e.line("// \u2500\u2500\u2500 Embedded runtime (@redocly/client-generator go runtime) \u2500\u2500\u2500"),e.line(oe(O)),e.blank()),e.block("type operationMeta struct {",()=>{e.line("ID string"),e.line("Method string"),e.line("Path string"),e.line("Security [][]SecuritySpec"),e.line("Pagination *PaginationSpec")},"}"),e.blank(),e.block("var operations = map[string]operationMeta{",()=>{for(let{op:a,ident:i}of v(t)){let c=a.specName??a.name,l=ne(a,t),m=o.get(i),f=[`ID: ${u.string(c)}`,`Method: ${u.string(a.method.toUpperCase())}`,`Path: ${u.string(a.path)}`,...l!==void 0?[`Security: ${l}`]:[],...m!==void 0?[`Pagination: ${te(m)}`]:[]];e.line(`${u.string(c)}: {${f.join(", ")}},`)}},"}"),e.blank();for(let{op:a,ident:i}of v(t))a.queryParams.length!==0&&(e.block(`type ${i}Params struct {`,()=>{for(let c of a.queryParams){let l=p(c.schema,r);e.line(`${d(c.name)} ${l.startsWith("*")?l:`*${l}`}`)}},"}"),e.blank());e.doc("Client",`Client for ${t.title} (${t.version}).`),e.block("type Client struct {",()=>{e.line("config Config")},"}"),e.blank(),e.block("func New(config Config) *Client {",()=>{e.block('if config.ServerURL == "" {',()=>{e.line(`config.ServerURL = ${u.string(n.serverUrl??t.serverUrl??"")}`)},"}"),e.line("return &Client{config: config}")},"}"),e.blank();for(let{op:a,ident:i}of v(t)){E(e,a,i,r),N(a)===void 0&&(a.successResponseHeaders?.length??0)>0&&E(e,a,i,r,t,!0);let c=o.get(i);if(c===void 0)continue;let l=j(a),m=l===void 0?"any":p(l,r),f=Z(l,c.items,t);re(e,a,i,r,m,f===void 0?"any":p(f,r))}}var rn=({model:e,output:t,banner:n,emit:r,pagination:o})=>{let s=new S,a=r.dateType??"string",i=X(r.goPackage),c=new Map;for(let{op:$,ident:y}of v(e)){let h=o?.get($.name)?.spec;h!==void 0&&c.set(y,h)}s.line(`// Code generated by @redocly/client-generator (go) from "${e.title}" ${e.version}. DO NOT EDIT.`),s.line("// Regenerate with `redocly generate-client`. Standard library only \u2014 zero dependencies."),s.line(`package ${i}`),s.blank();let l=r.runtime!=="module",m=l?se:(()=>{let $=new S;ae($,e,r,a,c,!1);let y=$.toString();return se.filter(h=>new RegExp(`\\b${h.split("/").pop()}\\.`).test(y))})();s.block("import (",()=>{for(let $ of m)s.line(u.string($))},")"),s.blank(),ae(s,e,r,a,c,l);let f={path:t.path.replace(/\.[^.\\/]+$/,".go"),content:s.toString()};if(l)return[f];let g=n.map($=>`// ${$}`).join(`
16
16
  `),b=O.replace(/^package .*$/m,`package ${i}`);return[f,{path:f.path.replace(/[^\\/]+$/,"runtime.go"),content:`${g}
17
17
  ${b.trimEnd()}
18
18
  `}]};function ge(e,t){let n=t.emit.dateType??"string",r=t.emit.goPackage??"client",o=v(t.model).find(c=>c.op.name===e.name)?.ident??d(e.name),s=["ctx",...e.pathParams.map(c=>`"<${P(c.name,{style:"camel",reserved:w})}>"`),...e.requestBody?[`${p(e.requestBody.schema,n)}{ /* \u2026 */ }`]:[],...e.queryParams.length>0?["nil"]:[]],a=`client.${o}(${s.join(", ")})`,i=N(e)!==void 0?`stream := ${a}`:j(e)===void 0?`err := ${a}`:`result, err := ${a}`;return{lang:"go",label:"Go SDK",source:`client := ${r}.New(${r}.Config{})
19
19
  ${i}
20
- `}}var on=({model:e,output:t,emit:n,pagination:r})=>[{path:t.path.replace(/\.[^.\\/]+$/,".go.md"),content:B(e,{title:`${e.title} Go SDK reference`,frontmatter:n.docsFrontmatter===!0,language:{name:"go",label:"Go",fence:"go",requires:"The SDK needs the standard library only."},sample:o=>ge(o,{model:e,emit:n,outputPath:t.path}),paginated:new Set(r?.keys()??[])})}];export{p as a,L as b,rn as c,ge as d,on as e};
20
+ `}}var on=({model:e,output:t,emit:n,pagination:r})=>[{path:t.path.replace(/\.[^.\\/]+$/,".go.md"),content:Y(e,{title:`${e.title} Go SDK reference`,frontmatter:n.docsFrontmatter===!0,language:{name:"go",label:"Go",fence:"go",requires:"The SDK needs the standard library only."},sample:o=>ge(o,{model:e,emit:n,outputPath:t.path}),paginated:new Set(r?.keys()??[])})}];export{p as a,L as b,rn as c,ge as d,on as e};
@@ -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}from"./LW5V3SVS.js";import"./42HL7XQH.js";import"./CGBDHCS4.js";import"./RSOM77DA.js";import"./BV72RZCF.js";import"./WZXA5XPB.js";import"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as tanstackQueryGenerator};
7
+ import{a}from"./OYAP4QAE.js";import"./SN3OGJPW.js";import"./B6JQC3AM.js";import"./KPWZVETN.js";import"./DFVJG4OO.js";import"./WZXA5XPB.js";import"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as tanstackQueryGenerator};
@@ -0,0 +1,78 @@
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{h as g}from"./B6JQC3AM.js";import{e as C,l as u,m as p}from"./KPWZVETN.js";import{c as j,d as v}from"./DFVJG4OO.js";import{X as b}from"./L2EEGRZN.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,`
8
+
9
+ `).trimEnd()+`
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 {
11
+ if (process.argv[1] === undefined) return false;
12
+ try {
13
+ return realpathSync(fileURLToPath(import.meta.url)) === realpathSync(process.argv[1]);
14
+ } catch {
15
+ return false;
16
+ }
17
+ }
18
+ if (isProcessEntry()) {
19
+ process.exit(await run());
20
+ }`;function m(r,e){return JSON.stringify(r,null,e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function y(r){return r.securitySchemes.map(e=>({key:e.key,kind:e.kind==="bearer"||e.kind==="basic"?e.kind:"apiKey"}))}function I(r){return r.group===void 0?`${r.name} (keeps the bare word, so the "${r.name}" group has no help page)`:`${r.name} (run it as "${u(r.group)} ${r.name}")`}function L(r){let e=new Set(r.filter(o=>o.group).map(o=>u(o.group))),n=r.filter(o=>e.has(o.name));n.length!==0&&b.warn(`generate-client: cli reads a leading group name as the group, so ${n.length} operation(s) named after a tag resolve unusually \u2014 rename the operation or the tag: ${n.map(I).join(", ")}.
21
+ `)}function N(r,e){let n=f(r,{pagination:e.pagination,argsStyle:e.argsStyle});L(n);let o=y(r),t=`./${e.stem}.${e.importExt}`,a=["client","configure",...e.zodSelected?["use"]:[]];return["#!/usr/bin/env node",q,`import { readFileSync, realpathSync, writeFileSync } from "node:fs";
22
+ import { fileURLToPath } from "node:url";`,[`import { ${a.join(", ")} } from "${t}";`,...e.zodSelected?[`import { zodValidation } from "./${e.stem}.zod.${e.importExt}";`]:[]].join(`
23
+ `),e.runtime==="module"?`import { invokedName, runCli, type CliCommand, type CliWiring } from "./runtime/cli.${e.importExt}";`:`// \u2500\u2500\u2500 Embedded cli engine (@redocly/client-generator) \u2500\u2500\u2500
24
+ `+x(),`export const COMMANDS: CliCommand[] = ${m(n,2)};`,...e.zodSelected?['use(zodValidation(process.argv.includes("--dry-run") ? { response: false } : {}));']:[],`export const wiring: CliWiring = {
25
+ name: invokedName(process.argv[1], ${m(e.stem)}),
26
+ envPrefix: ${m(p(e.stem))},
27
+ client,
28
+ ${e.argsStyle==="flat"?` argsStyle: "flat",
29
+ `:""} configure,
30
+ schemes: ${m(o)},
31
+ env: process.env,
32
+ stdin: () => readFileSync(0, "utf-8"),
33
+ readFile: (path: string) => readFileSync(path, "utf-8"),
34
+ writeFile: (path: string, data: Uint8Array) => writeFileSync(path, data),
35
+ stdout: (line: string) => console.log(line),
36
+ stderr: (line: string) => console.error(line),
37
+ };
38
+
39
+ /** Run this CLI programmatically; defaults to the process argv. */
40
+ export const run = (argv: string[] = process.argv.slice(2)): Promise<number> =>
41
+ runCli(COMMANDS, wiring, argv);
42
+
43
+ // Re-exported so a composed entry can run these commands without its own runtime copy.
44
+ export { runCli };
45
+
46
+ // Self-execute only as the process entry, so importing this module is side-effect-safe:
47
+ // composed binaries and login-style wrappers import COMMANDS/wiring/run instead of
48
+ // editing this generated file.
49
+ ${A}`].join(`
50
+
51
+ `)+`
52
+ `}function Q(r,e){let n=p(e),o=new Map;r.forEach(({alias:s},l)=>{let c=s.replace(/[^A-Za-z0-9]/g,"_"),d=/^[A-Za-z_]/.test(c)?c:`_${c}`;o.set(s,[...o.values()].includes(d)?`${d}_${l}`:d)});let t=s=>o.get(s),a=r.map(({alias:s,modulePath:l},c)=>{let d=t(s);return`import { COMMANDS as ${d}Commands, wiring as ${d}Wiring${c===0?", runCli":""} } from ${JSON.stringify(l)};`}),i=r.map(({alias:s})=>{let l=t(s),c=P(s),d=`${n}_${p(s)}`;return` {
53
+ namespace: ${JSON.stringify(c)},
54
+ commands: ${l}Commands,
55
+ wiring: { ...${l}Wiring, envPrefix: ${JSON.stringify(d)} },
56
+ },`});return["#!/usr/bin/env node",q,['import { realpathSync } from "node:fs";','import { fileURLToPath } from "node:url";',...a].join(`
57
+ `),`/** The composed sources \u2014 import SOURCES to layer custom commands around this binary. */
58
+ export const SOURCES = [
59
+ ${i.join(`
60
+ `)}
61
+ ];
62
+
63
+ /** Run the composed CLI programmatically; defaults to the process argv. */
64
+ export const run = (argv: string[] = process.argv.slice(2)): Promise<number> =>
65
+ runCli(SOURCES, argv);
66
+
67
+ // Re-exported so a wrapper (a custom \`login\` command) can run these sources itself.
68
+ export { runCli };
69
+
70
+ ${A}`].join(`
71
+
72
+ `)+`
73
+ `}var ie=({model:r,output:e,banner:n,emit:o,selected:t,pagination:a})=>{let i=N(r,{stem:e.stem,importExt:o.importExt??"js",zodSelected:t?.includes("zod")??!1,pagination:a,argsStyle:o.argsStyle??"grouped",runtime:o.runtime??"inline"}),s={path:$(e.dir,`${e.stem}.cli.ts`),content:i};if(o.runtime!=="module")return[s];let l=n.map(c=>`// ${c}`).join(`
74
+ `);return[s,{path:$(e.dir,"runtime","cli.ts"),content:`${l}
75
+
76
+ ${E().trim()}
77
+ `}]},se=({model:r,output:e,emit:n,pagination:o})=>{let t=R(f(r,{pagination:o}),{title:`${r.title} command-line reference`,frontmatter:n.docsFrontmatter===!0,name:e.stem,schemes:y(r)});return[{path:$(e.dir,`${e.stem}.cli.md`),content:t}]};function ae(r,e){let n=f(e.model,{pagination:e.pagination}).find(t=>t.name===r.name);return n===void 0?void 0:{lang:"shell",label:"CLI",source:`npx tsx client.cli.ts ${["client",...n.group?[u(n.group)]:[],n.name,...n.positionals.map(t=>`<${t.name}>`),...n.flags.filter(t=>t.required).map(t=>`--${t.name} <${t.type}>`),...n.body?["--json '<json>'"]:[]].slice(1).join(" ")}
78
+ `}}export{Q as a,ie as b,se as c,ae as d};
@@ -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,d as E,e as B,g as F,o as O,p as h}from"./4UWA75AV.js";import{a as b}from"./HNVJYHEV.js";import{f as I}from"./CUB5GMHZ.js";import{O as P,P as v,Q as i,S as u,T as m,X as a,m as c,na as d}from"./L2EEGRZN.js";var y=class extends Error{};async function X({argv:t,version:e}){let n=performance.now(),s=new b,{organization:o,project:p,pushId:$,wait:g}=t,T=t.domain||F(),w=t["continue-on-deploy-failures"]||!1,U=t["start-time"]||Date.now(),S=[];try{let f=B(),R={domain:T,apiKey:f,organization:o,project:p,pushId:$,version:e,onSunsetWarning:l=>S.push(l)},x={...R,maxExecutionTime:t["max-execution-time"],retryIntervalMs:t["retry-interval"]?t["retry-interval"]*1e3:void 0,startTime:U},D=l=>j=>{let{status:C,url:z}=j.status[l].deploy;s.start(M({status:C,url:z,buildType:l,wait:g}))},r=g?await h({...x,buildType:"preview",onRetry:D("preview")}):await O(R);return W({buildType:"preview",spinner:s,push:r,continueOnDeployFailures:w}),L(r.status.preview.scorecard),g&&r.isMainBranch&&r.status.preview.deploy.status==="success"&&(r=await h({...x,buildType:"production",onRetry:D("production")})),r.isMainBranch&&(W({buildType:"production",spinner:s,push:r,continueOnDeployFailures:w}),L(r.status.production.scorecard)),K({organization:o,project:p,pushId:$,startedAt:n}),{preview:r.status.preview,production:r.isMainBranch?r.status.production:null,commit:r.commit}}catch(f){s.stop(),N("\u2717 Failed to get push status.",f)}finally{s.stop(),k("push-status",S)}}function N(t,e){throw e instanceof y?new d(e.message):e instanceof A?new d(`${t} Reason: ${e.message} (status: ${e.status})
7
+ import{a as A,d as E,e as B,g as F,o as O,p as h}from"./K2PGWUA3.js";import{a as b}from"./HNVJYHEV.js";import{f as I}from"./CUB5GMHZ.js";import{O as P,P as v,Q as i,S as u,T as m,X as a,m as c,na as d}from"./L2EEGRZN.js";var y=class extends Error{};async function X({argv:t,version:e}){let n=performance.now(),s=new b,{organization:o,project:p,pushId:$,wait:g}=t,T=t.domain||F(),w=t["continue-on-deploy-failures"]||!1,U=t["start-time"]||Date.now(),S=[];try{let f=B(),R={domain:T,apiKey:f,organization:o,project:p,pushId:$,version:e,onSunsetWarning:l=>S.push(l)},x={...R,maxExecutionTime:t["max-execution-time"],retryIntervalMs:t["retry-interval"]?t["retry-interval"]*1e3:void 0,startTime:U},D=l=>j=>{let{status:C,url:z}=j.status[l].deploy;s.start(M({status:C,url:z,buildType:l,wait:g}))},r=g?await h({...x,buildType:"preview",onRetry:D("preview")}):await O(R);return W({buildType:"preview",spinner:s,push:r,continueOnDeployFailures:w}),L(r.status.preview.scorecard),g&&r.isMainBranch&&r.status.preview.deploy.status==="success"&&(r=await h({...x,buildType:"production",onRetry:D("production")})),r.isMainBranch&&(W({buildType:"production",spinner:s,push:r,continueOnDeployFailures:w}),L(r.status.production.scorecard)),K({organization:o,project:p,pushId:$,startedAt:n}),{preview:r.status.preview,production:r.isMainBranch?r.status.production:null,commit:r.commit}}catch(f){s.stop(),N("\u2717 Failed to get push status.",f)}finally{s.stop(),k("push-status",S)}}function N(t,e){throw e instanceof y?new d(e.message):e instanceof A?new d(`${t} Reason: ${e.message} (status: ${e.status})
8
8
  `):new d(`${t} Reason: ${e.message}
9
9
  `)}function k(t,e){let n=E(e);if(!n)return;let s='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. ${s}
10
10
 
@@ -0,0 +1,30 @@
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{e as R}from"./KPWZVETN.js";import{a as T}from"./DFVJG4OO.js";import{a as x,e as P,f as v,i as H,j as C,k as l,l as M}from"./LD5MEXEL.js";import{n as N}from"./UW4UC7ZI.js";function y(e){let t=new Map(e.pathParams.map(r=>[r.name,r])),n=[];for(let r of e.path.matchAll(/\{([^{}]+)\}/g)){let s=t.get(r[1]);s!==void 0&&n.push(s)}return n}function I(e){let t=y(e),n=e.queryParams.length>0,r=!!e.requestBody,s=e.headerParams.length>0,o=e.cookieParams.length>0;return{hasQuery:n,hasBody:r,hasHeaders:s,hasCookies:o,hasInputs:t.length>0||n||r||s||o,varsRequired:t.length>0||e.queryParams.some(a=>a.required)||(e.requestBody?.required??!1)||e.headerParams.some(a=>a.required)||e.cookieParams.some(a=>a.required),variablesTypeName:`${l(e.name)}Variables`}}var E=" ";function $(e,t,n){let r=C(e,t);return r===void 0?[]:[`${n}/**`,...H(r).split(`
8
+ `).map(s=>`${n} * ${s}`.replace(/ +$/,"")),`${n} */`]}function O(e){return typeof e=="string"?JSON.stringify(e):String(e)}function F(e,t,n){switch(e){case"string":return t?.format==="binary"?"Blob":n==="Date"&&(t?.format==="date-time"||t?.format==="date")?"Date":"string";case"number":case"integer":return"number";case"boolean":return"boolean"}}function B(e){return e.kind==="union"||e.kind==="intersection"||e.kind==="enum"&&e.values.length>1}function c(e,t="string",n=""){switch(e.kind){case"scalar":return F(e.scalar,e.metadata,t);case"ref":return e.name;case"literal":return O(e.value);case"enum":return e.values.map(O).join(" | ");case"null":return"null";case"unknown":return"unknown";case"array":{let r=c(e.items,t,n);return B(e.items)?`(${r})[]`:`${r}[]`}case"record":return`Record<string, ${c(e.value,t,n)}>`;case"object":{if(e.properties.length===0)return"{}";let r=n+E;return`{
9
+ ${e.properties.flatMap(o=>K(o,t,r)).join(`
10
+ `)}
11
+ ${n}}`}case"union":return e.members.map(r=>{let s=c(r,t,n);return B(r)?`(${s})`:s}).join(" | ");case"intersection":return e.members.map(r=>{let s=c(r,t,n);return B(r)?`(${s})`:s}).join(" & ");case"omit":return`Omit<${e.base}, ${e.keys.map(r=>JSON.stringify(r)).join(" | ")}>`}}function K(e,t,n){let r=P(e.name),s=e.readOnly?"readonly ":"",o=e.required?"":"?",a=c(e.schema,t,n);return[...$(e.description,e.schema.metadata,n),`${n}${s}${r}${o}: ${a};`]}function U(e){let t=e.schema;return t.kind!=="enum"||t.scalar!=="string"?[]:t.values.every(n=>typeof n=="string"&&x(n))?[`export const ${e.name} = {`,...t.values.map((n,r)=>`${E}${n}: ${JSON.stringify(n)}${r===t.values.length-1?"":","}`),"} as const;"]:[]}function te(e,t="string"){let n=[];for(let r of e){let s=[...$(r.schema.description??r.description,r.schema.metadata,""),`export type ${r.name} = ${c(r.schema,t)};`];n.push(s.join(`
12
+ `));let o=U(r);o.length>0&&n.push(o.join(`
13
+ `))}return n.join(`
14
+
15
+ `)}function A(e){return e.contentType==="multipart/form-data"&&e.schema.kind==="object"}var W=" ";function z(e,t=[]){let n=N(e,{schemas:t});return n==="integer"?"number":n}function ce(e,t=[]){let n=D(e,t);if(n.length!==0)return n.map(r=>({name:r.name,key:r.key,type:r.type}))}function j(e,t=[],n=""){let r=n+W,s=D(e,t).map(o=>`${r}${o.key}${o.required===!0?"":"?"}: ${o.type};`);return s.length===0?"{}":`{
16
+ ${s.join(`
17
+ `)}
18
+ ${n}}`}function D(e,t){let n=new Set;return(e??[]).map(r=>({...r,key:v(M(r.name),n),type:z(r.schema,t)}))}var h=" ";function b(e,t,n=""){if(A(e))return c(e.schema,t,n);switch(e.contentType){case"multipart/form-data":return"FormData";case"application/x-www-form-urlencoded":return"URLSearchParams";case"application/octet-stream":return"Blob | ArrayBuffer";default:return c(e.schema,t,n)}}function p(e,t,n=""){let r=n+h,s=e.flatMap(o=>[...$(o.description,o.schema.metadata,r),`${r}${P(o.name)}${o.required?"":"?"}: ${c(o.schema,t,r)};`]);return s.length===0?"{}":`{
19
+ ${s.join(`
20
+ `)}
21
+ ${n}}`}function J(e,t,n=""){if(e.length===0)return{type:"void",kind:"void"};let r=e.find(i=>i.contentType.toLowerCase().includes("json"));if(r)return{type:c(r.schema,t,n),kind:"json"};let s=[],o=new Set,a=!1,u=!1;for(let i of e){let m;R(i.contentType)?(m="Blob",a=!0):i.contentType.startsWith("text/")?(m="string",u=!0):m=c(i.schema,t,n),!o.has(m)&&(o.add(m),s.push(m))}return{type:s.join(" | "),kind:a?"blob":u?"text":"json"}}function L(e,t,n=""){let r=new Set,s=[];for(let o of e){let a=c(o.schema,t,n);r.has(a)||(r.add(a),s.push(a))}return s}function G(e,t,n=""){let r=e.sse?.eventSchema;return r?c(r,t,n):"string"}function g(e,t,n,r,s,o){let a=s.has(t)?n():t;return`${o}${e}${r?"":"?"}: ${a};`}function X(e,t){let n=new Set,r=e;for(;r.kind==="ref";){let{name:s}=r;if(n.has(s))return;n.add(s);let o=t?.find(a=>a.name===s);if(o===void 0)return;r=o.schema}return r}function Q(e,t){let n=X(e,t);if(n?.kind==="object")return n.properties.map(s=>s.name);if(n?.kind!=="intersection")return;let r=new Set;for(let s of n.members){let o=Q(s,t);if(o===void 0)return;for(let a of o)r.add(a)}return[...r]}function Y(e,t){let n=[...y(e),...e.queryParams,...e.headerParams,...e.cookieParams],r=(e.requestBody?.required??!1)&&e.requestBody!==void 0?Q(e.requestBody.schema,t):void 0,s=r!==void 0,o=new Map;for(let u of n)o.set(u.name,(o.get(u.name)??0)+1);e.requestBody&&!s&&o.set("body",(o.get("body")??0)+1);for(let u of r??[])o.set(u,(o.get(u)??0)+1);let a=[...o].filter(([,u])=>u>1).map(([u])=>u);return a.length>0?{collisions:a}:{mergeBody:s}}function Z(e,t,n){return e.flatMap(r=>[...$(r.description,r.schema.metadata,n),`${n}${P(r.name)}${r.required?"":"?"}: ${c(r.schema,t.dateType,n)};`])}function V(e,t,n,r=""){let{dateType:s,schemaNames:o}=n,a=r+h,u=n.argsStyle==="flat"?Y(e,n.schemas):void 0;if(u!==void 0&&"mergeBody"in u)return _(e,t,n,u.mergeBody,r);let i=[],m=y(e);return m.length>0&&i.push(g("path",`${t}Path`,()=>p(m,s,a),!0,o,a)),e.queryParams.length>0&&i.push(g("query",`${t}Query`,()=>p(e.queryParams,s,a),e.queryParams.some(d=>d.required),o,a)),e.requestBody&&i.push(g("body",`${t}Body`,()=>b(e.requestBody,s,a),e.requestBody.required,o,a)),e.headerParams.length>0&&i.push(g("headers",`${t}Headers`,()=>p(e.headerParams,s,a),e.headerParams.some(d=>d.required),o,a)),e.cookieParams.length>0&&i.push(g("cookies",`${t}Cookies`,()=>p(e.cookieParams,s,a),e.cookieParams.some(d=>d.required),o,a)),i.length===0?"{}":`{
22
+ ${i.join(`
23
+ `)}
24
+ ${r}}`}function _(e,t,n,r,s){let o=s+h,a=Z([...y(e),...e.queryParams,...e.headerParams,...e.cookieParams],n,o);e.requestBody&&!r&&a.push(g("body",`${t}Body`,()=>b(e.requestBody,n.dateType,o),e.requestBody.required,n.schemaNames,o));let u=n.schemaNames.has(`${t}Body`)?b(e.requestBody,n.dateType,s):`${t}Body`,i=a.length===0?"{}":`{
25
+ ${a.join(`
26
+ `)}
27
+ ${s}}`;return r?a.length===0?u:`${i} & ${u}`:i}function S(e,t,n){let r=`${l(e.name)}Result`;return t.schemaNames.has(r)?J(e.successResponses,t.dateType,n).type:r}function ee(e,t,n){let r=L(e.errorResponses,t.dateType,n);if(r.length===0)return"unknown";let s=`${l(e.name)}Error`;return t.schemaNames.has(s)?r.join(" | "):s}function $e(e,t,n){let r=T(e.services);if(r.length===0)return"";let s=r.flatMap(o=>{let a=t.get(o.name),u=l(o.name),i=h+h,m=V(o,u,n,i),d=o.sse!==void 0,q=d?G(o,n.dateType,i):n.errorMode==="result"?`Result<${S(o,n,i)}, ${ee(o,n,i)}>`:S(o,n,i),f=[`${i}args: ${m};`,`${i}result: ${q};`];n.errorMode==="result"&&!d&&f.push(`${i}mode: "result";`);let k=o.successResponseHeaders;k&&k.length>0&&f.push(`${i}headers: ${j(k,n.schemas,i)};`);let w=n.pagination?.get(o.name);return w&&(f.push(`${i}item: ${c(w.itemSchema,n.dateType,i)};`),n.errorMode==="result"&&f.push(`${i}page: ${S(o,n,i)};`)),d&&f.push(`${i}kind: "sse";`),[`${h}${a}: {`,...f,`${h}};`]});return[...$("Per-operation `args`/`result` shapes (plus `kind: 'sse'` for event streams) \u2014 the\ntype-level companion of `OPERATIONS` that gives `createClient<Ops>` its typed methods.",void 0,""),"export type Ops = {",...s,"};"].join(`
28
+ `)}function ge(e,t){let{dateType:n,schemaNames:r}=t,s=l(e.name),o=e.sse!==void 0,{hasInputs:a}=I(e),u=[];if(!o){let d=`${s}Result`;if(r.has(d)||u.push(`export type ${d} = ${J(e.successResponses,n).type};`),t.errorMode==="result"){let q=L(e.errorResponses,n),f=`${s}Error`;q.length>0&&!r.has(f)&&u.push(`export type ${f} = ${q.join(" | ")};`)}}let i=y(e);i.length>0&&!r.has(`${s}Path`)&&u.push(`export type ${s}Path = ${p(i,n)};`),e.queryParams.length>0&&!r.has(`${s}Query`)&&u.push(`export type ${s}Query = ${p(e.queryParams,n)};`),e.requestBody&&!r.has(`${s}Body`)&&u.push(`export type ${s}Body = ${b(e.requestBody,n)};`),e.headerParams.length>0&&!r.has(`${s}Headers`)&&u.push(`export type ${s}Headers = ${p(e.headerParams,n)};`);let m=e.successResponseHeaders;return m&&m.length>0&&!r.has(`${s}ResponseHeaders`)&&u.push(`export type ${s}ResponseHeaders = ${j(m,t.schemas)};`),e.cookieParams.length>0&&!r.has(`${s}Cookies`)&&u.push(`export type ${s}Cookies = ${p(e.cookieParams,n)};`),a&&!r.has(`${s}Variables`)&&u.push(`export type ${s}Variables = ${V(e,s,t)};`),u.join(`
29
+
30
+ `)}function Pe(e,t){let n=new Set,r=s=>{switch(s.kind){case"ref":n.add(s.name);return;case"omit":n.add(s.base);return;case"array":r(s.items);return;case"record":r(s.value);return;case"object":for(let o of s.properties)r(o.schema);return;case"union":case"intersection":for(let o of s.members)r(o);return;default:return}};for(let s of T(e.services)){for(let a of[...s.pathParams,...s.queryParams,...s.headerParams,...s.cookieParams])r(a.schema);s.requestBody&&r(s.requestBody.schema);for(let a of s.successResponses)r(a.schema),a.itemSchema&&r(a.itemSchema);if(t.errorMode==="result")for(let a of s.errorResponses)r(a.schema);let o=t.pagination?.get(s.name);o&&r(o.itemSchema)}return[...n].filter(s=>t.schemaNames.has(s)).sort()}export{I as a,A as b,ce as c,$ as d,c as e,te as f,J as g,Y as h,$e as i,ge as j,Pe as k};
@@ -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}from"./73UEREUT.js";import"./42HL7XQH.js";import"./CGBDHCS4.js";import"./RSOM77DA.js";import"./BV72RZCF.js";import"./WZXA5XPB.js";import"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as swrGenerator};
7
+ import{a}from"./DE4ZFTDG.js";import"./SN3OGJPW.js";import"./B6JQC3AM.js";import"./KPWZVETN.js";import"./DFVJG4OO.js";import"./WZXA5XPB.js";import"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as swrGenerator};
@@ -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}from"./AWIBN2J5.js";import"./RSOM77DA.js";import"./BV72RZCF.js";import"./WZXA5XPB.js";import"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as mockGenerator};
7
+ import{a}from"./OA5XCUEZ.js";import"./KPWZVETN.js";import"./DFVJG4OO.js";import"./WZXA5XPB.js";import"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as mockGenerator};
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a as $,b as a,c,d as i,e as m,f}from"./42HL7XQH.js";import{k as l}from"./LD5MEXEL.js";import{join as p}from"node:path";function k(t,n){let e=$(t,"swr");if(e.length===0)return"";let s=e.some(a),o=e.some(r=>!a(r));return[...s?['import useSWR from "swr";']:[],...o?['import useSWRMutation from "swr/mutation";']:[],f(e,n.sdkModule,s),...e.flatMap(r=>a(r)?g(r):[S(r)])].join(`
7
+ import{a as $,b as a,c,d as i,e as m,f}from"./SN3OGJPW.js";import{k as l}from"./LD5MEXEL.js";import{join as p}from"node:path";function k(t,n){let e=$(t,"swr");if(e.length===0)return"";let s=e.some(a),o=e.some(r=>!a(r));return[...s?['import useSWR from "swr";']:[],...o?['import useSWRMutation from "swr/mutation";']:[],f(e,n.sdkModule,s),...e.flatMap(r=>a(r)?g(r):[S(r)])].join(`
8
8
 
9
9
  `)}function y(t,n,e){return`export function use${l(t.name)}(${n}) {
10
10
  return ${e};
@@ -5397,4 +5397,4 @@ async function runSingle(
5397
5397
  }
5398
5398
  return fail(1, detail);
5399
5399
  }
5400
- }`},S=["ApiError","ApiErrorLike","AuthCredentials","BodyMethod","Capabilities","CliAuthScheme","CliCommand","CliFlag","CliGlobals","CliInvocation","CliWiring","Client","ClientConfig","ClientCore","CommandContext","CommandSource","CustomCommand","Envelope","EnvelopeResult","EnvelopeResultForKnownInit","FRAME_DELIMITER","GLOBAL_FLAGS","HeadersOf","IDEMPOTENT_METHODS","LAYERS","LAYER_OF","LinkPageCall","Middleware","NoRequiredKeys","OperationArgs","OperationContext","OperationDescriptor","OperationMethodIdentity","OpsShape","PageOf","Paginated","PaginationSpec","ParamSpec","ParseAs","QueryStyle","QueryValue","RequestContext","RequestOptions","ResolvedCommand","ResponseHeaderSpec","Result","RetryConfig","RetryContext","RetryStrategy","SecuritySpec","SendCapabilities","ServerSentEvent","SseOptions","SseParseError","TRANSIENT_STATUS","ThrowMethod","TimeoutError","TokenProvider","abortError","acceptFor","buildUrl","callInputs","coerceResponseHeader","commandContract","constantCase","createClientCore","defaultRetryOn","encodeBase64","encodeReserved","execute","groupSlug","inputOf","invokedName","isConfigured","items","itemsByLink","kindFor","linkNext","linkPageCall","loadBody","mergeSetup","middlewareChain","namespaceArgs","normalizeCommands","oneLine","pageCall","pages","pagesByLink","paginateCapability","parse","parseInvocation","parseSseFrame","prepareRequest","queryStyles","readEnvelopeHeaders","readError","redactHeaders","renderComposedHelp","renderHelp","resolveAuth","resolvePointer","resolveToken","retryDelay","runCli","runSingle","runSources","send","shadowedCommandName","sleep","splitArgs","sse","stringHeaders","substitutePath","toFormData","toHeaderRecord"];var j=["client","OPERATIONS","Ops","OperationId","OperationPath","OperationTag","createClient","mergeSetup","ApiError","TimeoutError","configure","use","auth","defaultRetryOn","ClientConfig","RequestOptions","SseOptions","Middleware","OperationDescriptor","ServerSentEvent","Result","Envelope","EnvelopeResult","TokenProvider","__redoclySetup"],$=["z","http","HttpResponse","handlers","faker","queryOptions","useSWR","useSWRMutation","__Writable"],N=["AbortSignal","Array","ArrayBuffer","ArrayBufferView","AsyncGenerator","AsyncIterable","Blob","BodyInit","Boolean","DOMException","Date","Error","Extract","FormData","Headers","HeadersInit","JSON","Map","Math","NonNullable","Number","Object","Omit","Partial","Promise","ReadableStream","Record","RegExp","RegExpExecArray","Request","RequestInit","Response","Set","String","TextDecoder","TextEncoder","TypeError","Uint8Array","URL","URLSearchParams","btoa","clearTimeout","crypto","decodeURIComponent","document","encodeURIComponent","fetch","globalThis","setTimeout","undefined"],w;function Q(){return w===void 0&&(w=new Set([...j,...$,...N,...S])),w}var A={name:"@redocly/client-generator",version:"0.4.15",description:"Generate typed, zero-dependency TypeScript clients (fetch, auth, retries, middleware, SSE) from OpenAPI descriptions.",type:"module",types:"lib/index.d.ts",sideEffects:!1,exports:{".":{types:"./lib/index.d.ts",import:"./lib/index.js",default:"./lib/index.js"},"./generate":{types:"./lib/generate.d.ts",import:"./lib/generate.js",default:"./lib/generate.js"},"./printers/python":{types:"./lib/printers/python.d.ts",import:"./lib/printers/python.js",default:"./lib/printers/python.js"},"./printers/go":{types:"./lib/printers/go.d.ts",import:"./lib/printers/go.js",default:"./lib/printers/go.js"},"./printers/php":{types:"./lib/printers/php.d.ts",import:"./lib/printers/php.js",default:"./lib/printers/php.js"},"./printers/typescript":{types:"./lib/printers/typescript.d.ts",import:"./lib/printers/typescript.js",default:"./lib/printers/typescript.js"},"./printers":{types:"./lib/printers/index.d.ts",import:"./lib/printers/index.js",default:"./lib/printers/index.js"},"./contracts/typescript":{types:"./lib/contracts/typescript.d.ts",import:"./lib/contracts/typescript.js",default:"./lib/contracts/typescript.js"},"./runtime-sources":{types:"./lib/runtime-sources.d.ts",import:"./lib/runtime-sources.js",default:"./lib/runtime-sources.js"},"./package.json":"./package.json"},engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,scripts:{"examples:regen":"node scripts/regenerate-examples.mjs",prepare:"node scripts/generate-runtime-sources.mjs && node scripts/generate-eject-assets.mjs","typecheck:examples":"node scripts/typecheck-examples.mjs"},license:"MIT",repository:{type:"git",url:"git+https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["OpenAPI","Swagger","TypeScript","client","generator","codegen","fetch"],contributors:["Roman Marshevskyi <roman.marshevskyy@redocly.com> (https://redocly.com/)"],dependencies:{"@redocly/openapi-core":"2.54.2"},peerDependencies:{typescript:">=5.5.0"},peerDependenciesMeta:{typescript:{optional:!0}},devDependencies:{typescript:"6.0.2"},files:["lib","eject-assets"]};var ee=A.version;function T(e){let n=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(e.trim());return n===null?void 0:[Number(n[1]),Number(n[2]),Number(n[3])]}function v(e,n){return e[0]-n[0]||e[1]-n[1]||e[2]-n[2]}function ne(e,n){let s=/^[\^~]|^>=/.exec(n.trim())?.[0]??"",r=T(n.trim().slice(s.length)),a=T(e);if(!(r===void 0||a===void 0))return v(a,r)<0?!1:s===">="?!0:s===""?v(a,r)===0:s==="~"?a[0]===r[0]&&a[1]===r[1]:r[0]!==0?a[0]===r[0]:r[1]!==0?a[0]===0&&a[1]===r[1]:v(a,r)===0}export{R as a,H as b,G as c,W as d,j as e,Q as f,ee as g,ne as h};
5400
+ }`},S=["ApiError","ApiErrorLike","AuthCredentials","BodyMethod","Capabilities","CliAuthScheme","CliCommand","CliFlag","CliGlobals","CliInvocation","CliWiring","Client","ClientConfig","ClientCore","CommandContext","CommandSource","CustomCommand","Envelope","EnvelopeResult","EnvelopeResultForKnownInit","FRAME_DELIMITER","GLOBAL_FLAGS","HeadersOf","IDEMPOTENT_METHODS","LAYERS","LAYER_OF","LinkPageCall","Middleware","NoRequiredKeys","OperationArgs","OperationContext","OperationDescriptor","OperationMethodIdentity","OpsShape","PageOf","Paginated","PaginationSpec","ParamSpec","ParseAs","QueryStyle","QueryValue","RequestContext","RequestOptions","ResolvedCommand","ResponseHeaderSpec","Result","RetryConfig","RetryContext","RetryStrategy","SecuritySpec","SendCapabilities","ServerSentEvent","SseOptions","SseParseError","TRANSIENT_STATUS","ThrowMethod","TimeoutError","TokenProvider","abortError","acceptFor","buildUrl","callInputs","coerceResponseHeader","commandContract","constantCase","createClientCore","defaultRetryOn","encodeBase64","encodeReserved","execute","groupSlug","inputOf","invokedName","isConfigured","items","itemsByLink","kindFor","linkNext","linkPageCall","loadBody","mergeSetup","middlewareChain","namespaceArgs","normalizeCommands","oneLine","pageCall","pages","pagesByLink","paginateCapability","parse","parseInvocation","parseSseFrame","prepareRequest","queryStyles","readEnvelopeHeaders","readError","redactHeaders","renderComposedHelp","renderHelp","resolveAuth","resolvePointer","resolveToken","retryDelay","runCli","runSingle","runSources","send","shadowedCommandName","sleep","splitArgs","sse","stringHeaders","substitutePath","toFormData","toHeaderRecord"];var j=["client","OPERATIONS","Ops","OperationId","OperationPath","OperationTag","createClient","mergeSetup","ApiError","TimeoutError","configure","use","auth","defaultRetryOn","ClientConfig","RequestOptions","SseOptions","Middleware","OperationDescriptor","ServerSentEvent","Result","Envelope","EnvelopeResult","TokenProvider","__redoclySetup"],$=["z","http","HttpResponse","handlers","faker","queryOptions","useSWR","useSWRMutation","__Writable"],N=["AbortSignal","Array","ArrayBuffer","ArrayBufferView","AsyncGenerator","AsyncIterable","Blob","BodyInit","Boolean","DOMException","Date","Error","Extract","FormData","Headers","HeadersInit","JSON","Map","Math","NonNullable","Number","Object","Omit","Partial","Promise","ReadableStream","Record","RegExp","RegExpExecArray","Request","RequestInit","Response","Set","String","TextDecoder","TextEncoder","TypeError","Uint8Array","URL","URLSearchParams","btoa","clearTimeout","crypto","decodeURIComponent","document","encodeURIComponent","fetch","globalThis","setTimeout","undefined"],w;function Q(){return w===void 0&&(w=new Set([...j,...$,...N,...S])),w}var A={name:"@redocly/client-generator",version:"0.4.16",description:"Generate typed, zero-dependency TypeScript clients (fetch, auth, retries, middleware, SSE) from OpenAPI descriptions.",type:"module",types:"lib/index.d.ts",sideEffects:!1,exports:{".":{types:"./lib/index.d.ts",import:"./lib/index.js",default:"./lib/index.js"},"./generate":{types:"./lib/generate.d.ts",import:"./lib/generate.js",default:"./lib/generate.js"},"./printers/python":{types:"./lib/printers/python.d.ts",import:"./lib/printers/python.js",default:"./lib/printers/python.js"},"./printers/go":{types:"./lib/printers/go.d.ts",import:"./lib/printers/go.js",default:"./lib/printers/go.js"},"./printers/php":{types:"./lib/printers/php.d.ts",import:"./lib/printers/php.js",default:"./lib/printers/php.js"},"./printers/typescript":{types:"./lib/printers/typescript.d.ts",import:"./lib/printers/typescript.js",default:"./lib/printers/typescript.js"},"./printers":{types:"./lib/printers/index.d.ts",import:"./lib/printers/index.js",default:"./lib/printers/index.js"},"./contracts/typescript":{types:"./lib/contracts/typescript.d.ts",import:"./lib/contracts/typescript.js",default:"./lib/contracts/typescript.js"},"./runtime-sources":{types:"./lib/runtime-sources.d.ts",import:"./lib/runtime-sources.js",default:"./lib/runtime-sources.js"},"./package.json":"./package.json"},engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,scripts:{"examples:regen":"node scripts/regenerate-examples.mjs",prepare:"node scripts/generate-runtime-sources.mjs && node scripts/generate-eject-assets.mjs","typecheck:examples":"node scripts/typecheck-examples.mjs"},license:"MIT",repository:{type:"git",url:"git+https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["OpenAPI","Swagger","TypeScript","client","generator","codegen","fetch"],contributors:["Roman Marshevskyi <roman.marshevskyy@redocly.com> (https://redocly.com/)"],dependencies:{"@redocly/openapi-core":"2.54.3"},peerDependencies:{typescript:">=5.5.0"},peerDependenciesMeta:{typescript:{optional:!0}},devDependencies:{typescript:"6.0.2"},files:["lib","eject-assets"]};var ee=A.version;function T(e){let n=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(e.trim());return n===null?void 0:[Number(n[1]),Number(n[2]),Number(n[3])]}function v(e,n){return e[0]-n[0]||e[1]-n[1]||e[2]-n[2]}function ne(e,n){let s=/^[\^~]|^>=/.exec(n.trim())?.[0]??"",r=T(n.trim().slice(s.length)),a=T(e);if(!(r===void 0||a===void 0))return v(a,r)<0?!1:s===">="?!0:s===""?v(a,r)===0:s==="~"?a[0]===r[0]&&a[1]===r[1]:r[0]!==0?a[0]===r[0]:r[1]!==0?a[0]===0&&a[1]===r[1]:v(a,r)===0}export{R as a,H as b,G as c,W as d,j as e,Q as f,ee as g,ne as h};
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a,b,c,d,e,f}from"./7GJ7DF3O.js";import"./2U6O26CV.js";import"./RSOM77DA.js";import"./BV72RZCF.js";import"./WZXA5XPB.js";import"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{f as pythonDocs,d as pythonGenerator,c as pythonOptions,e as pythonSample,a as pythonType,b as renderPythonModels};
7
+ import{a,b,c,d,e,f}from"./OJUJ2R6B.js";import"./2U6O26CV.js";import"./KPWZVETN.js";import"./DFVJG4OO.js";import"./WZXA5XPB.js";import"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{f as pythonDocs,d as pythonGenerator,c as pythonOptions,e as pythonSample,a as pythonType,b as renderPythonModels};
@@ -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}from"./G5RGUPPT.js";import"./2U6O26CV.js";import"./CGBDHCS4.js";import"./RSOM77DA.js";import"./BV72RZCF.js";import"./WZXA5XPB.js";import"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{b as typescriptDocs,a as typescriptGenerator,c as typescriptSample};
7
+ import{a,b,c}from"./KCRCWPLX.js";import"./2U6O26CV.js";import"./B6JQC3AM.js";import"./KPWZVETN.js";import"./DFVJG4OO.js";import"./WZXA5XPB.js";import"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{b as typescriptDocs,a as typescriptGenerator,c as typescriptSample};
@@ -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 e={name:"@redocly/cli",version:"2.54.3",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.30.0","@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.4.16","@redocly/openapi-core":"2.54.3","@redocly/respect-core":"2.54.3","@redocly/reunite-integration":"2.54.3","@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",react:"^17.0.0 || ^18.2.0 || ^19.2.7","react-dom":"^17.0.0 || ^18.2.0 || ^19.2.7",redoc:"2.5.4",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:i,name:c,engines:s}=e,n=e.devDependencies.redoc,p="sha384-w447zOpYfw/1Tv/5AK9NfHTlQIqE3RVR6KY62jCyy9zNDgO64cMwGGP1Fj0zJVf5";export{i as a,c as b,s as c,n as d,p as e};
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{b as x,c as P,d as h}from"./VQVISWBJ.js";import{e as y,g as b,m as w,n as $}from"./4UWA75AV.js";import"./HNVJYHEV.js";import{f as l}from"./CUB5GMHZ.js";import"./BXI4SF2U.js";import{P as g,X as n,l as p}from"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";async function C({argv:t,config:o,version:c}){let f=performance.now(),A=Date.now(),{organization:s,project:m,"mount-path":F,verbose:I}=t,d=t.domain||b(),e,i,u=[];try{let r=y();if(e=$(t.files,(a,S)=>{n.warn(`File ${a} is overwritten by ${S}
7
+ import{b as x,c as P,d as h}from"./77KV43X2.js";import{e as y,g as b,m as w,n as $}from"./K2PGWUA3.js";import"./HNVJYHEV.js";import{f as l}from"./CUB5GMHZ.js";import"./BXI4SF2U.js";import{P as g,X as n,l as p}from"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";async function C({argv:t,config:o,version:c}){let f=performance.now(),A=Date.now(),{organization:s,project:m,"mount-path":F,verbose:I}=t,d=t.domain||b(),e,i,u=[];try{let r=y();if(e=$(t.files,(a,S)=>{n.warn(`File ${a} is overwritten by ${S}
8
8
  `)}),!e.length)return l("push",f,"No files to upload");i=(await w({domain:d,apiKey:r,organization:s,project:m,mountPath:F,files:e,defaultBranch:t["default-branch"],commit:{message:t.message,branchName:t.branch,sha:t["commit-sha"],url:t["commit-url"],createdAt:t["created-at"],namespace:t.namespace,repository:t.repository,author:T(t.author)},version:c,onUploadStart:a=>{n.info(`Uploading to ${a.mountPath} ${e.length} ${p("file",e.length)}:
9
9
  `)},onSunsetWarning:a=>u.push(a)})).pushId}catch(r){h("push",u),P("\u2717 File upload failed.",r)}for(let r of e)n.info(g(`\u2713 ${r.name}
10
10
  `));return n.info(`
@@ -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 as R,b as u,c as f,d}from"./5OBAGRRJ.js";import{d as y,e as G,f as x}from"./OJUJ2R6B.js";import{c as g,d as S,e as h}from"./3TYRUZAW.js";import{c as k,d as v,e as b}from"./UNBNSCWN.js";import{a as D,b as E,c as q,d as z}from"./NRCWSDXN.js";import{a as o}from"./OYAP4QAE.js";import{a,b as p,c as s}from"./KCRCWPLX.js";import"./2U6O26CV.js";import{a as m}from"./XY2QUSMZ.js";import{a as i}from"./JM7BMZLD.js";import{a as c}from"./DE4ZFTDG.js";import"./SN3OGJPW.js";import{a as I,d as M,e as N}from"./B6JQC3AM.js";import{a as l}from"./OA5XCUEZ.js";import{a as H,b as er,c as tr,d as or,e as nr,f as ar,g as pr,h as sr,i as mr,j as ir}from"./KPWZVETN.js";import"./DFVJG4OO.js";import{a as U}from"./WZXA5XPB.js";import"./L2EEGRZN.js";import"./NEWT5A6S.js";import{e as T,h as j,k as w}from"./LD5MEXEL.js";import{a as _,b as B,c as F,d as J,e as Q,f as K,g as P,h as V,i as W,j as X,k as Y,l as Z,m as $,n as rr}from"./UW4UC7ZI.js";import"./RFWIIJFG.js";var A={typescript:{run:a,sample:s,docs:p},zod:{run:m},transformers:{run:i},"tanstack-query":{run:o("react")},"tanstack-query-vue":{run:o("vue")},"tanstack-query-svelte":{run:o("svelte")},"tanstack-query-solid":{run:o("solid")},swr:{run:c},mock:{run:l},cli:{run:u,sample:d,docs:f},python:{run:y,sample:G,docs:x},go:{run:g,sample:S,docs:h},php:{run:k,sample:v,docs:b}},L=Object.fromEntries(Object.entries(D).map(([e,{load:r,...t}])=>[e,{...t,...A[e]}]));function n(){return new Map(Object.entries(L))}function C(e,r,t=n(),O){E(e,r,t,O)}function Dr(e,r){let t=r.registry??n();return C(r.generators,r.emit,t,r.outputMode),q(e,{...r,registry:t})}export{ir as AUTHORING_HELPER_NAMES,U as NotSupportedError,_ as Printer,F as RESERVED_WORDS,B as casing,j as codeLiteral,Dr as collectGeneratedFiles,K as deref,V as discriminatorCases,Z as docText,Y as enumValues,P as flattenAllOf,z as generateClient,rr as headerCoerceType,J as identifierFor,nr as isBinaryContentType,or as isMultipartBody,W as isNullable,er as jsonSuccessSchema,I as operationSignature,sr as paginationItemSchema,H as paginationRuleFor,w as pascalCase,R as renderComposedCliEntry,mr as renderReferencePage,T as safeIdent,$ as schemaAtPointer,pr as securityRequirements,ar as serverUrlParts,tr as sseResponse,M as tsJsdoc,N as tsType,Q as uniqueIdentifiers,X as unwrapNullable};
@@ -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 c}from"./HITQPK62.js";import{h as s,l as a}from"./4UWA75AV.js";import"./BXI4SF2U.js";import{P as t,X as e,na as i}from"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";async function y({argv:r,config:l,version:d}){let o=s(l,r.residency);try{let n=new a(d);r.verbose&&(e.info(`OAuth client initialized.
7
+ import{a as c}from"./HITQPK62.js";import{h as s,l as a}from"./K2PGWUA3.js";import"./BXI4SF2U.js";import{P as t,X as e,na as i}from"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";async function y({argv:r,config:l,version:d}){let o=s(l,r.residency);try{let n=new a(d);r.verbose&&(e.info(`OAuth client initialized.
8
8
  `),e.info(`Local credentials file path: ${n.credentialsFilePath}
9
9
  `)),await n.login(o,c),e.output(t(`\u2705 Logged in
10
10
 
@@ -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
+ import{a as se}from"./BXI4SF2U.js";import{ea as M,j as L,l as $,la as W,na as m,o as j,p as B}from"./L2EEGRZN.js";import{e as ne}from"./RFWIIJFG.js";var S=ne(se(),1);function b(){return process.env.HTTPS_PROXY||process.env.HTTP_PROXY||process.env.http_proxy||process.env.https_proxy}function H(o){let t=process.env.NO_PROXY||process.env.no_proxy;if(!t)return!1;let e=t.split(",").map(s=>s.trim().toLowerCase()).filter(Boolean);if(e.length===0)return!1;let r;try{r=new URL(o).hostname.toLowerCase()}catch{return!1}return e.some(s=>!!(s==="*"||r===s||s.startsWith(".")&&r.endsWith(s)||!s.startsWith(".")&&r.endsWith("."+s)))}var q=async(o,{timeout:t,...e}={})=>{let r=b(),s=r&&!H(o),n,i=t?{connect:{timeout:t}}:{};return s?n=new S.ProxyAgent({uri:r,...i}):t&&(n=new S.Agent(i)),await fetch(o,{signal:t?AbortSignal.timeout(t):void 0,...e,dispatcher:n})};var oe=/^[\x21-\x7e]+( [\x21-\x7e]+)*$/;function Y(){let o=process.env.REDOCLY_ENVIRONMENT?.trim();return o&&oe.test(o)?o:void 0}var u=class extends Error{status;constructor(t,e){super(t),this.status=e}},y=class{command;version;sunsetWarnings=[];constructor(t,e="2.0"){this.command=t,this.version=e}async request(t,e){let r=Y(),s={...e.headers,"user-agent":`redocly-cli/${this.version} ${this.command}${r?` ${r}`:""}`};try{let n=await q(t,{...e,headers:s});return this.collectSunsetWarning(n),n}catch(n){let i="Failed to fetch.";throw n.cause&&(i+=` Caused by ${n.cause.message||n.cause.name}.`),(n.code||n.cause?.code)&&(i+=` Code: ${n.code||n.cause?.code}`),new Error(i)}}collectSunsetWarning(t){let e=this.getSunsetDate(t);if(!e)return;let r=new Date(e);e>Date.now()?this.sunsetWarnings.push({sunsetDate:r,isSunsetExpired:!1}):this.sunsetWarnings.push({sunsetDate:r,isSunsetExpired:!0})}getSunsetDate(t){let{headers:e}=t;if(!e)return;let r=e.get("sunset")||e.get("Sunset");if(r)return Date.parse(r)}},A=class{client;domain;apiKey;constructor(t,e,r){this.client=t,this.domain=e,this.apiKey=r}async getParsedResponse(t){let e=await t.json();if(t.ok)return e;throw new u(`${e.title||t.statusText||"Unknown error"}.`,t.status)}async getDefaultBranch(t,e){try{let r=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/source`,{timeout:6e3,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`}});return(await this.getParsedResponse(r)).branchName}catch(r){let s=`Failed to fetch default branch. ${r.message}`;throw r instanceof u?new u(s,r.status):new Error(s)}}async upsert(t,e,r){try{let s=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/remotes`,{timeout:6e3,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({mountPath:r.mountPath,mountBranchName:r.mountBranchName,type:"CICD",autoMerge:!0})});return await this.getParsedResponse(s)}catch(s){let n=`Failed to upsert remote. ${s.message}`;throw s instanceof u?new u(n,s.status):new Error(n)}}async push(t,e,r,s){let n=new globalThis.FormData;n.append("remoteId",r.remoteId),n.append("commit[message]",r.commit.message),n.append("commit[author][name]",r.commit.author.name),n.append("commit[author][email]",r.commit.author.email),n.append("commit[branchName]",r.commit.branchName),r.commit.url&&n.append("commit[url]",r.commit.url),r.commit.namespace&&n.append("commit[namespaceId]",r.commit.namespace),r.commit.sha&&n.append("commit[sha]",r.commit.sha),r.commit.repository&&n.append("commit[repositoryId]",r.commit.repository),r.commit.createdAt&&n.append("commit[createdAt]",r.commit.createdAt);for(let i of s){let a=Buffer.isBuffer(i.stream)?new Blob([i.stream]):new Blob([await ie(i.stream)]);n.append(`files[${i.path}]`,a,i.path)}r.isMainBranch&&n.append("isMainBranch","true");try{let i=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/pushes`,{method:"POST",headers:{Authorization:`Bearer ${this.apiKey}`},body:n});return await this.getParsedResponse(i)}catch(i){let a=`Failed to push. ${i.message}`;throw i instanceof u?new u(a,i.status):new Error(a)}}async getPush({organizationId:t,projectId:e,pushId:r}){try{let s=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/pushes/${r}`,{timeout:6e3,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`}});return await this.getParsedResponse(s)}catch(s){let n=`Failed to get push status. ${s.message}`;throw s instanceof u?new u(n,s.status):new Error(n)}}},p=class{apiClient;remotes;constructor({domain:t,apiKey:e,command:r,version:s}){this.apiClient=new y(r,s),this.remotes=new A(this.apiClient,t,e)}getSunsetWarning(){return V(this.apiClient.sunsetWarnings)}};function V(o){let[t]=[...o].sort((e,r)=>e.isSunsetExpired!==r.isSunsetExpired?e.isSunsetExpired?-1:1:e.sunsetDate>r.sunsetDate?1:-1);return t}async function ie(o){let t=[];for await(let e of o)t.push(e);return Buffer.concat(t)}function ae(){if(process.env.REDOCLY_AUTHORIZATION)return process.env.REDOCLY_AUTHORIZATION;throw new Error("No api key provided, please use environment variable REDOCLY_AUTHORIZATION.")}var v={us:"https://app.cloud.redocly.com",eu:"https://app.cloud.eu.redocly.com"};function ce(){return process.env.REDOCLY_DOMAIN||v.us}var z=ue((o,t)=>{try{let e=t||o?.resolvedConfig.residency;return le(e)?v[e]:e?new URL(e).origin:o?.resolvedConfig.scorecard?.fromProjectUrl?new URL(o.resolvedConfig.scorecard.fromProjectUrl).origin:v.us}catch{throw new T}});function N(o){try{z(void 0,o)}catch{return!1}return!0}function ue(o){return(...t)=>{let e=o(...t);if(!e.startsWith("https://"))throw new T;return e}}var T=class extends Error{constructor(){super("Invalid Reunite URL")}};function le(o){return typeof o=="string"&&o in v}import{Buffer as I}from"node:buffer";import _ from"node:crypto";import{mkdirSync as he,existsSync as G,writeFileSync as de,readFileSync as me,rmSync as pe}from"node:fs";import{homedir as fe}from"node:os";import X from"node:path";import*as K from"node:child_process";var f=class{baseUrl;apiClient;clientName="redocly-cli";constructor(t,e){this.baseUrl=t,this.apiClient=new y("login",e)}async run(t){let e=await this.getDeviceCode();t?.({verificationUri:e.verificationUri,verificationUriComplete:e.verificationUriComplete,userCode:e.userCode}),this.openBrowser(e.verificationUriComplete);let r=await this.pollingAccessToken(e.deviceCode,e.interval,e.expiresIn);return this.withResidency(r)}openBrowser(t){if(!/^https?:\/\//.test(t))return;let[e,r]=process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",t]]:process.platform==="darwin"?["open",[t]]:["xdg-open",[t]];K.spawn(e,r,{stdio:"ignore",detached:!0}).on("error",()=>{}).unref()}async verifyToken(t){try{return!!(await this.sendRequest("/session","GET",void 0,{Cookie:`accessToken=${t};`})).user}catch{return!1}}async verifyApiKey(t){try{return!!(await this.sendRequest("/api-keys-verify","POST",{apiKey:t})).success}catch{return!1}}async refreshToken(t){let e=await this.sendRequest("/device-rotate-token","POST",{grant_type:"refresh_token",client_name:this.clientName,refresh_token:t});if(!e.access_token)throw new Error("Failed to refresh token");return this.withResidency({access_token:e.access_token,refresh_token:e.refresh_token,expires_in:e.expires_in})}async pollingAccessToken(t,e,r){return new Promise((s,n)=>{let i=setInterval(async()=>{let c=await this.getAccessToken(t);c.access_token&&(clearInterval(i),clearTimeout(a),s(c)),c.error&&c.error!=="authorization_pending"&&(clearInterval(i),clearTimeout(a),n(c.error_description))},e*1e3),a=setTimeout(async()=>{clearInterval(i),clearTimeout(a),n("Authorization has expired. Please try again.")},r*1e3)})}async getAccessToken(t){return await this.sendRequest("/device-token","POST",{client_name:this.clientName,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})}async getDeviceCode(){let{device_code:t,user_code:e,verification_uri:r,verification_uri_complete:s,interval:n=10,expires_in:i=300}=await this.sendRequest("/device-authorize","POST",{client_name:this.clientName});return{deviceCode:t,userCode:e,verificationUri:r,verificationUriComplete:s,interval:n,expiresIn:i}}async sendRequest(t,e="GET",r=void 0,s={}){let n=`${this.baseUrl}/api${t}`,i=await this.apiClient.request(n,{body:r&&JSON.stringify(r),method:e,headers:{"Content-Type":"application/json",...s},timeout:6e3});return i.status===204?{success:!0}:await i.json()}withResidency(t){return{...t,residency:this.baseUrl}}};var ge="4618dbc9-8aed-4e27-aaf0-225f4603e5a4",J="aes-256-cbc",D=class{version;credentialsFolderPath;credentialsFilePath;credentialsFileName;key;iv;constructor(t){this.version=t;let e=fe();this.credentialsFolderPath=X.join(e,".redocly"),this.credentialsFileName="credentials",this.credentialsFilePath=X.join(this.credentialsFolderPath,this.credentialsFileName),this.key=_.createHash("sha256").update(`${this.credentialsFolderPath}${ge}`).digest(),this.iv=_.createHash("md5").update(this.credentialsFolderPath).digest(),he(this.credentialsFolderPath,{recursive:!0})}async login(t,e){let s=await new f(t,this.version).run(e);if(!s)throw new Error("Failed to login. No credentials received.");await this.saveCredentials(s)}async logout(){try{this.removeCredentials()}catch{}}async isAuthorized(t,e){return e?new f(t,this.version).verifyApiKey(e):!!await this.getAccessToken(t)}getAccessToken=async t=>{let e=new f(t,this.version),r=await this.readCredentials();if(!r||!N(t)||r.residency&&r.residency!==t)return null;if(await e.verifyToken(r.access_token))return r.access_token;try{let n=await e.refreshToken(r.refresh_token);return await this.saveCredentials(n),n.access_token}catch{return null}};async saveCredentials(t){try{let e=this.encryptCredentials(t);de(this.credentialsFilePath,e,"utf8")}catch(e){throw new Error(`Failed to save credentials: ${e.message}`)}}async readCredentials(){if(!G(this.credentialsFilePath))return null;try{let t=me(this.credentialsFilePath,"utf8");return this.decryptCredentials(t)}catch{return null}}async removeCredentials(){G(this.credentialsFilePath)&&pe(this.credentialsFilePath)}encryptCredentials(t){let e=_.createCipheriv(J,this.key,this.iv);return I.concat([e.update(JSON.stringify(t),"utf8"),e.final()]).toString("hex")}decryptCredentials(t){let e=_.createDecipheriv(J,this.key,this.iv),r=I.concat([e.update(I.from(t,"hex")),e.final()]);return JSON.parse(r.toString("utf8"))}};import*as g from"node:fs";import*as d from"node:path";async function we({domain:o,apiKey:t,organization:e,project:r,mountPath:s,files:n,defaultBranch:i,commit:a,version:c,onUploadStart:x,onSunsetWarning:C}){let h=new p({domain:o,apiKey:t,command:"push",version:c});try{let w=await h.remotes.getDefaultBranch(e,r),P=await h.remotes.upsert(e,r,{mountBranchName:w,mountPath:s});x?.(P);let{id:E}=await h.remotes.push(e,r,{remoteId:P.id,commit:a,isMainBranch:i===a.branchName},n.map(l=>({path:j(l.name),stream:g.createReadStream(l.path)})));return{pushId:E}}finally{let w=h.getSunsetWarning();w&&C?.(w)}}function ye(o,t){let e={};for(let s of o)if(g.statSync(s).isDirectory()){let n=s;Z(n,[]).forEach(a=>r(a,n))}else r(s,d.dirname(s));function r(s,n){let i=d.relative(n,s);e[i]&&t?.(e[i],s),e[i]=s}return Object.entries(e).map(([s,n])=>({name:s,path:d.resolve(n)}))}function Z(o,t){let e=g.readdirSync(o);for(let r of e){let s=d.join(o,r);g.statSync(s).isDirectory()?t=Z(s,t):t.push(s)}return t}async function Q({operation:o,condition:t,onConditionNotMet:e,startTime:r=Date.now(),retryTimeoutMs:s=6e5,retryIntervalMs:n=5e3}){async function i(){let a=await o();if(t(a))return a;if(Date.now()-r>s)throw new Error("Timeout exceeded.");return await e?.(a),await L(n),i()}return i()}var ve=1200,Te=5e3,xe=["pending","running"];async function Ce(o){let t=ee(o);try{return await re(t,o)}finally{te(t,o)}}async function Pe({buildType:o,maxExecutionTime:t=ve,retryIntervalMs:e=Te,startTime:r=Date.now(),onRetry:s,...n}){let i=ee(n);try{return await Q({operation:()=>re(i,n),condition:a=>!xe.includes(a.status[o].deploy.status),onConditionNotMet:s,startTime:r,retryTimeoutMs:t*1e3,retryIntervalMs:e})}finally{te(i,n)}}function ee({domain:o,apiKey:t,version:e}){return new p({domain:o,apiKey:t,command:"push-status",version:e})}function te(o,{onSunsetWarning:t}){let e=o.getSunsetWarning();e&&t?.(e)}function re(o,{organization:t,project:e,pushId:r}){return o.remotes.getPush({organizationId:t,projectId:e,pushId:r})}async function Ee({projectUrl:o,auth:t,isApiKey:e=!1,onDebug:r}){let s=Re(o);if(!s)throw new m(`Invalid project URL format: ${o}`);try{let n=await Se({...s,auth:t,isApiKey:e,onDebug:r}),i=n.config.scorecardClassic||n.config.scorecard;if(!i)throw new Error("No scorecard configuration found.");let a=n.config.pluginsUrl,c=a?await _e(a,r):void 0;return{scorecard:i,plugins:c,pluginsUrl:a}}catch(n){throw new m(n instanceof Error?n.message:String(n))}}function Re(o){let t=new URL(o),e=t.pathname.match(/\/org\/(?<orgSlug>[^/]+)\/project\/(?<projectSlug>[^/]+)/);if(!e?.groups)return;let{orgSlug:r,projectSlug:s}=e.groups;return{residency:t.origin,orgSlug:r,projectSlug:s}}async function Se({residency:o,orgSlug:t,projectSlug:e,auth:r,isApiKey:s,onDebug:n}){let i=new URL(`${o}/api/orgs/${t}/projects/${e}`),a=await fetch(i,{headers:Fe(r,s)});if(n?.(`Project fetch response status: ${a.status}`),a.status===401||a.status===403)throw n?.(`Authentication failed with status ${a.status}.`),n?.("Check that your credentials are valid and have the necessary permissions."),new Error(`Unauthorized access to project: ${e}. Please check your credentials.`);if(a.status!==200)throw new Error(`Failed to fetch project: ${e}. Status: ${a.status}`);return n?.("Successfully received project configuration."),a.json()}async function _e(o,t){t?.(`Fetching plugins from: ${o}`);try{let e=await fetch(o);if(t?.(`Plugins fetch response status: ${e.status}`),e.status!==200){t?.("Failed to fetch plugins");return}return e.text()}catch(e){t?.(`Error fetching plugins: ${e instanceof Error?e.message:String(e)}`);return}}function Fe(o,t){return t?{Authorization:`Bearer ${o}`}:{Cookie:`accessToken=${o}`}}async function O(o,t,e=[],r=[],s){let n={};for(let i of e){let a={[i.name]:{root:o,rules:t}},c=await M({apis:a,...i,plugins:r},{configPath:s});n[i.name]=c.forAlias(i.name)}return n}function k(o,t){if(o){for(let e of o)if(Object.entries(e.where?.metadata||{}).every(([s,n])=>$e(s,n,t)))return e}}function $e(o,t,e){if(t.match(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}Z)?\/(\d{4}-\d{2}-\d{2})?$/)){if(!e[o])return!1;let[r,s]=t.split("/"),n=new Date(e[o]);return!(n<new Date(r)||s&&n>new Date(s))}else if(t.match(/^\/.*\//)){if(!e[o])return!1;try{return B(t).test(e[o])}catch{throw new m(`Invalid regex in scorecard target "${o}": ${t}`)}}return e[o]===t}import{pathToFileURL as Ue}from"node:url";async function Ae(o,t){if(!o)return[];let e=Ue(t??process.cwd()).href+"/",r=o.replaceAll("__redocly_dirname",`"${e}"`);return(await import(`data:text/javascript;base64,${btoa(r)}`)).default.map(i=>i())}var Ne=".redocly.com";function Ie(o){try{return new URL(o).hostname.toLowerCase().endsWith(Ne)}catch{return!1}}async function De({apiPath:o,document:t,externalRefResolver:e,scorecardConfig:r,configPath:s,plugins:n=[],targetLevel:i,metadata:a={},onDebug:c}){let x=[],C=new Map,h=r.levels||[];if(i&&!h.some(l=>l.name===i))throw new m(`Target level "${i}" not found in the scorecard configuration levels.
8
+ `);let w=k(r.targets,a)?.rules,P=await O(o,w,h,n,s||"");for(let l of h){c?.(`
9
+ Validating level: "${l.name}"`),n.length>0&&c?.(`Using ${n.length} ${$("plugin",n.length)} for this level.`),c?.("Linting document against level rules...");let R=(await W({document:t,externalRefResolver:e,config:P[l.name]})).filter(({ignored:F})=>!F).map(F=>({...F,scorecardLevel:l.name}));c?.(`Found ${R.length} ${$("problem",R.length)} for level "${l.name}".`),C.set(l.name,R),x.push(...R)}let E=Oe(C,h,i);return{problems:x,achievedLevel:E,targetLevelAchieved:i?E===i:!0}}function Oe(o,t,e){let r=null;for(let s of t){if((o.get(s.name)||[]).some(a=>a.severity==="error"))return r||"Non Conformant";if(r=s.name,e&&s.name===e)return s.name}return r||"Non Conformant"}export{u as a,y as b,p as c,V as d,ae as e,v as f,ce as g,z as h,N as i,T as j,f as k,D as l,we as m,ye as n,Ce as o,Pe as p,Ee as q,O as r,k as s,Ae as t,Ie as u,De as v};
@@ -4,11 +4,11 @@ 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 S,c as E,d as w,f as A,g as M,h as q,i as D,j as B,k as F}from"./CGBDHCS4.js";import{b,g as T}from"./RSOM77DA.js";import{a as f,c as R,d as v,e as k}from"./BV72RZCF.js";import{d as I,f as N,h as P,i as j,m as C}from"./LD5MEXEL.js";import{join as Y}from"node:path";var y="// Generated by @redocly/client-generator \u2014 do not edit by hand.\n// Source: OpenAPI description. Re-run `redocly generate-client` to update.";function $(e){return e.filter(t=>t.length>0).join(`
7
+ import{b as S,c as E,d as w,f as A,g as M,h as q,i as D,j as B,k as F}from"./B6JQC3AM.js";import{g as b,i as T}from"./KPWZVETN.js";import{a as f,c as R,d as v,e as k}from"./DFVJG4OO.js";import{d as I,f as N,h as P,i as j,m as C}from"./LD5MEXEL.js";import{join as Y}from"node:path";var y="// Generated by @redocly/client-generator \u2014 do not edit by hand.\n// Source: OpenAPI description. Re-run `redocly generate-client` to update.";function $(e){return e.filter(t=>t.length>0).join(`
8
8
 
9
9
  `)+`
10
10
  `}function O(e){let t=["/**",` * ${j(`${e.title} (v${e.version})`)}`];if(e.description)for(let n of C(j(e.description)))t.push(` * ${n}`.replace(/ +$/,""));return t.push(" */"),t.join(`
11
- `)}function x(e){let t=new Set(k),n=new Map;for(let r of f(e.services))n.set(r.name,N(r.name,t));return n}function Z(e,t,n,r,s=[],o="grouped"){let i=[...e.pathParams,...e.queryParams,...e.headerParams,...e.cookieParams].map(c=>({name:c.name,in:c.in,...c.style!==void 0?{style:c.style}:{},...c.explode!==void 0?{explode:c.explode}:{},...c.allowReserved!==void 0?{allowReserved:c.allowReserved}:{}})),p=T(e,{securitySchemes:t}),m=e.sse!==void 0?"sse":M(e.successResponses,n).kind,u=E(e.successResponseHeaders,s);return{id:e.specName??e.name,method:e.method.toUpperCase(),path:e.path,...e.tags.length>0?{tags:e.tags}:{},...i.length>0?{params:i}:{},...e.requestBody?{body:{contentType:e.requestBody.contentType,...S(e.requestBody)?{multipart:!0}:{}}}:{},...m!=="json"?{responseKind:m}:{},...e.sse===void 0?{}:{sseDataKind:e.sse.dataKind},...p.length>0?{security:p}:{},...u===void 0?{}:{responseHeaders:u},...r?.has(e.name)?{pagination:r.get(e.name).spec}:{},...o==="flat"&&"collisions"in q(e,s)?{argsStyle:"grouped"}:{}}}function L(e,t,n,r,s="grouped"){let o=f(e.services);if(o.length===0)return"";let i=o.map((a,m)=>{let u=P(Z(a,e.securitySchemes,n,r,e.schemas,s));return` ${t.get(a.name)}: ${u}${m===o.length-1?"":","}`}),p=[[...w(`The wire-shape descriptor for every operation, keyed by operationId \u2014 the data the
11
+ `)}function x(e){let t=new Set(k),n=new Map;for(let r of f(e.services))n.set(r.name,N(r.name,t));return n}function Z(e,t,n,r,s=[],o="grouped"){let i=[...e.pathParams,...e.queryParams,...e.headerParams,...e.cookieParams].map(c=>({name:c.name,in:c.in,...c.style!==void 0?{style:c.style}:{},...c.explode!==void 0?{explode:c.explode}:{},...c.allowReserved!==void 0?{allowReserved:c.allowReserved}:{}})),p=b(e,{securitySchemes:t}),m=e.sse!==void 0?"sse":M(e.successResponses,n).kind,u=E(e.successResponseHeaders,s);return{id:e.specName??e.name,method:e.method.toUpperCase(),path:e.path,...e.tags.length>0?{tags:e.tags}:{},...i.length>0?{params:i}:{},...e.requestBody?{body:{contentType:e.requestBody.contentType,...S(e.requestBody)?{multipart:!0}:{}}}:{},...m!=="json"?{responseKind:m}:{},...e.sse===void 0?{}:{sseDataKind:e.sse.dataKind},...p.length>0?{security:p}:{},...u===void 0?{}:{responseHeaders:u},...r?.has(e.name)?{pagination:r.get(e.name).spec}:{},...o==="flat"&&"collisions"in q(e,s)?{argsStyle:"grouped"}:{}}}function L(e,t,n,r,s="grouped"){let o=f(e.services);if(o.length===0)return"";let i=o.map((a,m)=>{let u=P(Z(a,e.securitySchemes,n,r,e.schemas,s));return` ${t.get(a.name)}: ${u}${m===o.length-1?"":","}`}),p=[[...w(`The wire-shape descriptor for every operation, keyed by operationId \u2014 the data the
12
12
  runtime routes requests by. Also minification-safe static metadata (method, path,
13
13
  tags) for cache keys, tracing span names, and request logging.`,void 0,""),"export const OPERATIONS = {",...i,"} as const satisfies Record<string, OperationDescriptor>;"].join(`
14
14
  `),'export type OperationId = (typeof OPERATIONS)[keyof typeof OPERATIONS]["id"];','export type OperationPath = (typeof OPERATIONS)[keyof typeof OPERATIONS]["path"];'];return o.some(a=>a.tags.length>0)&&p.push(`export type OperationTag = Extract<(typeof OPERATIONS)[keyof typeof OPERATIONS], {
@@ -61,7 +61,7 @@ ${r.trim()}
61
61
  const __redoclySetup: { config?: ClientConfig; middleware?: Middleware[] } = ${e.setup};
62
62
  `+u:u}function ae(e,t){let n=["export const { configure, use } = client;"];if(e.length===0)return n.join(`
63
63
  `);let r=e.map(s=>t.get(s.name)).join(", ");return n.push(`export const { ${r} } = client;`),n.join(`
64
- `)}var Me=({model:e,output:t,outputMode:n,emit:r})=>{let s=V(e,r).map(({name:o,content:i})=>({path:Y(t.dir,"runtime",o),content:i}));if(n==="split"){let{dir:o,stem:i}=t,{entry:p,schemas:a}=W(e,r,i);return[...a===void 0?[]:[{path:Y(o,`${i}.schemas.ts`),content:a}],{path:t.path,content:p},...s]}return[{path:t.path,content:K(e,r)},...s]},qe=({model:e,output:t,emit:n,pagination:r})=>[{path:t.path.replace(/\.[^.\\/]+$/,".typescript.md"),content:b(e,{title:`${e.title} TypeScript client reference`,frontmatter:n.docsFrontmatter===!0,language:{name:"typescript",label:"TypeScript",fence:"typescript",requires:"The client has no dependencies."},sample:s=>ce(s,{model:e,emit:n,outputPath:t.path}),paginated:new Set(r?.keys()??[])})}];function ce(e,t){let n=x(t.model).get(e.name)??e.name,s=`./${t.outputPath.replace(/^.*[\\/]/,"").replace(/\.[^.]+$/,"")}.${t.emit.importExt??"js"}`,o=e.queryParams.filter(c=>c.required),i=t.emit.argsStyle==="flat",p=e.pathParams.map(c=>`${c.name}: '<${c.name}>'`),a=o.map(c=>`${c.name}: /* \u2026 */`),m=i?[...p,...a,...e.requestBody?["/* body properties */"]:[]]:[...p.length>0?[`path: { ${p.join(", ")} }`]:[],...a.length>0?[`query: { ${a.join(", ")} }`]:[],...e.requestBody?["body: { /* \u2026 */ }"]:[]],u=m.length>0?[`{ ${m.join(", ")} }`]:[];return{lang:"typescript",label:"TypeScript SDK",source:`import { ${n} } from '${s}';
64
+ `)}var Me=({model:e,output:t,outputMode:n,emit:r})=>{let s=V(e,r).map(({name:o,content:i})=>({path:Y(t.dir,"runtime",o),content:i}));if(n==="split"){let{dir:o,stem:i}=t,{entry:p,schemas:a}=W(e,r,i);return[...a===void 0?[]:[{path:Y(o,`${i}.schemas.ts`),content:a}],{path:t.path,content:p},...s]}return[{path:t.path,content:K(e,r)},...s]},qe=({model:e,output:t,emit:n,pagination:r})=>[{path:t.path.replace(/\.[^.\\/]+$/,".typescript.md"),content:T(e,{title:`${e.title} TypeScript client reference`,frontmatter:n.docsFrontmatter===!0,language:{name:"typescript",label:"TypeScript",fence:"typescript",requires:"The client has no dependencies."},sample:s=>ce(s,{model:e,emit:n,outputPath:t.path}),paginated:new Set(r?.keys()??[])})}];function ce(e,t){let n=x(t.model).get(e.name)??e.name,s=`./${t.outputPath.replace(/^.*[\\/]/,"").replace(/\.[^.]+$/,"")}.${t.emit.importExt??"js"}`,o=e.queryParams.filter(c=>c.required),i=t.emit.argsStyle==="flat",p=e.pathParams.map(c=>`${c.name}: '<${c.name}>'`),a=o.map(c=>`${c.name}: /* \u2026 */`),m=i?[...p,...a,...e.requestBody?["/* body properties */"]:[]]:[...p.length>0?[`path: { ${p.join(", ")} }`]:[],...a.length>0?[`query: { ${a.join(", ")} }`]:[],...e.requestBody?["body: { /* \u2026 */ }"]:[]],u=m.length>0?[`{ ${m.join(", ")} }`]:[];return{lang:"typescript",label:"TypeScript SDK",source:`import { ${n} } from '${s}';
65
65
 
66
66
  const result = await ${n}(${u.join(", ")});
67
67
  `}}export{Me as a,qe as b,ce as c};
@@ -0,0 +1,11 @@
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,m as u}from"./UW4UC7ZI.js";function m(e,t){let n=t??{},i=e.specName??e.name;if(Array.isArray(n.exclude)&&n.exclude.includes(i))return;let r=(n.operations??{})[i]??e.paginationExtension;if(r===void 0&&typeof n.style=="string"){let{exclude:c,operations:B,...l}=n,g=l.style==="cursor"?l.cursorParam:l.offsetParam;(l.style==="link"?e.successResponseHeaders?.some(p=>p.name==="link")===!0:typeof g=="string"&&e.queryParams.some(p=>p.name===g))&&(r=l)}if(r===void 0||typeof r.style!="string")return;let s=r.style==="cursor"?r.cursorParam:r.offsetParam;return{style:r.style,...typeof s=="string"?{param:s}:{},...typeof r.nextCursor=="string"?{nextCursor:r.nextCursor}:{},...typeof r.hasMore=="string"?{hasMore:r.hasMore}:{},...typeof r.limitParam=="string"?{limitParam:r.limitParam}:{},...typeof r.items=="string"?{items:r.items}:{}}}function h(e){return e.successResponses.find(t=>t.contentType.toLowerCase().includes("json"))?.schema}function x(e){return e.successResponses.find(t=>t.contentType.toLowerCase().includes("text/event-stream"))}function k(e){return e.requestBody?.contentType.toLowerCase().includes("multipart")??!1}var R=["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 d(e){let t=e.split(";")[0].trim().toLowerCase();return R.some(n=>t.startsWith(n))}function b(e){let t=new Set(e.variables.map(s=>s.name)),n=[],i="",a=e.url,r=/\{([^{}]+)\}/;for(let s=r.exec(a);s!==null;s=r.exec(a))i+=a.slice(0,s.index),t.has(s[1])?(i!==""&&n.push({kind:"literal",value:i}),i="",n.push({kind:"variable",name:s[1]})):i+=s[0],a=a.slice(s.index+s[0].length);return i+=a,(i!==""||n.length===0)&&n.push({kind:"literal",value:i}),n}function S(e,t){return e.security.map(n=>n.flatMap(i=>{let a=t.securitySchemes.find(r=>r.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 $(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 y(e){return(e??"").replace(/\s+/g," ").trim().replace(/\\/g,"\\\\").replace(/\|/g,"\\|")}function o(e){switch(e.kind){case"ref":return e.name;case"omit":return e.base;case"scalar":return e.scalar;case"array":return`array of ${o(e.items)}`;case"record":return`map of ${o(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(o).join(" or ");case"intersection":return e.members.map(o).join(" and ");case"object":return"object";case"null":return"null";case"unknown":return"any"}}function P(e){return e.successResponses.some(t=>t.contentType.toLowerCase().includes("json"))?!1:e.successResponses.some(t=>d(t.contentType))}function T(e,t){e.line("| Parameter | In | Type | Required | Description |"),e.line("| --------- | -- | ---- | -------- | ----------- |");for(let n of t)e.line(`| \`${n.name}\` | ${n.in} | ${y(o(n.schema))} | ${n.required?"yes":"no"} | ${y(n.description)} |`);e.blank()}function C(e,t,n){e.line(`### \`${t.specName??t.name}\``),e.blank(),t.summary!==void 0&&(e.line(y(t.summary)),e.blank()),e.line(`\`${t.method.toUpperCase()} ${t.path}\``),e.blank();let i=n.sample(t);if(i!==void 0){e.line("```"+n.language.fence);for(let c of i.source.replace(/\n+$/,"").split(`
8
+ `))e.line(c);e.line("```"),e.blank()}let a=[...t.pathParams,...t.queryParams,...t.headerParams];a.length>0&&T(e,a),t.requestBody!==void 0&&e.line(`Body: \`${t.requestBody.contentType}\`${t.requestBody.required?", required":", optional"}, of type ${o(t.requestBody.schema)}.`);let r=t.successResponses[0];e.line(r===void 0?"Returns no content.":`Returns \`${r.contentType}\`, of type ${o(r.schema)}.`),(n.paginated!==void 0?n.paginated.has(t.name):m(t,n.pagination)!==void 0)&&e.line("This operation is paginated, so the SDK gives it page and item iterators."),t.successResponses.some(c=>c.contentType==="text/event-stream")&&e.line("This operation streams server-sent events, so the SDK iterates the events."),P(t)&&e.line("This operation returns binary content."),e.blank()}function v(e,t){let n=new f;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 r of e.securitySchemes){let s=r.kind==="bearer"?"`Authorization: Bearer <token>`":r.kind==="basic"?"`Authorization: Basic <base64>`":r.kind==="apiKeyHeader"?`the \`${r.headerName}\` header`:r.kind==="apiKeyQuery"?`the \`${r.paramName}\` query parameter`:`the \`${r.cookieName}\` cookie`;n.line(`| \`${r.key}\` | ${r.kind} | ${s} |`)}}n.blank();let i=e.services.flatMap(r=>r.operations),a=[...new Set(i.map(r=>r.tags[0]))];for(let r of a){n.line(r===void 0?"## Operations":`## ${r}`),n.blank();for(let s of i.filter(c=>c.tags[0]===r))C(n,s,t)}return n.toString().replace(/\n{3,}/g,`
9
+
10
+ `).trimEnd()+`
11
+ `}var ee=["Printer","casing","identifierFor","uniqueIdentifiers","RESERVED_WORDS","flattenAllOf","deref","discriminatorCases","jsonSuccessSchema","sseResponse","isMultipartBody","isBinaryContentType","serverUrlParts","securityRequirements","paginationItemSchema","isNullable","unwrapNullable","enumValues","docText","headerCoerceType","schemaAtPointer","paginationRuleFor","renderReferencePage","NotSupportedError"];function E(e){return e}function w(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-")}function A(e){return e.replace(/[^A-Za-z0-9]+/g,"_").replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()}function q(e,t){let n={...e};for(let[i,a]of Object.entries(t))a!==void 0&&(n[i]=a);return n}function de(e){return e}async function ke(e){return(await import("./PZLKJXIF.js")).generateClient(e)}export{m as a,h as b,x as c,k as d,d as e,b as f,S as g,$ as h,v as i,ee as j,E as k,w as l,A as m,q as n,de as o,ke as p};
@@ -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{l as t}from"./4UWA75AV.js";import"./BXI4SF2U.js";import{X as o}from"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";async function i({version:n}){new t(n).logout(),o.output(`Logged out from the Redocly account. \u270B
7
+ import{l as t}from"./K2PGWUA3.js";import"./BXI4SF2U.js";import{X as o}from"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";async function i({version:n}){new t(n).logout(),o.output(`Logged out from the Redocly account. \u270B
8
8
  `)}export{i as handleLogout};