@redocly/cli 2.51.1 → 2.52.0

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 (139) hide show
  1. package/README.md +14 -1
  2. package/THIRD_PARTY_NOTICES +17 -4
  3. package/lib/chunks/2LDFGQ7M.js +67 -0
  4. package/lib/chunks/{KXYI4EET.js → 35R6GCFO.js} +1 -1
  5. package/lib/chunks/{4PIDMMUD.js → 7AUMFZDC.js} +1 -1
  6. package/lib/chunks/{CA4BPC77.js → AGENG2WT.js} +1 -1
  7. package/lib/chunks/{OEBWRENF.js → AQFM7XGG.js} +1 -1
  8. package/lib/chunks/{TMULAWFD.js → B4BGW6LX.js} +1 -1
  9. package/lib/chunks/{LWB43R4X.js → BOUAXXEO.js} +3 -3
  10. package/lib/chunks/{SKB7KFUK.js → BQFGD55Z.js} +1 -1
  11. package/lib/chunks/{IPFRJMV6.js → BT6KOTWJ.js} +1 -1
  12. package/lib/chunks/{LE7OKNLO.js → BXFJJ63W.js} +1 -1
  13. package/lib/chunks/{RXUHCIFX.js → CD6HJQ7Z.js} +1 -1
  14. package/lib/chunks/{3JJEI7CJ.js → CQMMUWIJ.js} +99 -95
  15. package/lib/chunks/{XMYTYWHZ.js → E23GS6YK.js} +1 -1
  16. package/lib/chunks/EI27DJLF.js +7 -0
  17. package/lib/chunks/FPLER37P.js +20 -0
  18. package/lib/chunks/{KQJOSAUI.js → GZNSV6XB.js} +1 -1
  19. package/lib/chunks/{NWMTC4AN.js → IULINGO6.js} +1 -1
  20. package/lib/chunks/JCEAJTUA.js +8 -0
  21. package/lib/chunks/{TSB6PODJ.js → JM7BMZLD.js} +1 -1
  22. package/lib/chunks/{6PX2QTPF.js → JQW53OZ2.js} +1 -1
  23. package/lib/chunks/LD5MEXEL.js +10 -0
  24. package/lib/chunks/{2UDYQ5CZ.js → LJ53IMLM.js} +160 -160
  25. package/lib/chunks/MJSI4VHA.js +184 -0
  26. package/lib/chunks/N6O32QAI.js +7 -0
  27. package/lib/chunks/{2OHNINBQ.js → NIDDLLHO.js} +1 -1
  28. package/lib/chunks/{K732KQHY.js → NY4C4KO6.js} +1 -1
  29. package/lib/chunks/{N5SXQI4I.js → O3T4DGBI.js} +1 -1
  30. package/lib/chunks/{6UH63WWT.js → OMNGRJM6.js} +1 -1
  31. package/lib/chunks/P5GXYHU7.js +7 -0
  32. package/lib/chunks/QB32BX35.js +7 -0
  33. package/lib/chunks/QNFSWXWM.js +9 -0
  34. package/lib/chunks/QTYASRSS.js +20 -0
  35. package/lib/chunks/RCG4MSAO.js +7 -0
  36. package/lib/chunks/{TKFA7G4G.js → RUPZTXQ3.js} +1 -1
  37. package/lib/chunks/{WHTCOU4Z.js → RZMAAWKX.js} +1 -1
  38. package/lib/chunks/{NSKVRJLY.js → SEECFWS6.js} +1 -1
  39. package/lib/chunks/SGNOWOE7.js +30 -0
  40. package/lib/chunks/SVJJMDUS.js +18 -0
  41. package/lib/chunks/TPYGW72X.js +7 -0
  42. package/lib/chunks/{CGINWISC.js → TR2ZE2NA.js} +1 -1
  43. package/lib/chunks/{SXKUE52F.js → U7Z4MLK3.js} +1 -1
  44. package/lib/chunks/UKWZHJSE.js +20 -0
  45. package/lib/chunks/{HJYFWIVE.js → UW4UC7ZI.js} +2 -2
  46. package/lib/chunks/{ZYLX724C.js → UXC4J2II.js} +1 -1
  47. package/lib/chunks/WPCGRKTH.js +7 -0
  48. package/lib/chunks/{Y2G2CYSF.js → X6NXBBZT.js} +1 -1
  49. package/lib/chunks/XAKGO2KF.js +11 -0
  50. package/lib/chunks/XMISXGL7.js +105 -0
  51. package/lib/chunks/{B3QINORT.js → Z3H5BHVF.js} +1 -1
  52. package/lib/eject-assets/generators/cli/docs.ts +1 -1
  53. package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
  54. package/lib/eject-assets/generators/cli/index.ts +2 -2
  55. package/lib/eject-assets/generators/cli/render.ts +1 -1
  56. package/lib/eject-assets/generators/go/client.ts +1 -1
  57. package/lib/eject-assets/generators/go/descriptor.ts +1 -1
  58. package/lib/eject-assets/generators/go/index.ts +2 -2
  59. package/lib/eject-assets/generators/go/models.ts +1 -1
  60. package/lib/eject-assets/generators/go/naming.ts +1 -1
  61. package/lib/eject-assets/generators/go/operations.ts +1 -1
  62. package/lib/eject-assets/generators/go/pagination.ts +1 -1
  63. package/lib/eject-assets/generators/go/types.ts +1 -1
  64. package/lib/eject-assets/generators/mock/faker.ts +1 -1
  65. package/lib/eject-assets/generators/mock/index.ts +2 -2
  66. package/lib/eject-assets/generators/mock/render.ts +1 -1
  67. package/lib/eject-assets/generators/mock/sample.ts +1 -1
  68. package/lib/eject-assets/generators/mock/values.ts +1 -1
  69. package/lib/eject-assets/generators/php/client.ts +1 -1
  70. package/lib/eject-assets/generators/php/descriptor.ts +1 -1
  71. package/lib/eject-assets/generators/php/index.ts +2 -2
  72. package/lib/eject-assets/generators/php/models.ts +1 -1
  73. package/lib/eject-assets/generators/php/naming.ts +1 -1
  74. package/lib/eject-assets/generators/php/operations.ts +1 -1
  75. package/lib/eject-assets/generators/php/pagination.ts +1 -1
  76. package/lib/eject-assets/generators/php/types.ts +1 -1
  77. package/lib/eject-assets/generators/python/client.ts +1 -1
  78. package/lib/eject-assets/generators/python/descriptor.ts +1 -1
  79. package/lib/eject-assets/generators/python/index.ts +2 -2
  80. package/lib/eject-assets/generators/python/models.ts +1 -1
  81. package/lib/eject-assets/generators/python/naming.ts +1 -1
  82. package/lib/eject-assets/generators/python/operations.ts +1 -1
  83. package/lib/eject-assets/generators/python/pagination.ts +1 -1
  84. package/lib/eject-assets/generators/python/types.ts +1 -1
  85. package/lib/eject-assets/generators/swr/index.ts +2 -2
  86. package/lib/eject-assets/generators/swr/render.ts +1 -1
  87. package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
  88. package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
  89. package/lib/eject-assets/generators/transformers/index.ts +2 -2
  90. package/lib/eject-assets/generators/transformers/render.ts +1 -1
  91. package/lib/eject-assets/generators/typescript/banner.ts +1 -1
  92. package/lib/eject-assets/generators/typescript/client.ts +1 -1
  93. package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
  94. package/lib/eject-assets/generators/typescript/index.ts +2 -2
  95. package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
  96. package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
  97. package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
  98. package/lib/eject-assets/generators/typescript/operations.ts +1 -1
  99. package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
  100. package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
  101. package/lib/eject-assets/generators/typescript/types.ts +1 -1
  102. package/lib/eject-assets/generators/zod/index.ts +2 -2
  103. package/lib/eject-assets/generators/zod/schemas.ts +1 -1
  104. package/lib/index.js +198 -191
  105. package/package.json +1 -1
  106. package/lib/chunks/25O4YORJ.js +0 -14
  107. package/lib/chunks/3A5KYQ7N.js +0 -26
  108. package/lib/chunks/5BMLOFU4.js +0 -20
  109. package/lib/chunks/67BLI5YQ.js +0 -90
  110. package/lib/chunks/6ZHC3PYG.js +0 -7
  111. package/lib/chunks/7SSQGR7O.js +0 -20
  112. package/lib/chunks/AH3V6J6B.js +0 -67
  113. package/lib/chunks/BGIV3YYM.js +0 -19
  114. package/lib/chunks/BJDVYUKU.js +0 -177
  115. package/lib/chunks/CXRHOXPI.js +0 -7
  116. package/lib/chunks/ECZA233J.js +0 -19
  117. package/lib/chunks/EE3PGFTZ.js +0 -16
  118. package/lib/chunks/EOS3ZB2L.js +0 -8
  119. package/lib/chunks/K2X43E7U.js +0 -57
  120. package/lib/chunks/L3TZNNJJ.js +0 -13
  121. package/lib/chunks/LAFBWLA7.js +0 -42
  122. package/lib/chunks/NB54XRRU.js +0 -10
  123. package/lib/chunks/NSIQWNYL.js +0 -7
  124. package/lib/chunks/NYFYWKQQ.js +0 -9
  125. package/lib/chunks/OIVSGFXK.js +0 -18
  126. package/lib/chunks/OKRLSOE5.js +0 -22
  127. package/lib/chunks/OZMIIHFH.js +0 -184
  128. package/lib/chunks/PFYPTG4G.js +0 -7
  129. package/lib/chunks/RBHN62FF.js +0 -7
  130. package/lib/chunks/REFX2EKS.js +0 -13
  131. package/lib/chunks/SGBB4RNM.js +0 -11
  132. package/lib/chunks/SQVG3CEM.js +0 -8
  133. package/lib/chunks/TVJE32GA.js +0 -11
  134. package/lib/chunks/VRWULG7P.js +0 -7
  135. package/lib/chunks/VZCENZBY.js +0 -30
  136. package/lib/chunks/WSOCDFHJ.js +0 -7
  137. package/lib/chunks/Y4BUDNR4.js +0 -14
  138. package/lib/chunks/ZBL4IVEW.js +0 -11
  139. /package/lib/chunks/{UKSQ7B5H.js → 2U6O26CV.js} +0 -0
@@ -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 x,b as f,c as m,d}from"./NYFYWKQQ.js";import{b as y,d as h,e as l}from"./NB54XRRU.js";import{m as P}from"./HJYFWIVE.js";import{join as E}from"node:path";function q(e,t){let n=x(e,"tanstack-query");if(n.length===0)return"";let r=t.pagination??new Map;return[j(n,t,r),...n.filter(f).map(i=>K(i,t.queryKeyPrefix)),Q(e,n,r,t.queryKeyPrefix,t.argsStyle),...R(n,r)].join(`
7
+ import{a as x,b as f,c as m,d}from"./QNFSWXWM.js";import{b as y,d as h,e as l}from"./LD5MEXEL.js";import{m as P}from"./UW4UC7ZI.js";import{join as E}from"node:path";function q(e,t){let n=x(e,"tanstack-query");if(n.length===0)return"";let r=t.pagination??new Map;return[j(n,t,r),...n.filter(f).map(i=>K(i,t.queryKeyPrefix)),Q(e,n,r,t.queryKeyPrefix,t.argsStyle),...R(n,r)].join(`
8
8
  `)}function b(e,t){if(!f(e))return!1;let n=t.get(e.name);return n!==void 0&&n.spec.style!=="link"}function j(e,t,n){let r=[...e.some(a=>b(a,n))?["infiniteQueryOptions"]:[],...e.some(f)?["queryOptions"]:[]],s=[...e.filter(m).map(d),"RequestOptions"].sort().map(a=>`type ${a}`),i=[];return r.length>0&&i.push(`import { ${r.join(", ")} } from "@tanstack/${t.framework}-query";`),i.push(`import { client, ${s.join(", ")} } from "${t.sdkModule}";`),i.join(`
9
9
  `)}function K(e,t){let n=M(e,t);return m(e)?`export const ${e.name}QueryKey = (vars?: ${d(e)}) =>
10
10
  vars === undefined ? ([${n}] as const) : ([${n}, vars] as const);`:`export const ${e.name}QueryKey = () => [${n}] as const;`}function M(e,t){return t===void 0?`"${e.name}"`:`${h(t)}, "${e.name}"`}function Q(e,t,n,r,s){return`/**
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ import{a,b,c,d,e}from"./UKWZHJSE.js";import"./2U6O26CV.js";import"./XAKGO2KF.js";import"./BOUAXXEO.js";import"./WZXA5XPB.js";import"./MJSI4VHA.js";import"./NEWT5A6S.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{e as phpDocs,c as phpGenerator,d as phpSample,a as phpType,b as renderPhpModels};
@@ -0,0 +1,20 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ import{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"./XAKGO2KF.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===`
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
+
10
+ `).trimEnd()}
11
+ `}function le(e){let t=e.split(`
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(`
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(`
16
+ `),b=O.replace(/^package .*$/m,`package ${i}`);return[f,{path:f.path.replace(/[^\\/]+$/,"runtime.go"),content:`${g}
17
+ ${b.trimEnd()}
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
+ ${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};
@@ -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"./NYFYWKQQ.js";import{k as l}from"./NB54XRRU.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"./QNFSWXWM.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};
@@ -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"./TSB6PODJ.js";import"./NB54XRRU.js";import"./HJYFWIVE.js";import"./RFWIIJFG.js";export{a as transformersGenerator};
7
+ import{a}from"./JM7BMZLD.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as transformersGenerator};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ import{c}from"./MJSI4VHA.js";import{open as U,readdir as H,stat as J}from"node:fs/promises";import x from"node:path";var L=new Set([".yaml",".yml",".json"]);async function K(e){let n=[];async function t(r){let o=await H(r,{withFileTypes:!0});for(let s of o){if(s.name.startsWith("."))continue;let i=x.join(r,s.name);if(s.isDirectory()){await t(i);continue}s.isFile()&&L.has(x.extname(s.name).toLowerCase())&&n.push(i)}}return await t(e),n.sort(),n}async function G(e,n=4096){let t=await U(e,"r");try{let r=Buffer.allocUnsafe(n),{bytesRead:o}=await t.read(r,0,n,0);return r.toString("utf8",0,o)}finally{await t.close()}}function X(e){return x.resolve(process.cwd(),e)}async function Y(e){let n=await J(e);if(n.isFile())return[e];if(!n.isDirectory())return[];let t=[];async function r(o){let s=await H(o,{withFileTypes:!0});for(let i of s){if(i.name.startsWith("."))continue;let a=x.join(o,i.name);if(i.isDirectory()){await r(a);continue}i.isFile()&&t.push(a)}}return await r(e),t.sort(),t}var z="drift.local",B=`http://${z}`;function l(e){return e===z}var I=new Set(["accept","accept-charset","accept-encoding","accept-language","authorization","baggage","cache-control","cdn-loop","cookie","connection","content-length","content-type","dpr","dnt","downlink","ect","forwarded","host","if-match","if-modified-since","if-none-match","if-range","if-unmodified-since","origin","pragma","priority","range","referer","sec-fetch-dest","sec-fetch-mode","sec-fetch-site","sec-fetch-user","sec-gpc","sentry-trace","te","traceparent","tracestate","upgrade","upgrade-insecure-requests","user-agent","via","x-client-trace-id","x-cloud-trace-context","x-correlation-id","x-http-method-override","x-hub-signature","x-hub-signature-256","x-method-override","x-real-ip","x-request-id","x-forwarded-for","x-forwarded-host","x-forwarded-port","x-forwarded-proto"]),q=["cf-","sec-ch-","sec-fetch-","x-amz-","x-amzn-","x-b3-","x-envoy-","x-forwarded-","x-github-"],T=`
8
+ `;function Z(e){return e.split(T)}function S(e,n,t){let r=n.toLowerCase(),o=e[r];if(o===void 0){e[r]=t;return}e[r]=r==="set-cookie"?`${o}${T}${t}`:`${o},${t}`}function w(e){if(!c(e)&&!Array.isArray(e))return{};let n={};if(Array.isArray(e)){for(let t of e){if(!c(t))continue;let{name:r,value:o}=t;typeof r=="string"&&o!==void 0&&S(n,r,String(o))}return n}for(let[t,r]of Object.entries(e))if(r!=null){if(Array.isArray(r)){for(let o of r)S(n,t,String(o));continue}S(n,t,String(r))}return n}function m(e){try{return new URL(e)}catch{return new URL(e,B)}}function N(e){return e.length>1&&e.endsWith("/")?e.slice(0,-1):e}function b(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(e){let n=[],t=0,r=e.startsWith("/")?e:`/${e}`,s=N(r).split("/").map(i=>{if(!i)return"";let a=[...i.matchAll(/\{([^}]+)\}/g)],h=n.length,u="",p=0,f=0;for(let[y,d]of a.entries()){let R=i.slice(f,d.index);u+=b(R),p+=R.length,n.push(d[1]),f=d.index+d[0].length;let E=a[y+1];if(!E){u+="([^/]+)";continue}let A=i.slice(f,E.index);u+=A?`((?:(?!${b(A)})[^/])+)`:"([^/])"}let g=i.slice(f);return u+=b(g),p+=g.length,n.length===h?t+=2:p>0&&(t+=1),u}).join("/");return{regex:new RegExp(`^${s||"/"}$`),params:n,score:t}}function k(e,n){if(n&&P(e))try{return JSON.parse(n)}catch{return}}function C(e){return e?e.split(";")[0]?.trim().toLowerCase()??"":""}function P(e){let n=C(e);return n==="application/json"||n.endsWith("+json")}function ee(e,n){let t=C(n);if(!t)return e["application/json"]??e["*/*"];if(e[t]!==void 0)return e[t];let[r,o]=t.split("/");if(r&&o){let s=`${r}/*`;if(e[s]!==void 0)return e[s]}return e["*/*"]}function ne(e){let n=new Set,t=[];for(let r of e){let o=r.trim().toLowerCase();o.length!==0&&(o.endsWith("*")?t.push(o.slice(0,-1)):n.add(o))}return{names:n,prefixes:t}}function te(e,n){let t=e.toLowerCase();return t.startsWith(":")||I.has(t)||q.some(r=>t.startsWith(r))?!0:n?n.names.has(t)||n.prefixes.some(r=>t.startsWith(r)):!1}import{createReadStream as F}from"node:fs";import{readFile as j}from"node:fs/promises";import{createInterface as W}from"node:readline";function D(e){if(e!=null){if(typeof e=="string")return e;if(Buffer.isBuffer(e))return e.toString("utf8");if(c(e)||Array.isArray(e))try{return JSON.stringify(e)}catch{return String(e)}return String(e)}}function ue(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()!==""){let n=Number(e);if(Number.isFinite(n))return n}}function $(e,n){if(e!=null){if(n==="base64"&&typeof e=="string")try{return Buffer.from(e,"base64").toString("utf8")}catch{return e}return D(e)}}function fe(e,n,t){let r=e.method?.toUpperCase(),o=e.url;if(!r||!o)return null;let s=w(e.requestHeaders),i=m(o);if(l(i.host)&&s.host)try{i=new URL(`${i.protocol}//${s.host}${i.pathname}${i.search}`)}catch{i=m(o)}let a=e.requestContentType??s["content-type"],h=$(e.requestBody),u={method:r,url:i.toString(),path:i.pathname,query:i.searchParams,protocol:i.protocol,protocolKnown:e.schemeKnown??/^https?:\/\//i.test(o),host:l(i.host)?void 0:i.host||void 0,headers:s,contentType:a,bodyText:h,bodyJson:k(a,h)},p,f=e.responseStatus;if(f!==void 0){let g=w(e.responseHeaders),y=e.responseContentType??g["content-type"],d=$(e.responseBody);p={status:f,statusText:e.responseStatusText,headers:g,contentType:y,bodyText:d,bodyJson:k(y,d)}}return{index:n,source:t,startedAt:e.startedAt,request:u,response:p,raw:e.raw}}async function*de(e){let n=F(e,{encoding:"utf8"}),t=W({input:n,crlfDelay:1/0});for await(let r of t){let o=r.trim();if(o)try{let s=JSON.parse(o);c(s)&&(yield s)}catch{}}}async function*pe(e,n){let t=await j(e,"utf8"),r=JSON.parse(t);if(n)for(let o of n.split("."))r=c(r)?r[o]:void 0;if(Array.isArray(r))for(let o of r)c(o)&&(yield o)}function ge(e){return w(e)["content-type"]}function he(e){return e?.replace(/\/+$/,"")||void 0}function O(e,n){if(!n||n==="/")return e||"/";if(e===n)return"/";if(e.startsWith(`${n}/`))return e.slice(n.length)||"/"}function ye(e,n){if(n.startsWith("/"))return O(e.path,n);let t=m(n.includes("://")?n:`http://${n}`);if(!(l(t.host)||e.host!==void 0&&e.host.toLowerCase()!==t.host))return O(e.path,N(t.pathname))}export{K as a,G as b,X as c,Y as d,l as e,Z as f,m as g,N as h,v as i,C as j,P as k,ee as l,ne as m,te as n,D as o,ue as p,$ as q,fe as r,de as s,pe as t,ge as u,he as v,ye as w};
@@ -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{e as T,k as y}from"./NB54XRRU.js";import{join as q}from"node:path";var a=" ";function j(r){return`transform${y(r)}`}var C="type __Writable<T> = { -readonly [K in keyof T]: T[K] };",A=!1;function D(r){return{text:r,path:[r]}}function W(r,t){return{text:`${r.text}[${JSON.stringify(t)}]`,path:[...r.path,t]}}function d(r,t,n){if(k(r))return!0;switch(r.kind){case"array":return d(r.items,t,n);case"union":return r.members.some(o=>d(o,t,n));case"ref":{if(n.has(r.name))return!1;let o=t.get(r.name);return o!==void 0&&d(o,t,new Set(n).add(r.name))}default:return!1}}function k(r){return r.kind==="scalar"&&r.scalar==="string"&&(r.metadata?.format==="date-time"||r.metadata?.format==="date")}function $(r,t,n){if(k(r))return!0;switch(r.kind){case"array":return $(r.items,t,n);case"record":return $(r.value,t,n);case"object":return r.properties.some(o=>$(o.schema,t,n));case"union":case"intersection":return r.members.some(o=>$(o,t,n));case"ref":{let o=t.get(r.name);return o!==void 0&&!n.has(r.name)?$(o,t,new Set(n).add(r.name)):!1}default:return!1}}function l(r,t,n,o=!1){return o?[`${n}if (${r}) {`,...t(n+a),`${n}}`]:[`${n}if (${r})`,...t(n+a)]}function v(r,t,n=!1){let o=n?B(r):r.text;return u=>[`${u}${o} = ${t};`]}function S(r){return t=>[`${t}${r};`]}function B(r){if(r.path.length<2)return r.text;A=!0;let t={text:r.text.slice(0,r.text.lastIndexOf("[")),path:r.path.slice(0,-1)},n=r.path[r.path.length-1];return`(${t.text} as __Writable<${G(t)}>)[${JSON.stringify(n)}]`}function G(r){let t=`typeof ${r.path[0]}`;for(let n of r.path.slice(1))t=`NonNullable<${t}>[${JSON.stringify(n)}]`;return`NonNullable<${t}>`}function K(r){return r==="data"?"item":`item${Number(r.slice(4))+1}`}function p(r,t,n,o,u,e,s=!1){if(k(t))return l(`typeof ${r.text} === "string"`,v(r,`new Date(${r.text})`,s),e);switch(t.kind){case"ref":return h(r,t.name,n,o,e,s);case"object":{let f=[];for(let c of t.properties)f.push(...b(W(r,c.name),c.schema,n,o,u,e,c.readOnly===!0));return f}case"array":return P(r,t.items,n,o,u,e,s);case"record":return I(r,t.value,n,o,u,e,!0);case"intersection":{let f=[];for(let c of t.members)f.push(...p(r,c,n,o,u,e,s));return f}case"union":return U(r,t.members,n,o,u,e,s);default:return[]}}function U(r,t,n,o,u,e,s=!1){let f=[],c=e+a,x=[];for(let i of t)if(k(i))f.push(...p(r,i,n,o,u,e,s));else if(i.kind==="ref"){if(!$(i,n,o))continue;let w=`${j(i.name)}(${r.text} as ${i.name})`,_=d(i,n,o)?v(r,w,s):S(w);x.push(..._(c))}else x.push(...p(r,i,n,o,u,c,s));return x.length>0&&f.push(...l(`${r.text} && typeof ${r.text} === "object"`,()=>x,e,!0)),f}function h(r,t,n,o,u,e=!1){let s={kind:"ref",name:t};if(!$(s,n,o))return[];let f=`${j(t)}(${r.text})`;return l(r.text,d(s,n,o)?v(r,f,e):S(f),u)}function b(r,t,n,o,u,e,s=!1){if(t.kind==="ref")return h(r,t.name,n,o,e,s);if(t.kind==="object"){let f=p(r,t,n,o,u,e+a);return f.length===0?[]:l(r.text,()=>f,e,!0)}return p(r,t,n,o,u,e,s)}function m(r,t,n,o,u=0){if(k(t))return`new Date(${r})`;if(t.kind==="ref"&&d(t,n,o))return`${j(t.name)}(${r})`;if(t.kind==="array"){let e=t.items.kind==="array"?E(u+1):"v",s=m(e,t.items,n,o,u+1);return s===null?null:`${r}.map(${e} => ${s})`}return null}function E(r){return r<=1?"row":`row${r}`}function P(r,t,n,o,u,e,s=!1){let f=t.kind==="array"?E(1):"v",c=m(f,t,n,o,1);return c!==null?l(`Array.isArray(${r.text})`,v(r,`${r.text}.map(${f} => ${c})`,s),e):t.kind==="ref"?$(t,n,o)?l(`Array.isArray(${r.text})`,S(`${r.text}.forEach(${j(t.name)})`),e):[]:I(r,t,n,o,u,e,!1)}function I(r,t,n,o,u,e,s){if(s){let i={text:`${r.text}[__k]`,path:[...r.path,"__k"]},w=m(i.text,t,n,o);if(w!==null){let _=k(t)?`typeof ${i.text} === "string"`:`Array.isArray(${i.text})`;return l(r.text,O=>[`${O}for (const __k of Object.keys(${r.text}))`,...l(_,J=>[`${J}${i.text} = ${w};`],O+a)],e)}}let f=K(u),c=p(D(f),t,n,o,f,e+a+a);if(c.length===0)return[];let x=s?`Object.values(${r.text})`:r.text;return l(s?r.text:`Array.isArray(${r.text})`,i=>[`${i}${x}.forEach(${f} => {`,...c,`${i}});`],e)}function R(r,t){let n=r.name,o=D("data"),u=r.schema.kind==="ref"?h(o,r.schema.name,t,new Set,a):p(o,r.schema,t,new Set,"data",a);return[`export const ${j(r.name)} = (data: ${n}): ${n} => {`,...u,`${a}return data;`,"};"].join(`
7
+ import{e as T,k as y}from"./LD5MEXEL.js";import{join as q}from"node:path";var a=" ";function j(r){return`transform${y(r)}`}var C="type __Writable<T> = { -readonly [K in keyof T]: T[K] };",A=!1;function D(r){return{text:r,path:[r]}}function W(r,t){return{text:`${r.text}[${JSON.stringify(t)}]`,path:[...r.path,t]}}function d(r,t,n){if(k(r))return!0;switch(r.kind){case"array":return d(r.items,t,n);case"union":return r.members.some(o=>d(o,t,n));case"ref":{if(n.has(r.name))return!1;let o=t.get(r.name);return o!==void 0&&d(o,t,new Set(n).add(r.name))}default:return!1}}function k(r){return r.kind==="scalar"&&r.scalar==="string"&&(r.metadata?.format==="date-time"||r.metadata?.format==="date")}function $(r,t,n){if(k(r))return!0;switch(r.kind){case"array":return $(r.items,t,n);case"record":return $(r.value,t,n);case"object":return r.properties.some(o=>$(o.schema,t,n));case"union":case"intersection":return r.members.some(o=>$(o,t,n));case"ref":{let o=t.get(r.name);return o!==void 0&&!n.has(r.name)?$(o,t,new Set(n).add(r.name)):!1}default:return!1}}function l(r,t,n,o=!1){return o?[`${n}if (${r}) {`,...t(n+a),`${n}}`]:[`${n}if (${r})`,...t(n+a)]}function v(r,t,n=!1){let o=n?B(r):r.text;return u=>[`${u}${o} = ${t};`]}function S(r){return t=>[`${t}${r};`]}function B(r){if(r.path.length<2)return r.text;A=!0;let t={text:r.text.slice(0,r.text.lastIndexOf("[")),path:r.path.slice(0,-1)},n=r.path[r.path.length-1];return`(${t.text} as __Writable<${G(t)}>)[${JSON.stringify(n)}]`}function G(r){let t=`typeof ${r.path[0]}`;for(let n of r.path.slice(1))t=`NonNullable<${t}>[${JSON.stringify(n)}]`;return`NonNullable<${t}>`}function K(r){return r==="data"?"item":`item${Number(r.slice(4))+1}`}function p(r,t,n,o,u,e,s=!1){if(k(t))return l(`typeof ${r.text} === "string"`,v(r,`new Date(${r.text})`,s),e);switch(t.kind){case"ref":return h(r,t.name,n,o,e,s);case"object":{let f=[];for(let c of t.properties)f.push(...b(W(r,c.name),c.schema,n,o,u,e,c.readOnly===!0));return f}case"array":return P(r,t.items,n,o,u,e,s);case"record":return I(r,t.value,n,o,u,e,!0);case"intersection":{let f=[];for(let c of t.members)f.push(...p(r,c,n,o,u,e,s));return f}case"union":return U(r,t.members,n,o,u,e,s);default:return[]}}function U(r,t,n,o,u,e,s=!1){let f=[],c=e+a,x=[];for(let i of t)if(k(i))f.push(...p(r,i,n,o,u,e,s));else if(i.kind==="ref"){if(!$(i,n,o))continue;let w=`${j(i.name)}(${r.text} as ${i.name})`,_=d(i,n,o)?v(r,w,s):S(w);x.push(..._(c))}else x.push(...p(r,i,n,o,u,c,s));return x.length>0&&f.push(...l(`${r.text} && typeof ${r.text} === "object"`,()=>x,e,!0)),f}function h(r,t,n,o,u,e=!1){let s={kind:"ref",name:t};if(!$(s,n,o))return[];let f=`${j(t)}(${r.text})`;return l(r.text,d(s,n,o)?v(r,f,e):S(f),u)}function b(r,t,n,o,u,e,s=!1){if(t.kind==="ref")return h(r,t.name,n,o,e,s);if(t.kind==="object"){let f=p(r,t,n,o,u,e+a);return f.length===0?[]:l(r.text,()=>f,e,!0)}return p(r,t,n,o,u,e,s)}function m(r,t,n,o,u=0){if(k(t))return`new Date(${r})`;if(t.kind==="ref"&&d(t,n,o))return`${j(t.name)}(${r})`;if(t.kind==="array"){let e=t.items.kind==="array"?E(u+1):"v",s=m(e,t.items,n,o,u+1);return s===null?null:`${r}.map(${e} => ${s})`}return null}function E(r){return r<=1?"row":`row${r}`}function P(r,t,n,o,u,e,s=!1){let f=t.kind==="array"?E(1):"v",c=m(f,t,n,o,1);return c!==null?l(`Array.isArray(${r.text})`,v(r,`${r.text}.map(${f} => ${c})`,s),e):t.kind==="ref"?$(t,n,o)?l(`Array.isArray(${r.text})`,S(`${r.text}.forEach(${j(t.name)})`),e):[]:I(r,t,n,o,u,e,!1)}function I(r,t,n,o,u,e,s){if(s){let i={text:`${r.text}[__k]`,path:[...r.path,"__k"]},w=m(i.text,t,n,o);if(w!==null){let _=k(t)?`typeof ${i.text} === "string"`:`Array.isArray(${i.text})`;return l(r.text,O=>[`${O}for (const __k of Object.keys(${r.text}))`,...l(_,J=>[`${J}${i.text} = ${w};`],O+a)],e)}}let f=K(u),c=p(D(f),t,n,o,f,e+a+a);if(c.length===0)return[];let x=s?`Object.values(${r.text})`:r.text;return l(s?r.text:`Array.isArray(${r.text})`,i=>[`${i}${x}.forEach(${f} => {`,...c,`${i}});`],e)}function R(r,t){let n=r.name,o=D("data"),u=r.schema.kind==="ref"?h(o,r.schema.name,t,new Set,a):p(o,r.schema,t,new Set,"data",a);return[`export const ${j(r.name)} = (data: ${n}): ${n} => {`,...u,`${a}return data;`,"};"].join(`
8
8
  `)}function M(r,t){let n=new Map(r.schemas.map(f=>[f.name,f.schema])),o=r.schemas.filter(f=>$(f.schema,n,new Set));if(o.length===0)return"";let u=o.map(f=>T(f.name)).join(", ");A=!1;let e=o.map(f=>R(f,n));return[`import type { ${u} } from ${JSON.stringify(t.sdkModule)};`,...A?[C]:[],...e].join(`
9
9
 
10
10
  `)}var X=({model:r,output:t,banner:n,emit:o})=>{let u=M(r,{sdkModule:`./${t.stem}.${o.importExt??"js"}`});if(u==="")return[];let e=n.map(s=>`// ${s}`).join(`
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{h as a}from"./ZYLX724C.js";import"./P26PQ2RU.js";import"./RS5PUOTT.js";import"./CXRHOXPI.js";import"./BXI4SF2U.js";import"./32XCOMOR.js";import"./OZMIIHFH.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{a as RedoclyOAuthClient};
7
+ import{h as a}from"./UXC4J2II.js";import"./RS5PUOTT.js";import"./BXI4SF2U.js";import"./32XCOMOR.js";import"./P26PQ2RU.js";import"./P5GXYHU7.js";import"./MJSI4VHA.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{a as RedoclyOAuthClient};
@@ -0,0 +1,10 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ import{c as f}from"./UW4UC7ZI.js";var u=/^[A-Za-z_$][A-Za-z0-9_$]*$/,o=f.typescript;function m(e){return u.test(e)}function E(e){return u.test(e)&&!o.has(e)}function p(e){let i=e.replace(/[^A-Za-z0-9_$]/g,"_");return(i===""||/^[0-9]/.test(i)||o.has(i))&&(i=`_${i}`),i}var l={"<":"\\u003C",">":"\\u003E","\u2028":"\\u2028","\u2029":"\\u2029"};function s(e){return JSON.stringify(e).replace(/[<>\u2028\u2029]/g,i=>l[i])}function L(e){return u.test(e)&&!o.has(e)?e:s(e)}function S(e,i){let n=p(e),r=n,t=2;for(;i.has(r);)r=`${n}_${t++}`;return i.add(r),r}var _=s;function c(e){if(typeof e=="string")return s(e);if(typeof e=="boolean"||e===null||typeof e=="number")return String(e);if(Array.isArray(e))return`[${e.map(c).join(", ")}]`;let i=Object.entries(e).map(([n,r])=>`${m(n)?n:s(n)}: ${c(r)}`);return i.length===0?"{}":`{ ${i.join(", ")} }`}function x(e){return e.replace(/\*\//g,"*\\/")}function y(e,i){let n=h(e,i);return n.length===0?void 0:n.join(`
8
+ `)}function h(e,i){let n=[];return e&&e.trim()&&n.push(...g($(e))),i&&n.push(...d(i)),n}function d(e){let i=[],n=(r,t)=>{t===void 0?i.push(`@${r}`):i.push(`@${r} ${t}`)};return e.minimum!==void 0&&n("minimum",e.minimum),e.maximum!==void 0&&n("maximum",e.maximum),e.exclusiveMinimum!==void 0&&n("exclusiveMinimum",e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&n("exclusiveMaximum",e.exclusiveMaximum),e.minLength!==void 0&&n("minLength",e.minLength),e.maxLength!==void 0&&n("maxLength",e.maxLength),e.pattern!==void 0&&n("pattern",x(e.pattern)),e.minItems!==void 0&&n("minItems",e.minItems),e.maxItems!==void 0&&n("maxItems",e.maxItems),e.uniqueItems===!0&&n("uniqueItems"),e.format!==void 0&&n("format",e.format),e.deprecated===!0&&n("deprecated"),i}function g(e){let i=0,n=e.length;for(;i<n&&e[i]==="";)i++;for(;n>i&&e[n-1]==="";)n--;return e.slice(i,n)}function C(e){return e[0].toUpperCase()+e.slice(1)}function j(e){let i=e.split(/[-_]/).filter(n=>n.length>0).map((n,r)=>{let t=n.toLowerCase();return r===0?t:t.charAt(0).toUpperCase()+t.slice(1)}).join("");return p(i)}function $(e){return e.replace(/\r\n/g,`
9
+ `).split(`
10
+ `).map(i=>i.trimEnd())}export{m as a,E as b,p as c,s as d,L as e,S as f,_ as g,c as h,x as i,y as j,C as k,j as l,$ as m};