@fern-api/csharp-dynamic-snippets 2.10.0 → 2.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DynamicSnippetsGenerator.cjs +1 -1
- package/cjs/DynamicSnippetsGenerator.cjs.map +1 -1
- package/cjs/DynamicSnippetsGenerator.d.cts +1 -1
- package/cjs/{DynamicSnippetsGeneratorContext-Dz9RlVgp.d.cts → DynamicSnippetsGeneratorContext-pehoeH_w.d.cts} +3 -0
- package/cjs/EndpointSnippetGenerator.d.cts +1 -1
- package/cjs/context/DynamicLiteralMapper.d.cts +1 -1
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs +1 -1
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +1 -1
- package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +1 -1
- package/cjs/context/DynamicTypeMapper.d.cts +1 -1
- package/cjs/context/FilePropertyMapper.d.cts +1 -1
- package/cjs/index.cjs +1 -1
- package/cjs/index.cjs.map +1 -1
- package/cjs/index.d.cts +1 -1
- package/esm/DynamicSnippetsGenerator.d.ts +1 -1
- package/esm/DynamicSnippetsGenerator.js +1 -1
- package/esm/{DynamicSnippetsGeneratorContext-Dz9RlVgp.d.ts → DynamicSnippetsGeneratorContext-pehoeH_w.d.ts} +3 -0
- package/esm/EndpointSnippetGenerator.d.ts +1 -1
- package/esm/EndpointSnippetGenerator.js +1 -1
- package/esm/{chunk-BHXOAZDW.js → chunk-3XDW3MPR.js} +2 -2
- package/esm/{chunk-RHB5YSP4.js → chunk-CEB5TOCF.js} +2 -2
- package/esm/{chunk-RHB5YSP4.js.map → chunk-CEB5TOCF.js.map} +1 -1
- package/esm/{chunk-54PJL32I.js → chunk-DBQMCX7L.js} +2 -2
- package/esm/{chunk-ONI3ZPJV.js → chunk-EC2FLIE6.js} +2 -2
- package/esm/{chunk-JXSLTUG5.js → chunk-EUEE2577.js} +2 -2
- package/esm/{chunk-3AKTWPYH.js → chunk-GEII674B.js} +2 -2
- package/esm/{chunk-4A2AR7IK.js → chunk-KFPJC632.js} +2 -2
- package/esm/{chunk-VBCDESX3.js → chunk-KIW23CQ5.js} +2 -2
- package/esm/context/DynamicLiteralMapper.d.ts +1 -1
- package/esm/context/DynamicLiteralMapper.js +1 -1
- package/esm/context/DynamicSnippetsGeneratorContext.d.ts +1 -1
- package/esm/context/DynamicSnippetsGeneratorContext.js +1 -1
- package/esm/context/DynamicTypeMapper.d.ts +1 -1
- package/esm/context/DynamicTypeMapper.js +1 -1
- package/esm/context/FilePropertyMapper.d.ts +1 -1
- package/esm/context/FilePropertyMapper.js +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/package.json +1 -1
- /package/esm/{chunk-BHXOAZDW.js.map → chunk-3XDW3MPR.js.map} +0 -0
- /package/esm/{chunk-54PJL32I.js.map → chunk-DBQMCX7L.js.map} +0 -0
- /package/esm/{chunk-ONI3ZPJV.js.map → chunk-EC2FLIE6.js.map} +0 -0
- /package/esm/{chunk-JXSLTUG5.js.map → chunk-EUEE2577.js.map} +0 -0
- /package/esm/{chunk-3AKTWPYH.js.map → chunk-GEII674B.js.map} +0 -0
- /package/esm/{chunk-4A2AR7IK.js.map → chunk-KFPJC632.js.map} +0 -0
- /package/esm/{chunk-VBCDESX3.js.map → chunk-KIW23CQ5.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as s,f as l,h as n,k as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as s,f as l,h as n,k as c}from"./chunk-CEB5TOCF.js";var p=class extends c{constructor({context:a}){super(a.generation);s(this,"context");this.context=a}getFilePropertyInfo({body:a,value:i}){var o;let t={fileFields:[],bodyPropertyFields:[]},r=(o=this.context.getRecord(i))!=null?o:{};for(let e of a.properties)switch(e.type){case"file":n.Record.missingKey(r,e.wireValue)&&(r[e.wireValue]="[bytes]"),t.fileFields.push({name:this.context.getPropertyName(e.name),value:this.getSingleFileProperty({property:e,record:r})});break;case"fileArray":n.Record.missingKey(r,e.wireValue)&&(r[e.wireValue]=["[bytes]"]),t.fileFields.push({name:this.context.getPropertyName(e.name),value:this.getArrayFileProperty({property:e,record:r})});break;case"bodyProperty":if(n.Record.missingKey(r,e.name.wireValue))switch(e.typeReference.type){case"optional":break;case"primitive":{switch(e.typeReference.value.toLowerCase()){case"integer":{r[e.name.wireValue]=123;break}case"string":{r[e.name.wireValue]="[string]";break}case"boolean":{r[e.name.wireValue]=!0;break}case"double":{r[e.name.wireValue]=123.456;break}case"float":{r[e.name.wireValue]=123.456;break}case"long":{r[e.name.wireValue]=123456789;break}case"uint":{r[e.name.wireValue]=123;break}case"uint64":{r[e.name.wireValue]=12345;break}case"date":{r[e.name.wireValue]=new Date(2021,1,1);break}case"datetime":{r[e.name.wireValue]=new Date(2021,1,1,12,0,0);break}case"uuid":{r[e.name.wireValue]="123e4567-e89b-12d3-a456-426614174000";break}case"base64":{r[e.name.wireValue]="SGVsbG8gd29ybGQh";break}case"biginteger":{r[e.name.wireValue]="12345678901234567890";break}}break}default:break}t.bodyPropertyFields.push({name:this.context.getPropertyName(e.name.name),value:this.getBodyProperty({property:e,record:r})});break;default:l(e)}return t}getSingleFileProperty({property:a,record:i}){let t=this.context.getSingleFileValue({property:a,record:i});return t==null?this.csharp.Literal.nop():this.context.getFileParameterForString(t)}getArrayFileProperty({property:a,record:i}){let t=this.context.getFileArrayValues({property:a,record:i});return t==null?this.csharp.Literal.nop():this.csharp.Literal.list({valueType:this.Types.FileParameter,values:t.map(r=>this.context.getFileParameterForString(r))})}getBodyProperty({property:a,record:i}){let t=i[a.name.wireValue];return t==null?this.csharp.Literal.nop():this.context.dynamicLiteralMapper.convert({typeReference:a.typeReference,value:t})}};export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DBQMCX7L.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as l,d as R,e as i}from"./chunk-VBCDESX3.js";import{a as b,b as v,e as w,f as m,h as A,i as F,k as E}from"./chunk-RHB5YSP4.js";var Te=typeof global=="object"&&global&&global.Object===Object&&global,k=Te;var Me=typeof self=="object"&&self&&self.Object===Object&&self,Ue=k||Me||Function("return this")(),T=Ue;var We=T.Symbol,d=We;var M=Object.prototype,je=M.hasOwnProperty,De=M.toString,h=d?d.toStringTag:void 0;function Ve(r){var s=je.call(r,h),e=r[h];try{r[h]=void 0;var t=!0}catch(o){}var a=De.call(r);return t&&(s?r[h]=e:delete r[h]),a}var U=Ve;var ze=Object.prototype,He=ze.toString;function Ge(r){return He.call(r)}var W=Ge;var Ze="[object Null]",Je="[object Undefined]",j=d?d.toStringTag:void 0;function Ke(r){return r==null?r===void 0?Je:Ze:j&&j in Object(r)?U(r):W(r)}var D=Ke;function _e(r){return r!=null&&typeof r=="object"}var V=_e;var $e="[object Symbol]";function Ye(r){return typeof r=="symbol"||V(r)&&D(r)==$e}var z=Ye;function Qe(r,s){for(var e=-1,t=r==null?0:r.length,a=Array(t);++e<t;)a[e]=s(r[e],e,r);return a}var H=Qe;var Xe=Array.isArray,G=Xe;var et=1/0,Z=d?d.prototype:void 0,J=Z?Z.toString:void 0;function K(r){if(typeof r=="string")return r;if(G(r))return H(r,K)+"";if(z(r))return J?J.call(r):"";var s=r+"";return s=="0"&&1/r==-et?"-0":s}var _=K;function tt(r){return r==null?"":_(r)}var p=tt;function rt(r,s,e){var t=-1,a=r.length;s<0&&(s=-s>a?0:a+s),e=e>a?a:e,e<0&&(e+=a),a=s>e?0:e-s>>>0,s>>>=0;for(var o=Array(a);++t<a;)o[t]=r[t+s];return o}var $=rt;function at(r,s,e){var t=r.length;return e=e===void 0?t:e,!s&&e>=t?r:$(r,s,e)}var Y=at;var ot="\\ud800-\\udfff",st="\\u0300-\\u036f",nt="\\ufe20-\\ufe2f",ft="\\u20d0-\\u20ff",ut=st+nt+ft,it="\\ufe0e\\ufe0f",dt="\\u200d",lt=RegExp("["+dt+ot+ut+it+"]");function pt(r){return lt.test(r)}var I=pt;function mt(r){return r.split("")}var Q=mt;var X="\\ud800-\\udfff",ct="\\u0300-\\u036f",xt="\\ufe20-\\ufe2f",ht="\\u20d0-\\u20ff",gt=ct+xt+ht,yt="\\ufe0e\\ufe0f",bt="["+X+"]",S="["+gt+"]",P="\\ud83c[\\udffb-\\udfff]",vt="(?:"+S+"|"+P+")",ee="[^"+X+"]",te="(?:\\ud83c[\\udde6-\\uddff]){2}",re="[\\ud800-\\udbff][\\udc00-\\udfff]",Rt="\\u200d",ae=vt+"?",oe="["+yt+"]?",At="(?:"+Rt+"(?:"+[ee,te,re].join("|")+")"+oe+ae+")*",It=oe+ae+At,Ct="(?:"+[ee+S+"?",S,te,re,bt].join("|")+")",Ft=RegExp(P+"(?="+P+")|"+Ct+It,"g");function St(r){return r.match(Ft)||[]}var se=St;function Pt(r){return I(r)?se(r):Q(r)}var ne=Pt;function Bt(r){return function(s){s=p(s);var e=I(s)?ne(s):void 0,t=e?e[0]:s.charAt(0),a=e?Y(e,1).join(""):s.slice(1);return t[r]()+a}}var fe=Bt;var Lt=fe("toUpperCase"),g=Lt;function Ot(r){return g(p(r).toLowerCase())}var ue=Ot;function Nt(r,s,e,t){var a=-1,o=r==null?0:r.length;for(t&&o&&(e=r[++a]);++a<o;)e=s(e,r[a],a,r);return e}var ie=Nt;function qt(r){return function(s){return r==null?void 0:r[s]}}var de=qt;var wt={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Et=de(wt),le=Et;var kt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tt="\\u0300-\\u036f",Mt="\\ufe20-\\ufe2f",Ut="\\u20d0-\\u20ff",Wt=Tt+Mt+Ut,jt="["+Wt+"]",Dt=RegExp(jt,"g");function Vt(r){return r=p(r),r&&r.replace(kt,le).replace(Dt,"")}var pe=Vt;var zt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Ht(r){return r.match(zt)||[]}var me=Ht;var Gt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Zt(r){return Gt.test(r)}var ce=Zt;var be="\\ud800-\\udfff",Jt="\\u0300-\\u036f",Kt="\\ufe20-\\ufe2f",_t="\\u20d0-\\u20ff",$t=Jt+Kt+_t,ve="\\u2700-\\u27bf",Re="a-z\\xdf-\\xf6\\xf8-\\xff",Yt="\\xac\\xb1\\xd7\\xf7",Qt="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Xt="\\u2000-\\u206f",er=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ae="A-Z\\xc0-\\xd6\\xd8-\\xde",tr="\\ufe0e\\ufe0f",Ie=Yt+Qt+Xt+er,Ce="['\u2019]",xe="["+Ie+"]",rr="["+$t+"]",Fe="\\d+",ar="["+ve+"]",Se="["+Re+"]",Pe="[^"+be+Ie+Fe+ve+Re+Ae+"]",or="\\ud83c[\\udffb-\\udfff]",sr="(?:"+rr+"|"+or+")",nr="[^"+be+"]",Be="(?:\\ud83c[\\udde6-\\uddff]){2}",Le="[\\ud800-\\udbff][\\udc00-\\udfff]",x="["+Ae+"]",fr="\\u200d",he="(?:"+Se+"|"+Pe+")",ur="(?:"+x+"|"+Pe+")",ge="(?:"+Ce+"(?:d|ll|m|re|s|t|ve))?",ye="(?:"+Ce+"(?:D|LL|M|RE|S|T|VE))?",Oe=sr+"?",Ne="["+tr+"]?",ir="(?:"+fr+"(?:"+[nr,Be,Le].join("|")+")"+Ne+Oe+")*",dr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",lr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",pr=Ne+Oe+ir,mr="(?:"+[ar,Be,Le].join("|")+")"+pr,cr=RegExp([x+"?"+Se+"+"+ge+"(?="+[xe,x,"$"].join("|")+")",ur+"+"+ye+"(?="+[xe,x+he,"$"].join("|")+")",x+"?"+he+"+"+ge,x+"+"+ye,lr,dr,Fe,mr].join("|"),"g");function xr(r){return r.match(cr)||[]}var qe=xr;function hr(r,s,e){return r=p(r),s=e?void 0:s,s===void 0?ce(r)?qe(r):me(r):r.match(s)||[]}var we=hr;var gr="['\u2019]",yr=RegExp(gr,"g");function br(r){return function(s){return ie(we(pe(s).replace(yr,"")),r,"")}}var Ee=br;var vr=Ee(function(r,s,e){return s=s.toLowerCase(),r+(e?ue(s):s)}),B=vr;var ke=class extends E{constructor({context:e}){super(e.generation);w(this,"context");this.context=e}async generateSnippet({endpoint:e,request:t,options:a}){return this.buildCodeBlock({endpoint:e,snippet:t,options:a}).toString({namespace:"Usage",generation:this.generation,allNamespaceSegments:new Set,allTypeClassReferences:new Map})}generateSnippetSync({endpoint:e,request:t,options:a}){return this.buildCodeBlock({endpoint:e,snippet:t,options:a}).toString({namespace:"Usage",generation:this.generation,allNamespaceSegments:new Set,allTypeClassReferences:new Map})}async generateSnippetAst({endpoint:e,request:t,options:a}){throw new Error("Unsupported")}buildCodeBlock({endpoint:e,snippet:t,options:a}){var f;if(e.examples&&!((f=e.examples)!=null&&f.find(u=>A.DynamicIR.EndpointExample(t)&&u.id===t.id)))throw new Error("Endpoint does not have an example that matches the snippet");let o=this.csharp.codeblock(u=>{u.writeNodeStatement(this.constructClient({endpoint:e,snippet:t})),u.newLine(),u.writeNodeStatement(this.callMethod({endpoint:e,snippet:t}))}),n=this.getStyle(a);switch(n){case R.Concise:return o;case R.Full:return this.buildFullCodeBlock({body:o,options:a});default:m(n)}}buildFullCodeBlock({body:e,options:t}){var n;let a=this.getConfig(t),o=this.csharp.class_({name:(n=a.fullStyleClassName)!=null?n:"Example",namespace:"Usage",access:F.Access.Public});return o.addNamespaceReference(this.Types.RootClient.namespace),o.addMethod({name:"Do",access:F.Access.Public,isAsync:!0,parameters:[],body:e}),o}constructClient({endpoint:e,snippet:t}){return this.csharp.codeblock(a=>{a.write("var client = "),a.writeNode(this.getRootClientConstructorInvocation(this.getConstructorArgs({endpoint:e,snippet:t})))})}callMethod({endpoint:e,snippet:t}){var n,f;let a=((n=e.response)==null?void 0:n.type)==="streaming"||((f=e.response)==null?void 0:f.type)==="streamParameter",o=this.csharp.invokeMethod({on:this.csharp.codeblock("client"),method:this.getMethod({endpoint:e}),arguments_:this.getMethodArgs({endpoint:e,snippet:t}),async:!0,configureAwait:!0,multiline:!0,isAsyncEnumerable:a});return a?this.csharp.codeblock(u=>{u.write("await foreach (var item in "),u.writeNode(o),u.writeLine(")"),u.pushScope(),u.writeLine("/* consume each item */"),u.popScope()}):o}getConstructorArgs({endpoint:e,snippet:t}){let a=[];e.auth!=null&&(t.auth!=null?a.push(...this.getConstructorAuthArgs({auth:e.auth,values:t.auth})):this.context.errors.add({severity:l.Warning,message:`Auth with ${e.auth.type} configuration is required for this endpoint`}));let o=[],n=this.getConstructorBaseUrlArgs({baseUrl:t.baseURL,environment:t.environment});n.length>0&&o.push(...n),this.context.errors.scope(i.Headers);let f=[];return this.context.ir.headers!=null&&t.headers!=null&&f.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:t.headers})),this.context.errors.unscope(),o.length===0?[...a,...f]:[...a,...f,{name:"clientOptions",assignment:this.csharp.instantiateClass({classReference:this.Types.ClientOptions,arguments_:o.map(u=>({name:u.name,assignment:u.assignment})),multiline:!0})}]}getConstructorBaseUrlArgs({baseUrl:e,environment:t}){let a=this.getBaseUrlArg({baseUrl:e,environment:t});return A.Literal.nop(a)?[]:[{name:this.getBaseUrlOptionName(),assignment:a}]}getBaseUrlArg({baseUrl:e,environment:t}){var a;if(e!=null&&t!=null)return this.context.errors.add({severity:l.Critical,message:"Cannot specify both baseUrl and environment options"}),this.csharp.Literal.nop();if(e!=null)return((a=this.context.ir.environments)==null?void 0:a.environments.type)==="multipleBaseUrls"?(this.context.errors.add({severity:l.Critical,message:"The C# SDK doesn't support a baseUrl when multiple URL environments are configured"}),this.csharp.Literal.nop()):this.csharp.Literal.string(e);if(t!=null){if(this.context.isSingleEnvironmentID(t)){let o=this.context.getEnvironmentTypeReferenceFromID(t);return o==null?(this.context.errors.add({severity:l.Warning,message:`Environment ${JSON.stringify(t)} was not found`}),this.csharp.Literal.nop()):this.csharp.Literal.reference(o)}if(this.context.isMultiEnvironmentValues(t))return this.context.validateMultiEnvironmentUrlValues(t)?this.csharp.Literal.reference(this.csharp.instantiateClass({classReference:this.Types.Environments,arguments_:Object.entries(t).map(([o,n])=>({name:g(B(o)),assignment:this.context.dynamicLiteralMapper.convert({typeReference:{type:"primitive",value:"STRING"},value:n})})),multiline:!0})):this.csharp.Literal.nop()}return this.csharp.Literal.nop()}getConstructorAuthArgs({auth:e,values:t}){if(t.type!==e.type)return this.addError(this.context.newAuthMismatchError({auth:e,values:t}).message),[];switch(e.type){case"basic":return t.type==="basic"?this.getConstructorBasicAuthArg({auth:e,values:t}):[];case"bearer":return t.type==="bearer"?this.getConstructorBearerAuthArgs({auth:e,values:t}):[];case"header":return t.type==="header"?this.getConstructorHeaderAuthArgs({auth:e,values:t}):[];case"oauth":return t.type==="oauth"?this.getConstructorOAuthArgs({auth:e,values:t}):[];case"inferred":return this.addWarning("The C# SDK Generator does not support Inferred auth scheme yet"),[];default:m(e)}}addError(e){this.context.errors.add({severity:l.Critical,message:e})}addWarning(e){this.context.errors.add({severity:l.Warning,message:e})}getConstructorBasicAuthArg({auth:e,values:t}){return[{name:this.context.getParameterName(e.username),assignment:this.csharp.Literal.string(t.username)},{name:this.context.getParameterName(e.password),assignment:this.csharp.Literal.string(t.password)}]}getConstructorBearerAuthArgs({auth:e,values:t}){return[{name:this.context.getParameterName(e.token),assignment:this.csharp.Literal.string(t.token)}]}getConstructorHeaderAuthArgs({auth:e,values:t}){return[{name:this.context.getParameterName(e.header.name.name),assignment:this.context.dynamicLiteralMapper.convert({typeReference:e.header.typeReference,value:t.value,fallbackToDefault:e.header.name.wireValue})}]}getConstructorOAuthArgs({auth:e,values:t}){return[{name:this.context.getParameterName(e.clientId),assignment:this.csharp.Literal.string(t.clientId)},{name:this.context.getParameterName(e.clientSecret),assignment:this.csharp.Literal.string(t.clientSecret)}]}getConstructorHeaderArgs({headers:e,values:t}){let a=[];for(let o of e){let n=this.getConstructorHeaderArg({header:o,value:t.value});n!=null&&a.push({name:this.context.getParameterName(o.name.name),assignment:n})}return a}getConstructorHeaderArg({header:e,value:t}){let a=this.context.dynamicLiteralMapper.convert({typeReference:e.typeReference,value:t,fallbackToDefault:e.name.wireValue});if(!A.Literal.nop(a))return a}getMethodArgs({endpoint:e,snippet:t}){switch(e.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:e.request,snippet:t});case"body":return this.getMethodArgsForBodyRequest({request:e.request,snippet:t});default:m(e.request)}}getMethodArgsForInlinedRequest({request:e,snippet:t}){var u,y;let a=[];this.context.errors.scope(i.PathParameters);let o=[],n=[...(u=this.context.ir.pathParameters)!=null?u:[],...(y=e.pathParameters)!=null?y:[]];n.length>0&&o.push(...this.getPathParameters({namedParameters:n,snippet:t})),this.context.errors.unscope(),this.context.errors.scope(i.RequestBody);let f=this.getFilePropertyInfo({request:e,snippet:t});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:this.settings.shouldInlinePathParameters})||a.push(...o.map(C=>C.value)),a.push(this.getInlinedRequestArg({request:e,snippet:t,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:this.settings.shouldInlinePathParameters})?o:[],filePropertyInfo:f})),a}getFilePropertyInfo({request:e,snippet:t}){return e.body==null||!this.context.isFileUploadRequestBody(e.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:e.body,value:t.requestBody})}getInlinedRequestArg({request:e,snippet:t,pathParameterFields:a,filePropertyInfo:o}){var L,O,N,q;this.context.errors.scope(i.QueryParameters);let f=this.context.associateQueryParametersByWireValue({parameters:(L=e.queryParameters)!=null?L:[],values:(O=t.queryParameters)!=null?O:{}}).map(c=>({name:this.context.getPropertyName(c.name.name),value:this.context.dynamicLiteralMapper.convert(c)}));this.context.errors.unscope(),this.context.errors.scope(i.Headers);let y=this.context.associateByWireValue({parameters:(N=e.headers)!=null?N:[],values:(q=t.headers)!=null?q:{}}).map(c=>({name:this.context.getPropertyName(c.name.name),value:this.context.dynamicLiteralMapper.convert(v(b({},c),{fallbackToDefault:c.name.wireValue}))}));this.context.errors.unscope(),this.context.errors.scope(i.RequestBody);let C=e.body!=null?this.getInlinedRequestBodyConstructorFields({body:e.body,value:t.requestBody,filePropertyInfo:o}):[];return this.context.errors.unscope(),this.csharp.Literal.class_({reference:this.csharp.classReference({origin:e.declaration,namespace:this.context.getNamespace(e.declaration.fernFilepath)}),fields:[...a,...f,...y,...C]})}getInlinedRequestBodyConstructorFields({body:e,value:t,filePropertyInfo:a}){switch(e.type){case"properties":return this.getInlinedRequestBodyPropertyConstructorFields({parameters:e.value,value:t});case"referenced":return[this.getReferencedRequestBodyPropertyConstructorField({body:e,value:t})];case"fileUpload":return this.getFileUploadRequestBodyConstructorFields({filePropertyInfo:a});default:m(e)}}getInlinedRequestBodyPropertyConstructorFields({parameters:e,value:t}){var n;let a=[],o=this.context.associateByWireValue({parameters:e,values:(n=this.context.getRecord(t))!=null?n:{}});for(let f of o)a.push({name:this.context.getPropertyName(f.name.name),value:this.context.dynamicLiteralMapper.convert(v(b({},f),{fallbackToDefault:f.name.wireValue}))});return a}getFileUploadRequestBodyConstructorFields({filePropertyInfo:e}){return[...e.fileFields,...e.bodyPropertyFields]}getReferencedRequestBodyPropertyConstructorField({body:e,value:t}){return{name:this.context.getPropertyName(e.bodyKey),value:this.getReferencedRequestBodyPropertyLiteral({body:e.bodyType,value:t})}}getReferencedRequestBodyPropertyLiteral({body:e,value:t}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:t});case"typeReference":return this.context.dynamicLiteralMapper.convert({typeReference:e.value,value:t,fallbackToDefault:JSON.stringify(e.value)});default:m(e)}}getMethodArgsForBodyRequest({request:e,snippet:t}){var n,f;let a=[];this.context.errors.scope(i.PathParameters);let o=[...(n=this.context.ir.pathParameters)!=null?n:[],...(f=e.pathParameters)!=null?f:[]];return o.length>0&&a.push(...this.getPathParameters({namedParameters:o,snippet:t}).map(u=>u.value)),this.context.errors.unscope(),this.context.errors.scope(i.RequestBody),e.body!=null&&a.push(this.getBodyRequestArg({body:e.body,value:t.requestBody})),this.context.errors.unscope(),a}getBodyRequestArg({body:e,value:t}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:t});case"typeReference":return e.value.type==="optional"&&t==null?this.csharp.Literal.null():this.context.dynamicLiteralMapper.convert({typeReference:e.value,value:t,fallbackToDefault:JSON.stringify(e.value)});default:m(e)}}getBytesBodyRequestArg({value:e}){let t=this.context.getValueAsString({value:e});return t==null&&(this.context.errors.add({severity:l.Critical,message:"The bytes request body must be provided in string format"}),t="[bytes]"),this.csharp.Literal.reference(this.context.getMemoryStreamForString(t))}getRootClientConstructorInvocation(e){return this.csharp.instantiateClass({classReference:this.Types.RootClient,arguments_:e,forceUseConstructor:!0,multiline:!0})}getPathParameters({namedParameters:e,snippet:t}){var n;let a=[],o=this.context.associateByWireValueOrDefault({parameters:e,values:(n=t.pathParameters)!=null?n:{}});for(let f of o)a.push({name:this.context.getPropertyName(f.name.name),value:this.context.dynamicLiteralMapper.convert(v(b({},f),{fallbackToDefault:f.name.wireValue}))});return a}getMethod({endpoint:e}){return e.declaration.fernFilepath.allParts.length>0?`${e.declaration.fernFilepath.allParts.map(t=>this.context.getClassName(t)).join(".")}.${this.context.getMethodName(e.declaration.name)}`:this.context.getMethodName(e.declaration.name)}getBaseUrlOptionName(){var e;return((e=this.context.ir.environments)==null?void 0:e.environments.type)==="multipleBaseUrls"?"Environment":"BaseUrl"}getStyle(e){var t,a;return(a=(t=e.style)!=null?t:this.context.options.style)!=null?a:R.Full}getConfig(e){var t,a;return(a=(t=e.config)!=null?t:this.context.options.config)!=null?a:{}}};export{ke as a};
|
|
1
|
+
import{b as l,d as R,e as i}from"./chunk-KIW23CQ5.js";import{a as b,b as v,e as w,f as m,h as A,i as F,k as E}from"./chunk-CEB5TOCF.js";var Te=typeof global=="object"&&global&&global.Object===Object&&global,k=Te;var Me=typeof self=="object"&&self&&self.Object===Object&&self,Ue=k||Me||Function("return this")(),T=Ue;var We=T.Symbol,d=We;var M=Object.prototype,je=M.hasOwnProperty,De=M.toString,h=d?d.toStringTag:void 0;function Ve(r){var s=je.call(r,h),e=r[h];try{r[h]=void 0;var t=!0}catch(o){}var a=De.call(r);return t&&(s?r[h]=e:delete r[h]),a}var U=Ve;var ze=Object.prototype,He=ze.toString;function Ge(r){return He.call(r)}var W=Ge;var Ze="[object Null]",Je="[object Undefined]",j=d?d.toStringTag:void 0;function Ke(r){return r==null?r===void 0?Je:Ze:j&&j in Object(r)?U(r):W(r)}var D=Ke;function _e(r){return r!=null&&typeof r=="object"}var V=_e;var $e="[object Symbol]";function Ye(r){return typeof r=="symbol"||V(r)&&D(r)==$e}var z=Ye;function Qe(r,s){for(var e=-1,t=r==null?0:r.length,a=Array(t);++e<t;)a[e]=s(r[e],e,r);return a}var H=Qe;var Xe=Array.isArray,G=Xe;var et=1/0,Z=d?d.prototype:void 0,J=Z?Z.toString:void 0;function K(r){if(typeof r=="string")return r;if(G(r))return H(r,K)+"";if(z(r))return J?J.call(r):"";var s=r+"";return s=="0"&&1/r==-et?"-0":s}var _=K;function tt(r){return r==null?"":_(r)}var p=tt;function rt(r,s,e){var t=-1,a=r.length;s<0&&(s=-s>a?0:a+s),e=e>a?a:e,e<0&&(e+=a),a=s>e?0:e-s>>>0,s>>>=0;for(var o=Array(a);++t<a;)o[t]=r[t+s];return o}var $=rt;function at(r,s,e){var t=r.length;return e=e===void 0?t:e,!s&&e>=t?r:$(r,s,e)}var Y=at;var ot="\\ud800-\\udfff",st="\\u0300-\\u036f",nt="\\ufe20-\\ufe2f",ft="\\u20d0-\\u20ff",ut=st+nt+ft,it="\\ufe0e\\ufe0f",dt="\\u200d",lt=RegExp("["+dt+ot+ut+it+"]");function pt(r){return lt.test(r)}var I=pt;function mt(r){return r.split("")}var Q=mt;var X="\\ud800-\\udfff",ct="\\u0300-\\u036f",xt="\\ufe20-\\ufe2f",ht="\\u20d0-\\u20ff",gt=ct+xt+ht,yt="\\ufe0e\\ufe0f",bt="["+X+"]",S="["+gt+"]",P="\\ud83c[\\udffb-\\udfff]",vt="(?:"+S+"|"+P+")",ee="[^"+X+"]",te="(?:\\ud83c[\\udde6-\\uddff]){2}",re="[\\ud800-\\udbff][\\udc00-\\udfff]",Rt="\\u200d",ae=vt+"?",oe="["+yt+"]?",At="(?:"+Rt+"(?:"+[ee,te,re].join("|")+")"+oe+ae+")*",It=oe+ae+At,Ct="(?:"+[ee+S+"?",S,te,re,bt].join("|")+")",Ft=RegExp(P+"(?="+P+")|"+Ct+It,"g");function St(r){return r.match(Ft)||[]}var se=St;function Pt(r){return I(r)?se(r):Q(r)}var ne=Pt;function Bt(r){return function(s){s=p(s);var e=I(s)?ne(s):void 0,t=e?e[0]:s.charAt(0),a=e?Y(e,1).join(""):s.slice(1);return t[r]()+a}}var fe=Bt;var Lt=fe("toUpperCase"),g=Lt;function Ot(r){return g(p(r).toLowerCase())}var ue=Ot;function Nt(r,s,e,t){var a=-1,o=r==null?0:r.length;for(t&&o&&(e=r[++a]);++a<o;)e=s(e,r[a],a,r);return e}var ie=Nt;function qt(r){return function(s){return r==null?void 0:r[s]}}var de=qt;var wt={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Et=de(wt),le=Et;var kt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tt="\\u0300-\\u036f",Mt="\\ufe20-\\ufe2f",Ut="\\u20d0-\\u20ff",Wt=Tt+Mt+Ut,jt="["+Wt+"]",Dt=RegExp(jt,"g");function Vt(r){return r=p(r),r&&r.replace(kt,le).replace(Dt,"")}var pe=Vt;var zt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Ht(r){return r.match(zt)||[]}var me=Ht;var Gt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Zt(r){return Gt.test(r)}var ce=Zt;var be="\\ud800-\\udfff",Jt="\\u0300-\\u036f",Kt="\\ufe20-\\ufe2f",_t="\\u20d0-\\u20ff",$t=Jt+Kt+_t,ve="\\u2700-\\u27bf",Re="a-z\\xdf-\\xf6\\xf8-\\xff",Yt="\\xac\\xb1\\xd7\\xf7",Qt="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Xt="\\u2000-\\u206f",er=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ae="A-Z\\xc0-\\xd6\\xd8-\\xde",tr="\\ufe0e\\ufe0f",Ie=Yt+Qt+Xt+er,Ce="['\u2019]",xe="["+Ie+"]",rr="["+$t+"]",Fe="\\d+",ar="["+ve+"]",Se="["+Re+"]",Pe="[^"+be+Ie+Fe+ve+Re+Ae+"]",or="\\ud83c[\\udffb-\\udfff]",sr="(?:"+rr+"|"+or+")",nr="[^"+be+"]",Be="(?:\\ud83c[\\udde6-\\uddff]){2}",Le="[\\ud800-\\udbff][\\udc00-\\udfff]",x="["+Ae+"]",fr="\\u200d",he="(?:"+Se+"|"+Pe+")",ur="(?:"+x+"|"+Pe+")",ge="(?:"+Ce+"(?:d|ll|m|re|s|t|ve))?",ye="(?:"+Ce+"(?:D|LL|M|RE|S|T|VE))?",Oe=sr+"?",Ne="["+tr+"]?",ir="(?:"+fr+"(?:"+[nr,Be,Le].join("|")+")"+Ne+Oe+")*",dr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",lr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",pr=Ne+Oe+ir,mr="(?:"+[ar,Be,Le].join("|")+")"+pr,cr=RegExp([x+"?"+Se+"+"+ge+"(?="+[xe,x,"$"].join("|")+")",ur+"+"+ye+"(?="+[xe,x+he,"$"].join("|")+")",x+"?"+he+"+"+ge,x+"+"+ye,lr,dr,Fe,mr].join("|"),"g");function xr(r){return r.match(cr)||[]}var qe=xr;function hr(r,s,e){return r=p(r),s=e?void 0:s,s===void 0?ce(r)?qe(r):me(r):r.match(s)||[]}var we=hr;var gr="['\u2019]",yr=RegExp(gr,"g");function br(r){return function(s){return ie(we(pe(s).replace(yr,"")),r,"")}}var Ee=br;var vr=Ee(function(r,s,e){return s=s.toLowerCase(),r+(e?ue(s):s)}),B=vr;var ke=class extends E{constructor({context:e}){super(e.generation);w(this,"context");this.context=e}async generateSnippet({endpoint:e,request:t,options:a}){return this.buildCodeBlock({endpoint:e,snippet:t,options:a}).toString({namespace:"Usage",generation:this.generation,allNamespaceSegments:new Set,allTypeClassReferences:new Map})}generateSnippetSync({endpoint:e,request:t,options:a}){return this.buildCodeBlock({endpoint:e,snippet:t,options:a}).toString({namespace:"Usage",generation:this.generation,allNamespaceSegments:new Set,allTypeClassReferences:new Map})}async generateSnippetAst({endpoint:e,request:t,options:a}){throw new Error("Unsupported")}buildCodeBlock({endpoint:e,snippet:t,options:a}){var f;if(e.examples&&!((f=e.examples)!=null&&f.find(u=>A.DynamicIR.EndpointExample(t)&&u.id===t.id)))throw new Error("Endpoint does not have an example that matches the snippet");let o=this.csharp.codeblock(u=>{u.writeNodeStatement(this.constructClient({endpoint:e,snippet:t})),u.newLine(),u.writeNodeStatement(this.callMethod({endpoint:e,snippet:t}))}),n=this.getStyle(a);switch(n){case R.Concise:return o;case R.Full:return this.buildFullCodeBlock({body:o,options:a});default:m(n)}}buildFullCodeBlock({body:e,options:t}){var n;let a=this.getConfig(t),o=this.csharp.class_({name:(n=a.fullStyleClassName)!=null?n:"Example",namespace:"Usage",access:F.Access.Public});return o.addNamespaceReference(this.Types.RootClient.namespace),o.addMethod({name:"Do",access:F.Access.Public,isAsync:!0,parameters:[],body:e}),o}constructClient({endpoint:e,snippet:t}){return this.csharp.codeblock(a=>{a.write("var client = "),a.writeNode(this.getRootClientConstructorInvocation(this.getConstructorArgs({endpoint:e,snippet:t})))})}callMethod({endpoint:e,snippet:t}){var n,f;let a=((n=e.response)==null?void 0:n.type)==="streaming"||((f=e.response)==null?void 0:f.type)==="streamParameter",o=this.csharp.invokeMethod({on:this.csharp.codeblock("client"),method:this.getMethod({endpoint:e}),arguments_:this.getMethodArgs({endpoint:e,snippet:t}),async:!0,configureAwait:!0,multiline:!0,isAsyncEnumerable:a});return a?this.csharp.codeblock(u=>{u.write("await foreach (var item in "),u.writeNode(o),u.writeLine(")"),u.pushScope(),u.writeLine("/* consume each item */"),u.popScope()}):o}getConstructorArgs({endpoint:e,snippet:t}){let a=[];e.auth!=null&&(t.auth!=null?a.push(...this.getConstructorAuthArgs({auth:e.auth,values:t.auth})):this.context.errors.add({severity:l.Warning,message:`Auth with ${e.auth.type} configuration is required for this endpoint`}));let o=[],n=this.getConstructorBaseUrlArgs({baseUrl:t.baseURL,environment:t.environment});n.length>0&&o.push(...n),this.context.errors.scope(i.Headers);let f=[];return this.context.ir.headers!=null&&t.headers!=null&&f.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:t.headers})),this.context.errors.unscope(),o.length===0?[...a,...f]:[...a,...f,{name:"clientOptions",assignment:this.csharp.instantiateClass({classReference:this.Types.ClientOptions,arguments_:o.map(u=>({name:u.name,assignment:u.assignment})),multiline:!0})}]}getConstructorBaseUrlArgs({baseUrl:e,environment:t}){let a=this.getBaseUrlArg({baseUrl:e,environment:t});return A.Literal.nop(a)?[]:[{name:this.getBaseUrlOptionName(),assignment:a}]}getBaseUrlArg({baseUrl:e,environment:t}){var a;if(e!=null&&t!=null)return this.context.errors.add({severity:l.Critical,message:"Cannot specify both baseUrl and environment options"}),this.csharp.Literal.nop();if(e!=null)return((a=this.context.ir.environments)==null?void 0:a.environments.type)==="multipleBaseUrls"?(this.context.errors.add({severity:l.Critical,message:"The C# SDK doesn't support a baseUrl when multiple URL environments are configured"}),this.csharp.Literal.nop()):this.csharp.Literal.string(e);if(t!=null){if(this.context.isSingleEnvironmentID(t)){let o=this.context.getEnvironmentTypeReferenceFromID(t);return o==null?(this.context.errors.add({severity:l.Warning,message:`Environment ${JSON.stringify(t)} was not found`}),this.csharp.Literal.nop()):this.csharp.Literal.reference(o)}if(this.context.isMultiEnvironmentValues(t))return this.context.validateMultiEnvironmentUrlValues(t)?this.csharp.Literal.reference(this.csharp.instantiateClass({classReference:this.Types.Environments,arguments_:Object.entries(t).map(([o,n])=>({name:g(B(o)),assignment:this.context.dynamicLiteralMapper.convert({typeReference:{type:"primitive",value:"STRING"},value:n})})),multiline:!0})):this.csharp.Literal.nop()}return this.csharp.Literal.nop()}getConstructorAuthArgs({auth:e,values:t}){if(t.type!==e.type)return this.addError(this.context.newAuthMismatchError({auth:e,values:t}).message),[];switch(e.type){case"basic":return t.type==="basic"?this.getConstructorBasicAuthArg({auth:e,values:t}):[];case"bearer":return t.type==="bearer"?this.getConstructorBearerAuthArgs({auth:e,values:t}):[];case"header":return t.type==="header"?this.getConstructorHeaderAuthArgs({auth:e,values:t}):[];case"oauth":return t.type==="oauth"?this.getConstructorOAuthArgs({auth:e,values:t}):[];case"inferred":return this.addWarning("The C# SDK Generator does not support Inferred auth scheme yet"),[];default:m(e)}}addError(e){this.context.errors.add({severity:l.Critical,message:e})}addWarning(e){this.context.errors.add({severity:l.Warning,message:e})}getConstructorBasicAuthArg({auth:e,values:t}){return[{name:this.context.getParameterName(e.username),assignment:this.csharp.Literal.string(t.username)},{name:this.context.getParameterName(e.password),assignment:this.csharp.Literal.string(t.password)}]}getConstructorBearerAuthArgs({auth:e,values:t}){return[{name:this.context.getParameterName(e.token),assignment:this.csharp.Literal.string(t.token)}]}getConstructorHeaderAuthArgs({auth:e,values:t}){return[{name:this.context.getParameterName(e.header.name.name),assignment:this.context.dynamicLiteralMapper.convert({typeReference:e.header.typeReference,value:t.value,fallbackToDefault:e.header.name.wireValue})}]}getConstructorOAuthArgs({auth:e,values:t}){return[{name:this.context.getParameterName(e.clientId),assignment:this.csharp.Literal.string(t.clientId)},{name:this.context.getParameterName(e.clientSecret),assignment:this.csharp.Literal.string(t.clientSecret)}]}getConstructorHeaderArgs({headers:e,values:t}){let a=[];for(let o of e){let n=this.getConstructorHeaderArg({header:o,value:t.value});n!=null&&a.push({name:this.context.getParameterName(o.name.name),assignment:n})}return a}getConstructorHeaderArg({header:e,value:t}){let a=this.context.dynamicLiteralMapper.convert({typeReference:e.typeReference,value:t,fallbackToDefault:e.name.wireValue});if(!A.Literal.nop(a))return a}getMethodArgs({endpoint:e,snippet:t}){switch(e.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:e.request,snippet:t});case"body":return this.getMethodArgsForBodyRequest({request:e.request,snippet:t});default:m(e.request)}}getMethodArgsForInlinedRequest({request:e,snippet:t}){var u,y;let a=[];this.context.errors.scope(i.PathParameters);let o=[],n=[...(u=this.context.ir.pathParameters)!=null?u:[],...(y=e.pathParameters)!=null?y:[]];n.length>0&&o.push(...this.getPathParameters({namedParameters:n,snippet:t})),this.context.errors.unscope(),this.context.errors.scope(i.RequestBody);let f=this.getFilePropertyInfo({request:e,snippet:t});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:this.settings.shouldInlinePathParameters})||a.push(...o.map(C=>C.value)),a.push(this.getInlinedRequestArg({request:e,snippet:t,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:this.settings.shouldInlinePathParameters})?o:[],filePropertyInfo:f})),a}getFilePropertyInfo({request:e,snippet:t}){return e.body==null||!this.context.isFileUploadRequestBody(e.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:e.body,value:t.requestBody})}getInlinedRequestArg({request:e,snippet:t,pathParameterFields:a,filePropertyInfo:o}){var L,O,N,q;this.context.errors.scope(i.QueryParameters);let f=this.context.associateQueryParametersByWireValue({parameters:(L=e.queryParameters)!=null?L:[],values:(O=t.queryParameters)!=null?O:{}}).map(c=>({name:this.context.getPropertyName(c.name.name),value:this.context.dynamicLiteralMapper.convert(c)}));this.context.errors.unscope(),this.context.errors.scope(i.Headers);let y=this.context.associateByWireValue({parameters:(N=e.headers)!=null?N:[],values:(q=t.headers)!=null?q:{}}).map(c=>({name:this.context.getPropertyName(c.name.name),value:this.context.dynamicLiteralMapper.convert(v(b({},c),{fallbackToDefault:c.name.wireValue}))}));this.context.errors.unscope(),this.context.errors.scope(i.RequestBody);let C=e.body!=null?this.getInlinedRequestBodyConstructorFields({body:e.body,value:t.requestBody,filePropertyInfo:o}):[];return this.context.errors.unscope(),this.csharp.Literal.class_({reference:this.csharp.classReference({origin:e.declaration,namespace:this.context.getNamespace(e.declaration.fernFilepath)}),fields:[...a,...f,...y,...C]})}getInlinedRequestBodyConstructorFields({body:e,value:t,filePropertyInfo:a}){switch(e.type){case"properties":return this.getInlinedRequestBodyPropertyConstructorFields({parameters:e.value,value:t});case"referenced":return[this.getReferencedRequestBodyPropertyConstructorField({body:e,value:t})];case"fileUpload":return this.getFileUploadRequestBodyConstructorFields({filePropertyInfo:a});default:m(e)}}getInlinedRequestBodyPropertyConstructorFields({parameters:e,value:t}){var n;let a=[],o=this.context.associateByWireValue({parameters:e,values:(n=this.context.getRecord(t))!=null?n:{}});for(let f of o)a.push({name:this.context.getPropertyName(f.name.name),value:this.context.dynamicLiteralMapper.convert(v(b({},f),{fallbackToDefault:f.name.wireValue}))});return a}getFileUploadRequestBodyConstructorFields({filePropertyInfo:e}){return[...e.fileFields,...e.bodyPropertyFields]}getReferencedRequestBodyPropertyConstructorField({body:e,value:t}){return{name:this.context.getPropertyName(e.bodyKey),value:this.getReferencedRequestBodyPropertyLiteral({body:e.bodyType,value:t})}}getReferencedRequestBodyPropertyLiteral({body:e,value:t}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:t});case"typeReference":return this.context.dynamicLiteralMapper.convert({typeReference:e.value,value:t,fallbackToDefault:JSON.stringify(e.value)});default:m(e)}}getMethodArgsForBodyRequest({request:e,snippet:t}){var n,f;let a=[];this.context.errors.scope(i.PathParameters);let o=[...(n=this.context.ir.pathParameters)!=null?n:[],...(f=e.pathParameters)!=null?f:[]];return o.length>0&&a.push(...this.getPathParameters({namedParameters:o,snippet:t}).map(u=>u.value)),this.context.errors.unscope(),this.context.errors.scope(i.RequestBody),e.body!=null&&a.push(this.getBodyRequestArg({body:e.body,value:t.requestBody})),this.context.errors.unscope(),a}getBodyRequestArg({body:e,value:t}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:t});case"typeReference":return e.value.type==="optional"&&t==null?this.csharp.Literal.null():this.context.dynamicLiteralMapper.convert({typeReference:e.value,value:t,fallbackToDefault:JSON.stringify(e.value)});default:m(e)}}getBytesBodyRequestArg({value:e}){let t=this.context.getValueAsString({value:e});return t==null&&(this.context.errors.add({severity:l.Critical,message:"The bytes request body must be provided in string format"}),t="[bytes]"),this.csharp.Literal.reference(this.context.getMemoryStreamForString(t))}getRootClientConstructorInvocation(e){return this.csharp.instantiateClass({classReference:this.Types.RootClient,arguments_:e,forceUseConstructor:!0,multiline:!0})}getPathParameters({namedParameters:e,snippet:t}){var n;let a=[],o=this.context.associateByWireValueOrDefault({parameters:e,values:(n=t.pathParameters)!=null?n:{}});for(let f of o)a.push({name:this.context.getPropertyName(f.name.name),value:this.context.dynamicLiteralMapper.convert(v(b({},f),{fallbackToDefault:f.name.wireValue}))});return a}getMethod({endpoint:e}){return e.declaration.fernFilepath.allParts.length>0?`${e.declaration.fernFilepath.allParts.map(t=>this.context.getClassName(t)).join(".")}.${this.context.getMethodName(e.declaration.name)}`:this.context.getMethodName(e.declaration.name)}getBaseUrlOptionName(){var e;return((e=this.context.ir.environments)==null?void 0:e.environments.type)==="multipleBaseUrls"?"Environment":"BaseUrl"}getStyle(e){var t,a;return(a=(t=e.style)!=null?t:this.context.options.style)!=null?a:R.Full}getConfig(e){var t,a;return(a=(t=e.config)!=null?t:this.context.options.config)!=null?a:{}}};export{ke as a};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
lodash-es/lodash.js:
|
|
@@ -12,4 +12,4 @@ lodash-es/lodash.js:
|
|
|
12
12
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
13
13
|
*)
|
|
14
14
|
*/
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-EC2FLIE6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as i,f as r,k as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as i,f as r,k as n}from"./chunk-CEB5TOCF.js";var s=class extends n{constructor({context:e}){super(e.generation);i(this,"context");this.context=e}convert(e){switch(e.typeReference.type){case"list":return this.Collection.list(this.convert({typeReference:e.typeReference,unboxOptionals:!0}));case"literal":return this.convertLiteral({literal:e.typeReference.value});case"map":return this.Collection.map(this.convert({typeReference:e.typeReference.key}),this.convert({typeReference:e.typeReference.value}));case"named":{let t=this.context.resolveNamedType({typeId:e.typeReference.value});return t==null?this.convertUnknown():this.convertNamed({named:t})}case"optional":case"nullable":{let t=this.convert({typeReference:e.typeReference.value});return e.unboxOptionals?t.asNonOptional():t.asOptional()}case"primitive":return this.convertPrimitive({primitive:e.typeReference.value});case"set":return this.Collection.set(this.convert({typeReference:e.typeReference,unboxOptionals:!0}));case"unknown":return this.convertUnknown();default:r(e.typeReference)}}convertToClassReference(e){return this.csharp.classReference({origin:e.declaration,namespace:this.context.getNamespace(e.declaration.fernFilepath)})}convertNamed({named:e}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference});case"enum":case"object":return this.csharp.classReference({origin:e.declaration,namespace:this.context.getNamespace(e.declaration.fernFilepath)});case"discriminatedUnion":return this.settings.shouldGeneratedDiscriminatedUnions?this.csharp.classReference({origin:e.declaration,namespace:this.context.getNamespace(e.declaration.fernFilepath)}):this.Primitive.object;case"undiscriminatedUnion":return this.OneOf.OneOf(e.types.map(t=>this.convert({typeReference:t})));default:r(e)}}convertLiteral({literal:e}){switch(e.type){case"boolean":return this.Primitive.boolean;case"string":return this.Primitive.string}}convertUnknown(){return this.Primitive.object}convertPrimitive({primitive:e}){switch(e){case"INTEGER":return this.Primitive.integer;case"UINT":return this.Primitive.uint;case"LONG":return this.Primitive.long;case"UINT_64":return this.Primitive.ulong;case"FLOAT":return this.Primitive.float;case"DOUBLE":return this.Primitive.double;case"BOOLEAN":return this.Primitive.boolean;case"STRING":return this.Primitive.string;case"DATE":return this.Value.dateOnly;case"DATE_TIME":return this.Value.dateTime;case"UUID":return this.Primitive.string;case"BASE_64":return this.Primitive.string;case"BIG_INTEGER":return this.Primitive.string;default:r(e)}}};export{s as a};
|
|
2
|
+
//# sourceMappingURL=chunk-EUEE2577.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as c}from"./chunk-3XDW3MPR.js";import{c as a}from"./chunk-KIW23CQ5.js";import{a as p}from"./chunk-EUEE2577.js";import{a as m}from"./chunk-DBQMCX7L.js";import{e as r,j as o}from"./chunk-CEB5TOCF.js";var l=class g extends a{constructor({ir:e,config:t,options:n,generation:i}){super({ir:e,config:t,options:n});r(this,"ir");r(this,"dynamicTypeMapper");r(this,"dynamicLiteralMapper");r(this,"filePropertyMapper");r(this,"generation");this.ir=e,this.generation=i!=null?i:new o(e,t.workspaceName,t.customConfig!=null?t.customConfig:{},t),this.dynamicTypeMapper=new p({context:this}),this.dynamicLiteralMapper=new c({context:this}),this.filePropertyMapper=new m({context:this})}get namespaces(){return this.generation.namespaces}get registry(){return this.generation.registry}get settings(){return this.generation.settings}get constants(){return this.generation.constants}get names(){return this.generation.names}get model(){return this.generation.model}get format(){return this.generation.format}get csharp(){return this.generation.csharp}get Types(){return this.generation.Types}get System(){return this.generation.extern.System}get NUnit(){return this.generation.extern.NUnit}get OneOf(){return this.generation.extern.OneOf}get Google(){return this.generation.extern.Google}get WireMock(){return this.generation.extern.WireMock}get Primitive(){return this.generation.Primitive}get Value(){return this.generation.Value}get Collection(){return this.generation.Collection}clone(){return new g({ir:this.ir,config:this.config,options:this.options,generation:this.generation})}getFileParameterForString(e){return this.csharp.Literal.reference(this.csharp.instantiateClass({classReference:this.Types.FileParameter,arguments_:[],properties:[{name:"Stream",value:this.getMemoryStreamForString(e)}],multiline:!0}))}getMemoryStreamForString(e){return this.System.IO.MemoryStream.new({arguments_:[this.csharp.invokeMethod({on:this.System.Text.Encoding_UTF8,method:"GetBytes",arguments_:[this.csharp.Literal.string(e)]})]})}getClassName(e){return e.pascalCase.safeName}getParameterName(e){return e.camelCase.safeName}getPropertyName(e){return e.pascalCase.safeName}getMethodName(e){return`${e.pascalCase.safeName}Async`}getNamespace(e,t){let n=this.getNamespaceSegments(e);return n=t!=null?[...n,t]:n,[this.namespaces.root,...n].join(".")}getEnvironmentTypeReferenceFromID(e){let t=this.resolveEnvironmentName(e);if(t!=null)return this.getEnvironmentClassReferenceForEnumName(t)}getEnvironmentClassReferenceForEnumName(e){return this.csharp.classReference({name:`${this.generation.Types.Environments.name}.${this.getClassName(e)}`,namespace:this.namespaces.root})}getNamespaceSegments(e){return(this.settings.explicitNamespaces?e.allParts:e.packagePath).map(n=>n.pascalCase.safeName)}precalculate(e){this.generation.initialize(),this.System.Collections.Generic.KeyValuePair(),this.System.Collections.Generic.IEnumerable(),this.System.Collections.Generic.IAsyncEnumerable(),this.System.Collections.Generic.HashSet(),this.System.Collections.Generic.List(),this.System.Collections.Generic.Dictionary(),this.System.Threading.Tasks.Task(),Object.entries(this.ir.types).sort((t,n)=>t[0].length-n[0].length).forEach(([t,n])=>{this.dynamicTypeMapper.convertToClassReference(n)});for(let[t,n]of e.entries())if(this.csharp.classReference({origin:this.model.staticExplicit(`Example${t}`),namespace:"Usage"}),n.endpoint){let i=this.resolveEndpointLocation(n.endpoint);for(let s of i)switch(s.request.type){case"inlined":this.csharp.classReference({origin:s.request.declaration.name,namespace:this.getNamespace(s.request.declaration.fernFilepath)});break;case"body":break}}this.generation.Types.ClientOptions,this.generation.Types.RootClient,this.csharp.freezeClassReferences()}};export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-GEII674B.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as p}from"./chunk-EC2FLIE6.js";import{a as r}from"./chunk-GEII674B.js";import{a as t}from"./chunk-KIW23CQ5.js";var i=class extends t{constructor({ir:e,config:n,options:o={}}){super(new r({ir:e,config:n,options:o}))}precalculate(e){this.context.precalculate(e)}async generate(e,n={}){return super.generate(e,n)}generateSync(e,n={}){return super.generateSync(e,n)}async generateSnippetAst(e){return super.generateSnippetAst(e)}createSnippetGenerator(e){return new p({context:e})}};export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KFPJC632.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as E,b as w,c as x,d as T,e as p,f as d,g as m}from"./chunk-RHB5YSP4.js";var c=class{constructor(){p(this,"reporter");p(this,"snippet");p(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:e,snippet:r}){this.shouldUpdate({snippet:r,reporter:e.errors})&&(this.reporter=e.errors.clone(),this.snippet=r)}getResponseOrThrow({endpoint:e}){var r;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(r=this.err)!=null?r:new Error(`Failed to generate snippet for endpoint "${e.method} ${e.path}"`)}shouldUpdate({snippet:e,reporter:r}){var t,n;return this.reporter==null||this.reporter.size()>0&&r.size()===0?!0:e.length>((n=(t=this.snippet)==null?void 0:t.length)!=null?n:0)}};var y=class{constructor(e){p(this,"context");this.context=e}async generate(e,r={}){let t=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(t.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let n=new c;for(let i of t){let s=this.context.clone(),l=this.createSnippetGenerator(s);try{let a=await l.generateSnippet({endpoint:i,request:e,options:r});if(s.errors.empty())return{snippet:a,errors:void 0};n.update({context:s,snippet:a})}catch(a){n.err==null&&(n.err=a)}}return n.getResponseOrThrow({endpoint:e.endpoint})}async generateSnippetAst(e,r={}){let t=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(t.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let n;for(let i of t){let s=this.context.clone(),l=this.createSnippetGenerator(s);try{return await l.generateSnippetAst({endpoint:i,request:e,options:r})}catch(a){n=a}}throw n!=null?n:new Error(`Failed to generate snippet AST for endpoint: ${e.endpoint.method} ${e.endpoint.path}`)}generateSync(e,r={}){let t=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(t.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let n=new c;for(let i of t){let s=this.context.clone(),l=this.createSnippetGenerator(s);try{let a=l.generateSnippetSync({endpoint:i,request:e,options:r});if(s.errors.empty())return{snippet:a,errors:void 0};n.update({context:s,snippet:a})}catch(a){n.err==null&&(n.err=a)}}return n.getResponseOrThrow({endpoint:e.endpoint})}};var o={Critical:"CRITICAL",Warning:"WARNING"},f=class u{constructor(){p(this,"errors");p(this,"path");this.errors=[],this.path=[]}add(e){this.errors.push(w(E({},e),{path:[...this.path]}))}scope(e){this.path.push(e)}unscope(){this.path.pop()}getBySeverity(e){return this.errors.filter(r=>r.severity===e)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let e=new u;return e.errors=[...this.errors],e.path=[...this.path],e}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(e=>({severity:e.severity,path:e.path!=null?this.pathToStringArray(e.path):void 0,message:e.message}))}pathToStringArray(e){let r=[];for(let t of e){if(typeof t=="string"){r.push(t);continue}r[r.length-1]+=`[${t.index}]`}return r}};var h=class{constructor(){p(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/)}validate(e){return this.REFERENCE_REGEX.test(e)?{type:"valid"}:{type:"invalid"}}tryParse(e){if(this.validate(e).type==="invalid")return;let t=e.match(this.REFERENCE_REGEX);if(!(t==null||t[1]==null||t[2]==null))return{method:t[1],path:t[2]}}};var g=class{constructor({ir:e,config:r,options:t={}}){p(this,"config");p(this,"options");p(this,"errors");p(this,"_ir");p(this,"httpEndpointReferenceParser");this._ir=e,this.config=r,this.options=t,this.errors=new f,this.httpEndpointReferenceParser=new h}associateQueryParametersByWireValue({parameters:e,values:r}){let t=[];for(let[n,i]of Object.entries(r)){this.errors.scope(n);try{let s=e.find(a=>a.name.wireValue===n);if(s==null)throw this.newParameterNotRecognizedError(n);let l=this.isListTypeReference(s.typeReference)&&!Array.isArray(i)?[i]:i;t.push({name:s.name,typeReference:s.typeReference,value:l})}finally{this.errors.unscope()}}return t}associateByWireValueOrDefault({parameters:e,values:r}){let t=[];for(let n of e){this.errors.scope(n.name.wireValue);try{let i=r[n.name.wireValue];if(i==null)if(n.typeReference.type==="primitive"&&n.typeReference.value==="STRING")i=`<${n.name.wireValue}>`;else{this.errors.add({severity:o.Critical,message:this.newParameterNotRecognizedError(n.name.wireValue).message});continue}t.push({name:n.name,typeReference:n.typeReference,value:i})}finally{this.errors.unscope()}}return t}associateByWireValue({parameters:e,values:r,ignoreMissingParameters:t}){let n=[];for(let[i,s]of Object.entries(r)){this.errors.scope(i);try{let l=e.find(a=>a.name.wireValue===i);if(l==null){if(t)continue;this.errors.add({severity:o.Critical,message:this.newParameterNotRecognizedError(i).message});continue}n.push({name:l.name,typeReference:l.typeReference,value:s})}finally{this.errors.unscope()}}return n}getExampleObjectProperties({parameters:e,snippetObject:r}){let t=typeof r=="object"&&r!==null&&!Array.isArray(r)?r:{},n=[];for(let i of e){let s=t[i.name.wireValue];s==null?i.typeReference.type==="nullable"&&n.push({name:i.name,typeReference:i.typeReference,value:null}):n.push({name:i.name,typeReference:i.typeReference,value:s})}return n}getSingleFileValue({property:e,record:r}){let t=r[e.wireValue];if(t!=null){if(typeof t!="string"){this.errors.add({severity:o.Critical,message:`Expected file value to be a string, got ${typeof t}`});return}return t}}getFileArrayValues({property:e,record:r}){let t=r[e.wireValue];if(t==null)return;if(!Array.isArray(t)){this.errors.add({severity:o.Critical,message:`Expected file array value to be an array of strings, got ${typeof t}`});return}let n=[];for(let i of t){if(typeof i!="string"){this.errors.add({severity:o.Critical,message:`Expected file array value to be an array of strings, got ${typeof i}`});return}n.push(i)}return n}getRecord(e){if(typeof e!="object"||Array.isArray(e)){this.errors.add({severity:o.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(e)?"array":typeof e}`});return}return e==null?{}:e}resolveNamedType({typeId:e}){let r=this._ir.types[e];if(r==null){this.errors.add({severity:o.Critical,message:`Type identified by "${e}" could not be found`});return}return r}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:r}){let t=this.getRecord(r);if(t==null)return;let n=e.discriminant.wireValue,i=t[n];if(i==null){this.errors.add({severity:o.Critical,message:this.newParameterNotRecognizedError(n).message});return}if(typeof i!="string"){this.errors.add({severity:o.Critical,message:`Expected discriminant value to be a string but got: ${typeof i}`});return}let s=e.types[i];if(s==null){this.errors.add({severity:o.Critical,message:`No type found for discriminant value "${i}"`});return}let R=t,{[n]:l}=R,a=T(R,[x(n)]);return{singleDiscriminatedUnionType:s,discriminantValue:s.discriminantValue,value:a}}resolveEndpointOrThrow(e){let r=this.httpEndpointReferenceParser.tryParse(e);if(r==null)throw new Error(`Failed to parse endpoint reference "${e}"`);return this.resolveEndpointLocationOrThrow(r)}resolveEndpointLocation(e){let r=[];for(let t of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:t,parsedEndpoint:e})&&r.push(t);return r}resolveEndpointLocationOrThrow(e){let r=this.resolveEndpointLocation(e);if(r.length===0)throw new Error(`Failed to find endpoint identified by "${e.method} ${e.path}"`);return r}needsRequestParameter({request:e,inlinePathParameters:r,inlineFileProperties:t}){var n;return this.includePathParametersInWrappedRequest({request:e,inlinePathParameters:r})||e.queryParameters!=null&&e.queryParameters.length>0||e.headers!=null&&e.headers.length>0?!0:e.body!=null?this.includeRequestBodyInWrappedRequest({body:e.body,inlineFileProperties:t}):!((n=e.metadata)!=null&&n.onlyPathParameters)}includePathParametersInWrappedRequest({request:e,inlinePathParameters:r}){var t,n;return r&&((n=(t=e.metadata)==null?void 0:t.includePathParameters)!=null?n:!1)}isFileUploadRequestBody(e){switch(e.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:d(e)}}resolveEnvironmentName(e){if(this._ir.environments==null)return;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":{let t=r.environments.find(n=>n.id===e);return t==null?void 0:t.name}case"multipleBaseUrls":{let t=r.environments.find(n=>n.id===e);return t==null?void 0:t.name}default:d(r)}}isSingleEnvironmentID(e){return typeof e=="string"}isMultiEnvironmentValues(e){return typeof e=="object"}validateMultiEnvironmentUrlValues(e){if(this._ir.environments==null)return this.errors.add({severity:o.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":return this.errors.add({severity:o.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let t=r.environments[0];if(t==null)return this.errors.add({severity:o.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let n=new Set(m(t.urls));for(let i of m(e))n.has(i)&&n.delete(i);return n.size>0?(this.errors.add({severity:o.Critical,message:`The provided environments are invalid; got: [${Object.keys(e).join(", ")}], expected: [${m(t.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:e}){if(typeof e!="number"){this.errors.add({severity:o.Critical,message:this.newTypeMismatchError({expected:"number",value:e}).message});return}return e}getValueAsBoolean({value:e}){if(typeof e!="boolean"){this.errors.add({severity:o.Critical,message:this.newTypeMismatchError({expected:"boolean",value:e}).message});return}return e}getValueAsString({value:e}){if(typeof e!="string"){this.errors.add({severity:o.Critical,message:this.newTypeMismatchError({expected:"string",value:e}).message});return}return e}isOptional(e){switch(e.type){case"nullable":return this.isOptional(e.value);case"optional":return!0;case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}isNullable(e){switch(e.type){case"nullable":return!0;case"optional":return this.isNullable(e.value);case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}newAuthMismatchError({auth:e,values:r}){return new Error(`Expected auth type ${e.type}, got ${r.type}`)}newParameterNotRecognizedError(e){return new Error(`"${e}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:e,value:r}){return new Error(`Expected ${e}, got ${typeof r}`)}includeRequestBodyInWrappedRequest({body:e,inlineFileProperties:r}){switch(e.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r});default:d(e)}}includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r}){return this.fileUploadHasBodyProperties({fileUpload:e})||r&&this.fileUploadHasFileProperties({fileUpload:e})}fileUploadHasBodyProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:d(r)}})}fileUploadHasFileProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:d(r)}})}isListTypeReference(e){return e.type==="optional"?this.isListTypeReference(e.value):e.type==="list"||e.type==="set"}parsedEndpointMatches({endpoint:e,parsedEndpoint:r}){return e.location.method===r.method&&e.location.path===r.path}};var v;(function(u){u.Concise="concise",u.Full="full"})(v||(v={}));var P={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};export{y as a,o as b,g as c,v as d,P as e};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as E,b as w,c as x,d as T,e as p,f as d,g as m}from"./chunk-CEB5TOCF.js";var c=class{constructor(){p(this,"reporter");p(this,"snippet");p(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:e,snippet:r}){this.shouldUpdate({snippet:r,reporter:e.errors})&&(this.reporter=e.errors.clone(),this.snippet=r)}getResponseOrThrow({endpoint:e}){var r;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(r=this.err)!=null?r:new Error(`Failed to generate snippet for endpoint "${e.method} ${e.path}"`)}shouldUpdate({snippet:e,reporter:r}){var t,n;return this.reporter==null||this.reporter.size()>0&&r.size()===0?!0:e.length>((n=(t=this.snippet)==null?void 0:t.length)!=null?n:0)}};var y=class{constructor(e){p(this,"context");this.context=e}async generate(e,r={}){let t=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(t.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let n=new c;for(let i of t){let s=this.context.clone(),l=this.createSnippetGenerator(s);try{let a=await l.generateSnippet({endpoint:i,request:e,options:r});if(s.errors.empty())return{snippet:a,errors:void 0};n.update({context:s,snippet:a})}catch(a){n.err==null&&(n.err=a)}}return n.getResponseOrThrow({endpoint:e.endpoint})}async generateSnippetAst(e,r={}){let t=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(t.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let n;for(let i of t){let s=this.context.clone(),l=this.createSnippetGenerator(s);try{return await l.generateSnippetAst({endpoint:i,request:e,options:r})}catch(a){n=a}}throw n!=null?n:new Error(`Failed to generate snippet AST for endpoint: ${e.endpoint.method} ${e.endpoint.path}`)}generateSync(e,r={}){let t=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(t.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let n=new c;for(let i of t){let s=this.context.clone(),l=this.createSnippetGenerator(s);try{let a=l.generateSnippetSync({endpoint:i,request:e,options:r});if(s.errors.empty())return{snippet:a,errors:void 0};n.update({context:s,snippet:a})}catch(a){n.err==null&&(n.err=a)}}return n.getResponseOrThrow({endpoint:e.endpoint})}};var o={Critical:"CRITICAL",Warning:"WARNING"},f=class u{constructor(){p(this,"errors");p(this,"path");this.errors=[],this.path=[]}add(e){this.errors.push(w(E({},e),{path:[...this.path]}))}scope(e){this.path.push(e)}unscope(){this.path.pop()}getBySeverity(e){return this.errors.filter(r=>r.severity===e)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let e=new u;return e.errors=[...this.errors],e.path=[...this.path],e}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(e=>({severity:e.severity,path:e.path!=null?this.pathToStringArray(e.path):void 0,message:e.message}))}pathToStringArray(e){let r=[];for(let t of e){if(typeof t=="string"){r.push(t);continue}r[r.length-1]+=`[${t.index}]`}return r}};var h=class{constructor(){p(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/)}validate(e){return this.REFERENCE_REGEX.test(e)?{type:"valid"}:{type:"invalid"}}tryParse(e){if(this.validate(e).type==="invalid")return;let t=e.match(this.REFERENCE_REGEX);if(!(t==null||t[1]==null||t[2]==null))return{method:t[1],path:t[2]}}};var g=class{constructor({ir:e,config:r,options:t={}}){p(this,"config");p(this,"options");p(this,"errors");p(this,"_ir");p(this,"httpEndpointReferenceParser");this._ir=e,this.config=r,this.options=t,this.errors=new f,this.httpEndpointReferenceParser=new h}associateQueryParametersByWireValue({parameters:e,values:r}){let t=[];for(let[n,i]of Object.entries(r)){this.errors.scope(n);try{let s=e.find(a=>a.name.wireValue===n);if(s==null)throw this.newParameterNotRecognizedError(n);let l=this.isListTypeReference(s.typeReference)&&!Array.isArray(i)?[i]:i;t.push({name:s.name,typeReference:s.typeReference,value:l})}finally{this.errors.unscope()}}return t}associateByWireValueOrDefault({parameters:e,values:r}){let t=[];for(let n of e){this.errors.scope(n.name.wireValue);try{let i=r[n.name.wireValue];if(i==null)if(n.typeReference.type==="primitive"&&n.typeReference.value==="STRING")i=`<${n.name.wireValue}>`;else{this.errors.add({severity:o.Critical,message:this.newParameterNotRecognizedError(n.name.wireValue).message});continue}t.push({name:n.name,typeReference:n.typeReference,value:i})}finally{this.errors.unscope()}}return t}associateByWireValue({parameters:e,values:r,ignoreMissingParameters:t}){let n=[];for(let[i,s]of Object.entries(r)){this.errors.scope(i);try{let l=e.find(a=>a.name.wireValue===i);if(l==null){if(t)continue;this.errors.add({severity:o.Critical,message:this.newParameterNotRecognizedError(i).message});continue}n.push({name:l.name,typeReference:l.typeReference,value:s})}finally{this.errors.unscope()}}return n}getExampleObjectProperties({parameters:e,snippetObject:r}){let t=typeof r=="object"&&r!==null&&!Array.isArray(r)?r:{},n=[];for(let i of e){let s=t[i.name.wireValue];s==null?i.typeReference.type==="nullable"&&n.push({name:i.name,typeReference:i.typeReference,value:null}):n.push({name:i.name,typeReference:i.typeReference,value:s})}return n}getSingleFileValue({property:e,record:r}){let t=r[e.wireValue];if(t!=null){if(typeof t!="string"){this.errors.add({severity:o.Critical,message:`Expected file value to be a string, got ${typeof t}`});return}return t}}getFileArrayValues({property:e,record:r}){let t=r[e.wireValue];if(t==null)return;if(!Array.isArray(t)){this.errors.add({severity:o.Critical,message:`Expected file array value to be an array of strings, got ${typeof t}`});return}let n=[];for(let i of t){if(typeof i!="string"){this.errors.add({severity:o.Critical,message:`Expected file array value to be an array of strings, got ${typeof i}`});return}n.push(i)}return n}getRecord(e){if(typeof e!="object"||Array.isArray(e)){this.errors.add({severity:o.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(e)?"array":typeof e}`});return}return e==null?{}:e}resolveNamedType({typeId:e}){let r=this._ir.types[e];if(r==null){this.errors.add({severity:o.Critical,message:`Type identified by "${e}" could not be found`});return}return r}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:r}){let t=this.getRecord(r);if(t==null)return;let n=e.discriminant.wireValue,i=t[n];if(i==null){this.errors.add({severity:o.Critical,message:this.newParameterNotRecognizedError(n).message});return}if(typeof i!="string"){this.errors.add({severity:o.Critical,message:`Expected discriminant value to be a string but got: ${typeof i}`});return}let s=e.types[i];if(s==null){this.errors.add({severity:o.Critical,message:`No type found for discriminant value "${i}"`});return}let R=t,{[n]:l}=R,a=T(R,[x(n)]);return{singleDiscriminatedUnionType:s,discriminantValue:s.discriminantValue,value:a}}resolveEndpointOrThrow(e){let r=this.httpEndpointReferenceParser.tryParse(e);if(r==null)throw new Error(`Failed to parse endpoint reference "${e}"`);return this.resolveEndpointLocationOrThrow(r)}resolveEndpointLocation(e){let r=[];for(let t of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:t,parsedEndpoint:e})&&r.push(t);return r}resolveEndpointLocationOrThrow(e){let r=this.resolveEndpointLocation(e);if(r.length===0)throw new Error(`Failed to find endpoint identified by "${e.method} ${e.path}"`);return r}needsRequestParameter({request:e,inlinePathParameters:r,inlineFileProperties:t}){var n;return this.includePathParametersInWrappedRequest({request:e,inlinePathParameters:r})||e.queryParameters!=null&&e.queryParameters.length>0||e.headers!=null&&e.headers.length>0?!0:e.body!=null?this.includeRequestBodyInWrappedRequest({body:e.body,inlineFileProperties:t}):!((n=e.metadata)!=null&&n.onlyPathParameters)}includePathParametersInWrappedRequest({request:e,inlinePathParameters:r}){var t,n;return r&&((n=(t=e.metadata)==null?void 0:t.includePathParameters)!=null?n:!1)}isFileUploadRequestBody(e){switch(e.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:d(e)}}resolveEnvironmentName(e){if(this._ir.environments==null)return;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":{let t=r.environments.find(n=>n.id===e);return t==null?void 0:t.name}case"multipleBaseUrls":{let t=r.environments.find(n=>n.id===e);return t==null?void 0:t.name}default:d(r)}}isSingleEnvironmentID(e){return typeof e=="string"}isMultiEnvironmentValues(e){return typeof e=="object"}validateMultiEnvironmentUrlValues(e){if(this._ir.environments==null)return this.errors.add({severity:o.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":return this.errors.add({severity:o.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let t=r.environments[0];if(t==null)return this.errors.add({severity:o.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let n=new Set(m(t.urls));for(let i of m(e))n.has(i)&&n.delete(i);return n.size>0?(this.errors.add({severity:o.Critical,message:`The provided environments are invalid; got: [${Object.keys(e).join(", ")}], expected: [${m(t.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:e}){if(typeof e!="number"){this.errors.add({severity:o.Critical,message:this.newTypeMismatchError({expected:"number",value:e}).message});return}return e}getValueAsBoolean({value:e}){if(typeof e!="boolean"){this.errors.add({severity:o.Critical,message:this.newTypeMismatchError({expected:"boolean",value:e}).message});return}return e}getValueAsString({value:e}){if(typeof e!="string"){this.errors.add({severity:o.Critical,message:this.newTypeMismatchError({expected:"string",value:e}).message});return}return e}isOptional(e){switch(e.type){case"nullable":return this.isOptional(e.value);case"optional":return!0;case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}isNullable(e){switch(e.type){case"nullable":return!0;case"optional":return this.isNullable(e.value);case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}newAuthMismatchError({auth:e,values:r}){return new Error(`Expected auth type ${e.type}, got ${r.type}`)}newParameterNotRecognizedError(e){return new Error(`"${e}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:e,value:r}){return new Error(`Expected ${e}, got ${typeof r}`)}includeRequestBodyInWrappedRequest({body:e,inlineFileProperties:r}){switch(e.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r});default:d(e)}}includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r}){return this.fileUploadHasBodyProperties({fileUpload:e})||r&&this.fileUploadHasFileProperties({fileUpload:e})}fileUploadHasBodyProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:d(r)}})}fileUploadHasFileProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:d(r)}})}isListTypeReference(e){return e.type==="optional"?this.isListTypeReference(e.value):e.type==="list"||e.type==="set"}parsedEndpointMatches({endpoint:e,parsedEndpoint:r}){return e.location.method===r.method&&e.location.path===r.path}};var v;(function(u){u.Concise="concise",u.Full="full"})(v||(v={}));var P={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};export{y as a,o as b,g as c,v as d,P as e};
|
|
2
|
+
//# sourceMappingURL=chunk-KIW23CQ5.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@fern-api/csharp-codegen';
|
|
2
2
|
import '@fern-api/dynamic-ir-sdk';
|
|
3
|
-
export { a as DynamicLiteralMapper } from '../DynamicSnippetsGeneratorContext-
|
|
3
|
+
export { a as DynamicLiteralMapper } from '../DynamicSnippetsGeneratorContext-pehoeH_w.js';
|
|
4
4
|
import '@fern-api/csharp-codegen/lib/ast';
|
|
5
5
|
import '@fern-api/csharp-codegen/lib/ast/types/Type';
|
|
6
6
|
import '@fern-api/csharp-codegen/lib/context/model-navigator';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-3XDW3MPR.js";import"../chunk-KIW23CQ5.js";import"../chunk-CEB5TOCF.js";export{a as DynamicLiteralMapper};
|
|
2
2
|
//# sourceMappingURL=DynamicLiteralMapper.js.map
|
|
@@ -4,4 +4,4 @@ import '@fern-api/csharp-codegen/lib/context/model-navigator';
|
|
|
4
4
|
import '@fern-api/csharp-codegen';
|
|
5
5
|
import '@fern-api/browser-compatible-base-generator';
|
|
6
6
|
import '@fern-api/dynamic-ir-sdk';
|
|
7
|
-
export { D as DynamicSnippetsGeneratorContext } from '../DynamicSnippetsGeneratorContext-
|
|
7
|
+
export { D as DynamicSnippetsGeneratorContext } from '../DynamicSnippetsGeneratorContext-pehoeH_w.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-GEII674B.js";import"../chunk-3XDW3MPR.js";import"../chunk-KIW23CQ5.js";import"../chunk-EUEE2577.js";import"../chunk-DBQMCX7L.js";import"../chunk-CEB5TOCF.js";export{a as DynamicSnippetsGeneratorContext};
|
|
2
2
|
//# sourceMappingURL=DynamicSnippetsGeneratorContext.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@fern-api/csharp-codegen';
|
|
2
2
|
import '@fern-api/dynamic-ir-sdk';
|
|
3
|
-
export { b as DynamicTypeMapper } from '../DynamicSnippetsGeneratorContext-
|
|
3
|
+
export { b as DynamicTypeMapper } from '../DynamicSnippetsGeneratorContext-pehoeH_w.js';
|
|
4
4
|
import '@fern-api/csharp-codegen/lib/ast';
|
|
5
5
|
import '@fern-api/csharp-codegen/lib/ast/types/Type';
|
|
6
6
|
import '@fern-api/csharp-codegen/lib/context/model-navigator';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-EUEE2577.js";import"../chunk-CEB5TOCF.js";export{a as DynamicTypeMapper};
|
|
2
2
|
//# sourceMappingURL=DynamicTypeMapper.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@fern-api/csharp-codegen';
|
|
2
2
|
import '@fern-api/dynamic-ir-sdk';
|
|
3
|
-
export { F as FilePropertyInfo, c as FilePropertyMapper } from '../DynamicSnippetsGeneratorContext-
|
|
3
|
+
export { F as FilePropertyInfo, c as FilePropertyMapper } from '../DynamicSnippetsGeneratorContext-pehoeH_w.js';
|
|
4
4
|
import '@fern-api/csharp-codegen/lib/ast';
|
|
5
5
|
import '@fern-api/csharp-codegen/lib/ast/types/Type';
|
|
6
6
|
import '@fern-api/csharp-codegen/lib/context/model-navigator';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-DBQMCX7L.js";import"../chunk-CEB5TOCF.js";export{a as FilePropertyMapper};
|
|
2
2
|
//# sourceMappingURL=FilePropertyMapper.js.map
|
package/esm/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { Config } from './Config.js';
|
|
|
2
2
|
export { DynamicSnippetsGenerator } from './DynamicSnippetsGenerator.js';
|
|
3
3
|
import '@fern-api/browser-compatible-base-generator';
|
|
4
4
|
import '@fern-api/dynamic-ir-sdk';
|
|
5
|
-
import './DynamicSnippetsGeneratorContext-
|
|
5
|
+
import './DynamicSnippetsGeneratorContext-pehoeH_w.js';
|
|
6
6
|
import '@fern-api/csharp-codegen/lib/ast';
|
|
7
7
|
import '@fern-api/csharp-codegen/lib/ast/types/Type';
|
|
8
8
|
import '@fern-api/csharp-codegen/lib/context/model-navigator';
|
package/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-KHCIVF5J.js";import{a as e}from"./chunk-
|
|
1
|
+
import"./chunk-KHCIVF5J.js";import{a as e}from"./chunk-KFPJC632.js";import"./chunk-EC2FLIE6.js";import"./chunk-GEII674B.js";import"./chunk-3XDW3MPR.js";import"./chunk-KIW23CQ5.js";import"./chunk-EUEE2577.js";import"./chunk-DBQMCX7L.js";import"./chunk-CEB5TOCF.js";export{e as DynamicSnippetsGenerator};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|