@redocly/cli 2.49.1 → 2.50.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.
- package/lib/chunks/{VN7LZQGN.js → 2MDLP4KJ.js} +1 -1
- package/lib/chunks/{W5DUUIKF.js → 4G6EYFND.js} +1 -1
- package/lib/chunks/{7K66NKDE.js → 5NWHDZIY.js} +1 -1
- package/lib/chunks/{WZ7U5J57.js → 5WFODJ7E.js} +1 -1
- package/lib/chunks/{CWHIZM5P.js → 6I34CQBG.js} +1 -1
- package/lib/chunks/{FRTUU2MY.js → 6SPYPUI6.js} +1 -1
- package/lib/chunks/{4PPXJI4C.js → AB3HPOHP.js} +1 -1
- package/lib/chunks/{M3XP3LQ3.js → AYCCHB2H.js} +77 -77
- package/lib/chunks/{YOFC4HMY.js → BPXJZY3G.js} +1 -1
- package/lib/chunks/{4OMVSQVK.js → BQM4LA5W.js} +1 -1
- package/lib/chunks/{7RCYOS5C.js → BTDYBYOM.js} +1 -1
- package/lib/chunks/{D7CUMUET.js → C7GGV6MA.js} +1 -1
- package/lib/chunks/{YAMJYOV5.js → CGWDSTQU.js} +1 -1
- package/lib/chunks/{5HNCFY3B.js → DV7Y25N6.js} +1 -1
- package/lib/chunks/{QKGUXGJO.js → EC24G6EZ.js} +1 -1
- package/lib/chunks/{C7PTGUVO.js → EZ3GAVTS.js} +1 -1
- package/lib/chunks/{GTD7QSP5.js → FLT7L6M6.js} +3 -3
- package/lib/chunks/{TNYG2WWT.js → FNNGQ3LB.js} +1 -1
- package/lib/chunks/{T5DNFYA3.js → GAYNNACL.js} +5 -5
- package/lib/chunks/{AEYKQB3Y.js → GINMHJWC.js} +1 -1
- package/lib/chunks/{VEQESANY.js → GQLQMPIU.js} +1 -1
- package/lib/chunks/{WAUR32EX.js → HPMV62YM.js} +1 -1
- package/lib/chunks/{MOKGEIKX.js → JIYXF2LJ.js} +1 -1
- package/lib/chunks/{KD4AOMY6.js → JQNS7VUU.js} +4 -4
- package/lib/chunks/{ENKAF6J7.js → KM7PMMIJ.js} +1 -1
- package/lib/chunks/{HKNDR3ZE.js → L3LA7UTJ.js} +1 -1
- package/lib/chunks/{M3HF5ZRI.js → M5NHHJLI.js} +1 -1
- package/lib/chunks/{G4MWXFHH.js → OSHXPRZS.js} +1 -1
- package/lib/chunks/{3BZL5B4H.js → OUY7OMOM.js} +1 -1
- package/lib/chunks/{7EFXGPDR.js → OWY3GI2B.js} +1 -1
- package/lib/chunks/{UHWZYG4E.js → OYK34CLF.js} +1 -1
- package/lib/chunks/{WG3HZCUF.js → QBLBI6YV.js} +1 -1
- package/lib/chunks/{3O6RY2OI.js → QE2DAZZS.js} +1 -1
- package/lib/chunks/{A5ASAZNF.js → QFDZWJOM.js} +1 -1
- package/lib/chunks/{GZI26L3N.js → RT7XNB4J.js} +1 -1
- package/lib/chunks/{GG676VHI.js → TOMUPTSM.js} +1 -1
- package/lib/chunks/{KW2DYFTU.js → UTMTQAX7.js} +1 -1
- package/lib/chunks/{JVOPWBET.js → UVVDFDXF.js} +1 -1
- package/lib/chunks/{VGBSMXRM.js → VFTQZ2K5.js} +2 -2
- package/lib/chunks/{H2G5AV35.js → W4SAP7O3.js} +3 -3
- package/lib/chunks/{N4AFJIJZ.js → WSWWRWOX.js} +1 -1
- package/lib/chunks/{ULOXDWJT.js → WUWXNE33.js} +1 -1
- package/lib/chunks/{PQ2JPZXM.js → WV47KPC2.js} +1 -1
- package/lib/chunks/{3UDONSS2.js → WYBHMXUT.js} +1 -1
- package/lib/chunks/{KW4NHNFI.js → X7EILS2N.js} +1 -1
- package/lib/chunks/{TXGTKM76.js → XX6MHUWG.js} +1 -1
- package/lib/chunks/{RQPDQIKC.js → Y3KBABBM.js} +1 -1
- package/lib/chunks/{TFNO2II2.js → YAOO5YIR.js} +1 -1
- package/lib/chunks/{J7XZNTM3.js → YHN6XBDC.js} +1 -1
- package/lib/chunks/{GULPNFGZ.js → YMZURCC6.js} +1 -1
- package/lib/chunks/{SSHEKZ4L.js → Z46FHG6E.js} +1 -1
- package/lib/eject-assets/generators/cli/docs.ts +1 -1
- package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
- package/lib/eject-assets/generators/cli/index.ts +2 -2
- package/lib/eject-assets/generators/cli/render.ts +1 -1
- package/lib/eject-assets/generators/go/client.ts +1 -1
- package/lib/eject-assets/generators/go/descriptor.ts +1 -1
- package/lib/eject-assets/generators/go/index.ts +2 -2
- package/lib/eject-assets/generators/go/models.ts +1 -1
- package/lib/eject-assets/generators/go/naming.ts +1 -1
- package/lib/eject-assets/generators/go/operations.ts +1 -1
- package/lib/eject-assets/generators/go/pagination.ts +1 -1
- package/lib/eject-assets/generators/go/types.ts +1 -1
- package/lib/eject-assets/generators/mock/faker.ts +1 -1
- package/lib/eject-assets/generators/mock/index.ts +2 -2
- package/lib/eject-assets/generators/mock/render.ts +1 -1
- package/lib/eject-assets/generators/mock/sample.ts +1 -1
- package/lib/eject-assets/generators/mock/values.ts +1 -1
- package/lib/eject-assets/generators/php/client.ts +1 -1
- package/lib/eject-assets/generators/php/descriptor.ts +1 -1
- package/lib/eject-assets/generators/php/index.ts +2 -2
- package/lib/eject-assets/generators/php/models.ts +1 -1
- package/lib/eject-assets/generators/php/naming.ts +1 -1
- package/lib/eject-assets/generators/php/operations.ts +1 -1
- package/lib/eject-assets/generators/php/pagination.ts +1 -1
- package/lib/eject-assets/generators/php/types.ts +1 -1
- package/lib/eject-assets/generators/python/client.ts +1 -1
- package/lib/eject-assets/generators/python/descriptor.ts +1 -1
- package/lib/eject-assets/generators/python/index.ts +2 -2
- package/lib/eject-assets/generators/python/models.ts +1 -1
- package/lib/eject-assets/generators/python/naming.ts +1 -1
- package/lib/eject-assets/generators/python/operations.ts +1 -1
- package/lib/eject-assets/generators/python/pagination.ts +1 -1
- package/lib/eject-assets/generators/python/types.ts +1 -1
- package/lib/eject-assets/generators/swr/index.ts +2 -2
- package/lib/eject-assets/generators/swr/render.ts +1 -1
- package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
- package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
- package/lib/eject-assets/generators/transformers/index.ts +2 -2
- package/lib/eject-assets/generators/transformers/render.ts +1 -1
- package/lib/eject-assets/generators/typescript/banner.ts +1 -1
- package/lib/eject-assets/generators/typescript/client.ts +1 -1
- package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
- package/lib/eject-assets/generators/typescript/index.ts +2 -2
- package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
- package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
- package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
- package/lib/eject-assets/generators/typescript/operations.ts +1 -1
- package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
- package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
- package/lib/eject-assets/generators/typescript/types.ts +1 -1
- package/lib/eject-assets/generators/zod/index.ts +2 -2
- package/lib/eject-assets/generators/zod/schemas.ts +1 -1
- package/lib/index.js +14 -14
- package/package.json +1 -1
|
@@ -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{c as Wz,e as jz}from"./
|
|
7
|
+
import{c as Wz,e as jz}from"./GAYNNACL.js";import{b as g1}from"./DV7Y25N6.js";import{a as nre,b as rre}from"./O6PRCLSV.js";import{a as tre}from"./RS5PUOTT.js";import{d as Uz,e as Hz}from"./UVVDFDXF.js";import"./32XCOMOR.js";import{V as zv,k as $ne,s as p1,v as zz,w as ere}from"./AYCCHB2H.js";import"./NEWT5A6S.js";import{a as Br,b as Bz,c as V,d as Zne,e as Bv,f as Jne}from"./RFWIIJFG.js";var Yz=V((Vz,Gz)=>{(function(){var e=function(t){var n=new e.Builder;return n.pipeline.add(e.trimmer,e.stopWordFilter,e.stemmer),n.searchPipeline.add(e.stemmer),t.call(n,n),n.build()};e.version="2.3.9";e.utils={},e.utils.warn=(function(t){return function(n){t.console&&console.warn&&console.warn(n)}})(this),e.utils.asString=function(t){return t==null?"":t.toString()},e.utils.clone=function(t){if(t==null)return t;for(var n=Object.create(null),r=Object.keys(t),i=0;i<r.length;i++){var o=r[i],s=t[o];if(Array.isArray(s)){n[o]=s.slice();continue}if(typeof s=="string"||typeof s=="number"||typeof s=="boolean"){n[o]=s;continue}throw new TypeError("clone is not deep and does not support nested objects")}return n},e.FieldRef=function(t,n,r){this.docRef=t,this.fieldName=n,this._stringValue=r},e.FieldRef.joiner="/",e.FieldRef.fromString=function(t){var n=t.indexOf(e.FieldRef.joiner);if(n===-1)throw"malformed field ref string";var r=t.slice(0,n),i=t.slice(n+1);return new e.FieldRef(i,r,t)},e.FieldRef.prototype.toString=function(){return this._stringValue==null&&(this._stringValue=this.fieldName+e.FieldRef.joiner+this.docRef),this._stringValue};e.Set=function(t){if(this.elements=Object.create(null),t){this.length=t.length;for(var n=0;n<this.length;n++)this.elements[t[n]]=!0}else this.length=0},e.Set.complete={intersect:function(t){return t},union:function(){return this},contains:function(){return!0}},e.Set.empty={intersect:function(){return this},union:function(t){return t},contains:function(){return!1}},e.Set.prototype.contains=function(t){return!!this.elements[t]},e.Set.prototype.intersect=function(t){var n,r,i,o=[];if(t===e.Set.complete)return this;if(t===e.Set.empty)return t;this.length<t.length?(n=this,r=t):(n=t,r=this),i=Object.keys(n.elements);for(var s=0;s<i.length;s++){var a=i[s];a in r.elements&&o.push(a)}return new e.Set(o)},e.Set.prototype.union=function(t){return t===e.Set.complete?e.Set.complete:t===e.Set.empty?this:new e.Set(Object.keys(this.elements).concat(Object.keys(t.elements)))},e.idf=function(t,n){var r=0;for(var i in t)i!="_index"&&(r+=Object.keys(t[i]).length);var o=(n-r+.5)/(r+.5);return Math.log(1+Math.abs(o))},e.Token=function(t,n){this.str=t||"",this.metadata=n||{}},e.Token.prototype.toString=function(){return this.str},e.Token.prototype.update=function(t){return this.str=t(this.str,this.metadata),this},e.Token.prototype.clone=function(t){return t=t||function(n){return n},new e.Token(t(this.str,this.metadata),this.metadata)};e.tokenizer=function(t,n){if(t==null||t==null)return[];if(Array.isArray(t))return t.map(function(d){return new e.Token(e.utils.asString(d).toLowerCase(),e.utils.clone(n))});for(var r=t.toString().toLowerCase(),i=r.length,o=[],s=0,a=0;s<=i;s++){var l=r.charAt(s),c=s-a;if(l.match(e.tokenizer.separator)||s==i){if(c>0){var y=e.utils.clone(n)||{};y.position=[a,c],y.index=o.length,o.push(new e.Token(r.slice(a,s),y))}a=s+1}}return o},e.tokenizer.separator=/[\s\-]+/;e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,n){n in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+n),t.label=n,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var n=t.label&&t.label in this.registeredFunctions;n||e.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index.
|
|
8
8
|
`,t)},e.Pipeline.load=function(t){var n=new e.Pipeline;return t.forEach(function(r){var i=e.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(n){e.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},e.Pipeline.prototype.after=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(t);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},e.Pipeline.prototype.before=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(t);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},e.Pipeline.prototype.remove=function(t){var n=this._stack.indexOf(t);n!=-1&&this._stack.splice(n,1)},e.Pipeline.prototype.run=function(t){for(var n=this._stack.length,r=0;r<n;r++){for(var i=this._stack[r],o=[],s=0;s<t.length;s++){var a=i(t[s],s,t);if(!(a==null||a===""))if(Array.isArray(a))for(var l=0;l<a.length;l++)o.push(a[l]);else o.push(a)}t=o}return t},e.Pipeline.prototype.runString=function(t,n){var r=new e.Token(t,n);return this.run([r]).map(function(i){return i.toString()})},e.Pipeline.prototype.reset=function(){this._stack=[]},e.Pipeline.prototype.toJSON=function(){return this._stack.map(function(t){return e.Pipeline.warnIfFunctionNotRegistered(t),t.label})};e.Vector=function(t){this._magnitude=0,this.elements=t||[]},e.Vector.prototype.positionForIndex=function(t){if(this.elements.length==0)return 0;for(var n=0,r=this.elements.length/2,i=r-n,o=Math.floor(i/2),s=this.elements[o*2];i>1&&(s<t&&(n=o),s>t&&(r=o),s!=t);)i=r-n,o=n+Math.floor(i/2),s=this.elements[o*2];if(s==t||s>t)return o*2;if(s<t)return(o+1)*2},e.Vector.prototype.insert=function(t,n){this.upsert(t,n,function(){throw"duplicate index"})},e.Vector.prototype.upsert=function(t,n,r){this._magnitude=0;var i=this.positionForIndex(t);this.elements[i]==t?this.elements[i+1]=r(this.elements[i+1],n):this.elements.splice(i,0,t,n)},e.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var t=0,n=this.elements.length,r=1;r<n;r+=2){var i=this.elements[r];t+=i*i}return this._magnitude=Math.sqrt(t)},e.Vector.prototype.dot=function(t){for(var n=0,r=this.elements,i=t.elements,o=r.length,s=i.length,a=0,l=0,c=0,y=0;c<o&&y<s;)a=r[c],l=i[y],a<l?c+=2:a>l?y+=2:a==l&&(n+=r[c+1]*i[y+1],c+=2,y+=2);return n},e.Vector.prototype.similarity=function(t){return this.dot(t)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var t=new Array(this.elements.length/2),n=1,r=0;n<this.elements.length;n+=2,r++)t[r]=this.elements[n];return t},e.Vector.prototype.toJSON=function(){return this.elements};e.stemmer=(function(){var t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},n={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},r="[^aeiou]",i="[aeiouy]",o=r+"[^aeiouy]*",s=i+"[aeiou]*",a="^("+o+")?"+s+o,l="^("+o+")?"+s+o+"("+s+")?$",c="^("+o+")?"+s+o+s+o,y="^("+o+")?"+i,d=new RegExp(a),v=new RegExp(c),x=new RegExp(l),T=new RegExp(y),O=/^(.+?)(ss|i)es$/,k=/^(.+?)([^s])s$/,R=/^(.+?)eed$/,N=/^(.+?)(ed|ing)$/,H=/.$/,z=/(at|bl|iz)$/,ee=new RegExp("([^aeiouylsz])\\1$"),j=new RegExp("^"+o+i+"[^aeiouwxy]$"),re=/^(.+?[^aeiou])y$/,U=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,ie=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,ne=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,ue=/^(.+?)(s|t)(ion)$/,he=/^(.+?)e$/,Y=/ll$/,le=new RegExp("^"+o+i+"[^aeiouwxy]$"),de=function(ce){var Te,pe,ke,oe,we,De,at;if(ce.length<3)return ce;if(ke=ce.substr(0,1),ke=="y"&&(ce=ke.toUpperCase()+ce.substr(1)),oe=O,we=k,oe.test(ce)?ce=ce.replace(oe,"$1$2"):we.test(ce)&&(ce=ce.replace(we,"$1$2")),oe=R,we=N,oe.test(ce)){var Ge=oe.exec(ce);oe=d,oe.test(Ge[1])&&(oe=H,ce=ce.replace(oe,""))}else if(we.test(ce)){var Ge=we.exec(ce);Te=Ge[1],we=T,we.test(Te)&&(ce=Te,we=z,De=ee,at=j,we.test(ce)?ce=ce+"e":De.test(ce)?(oe=H,ce=ce.replace(oe,"")):at.test(ce)&&(ce=ce+"e"))}if(oe=re,oe.test(ce)){var Ge=oe.exec(ce);Te=Ge[1],ce=Te+"i"}if(oe=U,oe.test(ce)){var Ge=oe.exec(ce);Te=Ge[1],pe=Ge[2],oe=d,oe.test(Te)&&(ce=Te+t[pe])}if(oe=ie,oe.test(ce)){var Ge=oe.exec(ce);Te=Ge[1],pe=Ge[2],oe=d,oe.test(Te)&&(ce=Te+n[pe])}if(oe=ne,we=ue,oe.test(ce)){var Ge=oe.exec(ce);Te=Ge[1],oe=v,oe.test(Te)&&(ce=Te)}else if(we.test(ce)){var Ge=we.exec(ce);Te=Ge[1]+Ge[2],we=v,we.test(Te)&&(ce=Te)}if(oe=he,oe.test(ce)){var Ge=oe.exec(ce);Te=Ge[1],oe=v,we=x,De=le,(oe.test(Te)||we.test(Te)&&!De.test(Te))&&(ce=Te)}return oe=Y,we=v,oe.test(ce)&&we.test(ce)&&(oe=H,ce=ce.replace(oe,"")),ke=="y"&&(ce=ke.toLowerCase()+ce.substr(1)),ce};return function(ve){return ve.update(de)}})(),e.Pipeline.registerFunction(e.stemmer,"stemmer");e.generateStopWordFilter=function(t){var n=t.reduce(function(r,i){return r[i]=i,r},{});return function(r){if(r&&n[r.toString()]!==r.toString())return r}},e.stopWordFilter=e.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),e.Pipeline.registerFunction(e.stopWordFilter,"stopWordFilter");e.trimmer=function(t){return t.update(function(n){return n.replace(/^\W+/,"").replace(/\W+$/,"")})},e.Pipeline.registerFunction(e.trimmer,"trimmer");e.TokenSet=function(){this.final=!1,this.edges={},this.id=e.TokenSet._nextId,e.TokenSet._nextId+=1},e.TokenSet._nextId=1,e.TokenSet.fromArray=function(t){for(var n=new e.TokenSet.Builder,r=0,i=t.length;r<i;r++)n.insert(t[r]);return n.finish(),n.root},e.TokenSet.fromClause=function(t){return"editDistance"in t?e.TokenSet.fromFuzzyString(t.term,t.editDistance):e.TokenSet.fromString(t.term)},e.TokenSet.fromFuzzyString=function(t,n){for(var r=new e.TokenSet,i=[{node:r,editsRemaining:n,str:t}];i.length;){var o=i.pop();if(o.str.length>0){var s=o.str.charAt(0),a;s in o.node.edges?a=o.node.edges[s]:(a=new e.TokenSet,o.node.edges[s]=a),o.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:o.editsRemaining,str:o.str.slice(1)})}if(o.editsRemaining!=0){if("*"in o.node.edges)var l=o.node.edges["*"];else{var l=new e.TokenSet;o.node.edges["*"]=l}if(o.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:o.editsRemaining-1,str:o.str}),o.str.length>1&&i.push({node:o.node,editsRemaining:o.editsRemaining-1,str:o.str.slice(1)}),o.str.length==1&&(o.node.final=!0),o.str.length>=1){if("*"in o.node.edges)var c=o.node.edges["*"];else{var c=new e.TokenSet;o.node.edges["*"]=c}o.str.length==1&&(c.final=!0),i.push({node:c,editsRemaining:o.editsRemaining-1,str:o.str.slice(1)})}if(o.str.length>1){var y=o.str.charAt(0),d=o.str.charAt(1),v;d in o.node.edges?v=o.node.edges[d]:(v=new e.TokenSet,o.node.edges[d]=v),o.str.length==1&&(v.final=!0),i.push({node:v,editsRemaining:o.editsRemaining-1,str:y+o.str.slice(2)})}}}return r},e.TokenSet.fromString=function(t){for(var n=new e.TokenSet,r=n,i=0,o=t.length;i<o;i++){var s=t[i],a=i==o-1;if(s=="*")n.edges[s]=n,n.final=a;else{var l=new e.TokenSet;l.final=a,n.edges[s]=l,n=l}}return r},e.TokenSet.prototype.toArray=function(){for(var t=[],n=[{prefix:"",node:this}];n.length;){var r=n.pop(),i=Object.keys(r.node.edges),o=i.length;r.node.final&&(r.prefix.charAt(0),t.push(r.prefix));for(var s=0;s<o;s++){var a=i[s];n.push({prefix:r.prefix.concat(a),node:r.node.edges[a]})}}return t},e.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var t=this.final?"1":"0",n=Object.keys(this.edges).sort(),r=n.length,i=0;i<r;i++){var o=n[i],s=this.edges[o];t=t+o+s.id}return t},e.TokenSet.prototype.intersect=function(t){for(var n=new e.TokenSet,r=void 0,i=[{qNode:t,output:n,node:this}];i.length;){r=i.pop();for(var o=Object.keys(r.qNode.edges),s=o.length,a=Object.keys(r.node.edges),l=a.length,c=0;c<s;c++)for(var y=o[c],d=0;d<l;d++){var v=a[d];if(v==y||y=="*"){var x=r.node.edges[v],T=r.qNode.edges[y],O=x.final&&T.final,k=void 0;v in r.output.edges?(k=r.output.edges[v],k.final=k.final||O):(k=new e.TokenSet,k.final=O,r.output.edges[v]=k),i.push({qNode:T,output:k,node:x})}}}return n},e.TokenSet.Builder=function(){this.previousWord="",this.root=new e.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},e.TokenSet.Builder.prototype.insert=function(t){var n,r=0;if(t<this.previousWord)throw new Error("Out of order word insertion");for(var i=0;i<t.length&&i<this.previousWord.length&&t[i]==this.previousWord[i];i++)r++;this.minimize(r),this.uncheckedNodes.length==0?n=this.root:n=this.uncheckedNodes[this.uncheckedNodes.length-1].child;for(var i=r;i<t.length;i++){var o=new e.TokenSet,s=t[i];n.edges[s]=o,this.uncheckedNodes.push({parent:n,char:s,child:o}),n=o}n.final=!0,this.previousWord=t},e.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},e.TokenSet.Builder.prototype.minimize=function(t){for(var n=this.uncheckedNodes.length-1;n>=t;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};e.Index=function(t){this.invertedIndex=t.invertedIndex,this.fieldVectors=t.fieldVectors,this.tokenSet=t.tokenSet,this.fields=t.fields,this.pipeline=t.pipeline},e.Index.prototype.search=function(t){return this.query(function(n){var r=new e.QueryParser(t,n);r.parse()})},e.Index.prototype.query=function(t){for(var n=new e.Query(this.fields),r=Object.create(null),i=Object.create(null),o=Object.create(null),s=Object.create(null),a=Object.create(null),l=0;l<this.fields.length;l++)i[this.fields[l]]=new e.Vector;t.call(n,n);for(var l=0;l<n.clauses.length;l++){var c=n.clauses[l],y=null,d=e.Set.empty;c.usePipeline?y=this.pipeline.runString(c.term,{fields:c.fields}):y=[c.term];for(var v=0;v<y.length;v++){var x=y[v];c.term=x;var T=e.TokenSet.fromClause(c),O=this.tokenSet.intersect(T).toArray();if(O.length===0&&c.presence===e.Query.presence.REQUIRED){for(var k=0;k<c.fields.length;k++){var R=c.fields[k];s[R]=e.Set.empty}break}for(var N=0;N<O.length;N++)for(var H=O[N],z=this.invertedIndex[H],ee=z._index,k=0;k<c.fields.length;k++){var R=c.fields[k],j=z[R],re=Object.keys(j),U=H+"/"+R,ie=new e.Set(re);if(c.presence==e.Query.presence.REQUIRED&&(d=d.union(ie),s[R]===void 0&&(s[R]=e.Set.complete)),c.presence==e.Query.presence.PROHIBITED){a[R]===void 0&&(a[R]=e.Set.empty),a[R]=a[R].union(ie);continue}if(i[R].upsert(ee,c.boost,function(K,Le){return K+Le}),!o[U]){for(var ne=0;ne<re.length;ne++){var ue=re[ne],he=new e.FieldRef(ue,R),Y=j[ue],le;(le=r[he])===void 0?r[he]=new e.MatchData(H,R,Y):le.add(H,R,Y)}o[U]=!0}}}if(c.presence===e.Query.presence.REQUIRED)for(var k=0;k<c.fields.length;k++){var R=c.fields[k];s[R]=s[R].intersect(d)}}for(var de=e.Set.complete,ve=e.Set.empty,l=0;l<this.fields.length;l++){var R=this.fields[l];s[R]&&(de=de.intersect(s[R])),a[R]&&(ve=ve.union(a[R]))}var ce=Object.keys(r),Te=[],pe=Object.create(null);if(n.isNegated()){ce=Object.keys(this.fieldVectors);for(var l=0;l<ce.length;l++){var he=ce[l],ke=e.FieldRef.fromString(he);r[he]=new e.MatchData}}for(var l=0;l<ce.length;l++){var ke=e.FieldRef.fromString(ce[l]),oe=ke.docRef;if(de.contains(oe)&&!ve.contains(oe)){var we=this.fieldVectors[ke],De=i[ke.fieldName].similarity(we),at;if((at=pe[oe])!==void 0)at.score+=De,at.matchData.combine(r[ke]);else{var Ge={ref:oe,score:De,matchData:r[ke]};pe[oe]=Ge,Te.push(Ge)}}}return Te.sort(function(xe,Be){return Be.score-xe.score})},e.Index.prototype.toJSON=function(){var t=Object.keys(this.invertedIndex).sort().map(function(r){return[r,this.invertedIndex[r]]},this),n=Object.keys(this.fieldVectors).map(function(r){return[r,this.fieldVectors[r].toJSON()]},this);return{version:e.version,fields:this.fields,fieldVectors:n,invertedIndex:t,pipeline:this.pipeline.toJSON()}},e.Index.load=function(t){var n={},r={},i=t.fieldVectors,o=Object.create(null),s=t.invertedIndex,a=new e.TokenSet.Builder,l=e.Pipeline.load(t.pipeline);t.version!=e.version&&e.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+e.version+"' does not match serialized index '"+t.version+"'");for(var c=0;c<i.length;c++){var y=i[c],d=y[0],v=y[1];r[d]=new e.Vector(v)}for(var c=0;c<s.length;c++){var y=s[c],x=y[0],T=y[1];a.insert(x),o[x]=T}return a.finish(),n.fields=t.fields,n.fieldVectors=r,n.invertedIndex=o,n.tokenSet=a.root,n.pipeline=l,new e.Index(n)};e.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=e.tokenizer,this.pipeline=new e.Pipeline,this.searchPipeline=new e.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},e.Builder.prototype.ref=function(t){this._ref=t},e.Builder.prototype.field=function(t,n){if(/\//.test(t))throw new RangeError("Field '"+t+"' contains illegal character '/'");this._fields[t]=n||{}},e.Builder.prototype.b=function(t){t<0?this._b=0:t>1?this._b=1:this._b=t},e.Builder.prototype.k1=function(t){this._k1=t},e.Builder.prototype.add=function(t,n){var r=t[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var o=0;o<i.length;o++){var s=i[o],a=this._fields[s].extractor,l=a?a(t):t[s],c=this.tokenizer(l,{fields:[s]}),y=this.pipeline.run(c),d=new e.FieldRef(r,s),v=Object.create(null);this.fieldTermFrequencies[d]=v,this.fieldLengths[d]=0,this.fieldLengths[d]+=y.length;for(var x=0;x<y.length;x++){var T=y[x];if(v[T]==null&&(v[T]=0),v[T]+=1,this.invertedIndex[T]==null){var O=Object.create(null);O._index=this.termIndex,this.termIndex+=1;for(var k=0;k<i.length;k++)O[i[k]]=Object.create(null);this.invertedIndex[T]=O}this.invertedIndex[T][s][r]==null&&(this.invertedIndex[T][s][r]=Object.create(null));for(var R=0;R<this.metadataWhitelist.length;R++){var N=this.metadataWhitelist[R],H=T.metadata[N];this.invertedIndex[T][s][r][N]==null&&(this.invertedIndex[T][s][r][N]=[]),this.invertedIndex[T][s][r][N].push(H)}}}},e.Builder.prototype.calculateAverageFieldLengths=function(){for(var t=Object.keys(this.fieldLengths),n=t.length,r={},i={},o=0;o<n;o++){var s=e.FieldRef.fromString(t[o]),a=s.fieldName;i[a]||(i[a]=0),i[a]+=1,r[a]||(r[a]=0),r[a]+=this.fieldLengths[s]}for(var l=Object.keys(this._fields),o=0;o<l.length;o++){var c=l[o];r[c]=r[c]/i[c]}this.averageFieldLength=r},e.Builder.prototype.createFieldVectors=function(){for(var t={},n=Object.keys(this.fieldTermFrequencies),r=n.length,i=Object.create(null),o=0;o<r;o++){for(var s=e.FieldRef.fromString(n[o]),a=s.fieldName,l=this.fieldLengths[s],c=new e.Vector,y=this.fieldTermFrequencies[s],d=Object.keys(y),v=d.length,x=this._fields[a].boost||1,T=this._documents[s.docRef].boost||1,O=0;O<v;O++){var k=d[O],R=y[k],N=this.invertedIndex[k]._index,H,z,ee;i[k]===void 0?(H=e.idf(this.invertedIndex[k],this.documentCount),i[k]=H):H=i[k],z=H*((this._k1+1)*R)/(this._k1*(1-this._b+this._b*(l/this.averageFieldLength[a]))+R),z*=x,z*=T,ee=Math.round(z*1e3)/1e3,c.insert(N,ee)}t[s]=c}this.fieldVectors=t},e.Builder.prototype.createTokenSet=function(){this.tokenSet=e.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},e.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new e.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},e.Builder.prototype.use=function(t){var n=Array.prototype.slice.call(arguments,1);n.unshift(this),t.apply(this,n)},e.MatchData=function(t,n,r){for(var i=Object.create(null),o=Object.keys(r||{}),s=0;s<o.length;s++){var a=o[s];i[a]=r[a].slice()}this.metadata=Object.create(null),t!==void 0&&(this.metadata[t]=Object.create(null),this.metadata[t][n]=i)},e.MatchData.prototype.combine=function(t){for(var n=Object.keys(t.metadata),r=0;r<n.length;r++){var i=n[r],o=Object.keys(t.metadata[i]);this.metadata[i]==null&&(this.metadata[i]=Object.create(null));for(var s=0;s<o.length;s++){var a=o[s],l=Object.keys(t.metadata[i][a]);this.metadata[i][a]==null&&(this.metadata[i][a]=Object.create(null));for(var c=0;c<l.length;c++){var y=l[c];this.metadata[i][a][y]==null?this.metadata[i][a][y]=t.metadata[i][a][y]:this.metadata[i][a][y]=this.metadata[i][a][y].concat(t.metadata[i][a][y])}}}},e.MatchData.prototype.add=function(t,n,r){if(!(t in this.metadata)){this.metadata[t]=Object.create(null),this.metadata[t][n]=r;return}if(!(n in this.metadata[t])){this.metadata[t][n]=r;return}for(var i=Object.keys(r),o=0;o<i.length;o++){var s=i[o];s in this.metadata[t][n]?this.metadata[t][n][s]=this.metadata[t][n][s].concat(r[s]):this.metadata[t][n][s]=r[s]}},e.Query=function(t){this.clauses=[],this.allFields=t},e.Query.wildcard=new String("*"),e.Query.wildcard.NONE=0,e.Query.wildcard.LEADING=1,e.Query.wildcard.TRAILING=2,e.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},e.Query.prototype.clause=function(t){return"fields"in t||(t.fields=this.allFields),"boost"in t||(t.boost=1),"usePipeline"in t||(t.usePipeline=!0),"wildcard"in t||(t.wildcard=e.Query.wildcard.NONE),t.wildcard&e.Query.wildcard.LEADING&&t.term.charAt(0)!=e.Query.wildcard&&(t.term="*"+t.term),t.wildcard&e.Query.wildcard.TRAILING&&t.term.slice(-1)!=e.Query.wildcard&&(t.term=""+t.term+"*"),"presence"in t||(t.presence=e.Query.presence.OPTIONAL),this.clauses.push(t),this},e.Query.prototype.isNegated=function(){for(var t=0;t<this.clauses.length;t++)if(this.clauses[t].presence!=e.Query.presence.PROHIBITED)return!1;return!0},e.Query.prototype.term=function(t,n){if(Array.isArray(t))return t.forEach(function(i){this.term(i,e.utils.clone(n))},this),this;var r=n||{};return r.term=t.toString(),this.clause(r),this},e.QueryParseError=function(t,n,r){this.name="QueryParseError",this.message=t,this.start=n,this.end=r},e.QueryParseError.prototype=new Error,e.QueryLexer=function(t){this.lexemes=[],this.str=t,this.length=t.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},e.QueryLexer.prototype.run=function(){for(var t=e.QueryLexer.lexText;t;)t=t(this)},e.QueryLexer.prototype.sliceString=function(){for(var t=[],n=this.start,r=this.pos,i=0;i<this.escapeCharPositions.length;i++)r=this.escapeCharPositions[i],t.push(this.str.slice(n,r)),n=r+1;return t.push(this.str.slice(n,this.pos)),this.escapeCharPositions.length=0,t.join("")},e.QueryLexer.prototype.emit=function(t){this.lexemes.push({type:t,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},e.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},e.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,n;do t=this.next(),n=t.charCodeAt(0);while(n>47&&n<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos<this.length},e.QueryLexer.EOS="EOS",e.QueryLexer.FIELD="FIELD",e.QueryLexer.TERM="TERM",e.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",e.QueryLexer.BOOST="BOOST",e.QueryLexer.PRESENCE="PRESENCE",e.QueryLexer.lexField=function(t){return t.backup(),t.emit(e.QueryLexer.FIELD),t.ignore(),e.QueryLexer.lexText},e.QueryLexer.lexTerm=function(t){if(t.width()>1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var n=t.next();if(n==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){t.escapeCharacter();continue}if(n==":")return e.QueryLexer.lexField;if(n=="~")return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if(n=="^")return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if(n=="+"&&t.width()===1||n=="-"&&t.width()===1)return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(n.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}},e.QueryParser=function(t,n){this.lexer=new e.QueryLexer(t),this.query=n,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var t=this.peekLexeme();return this.lexemeIdx+=1,t},e.QueryParser.prototype.nextClause=function(){var t=this.currentClause;this.query.clause(t),this.currentClause={}},e.QueryParser.parseClause=function(t){var n=t.peekLexeme();if(n!=null)switch(n.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new e.QueryParseError(r,n.start,n.end)}},e.QueryParser.parsePresence=function(t){var n=t.consumeLexeme();if(n!=null){switch(n.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new e.QueryParseError(r,n.start,n.end)}var i=t.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new e.QueryParseError(r,n.start,n.end)}switch(i.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new e.QueryParseError(r,i.start,i.end)}}},e.QueryParser.parseField=function(t){var n=t.consumeLexeme();if(n!=null){if(t.query.allFields.indexOf(n.str)==-1){var r=t.query.allFields.map(function(s){return"'"+s+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new e.QueryParseError(i,n.start,n.end)}t.currentClause.fields=[n.str];var o=t.peekLexeme();if(o==null){var i="expecting term, found nothing";throw new e.QueryParseError(i,n.start,n.end)}if(o.type===e.QueryLexer.TERM)return e.QueryParser.parseTerm;var i="expecting term, found '"+o.type+"'";throw new e.QueryParseError(i,o.start,o.end)}},e.QueryParser.parseTerm=function(t){var n=t.consumeLexeme();if(n!=null){t.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var r=t.peekLexeme();if(r==null){t.nextClause();return}switch(r.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new e.QueryParseError(i,r.start,r.end)}}},e.QueryParser.parseEditDistance=function(t){var n=t.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new e.QueryParseError(i,n.start,n.end)}t.currentClause.editDistance=r;var o=t.peekLexeme();if(o==null){t.nextClause();return}switch(o.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+o.type+"'";throw new e.QueryParseError(i,o.start,o.end)}}},e.QueryParser.parseBoost=function(t){var n=t.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new e.QueryParseError(i,n.start,n.end)}t.currentClause.boost=r;var o=t.peekLexeme();if(o==null){t.nextClause();return}switch(o.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+o.type+"'";throw new e.QueryParseError(i,o.start,o.end)}}},(function(t,n){typeof define=="function"&&define.amd?define(n):typeof Vz=="object"?Gz.exports=n():t.lunr=n()})(this,function(){return e})})()});var qz=V((ZFe,Xz)=>{"use strict";function ire(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(t){setTimeout(t,0)}}Xz.exports=ire()});var Zz=V((JFe,Kz)=>{"use strict";var Qz=qz();Kz.exports=function(t,n){if(t){n.then(function(r){Qz(function(){t(null,r)})},function(r){Qz(function(){t(r)})});return}else return n}});var r5=V(($Fe,n5)=>{n5.exports=kS;kS.default=kS;kS.stable=e5;kS.stableStringify=e5;var m1="[...]",Jz="[Circular]",Py=[],Cy=[];function $z(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function kS(e,t,n,r){typeof r>"u"&&(r=$z()),VA(e,"",0,[],void 0,0,r);var i;try{Cy.length===0?i=JSON.stringify(e,t,n):i=JSON.stringify(e,t5(t),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Py.length!==0;){var o=Py.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function Uv(e,t,n,r){var i=Object.getOwnPropertyDescriptor(r,n);i.get!==void 0?i.configurable?(Object.defineProperty(r,n,{value:e}),Py.push([r,n,t,i])):Cy.push([t,n,e]):(r[n]=e,Py.push([r,n,t]))}function VA(e,t,n,r,i,o,s){o+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<r.length;a++)if(r[a]===e){Uv(Jz,e,t,i);return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){Uv(m1,e,t,i);return}if(typeof s.edgesLimit<"u"&&n+1>s.edgesLimit){Uv(m1,e,t,i);return}if(r.push(e),Array.isArray(e))for(a=0;a<e.length;a++)VA(e[a],a,a,r,e,o,s);else{var l=Object.keys(e);for(a=0;a<l.length;a++){var c=l[a];VA(e[c],c,a,r,e,o,s)}}r.pop()}}function ore(e,t){return e<t?-1:e>t?1:0}function e5(e,t,n,r){typeof r>"u"&&(r=$z());var i=GA(e,"",0,[],void 0,0,r)||e,o;try{Cy.length===0?o=JSON.stringify(i,t,n):o=JSON.stringify(i,t5(t),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Py.length!==0;){var s=Py.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return o}function GA(e,t,n,r,i,o,s){o+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<r.length;a++)if(r[a]===e){Uv(Jz,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){Uv(m1,e,t,i);return}if(typeof s.edgesLimit<"u"&&n+1>s.edgesLimit){Uv(m1,e,t,i);return}if(r.push(e),Array.isArray(e))for(a=0;a<e.length;a++)GA(e[a],a,a,r,e,o,s);else{var l={},c=Object.keys(e).sort(ore);for(a=0;a<c.length;a++){var y=c[a];GA(e[y],y,a,r,e,o,s),l[y]=e[y]}if(typeof i<"u")Py.push([i,t,e]),i[t]=l;else return l}r.pop()}}function t5(e){return e=typeof e<"u"?e:function(t,n){return n},function(t,n){if(Cy.length>0)for(var r=0;r<Cy.length;r++){var i=Cy[r];if(i[1]===t&&i[0]===n){n=i[2],Cy.splice(r,1);break}}return e.call(this,t,n)}}});var o5=V((e3e,i5)=>{i5.exports=(function(e,t){e||(e=document),t||(t=window);var n=[],r,i=!1,o=e.documentElement,s=function(){},a,l="hidden",c="visibilitychange";e.webkitHidden!==void 0&&(l="webkitHidden",c="webkitvisibilitychange"),t.getComputedStyle||x();for(var y=["","-webkit-","-moz-","-ms-"],d=document.createElement("div"),v=y.length-1;v>=0;v--){try{d.style.position=y[v]+"sticky"}catch{}d.style.position!=""&&x()}k();function x(){pe=at=ke=oe=we=De=s}function T(xe,Be){for(key in Be)Be.hasOwnProperty(key)&&(xe[key]=Be[key])}function O(xe){return parseFloat(xe)||0}function k(){r={top:t.pageYOffset,left:t.pageXOffset}}function R(){if(t.pageXOffset!=r.left){k(),ke();return}t.pageYOffset!=r.top&&(k(),H())}function N(xe){setTimeout(function(){t.pageYOffset!=r.top&&(r.top=t.pageYOffset,H())},0)}function H(){for(var xe=n.length-1;xe>=0;xe--)z(n[xe])}function z(xe){if(xe.inited){var Be=r.top<=xe.limit.start?0:r.top>=xe.limit.end?2:1;xe.mode!=Be&&ne(xe,Be)}}function ee(){for(var xe=n.length-1;xe>=0;xe--)if(n[xe].inited){var Be=Math.abs(le(n[xe].clone)-n[xe].docOffsetTop),L=Math.abs(n[xe].parent.node.offsetHeight-n[xe].parent.height);if(Be>=2||L>=2)return!1}return!0}function j(xe){isNaN(parseFloat(xe.computed.top))||xe.isCell||(xe.inited=!0,xe.clone||ue(xe),xe.parent.computed.position!="absolute"&&xe.parent.computed.position!="relative"&&(xe.parent.node.style.position="relative"),z(xe),xe.parent.height=xe.parent.node.offsetHeight,xe.docOffsetTop=le(xe.clone))}function re(xe){var Be=!0;xe.clone&&he(xe),T(xe.node.style,xe.css);for(var L=n.length-1;L>=0;L--)if(n[L].node!==xe.node&&n[L].parent.node===xe.parent.node){Be=!1;break}Be&&(xe.parent.node.style.position=xe.parent.css.position),xe.mode=-1}function U(){for(var xe=n.length-1;xe>=0;xe--)j(n[xe])}function ie(){for(var xe=n.length-1;xe>=0;xe--)re(n[xe])}function ne(xe,Be){var L=xe.node.style;switch(Be){case 0:L.position="absolute",L.left=xe.offset.left+"px",L.right=xe.offset.right+"px",L.top=xe.offset.top+"px",L.bottom="auto",L.width="auto",L.marginLeft=0,L.marginRight=0,L.marginTop=0;break;case 1:L.position="fixed",L.left=xe.box.left+"px",L.right=xe.box.right+"px",L.top=xe.css.top,L.bottom="auto",L.width="auto",L.marginLeft=0,L.marginRight=0,L.marginTop=0;break;case 2:L.position="absolute",L.left=xe.offset.left+"px",L.right=xe.offset.right+"px",L.top="auto",L.bottom=0,L.width="auto",L.marginLeft=0,L.marginRight=0;break}xe.mode=Be}function ue(xe){xe.clone=document.createElement("div");var Be=xe.node.nextSibling||xe.node,L=xe.clone.style;L.height=xe.height+"px",L.width=xe.width+"px",L.marginTop=xe.computed.marginTop,L.marginBottom=xe.computed.marginBottom,L.marginLeft=xe.computed.marginLeft,L.marginRight=xe.computed.marginRight,L.padding=L.border=L.borderSpacing=0,L.fontSize="1em",L.position="static",L.cssFloat=xe.computed.cssFloat,xe.node.parentNode.insertBefore(xe.clone,Be)}function he(xe){xe.clone.parentNode.removeChild(xe.clone),xe.clone=void 0}function Y(xe){var Be=getComputedStyle(xe),L=xe.parentNode,K=getComputedStyle(L),Le=xe.style.position;xe.style.position="relative";var $e={top:Be.top,marginTop:Be.marginTop,marginBottom:Be.marginBottom,marginLeft:Be.marginLeft,marginRight:Be.marginRight,cssFloat:Be.cssFloat},Oe={top:O(Be.top),marginBottom:O(Be.marginBottom),paddingLeft:O(Be.paddingLeft),paddingRight:O(Be.paddingRight),borderLeftWidth:O(Be.borderLeftWidth),borderRightWidth:O(Be.borderRightWidth)};xe.style.position=Le;var te={position:xe.style.position,top:xe.style.top,bottom:xe.style.bottom,left:xe.style.left,right:xe.style.right,width:xe.style.width,marginTop:xe.style.marginTop,marginLeft:xe.style.marginLeft,marginRight:xe.style.marginRight},q=de(xe),Ie=de(L),Ee={node:L,css:{position:L.style.position},computed:{position:K.position},numeric:{borderLeftWidth:O(K.borderLeftWidth),borderRightWidth:O(K.borderRightWidth),borderTopWidth:O(K.borderTopWidth),borderBottomWidth:O(K.borderBottomWidth)}},nt={node:xe,box:{left:q.win.left,right:o.clientWidth-q.win.right},offset:{top:q.win.top-Ie.win.top-Ee.numeric.borderTopWidth,left:q.win.left-Ie.win.left-Ee.numeric.borderLeftWidth,right:-q.win.right+Ie.win.right-Ee.numeric.borderRightWidth},css:te,isCell:Be.display=="table-cell",computed:$e,numeric:Oe,width:q.win.right-q.win.left,height:q.win.bottom-q.win.top,mode:-1,inited:!1,parent:Ee,limit:{start:q.doc.top-Oe.top,end:Ie.doc.top+L.offsetHeight-Ee.numeric.borderBottomWidth-xe.offsetHeight-Oe.top-Oe.marginBottom}};return nt}function le(xe){for(var Be=0;xe;)Be+=xe.offsetTop,xe=xe.offsetParent;return Be}function de(xe){var Be=xe.getBoundingClientRect();return{doc:{top:Be.top+t.pageYOffset,left:Be.left+t.pageXOffset},win:Be}}function ve(){a=setInterval(function(){!ee()&&ke()},500)}function ce(){clearInterval(a)}function Te(){i&&(document[l]?ce():ve())}function pe(){i||(k(),U(),t.addEventListener("scroll",R),t.addEventListener("wheel",N),t.addEventListener("resize",ke),t.addEventListener("orientationchange",ke),e.addEventListener(c,Te),ve(),i=!0)}function ke(){if(i){ie();for(var xe=n.length-1;xe>=0;xe--)n[xe]=Y(n[xe].node);U()}}function oe(){t.removeEventListener("scroll",R),t.removeEventListener("wheel",N),t.removeEventListener("resize",ke),t.removeEventListener("orientationchange",ke),e.removeEventListener(c,Te),ce(),i=!1}function we(){oe(),ie()}function De(){for(we();n.length;)n.pop()}function at(xe){for(var Be=n.length-1;Be>=0;Be--)if(n[Be].node===xe)return;var L=Y(xe);n.push(L),i?j(L):pe()}function Ge(xe){for(var Be=n.length-1;Be>=0;Be--)n[Be].node===xe&&(re(n[Be]),n.splice(Be,1))}return{stickies:n,add:at,remove:Ge,init:pe,rebuild:ke,pause:oe,stop:we,kill:De}})});var nr=V(sa=>{"use strict";var YA=Symbol.for("yaml.alias"),s5=Symbol.for("yaml.document"),y1=Symbol.for("yaml.map"),a5=Symbol.for("yaml.pair"),XA=Symbol.for("yaml.scalar"),b1=Symbol.for("yaml.seq"),ep=Symbol.for("yaml.node.type"),sre=e=>!!e&&typeof e=="object"&&e[ep]===YA,are=e=>!!e&&typeof e=="object"&&e[ep]===s5,lre=e=>!!e&&typeof e=="object"&&e[ep]===y1,cre=e=>!!e&&typeof e=="object"&&e[ep]===a5,l5=e=>!!e&&typeof e=="object"&&e[ep]===XA,ure=e=>!!e&&typeof e=="object"&&e[ep]===b1;function c5(e){if(e&&typeof e=="object")switch(e[ep]){case y1:case b1:return!0}return!1}function fre(e){if(e&&typeof e=="object")switch(e[ep]){case YA:case y1:case XA:case b1:return!0}return!1}var dre=e=>(l5(e)||c5(e))&&!!e.anchor;sa.ALIAS=YA;sa.DOC=s5;sa.MAP=y1;sa.NODE_TYPE=ep;sa.PAIR=a5;sa.SCALAR=XA;sa.SEQ=b1;sa.hasAnchor=dre;sa.isAlias=sre;sa.isCollection=c5;sa.isDocument=are;sa.isMap=lre;sa.isNode=fre;sa.isPair=cre;sa.isScalar=l5;sa.isSeq=ure});var CS=V(qA=>{"use strict";var Es=nr(),dc=Symbol("break visit"),u5=Symbol("skip children"),Wd=Symbol("remove node");function v1(e,t){let n=f5(t);Es.isDocument(e)?Hv(null,e.contents,n,Object.freeze([e]))===Wd&&(e.contents=null):Hv(null,e,n,Object.freeze([]))}v1.BREAK=dc;v1.SKIP=u5;v1.REMOVE=Wd;function Hv(e,t,n,r){let i=d5(e,t,n,r);if(Es.isNode(i)||Es.isPair(i))return h5(e,r,i),Hv(e,i,n,r);if(typeof i!="symbol"){if(Es.isCollection(t)){r=Object.freeze(r.concat(t));for(let o=0;o<t.items.length;++o){let s=Hv(o,t.items[o],n,r);if(typeof s=="number")o=s-1;else{if(s===dc)return dc;s===Wd&&(t.items.splice(o,1),o-=1)}}}else if(Es.isPair(t)){r=Object.freeze(r.concat(t));let o=Hv("key",t.key,n,r);if(o===dc)return dc;o===Wd&&(t.key=null);let s=Hv("value",t.value,n,r);if(s===dc)return dc;s===Wd&&(t.value=null)}}return i}async function w1(e,t){let n=f5(t);Es.isDocument(e)?await Wv(null,e.contents,n,Object.freeze([e]))===Wd&&(e.contents=null):await Wv(null,e,n,Object.freeze([]))}w1.BREAK=dc;w1.SKIP=u5;w1.REMOVE=Wd;async function Wv(e,t,n,r){let i=await d5(e,t,n,r);if(Es.isNode(i)||Es.isPair(i))return h5(e,r,i),Wv(e,i,n,r);if(typeof i!="symbol"){if(Es.isCollection(t)){r=Object.freeze(r.concat(t));for(let o=0;o<t.items.length;++o){let s=await Wv(o,t.items[o],n,r);if(typeof s=="number")o=s-1;else{if(s===dc)return dc;s===Wd&&(t.items.splice(o,1),o-=1)}}}else if(Es.isPair(t)){r=Object.freeze(r.concat(t));let o=await Wv("key",t.key,n,r);if(o===dc)return dc;o===Wd&&(t.key=null);let s=await Wv("value",t.value,n,r);if(s===dc)return dc;s===Wd&&(t.value=null)}}return i}function f5(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function d5(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(Es.isMap(t))return n.Map?.(e,t,r);if(Es.isSeq(t))return n.Seq?.(e,t,r);if(Es.isPair(t))return n.Pair?.(e,t,r);if(Es.isScalar(t))return n.Scalar?.(e,t,r);if(Es.isAlias(t))return n.Alias?.(e,t,r)}function h5(e,t,n){let r=t[t.length-1];if(Es.isCollection(r))r.items[e]=n;else if(Es.isPair(r))e==="key"?r.key=n:r.value=n;else if(Es.isDocument(r))r.contents=n;else{let i=Es.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}qA.visit=v1;qA.visitAsync=w1});var QA=V(g5=>{"use strict";var p5=nr(),hre=CS(),pre={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},gre=e=>e.replace(/[!,[\]{}]/g,t=>pre[t]),PS=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[o,s]=r;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=r;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,s),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let s=t.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}let[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);let o=this.tags[r];if(o)try{return o+decodeURIComponent(i)}catch(s){return n(String(s)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+gre(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),i;if(t&&r.length>0&&p5.isNode(t.contents)){let o={};hre.visit(t.contents,(s,a)=>{p5.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of r)o==="!!"&&s==="tag:yaml.org,2002:"||(!t||i.some(a=>a.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(`
|
|
9
9
|
`)}};PS.defaultYaml={explicit:!1,version:"1.2"};PS.defaultTags={"!!":"tag:yaml.org,2002:"};g5.Directives=PS});var S1=V(AS=>{"use strict";var m5=nr(),mre=CS();function yre(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function y5(e){let t=new Set;return mre.visit(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function b5(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function bre(e,t){let n=[],r=new Map,i=null;return{onAnchor:o=>{n.push(o),i??(i=y5(e));let s=b5(t,i);return i.add(s),s},setAnchors:()=>{for(let o of n){let s=r.get(o);if(typeof s=="object"&&s.anchor&&(m5.isScalar(s.node)||m5.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:r}}AS.anchorIsValid=yre;AS.anchorNames=y5;AS.createNodeAnchors=bre;AS.findNewAnchor=b5});var KA=V(v5=>{"use strict";function RS(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,o=r.length;i<o;++i){let s=r[i],a=RS(e,r,String(i),s);a===void 0?delete r[i]:a!==s&&(r[i]=a)}else if(r instanceof Map)for(let i of Array.from(r.keys())){let o=r.get(i),s=RS(e,r,i,o);s===void 0?r.delete(i):s!==o&&r.set(i,s)}else if(r instanceof Set)for(let i of Array.from(r)){let o=RS(e,r,i,i);o===void 0?r.delete(i):o!==i&&(r.delete(i),r.add(o))}else for(let[i,o]of Object.entries(r)){let s=RS(e,r,i,o);s===void 0?delete r[i]:s!==o&&(r[i]=s)}return e.call(t,n,r)}v5.applyReviver=RS});var Bg=V(S5=>{"use strict";var vre=nr();function w5(e,t,n){if(Array.isArray(e))return e.map((r,i)=>w5(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!vre.hasAnchor(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=o=>{r.res=o,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}S5.toJS=w5});var x1=V(E5=>{"use strict";var wre=KA(),x5=nr(),Sre=Bg(),ZA=class{constructor(t){Object.defineProperty(this,x5.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){if(!x5.isDocument(t))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=Sre.toJS(this,"",s);if(typeof i=="function")for(let{count:l,res:c}of s.anchors.values())i(c,l);return typeof o=="function"?wre.applyReviver(o,{"":a},"",a):a}};E5.NodeBase=ZA});var IS=V(_5=>{"use strict";var xre=S1(),Ere=CS(),jv=nr(),_re=x1(),Ore=Bg(),JA=class extends _re.NodeBase{constructor(t){super(jv.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],Ere.visit(t,{Node:(o,s)=>{(jv.isAlias(s)||jv.hasAnchor(s))&&r.push(s)}}),n&&(n.aliasResolveCache=r));let i;for(let o of r){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(t,n){if(!n)return{source:this.source};let{anchors:r,doc:i,maxAliasCount:o}=n,s=this.resolve(i,n);if(!s){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=r.get(s);if(a||(Ore.toJS(s,null,n),a=r.get(s)),a?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=E1(i,s,r)),a.count*a.aliasCount>o)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(t,n,r){let i=`*${this.source}`;if(t){if(xre.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${i} `}return i}};function E1(e,t,n){if(jv.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(jv.isCollection(t)){let r=0;for(let i of t.items){let o=E1(e,i,n);o>r&&(r=o)}return r}else if(jv.isPair(t)){let r=E1(e,t.key,n),i=E1(e,t.value,n);return Math.max(r,i)}return 1}_5.Alias=JA});var os=V($A=>{"use strict";var Tre=nr(),kre=x1(),Cre=Bg(),Pre=e=>!e||typeof e!="function"&&typeof e!="object",zg=class extends kre.NodeBase{constructor(t){super(Tre.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:Cre.toJS(this.value,t,n)}toString(){return String(this.value)}};zg.BLOCK_FOLDED="BLOCK_FOLDED";zg.BLOCK_LITERAL="BLOCK_LITERAL";zg.PLAIN="PLAIN";zg.QUOTE_DOUBLE="QUOTE_DOUBLE";zg.QUOTE_SINGLE="QUOTE_SINGLE";$A.Scalar=zg;$A.isScalarValue=Pre});var MS=V(T5=>{"use strict";var Are=IS(),Ay=nr(),O5=os(),Rre="tag:yaml.org,2002:";function Ire(e,t,n){if(t){let r=n.filter(o=>o.tag===t),i=r.find(o=>!o.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function Mre(e,t,n){if(Ay.isDocument(e)&&(e=e.contents),Ay.isNode(e))return e;if(Ay.isPair(e)){let d=n.schema[Ay.MAP].createNode?.(n.schema,null,n);return d.items.push(e),d}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=n,l;if(r&&e&&typeof e=="object"){if(l=a.get(e),l)return l.anchor??(l.anchor=i(e)),new Are.Alias(l.anchor);l={anchor:null,node:null},a.set(e,l)}t?.startsWith("!!")&&(t=Rre+t.slice(2));let c=Ire(e,t,s.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let d=new O5.Scalar(e);return l&&(l.node=d),d}c=e instanceof Map?s[Ay.MAP]:Symbol.iterator in Object(e)?s[Ay.SEQ]:s[Ay.MAP]}o&&(o(c),delete n.onTagObj);let y=c?.createNode?c.createNode(n.schema,e,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,e,n):new O5.Scalar(e);return t?y.tag=t:c.default||(y.tag=c.tag),l&&(l.node=y),y}T5.createNode=Mre});var O1=V(_1=>{"use strict";var Lre=MS(),jd=nr(),Nre=x1();function eR(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){let o=t[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=r,r=s}else r=new Map([[o,r]])}return Lre.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var k5=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,tR=class extends Nre.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>jd.isNode(r)||jd.isPair(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(k5(t))this.add(n);else{let[r,...i]=t,o=this.get(r,!0);if(jd.isCollection(o))o.addIn(i,n);else if(o===void 0&&this.schema)this.set(r,eR(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){let[n,...r]=t;if(r.length===0)return this.delete(n);let i=this.get(n,!0);if(jd.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){let[r,...i]=t,o=this.get(r,!0);return i.length===0?!n&&jd.isScalar(o)?o.value:o:jd.isCollection(o)?o.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!jd.isPair(n))return!1;let r=n.value;return r==null||t&&jd.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){let[n,...r]=t;if(r.length===0)return this.has(n);let i=this.get(n,!0);return jd.isCollection(i)?i.hasIn(r):!1}setIn(t,n){let[r,...i]=t;if(i.length===0)this.set(r,n);else{let o=this.get(r,!0);if(jd.isCollection(o))o.setIn(i,n);else if(o===void 0&&this.schema)this.set(r,eR(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};_1.Collection=tR;_1.collectionFromPath=eR;_1.isEmptyPath=k5});var LS=V(T1=>{"use strict";var Dre=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function nR(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Fre=(e,t,n)=>e.endsWith(`
|
|
10
10
|
`)?nR(n,t):n.includes(`
|
|
@@ -8,4 +8,4 @@ import{a as c,m as u}from"./HJYFWIVE.js";function m(e,n){let t=n??{},o=e.specNam
|
|
|
8
8
|
`))e.line(l);e.line("```"),e.blank()}let i=[...n.pathParams,...n.queryParams,...n.headerParams];i.length>0&&x(e,i),n.requestBody!==void 0&&e.line(`Body: \`${n.requestBody.contentType}\`${n.requestBody.required?", required":", optional"}, of type ${a(n.requestBody.schema)}.`);let r=n.successResponses[0];e.line(r===void 0?"Returns no content.":`Returns \`${r.contentType}\`, of type ${a(r.schema)}.`),(t.paginated!==void 0?t.paginated.has(n.name):m(n,t.pagination)!==void 0)&&e.line("This operation is paginated, so the SDK gives it page and item iterators."),n.successResponses.some(l=>l.contentType==="text/event-stream")&&e.line("This operation streams server-sent events, so the SDK iterates the events."),y(n)&&e.line("This operation returns binary content."),e.blank()}function R(e,n){let t=new c;if(n.frontmatter&&(t.line("---"),t.line(`title: ${n.title}`),t.line("---"),t.blank()),t.line(`# ${n.title}`),t.blank(),t.line(`Generated reference for the ${n.language.label} SDK, produced from the API description by \`redocly generate-client\`.`),t.line("Re-run generation to update it \u2014 this file is not hand-edited."),t.blank(),t.line(n.language.requires),t.blank(),t.line("## Authentication"),t.blank(),e.securitySchemes.length===0)t.line("The description declares no security schemes.");else{t.line("The description declares these schemes, which you pass to the client:"),t.blank(),t.line("| Scheme | Kind | Sent as |"),t.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`;t.line(`| \`${r.key}\` | ${r.kind} | ${s} |`)}}t.blank();let o=e.services.flatMap(r=>r.operations),i=[...new Set(o.map(r=>r.tags[0]))];for(let r of i){t.line(r===void 0?"## Operations":`## ${r}`),t.blank();for(let s of o.filter(l=>l.tags[0]===r))C(t,s,n)}return t.toString().replace(/\n{3,}/g,`
|
|
9
9
|
|
|
10
10
|
`).trimEnd()+`
|
|
11
|
-
`}function h(e){return e.successResponses.find(n=>n.contentType.toLowerCase().includes("json"))?.schema}function S(e){return e.successResponses.find(n=>n.contentType.toLowerCase().includes("text/event-stream"))}function b(e){return e.requestBody?.contentType.toLowerCase().includes("multipart")??!1}function k(e){let n=new Set(e.variables.map(s=>s.name)),t=[],o="",i=e.url,r=/\{([^{}]+)\}/;for(let s=r.exec(i);s!==null;s=r.exec(i))o+=i.slice(0,s.index),n.has(s[1])?(o!==""&&t.push({kind:"literal",value:o}),o="",t.push({kind:"variable",name:s[1]})):o+=s[0],i=i.slice(s.index+s[0].length);return o+=i,(o!==""||t.length===0)&&t.push({kind:"literal",value:o}),t}function P(e,n){return e.security.map(t=>t.flatMap(o=>{let i=n.securitySchemes.find(r=>r.key===o);return i===void 0?[]:i.kind==="bearer"||i.kind==="basic"?[{scheme:o,kind:i.kind}]:i.kind==="apiKeyHeader"?[{scheme:o,kind:"apiKey",name:i.headerName,in:"header"}]:i.kind==="apiKeyQuery"?[{scheme:o,kind:"apiKey",name:i.paramName,in:"query"}]:[{scheme:o,kind:"apiKey",name:i.cookieName,in:"cookie"}]})).filter(t=>t.length>0)}function M(e,n,t){if(e===void 0||n===void 0)return;let o=u(e,n,t);return o?.kind==="array"?o.items:void 0}var Z=["Printer","casing","identifierFor","uniqueIdentifiers","RESERVED_WORDS","flattenAllOf","deref","discriminatorCases","jsonSuccessSchema","sseResponse","isMultipartBody","serverUrlParts","securityRequirements","paginationItemSchema","isNullable","unwrapNullable","enumValues","docText","headerCoerceType","schemaAtPointer","paginationRuleFor","renderReferencePage","NotSupportedError"];function O(e){return e}function v(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-")}function q(e){return e.replace(/[^A-Za-z0-9]+/g,"_").replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()}function w(e,n){let t={...e};for(let[o,i]of Object.entries(n))i!==void 0&&(t[o]=i);return t}function pe(e){return e}async function fe(e){return(await import("./
|
|
11
|
+
`}function h(e){return e.successResponses.find(n=>n.contentType.toLowerCase().includes("json"))?.schema}function S(e){return e.successResponses.find(n=>n.contentType.toLowerCase().includes("text/event-stream"))}function b(e){return e.requestBody?.contentType.toLowerCase().includes("multipart")??!1}function k(e){let n=new Set(e.variables.map(s=>s.name)),t=[],o="",i=e.url,r=/\{([^{}]+)\}/;for(let s=r.exec(i);s!==null;s=r.exec(i))o+=i.slice(0,s.index),n.has(s[1])?(o!==""&&t.push({kind:"literal",value:o}),o="",t.push({kind:"variable",name:s[1]})):o+=s[0],i=i.slice(s.index+s[0].length);return o+=i,(o!==""||t.length===0)&&t.push({kind:"literal",value:o}),t}function P(e,n){return e.security.map(t=>t.flatMap(o=>{let i=n.securitySchemes.find(r=>r.key===o);return i===void 0?[]:i.kind==="bearer"||i.kind==="basic"?[{scheme:o,kind:i.kind}]:i.kind==="apiKeyHeader"?[{scheme:o,kind:"apiKey",name:i.headerName,in:"header"}]:i.kind==="apiKeyQuery"?[{scheme:o,kind:"apiKey",name:i.paramName,in:"query"}]:[{scheme:o,kind:"apiKey",name:i.cookieName,in:"cookie"}]})).filter(t=>t.length>0)}function M(e,n,t){if(e===void 0||n===void 0)return;let o=u(e,n,t);return o?.kind==="array"?o.items:void 0}var Z=["Printer","casing","identifierFor","uniqueIdentifiers","RESERVED_WORDS","flattenAllOf","deref","discriminatorCases","jsonSuccessSchema","sseResponse","isMultipartBody","serverUrlParts","securityRequirements","paginationItemSchema","isNullable","unwrapNullable","enumValues","docText","headerCoerceType","schemaAtPointer","paginationRuleFor","renderReferencePage","NotSupportedError"];function O(e){return e}function v(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-")}function q(e){return e.replace(/[^A-Za-z0-9]+/g,"_").replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()}function w(e,n){let t={...e};for(let[o,i]of Object.entries(n))i!==void 0&&(t[o]=i);return t}function pe(e){return e}async function fe(e){return(await import("./W4SAP7O3.js")).generateClient(e)}export{m as a,R as b,h as c,S as d,b as e,k as f,P as g,M as h,Z as i,O as j,v as k,q as l,w as m,pe as n,fe as o};
|
|
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import"./UKSQ7B5H.js";import"./
|
|
7
|
+
import"./UKSQ7B5H.js";import"./FNNGQ3LB.js";import{g as m}from"./JIYXF2LJ.js";import{k as l,l as c}from"./BQM4LA5W.js";import{c as b,d as $}from"./VFTQZ2K5.js";import"./PFYPTG4G.js";import{V as h}from"./AYCCHB2H.js";import"./NEWT5A6S.js";import"./NB54XRRU.js";import{a as C,b as S}from"./HJYFWIVE.js";import"./RFWIIJFG.js";import{join as y}from"node:path";function g(t){return(t??"").replace(/\s+/g," ").trim().replace(/\\/g,"\\\\").replace(/\|/g,"\\|")}function k(t){return[t.group===void 0?void 0:l(t.group),t.name].filter(Boolean).join(" ")}function R(t,e){return[t,k(e),...e.positionals.map(i=>`<${i.name}>`),...e.flags.filter(i=>i.required).map(i=>`--${i.name} <${i.type}>`),...e.body?[e.body.required?"--json '<json>'":"[--json '<json>']"]:[]].filter(i=>i!=="").join(" ")}function P(t,e){t.line("| Flag | Type | Required | Description |"),t.line("| ---- | ---- | -------- | ----------- |");for(let n of e){let i=[g(n.description),n.enum===void 0?"":`One of ${n.enum.map(r=>`\`${r}\``).join(", ")}.`,n.type==="array"?"Repeat the flag for multiple values.":""].filter(r=>r!=="").join(" ");t.line(`| \`--${n.name}\` | ${n.type} | ${n.required?"yes":"no"} | ${i} |`)}t.blank()}function A(t,e,n){if(t.line(`### \`${k(e)}\``),t.blank(),e.summary!==void 0&&(t.line(g(e.summary)),t.blank()),t.line(`\`${e.method} ${e.path}\``),t.blank(),t.line("```sh"),t.line(R(n.name,e)),t.line("```"),t.blank(),e.positionals.length>0){t.line("| Argument | Description |"),t.line("| -------- | ----------- |");for(let r of e.positionals)t.line(`| \`<${r.name}>\` | ${g(r.description)} |`);t.blank()}e.flags.length>0&&P(t,e.flags);let i=[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(r=>r!=="");for(let r of i)t.line(r);i.length>0&&t.blank()}function v(t,e){let n=new C;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 i=e.schemes.some(o=>o.kind==="bearer");for(let[o,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."],...i?[["--token <token>","Bearer token, overriding the environment."]]:[],["--json <json\\|@file\\|@->","Request body, inline or from a file or stdin."]])n.line(`| \`${o}\` | ${s} |`);n.blank();let r=c(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 o of e.schemes){let s=o.kind==="bearer"?`\`${r}_TOKEN\` (or \`--token\`)`:o.kind==="basic"?`\`${r}_USERNAME\` and \`${r}_PASSWORD\``:`\`${r}_API_KEY_${c(o.key)}\``;n.line(`| ${o.kind} (\`${o.key}\`) | ${s} |`)}}n.blank(),n.line("## Exit codes"),n.blank(),n.line("| Code | Meaning |"),n.line("| ---- | ------- |");for(let[o,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(`| ${o} | ${s} |`);n.blank(),n.line("Errors print one JSON object to stderr, so stdout stays clean for piping."),n.blank();let a=[...new Set(t.map(o=>o.group))];for(let o of a){let s=t.filter(d=>d.group===o);o===void 0?(n.line("## Commands"),n.blank()):(n.line(`## ${o}`),n.blank(),n.line(`Addressed as \`${e.name} ${l(o)} <command>\`.`),n.blank());for(let d of s)A(n,d,e)}return n.toString().replace(/\n{3,}/g,`
|
|
8
8
|
|
|
9
9
|
`).trimEnd()+`
|
|
10
10
|
`}function w(){return $["cli.ts"]}function x(){return b["cli.ts"]}var E="// Generated by @redocly/client-generator \u2014 do not edit by hand.\n// Source: OpenAPI description. Re-run `redocly generate-client` to update.";function q(t){return S.snake(t).replace(/_/g,"-")}function j(t){let e=t.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:q(t.name),param:t.name,type:n,required:t.required,...e.kind==="enum"?{enum:e.values.map(String)}:{},...t.description!==void 0?{description:t.description}:{}}}function F(t){let e=t.successResponses;return e.some(n=>n.contentType.toLowerCase().includes("json"))?!1:e.some(n=>n.contentType.startsWith("image/")||n.contentType==="application/octet-stream")}function N(t){return t.successResponses.find(e=>e.contentType.toLowerCase().includes("json"))?.schema}function T(t,e,n){if(n!=="flat")return{};let i=m(t,e.schemas);return"mergeBody"in i&&i.mergeBody?{merged:!0}:{}}function D(t,e,n){return n!=="flat"?{}:"collisions"in m(t,e.schemas)?{argsStyle:"grouped"}:{}}function p(t,e){let n=[];for(let i of t.services)for(let r of i.operations){let a=r.requestBody?.contentType.toLowerCase().includes("json")?r.requestBody:void 0,o=N(r);n.push({...r.tags.length>0?{group:r.tags[0]}:{},name:r.name,...r.summary!==void 0?{summary:r.summary}:{},method:r.method.toUpperCase(),path:r.path,positionals:r.pathParams.map(s=>({name:s.name,type:j(s).type,...s.description!==void 0?{description:s.description}:{}})),flags:r.queryParams.map(j),...a?{body:{required:a.required,...T(r,t,e.argsStyle)}}:{},...a===void 0&&r.requestBody!==void 0?{unsupportedBody:r.requestBody.contentType}:{},...e.pagination?.has(r.name)===!0?{paginated:!0}:{},...D(r,t,e.argsStyle),...r.sse!==void 0?{sse:!0}:{},...F(r)?{blob:!0}:{},...a!==void 0||o!==void 0?{schemas:{...a?{request:a.schema}:{},...o!==void 0?{response:o}:{}}}:{}})}return n}var U=`function isProcessEntry(): boolean {
|
|
@@ -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 R}from"./SQVG3CEM.js";import{c as L}from"./UKSQ7B5H.js";import{b as J,c as E,d as F,e as W,f as ne,g as B,h as te}from"./4OMVSQVK.js";import{c as z,d as w,e as A,g as U,h as C,i as Q,j as X,k as Z,n as ee}from"./HJYFWIVE.js";var k=z.python,f=new R;function O(e){return f.typeName(e)}function q(e){let{identifier:n,renamed:s}=f.memberName(e);return{python:n,renamed:s}}function I(e){let n=e.services.flatMap(t=>t.operations),s=A(n.map(t=>t.name),{style:"snake",reserved:k});return n.map((t,r)=>({op:t,ident:s[r]}))}var T=["self","body","headers","timeout","retry","idempotency_key"];function se(e){return f.literal(e)}function oe(e){if(e!==void 0)return{style:e.style,...e.param!==void 0?{param:e.param}:{},...e.nextCursor!==void 0?{next_cursor:e.nextCursor}:{},...e.hasMore!==void 0?{has_more:e.hasMore}:{},...e.limitParam!==void 0?{limit_param:e.limitParam}:{},...e.items!==void 0?{items:e.items}:{}}}function ae(e,n){let s=new Set;return`[${(e.successResponseHeaders??[]).map(r=>{let a=w(r.name,{style:"snake",reserved:k}),c=a,i=2;for(;s.has(c);)c=`${a}_${i++}`;s.add(c);let m=ee(r.schema,n);return`(${f.string(r.name)}, ${f.string(c)}, ${f.string(m)})`}).join(", ")}]`}function y(e,n="string"){if(Q(e))return`Optional[${y(X(e),n)}]`;switch(e.kind){case"scalar":if(n==="Date"&&e.scalar==="string"){if(e.metadata?.format==="date-time")return"datetime";if(e.metadata?.format==="date")return"date"}return{string:"str",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"array":return`List[${y(e.items,n)}]`;case"record":return`Dict[str, ${y(e.value,n)}]`;case"ref":return O(e.name);case"literal":return`Literal[${f.literal(e.value)}]`;case"enum":return{string:"str",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"union":return`Union[${e.members.map(s=>y(s,n)).join(", ")}]`;case"null":return"None";case"omit":return O(e.base);case"object":case"intersection":case"unknown":return"Any"}}function H(e,n,s,t,r,a,c,i=!1){let m=A([...n.pathParams,...n.queryParams].map(N=>N.name),{style:"snake",reserved:k,taken:T}),l=n.pathParams.map((N,S)=>({param:N,python:m[S]})),o=n.queryParams.map((N,S)=>({param:N,python:m[n.pathParams.length+S]})),p=l.map(({param:N,python:S})=>`${S}: ${y(N.schema,a)}`),u=n.requestBody?[`body: ${y(n.requestBody.schema,a)}`]:[],$=[...o.map(({param:N,python:S})=>{let D=y(N.schema,a),j=D.startsWith("Optional[")?D:`Optional[${D}]`;return`${S}: ${j} = None`}),"headers: Optional[Dict[str, str]] = None","timeout: Optional[float] = None","retry: Optional[Dict[str, Any]] = None","idempotency_key: Any = None"],h=E(n),g=F(n),v=i?`Envelope[${h===void 0?"None":y(h,a)}]`:g!==void 0?`${r?"AsyncIterator":"Iterator"}[ServerSentEvent]`:t==="result"?"Result":h===void 0?"None":y(h,a),P=r&&g===void 0?"async def":"def",d=r?"await ":"",_=r?"send_async":"send",b=["self",...p,...u,"*",...$].join(", "),x=i?`${s}_with_headers`:s;e.block(`${P} ${x}(${b}) -> ${v}:`,()=>{e.doc(i?`Like ${s}(), returning an Envelope with the declared response headers.`:n.summary),e.line(`op = _OPERATIONS["${s}"]`),e.line('auth_headers, auth_query = resolve_auth(op.get("security") or [], self._auth)'),e.line("params: Dict[str, Any] = dict(auth_query)");for(let{param:j,python:M}of o)e.block(`if ${M} is not None:`,()=>{e.line(`params[${f.string(j.name)}] = encode(${M})`)});let N=l.map(({param:j,python:M})=>`${f.string(j.name)}: ${M}`).join(", ");if(e.line(`url = build_url(self._server_url, op["path"], {${N}})`),g!==void 0){let j=g.schema!==void 0&&g.schema.kind!=="unknown"?"json":"text";e.block("def _open(extra_headers: Dict[str, str]):",()=>{e.line('return self._http.stream(op["method"], url, headers={**auth_headers, **(headers or {}), **extra_headers}, params=params, timeout=timeout)')}),e.line(`return ${r?"aiter_sse":"iter_sse"}(_open, data_kind="${j}")`);return}W(n)&&e.line("form_data, form_files = to_multipart(body)");let S=n.requestBody?W(n)?", data=form_data, files=form_files":", json_body=encode(body)":"";e.line(`response = ${d}${_}(self._http, self._config, op, url, method=op["method"], headers={**auth_headers, **(headers or {})}, params=params${S}, timeout=timeout, retry=retry, idempotency_key=idempotency_key)`);let D=h===void 0?"None":`decode(${y(h,a)}, _safe_json(response))`;i?(e.block("if not response.is_success:",()=>{e.line("raise ApiError(url, response.status_code, response.reason_phrase, _safe_json(response))")}),e.line(`return Envelope(data=${D}, headers=read_envelope_headers(response, ${ae(n,c)}), response=response)`)):t==="result"?(e.block("if not response.is_success:",()=>{e.line("return Result(data=None, error=_safe_json(response), response=response)")}),e.line(`return Result(data=${D}, error=None, response=response)`)):(e.block("if not response.is_success:",()=>{e.line("raise ApiError(url, response.status_code, response.reason_phrase, _safe_json(response))")}),e.line(h===void 0?"return None":`return ${D}`))}),e.blank()}function re(e,n,s,t,r,a){let c=E(n),i=c===void 0?"Any":y(c,a),m=A([...n.pathParams,...n.queryParams].map(d=>d.name),{style:"snake",reserved:k,taken:T}),l=n.pathParams.map((d,_)=>({param:d,python:m[_]})),o=n.queryParams.map((d,_)=>({param:d,python:m[n.pathParams.length+_]})),p=l.map(({param:d,python:_})=>`${_}: ${y(d.schema,a)}`),u=[...o.map(({param:d,python:_})=>{let b=y(d.schema,a),x=b.startsWith("Optional[")?b:`Optional[${b}]`;return`${_}: ${x} = None`}),"headers: Optional[Dict[str, str]] = None","timeout: Optional[float] = None","retry: Optional[Dict[str, Any]] = None"],$=["self",...p,"*",...u].join(", "),h=t?"AsyncIterator":"Iterator",g=t?"aiter_pages":"iter_pages",v=t?"aiter_items":"iter_items",P=()=>{e.line("base: Dict[str, Any] = {}");for(let{param:b,python:x}of o)e.block(`if ${x} is not None:`,()=>{e.line(`base[${f.string(b.name)}] = encode(${x})`)});let d=t?"async def":"def",_=t?"await ":"";e.block(`${d} _page(page_params: Dict[str, Any]) -> Tuple[Any, Any]:`,()=>{e.line('auth_headers, auth_query = resolve_auth(op.get("security") or [], self._auth)');let b=l.map(({param:x,python:N})=>`${f.string(x.name)}: ${N}`).join(", ");e.line(`url = build_url(self._server_url, op["path"], {${b}})`),e.line(`response = ${_}${t?"send_async":"send"}(self._http, self._config, op, url, method=op["method"], headers={**auth_headers, **(headers or {})}, params={**page_params, **auth_query}, timeout=timeout, retry=retry)`),e.block("if not response.is_success:",()=>{e.line("raise ApiError(url, response.status_code, response.reason_phrase, _safe_json(response))")}),e.line("return _safe_json(response), response")})};t?(e.block(`async def ${s}_pages(${$}) -> ${h}[${i}]:`,()=>{e.line(`op = _OPERATIONS["${s}"]`),P(),e.block(`async for page in ${g}(_page, op["pagination"], base):`,()=>{e.line(i==="Any"?"yield page":`yield decode(${i}, page)`)})}),e.blank(),e.block(`async def ${s}_items(${$}) -> ${h}[${r}]:`,()=>{e.line(`op = _OPERATIONS["${s}"]`),P(),e.block(`async for item in ${v}(_page, op["pagination"], base):`,()=>{e.line(r==="Any"?"yield item":`yield decode(${r}, item)`)})})):(e.block(`def ${s}_pages(${$}) -> ${h}[${i}]:`,()=>{e.line(`op = _OPERATIONS["${s}"]`),P(),e.line(i==="Any"?`return ${g}(_page, op["pagination"], base)`:`return (decode(${i}, page) for page in ${g}(_page, op["pagination"], base))`)}),e.blank(),e.block(`def ${s}_items(${$}) -> ${h}[${r}]:`,()=>{e.line(`op = _OPERATIONS["${s}"]`),P(),e.line(r==="Any"?`return ${v}(_page, op["pagination"], base)`:`return (decode(${r}, item) for item in ${v}(_page, op["pagination"], base))`)})),e.blank()}function le(e){return ne(e).map(s=>s.kind==="literal"?f.string(s.value):q(s.name).python).join(" + ")}function ie(e,n){let s=n.servers??[];if(s.length===0)return;let t=new Set;e.block("class Servers:",()=>{e.line('"""The declared servers; variables default to the values from the description."""'),e.blank(),s.forEach((r,a)=>{let c=w(r.description??`server${a+1}`,{style:"snake",reserved:k});t.has(c)&&(c=`${c}_${a+1}`),t.add(c);let i=r.variables.map(m=>`${q(m.name).python}: str = ${f.string(m.default)}`);a>0&&e.blank(),e.line("@staticmethod"),e.block(`def ${c}(${i.join(", ")}) -> str:`,()=>{e.line(`return ${le(r)}`)})})}),e.blank()}function K(e,n,s,t,r,a,c){let i=t?"AsyncClient":"Client",m=t?"httpx.AsyncClient":"httpx.Client";e.block(`class ${i}:`,()=>{e.doc(`${t?"Async ":""}client for ${n.title} (${n.version}).`),e.block(`def __init__(self, server_url: str = ${f.string(a)}, *, auth: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, timeout: Optional[float] = None, retry: Optional[Dict[str, Any]] = None, middleware: Optional[List[Any]] = None, idempotency_key: Any = None, http_client: Optional[${m}] = None) -> None:`,()=>{e.line("self._server_url = server_url"),e.line("self._auth = auth or {}"),e.line("self._config: Dict[str, Any] = {"),e.indent(()=>{e.line('"headers": headers or {},'),e.line('"timeout": timeout,'),e.line('"retry": retry or {},'),e.line('"middleware": middleware or [],'),e.line('"idempotency_key": idempotency_key,')}),e.line("}"),e.line(`self._http = http_client or ${m}()`)}),e.blank();for(let{op:l,ident:o}of I(n)){H(e,l,o,s,t,c),F(l)===void 0&&(l.successResponseHeaders?.length??0)>0&&H(e,l,o,s,t,c,n,!0);let p=r.get(o);if(p!==void 0){let u=E(l),$=te(u,typeof p.items=="string"?p.items:void 0,n);re(e,l,o,t,$===void 0?"Any":y($,c),c)}}}),e.blank()}function Y(e){let n=new Map,s=new Set,t=[];for(let{name:a,schema:c}of e.schemas){let i=C(c,e);if(!(i===void 0||!i.cases.every(l=>U(l.schema,e)?.properties.some(o=>o.name===i.property)===!0))){for(let l of i.cases){let o=n.get(l.schemaName);if(o!==void 0&&o.value!==l.value){s.add(l.schemaName);continue}n.set(l.schemaName,{property:i.property,value:l.value})}t.push({name:a,property:i.property,members:i.cases.map(l=>l.schemaName)})}}let r=new Map;for(let a of t)a.members.some(c=>s.has(c))||r.set(a.name,q(a.property).python);for(let a of s)n.delete(a);return{pins:n,unions:r}}function pe(e,n,s,t,r,a,c){let i=r==="pydantic";i||e.line("@dataclass");let m=i?`class ${O(n)}(BaseModel):`:`class ${O(n)}:`;e.block(m,()=>{e.doc(a),i&&(e.line("model_config = ConfigDict(populate_by_name=True)"),e.blank());let l=[...s.filter(p=>p.required),...s.filter(p=>!p.required)],o=[];l.length===0&&e.line("pass");for(let p of l){let{python:u,renamed:$}=q(p.name);$&&!i&&o.push([u,p.name]);let h=$&&i?`alias=${f.string(p.name)}`:void 0,g=c?.property===p.name?`Literal[${f.literal(c.value)}]`:y(p.schema,t);if(p.required){let v=h===void 0?"":` = Field(${h})`;e.line(`${u}: ${g}${v}`)}else{let v=g.startsWith("Optional[")?g:`Optional[${g}]`,P=h===void 0?"None":`Field(default=None, ${h})`;e.line(`${u}: ${v} = ${P}`)}}if(o.length>0){e.blank(),e.line("# Python field name -> wire (JSON) name, for (de)serialization.");let p=o.map(([u,$])=>`"${u}": ${f.string($)}`).join(", ");e.line(`_field_map: ClassVar[Dict[str, str]] = {${p}}`)}}),e.blank(),e.blank()}function G(e,n="string",s="dataclass"){let t=new R,{pins:r,unions:a}=s==="pydantic"?Y(e):{pins:new Map,unions:new Map};t.line("from __future__ import annotations"),t.blank(),s==="dataclass"&&t.line("from dataclasses import dataclass"),t.line("from enum import Enum");let c=["Any","AsyncIterator","Dict","Iterator","List","Literal","Optional","Tuple","Union"];s==="dataclass"&&c.splice(2,0,"ClassVar"),a.size>0&&c.unshift("Annotated"),t.line(`from typing import ${c.join(", ")}`),s==="pydantic"&&t.line("from pydantic import BaseModel, ConfigDict, Field"),n==="Date"&&t.line("from datetime import date, datetime"),t.blank(),t.blank();let i=[];for(let{name:m,schema:l}of e.schemas){let o=Z(l);if(o!==void 0){let p=o.scalar==="string"?"str, Enum":"int, Enum";t.block(`class ${O(m)}(${p}):`,()=>{t.doc(l.description),o.values.forEach((u,$)=>{t.line(`${o.memberNames[$]} = ${f.literal(u)}`)})}),t.blank(),t.blank();continue}if(l.kind==="object"||l.kind==="intersection"){let p=U(l,e);if(p!==void 0){pe(t,m,p.properties,n,s,p.description??l.description,r.get(m));continue}}i.push(()=>{let p=C(l,e);if(p!==void 0){let h=p.cases.map(g=>`${g.value} -> ${O(g.schemaName)}`).join(", ");t.line(`# Discriminated by "${p.property}": ${h}`)}let u=a.get(m),$=u===void 0?y(l,n):`Annotated[${y(l,n)}, Field(discriminator=${f.string(u)})]`;t.line(`${O(m)} = ${$}`),t.blank()})}for(let m of i)m();return t.toString()}function ce(e,n){let s=[];for(let{name:t,schema:r}of e.schemas){if(n.has(t))continue;let a=C(r,e);if(a===void 0)continue;let c=a.cases.map(i=>`${f.string(i.value)}: ${O(i.schemaName)}`).join(", ");s.push(`DISCRIMINATORS[${O(t)}] = (${f.string(a.property)}, {${c}})`)}return s}var Ve={type:"object",properties:{models:{enum:["dataclass","pydantic"],default:"dataclass",description:"Model style: standard-library dataclasses (default, httpx is the only dependency), or pydantic BaseModel classes (adds pydantic)."}},additionalProperties:!1};function V(e){let n=e.lastIndexOf("/")>=0?"/":"\\",s=e.lastIndexOf(n),t=s>=0?e.slice(0,s+1):"",r=(s>=0?e.slice(s+1):e).replace(/\.[^.]+$/,"");return`${t}${w(r,{style:"snake",reserved:k})}.py`}var ze=({model:e,output:n,banner:s,emit:t,options:r,pagination:a})=>{let c=t.errorMode??"throw",i=t.dateType??"string",m=r?.models??"dataclass",l=m==="pydantic"?Y(e):void 0,o=new R;if(o.line(`# Generated by @redocly/client-generator (python) from "${e.title}" ${e.version}.`),o.line("# Do not edit by hand \u2014 regenerate with `redocly generate-client`."),o.line(m==="pydantic"?"# Requires Python >= 3.9, httpx, and pydantic: pip install httpx pydantic":"# Requires Python >= 3.9 and httpx: pip install httpx"),o.blank(),o.line(G(e,i,m).trimEnd()),o.blank(),o.blank(),ie(o,e),t.runtime==="module"){o.line("# \u2500\u2500\u2500 Runtime (real modules beside this file, written by the same run) \u2500\u2500\u2500");for(let d of Object.keys(L))o.line(`from ${d.replace(/\.py$/,"")} import *`);o.blank(),o.blank()}else{o.line("# \u2500\u2500\u2500 Embedded runtime (@redocly/client-generator python runtime) \u2500\u2500\u2500");for(let d of Object.values(L)){let _=d.split(`
|
|
7
|
+
import{a as R}from"./SQVG3CEM.js";import{c as L}from"./UKSQ7B5H.js";import{b as J,c as E,d as F,e as W,f as ne,g as B,h as te}from"./BQM4LA5W.js";import{c as z,d as w,e as A,g as U,h as C,i as Q,j as X,k as Z,n as ee}from"./HJYFWIVE.js";var k=z.python,f=new R;function O(e){return f.typeName(e)}function q(e){let{identifier:n,renamed:s}=f.memberName(e);return{python:n,renamed:s}}function I(e){let n=e.services.flatMap(t=>t.operations),s=A(n.map(t=>t.name),{style:"snake",reserved:k});return n.map((t,r)=>({op:t,ident:s[r]}))}var T=["self","body","headers","timeout","retry","idempotency_key"];function se(e){return f.literal(e)}function oe(e){if(e!==void 0)return{style:e.style,...e.param!==void 0?{param:e.param}:{},...e.nextCursor!==void 0?{next_cursor:e.nextCursor}:{},...e.hasMore!==void 0?{has_more:e.hasMore}:{},...e.limitParam!==void 0?{limit_param:e.limitParam}:{},...e.items!==void 0?{items:e.items}:{}}}function ae(e,n){let s=new Set;return`[${(e.successResponseHeaders??[]).map(r=>{let a=w(r.name,{style:"snake",reserved:k}),c=a,i=2;for(;s.has(c);)c=`${a}_${i++}`;s.add(c);let m=ee(r.schema,n);return`(${f.string(r.name)}, ${f.string(c)}, ${f.string(m)})`}).join(", ")}]`}function y(e,n="string"){if(Q(e))return`Optional[${y(X(e),n)}]`;switch(e.kind){case"scalar":if(n==="Date"&&e.scalar==="string"){if(e.metadata?.format==="date-time")return"datetime";if(e.metadata?.format==="date")return"date"}return{string:"str",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"array":return`List[${y(e.items,n)}]`;case"record":return`Dict[str, ${y(e.value,n)}]`;case"ref":return O(e.name);case"literal":return`Literal[${f.literal(e.value)}]`;case"enum":return{string:"str",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"union":return`Union[${e.members.map(s=>y(s,n)).join(", ")}]`;case"null":return"None";case"omit":return O(e.base);case"object":case"intersection":case"unknown":return"Any"}}function H(e,n,s,t,r,a,c,i=!1){let m=A([...n.pathParams,...n.queryParams].map(N=>N.name),{style:"snake",reserved:k,taken:T}),l=n.pathParams.map((N,S)=>({param:N,python:m[S]})),o=n.queryParams.map((N,S)=>({param:N,python:m[n.pathParams.length+S]})),p=l.map(({param:N,python:S})=>`${S}: ${y(N.schema,a)}`),u=n.requestBody?[`body: ${y(n.requestBody.schema,a)}`]:[],$=[...o.map(({param:N,python:S})=>{let D=y(N.schema,a),j=D.startsWith("Optional[")?D:`Optional[${D}]`;return`${S}: ${j} = None`}),"headers: Optional[Dict[str, str]] = None","timeout: Optional[float] = None","retry: Optional[Dict[str, Any]] = None","idempotency_key: Any = None"],h=E(n),g=F(n),v=i?`Envelope[${h===void 0?"None":y(h,a)}]`:g!==void 0?`${r?"AsyncIterator":"Iterator"}[ServerSentEvent]`:t==="result"?"Result":h===void 0?"None":y(h,a),P=r&&g===void 0?"async def":"def",d=r?"await ":"",_=r?"send_async":"send",b=["self",...p,...u,"*",...$].join(", "),x=i?`${s}_with_headers`:s;e.block(`${P} ${x}(${b}) -> ${v}:`,()=>{e.doc(i?`Like ${s}(), returning an Envelope with the declared response headers.`:n.summary),e.line(`op = _OPERATIONS["${s}"]`),e.line('auth_headers, auth_query = resolve_auth(op.get("security") or [], self._auth)'),e.line("params: Dict[str, Any] = dict(auth_query)");for(let{param:j,python:M}of o)e.block(`if ${M} is not None:`,()=>{e.line(`params[${f.string(j.name)}] = encode(${M})`)});let N=l.map(({param:j,python:M})=>`${f.string(j.name)}: ${M}`).join(", ");if(e.line(`url = build_url(self._server_url, op["path"], {${N}})`),g!==void 0){let j=g.schema!==void 0&&g.schema.kind!=="unknown"?"json":"text";e.block("def _open(extra_headers: Dict[str, str]):",()=>{e.line('return self._http.stream(op["method"], url, headers={**auth_headers, **(headers or {}), **extra_headers}, params=params, timeout=timeout)')}),e.line(`return ${r?"aiter_sse":"iter_sse"}(_open, data_kind="${j}")`);return}W(n)&&e.line("form_data, form_files = to_multipart(body)");let S=n.requestBody?W(n)?", data=form_data, files=form_files":", json_body=encode(body)":"";e.line(`response = ${d}${_}(self._http, self._config, op, url, method=op["method"], headers={**auth_headers, **(headers or {})}, params=params${S}, timeout=timeout, retry=retry, idempotency_key=idempotency_key)`);let D=h===void 0?"None":`decode(${y(h,a)}, _safe_json(response))`;i?(e.block("if not response.is_success:",()=>{e.line("raise ApiError(url, response.status_code, response.reason_phrase, _safe_json(response))")}),e.line(`return Envelope(data=${D}, headers=read_envelope_headers(response, ${ae(n,c)}), response=response)`)):t==="result"?(e.block("if not response.is_success:",()=>{e.line("return Result(data=None, error=_safe_json(response), response=response)")}),e.line(`return Result(data=${D}, error=None, response=response)`)):(e.block("if not response.is_success:",()=>{e.line("raise ApiError(url, response.status_code, response.reason_phrase, _safe_json(response))")}),e.line(h===void 0?"return None":`return ${D}`))}),e.blank()}function re(e,n,s,t,r,a){let c=E(n),i=c===void 0?"Any":y(c,a),m=A([...n.pathParams,...n.queryParams].map(d=>d.name),{style:"snake",reserved:k,taken:T}),l=n.pathParams.map((d,_)=>({param:d,python:m[_]})),o=n.queryParams.map((d,_)=>({param:d,python:m[n.pathParams.length+_]})),p=l.map(({param:d,python:_})=>`${_}: ${y(d.schema,a)}`),u=[...o.map(({param:d,python:_})=>{let b=y(d.schema,a),x=b.startsWith("Optional[")?b:`Optional[${b}]`;return`${_}: ${x} = None`}),"headers: Optional[Dict[str, str]] = None","timeout: Optional[float] = None","retry: Optional[Dict[str, Any]] = None"],$=["self",...p,"*",...u].join(", "),h=t?"AsyncIterator":"Iterator",g=t?"aiter_pages":"iter_pages",v=t?"aiter_items":"iter_items",P=()=>{e.line("base: Dict[str, Any] = {}");for(let{param:b,python:x}of o)e.block(`if ${x} is not None:`,()=>{e.line(`base[${f.string(b.name)}] = encode(${x})`)});let d=t?"async def":"def",_=t?"await ":"";e.block(`${d} _page(page_params: Dict[str, Any]) -> Tuple[Any, Any]:`,()=>{e.line('auth_headers, auth_query = resolve_auth(op.get("security") or [], self._auth)');let b=l.map(({param:x,python:N})=>`${f.string(x.name)}: ${N}`).join(", ");e.line(`url = build_url(self._server_url, op["path"], {${b}})`),e.line(`response = ${_}${t?"send_async":"send"}(self._http, self._config, op, url, method=op["method"], headers={**auth_headers, **(headers or {})}, params={**page_params, **auth_query}, timeout=timeout, retry=retry)`),e.block("if not response.is_success:",()=>{e.line("raise ApiError(url, response.status_code, response.reason_phrase, _safe_json(response))")}),e.line("return _safe_json(response), response")})};t?(e.block(`async def ${s}_pages(${$}) -> ${h}[${i}]:`,()=>{e.line(`op = _OPERATIONS["${s}"]`),P(),e.block(`async for page in ${g}(_page, op["pagination"], base):`,()=>{e.line(i==="Any"?"yield page":`yield decode(${i}, page)`)})}),e.blank(),e.block(`async def ${s}_items(${$}) -> ${h}[${r}]:`,()=>{e.line(`op = _OPERATIONS["${s}"]`),P(),e.block(`async for item in ${v}(_page, op["pagination"], base):`,()=>{e.line(r==="Any"?"yield item":`yield decode(${r}, item)`)})})):(e.block(`def ${s}_pages(${$}) -> ${h}[${i}]:`,()=>{e.line(`op = _OPERATIONS["${s}"]`),P(),e.line(i==="Any"?`return ${g}(_page, op["pagination"], base)`:`return (decode(${i}, page) for page in ${g}(_page, op["pagination"], base))`)}),e.blank(),e.block(`def ${s}_items(${$}) -> ${h}[${r}]:`,()=>{e.line(`op = _OPERATIONS["${s}"]`),P(),e.line(r==="Any"?`return ${v}(_page, op["pagination"], base)`:`return (decode(${r}, item) for item in ${v}(_page, op["pagination"], base))`)})),e.blank()}function le(e){return ne(e).map(s=>s.kind==="literal"?f.string(s.value):q(s.name).python).join(" + ")}function ie(e,n){let s=n.servers??[];if(s.length===0)return;let t=new Set;e.block("class Servers:",()=>{e.line('"""The declared servers; variables default to the values from the description."""'),e.blank(),s.forEach((r,a)=>{let c=w(r.description??`server${a+1}`,{style:"snake",reserved:k});t.has(c)&&(c=`${c}_${a+1}`),t.add(c);let i=r.variables.map(m=>`${q(m.name).python}: str = ${f.string(m.default)}`);a>0&&e.blank(),e.line("@staticmethod"),e.block(`def ${c}(${i.join(", ")}) -> str:`,()=>{e.line(`return ${le(r)}`)})})}),e.blank()}function K(e,n,s,t,r,a,c){let i=t?"AsyncClient":"Client",m=t?"httpx.AsyncClient":"httpx.Client";e.block(`class ${i}:`,()=>{e.doc(`${t?"Async ":""}client for ${n.title} (${n.version}).`),e.block(`def __init__(self, server_url: str = ${f.string(a)}, *, auth: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, timeout: Optional[float] = None, retry: Optional[Dict[str, Any]] = None, middleware: Optional[List[Any]] = None, idempotency_key: Any = None, http_client: Optional[${m}] = None) -> None:`,()=>{e.line("self._server_url = server_url"),e.line("self._auth = auth or {}"),e.line("self._config: Dict[str, Any] = {"),e.indent(()=>{e.line('"headers": headers or {},'),e.line('"timeout": timeout,'),e.line('"retry": retry or {},'),e.line('"middleware": middleware or [],'),e.line('"idempotency_key": idempotency_key,')}),e.line("}"),e.line(`self._http = http_client or ${m}()`)}),e.blank();for(let{op:l,ident:o}of I(n)){H(e,l,o,s,t,c),F(l)===void 0&&(l.successResponseHeaders?.length??0)>0&&H(e,l,o,s,t,c,n,!0);let p=r.get(o);if(p!==void 0){let u=E(l),$=te(u,typeof p.items=="string"?p.items:void 0,n);re(e,l,o,t,$===void 0?"Any":y($,c),c)}}}),e.blank()}function Y(e){let n=new Map,s=new Set,t=[];for(let{name:a,schema:c}of e.schemas){let i=C(c,e);if(!(i===void 0||!i.cases.every(l=>U(l.schema,e)?.properties.some(o=>o.name===i.property)===!0))){for(let l of i.cases){let o=n.get(l.schemaName);if(o!==void 0&&o.value!==l.value){s.add(l.schemaName);continue}n.set(l.schemaName,{property:i.property,value:l.value})}t.push({name:a,property:i.property,members:i.cases.map(l=>l.schemaName)})}}let r=new Map;for(let a of t)a.members.some(c=>s.has(c))||r.set(a.name,q(a.property).python);for(let a of s)n.delete(a);return{pins:n,unions:r}}function pe(e,n,s,t,r,a,c){let i=r==="pydantic";i||e.line("@dataclass");let m=i?`class ${O(n)}(BaseModel):`:`class ${O(n)}:`;e.block(m,()=>{e.doc(a),i&&(e.line("model_config = ConfigDict(populate_by_name=True)"),e.blank());let l=[...s.filter(p=>p.required),...s.filter(p=>!p.required)],o=[];l.length===0&&e.line("pass");for(let p of l){let{python:u,renamed:$}=q(p.name);$&&!i&&o.push([u,p.name]);let h=$&&i?`alias=${f.string(p.name)}`:void 0,g=c?.property===p.name?`Literal[${f.literal(c.value)}]`:y(p.schema,t);if(p.required){let v=h===void 0?"":` = Field(${h})`;e.line(`${u}: ${g}${v}`)}else{let v=g.startsWith("Optional[")?g:`Optional[${g}]`,P=h===void 0?"None":`Field(default=None, ${h})`;e.line(`${u}: ${v} = ${P}`)}}if(o.length>0){e.blank(),e.line("# Python field name -> wire (JSON) name, for (de)serialization.");let p=o.map(([u,$])=>`"${u}": ${f.string($)}`).join(", ");e.line(`_field_map: ClassVar[Dict[str, str]] = {${p}}`)}}),e.blank(),e.blank()}function G(e,n="string",s="dataclass"){let t=new R,{pins:r,unions:a}=s==="pydantic"?Y(e):{pins:new Map,unions:new Map};t.line("from __future__ import annotations"),t.blank(),s==="dataclass"&&t.line("from dataclasses import dataclass"),t.line("from enum import Enum");let c=["Any","AsyncIterator","Dict","Iterator","List","Literal","Optional","Tuple","Union"];s==="dataclass"&&c.splice(2,0,"ClassVar"),a.size>0&&c.unshift("Annotated"),t.line(`from typing import ${c.join(", ")}`),s==="pydantic"&&t.line("from pydantic import BaseModel, ConfigDict, Field"),n==="Date"&&t.line("from datetime import date, datetime"),t.blank(),t.blank();let i=[];for(let{name:m,schema:l}of e.schemas){let o=Z(l);if(o!==void 0){let p=o.scalar==="string"?"str, Enum":"int, Enum";t.block(`class ${O(m)}(${p}):`,()=>{t.doc(l.description),o.values.forEach((u,$)=>{t.line(`${o.memberNames[$]} = ${f.literal(u)}`)})}),t.blank(),t.blank();continue}if(l.kind==="object"||l.kind==="intersection"){let p=U(l,e);if(p!==void 0){pe(t,m,p.properties,n,s,p.description??l.description,r.get(m));continue}}i.push(()=>{let p=C(l,e);if(p!==void 0){let h=p.cases.map(g=>`${g.value} -> ${O(g.schemaName)}`).join(", ");t.line(`# Discriminated by "${p.property}": ${h}`)}let u=a.get(m),$=u===void 0?y(l,n):`Annotated[${y(l,n)}, Field(discriminator=${f.string(u)})]`;t.line(`${O(m)} = ${$}`),t.blank()})}for(let m of i)m();return t.toString()}function ce(e,n){let s=[];for(let{name:t,schema:r}of e.schemas){if(n.has(t))continue;let a=C(r,e);if(a===void 0)continue;let c=a.cases.map(i=>`${f.string(i.value)}: ${O(i.schemaName)}`).join(", ");s.push(`DISCRIMINATORS[${O(t)}] = (${f.string(a.property)}, {${c}})`)}return s}var Ve={type:"object",properties:{models:{enum:["dataclass","pydantic"],default:"dataclass",description:"Model style: standard-library dataclasses (default, httpx is the only dependency), or pydantic BaseModel classes (adds pydantic)."}},additionalProperties:!1};function V(e){let n=e.lastIndexOf("/")>=0?"/":"\\",s=e.lastIndexOf(n),t=s>=0?e.slice(0,s+1):"",r=(s>=0?e.slice(s+1):e).replace(/\.[^.]+$/,"");return`${t}${w(r,{style:"snake",reserved:k})}.py`}var ze=({model:e,output:n,banner:s,emit:t,options:r,pagination:a})=>{let c=t.errorMode??"throw",i=t.dateType??"string",m=r?.models??"dataclass",l=m==="pydantic"?Y(e):void 0,o=new R;if(o.line(`# Generated by @redocly/client-generator (python) from "${e.title}" ${e.version}.`),o.line("# Do not edit by hand \u2014 regenerate with `redocly generate-client`."),o.line(m==="pydantic"?"# Requires Python >= 3.9, httpx, and pydantic: pip install httpx pydantic":"# Requires Python >= 3.9 and httpx: pip install httpx"),o.blank(),o.line(G(e,i,m).trimEnd()),o.blank(),o.blank(),ie(o,e),t.runtime==="module"){o.line("# \u2500\u2500\u2500 Runtime (real modules beside this file, written by the same run) \u2500\u2500\u2500");for(let d of Object.keys(L))o.line(`from ${d.replace(/\.py$/,"")} import *`);o.blank(),o.blank()}else{o.line("# \u2500\u2500\u2500 Embedded runtime (@redocly/client-generator python runtime) \u2500\u2500\u2500");for(let d of Object.values(L)){let _=d.split(`
|
|
8
8
|
`).filter(b=>!b.startsWith("from __future__")&&!b.startsWith("from ._")).join(`
|
|
9
9
|
`).trim();o.line(_),o.blank()}o.blank()}let p=ce(e,new Set(l?.unions.keys()));if(p.length>0){o.line("# Discriminated unions dispatch by their property inside decode().");for(let d of p)o.line(d);o.blank()}o.block("def _safe_json(response: httpx.Response) -> Any:",()=>{o.block("try:",()=>{o.line("return response.json()")}),o.block("except Exception:",()=>{o.line("return None")})}),o.blank();let u=new Map;for(let{op:d,ident:_}of I(e))u.set(_,oe(a?.get(d.name)?.spec));o.line("_OPERATIONS = {"),o.indent(()=>{for(let{op:d,ident:_}of I(e)){let b={id:d.specName??d.name,method:d.method.toUpperCase(),path:d.path,...B(d,e).length>0?{security:B(d,e)}:{},...u.get(_)!==void 0?{pagination:u.get(_)}:{}};o.line(`"${_}": ${se(b)},`)}}),o.line("}"),o.blank(),o.blank();let $=t.serverUrl??e.serverUrl??"";K(o,e,c,!1,u,$,i),K(o,e,c,!0,u,$,i);let h={path:V(n.path),content:o.toString()};if(t.runtime!=="module")return[h];let g=s.map(d=>`# ${d}`).join(`
|
|
10
10
|
`),v=V(n.path).replace(/[^\\/]+$/,""),P=Object.entries(L).map(([d,_])=>({path:`${v}${d}`,content:`${g}
|
|
@@ -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"./
|
|
7
|
+
import{a as $,b as a,c,d as i,e as m,f}from"./FNNGQ3LB.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(`
|
|
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{la as e}from"./
|
|
7
|
+
import{la as e}from"./AYCCHB2H.js";var t=class extends Error{};function o(r){throw new e(r)}export{t as a,o as b};
|
|
@@ -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 j}from"./NSIQWNYL.js";import{b as O}from"./UKSQ7B5H.js";import{b as Q,c as _,d as I,e as M,f as X,g as Z,h as ee}from"./4OMVSQVK.js";import{c as z,d as P,e as H,f as N,g as R,h as U,i as V,j as x,k as D,n as Y}from"./HJYFWIVE.js";var p=z.php,B=new j;function h(e){return B.typeName(e)}function g(e){return B.memberName(e)}function c(e){return B.string(e)}function ne(e){return P(e.name,{style:"camel",reserved:p})}function F(e){let n=e.services.flatMap(s=>s.operations),a=H(n.map(s=>s.name),{style:"camel",reserved:p});return new Map(n.map((s,r)=>[s.name,a[r]]))}function ue(e){return X(e).map(a=>a.kind==="literal"?c(a.value):`$${g(a.name)}`).join(" . ")}function te(e,n){let a=n.servers??[];if(a.length===0)return;let s=new Set;e.line("/** The declared servers; variables default to the values from the description. */"),e.line("final class Servers"),e.block("{",()=>{a.forEach((r,t)=>{let i=P(r.description??`server${t+1}`,{style:"camel",reserved:p});s.has(i)&&(i=`${i}${t+1}`),s.add(i);let o=r.variables.map(l=>`string $${g(l.name)} = ${c(l.default)}`);t>0&&e.blank(),e.line(`public static function ${i}(${o.join(", ")}): string`),e.block("{",()=>{e.line(`return ${ue(r)};`)},"}")})},"}"),e.blank()}function re(e,n){let a=Z(e,n).map(s=>`[${s.map(t=>t.kind==="apiKey"?`['kind' => 'apiKey', 'scheme' => ${c(t.scheme)}, 'name' => ${c(t.name)}, 'in' => ${c(t.in)}]`:`['kind' => ${c(t.kind)}, 'scheme' => ${c(t.scheme)}]`).join(", ")}]`);if(a.length!==0)return`[${a.join(", ")}]`}function se(e){return`[${[`'style' => ${c(e.style)}`,...e.param!==void 0?[`'param' => ${c(e.param)}`]:[],...e.nextCursor!==void 0?[`'nextCursor' => ${c(e.nextCursor)}`]:[],...e.hasMore!==void 0?[`'hasMore' => ${c(e.hasMore)}`]:[],...e.limitParam!==void 0?[`'limitParam' => ${c(e.limitParam)}`]:[],...e.items!==void 0?[`'items' => ${c(e.items)}`]:[]].join(", ")}]`}function ae(e,n){let a=new Set;return`[${(e.successResponseHeaders??[]).map(r=>{let t=P(r.name,{style:"camel",reserved:p}),i=2;for(;a.has(t);)t=`${P(r.name,{style:"camel",reserved:p})}_${i++}`;a.add(t);let o=Y(r.schema,n);return`[${c(r.name)}, ${c(t)}, ${c(o)}]`}).join(", ")}]`}function E(e,n){let a=n.schemas.find(t=>t.name===e);if(a===void 0)return"other";let s=a.schema,r=D(s);return r!==void 0&&(r.scalar==="string"||r.scalar==="integer")?"enum":(s.kind==="object"||s.kind==="intersection")&&R(s,n)!==void 0?"class":"other"}function m(e,n,a="string"){if(V(e)){let s=m(x(e),n,a);return A(s)}switch(e.kind){case"scalar":return a==="Date"&&e.scalar==="string"&&G(e)?"\\DateTimeImmutable":{string:"string",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"array":case"record":return"array";case"ref":{let s=E(e.name,n);if(s==="class"||s==="enum")return h(e.name);let r=N(e,n);return r===void 0?"mixed":m(r,n,a)}case"enum":return{string:"string",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"literal":return typeof e.value=="string"?"string":typeof e.value=="boolean"?"bool":"float";case"omit":return h(e.base);case"union":return $e(e.members,n,a);case"null":case"object":case"intersection":case"unknown":return"mixed"}}function G(e){let n=e.metadata?.format;return n==="date"||n==="date-time"}function A(e){return e==="mixed"||e.startsWith("?")||e.endsWith("|null")?e:e.includes("|")?`${e}|null`:`?${e}`}function $e(e,n,a){let s=[];for(let r of e){if(r.kind==="null")continue;let t=m(r,n,a);if(t==="mixed")return"mixed";let i=t.startsWith("?")?t.slice(1):t;s.includes(i)||s.push(i),t.startsWith("?")&&!s.includes("null")&&s.push("null")}return s.length===0?"mixed":s.join("|")}function K(e,n,a){if(e===void 0)return;let s=x(e);if(s.kind==="ref"){let t=N(s,n);return E(s.name,n)==="other"?K(t,n,a):void 0}if(s.kind!=="array")return;let r=m(s.items,n,a);return r==="mixed"?void 0:r}function ie(e,n){let a=n.schemas.find(s=>s.name===e);return a!==void 0&&U(a.schema,n)!==void 0}function v(e,n,a,s){let r=x(e);if(s==="Date"&&r.kind==="scalar"&&r.scalar==="string"&&G(r))return`new \\DateTimeImmutable(${n})`;if(r.kind==="omit")return v({kind:"ref",name:r.base},n,a,s);if(r.kind==="ref"){let t=E(r.name,a);if(t==="class")return`${h(r.name)}::fromArray(${n})`;if(t==="enum")return`${h(r.name)}::from(${n})`;if(ie(r.name,a))return`unmarshal${h(r.name)}(${n})`;let i=N(r,a);return i===void 0?void 0:v(i,n,a,s)}if(r.kind==="array"){let t=v(r.items,"$item",a,s);return t===void 0?void 0:`array_map(static fn ($item) => ${t}, ${n})`}if(r.kind==="record"){let t=v(r.value,"$item",a,s);return t===void 0?void 0:`array_map(static fn ($item) => ${t}, ${n})`}}function q(e,n,a,s="string"){let r=x(e);if(s==="Date"&&r.kind==="scalar"&&r.scalar==="string"){if(r.metadata?.format==="date")return`${n}->format('Y-m-d')`;if(r.metadata?.format==="date-time")return`${n}->format(\\DateTimeInterface::ATOM)`}if(r.kind==="omit")return q({kind:"ref",name:r.base},n,a,s);if(r.kind==="ref"){let t=E(r.name,a);if(t==="class")return`${n}->toArray()`;if(t==="enum")return`${n}->value`;if(ie(r.name,a))return`is_object(${n}) ? ${n}->toArray() : ${n}`;let i=N(r,a);return i===void 0?void 0:q(i,n,a,s)}if(r.kind==="array"||r.kind==="record"){let t=r.kind==="array"?r.items:r.value,i=q(t,"$item",a,s);return i===void 0?void 0:`array_map(static fn ($item) => ${i}, ${n})`}}function fe(e,n,a,s,r,t){let i=[...a.filter(o=>o.required),...a.filter(o=>!o.required)];e.doc(h(n),t),e.line(`final class ${h(n)}`),e.block("{",()=>{e.block("public function __construct(",()=>{for(let o of i){let l=m(o.schema,s,r);if(o.required)e.line(`public ${l} $${g(o.name)},`);else{let u=A(l);e.line(`public ${u} $${g(o.name)} = null,`)}}},") {"),e.line("}"),e.blank(),e.line("public static function fromArray(array $data): self"),e.block("{",()=>{e.block("return new self(",()=>{for(let o of i){let l=`$data[${c(o.name)}]`,u=v(o.schema,l,s,r),f=g(o.name);o.required?e.line(`${f}: ${u??l},`):u===void 0?e.line(`${f}: ${l} ?? null,`):e.line(`${f}: isset(${l}) ? ${u} : null,`)}},");")},"}"),e.blank(),e.line("public function toArray(): array"),e.block("{",()=>{e.line("$data = [];");for(let o of i){let l=`$this->${g(o.name)}`,u=q(o.schema,l,s,r)??l;o.required?e.line(`$data[${c(o.name)}] = ${u};`):e.block(`if (${l} !== null) {`,()=>{e.line(`$data[${c(o.name)}] = ${u};`)},"}")}e.line("return $data;")},"}")},"}"),e.blank()}function L(e,n="string"){let a=new j;for(let{name:s,schema:r}of e.schemas){let t=D(r);if(t!==void 0&&(t.scalar==="string"||t.scalar==="integer")){let o=t.scalar==="string"?"string":"int";a.doc(h(s),r.description),a.line(`enum ${h(s)}: ${o}`),a.block("{",()=>{let l=H(t.values.map(u=>String(u)),{style:"pascal",reserved:p});t.values.forEach((u,f)=>{let y=typeof u=="string"?c(u):String(u);a.line(`case ${l[f]} = ${y};`)})},"}"),a.blank();continue}if(r.kind==="object"||r.kind==="intersection"){let o=R(r,e);if(o!==void 0){fe(a,s,o.properties,e,n,o.description??r.description);continue}}let i=U(r,e);if(i!==void 0){let o=h(s),l=i.cases.map(u=>`${u.value} -> ${h(u.schemaName)}`).join(", ");a.line(`/** ${o} is a discriminated union (${c(i.property)}): ${l}. */`),a.line(`function unmarshal${o}(array $data): mixed`),a.block("{",()=>{a.block(`return match ($data[${c(i.property)}] ?? null) {`,()=>{for(let u of i.cases)a.line(`${c(u.value)} => ${h(u.schemaName)}::fromArray($data),`);a.line("default => $data,")},"};")},"}"),a.blank();continue}}return a.toString()}var oe=new Set(["post","put","patch"]),de=["body","headers","idempotencyKey"];function W(e,n,a,s){let r=H([...e.pathParams,...e.queryParams].map(l=>l.name),{style:"camel",reserved:p,taken:de}),t=e.pathParams.map((l,u)=>({php:r[u],wire:l.name,type:m(l.schema,n,s)})),i=e.queryParams.map((l,u)=>{let f=r[e.pathParams.length+u];return{php:f,wire:l.name,type:m(l.schema,n,s),value:q(l.schema,`$${f}`,n,s)??`$${f}`}}),o=[...t.map(({php:l,type:u})=>`${u} $${l}`),...a&&e.requestBody?[`${M(e)?"array":m(e.requestBody.schema,n,s)} $body`]:[],...i.map(({php:l,type:u})=>`${A(u)} $${l} = null`),"?array $headers = null",...a&&oe.has(e.method.toLowerCase())?["?string $idempotencyKey = null"]:[]];return{pathArgs:t,queryArgs:i,signature:o}}function me(e,n,a){e.line(`$op = OPERATIONS[${c(n.specName??n.name)}];`),e.line("[$authHeaders, $query, $cookies] = resolveAuth($op['security'] ?? [], $this->config->auth);");for(let{php:r,wire:t,value:i}of a.queryArgs)e.block(`if ($${r} !== null) {`,()=>{e.line(`$query[${c(t)}] = ${i};`)},"}");let s=a.pathArgs.map(({php:r,wire:t})=>`${c(t)} => $${r}`).join(", ");e.line(`$url = buildUrl($this->config->serverUrl, $op['path'], [${s}]);`),e.line("$requestHeaders = array_merge($authHeaders, $headers ?? []);"),e.block("if ($cookies !== []) {",()=>{e.line("$requestHeaders['Cookie'] = implode('; ', $cookies);")},"}")}function J(e,n,a,s,r,t=!1){let i=W(n,s,!0,r),o=I(n),l=_(n),u=o===void 0&&l===void 0&&n.successResponses.some(b=>b.contentType!==""),f=t?"Envelope":o!==void 0?"\\Generator":l!==void 0?m(l,s,r):u?"string":"void",y=t?`${a}WithHeaders`:a,S=t?void 0:K(l,s,r);e.doc(y,t?`Like ${a}(), returning an Envelope with the declared response headers.`:n.summary??`${n.method.toUpperCase()} ${n.path}`,S===void 0?[]:[`@return ${S}[]`]),e.line(`public function ${y}(${i.signature.join(", ")}): ${f}`),e.block("{",()=>{if(me(e,n,i),o!==void 0){let d=o.schema!==void 0&&o.schema.kind!=="unknown";e.line("$url = appendQuery($url, $query);"),e.block("$open = function (array $extraHeaders) use ($url, $requestHeaders): \\CurlHandle {",()=>{e.line("$handle = curl_init($url);"),e.line("$lines = [];"),e.block("foreach (array_merge($requestHeaders, $extraHeaders) as $name => $value) {",()=>{e.line("$lines[] = $name . ': ' . $value;")},"}"),e.line("curl_setopt($handle, CURLOPT_HTTPHEADER, $lines);"),e.line("return $handle;")},"};"),e.line(`yield from iterSse($open, ${d?"true":"false"});`);return}let b=["'operationId' => $op['id']","'method' => $op['method']","'url' => $url","'headers' => $requestHeaders","'query' => $query"];if(n.requestBody&&M(n))e.line("[$contentType, $encoded] = toMultipart($body);"),b.push("'body' => $encoded","'contentType' => $contentType");else if(n.requestBody){let d=q(n.requestBody.schema,"$body",s,r)??"$body";e.line(`$payload = json_encode(${d});`),b.push("'body' => $payload",`'contentType' => ${c(n.requestBody.contentType)}`)}oe.has(n.method.toLowerCase())&&n.requestBody&&b.push("'idempotencyKey' => $idempotencyKey"),e.line(`$response = send($this->config, [${b.join(", ")}]);`),e.block("if ($response['status'] >= 400) {",()=>{e.line("throw apiErrorFrom($response);")},"}");let $=u?"$response['body']":(l===void 0?void 0:v(l,"decodeJson($response)",s,r))??"decodeJson($response)";if(t){e.line(`$data = ${$};`),e.line(`return new Envelope(data: $data, headers: readEnvelopeHeaders($response, ${ae(n,s)}), status: $response['status']);`);return}if(u){e.line("return $response['body'];");return}if(f==="void"){e.line("decodeJson($response);");return}e.line(`return ${$};`)},"}"),e.blank()}function ce(e,n,a,s,r,t,i,o,l){let u=W(n,s,!1,r),f=a,y=()=>{e.line(`$op = OPERATIONS[${c(n.specName??n.name)}];`),e.line("$base = [];");for(let{php:d,wire:k,value:w}of u.queryArgs)e.block(`if ($${d} !== null) {`,()=>{e.line(`$base[${c(k)}] = ${w};`)},"}");let $=u.pathArgs.map(({php:d,wire:k})=>`${c(k)} => $${d}`).join(", ");e.block("$call = function (array $params) use ($op, $headers): array {",()=>{e.line("[$authHeaders, $authQuery, $cookies] = resolveAuth($op['security'] ?? [], $this->config->auth);"),e.line(`$url = buildUrl($this->config->serverUrl, $op['path'], [${$}]);`),e.line("$requestHeaders = array_merge($authHeaders, $headers ?? []);"),e.block("if ($cookies !== []) {",()=>{e.line("$requestHeaders['Cookie'] = implode('; ', $cookies);")},"}"),e.line("$response = send($this->config, ['operationId' => $op['id'], 'method' => $op['method'], 'url' => $url, 'headers' => $requestHeaders, 'query' => array_merge($params, $authQuery)]);"),e.block("if ($response['status'] >= 400) {",()=>{e.line("throw apiErrorFrom($response);")},"}"),e.line("return [decodeJson($response), $response];")},"};")},S=m(_(n)??{kind:"unknown"},s,r),b=S==="mixed"?"mixed":S;e.line("/**"),e.line(` * ${f} response pages, following the pagination rule automatically.`),e.line(" *"),e.line(` * @return \\Generator<int, ${b}>`),e.line(" */"),e.line(`public function ${f}Pages(${u.signature.join(", ")}): \\Generator`),e.block("{",()=>{y(),e.block("foreach (iterPages($call, $op['pagination'], $base) as $page) {",()=>{e.line(`yield ${t??"$page"};`)},"}")},"}"),e.blank(),e.line("/**"),e.line(` * The items of every ${f} page.`),e.line(" *"),e.line(` * @return \\Generator<int, ${l}>`),e.line(" */"),e.line(`public function ${f}Items(${u.signature.join(", ")}): \\Generator`),e.block("{",()=>{y(),e.block("foreach (iterPages($call, $op['pagination'], $base) as $page) {",()=>{e.line(`$items = resolvePointer($page, ${c(o??"")});`),e.block("foreach (is_array($items) ? $items : [] as $item) {",()=>{e.line(`yield ${i??"$item"};`)},"}")},"}")},"}"),e.blank()}function pe(e){let n=e.split(`
|
|
7
|
+
import{a as j}from"./NSIQWNYL.js";import{b as O}from"./UKSQ7B5H.js";import{b as Q,c as _,d as I,e as M,f as X,g as Z,h as ee}from"./BQM4LA5W.js";import{c as z,d as P,e as H,f as N,g as R,h as U,i as V,j as x,k as D,n as Y}from"./HJYFWIVE.js";var p=z.php,B=new j;function h(e){return B.typeName(e)}function g(e){return B.memberName(e)}function c(e){return B.string(e)}function ne(e){return P(e.name,{style:"camel",reserved:p})}function F(e){let n=e.services.flatMap(s=>s.operations),a=H(n.map(s=>s.name),{style:"camel",reserved:p});return new Map(n.map((s,r)=>[s.name,a[r]]))}function ue(e){return X(e).map(a=>a.kind==="literal"?c(a.value):`$${g(a.name)}`).join(" . ")}function te(e,n){let a=n.servers??[];if(a.length===0)return;let s=new Set;e.line("/** The declared servers; variables default to the values from the description. */"),e.line("final class Servers"),e.block("{",()=>{a.forEach((r,t)=>{let i=P(r.description??`server${t+1}`,{style:"camel",reserved:p});s.has(i)&&(i=`${i}${t+1}`),s.add(i);let o=r.variables.map(l=>`string $${g(l.name)} = ${c(l.default)}`);t>0&&e.blank(),e.line(`public static function ${i}(${o.join(", ")}): string`),e.block("{",()=>{e.line(`return ${ue(r)};`)},"}")})},"}"),e.blank()}function re(e,n){let a=Z(e,n).map(s=>`[${s.map(t=>t.kind==="apiKey"?`['kind' => 'apiKey', 'scheme' => ${c(t.scheme)}, 'name' => ${c(t.name)}, 'in' => ${c(t.in)}]`:`['kind' => ${c(t.kind)}, 'scheme' => ${c(t.scheme)}]`).join(", ")}]`);if(a.length!==0)return`[${a.join(", ")}]`}function se(e){return`[${[`'style' => ${c(e.style)}`,...e.param!==void 0?[`'param' => ${c(e.param)}`]:[],...e.nextCursor!==void 0?[`'nextCursor' => ${c(e.nextCursor)}`]:[],...e.hasMore!==void 0?[`'hasMore' => ${c(e.hasMore)}`]:[],...e.limitParam!==void 0?[`'limitParam' => ${c(e.limitParam)}`]:[],...e.items!==void 0?[`'items' => ${c(e.items)}`]:[]].join(", ")}]`}function ae(e,n){let a=new Set;return`[${(e.successResponseHeaders??[]).map(r=>{let t=P(r.name,{style:"camel",reserved:p}),i=2;for(;a.has(t);)t=`${P(r.name,{style:"camel",reserved:p})}_${i++}`;a.add(t);let o=Y(r.schema,n);return`[${c(r.name)}, ${c(t)}, ${c(o)}]`}).join(", ")}]`}function E(e,n){let a=n.schemas.find(t=>t.name===e);if(a===void 0)return"other";let s=a.schema,r=D(s);return r!==void 0&&(r.scalar==="string"||r.scalar==="integer")?"enum":(s.kind==="object"||s.kind==="intersection")&&R(s,n)!==void 0?"class":"other"}function m(e,n,a="string"){if(V(e)){let s=m(x(e),n,a);return A(s)}switch(e.kind){case"scalar":return a==="Date"&&e.scalar==="string"&&G(e)?"\\DateTimeImmutable":{string:"string",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"array":case"record":return"array";case"ref":{let s=E(e.name,n);if(s==="class"||s==="enum")return h(e.name);let r=N(e,n);return r===void 0?"mixed":m(r,n,a)}case"enum":return{string:"string",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"literal":return typeof e.value=="string"?"string":typeof e.value=="boolean"?"bool":"float";case"omit":return h(e.base);case"union":return $e(e.members,n,a);case"null":case"object":case"intersection":case"unknown":return"mixed"}}function G(e){let n=e.metadata?.format;return n==="date"||n==="date-time"}function A(e){return e==="mixed"||e.startsWith("?")||e.endsWith("|null")?e:e.includes("|")?`${e}|null`:`?${e}`}function $e(e,n,a){let s=[];for(let r of e){if(r.kind==="null")continue;let t=m(r,n,a);if(t==="mixed")return"mixed";let i=t.startsWith("?")?t.slice(1):t;s.includes(i)||s.push(i),t.startsWith("?")&&!s.includes("null")&&s.push("null")}return s.length===0?"mixed":s.join("|")}function K(e,n,a){if(e===void 0)return;let s=x(e);if(s.kind==="ref"){let t=N(s,n);return E(s.name,n)==="other"?K(t,n,a):void 0}if(s.kind!=="array")return;let r=m(s.items,n,a);return r==="mixed"?void 0:r}function ie(e,n){let a=n.schemas.find(s=>s.name===e);return a!==void 0&&U(a.schema,n)!==void 0}function v(e,n,a,s){let r=x(e);if(s==="Date"&&r.kind==="scalar"&&r.scalar==="string"&&G(r))return`new \\DateTimeImmutable(${n})`;if(r.kind==="omit")return v({kind:"ref",name:r.base},n,a,s);if(r.kind==="ref"){let t=E(r.name,a);if(t==="class")return`${h(r.name)}::fromArray(${n})`;if(t==="enum")return`${h(r.name)}::from(${n})`;if(ie(r.name,a))return`unmarshal${h(r.name)}(${n})`;let i=N(r,a);return i===void 0?void 0:v(i,n,a,s)}if(r.kind==="array"){let t=v(r.items,"$item",a,s);return t===void 0?void 0:`array_map(static fn ($item) => ${t}, ${n})`}if(r.kind==="record"){let t=v(r.value,"$item",a,s);return t===void 0?void 0:`array_map(static fn ($item) => ${t}, ${n})`}}function q(e,n,a,s="string"){let r=x(e);if(s==="Date"&&r.kind==="scalar"&&r.scalar==="string"){if(r.metadata?.format==="date")return`${n}->format('Y-m-d')`;if(r.metadata?.format==="date-time")return`${n}->format(\\DateTimeInterface::ATOM)`}if(r.kind==="omit")return q({kind:"ref",name:r.base},n,a,s);if(r.kind==="ref"){let t=E(r.name,a);if(t==="class")return`${n}->toArray()`;if(t==="enum")return`${n}->value`;if(ie(r.name,a))return`is_object(${n}) ? ${n}->toArray() : ${n}`;let i=N(r,a);return i===void 0?void 0:q(i,n,a,s)}if(r.kind==="array"||r.kind==="record"){let t=r.kind==="array"?r.items:r.value,i=q(t,"$item",a,s);return i===void 0?void 0:`array_map(static fn ($item) => ${i}, ${n})`}}function fe(e,n,a,s,r,t){let i=[...a.filter(o=>o.required),...a.filter(o=>!o.required)];e.doc(h(n),t),e.line(`final class ${h(n)}`),e.block("{",()=>{e.block("public function __construct(",()=>{for(let o of i){let l=m(o.schema,s,r);if(o.required)e.line(`public ${l} $${g(o.name)},`);else{let u=A(l);e.line(`public ${u} $${g(o.name)} = null,`)}}},") {"),e.line("}"),e.blank(),e.line("public static function fromArray(array $data): self"),e.block("{",()=>{e.block("return new self(",()=>{for(let o of i){let l=`$data[${c(o.name)}]`,u=v(o.schema,l,s,r),f=g(o.name);o.required?e.line(`${f}: ${u??l},`):u===void 0?e.line(`${f}: ${l} ?? null,`):e.line(`${f}: isset(${l}) ? ${u} : null,`)}},");")},"}"),e.blank(),e.line("public function toArray(): array"),e.block("{",()=>{e.line("$data = [];");for(let o of i){let l=`$this->${g(o.name)}`,u=q(o.schema,l,s,r)??l;o.required?e.line(`$data[${c(o.name)}] = ${u};`):e.block(`if (${l} !== null) {`,()=>{e.line(`$data[${c(o.name)}] = ${u};`)},"}")}e.line("return $data;")},"}")},"}"),e.blank()}function L(e,n="string"){let a=new j;for(let{name:s,schema:r}of e.schemas){let t=D(r);if(t!==void 0&&(t.scalar==="string"||t.scalar==="integer")){let o=t.scalar==="string"?"string":"int";a.doc(h(s),r.description),a.line(`enum ${h(s)}: ${o}`),a.block("{",()=>{let l=H(t.values.map(u=>String(u)),{style:"pascal",reserved:p});t.values.forEach((u,f)=>{let y=typeof u=="string"?c(u):String(u);a.line(`case ${l[f]} = ${y};`)})},"}"),a.blank();continue}if(r.kind==="object"||r.kind==="intersection"){let o=R(r,e);if(o!==void 0){fe(a,s,o.properties,e,n,o.description??r.description);continue}}let i=U(r,e);if(i!==void 0){let o=h(s),l=i.cases.map(u=>`${u.value} -> ${h(u.schemaName)}`).join(", ");a.line(`/** ${o} is a discriminated union (${c(i.property)}): ${l}. */`),a.line(`function unmarshal${o}(array $data): mixed`),a.block("{",()=>{a.block(`return match ($data[${c(i.property)}] ?? null) {`,()=>{for(let u of i.cases)a.line(`${c(u.value)} => ${h(u.schemaName)}::fromArray($data),`);a.line("default => $data,")},"};")},"}"),a.blank();continue}}return a.toString()}var oe=new Set(["post","put","patch"]),de=["body","headers","idempotencyKey"];function W(e,n,a,s){let r=H([...e.pathParams,...e.queryParams].map(l=>l.name),{style:"camel",reserved:p,taken:de}),t=e.pathParams.map((l,u)=>({php:r[u],wire:l.name,type:m(l.schema,n,s)})),i=e.queryParams.map((l,u)=>{let f=r[e.pathParams.length+u];return{php:f,wire:l.name,type:m(l.schema,n,s),value:q(l.schema,`$${f}`,n,s)??`$${f}`}}),o=[...t.map(({php:l,type:u})=>`${u} $${l}`),...a&&e.requestBody?[`${M(e)?"array":m(e.requestBody.schema,n,s)} $body`]:[],...i.map(({php:l,type:u})=>`${A(u)} $${l} = null`),"?array $headers = null",...a&&oe.has(e.method.toLowerCase())?["?string $idempotencyKey = null"]:[]];return{pathArgs:t,queryArgs:i,signature:o}}function me(e,n,a){e.line(`$op = OPERATIONS[${c(n.specName??n.name)}];`),e.line("[$authHeaders, $query, $cookies] = resolveAuth($op['security'] ?? [], $this->config->auth);");for(let{php:r,wire:t,value:i}of a.queryArgs)e.block(`if ($${r} !== null) {`,()=>{e.line(`$query[${c(t)}] = ${i};`)},"}");let s=a.pathArgs.map(({php:r,wire:t})=>`${c(t)} => $${r}`).join(", ");e.line(`$url = buildUrl($this->config->serverUrl, $op['path'], [${s}]);`),e.line("$requestHeaders = array_merge($authHeaders, $headers ?? []);"),e.block("if ($cookies !== []) {",()=>{e.line("$requestHeaders['Cookie'] = implode('; ', $cookies);")},"}")}function J(e,n,a,s,r,t=!1){let i=W(n,s,!0,r),o=I(n),l=_(n),u=o===void 0&&l===void 0&&n.successResponses.some(b=>b.contentType!==""),f=t?"Envelope":o!==void 0?"\\Generator":l!==void 0?m(l,s,r):u?"string":"void",y=t?`${a}WithHeaders`:a,S=t?void 0:K(l,s,r);e.doc(y,t?`Like ${a}(), returning an Envelope with the declared response headers.`:n.summary??`${n.method.toUpperCase()} ${n.path}`,S===void 0?[]:[`@return ${S}[]`]),e.line(`public function ${y}(${i.signature.join(", ")}): ${f}`),e.block("{",()=>{if(me(e,n,i),o!==void 0){let d=o.schema!==void 0&&o.schema.kind!=="unknown";e.line("$url = appendQuery($url, $query);"),e.block("$open = function (array $extraHeaders) use ($url, $requestHeaders): \\CurlHandle {",()=>{e.line("$handle = curl_init($url);"),e.line("$lines = [];"),e.block("foreach (array_merge($requestHeaders, $extraHeaders) as $name => $value) {",()=>{e.line("$lines[] = $name . ': ' . $value;")},"}"),e.line("curl_setopt($handle, CURLOPT_HTTPHEADER, $lines);"),e.line("return $handle;")},"};"),e.line(`yield from iterSse($open, ${d?"true":"false"});`);return}let b=["'operationId' => $op['id']","'method' => $op['method']","'url' => $url","'headers' => $requestHeaders","'query' => $query"];if(n.requestBody&&M(n))e.line("[$contentType, $encoded] = toMultipart($body);"),b.push("'body' => $encoded","'contentType' => $contentType");else if(n.requestBody){let d=q(n.requestBody.schema,"$body",s,r)??"$body";e.line(`$payload = json_encode(${d});`),b.push("'body' => $payload",`'contentType' => ${c(n.requestBody.contentType)}`)}oe.has(n.method.toLowerCase())&&n.requestBody&&b.push("'idempotencyKey' => $idempotencyKey"),e.line(`$response = send($this->config, [${b.join(", ")}]);`),e.block("if ($response['status'] >= 400) {",()=>{e.line("throw apiErrorFrom($response);")},"}");let $=u?"$response['body']":(l===void 0?void 0:v(l,"decodeJson($response)",s,r))??"decodeJson($response)";if(t){e.line(`$data = ${$};`),e.line(`return new Envelope(data: $data, headers: readEnvelopeHeaders($response, ${ae(n,s)}), status: $response['status']);`);return}if(u){e.line("return $response['body'];");return}if(f==="void"){e.line("decodeJson($response);");return}e.line(`return ${$};`)},"}"),e.blank()}function ce(e,n,a,s,r,t,i,o,l){let u=W(n,s,!1,r),f=a,y=()=>{e.line(`$op = OPERATIONS[${c(n.specName??n.name)}];`),e.line("$base = [];");for(let{php:d,wire:k,value:w}of u.queryArgs)e.block(`if ($${d} !== null) {`,()=>{e.line(`$base[${c(k)}] = ${w};`)},"}");let $=u.pathArgs.map(({php:d,wire:k})=>`${c(k)} => $${d}`).join(", ");e.block("$call = function (array $params) use ($op, $headers): array {",()=>{e.line("[$authHeaders, $authQuery, $cookies] = resolveAuth($op['security'] ?? [], $this->config->auth);"),e.line(`$url = buildUrl($this->config->serverUrl, $op['path'], [${$}]);`),e.line("$requestHeaders = array_merge($authHeaders, $headers ?? []);"),e.block("if ($cookies !== []) {",()=>{e.line("$requestHeaders['Cookie'] = implode('; ', $cookies);")},"}"),e.line("$response = send($this->config, ['operationId' => $op['id'], 'method' => $op['method'], 'url' => $url, 'headers' => $requestHeaders, 'query' => array_merge($params, $authQuery)]);"),e.block("if ($response['status'] >= 400) {",()=>{e.line("throw apiErrorFrom($response);")},"}"),e.line("return [decodeJson($response), $response];")},"};")},S=m(_(n)??{kind:"unknown"},s,r),b=S==="mixed"?"mixed":S;e.line("/**"),e.line(` * ${f} response pages, following the pagination rule automatically.`),e.line(" *"),e.line(` * @return \\Generator<int, ${b}>`),e.line(" */"),e.line(`public function ${f}Pages(${u.signature.join(", ")}): \\Generator`),e.block("{",()=>{y(),e.block("foreach (iterPages($call, $op['pagination'], $base) as $page) {",()=>{e.line(`yield ${t??"$page"};`)},"}")},"}"),e.blank(),e.line("/**"),e.line(` * The items of every ${f} page.`),e.line(" *"),e.line(` * @return \\Generator<int, ${l}>`),e.line(" */"),e.line(`public function ${f}Items(${u.signature.join(", ")}): \\Generator`),e.block("{",()=>{y(),e.block("foreach (iterPages($call, $op['pagination'], $base) as $page) {",()=>{e.line(`$items = resolvePointer($page, ${c(o??"")});`),e.block("foreach (is_array($items) ? $items : [] as $item) {",()=>{e.line(`yield ${i??"$item"};`)},"}")},"}")},"}"),e.blank()}function pe(e){let n=e.split(`
|
|
8
8
|
`),a=0;for(let s=0;s<n.length;s++)if(n[s].trim().startsWith("namespace ")){a=s+1;break}return n.slice(a).join(`
|
|
9
9
|
`).trim()}var nn=({model:e,output:n,banner:a,emit:s,pagination:r})=>{let t=new j,i=s.dateType??"string",o=P(e.title,{style:"pascal",reserved:p});t.line("<?php"),t.blank(),t.line(`// Code generated by @redocly/client-generator (php) from ${c(e.title)} ${e.version}. DO NOT EDIT.`),t.line("// Regenerate with `redocly generate-client`. PHP >= 8.1, curl extension \u2014 zero Composer dependencies."),t.blank(),t.line("declare(strict_types=1);"),t.blank(),t.line(`namespace ${o};`),t.blank(),t.line(L(e,i)),te(t,e),s.runtime==="module"?(t.line("// \u2500\u2500\u2500 Runtime (a real file beside this one, written by the same run) \u2500\u2500\u2500"),t.line("require_once __DIR__ . '/runtime.php';"),t.blank()):(t.line("// \u2500\u2500\u2500 Embedded runtime (@redocly/client-generator php runtime) \u2500\u2500\u2500"),t.line(pe(O)),t.blank());let l=e.services.flatMap($=>$.operations),u=F(e),f=new Map;for(let $ of l){let d=r?.get($.name)?.spec;d!==void 0&&f.set($.name,d)}t.block("const OPERATIONS = [",()=>{for(let $ of l){let d=$.specName??$.name,k=re($,e),w=f.get($.name),T=[`'id' => ${c(d)}`,`'method' => ${c($.method.toUpperCase())}`,`'path' => ${c($.path)}`,...k!==void 0?[`'security' => ${k}`]:[],...w!==void 0?[`'pagination' => ${se(w)}`]:[]];t.line(`${c(d)} => [${T.join(", ")}],`)}},"];"),t.blank(),t.doc("Client",`Client for ${e.title} (${e.version}).`),t.line("class Client"),t.block("{",()=>{t.line("public function __construct(private Config $config)"),t.block("{",()=>{t.block("if ($this->config->serverUrl === '') {",()=>{t.line(`$this->config->serverUrl = ${c(s.serverUrl??e.serverUrl??"")};`)},"}")},"}"),t.blank();for(let $ of l){let d=u.get($.name);J(t,$,d,e,i),I($)===void 0&&($.successResponseHeaders?.length??0)>0&&J(t,$,d,e,i,!0);let k=f.get($.name);if(k===void 0)continue;let w=_($),T=w===void 0?void 0:v(w,"$page",e,i),C=ee(w,k.items,e),le=C===void 0?void 0:v(C,"$item",e,i);ce(t,$,d,e,i,T,le,k.items,C===void 0?"mixed":m(C,e,i))}},"}");let y={path:n.path.replace(/\.[^.\\/]+$/,".php"),content:t.toString()};if(s.runtime!=="module")return[y];let S=a.map($=>`// ${$}`).join(`
|
|
10
10
|
`),b=O.replace(/^namespace .*$/m,`namespace ${o};`).replace(/^<\?php\n/,`<?php
|
|
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{b as a,c as b,d as c}from"./
|
|
7
|
+
import{b as a,c as b,d as c}from"./5WFODJ7E.js";import"./UKSQ7B5H.js";import"./FNNGQ3LB.js";import"./JIYXF2LJ.js";import"./BQM4LA5W.js";import"./VFTQZ2K5.js";import"./PFYPTG4G.js";import"./AYCCHB2H.js";import"./NEWT5A6S.js";import"./NB54XRRU.js";import"./HJYFWIVE.js";import"./RFWIIJFG.js";export{b as cliDocs,a as cliGenerator,c as cliSample};
|
|
@@ -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 Me}from"./
|
|
7
|
+
import{a as Me}from"./M5NHHJLI.js";import{d as Ke,e as Ue,f as Fe}from"./C7GGV6MA.js";import{c as Be,d as He,e as Ge}from"./EC24G6EZ.js";import{a as h}from"./WZXA5XPB.js";import{a as kn,b as Ce,c as Se,d as Ae}from"./5WFODJ7E.js";import{c as Ee,d as Te,e as qe}from"./6SPYPUI6.js";import{a as $}from"./HPMV62YM.js";import{a as Pe,b as xn,c as On,d as Ie,e as $e,f as je}from"./KM7PMMIJ.js";import{a as Ne}from"./TOMUPTSM.js";import{a as De}from"./TSB6PODJ.js";import{a as Le}from"./CGWDSTQU.js";import"./SQVG3CEM.js";import"./REFX2EKS.js";import"./NSIQWNYL.js";import"./UKSQ7B5H.js";import"./FNNGQ3LB.js";import"./JIYXF2LJ.js";import"./BQM4LA5W.js";import{g as Re}from"./VFTQZ2K5.js";import"./PFYPTG4G.js";import{C as we,H as ve,V as w,X as ke,aa as xe,c as O,ca as _,ja as Oe,q as R,s as be}from"./AYCCHB2H.js";import"./NEWT5A6S.js";import"./NB54XRRU.js";import"./HJYFWIVE.js";import"./RFWIIJFG.js";function M(e){return{requires:["typescript"],errorModes:["throw"],load:()=>import("./UTMTQAX7.js").then(n=>({run:n.tanstackQueryGenerator(e)}))}}var z={outputMode:"it always emits one self-contained file",runtime:"the runtime is always embedded in the generated file",argsStyle:"inputs follow the target language's own idiom",importExt:"the generated file has no relative imports"},I={typescript:{load:()=>import("./Z46FHG6E.js").then(e=>({run:e.typescriptGenerator,sample:e.typescriptSample,docs:e.typescriptDocs}))},zod:{load:()=>import("./QE2DAZZS.js").then(e=>({run:e.zodGenerator}))},transformers:{requires:["typescript"],dateTypes:["Date"],load:()=>import("./NWMTC4AN.js").then(e=>({run:e.transformersGenerator}))},"tanstack-query":M("react"),"tanstack-query-vue":M("vue"),"tanstack-query-svelte":M("svelte"),"tanstack-query-solid":M("solid"),swr:{requires:["typescript"],errorModes:["throw"],load:()=>import("./OYK34CLF.js").then(e=>({run:e.swrGenerator}))},mock:{requires:["typescript"],load:()=>import("./OSHXPRZS.js").then(e=>({run:e.mockGenerator}))},cli:{requires:["typescript","zod"],errorModes:["throw"],load:()=>import("./EZ3GAVTS.js").then(e=>({run:e.cliGenerator,sample:e.cliSample,docs:e.cliDocs}))},python:{notApplicable:z,load:()=>import("./6I34CQBG.js").then(e=>({run:e.pythonGenerator,sample:e.pythonSample,docs:e.pythonDocs,options:e.pythonOptions}))},go:{errorModes:["throw"],notApplicable:z,load:()=>import("./GQLQMPIU.js").then(e=>({run:e.goGenerator,sample:e.goSample,docs:e.goDocs}))},php:{errorModes:["throw"],notApplicable:z,load:()=>import("./OUY7OMOM.js").then(e=>({run:e.phpGenerator,sample:e.phpSample,docs:e.phpDocs}))}};function K(e,n,t,r){let s=new Set(e);n.goPackage!==void 0&&!s.has("go")&&w.warn(`generate-client: goPackage is ignored \u2014 it declares the Go package clause, and no selected generator uses it (add --generator go).
|
|
8
8
|
`);let o=n.errorMode??"throw",a=n.dateType??"string";for(let i of e){let d=t.get(i);if(!d)throw new h(`Unknown generator: ${i}`);for(let c of d.requires??[])if(!s.has(c)){let u=[...new Set([c,...e])].map(g=>`--generator ${g}`).join(" ");throw new h(`The "${i}" generator requires the "${c}" generator. Add it, e.g. ${u}.`)}if(d.errorModes&&!d.errorModes.includes(o))throw new h(`The "${i}" generator does not support --error-mode "${o}" (supported: ${d.errorModes.join(", ")}).`);if(d.dateTypes&&!d.dateTypes.includes(a))throw new h(`The "${i}" generator requires --date-type ${d.dateTypes.join(" or ")} (got "${a}") so the runtime values match the generated types.`);let l={...n,outputMode:r};for(let[c,u]of Object.entries(d.notApplicable??{}))l[c]!==void 0&&w.warn(`generate-client: the "${i}" generator ignores ${c} \u2014 ${u}.
|
|
9
9
|
`)}}var Rn={typescript:{run:Ie,sample:je,docs:$e},zod:{run:Ne},transformers:{run:De},"tanstack-query":{run:$("react")},"tanstack-query-vue":{run:$("vue")},"tanstack-query-svelte":{run:$("svelte")},"tanstack-query-solid":{run:$("solid")},swr:{run:Le},mock:{run:Me},cli:{run:Ce,sample:Ae,docs:Se},python:{run:Ke,sample:Ue,docs:Fe},go:{run:Ee,sample:Te,docs:qe},php:{run:Be,sample:He,docs:Ge}},Cn=Object.fromEntries(Object.entries(I).map(([e,{load:n,...t}])=>[e,{...t,...Rn[e]}]));function W(){return new Map(Object.entries(Cn))}function _e(e,n,t=W(),r){K(e,n,t,r)}import{mkdir as Ct,readFile as St,writeFile as At}from"node:fs/promises";import{dirname as vn,parse as Et,resolve as G,sep as Tt}from"node:path";function ze(e,n,t){let r=new Map;for(let s of e){let o=n.get(s)?.options,a=t?.[s];if(o===void 0){a!==void 0&&w.warn(`generate-client: the "${s}" generator declares no options, so client.options.${s} is ignored.
|
|
10
10
|
`),r.set(s,{});continue}r.set(s,Sn(s,o,a))}return r}function Sn(e,n,t){if(t!==void 0&&!O(t))throw new h(`The "${e}" generator's options must be a map of option names to values.`);let r=t??{},s=Object.keys(n.properties);if(n.additionalProperties!==!0){for(let a of Object.keys(r))if(!s.includes(a))throw new h(`The "${e}" generator got an unknown option "${a}". Declared options: ${s.join(", ")||"(none)"}.`)}for(let a of n.required??[])if(r[a]===void 0)throw new h(`The "${e}" generator requires the "${a}" option.`);let o={...r};for(let[a,i]of Object.entries(n.properties)){if(o[a]===void 0){i.default!==void 0&&(o[a]=i.default);continue}let d=An(i,o[a]);if(d!==void 0)throw new h(`The "${e}" generator's "${a}" ${d}.`)}return o}function An(e,n){if("enum"in e)return e.enum.includes(n)?void 0:`must be one of: ${e.enum.join(", ")}`;if(e.type==="array"){let t=e.items.type;return Array.isArray(n)&&n.every(r=>typeof r===t)?void 0:`must be an array of ${t}`}return typeof n===e.type?void 0:`must be a ${e.type}`}import{isAbsolute as Tn,resolve as qn}from"node:path";import{pathToFileURL as Pn}from"node:url";var V=Re.version;function We(e){let n=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(e.trim());return n===null?void 0:[Number(n[1]),Number(n[2]),Number(n[3])]}function J(e,n){return e[0]-n[0]||e[1]-n[1]||e[2]-n[2]}function Je(e,n){let t=/^[\^~]|^>=/.exec(n.trim())?.[0]??"",r=We(n.trim().slice(t.length)),s=We(e);if(!(r===void 0||s===void 0))return J(s,r)<0?!1:t===">="?!0:t===""?J(s,r)===0:t==="~"?s[0]===r[0]&&s[1]===r[1]:r[0]!==0?s[0]===r[0]:r[1]!==0?s[0]===0&&s[1]===r[1]:J(s,r)===0}var En=function(e,n){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(t,r,s,o,a){return r?n?".jsx":".js":s&&(!o||!a)?t:s+o+"."+a.toLowerCase()+"js"}):e};async function Qe(e,n={}){let t=new Map;for(let i of n.customGenerators??[])Xe(t,i);let r=[];for(let i of e)r.push(await Ve(i,t,n.configDir));let s=[],o=new Set,a=async i=>{if(!(s.includes(i)||o.has(i))){o.add(i);for(let d of t.get(i).requires??[])(t.has(d)||d in I)&&await a(await Ve(d,t,n.configDir));o.delete(i),s.push(i)}};for(let i of r)await a(i);return{selected:s,registry:t}}async function Ve(e,n,t){if(n.has(e))return e;let r=I[e];if(r!==void 0){let{load:o,...a}=r;return n.set(e,{...a,...await o()}),e}if(e==="sdk")throw new h('The "sdk" generator is now named "typescript". Update the `generators` list or the --generator flag.');let s=await In(e,t??process.cwd());return Xe(n,s),s.name}function Xe(e,n){if(!O(n)||typeof n.name!="string"||n.name===""||typeof n.run!="function")throw new h("Invalid custom generator: expected an object with a non-empty string `name` and a `run` function (build one with `defineGenerator`).");if(e.has(n.name))throw new h(`Generator name "${n.name}" collides with an existing generator. Rename the custom generator.`);if(n.requiresGenerator!==void 0){let t=Je(V,n.requiresGenerator);if(t===void 0)throw new h(`Generator "${n.name}" declares requiresGenerator "${n.requiresGenerator}", which is not a range we read. Use ^1.2.0, ~1.2.0, >=1.2.0, or an exact version.`);if(!t)throw new h(`Generator "${n.name}" needs @redocly/client-generator ${n.requiresGenerator}; this CLI ships ${V}. Upgrade @redocly/cli if the generator is newer, or update the generator \u2014 \`redocly eject-generator <name> --update\` for an ejected file, or upgrade its package.`)}n.name in I&&w.warn(`generate-client: custom generator "${n.name}" takes over the built-in generator of the same name.
|
|
@@ -13,9 +13,9 @@ import{a as Me}from"./M3HF5ZRI.js";import{d as Ke,e as Ue,f as Fe}from"./D7CUMUE
|
|
|
13
13
|
`}};function A(e,n){let t=new Set,r=e;for(;r.kind==="ref";){let{name:s}=r;if(t.has(s))return;t.add(s);let o=n.schemas.find(a=>a.name===s);if(o===void 0)return;r=o.schema}return r}function en(e,n){let t=A(e,n);if(t===void 0)return;if(t.kind==="object")return{properties:t.properties,description:t.description};if(t.kind!=="intersection")return;let r=new Map;for(let s of t.members){let o=en(s,n);if(o===void 0)return;for(let a of o.properties)r.set(a.name,a)}return{properties:[...r.values()],description:t.description}}function $n(e,n){let t=A(e,n);if(t?.kind!=="union"||t.discriminator===void 0)return;let r=[];for(let{value:s,schemaName:o}of t.discriminator.mapping){let a=A({kind:"ref",name:o},n);if(a===void 0)return;r.push({value:s,schemaName:o,schema:a})}return{property:t.discriminator.propertyName,cases:r}}function nn(e){return e.kind==="union"&&e.members.some(n=>n.kind==="null")}function jn(e){if(e.kind!=="union"||!nn(e))return e;let n=e.members.filter(t=>t.kind!=="null");return n.length===1?n[0]:{...e,members:n}}function Nn(e){if(e.kind!=="enum")return;let n=X(e.values.map(t=>typeof t=="string"?j.screaming(t):`VALUE_${j.screaming(String(t))}`),{style:"screaming"});return{values:e.values,scalar:e.scalar,memberNames:n}}function Dn(e){if(!e)return[];let n=e.split(/\r\n|\n|\r/).map(t=>t.trim());for(;n.length>0&&n[0]==="";)n.shift();for(;n.length>0&&n[n.length-1]==="";)n.pop();return n}function tn(e,n,t){if(e.kind==="object")return e.properties.find(r=>r.name===n)?.schema;if(e.kind==="record")return e.value;if(e.kind==="array"&&/^(0|[1-9]\d*)$/.test(n))return e.items;if(e.kind==="intersection"){let r;for(let s of e.members){let o=A(s,t);o!==void 0&&(r=tn(o,n,t)??r)}return r}}function E(e,n,t){let r=A(e,t);if(!(r===void 0||n!==""&&!n.startsWith("/"))){if(n==="")return r;for(let s of n.slice(1).split("/")){let o=s.replaceAll("~1","/").replaceAll("~0","~"),a=tn(r,o,t);if(a===void 0||(r=A(a,t),r===void 0))return}return r}}function D(e,n,t=new Set){if(e.kind==="ref"){if(t.has(e.name))return"string";t.add(e.name);let r=n.schemas.find(s=>s.name===e.name);return r===void 0?"string":D(r.schema,n,t)}if(e.kind==="intersection"){let r=e.members.filter(o=>o.kind!=="unknown");if(r.length===1)return D(r[0],n,t);let s=[...new Set(r.map(o=>D(o,n,new Set(t))))];return s.length===1?s[0]:s.every(o=>o==="integer"||o==="number")?"number":"string"}if(e.kind==="union"){let r=e.members.filter(s=>s.kind!=="null");return r.length===1?D(r[0],n,t):"string"}if(e.kind==="scalar"||e.kind==="enum"){if(e.scalar==="integer")return"integer";if(e.scalar==="number")return"number";if(e.scalar==="boolean")return"boolean"}if(e.kind==="literal"){if(typeof e.value=="number")return Number.isInteger(e.value)?"integer":"number";if(typeof e.value=="boolean")return"boolean"}return"string"}var ee=/^[A-Za-z_$][A-Za-z0-9_$]*$/,ne=Q.typescript;function Ln(e){return ee.test(e)}function F(e){return ee.test(e)&&!ne.has(e)}function te(e){let n=e.replace(/[^A-Za-z0-9_$]/g,"_");return(n===""||/^[0-9]/.test(n)||ne.has(n))&&(n=`_${n}`),n}var Mn={"<":"\\u003C",">":"\\u003E","\u2028":"\\u2028","\u2029":"\\u2029"};function Y(e){return JSON.stringify(e).replace(/[<>\u2028\u2029]/g,n=>Mn[n])}function Kn(e){return ee.test(e)&&!ne.has(e)?e:Y(e)}function Z(e){if(typeof e=="string")return Y(e);if(typeof e=="boolean"||e===null||typeof e=="number")return String(e);if(Array.isArray(e))return`[${e.map(Z).join(", ")}]`;let n=Object.entries(e).map(([t,r])=>`${Ln(t)?t:Y(t)}: ${Z(r)}`);return n.length===0?"{}":`{ ${n.join(", ")} }`}function B(e){return e[0].toUpperCase()+e.slice(1)}var rn=["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 Un=["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"],Fn=["z","http","HttpResponse","handlers","faker","queryOptions","useSWR","useSWRMutation","__Writable"],Bn=["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"],re;function on(){return re===void 0&&(re=new Set([...Un,...Fn,...Bn,...rn])),re}function dn(e){let n=new Set,t=new Set,r=new Map;for(let p of e.securitySchemes){let m=oe(p.key,n,t);m!==p.key&&(r.set(p.key,m),ae("security scheme",p.key,m,an(p.key,n)),p.key=m)}let s=new Set(on()),o=new Set(s),a=new Set,i=new Map;for(let p of e.schemas){let m=oe(p.name,o,a);m!==p.name&&(i.set(p.name,m),ae("schema",p.name,m,an(p.name,s)),p.name=m)}let d=p=>i.get(p)??sn(p),l=p=>r.get(p)??sn(p);for(let p of e.schemas)v(p.schema,d);let c=new Set(o),u=new Set,g=new Set;for(let p of e.services)for(let m of p.operations){let f=g.has(m.name);g.add(m.name);let y=m.name,P=oe(m.name,c,u);if(P!==m.name){let x=f?{kind:"duplicate-operation-id"}:s.has(y)?{kind:"reserved"}:o.has(y)?{kind:"schema-collision"}:{kind:"unusable"};ae("operation",y,P,x),m.specName=m.name,m.name=P}Hn(m,d),m.security=m.security.map(x=>x.map(l))}}function oe(e,n,t){let r=te(e),s=r,o=2;for(;n.has(s)||t.has(B(s));)s=`${r}_${o++}`;return n.add(s),t.add(B(s)),s}function ln(e){for(let n of e.schemas)if(!F(n.name))throw se("schema",n.name);for(let n of e.securitySchemes)if(!F(n.key))throw se("security scheme",n.key);for(let n of e.services)for(let t of n.operations)if(!F(t.name))throw se("operation",t.name)}function se(e,n){return new Error(`Internal error: ${e} name ${JSON.stringify(n)} is not a safe identifier after sanitization.`)}function sn(e){return te(e)}function ae(e,n,t,r){let s=JSON.stringify(n),o=JSON.stringify(t),a=r.kind==="duplicate-operation-id"?`two operations share the operationId ${s}; the second is emitted as ${o} \u2014 give each operation a unique operationId to control its method name`:r.kind==="schema-collision"?`${e} ${s} collides with the schema of the same name, so it is emitted as ${o} \u2014 rename the operation or the schema in the description to control its name`:r.kind==="reserved"?`${e} ${s} is a name a generated client already declares, so it is emitted as ${o} \u2014 the reserved set spans every target language, so one schema keeps one name across the SDKs you generate`:`${e} ${s} is not a usable identifier, so it is emitted as ${o}`;w.warn(`generate-client: ${a}.
|
|
14
14
|
`)}function an(e,n){return n.has(e)?{kind:"reserved"}:{kind:"unusable"}}function v(e,n){switch(e.kind){case"ref":e.name=n(e.name);break;case"omit":e.base=n(e.base);break;case"array":v(e.items,n);break;case"record":v(e.value,n);break;case"object":for(let t of e.properties)v(t.schema,n);break;case"union":for(let t of e.members)v(t,n);if(e.discriminator)for(let t of e.discriminator.mapping)t.schemaName=n(t.schemaName);break;case"intersection":for(let t of e.members)v(t,n);break}}function Hn(e,n){for(let t of e.pathParams)v(t.schema,n);for(let t of e.queryParams)v(t.schema,n);for(let t of e.headerParams)v(t.schema,n);for(let t of e.cookieParams)v(t.schema,n);e.requestBody&&v(e.requestBody.schema,n);for(let t of[...e.successResponses,...e.errorResponses])v(t.schema,n),t.itemSchema&&v(t.itemSchema,n)}var Gn=["get","post","put","delete","patch","head","options"];function pn(e,n){if(!n.startsWith("#/"))throw new h(`External $ref not supported: ${n}`);let t=n.slice(2).split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~")),r=e;for(let s of t){if(!O(r)&&!Array.isArray(r))throw new h(`Cannot resolve $ref: ${n}`);r=r[s]}if(r===void 0)throw new h(`Cannot resolve $ref: ${n}`);return r}function C(e,n){return R(n)?pn(e,n.$ref):n}function L(e){let n=e.lastIndexOf("/");return n>=0?e.slice(n+1):e}function _n(e){let n=e,t={};return typeof n.minimum=="number"&&(t.minimum=n.minimum),typeof n.maximum=="number"&&(t.maximum=n.maximum),typeof n.exclusiveMinimum=="number"?t.exclusiveMinimum=n.exclusiveMinimum:n.exclusiveMinimum===!0&&typeof n.minimum=="number"&&(t.exclusiveMinimum=n.minimum,delete t.minimum),typeof n.exclusiveMaximum=="number"?t.exclusiveMaximum=n.exclusiveMaximum:n.exclusiveMaximum===!0&&typeof n.maximum=="number"&&(t.exclusiveMaximum=n.maximum,delete t.maximum),typeof n.minLength=="number"&&(t.minLength=n.minLength),typeof n.maxLength=="number"&&(t.maxLength=n.maxLength),typeof n.pattern=="string"&&(t.pattern=n.pattern),typeof n.minItems=="number"&&(t.minItems=n.minItems),typeof n.maxItems=="number"&&(t.maxItems=n.maxItems),n.uniqueItems===!0&&(t.uniqueItems=!0),typeof n.format=="string"&&(t.format=n.format),n.deprecated===!0&&(t.deprecated=!0),n.example!==void 0?t.example=n.example:Array.isArray(n.examples)&&n.examples.length>0&&(t.example=n.examples[0]),n.default!==void 0&&(t.default=n.default),Object.keys(t).length>0?t:void 0}function zn(e,n){let t=e.discriminator;if(!t||typeof t.propertyName!="string")return;let r=[];if(t.mapping)for(let[s,o]of Object.entries(t.mapping))r.push({value:s,schemaName:L(o)});else for(let s of n)if(R(s)){let o=L(s.$ref);r.push({value:o,schemaName:o})}if(r.length!==0)return{propertyName:t.propertyName,mapping:r}}function k(e,n){return n?{...e,metadata:n}:e}function ie(e,n){return e?n?{...e,...n}:e:n}function Wn(e){return e?e.url.replace(/\{([^{}]+)\}/g,(n,t)=>e.variables?.[t]?.default??n):""}function un(e){let n=e.info?.title??"Api",t=e.info?.version??"0.0.0",r=e.info?.description,s=Wn(e.servers?.[0]),o=(e.servers??[]).map(c=>({url:c.url,description:c.description,variables:Object.entries(c.variables??{}).map(([u,g])=>({name:u,default:g.default,description:g.description}))})),a=et(e),i=Yn(e),d=nt(e,i),l={title:n,version:t,description:r,serverUrl:s,servers:o,services:d,schemas:a,securitySchemes:i};return dn(l),Jn(d,a),ln(l),l}function Jn(e,n){let t=new Map(n.map(r=>[r.name,r.schema]));for(let r of e)for(let s of r.operations)s.requestBody&&(s.requestBody.schema=Qn(s.requestBody.schema,t))}function Vn(e){let n=e.filter(t=>t.kind!=="unknown");return n.length>0?n:[{kind:"unknown"}]}function Qn(e,n){if(e.kind==="ref"){let t=Xn(e,n,new Set);return t.length>0?{kind:"omit",base:e.name,keys:t}:e}if(e.kind==="object"){let t=e.properties.filter(r=>!r.readOnly);return t.length===e.properties.length?e:{...e,properties:t}}return e}function Xn(e,n,t){let r=[],s=o=>{if(o.kind==="ref"){if(t.has(o.name))return;t.add(o.name);let a=n.get(o.name);a&&s(a)}else if(o.kind==="object")for(let a of o.properties)a.readOnly&&!r.includes(a.name)&&r.push(a.name);else if(o.kind==="intersection")for(let a of o.members)s(a)};return s(e),r}function Yn(e){let n=e.components?.securitySchemes;if(!n)return[];let t=[];for(let[r,s]of Object.entries(n)){let o=C(e,s),a=o.type;a==="oauth2"||a==="openIdConnect"?t.push({kind:"bearer",key:r}):a==="http"&&(o.scheme??"").toLowerCase()==="bearer"?t.push({kind:"bearer",key:r}):a==="http"&&(o.scheme??"").toLowerCase()==="basic"?t.push({kind:"basic",key:r}):a==="apiKey"&&o.in==="header"&&typeof o.name=="string"?t.push({kind:"apiKeyHeader",key:r,headerName:o.name}):a==="apiKey"&&o.in==="query"&&typeof o.name=="string"?t.push({kind:"apiKeyQuery",key:r,paramName:o.name}):a==="apiKey"&&o.in==="cookie"&&typeof o.name=="string"&&(w.warn(`generate-client: security scheme "${r}" sends its credential in the Cookie header, which browsers ignore \u2014 cookie auth works only in server-side clients.
|
|
15
15
|
`),t.push({kind:"apiKeyCookie",key:r,cookieName:o.name}))}return t}function Zn(e,n,t){let r=e.security??n.security;if(!r)return[];let s=[];for(let o of r){let a=Object.keys(o);a.length!==0&&a.every(i=>t.has(i))&&s.push([...new Set(a)])}return s}function et(e){let n=e.components?.schemas;return n?Object.entries(n).map(([t,r])=>{if(R(r)){let o=pn(e,r.$ref);return{name:t,schema:T(o,`components.schemas.${t}`,e),description:o.description}}let s=T(r,`components.schemas.${t}`,e);return{name:t,schema:s,description:r.description}}):[]}function nt(e,n){let t=new Set(n.map(a=>a.key)),r=[],s=new Set;for(let[a,i]of Object.entries(e.paths??{})){if(!i)continue;let d=C(e,i),l=(d.parameters??[]).map(c=>mn(C(e,c),`paths.${a}.parameters`,e));for(let c of Gn){let u=d[c];u&&(r.push({method:c,path:a,operation:u,pathLevelParams:l}),u.operationId&&s.add(u.operationId))}}return[{name:"Default",operations:r.map(a=>{let i=a.operation.operationId??ot(tt(a.method,a.path),s);return st(a.method,a.path,a.operation,i,a.pathLevelParams,e,t)})}]}function tt(e,n){let t=n.split("/").filter(Boolean).map(r=>rt(r.replace(/[{}]/g,"")));return`${e}${t.join("")}`}function rt(e){return e.split(/[^A-Za-z0-9]+/).filter(Boolean).map(n=>n[0].toUpperCase()+n.slice(1)).join("")}function ot(e,n){let t=e,r=2;for(;n.has(t);)t=`${e}${r++}`;return n.add(t),t}function st(e,n,t,r,s,o,a){let i=(t.parameters??[]).map(b=>mn(C(o,b),`paths.${n}.${e}.parameters`,o)),d=new Set,l=[];for(let b of i)d.add(`${b.in}:${b.name}`),l.push(b);for(let b of s)d.has(`${b.in}:${b.name}`)||l.push(b);let c=l.filter(b=>b.in==="path"),u=l.filter(b=>b.in==="query"),g=l.filter(b=>b.in==="header"),p=l.filter(b=>b.in==="cookie"),m=t.requestBody?it(C(o,t.requestBody),`${e} ${n}`,o):void 0,{successResponses:f,successResponseHeaders:y}=dt(t,n,o),P=ct(t,n,o),x=Zn(t,o,a),he=t["x-redoclyPagination"],ye=at(f);return{name:r,method:e,path:n,summary:t.summary,description:t.description,pathParams:c,queryParams:u,headerParams:g,cookieParams:p,requestBody:m,successResponses:f,...y===void 0?{}:{successResponseHeaders:y},errorResponses:P,security:x,tags:Array.isArray(t.tags)?t.tags.filter(b=>typeof b=="string"):[],...he!==void 0?{paginationExtension:he}:{},...ye===void 0?{}:{sse:ye}}}function at(e){let n=e.find(s=>s.contentType.split(";")[0].trim().toLowerCase()==="text/event-stream");if(n===void 0)return;let t=n.itemSchema&&n.itemSchema.kind!=="unknown"?n.itemSchema:n.schema.kind!=="unknown"?n.schema:void 0;if(t===void 0)return{dataKind:"text"};let r=t.kind==="object"||t.kind==="ref"||t.kind==="array"||t.kind==="record"||t.kind==="union"||t.kind==="intersection";return{eventSchema:t,dataKind:r?"json":"text"}}function mn(e,n,t){if(!e.in)throw new h(`Parameter ${e.name} at ${n} is missing "in"`);if(!["path","query","header","cookie"].includes(e.in))throw new h(`Unsupported parameter location "${e.in}" for ${e.name} at ${n}`);let r=S(e.schema,`${n}.${e.name}`,t);e.deprecated===!0&&(r={...r,metadata:ie(r.metadata,{deprecated:!0})});let s={name:e.name,in:e.in,schema:r,required:!!e.required,description:e.description};if(s.in==="query"){let o=e;(o.style==="form"||o.style==="spaceDelimited"||o.style==="pipeDelimited"||o.style==="deepObject")&&(s.style=o.style),typeof o.explode=="boolean"&&(s.explode=o.explode),typeof o.allowReserved=="boolean"&&(s.allowReserved=o.allowReserved)}return s}function it(e,n,t){let r=e.content??{},s=r["application/json"]??r["application/merge-patch+json"]??r["application/x-www-form-urlencoded"]??r["multipart/form-data"]??Object.values(r)[0];if(!s)return;let o=Object.keys(r).find(i=>r[i]===s),a=S(s.schema,`${n}.requestBody`,t);return{contentType:o,schema:a,required:!!e.required,description:e.description}}function dt(e,n,t){let r=e.responses??{},s=Object.keys(r).filter(g=>/^2\d\d$/.test(g));s.length===0&&(r["2XX"]?s.push("2XX"):r.default&&s.push("default"));let o=s[0];if(!o)return{successResponses:[]};let a=r[o];if(!a)return{successResponses:[]};let i=C(t,a),d=lt(i.headers,`paths.${n}.response.${o}`,t),l=i.content;if(!l)return{successResponses:[],...d===void 0?{}:{successResponseHeaders:d}};let c=o==="default"||o==="2XX"?o:Number(o),u=[];for(let[g,p]of Object.entries(l)){let m=S(p.schema,`paths.${n}.response.${o}.${g}`,t),f=p.itemSchema,y=f!==void 0?S(f,`paths.${n}.response.${o}.${g}.itemSchema`,t):void 0;u.push({contentType:g,schema:m,status:c,...y===void 0?{}:{itemSchema:y}})}return{successResponses:u,...d===void 0?{}:{successResponseHeaders:d}}}function lt(e,n,t){if(!e)return;let r=[];for(let[s,o]of Object.entries(e)){let a=C(t,o),i={name:s.toLowerCase(),schema:S(a.schema===void 0?void 0:C(t,a.schema),`${n}.headers.${s}`,t)};a.required===!0&&(i.required=!0),r.push(i)}return r.length>0?r:void 0}function ct(e,n,t){let r=e.responses??{},s=Object.keys(r).filter(i=>/^([45]\d\d|4XX|5XX)$/.test(i));Object.keys(r).some(i=>/^(2\d\d|2XX)$/.test(i))&&r.default&&s.push("default");let a=[];for(let i of s){let d=r[i];if(!d)continue;let c=C(t,d).content;if(!c)continue;let u=i==="default"||i==="4XX"||i==="5XX"?i:Number(i);for(let[g,p]of Object.entries(c)){let m=S(p.schema,`paths.${n}.response.${i}.${g}`,t);a.push({contentType:g,schema:m,status:u})}}return a}function S(e,n,t){return e===void 0||typeof e=="boolean"?{kind:"unknown"}:R(e)?{kind:"ref",name:L(e.$ref)}:T(e,n,t)}function T(e,n,t){let r=_n(e),s=e.oneOf??e.anyOf;if(s){let i=s.map((c,u)=>R(c)?{kind:"ref",name:L(c.$ref)}:T(c,`${n}.[${u}]`,t)),d=Vn(i);if(d.length===1&&d.length<i.length){let c=d[0];return{...c,description:c.description??e.description,metadata:ie(r,c.metadata)}}let l=zn(e,s);return k({kind:"union",members:d,discriminator:l,description:e.description},r)}if(e.allOf){let i=e.allOf.map((l,c)=>R(l)?{kind:"ref",name:L(l.$ref)}:T(l,`${n}.allOf[${c}]`,t)),d=cn(e,n,t);if(d.length>0&&i.unshift({kind:"object",properties:d}),i.length===1){let l=i[0];return{...l,description:l.description??e.description,metadata:ie(r,l.metadata)}}return k({kind:"intersection",members:i,description:e.description},r)}let o=e.type;if(Array.isArray(o)){let i=o.filter(c=>c!=="null"),d=o.includes("null"),l=i.map(c=>{let u={...e,type:c};if(Array.isArray(u.enum)){let g=u.enum.filter(p=>p!==null);u.enum=g.length>0?g:void 0}return T(u,n,t)});return d&&l.push({kind:"null"}),l.length===1?l[0]:k({kind:"union",members:l,description:e.description},r)}if(e.nullable)return{kind:"union",members:[T({...e,nullable:void 0},n,t),{kind:"null"}],description:e.description};if(e.const!==void 0){let i=e.const;if(typeof i!="string"&&typeof i!="number"&&typeof i!="boolean")throw new h(`Unsupported const value at ${n}: ${JSON.stringify(i)}`);return k({kind:"literal",value:i,description:e.description},r)}if(e.enum){let i=e.enum,d=i.filter(g=>g!==null),l=d.length!==i.length;if(d.length===0)return k({kind:"null",description:e.description},r);let c=pt(d,n),u=c==="boolean"?{kind:"scalar",scalar:"boolean",description:e.description}:{kind:"enum",values:d,scalar:c,description:e.description};return k(l?{kind:"union",members:[u,{kind:"null"}],description:e.description}:u,r)}let a=o;if(a==="null")return k({kind:"null",description:e.description},r);if(a==="array"){let i=e.items,d=S(i,`${n}.items`,t);return k({kind:"array",items:d,description:e.description},r)}if(a==="object"||e.properties||e.additionalProperties){let i=cn(e,n,t),d=e.additionalProperties;if(i.length===0&&d!==!1){let l=S(d,`${n}.additionalProperties`,t);return k({kind:"record",value:l,description:e.description},r)}return k({kind:"object",properties:i,description:e.description},r)}return k(a==="string"||a==="number"||a==="integer"||a==="boolean"?{kind:"scalar",scalar:a,description:e.description}:{kind:"unknown",description:e.description},r)}function pt(e,n){let t=!1,r=!1,s=!1;for(let o of e)if(typeof o=="string")t=!0;else if(typeof o=="number")r=!0;else if(typeof o=="boolean")s=!0;else throw new h(`Unsupported enum value type at ${n}: ${JSON.stringify(o)}`);return t&&!r&&!s?"string":r&&!t&&!s?"number":s&&!t&&!r?"boolean":"string"}function ut(e){return!(e.openapi??"").startsWith("3.0")}function cn(e,n,t){let r=e.properties??{},s=new Set(e.required??[]),o=ut(t);return Object.entries(r).map(([a,i])=>{let d=i.readOnly===!0;d&&R(i)&&!o&&w.warn(`generate-client: "${a}" declares readOnly beside a $ref, which OpenAPI ${t.openapi} ignores \u2014 the property stays in request bodies. Inline the schema, wrap the $ref in allOf, or move the description to OpenAPI 3.1.
|
|
16
|
-
`);let l=d&&(o||!R(i));return{name:a,schema:S(i,`${n}.${a}`,t),required:s.has(a),description:i.description,...l?{readOnly:!0}:{}}})}function H(e){return e.flatMap(n=>n.operations)}function fn(e){let n=de(e),t={...n};delete t.swagger,delete t.host,delete t.basePath,delete t.schemes,delete t.definitions,delete t.securityDefinitions,delete t.consumes,delete t.produces,delete t.parameters,delete t.responses,t.openapi="3.0.3";let r=mt(n);return r&&(t.servers=r),t.components=ft(n),t.paths=bt(n.paths??{},n.consumes??void 0,n.produces??void 0),t}function mt(e){let n=e.host,t=e.basePath??"",r=(e.schemes??["https"])[0]??"https";if(n)return[{url:`${r}://${n}${t}`}]}function ft(e){let n={};e.definitions&&(n.schemas=e.definitions),e.parameters&&(n.parameters=Object.fromEntries(Object.entries(e.parameters).map(([r,s])=>[r,le(s)]))),e.responses&&(n.responses=hn(e.responses,void 0));let t=e.securityDefinitions;if(t){let r={};for(let[s,o]of Object.entries(t))r[s]=gt(o);n.securitySchemes=r}return n}function gt(e){switch(e.type){case"basic":return{type:"http",scheme:"basic"};case"apiKey":return{type:"apiKey",name:e.name,in:e.in};case"oauth2":{let n=e.flow==="accessCode"?"authorizationCode":e.flow==="application"?"clientCredentials":e.flow,t={scopes:e.scopes??{}};return e.authorizationUrl&&(t.authorizationUrl=e.authorizationUrl),e.tokenUrl&&(t.tokenUrl=e.tokenUrl),{type:"oauth2",flows:{[n]:t}}}default:return e}}function de(e){if(Array.isArray(e))return e.map(de);if(O(e)){let n={};for(let[t,r]of Object.entries(e))t==="$ref"&&typeof r=="string"?n.$ref=r.replace("#/definitions/","#/components/schemas/").replace("#/parameters/","#/components/parameters/").replace("#/responses/","#/components/responses/"):n[t]=de(r);return n}return e}var ht="application/json",yt="application/json",gn=new Set(["name","in","required","description","deprecated","allowEmptyValue","collectionFormat"]);function bt(e,n,t){let r={};for(let[s,o]of Object.entries(e)){let a=o,i={};for(let[d,l]of Object.entries(a)){if(d==="parameters"&&Array.isArray(l)){i.parameters=l.map(le);continue}if(!wt(d)){i[d]=l;continue}i[d]=vt(l,n,t)}r[s]=i}return r}function wt(e){return["get","put","post","delete","options","head","patch"].includes(e.toLowerCase())}function vt(e,n,t){let r=e.consumes??n,s=e.produces??t,o=e.parameters??[],a=o.find(u=>u.in==="body"),i=o.filter(u=>u.in==="formData"),d=o.filter(u=>u.in!=="body"&&u.in!=="formData").map(le),l={...e,parameters:d};delete l.consumes,delete l.produces;let c=r?.[0]??ht;if(a)l.requestBody={required:!!a.required,content:{[c]:{schema:a.schema}}};else if(i.length>0){let u={},g=[];for(let f of i)u[f.name]=kt(f),f.required&&g.push(f.name);let p={type:"object",properties:u};g.length>0&&(p.required=g);let m=r?.find(f=>f==="multipart/form-data")??r?.[0]??"application/x-www-form-urlencoded";l.requestBody={required:g.length>0,content:{[m]:{schema:p}}}}return e.responses&&(l.responses=hn(e.responses,s)),l}function le(e){if(e.$ref!==void 0||e.in==="body"||e.in==="formData")return e;let n={},t={};for(let[r,s]of Object.entries(e))gn.has(r)?n[r]=s:t[r]=s;if(n.schema=t,delete n.collectionFormat,e.in==="query"&&t.type==="array"){let r=e.collectionFormat??"csv";r!=="multi"&&(n.style=r==="ssv"?"spaceDelimited":r==="pipes"?"pipeDelimited":"form",n.explode=!1)}return n}function kt(e){let n={};for(let[t,r]of Object.entries(e))gn.has(t)||(n[t]=r);return n}function hn(e,n){let t=n?.[0]??yt,r={};for(let[s,o]of Object.entries(e)){let a=o;if(a.schema===void 0){r[s]=a;continue}let{schema:i,...d}=a;r[s]={...d,content:{[t]:{schema:i}}}}return r}async function yn(e,n){let t=n??await _({}),r=await xe({ref:e,config:t}),s=await _({rules:{struct:"error"}}),o=await Oe({externalRefResolver:new
|
|
16
|
+
`);let l=d&&(o||!R(i));return{name:a,schema:S(i,`${n}.${a}`,t),required:s.has(a),description:i.description,...l?{readOnly:!0}:{}}})}function H(e){return e.flatMap(n=>n.operations)}function fn(e){let n=de(e),t={...n};delete t.swagger,delete t.host,delete t.basePath,delete t.schemes,delete t.definitions,delete t.securityDefinitions,delete t.consumes,delete t.produces,delete t.parameters,delete t.responses,t.openapi="3.0.3";let r=mt(n);return r&&(t.servers=r),t.components=ft(n),t.paths=bt(n.paths??{},n.consumes??void 0,n.produces??void 0),t}function mt(e){let n=e.host,t=e.basePath??"",r=(e.schemes??["https"])[0]??"https";if(n)return[{url:`${r}://${n}${t}`}]}function ft(e){let n={};e.definitions&&(n.schemas=e.definitions),e.parameters&&(n.parameters=Object.fromEntries(Object.entries(e.parameters).map(([r,s])=>[r,le(s)]))),e.responses&&(n.responses=hn(e.responses,void 0));let t=e.securityDefinitions;if(t){let r={};for(let[s,o]of Object.entries(t))r[s]=gt(o);n.securitySchemes=r}return n}function gt(e){switch(e.type){case"basic":return{type:"http",scheme:"basic"};case"apiKey":return{type:"apiKey",name:e.name,in:e.in};case"oauth2":{let n=e.flow==="accessCode"?"authorizationCode":e.flow==="application"?"clientCredentials":e.flow,t={scopes:e.scopes??{}};return e.authorizationUrl&&(t.authorizationUrl=e.authorizationUrl),e.tokenUrl&&(t.tokenUrl=e.tokenUrl),{type:"oauth2",flows:{[n]:t}}}default:return e}}function de(e){if(Array.isArray(e))return e.map(de);if(O(e)){let n={};for(let[t,r]of Object.entries(e))t==="$ref"&&typeof r=="string"?n.$ref=r.replace("#/definitions/","#/components/schemas/").replace("#/parameters/","#/components/parameters/").replace("#/responses/","#/components/responses/"):n[t]=de(r);return n}return e}var ht="application/json",yt="application/json",gn=new Set(["name","in","required","description","deprecated","allowEmptyValue","collectionFormat"]);function bt(e,n,t){let r={};for(let[s,o]of Object.entries(e)){let a=o,i={};for(let[d,l]of Object.entries(a)){if(d==="parameters"&&Array.isArray(l)){i.parameters=l.map(le);continue}if(!wt(d)){i[d]=l;continue}i[d]=vt(l,n,t)}r[s]=i}return r}function wt(e){return["get","put","post","delete","options","head","patch"].includes(e.toLowerCase())}function vt(e,n,t){let r=e.consumes??n,s=e.produces??t,o=e.parameters??[],a=o.find(u=>u.in==="body"),i=o.filter(u=>u.in==="formData"),d=o.filter(u=>u.in!=="body"&&u.in!=="formData").map(le),l={...e,parameters:d};delete l.consumes,delete l.produces;let c=r?.[0]??ht;if(a)l.requestBody={required:!!a.required,content:{[c]:{schema:a.schema}}};else if(i.length>0){let u={},g=[];for(let f of i)u[f.name]=kt(f),f.required&&g.push(f.name);let p={type:"object",properties:u};g.length>0&&(p.required=g);let m=r?.find(f=>f==="multipart/form-data")??r?.[0]??"application/x-www-form-urlencoded";l.requestBody={required:g.length>0,content:{[m]:{schema:p}}}}return e.responses&&(l.responses=hn(e.responses,s)),l}function le(e){if(e.$ref!==void 0||e.in==="body"||e.in==="formData")return e;let n={},t={};for(let[r,s]of Object.entries(e))gn.has(r)?n[r]=s:t[r]=s;if(n.schema=t,delete n.collectionFormat,e.in==="query"&&t.type==="array"){let r=e.collectionFormat??"csv";r!=="multi"&&(n.style=r==="ssv"?"spaceDelimited":r==="pipes"?"pipeDelimited":"form",n.explode=!1)}return n}function kt(e){let n={};for(let[t,r]of Object.entries(e))gn.has(t)||(n[t]=r);return n}function hn(e,n){let t=n?.[0]??yt,r={};for(let[s,o]of Object.entries(e)){let a=o;if(a.schema===void 0){r[s]=a;continue}let{schema:i,...d}=a;r[s]={...d,content:{[t]:{schema:i}}}}return r}async function yn(e,n){let t=n??await _({}),r=await xe({ref:e,config:t}),s=await _({rules:{struct:"error"}}),o=await Oe({externalRefResolver:new ve,document:r.bundle,config:s}),a=[...r.problems,...o].filter(d=>d.severity==="error");if(a.length>0){let d=a.map(l=>`- ${l.message} (at ${l.location?.[0]?.pointer??e})`).join(`
|
|
17
17
|
`);throw new Error(`The API description has ${a.length} error(s):
|
|
18
|
-
${d}`)}let i=r.bundle.parsed;return{document:i,version:
|
|
18
|
+
${d}`)}let i=r.bundle.parsed;return{document:i,version:ke(i)}}function xt(e,n,t){let r=e.specName??e.name;if(t?.exclude?.includes(r))return{};let s=t?.operations?.[r];if(s!==void 0)return ce(e,n,s,`pagination.operations["${r}"]`,!0);if(e.paginationExtension!==void 0)return ce(e,n,e.paginationExtension,"x-redoclyPagination",!0);if(t?.style!==void 0){let{exclude:o,operations:a,...i}=t;return ce(e,n,i,"pagination convention",!1)}return{}}function bn(e,n){let t=new Map,r=[];for(let s of H(e.services)){let o=xt(s,e,n);o.error!==void 0?r.push(o.error):o.spec!==void 0&&t.set(s.name,{spec:o.spec,itemSchema:o.itemSchema})}if(r.length>0)throw new Error(["Invalid pagination configuration:",...r].join(`
|
|
19
19
|
- `));return t}function ce(e,n,t,r,s){let o=`Pagination for operation "${e.name}" (${r})`,a=Ot(t);if(a!==void 0)return{error:`${o}: ${a}`};let i=t,d=p=>s?{error:`${o}: ${p}`}:{};if(e.sse!==void 0)return d("the operation is a Server-Sent Events stream");if(i.style!=="link"){let p=i.style==="cursor"?"cursorParam":"offsetParam",m=i.style==="cursor"?i.cursorParam:i.offsetParam,f=e.queryParams.find(x=>x.name===m);if(!f){let x=e.queryParams.map(ge=>ge.name).join(", ");return d(`query parameter "${m}" is not declared on the operation`+(x===""?"":` (declared: ${x})`))}let y=wn(f.schema,n);if(!(y!==void 0&&(i.style==="cursor"?pe(y,n):y.kind==="scalar"&&(y.scalar==="number"||y.scalar==="integer")))){let x=i.style==="cursor"?"a string":"a number";return d(`the "${p}" query parameter "${m}" must accept ${x} (got ${Rt(y)})`)}}let l=e.successResponses.find(p=>p.contentType.toLowerCase().includes("json"));if(!l)return d("the operation has no JSON success response");if(i.style==="link"){let p=e.successResponseHeaders?.some(m=>m.name==="link")===!0;if(!p&&!s)return{};p||w.warn(`generate-client: ${o.toLowerCase()} follows the Link header, but the success response does not document one.
|
|
20
20
|
`)}let c=E(l.schema,i.items,n);if(c===void 0)return d(`the "items" pointer "${i.items}" does not resolve in the success response schema`);if(c.kind!=="array")return d(`the "items" pointer "${i.items}" must point at an array (got ${c.kind})`);if(i.style==="cursor"){let p=E(l.schema,i.nextCursor,n);if(p===void 0)return d(`the "nextCursor" pointer "${i.nextCursor}" does not resolve in the success response schema`);if(!pe(p,n))return d(`the "nextCursor" pointer "${i.nextCursor}" must point at a string (got ${p.kind})`);if(i.hasMore!==void 0){let m=E(l.schema,i.hasMore,n);if(m===void 0)return d(`the "hasMore" pointer "${i.hasMore}" does not resolve in the success response schema`);if(m.kind!=="scalar"||m.scalar!=="boolean")return d(`the "hasMore" pointer "${i.hasMore}" must point at a boolean (got ${m.kind})`)}}let u=i.limitParam!==void 0?{limitParam:i.limitParam}:{};return{spec:i.style==="cursor"?{style:"cursor",param:i.cursorParam,...u,nextCursor:i.nextCursor,...i.hasMore!==void 0?{hasMore:i.hasMore}:{},items:i.items}:i.style==="link"?{style:"link",...u,items:i.items}:{style:i.style,param:i.offsetParam,...u,items:i.items},itemSchema:c.items}}function Ot(e){if(!O(e))return"the rule must be an object";let{style:n,cursorParam:t,nextCursor:r,hasMore:s,offsetParam:o,limitParam:a,items:i}=e;if(n!=="cursor"&&n!=="offset"&&n!=="page"&&n!=="link")return`"style" must be one of "cursor" | "offset" | "page" | "link" (got ${JSON.stringify(n)})`;if(typeof i!="string"||i!==""&&!i.startsWith("/"))return'"items" must be a JSON pointer starting with "/" (or "" when the response body is the item array itself)';if(n==="cursor"){if(typeof t!="string"||t==="")return'cursor style requires a "cursorParam" query parameter name';if(typeof r!="string"||!r.startsWith("/"))return'cursor style requires a "nextCursor" JSON pointer starting with "/"';if(s!==void 0&&(typeof s!="string"||!s.startsWith("/")))return'"hasMore" must be a JSON pointer starting with "/"'}else if((n==="offset"||n==="page")&&(typeof o!="string"||o===""))return`${n} style requires an "offsetParam" query parameter name`;if(a!==void 0&&typeof a!="string")return'"limitParam" must be a query parameter name'}function Rt(e){return e===void 0?"an unresolvable ref":e.kind==="scalar"||e.kind==="enum"?e.scalar:e.kind}function wn(e,n){let t=new Set,r=e;for(;r.kind==="ref";){let{name:s}=r;if(t.has(s))return;t.add(s);let o=n.schemas.find(a=>a.name===s);if(o===void 0)return;r=o.schema}return r}function pe(e,n){return e.kind==="scalar"||e.kind==="enum"?e.scalar==="string":e.kind==="literal"?typeof e.value=="string":e.kind==="union"?e.members.every(t=>{let r=wn(t,n);return r!==void 0&&(r.kind==="null"||r.kind!=="union"&&pe(r,n))}):!1}var qt=["Generated by @redocly/client-generator \u2014 do not edit by hand.","Source: OpenAPI description. Re-run `redocly generate-client` to update."];function ue(e,n){let t=[],r=new Set,s=G(vn(n.outputPath)),{dir:o,name:a,ext:i}=Et(n.outputPath),d={path:n.outputPath,dir:o,stem:a,ext:i},l=qt,c=!1;for(let u of n.generators){let g=n.registry.get(u),p={model:e,output:d,banner:l,outputMode:n.outputMode,emit:n.emit,pagination:n.pagination,selected:n.generators,options:n.generatorOptions?.get(u)??{}},m;try{n.emit.docs===!0&&g.docs!==void 0?(m=[...g.run(p),...g.docs(p)],c=!0):m=g.run(p)}catch(f){let y=f instanceof Error?f.message:String(f);throw new Error(`Generator "${u}" failed: ${y}`)}if(!Array.isArray(m)||m.some(f=>typeof f?.path!="string"||f.path===""||typeof f.content!="string"))throw new Error(`Generator "${u}" failed: run() must return an array of { path, content } files.`);for(let f of m){let y=G(s,f.path);if(y!==s&&!y.startsWith(s+Tt))throw new Error(`Generator "${u}" failed: file path escapes the output directory: ${f.path}`);if(r.has(y))throw new Error(`Generator conflict: ${f.path} already emitted by an earlier generator`);r.add(y),t.push({path:y,content:f.content})}}return n.emit.docs===!0&&!c&&w.warn(`generate-client: docs is on, but no selected generator writes documentation (${n.generators.join(", ")}).
|
|
21
21
|
`),t}function Pt(e){for(let n of e.services)for(let t of n.operations){let r=new Set,s=new Set;for(let o of[...t.pathParams,...t.queryParams,...t.headerParams,...t.cookieParams])r.has(o.name)&&s.add(o.name),r.add(o.name);s.size!==0&&w.warn(`generate-client: operation "${t.specName??t.name}" uses ${[...s].map(o=>`"${o}"`).join(", ")} in more than one parameter location. Every SDK sends both, and the SDKs whose methods take one argument per parameter give the later one a suffixed name \u2014 rename it in the description to choose the name yourself.
|
|
@@ -4,6 +4,6 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a as i}from"./
|
|
7
|
+
import{a as i}from"./JIYXF2LJ.js";import{V as p}from"./AYCCHB2H.js";function h(t,o){let n=t.services.flatMap(e=>e.operations),r=n.filter(e=>e.sse!==void 0);r.length>0&&p.warn(`generate-client: ${o} skipped ${r.length} server-sent-events operation(s) \u2014 iterate the sdk's exported async generators directly: ${r.map(e=>e.name).join(", ")}.
|
|
8
8
|
`);let s=new Set(t.schemas.map(e=>e.name)),a=n.filter(e=>e.sse===void 0&&l(e,s));return a.length>0&&p.warn(`generate-client: ${o} skipped ${a.length} operation(s) whose variables type name collides with a schema \u2014 rename the schema or the operation: ${a.map(e=>e.name).join(", ")}.
|
|
9
9
|
`),n.filter(e=>e.sse===void 0&&!l(e,s))}function l(t,o){let n=i(t);return n.hasInputs&&o.has(n.variablesTypeName)}function g(t){return t.method==="get"||t.method==="head"}function m(t){return i(t).hasInputs}function u(t){return i(t).variablesTypeName}function O(t,o,n){let r=[];return i(t).hasInputs?r.push(o):n&&r.push("{}"),n&&r.push("{ ...init, envelope: undefined }"),`${t.name}(${r.join(", ")})`}function x(t,o,n){let r=t.map(e=>e.name).sort(),s=t.filter(m).map(u).sort();return n&&s.push("RequestOptions"),`import { ${[...r,...s.map(e=>`type ${e}`)].join(", ")} } from ${JSON.stringify(o)};`}export{h as a,g as b,m as c,u as d,O as e,x as f};
|