@fern-api/go-dynamic-snippets 0.0.12 → 0.0.14
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 +15 -15
- package/cjs/DynamicSnippetsGenerator.d.cts +6 -9
- package/{esm/DynamicSnippetsGeneratorContext-Dyk9qWMy.d.ts → cjs/DynamicSnippetsGeneratorContext-lz2pTZw3.d.cts} +28 -69
- package/cjs/EndpointSnippetGenerator.cjs +8 -8
- package/cjs/EndpointSnippetGenerator.d.cts +6 -10
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs +15 -15
- package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +2 -5
- package/cjs/context/DynamicTypeInstantiationMapper.cjs +15 -15
- package/cjs/context/DynamicTypeInstantiationMapper.d.cts +2 -5
- package/cjs/context/DynamicTypeMapper.cjs +7 -7
- package/cjs/context/DynamicTypeMapper.d.cts +2 -5
- package/cjs/context/FilePropertyMapper.cjs +8 -8
- package/cjs/context/FilePropertyMapper.d.cts +2 -5
- package/cjs/index.cjs +22 -22
- package/cjs/index.d.cts +2 -5
- package/esm/DynamicSnippetsGenerator.d.ts +6 -9
- package/esm/DynamicSnippetsGenerator.js +1 -1
- package/{cjs/DynamicSnippetsGeneratorContext-f4OAff1R.d.cts → esm/DynamicSnippetsGeneratorContext-lz2pTZw3.d.ts} +28 -69
- package/esm/EndpointSnippetGenerator.d.ts +6 -10
- package/esm/EndpointSnippetGenerator.js +1 -1
- package/esm/chunk-5HP3T45N.js +1 -0
- package/esm/chunk-D3UUM672.js +1 -0
- package/esm/chunk-I3VUX77R.js +1 -0
- package/esm/chunk-J745U74Q.js +1 -0
- package/esm/chunk-SS6XZXHU.js +1 -0
- package/esm/chunk-TUE3DOHS.js +29 -0
- package/esm/chunk-X7QP3WH3.js +1 -0
- package/esm/chunk-YAGEU3HO.js +1 -0
- package/esm/context/DynamicSnippetsGeneratorContext.d.ts +2 -5
- package/esm/context/DynamicSnippetsGeneratorContext.js +1 -1
- package/esm/context/DynamicTypeInstantiationMapper.d.ts +2 -5
- package/esm/context/DynamicTypeInstantiationMapper.js +1 -1
- package/esm/context/DynamicTypeMapper.d.ts +2 -5
- package/esm/context/DynamicTypeMapper.js +1 -1
- package/esm/context/FilePropertyMapper.d.ts +2 -5
- package/esm/context/FilePropertyMapper.js +1 -1
- package/esm/index.d.ts +2 -5
- package/esm/index.js +5 -5
- package/package.json +2 -2
- package/cjs/DiscriminatedUnionTypeInstance.cjs +0 -11
- package/cjs/DiscriminatedUnionTypeInstance.d.cts +0 -12
- package/cjs/Result.cjs +0 -11
- package/cjs/Result.d.cts +0 -23
- package/cjs/Scope.cjs +0 -11
- package/cjs/Scope.d.cts +0 -9
- package/cjs/TypeInstance.cjs +0 -11
- package/cjs/TypeInstance.d.cts +0 -15
- package/cjs/context/ErrorReporter.cjs +0 -11
- package/cjs/context/ErrorReporter.d.cts +0 -39
- package/esm/DiscriminatedUnionTypeInstance.d.ts +0 -12
- package/esm/DiscriminatedUnionTypeInstance.js +0 -1
- package/esm/Result.d.ts +0 -23
- package/esm/Result.js +0 -1
- package/esm/Scope.d.ts +0 -9
- package/esm/Scope.js +0 -1
- package/esm/TypeInstance.d.ts +0 -15
- package/esm/TypeInstance.js +0 -1
- package/esm/chunk-2AZXIWKY.js +0 -11
- package/esm/chunk-575DWQWD.js +0 -1
- package/esm/chunk-5TA7XQOD.js +0 -1
- package/esm/chunk-DMDZDIA7.js +0 -1
- package/esm/chunk-E5FOYV6P.js +0 -19
- package/esm/chunk-HBFOF5YT.js +0 -1
- package/esm/chunk-IIKN6XQS.js +0 -1
- package/esm/chunk-LLE63BZO.js +0 -1
- package/esm/chunk-M3DYFCFN.js +0 -1
- package/esm/chunk-VLNKANS2.js +0 -1
- package/esm/chunk-ZI6CAI2V.js +0 -1
- package/esm/context/ErrorReporter.d.ts +0 -39
- package/esm/context/ErrorReporter.js +0 -1
package/cjs/TypeInstance.cjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";var z=Object.defineProperty;var pr=Object.getOwnPropertyDescriptor;var sr=Object.getOwnPropertyNames;var wr=Object.prototype.hasOwnProperty;var xr=(i,r,n,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of sr(r))!wr.call(i,t)&&t!==n&&z(i,t,{get:()=>r[t],enumerable:!(e=pr(r,t))||e.enumerable});return i};var Er=i=>xr(z({},"__esModule",{value:!0}),i);var gn={};module.exports=Er(gn);function J(){throw new Error("setTimeout has not been defined")}function O(){throw new Error("clearTimeout has not been defined")}var R=J,_=O;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(_=clearTimeout);function Q(i){if(R===setTimeout)return setTimeout(i,0);if((R===J||!R)&&setTimeout)return R=setTimeout,setTimeout(i,0);try{return R(i,0)}catch(r){try{return R.call(null,i,0)}catch(n){return R.call(this,i,0)}}}function mr(i){if(_===clearTimeout)return clearTimeout(i);if((_===O||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(i);try{return _(i)}catch(r){try{return _.call(null,i)}catch(n){return _.call(this,i)}}}var g=[],S=!1,I,Y=-1;function Ar(){!S||!I||(S=!1,I.length?g=I.concat(g):Y=-1,g.length&&X())}function X(){if(!S){var i=Q(Ar);S=!0;for(var r=g.length;r;){for(I=g,g=[];++Y<r;)I&&I[Y].run();Y=-1,r=g.length}I=null,S=!1,mr(i)}}function yr(i){var r=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)r[n-1]=arguments[n];g.push(new q(i,r)),g.length===1&&!S&&Q(X)}function q(i,r){this.fun=i,this.array=r}q.prototype.run=function(){this.fun.apply(null,this.array)};var gr="browser",Tr="browser",Rr=!0,_r={},Ir=[],vr="",Ur={},Br={},dr={};function v(){}var Sr=v,Yr=v,Pr=v,Dr=v,Mr=v,Cr=v,kr=v;function Nr(i){throw new Error("process.binding is not supported")}function Lr(){return"/"}function Fr(i){throw new Error("process.chdir is not supported")}function Wr(){return 0}var d=globalThis.performance||{},Vr=d.now||d.mozNow||d.msNow||d.oNow||d.webkitNow||function(){return new Date().getTime()};function Hr(i){var r=Vr.call(d)*.001,n=Math.floor(r),e=Math.floor(r%1*1e9);return i&&(n=n-i[0],e=e-i[1],e<0&&(n--,e+=1e9)),[n,e]}var zr=new Date;function Gr(){var i=new Date,r=i-zr;return r/1e3}var L={nextTick:yr,title:gr,browser:Rr,env:_r,argv:Ir,version:vr,versions:Ur,on:Sr,addListener:Yr,once:Pr,off:Dr,removeListener:Mr,removeAllListeners:Cr,emit:kr,binding:Nr,cwd:Lr,chdir:Fr,umask:Wr,hrtime:Hr,platform:Tr,release:Br,config:dr,uptime:Gr},G={};Object.keys(G).forEach(i=>{let r=i.split("."),n=L;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?n[t]=G[i]:n=n[t]||(n[t]={})}});var A=[],E=[],Jr=typeof Uint8Array!="undefined"?Uint8Array:Array,W=!1;function b(){W=!0;for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,n=i.length;r<n;++r)A[r]=i[r],E[i.charCodeAt(r)]=r;E[45]=62,E[95]=63}function Or(i){W||b();var r,n,e,t,f,u,a=i.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f=i[a-2]==="="?2:i[a-1]==="="?1:0,u=new Jr(a*3/4-f),e=f>0?a-4:a;var h=0;for(r=0,n=0;r<e;r+=4,n+=3)t=E[i.charCodeAt(r)]<<18|E[i.charCodeAt(r+1)]<<12|E[i.charCodeAt(r+2)]<<6|E[i.charCodeAt(r+3)],u[h++]=t>>16&255,u[h++]=t>>8&255,u[h++]=t&255;return f===2?(t=E[i.charCodeAt(r)]<<2|E[i.charCodeAt(r+1)]>>4,u[h++]=t&255):f===1&&(t=E[i.charCodeAt(r)]<<10|E[i.charCodeAt(r+1)]<<4|E[i.charCodeAt(r+2)]>>2,u[h++]=t>>8&255,u[h++]=t&255),u}function Qr(i){return A[i>>18&63]+A[i>>12&63]+A[i>>6&63]+A[i&63]}function Xr(i,r,n){for(var e,t=[],f=r;f<n;f+=3)e=(i[f]<<16)+(i[f+1]<<8)+i[f+2],t.push(Qr(e));return t.join("")}function Z(i){W||b();for(var r,n=i.length,e=n%3,t="",f=[],u=16383,a=0,h=n-e;a<h;a+=u)f.push(Xr(i,a,a+u>h?h:a+u));return e===1?(r=i[n-1],t+=A[r>>2],t+=A[r<<4&63],t+="=="):e===2&&(r=(i[n-2]<<8)+i[n-1],t+=A[r>>10],t+=A[r>>4&63],t+=A[r<<2&63],t+="="),f.push(t),f.join("")}o.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function P(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(i,r){if(P()<r)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(i=new Uint8Array(r),i.__proto__=o.prototype):(i===null&&(i=new o(r)),i.length=r),i}function o(i,r,n){if(!o.TYPED_ARRAY_SUPPORT&&!(this instanceof o))return new o(i,r,n);if(typeof i=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return V(this,i)}return j(this,i,r,n)}o.poolSize=8192;o._augment=function(i){return i.__proto__=o.prototype,i};function j(i,r,n,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&r instanceof ArrayBuffer?Kr(i,r,n,e):typeof r=="string"?Zr(i,r,n):$r(i,r)}o.from=function(i,r,n){return j(null,i,r,n)};o.kMaxLength=P();o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&o[Symbol.species]);function rr(i){if(typeof i!="number")throw new TypeError('"size" argument must be a number');if(i<0)throw new RangeError('"size" argument must not be negative')}function qr(i,r,n,e){return rr(r),r<=0?T(i,r):n!==void 0?typeof e=="string"?T(i,r).fill(n,e):T(i,r).fill(n):T(i,r)}o.alloc=function(i,r,n){return qr(null,i,r,n)};function V(i,r){if(rr(r),i=T(i,r<0?0:H(r)|0),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)i[n]=0;return i}o.allocUnsafe=function(i){return V(null,i)};o.allocUnsafeSlow=function(i){return V(null,i)};function Zr(i,r,n){if((typeof n!="string"||n==="")&&(n="utf8"),!o.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var e=nr(r,n)|0;i=T(i,e);var t=i.write(r,n);return t!==e&&(i=i.slice(0,t)),i}function F(i,r){var n=r.length<0?0:H(r.length)|0;i=T(i,n);for(var e=0;e<n;e+=1)i[e]=r[e]&255;return i}function Kr(i,r,n,e){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(e||0))throw new RangeError("'length' is out of bounds");return n===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,n):r=new Uint8Array(r,n,e),o.TYPED_ARRAY_SUPPORT?(i=r,i.__proto__=o.prototype):i=F(i,r),i}function $r(i,r){if(y(r)){var n=H(r.length)|0;return i=T(i,n),i.length===0||r.copy(i,0,0,n),i}if(r){if(typeof ArrayBuffer!="undefined"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||mn(r.length)?T(i,0):F(i,r);if(r.type==="Buffer"&&Array.isArray(r.data))return F(i,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function H(i){if(i>=P())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P().toString(16)+" bytes");return i|0}o.isBuffer=An;function y(i){return!!(i!=null&&i._isBuffer)}o.compare=function(r,n){if(!y(r)||!y(n))throw new TypeError("Arguments must be Buffers");if(r===n)return 0;for(var e=r.length,t=n.length,f=0,u=Math.min(e,t);f<u;++f)if(r[f]!==n[f]){e=r[f],t=n[f];break}return e<t?-1:t<e?1:0};o.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};o.concat=function(r,n){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);var e;if(n===void 0)for(n=0,e=0;e<r.length;++e)n+=r[e].length;var t=o.allocUnsafe(n),f=0;for(e=0;e<r.length;++e){var u=r[e];if(!y(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,f),f+=u.length}return t};function nr(i,r){if(y(i))return i.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(i)||i instanceof ArrayBuffer))return i.byteLength;typeof i!="string"&&(i=""+i);var n=i.length;if(n===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return D(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return ar(i).length;default:if(e)return D(i).length;r=(""+r).toLowerCase(),e=!0}}o.byteLength=nr;function br(i,r,n){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,r>>>=0,n<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return hn(this,r,n);case"utf8":case"utf-8":return tr(this,r,n);case"ascii":return on(this,r,n);case"latin1":case"binary":return an(this,r,n);case"base64":return fn(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return cn(this,r,n);default:if(e)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),e=!0}}o.prototype._isBuffer=!0;function U(i,r,n){var e=i[r];i[r]=i[n],i[n]=e}o.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<r;n+=2)U(this,n,n+1);return this};o.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<r;n+=4)U(this,n,n+3),U(this,n+1,n+2);return this};o.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<r;n+=8)U(this,n,n+7),U(this,n+1,n+6),U(this,n+2,n+5),U(this,n+3,n+4);return this};o.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?tr(this,0,r):br.apply(this,arguments)};o.prototype.equals=function(r){if(!y(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0};o.prototype.compare=function(r,n,e,t,f){if(!y(r))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),f===void 0&&(f=this.length),n<0||e>r.length||t<0||f>this.length)throw new RangeError("out of range index");if(t>=f&&n>=e)return 0;if(t>=f)return-1;if(n>=e)return 1;if(n>>>=0,e>>>=0,t>>>=0,f>>>=0,this===r)return 0;for(var u=f-t,a=e-n,h=Math.min(u,a),l=this.slice(t,f),p=r.slice(n,e),c=0;c<h;++c)if(l[c]!==p[c]){u=l[c],a=p[c];break}return u<a?-1:a<u?1:0};function ir(i,r,n,e,t){if(i.length===0)return-1;if(typeof n=="string"?(e=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=t?0:i.length-1),n<0&&(n=i.length+n),n>=i.length){if(t)return-1;n=i.length-1}else if(n<0)if(t)n=0;else return-1;if(typeof r=="string"&&(r=o.from(r,e)),y(r))return r.length===0?-1:K(i,r,n,e,t);if(typeof r=="number")return r=r&255,o.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(i,r,n):Uint8Array.prototype.lastIndexOf.call(i,r,n):K(i,[r],n,e,t);throw new TypeError("val must be string, number or Buffer")}function K(i,r,n,e,t){var f=1,u=i.length,a=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(i.length<2||r.length<2)return-1;f=2,u/=2,a/=2,n/=2}function h(x,B){return f===1?x[B]:x.readUInt16BE(B*f)}var l;if(t){var p=-1;for(l=n;l<u;l++)if(h(i,l)===h(r,p===-1?0:l-p)){if(p===-1&&(p=l),l-p+1===a)return p*f}else p!==-1&&(l-=l-p),p=-1}else for(n+a>u&&(n=u-a),l=n;l>=0;l--){for(var c=!0,m=0;m<a;m++)if(h(i,l+m)!==h(r,m)){c=!1;break}if(c)return l}return-1}o.prototype.includes=function(r,n,e){return this.indexOf(r,n,e)!==-1};o.prototype.indexOf=function(r,n,e){return ir(this,r,n,e,!0)};o.prototype.lastIndexOf=function(r,n,e){return ir(this,r,n,e,!1)};function jr(i,r,n,e){n=Number(n)||0;var t=i.length-n;e?(e=Number(e),e>t&&(e=t)):e=t;var f=r.length;if(f%2!==0)throw new TypeError("Invalid hex string");e>f/2&&(e=f/2);for(var u=0;u<e;++u){var a=parseInt(r.substr(u*2,2),16);if(isNaN(a))return u;i[n+u]=a}return u}function rn(i,r,n,e){return k(D(r,i.length-n),i,n,e)}function er(i,r,n,e){return k(xn(r),i,n,e)}function nn(i,r,n,e){return er(i,r,n,e)}function en(i,r,n,e){return k(ar(r),i,n,e)}function tn(i,r,n,e){return k(En(r,i.length-n),i,n,e)}o.prototype.write=function(r,n,e,t){if(n===void 0)t="utf8",e=this.length,n=0;else if(e===void 0&&typeof n=="string")t=n,e=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-n;if((e===void 0||e>f)&&(e=f),r.length>0&&(e<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return jr(this,r,n,e);case"utf8":case"utf-8":return rn(this,r,n,e);case"ascii":return er(this,r,n,e);case"latin1":case"binary":return nn(this,r,n,e);case"base64":return en(this,r,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tn(this,r,n,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function fn(i,r,n){return r===0&&n===i.length?Z(i):Z(i.slice(r,n))}function tr(i,r,n){n=Math.min(i.length,n);for(var e=[],t=r;t<n;){var f=i[t],u=null,a=f>239?4:f>223?3:f>191?2:1;if(t+a<=n){var h,l,p,c;switch(a){case 1:f<128&&(u=f);break;case 2:h=i[t+1],(h&192)===128&&(c=(f&31)<<6|h&63,c>127&&(u=c));break;case 3:h=i[t+1],l=i[t+2],(h&192)===128&&(l&192)===128&&(c=(f&15)<<12|(h&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:h=i[t+1],l=i[t+2],p=i[t+3],(h&192)===128&&(l&192)===128&&(p&192)===128&&(c=(f&15)<<18|(h&63)<<12|(l&63)<<6|p&63,c>65535&&c<1114112&&(u=c))}}u===null?(u=65533,a=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=a}return un(e)}var $=4096;function un(i){var r=i.length;if(r<=$)return String.fromCharCode.apply(String,i);for(var n="",e=0;e<r;)n+=String.fromCharCode.apply(String,i.slice(e,e+=$));return n}function on(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]&127);return e}function an(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]);return e}function hn(i,r,n){var e=i.length;(!r||r<0)&&(r=0),(!n||n<0||n>e)&&(n=e);for(var t="",f=r;f<n;++f)t+=wn(i[f]);return t}function cn(i,r,n){for(var e=i.slice(r,n),t="",f=0;f<e.length;f+=2)t+=String.fromCharCode(e[f]+e[f+1]*256);return t}o.prototype.slice=function(r,n){var e=this.length;r=~~r,n=n===void 0?e:~~n,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),n<0?(n+=e,n<0&&(n=0)):n>e&&(n=e),n<r&&(n=r);var t;if(o.TYPED_ARRAY_SUPPORT)t=this.subarray(r,n),t.__proto__=o.prototype;else{var f=n-r;t=new o(f,void 0);for(var u=0;u<f;++u)t[u]=this[u+r]}return t};function s(i,r,n){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+r>n)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUIntLE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r],f=1,u=0;++u<n&&(f*=256);)t+=this[r+u]*f;return t};o.prototype.readUIntBE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r+--n],f=1;n>0&&(f*=256);)t+=this[r+--n]*f;return t};o.prototype.readUInt8=function(r,n){return n||s(r,1,this.length),this[r]};o.prototype.readUInt16LE=function(r,n){return n||s(r,2,this.length),this[r]|this[r+1]<<8};o.prototype.readUInt16BE=function(r,n){return n||s(r,2,this.length),this[r]<<8|this[r+1]};o.prototype.readUInt32LE=function(r,n){return n||s(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};o.prototype.readUInt32BE=function(r,n){return n||s(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};o.prototype.readIntLE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r],f=1,u=0;++u<n&&(f*=256);)t+=this[r+u]*f;return f*=128,t>=f&&(t-=Math.pow(2,8*n)),t};o.prototype.readIntBE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=n,f=1,u=this[r+--t];t>0&&(f*=256);)u+=this[r+--t]*f;return f*=128,u>=f&&(u-=Math.pow(2,8*n)),u};o.prototype.readInt8=function(r,n){return n||s(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};o.prototype.readInt16LE=function(r,n){n||s(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};o.prototype.readInt16BE=function(r,n){n||s(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};o.prototype.readInt32LE=function(r,n){return n||s(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};o.prototype.readInt32BE=function(r,n){return n||s(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};o.prototype.readFloatLE=function(r,n){return n||s(r,4,this.length),N(this,r,!0,23,4)};o.prototype.readFloatBE=function(r,n){return n||s(r,4,this.length),N(this,r,!1,23,4)};o.prototype.readDoubleLE=function(r,n){return n||s(r,8,this.length),N(this,r,!0,52,8)};o.prototype.readDoubleBE=function(r,n){return n||s(r,8,this.length),N(this,r,!1,52,8)};function w(i,r,n,e,t,f){if(!y(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<f)throw new RangeError('"value" argument is out of bounds');if(n+e>i.length)throw new RangeError("Index out of range")}o.prototype.writeUIntLE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,n,e,f,0)}var u=1,a=0;for(this[n]=r&255;++a<e&&(u*=256);)this[n+a]=r/u&255;return n+e};o.prototype.writeUIntBE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,n,e,f,0)}var u=e-1,a=1;for(this[n+u]=r&255;--u>=0&&(a*=256);)this[n+u]=r/a&255;return n+e};o.prototype.writeUInt8=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,1,255,0),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[n]=r&255,n+1};function M(i,r,n,e){r<0&&(r=65535+r+1);for(var t=0,f=Math.min(i.length-n,2);t<f;++t)i[n+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}o.prototype.writeUInt16LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):M(this,r,n,!0),n+2};o.prototype.writeUInt16BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):M(this,r,n,!1),n+2};function C(i,r,n,e){r<0&&(r=4294967295+r+1);for(var t=0,f=Math.min(i.length-n,4);t<f;++t)i[n+t]=r>>>(e?t:3-t)*8&255}o.prototype.writeUInt32LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[n+3]=r>>>24,this[n+2]=r>>>16,this[n+1]=r>>>8,this[n]=r&255):C(this,r,n,!0),n+4};o.prototype.writeUInt32BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):C(this,r,n,!1),n+4};o.prototype.writeIntLE=function(r,n,e,t){if(r=+r,n=n|0,!t){var f=Math.pow(2,8*e-1);w(this,r,n,e,f-1,-f)}var u=0,a=1,h=0;for(this[n]=r&255;++u<e&&(a*=256);)r<0&&h===0&&this[n+u-1]!==0&&(h=1),this[n+u]=(r/a>>0)-h&255;return n+e};o.prototype.writeIntBE=function(r,n,e,t){if(r=+r,n=n|0,!t){var f=Math.pow(2,8*e-1);w(this,r,n,e,f-1,-f)}var u=e-1,a=1,h=0;for(this[n+u]=r&255;--u>=0&&(a*=256);)r<0&&h===0&&this[n+u+1]!==0&&(h=1),this[n+u]=(r/a>>0)-h&255;return n+e};o.prototype.writeInt8=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,1,127,-128),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[n]=r&255,n+1};o.prototype.writeInt16LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):M(this,r,n,!0),n+2};o.prototype.writeInt16BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):M(this,r,n,!1),n+2};o.prototype.writeInt32LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8,this[n+2]=r>>>16,this[n+3]=r>>>24):C(this,r,n,!0),n+4};o.prototype.writeInt32BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):C(this,r,n,!1),n+4};function fr(i,r,n,e,t,f){if(n+e>i.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function ur(i,r,n,e,t){return t||fr(i,r,n,4,34028234663852886e22,-34028234663852886e22),cr(i,r,n,e,23,4),n+4}o.prototype.writeFloatLE=function(r,n,e){return ur(this,r,n,!0,e)};o.prototype.writeFloatBE=function(r,n,e){return ur(this,r,n,!1,e)};function or(i,r,n,e,t){return t||fr(i,r,n,8,17976931348623157e292,-17976931348623157e292),cr(i,r,n,e,52,8),n+8}o.prototype.writeDoubleLE=function(r,n,e){return or(this,r,n,!0,e)};o.prototype.writeDoubleBE=function(r,n,e){return or(this,r,n,!1,e)};o.prototype.copy=function(r,n,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),n>=r.length&&(n=r.length),n||(n=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-n<t-e&&(t=r.length-n+e);var f=t-e,u;if(this===r&&e<n&&n<t)for(u=f-1;u>=0;--u)r[u+n]=this[u+e];else if(f<1e3||!o.TYPED_ARRAY_SUPPORT)for(u=0;u<f;++u)r[u+n]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+f),n);return f};o.prototype.fill=function(r,n,e,t){if(typeof r=="string"){if(typeof n=="string"?(t=n,n=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var f=r.charCodeAt(0);f<256&&(r=f)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(n<0||this.length<n||this.length<e)throw new RangeError("Out of range index");if(e<=n)return this;n=n>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=n;u<e;++u)this[u]=r;else{var a=y(r)?r:D(new o(r,t).toString()),h=a.length;for(u=0;u<e-n;++u)this[u+n]=a[u%h]}return this};var ln=/[^+\/0-9A-Za-z-_]/g;function pn(i){if(i=sn(i).replace(ln,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function sn(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function wn(i){return i<16?"0"+i.toString(16):i.toString(16)}function D(i,r){r=r||1/0;for(var n,e=i.length,t=null,f=[],u=0;u<e;++u){if(n=i.charCodeAt(u),n>55295&&n<57344){if(!t){if(n>56319){(r-=3)>-1&&f.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&f.push(239,191,189);continue}t=n;continue}if(n<56320){(r-=3)>-1&&f.push(239,191,189),t=n;continue}n=(t-55296<<10|n-56320)+65536}else t&&(r-=3)>-1&&f.push(239,191,189);if(t=null,n<128){if((r-=1)<0)break;f.push(n)}else if(n<2048){if((r-=2)<0)break;f.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;f.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;f.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return f}function xn(i){for(var r=[],n=0;n<i.length;++n)r.push(i.charCodeAt(n)&255);return r}function En(i,r){for(var n,e,t,f=[],u=0;u<i.length&&!((r-=2)<0);++u)n=i.charCodeAt(u),e=n>>8,t=n%256,f.push(t),f.push(e);return f}function ar(i){return Or(pn(i))}function k(i,r,n,e){for(var t=0;t<e&&!(t+n>=r.length||t>=i.length);++t)r[t+n]=i[t];return t}function mn(i){return i!==i}function An(i){return i!=null&&(!!i._isBuffer||hr(i)||yn(i))}function hr(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function yn(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&hr(i.slice(0,0))}function N(i,r,n,e,t){var f,u,a=t*8-e-1,h=(1<<a)-1,l=h>>1,p=-7,c=n?t-1:0,m=n?-1:1,x=i[r+c];for(c+=m,f=x&(1<<-p)-1,x>>=-p,p+=a;p>0;f=f*256+i[r+c],c+=m,p-=8);for(u=f&(1<<-p)-1,f>>=-p,p+=e;p>0;u=u*256+i[r+c],c+=m,p-=8);if(f===0)f=1-l;else{if(f===h)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,e),f=f-l}return(x?-1:1)*u*Math.pow(2,f-e)}function cr(i,r,n,e,t,f){var u,a,h,l=f*8-t-1,p=(1<<l)-1,c=p>>1,m=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=e?0:f-1,B=e?1:-1,lr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=p):(u=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-u))<1&&(u--,h*=2),u+c>=1?r+=m/h:r+=m*Math.pow(2,1-c),r*h>=2&&(u++,h/=2),u+c>=p?(a=0,u=p):u+c>=1?(a=(r*h-1)*Math.pow(2,t),u=u+c):(a=r*Math.pow(2,c-1)*Math.pow(2,t),u=0));t>=8;i[n+x]=a&255,x+=B,a/=256,t-=8);for(u=u<<t|a,l+=t;l>0;i[n+x]=u&255,x+=B,u/=256,l-=8);i[n+x-B]|=lr*128}
|
|
2
|
-
/*! Bundled license information:
|
|
3
|
-
|
|
4
|
-
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
5
|
-
(*!
|
|
6
|
-
* The buffer module from node.js, for the browser.
|
|
7
|
-
*
|
|
8
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
9
|
-
* @license MIT
|
|
10
|
-
*)
|
|
11
|
-
*/
|
package/cjs/TypeInstance.d.cts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { NameAndWireValue, dynamic } from '@fern-fern/ir-sdk/api';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A type instance that can be converted into a language-specific AST node.
|
|
5
|
-
*
|
|
6
|
-
* The 'type' and 'value' are used to convert the AST node itself, and the name
|
|
7
|
-
* is (optionally) used within the dynamic snippet, e.g. for named fields.
|
|
8
|
-
*/
|
|
9
|
-
interface TypeInstance {
|
|
10
|
-
name: NameAndWireValue;
|
|
11
|
-
typeReference: dynamic.TypeReference;
|
|
12
|
-
value: unknown;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type { TypeInstance };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";var P=Object.defineProperty,gr=Object.defineProperties,Ar=Object.getOwnPropertyDescriptor,Tr=Object.getOwnPropertyDescriptors,Rr=Object.getOwnPropertyNames,J=Object.getOwnPropertySymbols;var Q=Object.prototype.hasOwnProperty,vr=Object.prototype.propertyIsEnumerable;var F=(e,r,i)=>r in e?P(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,X=(e,r)=>{for(var i in r||(r={}))Q.call(r,i)&&F(e,i,r[i]);if(J)for(var i of J(r))vr.call(r,i)&&F(e,i,r[i]);return e},q=(e,r)=>gr(e,Tr(r));var Ir=(e,r)=>{for(var i in r)P(e,i,{get:r[i],enumerable:!0})},_r=(e,r,i,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of Rr(r))!Q.call(e,t)&&t!==i&&P(e,t,{get:()=>r[t],enumerable:!(n=Ar(r,t))||n.enumerable});return e};var Ur=e=>_r(P({},"__esModule",{value:!0}),e);var W=(e,r,i)=>F(e,typeof r!="symbol"?r+"":r,i);var Pi={};Ir(Pi,{ErrorReporter:()=>V,Severity:()=>Si});module.exports=Ur(Pi);function $(){throw new Error("setTimeout has not been defined")}function K(){throw new Error("clearTimeout has not been defined")}var R=$,v=K;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(v=clearTimeout);function j(e){if(R===setTimeout)return setTimeout(e,0);if((R===$||!R)&&setTimeout)return R=setTimeout,setTimeout(e,0);try{return R(e,0)}catch(r){try{return R.call(null,e,0)}catch(i){return R.call(this,e,0)}}}function dr(e){if(v===clearTimeout)return clearTimeout(e);if((v===K||!v)&&clearTimeout)return v=clearTimeout,clearTimeout(e);try{return v(e)}catch(r){try{return v.call(null,e)}catch(i){return v.call(this,e)}}}var A=[],S=!1,I,Y=-1;function Br(){!S||!I||(S=!1,I.length?A=I.concat(A):Y=-1,A.length&&rr())}function rr(){if(!S){var e=j(Br);S=!0;for(var r=A.length;r;){for(I=A,A=[];++Y<r;)I&&I[Y].run();Y=-1,r=A.length}I=null,S=!1,dr(e)}}function Sr(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)r[i-1]=arguments[i];A.push(new ir(e,r)),A.length===1&&!S&&j(rr)}function ir(e,r){this.fun=e,this.array=r}ir.prototype.run=function(){this.fun.apply(null,this.array)};var Pr="browser",Yr="browser",Cr=!0,Mr={},Dr=[],kr="",Nr={},Lr={},Fr={};function _(){}var Wr=_,br=_,Gr=_,zr=_,Hr=_,Or=_,Vr=_;function Jr(e){throw new Error("process.binding is not supported")}function Qr(){return"/"}function Xr(e){throw new Error("process.chdir is not supported")}function qr(){return 0}var B=globalThis.performance||{},Zr=B.now||B.mozNow||B.msNow||B.oNow||B.webkitNow||function(){return new Date().getTime()};function $r(e){var r=Zr.call(B)*.001,i=Math.floor(r),n=Math.floor(r%1*1e9);return e&&(i=i-e[0],n=n-e[1],n<0&&(i--,n+=1e9)),[i,n]}var Kr=new Date;function jr(){var e=new Date,r=e-Kr;return r/1e3}var b={nextTick:Sr,title:Pr,browser:Cr,env:Mr,argv:Dr,version:kr,versions:Nr,on:Wr,addListener:br,once:Gr,off:zr,removeListener:Hr,removeAllListeners:Or,emit:Vr,binding:Jr,cwd:Qr,chdir:Xr,umask:qr,hrtime:$r,platform:Yr,release:Lr,config:Fr,uptime:jr},Z={};Object.keys(Z).forEach(e=>{let r=e.split("."),i=b;for(let n=0;n<r.length;n++){let t=r[n];n===r.length-1?i[t]=Z[e]:i=i[t]||(i[t]={})}});var y=[],E=[],ri=typeof Uint8Array!="undefined"?Uint8Array:Array,z=!1;function or(){z=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,i=e.length;r<i;++r)y[r]=e[r],E[e.charCodeAt(r)]=r;E[45]=62,E[95]=63}function ii(e){z||or();var r,i,n,t,o,u,a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=e[a-2]==="="?2:e[a-1]==="="?1:0,u=new ri(a*3/4-o),n=o>0?a-4:a;var h=0;for(r=0,i=0;r<n;r+=4,i+=3)t=E[e.charCodeAt(r)]<<18|E[e.charCodeAt(r+1)]<<12|E[e.charCodeAt(r+2)]<<6|E[e.charCodeAt(r+3)],u[h++]=t>>16&255,u[h++]=t>>8&255,u[h++]=t&255;return o===2?(t=E[e.charCodeAt(r)]<<2|E[e.charCodeAt(r+1)]>>4,u[h++]=t&255):o===1&&(t=E[e.charCodeAt(r)]<<10|E[e.charCodeAt(r+1)]<<4|E[e.charCodeAt(r+2)]>>2,u[h++]=t>>8&255,u[h++]=t&255),u}function ei(e){return y[e>>18&63]+y[e>>12&63]+y[e>>6&63]+y[e&63]}function ni(e,r,i){for(var n,t=[],o=r;o<i;o+=3)n=(e[o]<<16)+(e[o+1]<<8)+e[o+2],t.push(ei(n));return t.join("")}function er(e){z||or();for(var r,i=e.length,n=i%3,t="",o=[],u=16383,a=0,h=i-n;a<h;a+=u)o.push(ni(e,a,a+u>h?h:a+u));return n===1?(r=e[i-1],t+=y[r>>2],t+=y[r<<4&63],t+="=="):n===2&&(r=(e[i-2]<<8)+e[i-1],t+=y[r>>10],t+=y[r>>4&63],t+=y[r<<2&63],t+="="),o.push(t),o.join("")}f.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function C(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(e,r){if(C()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r),e.__proto__=f.prototype):(e===null&&(e=new f(r)),e.length=r),e}function f(e,r,i){if(!f.TYPED_ARRAY_SUPPORT&&!(this instanceof f))return new f(e,r,i);if(typeof e=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return H(this,e)}return ur(this,e,r,i)}f.poolSize=8192;f._augment=function(e){return e.__proto__=f.prototype,e};function ur(e,r,i,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&r instanceof ArrayBuffer?ui(e,r,i,n):typeof r=="string"?oi(e,r,i):fi(e,r)}f.from=function(e,r,i){return ur(null,e,r,i)};f.kMaxLength=C();f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&f[Symbol.species]);function fr(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function ti(e,r,i,n){return fr(r),r<=0?T(e,r):i!==void 0?typeof n=="string"?T(e,r).fill(i,n):T(e,r).fill(i):T(e,r)}f.alloc=function(e,r,i){return ti(null,e,r,i)};function H(e,r){if(fr(r),e=T(e,r<0?0:O(r)|0),!f.TYPED_ARRAY_SUPPORT)for(var i=0;i<r;++i)e[i]=0;return e}f.allocUnsafe=function(e){return H(null,e)};f.allocUnsafeSlow=function(e){return H(null,e)};function oi(e,r,i){if((typeof i!="string"||i==="")&&(i="utf8"),!f.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=ar(r,i)|0;e=T(e,n);var t=e.write(r,i);return t!==n&&(e=e.slice(0,t)),e}function G(e,r){var i=r.length<0?0:O(r.length)|0;e=T(e,i);for(var n=0;n<i;n+=1)e[n]=r[n]&255;return e}function ui(e,r,i,n){if(r.byteLength,i<0||r.byteLength<i)throw new RangeError("'offset' is out of bounds");if(r.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");return i===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,i):r=new Uint8Array(r,i,n),f.TYPED_ARRAY_SUPPORT?(e=r,e.__proto__=f.prototype):e=G(e,r),e}function fi(e,r){if(g(r)){var i=O(r.length)|0;return e=T(e,i),e.length===0||r.copy(e,0,0,i),e}if(r){if(typeof ArrayBuffer!="undefined"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ui(r.length)?T(e,0):G(e,r);if(r.type==="Buffer"&&Array.isArray(r.data))return G(e,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function O(e){if(e>=C())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C().toString(16)+" bytes");return e|0}f.isBuffer=di;function g(e){return!!(e!=null&&e._isBuffer)}f.compare=function(r,i){if(!g(r)||!g(i))throw new TypeError("Arguments must be Buffers");if(r===i)return 0;for(var n=r.length,t=i.length,o=0,u=Math.min(n,t);o<u;++o)if(r[o]!==i[o]){n=r[o],t=i[o];break}return n<t?-1:t<n?1:0};f.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};f.concat=function(r,i){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return f.alloc(0);var n;if(i===void 0)for(i=0,n=0;n<r.length;++n)i+=r[n].length;var t=f.allocUnsafe(i),o=0;for(n=0;n<r.length;++n){var u=r[n];if(!g(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,o),o+=u.length}return t};function ar(e,r){if(g(e))return e.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var i=e.length;if(i===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return M(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return xr(e).length;default:if(n)return M(e).length;r=(""+r).toLowerCase(),n=!0}}f.byteLength=ar;function ai(e,r,i){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,r>>>=0,i<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return yi(this,r,i);case"utf8":case"utf-8":return pr(this,r,i);case"ascii":return Ei(this,r,i);case"latin1":case"binary":return mi(this,r,i);case"base64":return wi(this,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gi(this,r,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}f.prototype._isBuffer=!0;function U(e,r,i){var n=e[r];e[r]=e[i],e[i]=n}f.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<r;i+=2)U(this,i,i+1);return this};f.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<r;i+=4)U(this,i,i+3),U(this,i+1,i+2);return this};f.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<r;i+=8)U(this,i,i+7),U(this,i+1,i+6),U(this,i+2,i+5),U(this,i+3,i+4);return this};f.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?pr(this,0,r):ai.apply(this,arguments)};f.prototype.equals=function(r){if(!g(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:f.compare(this,r)===0};f.prototype.compare=function(r,i,n,t,o){if(!g(r))throw new TypeError("Argument must be a Buffer");if(i===void 0&&(i=0),n===void 0&&(n=r?r.length:0),t===void 0&&(t=0),o===void 0&&(o=this.length),i<0||n>r.length||t<0||o>this.length)throw new RangeError("out of range index");if(t>=o&&i>=n)return 0;if(t>=o)return-1;if(i>=n)return 1;if(i>>>=0,n>>>=0,t>>>=0,o>>>=0,this===r)return 0;for(var u=o-t,a=n-i,h=Math.min(u,a),p=this.slice(t,o),s=r.slice(i,n),c=0;c<h;++c)if(p[c]!==s[c]){u=p[c],a=s[c];break}return u<a?-1:a<u?1:0};function hr(e,r,i,n,t){if(e.length===0)return-1;if(typeof i=="string"?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=t?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(t)return-1;i=e.length-1}else if(i<0)if(t)i=0;else return-1;if(typeof r=="string"&&(r=f.from(r,n)),g(r))return r.length===0?-1:nr(e,r,i,n,t);if(typeof r=="number")return r=r&255,f.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(e,r,i):Uint8Array.prototype.lastIndexOf.call(e,r,i):nr(e,[r],i,n,t);throw new TypeError("val must be string, number or Buffer")}function nr(e,r,i,n,t){var o=1,u=e.length,a=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,u/=2,a/=2,i/=2}function h(x,d){return o===1?x[d]:x.readUInt16BE(d*o)}var p;if(t){var s=-1;for(p=i;p<u;p++)if(h(e,p)===h(r,s===-1?0:p-s)){if(s===-1&&(s=p),p-s+1===a)return s*o}else s!==-1&&(p-=p-s),s=-1}else for(i+a>u&&(i=u-a),p=i;p>=0;p--){for(var c=!0,m=0;m<a;m++)if(h(e,p+m)!==h(r,m)){c=!1;break}if(c)return p}return-1}f.prototype.includes=function(r,i,n){return this.indexOf(r,i,n)!==-1};f.prototype.indexOf=function(r,i,n){return hr(this,r,i,n,!0)};f.prototype.lastIndexOf=function(r,i,n){return hr(this,r,i,n,!1)};function hi(e,r,i,n){i=Number(i)||0;var t=e.length-i;n?(n=Number(n),n>t&&(n=t)):n=t;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var a=parseInt(r.substr(u*2,2),16);if(isNaN(a))return u;e[i+u]=a}return u}function ci(e,r,i,n){return N(M(r,e.length-i),e,i,n)}function cr(e,r,i,n){return N(Ii(r),e,i,n)}function pi(e,r,i,n){return cr(e,r,i,n)}function si(e,r,i,n){return N(xr(r),e,i,n)}function li(e,r,i,n){return N(_i(r,e.length-i),e,i,n)}f.prototype.write=function(r,i,n,t){if(i===void 0)t="utf8",n=this.length,i=0;else if(n===void 0&&typeof i=="string")t=i,n=this.length,i=0;else if(isFinite(i))i=i|0,isFinite(n)?(n=n|0,t===void 0&&(t="utf8")):(t=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-i;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return hi(this,r,i,n);case"utf8":case"utf-8":return ci(this,r,i,n);case"ascii":return cr(this,r,i,n);case"latin1":case"binary":return pi(this,r,i,n);case"base64":return si(this,r,i,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return li(this,r,i,n);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function wi(e,r,i){return r===0&&i===e.length?er(e):er(e.slice(r,i))}function pr(e,r,i){i=Math.min(e.length,i);for(var n=[],t=r;t<i;){var o=e[t],u=null,a=o>239?4:o>223?3:o>191?2:1;if(t+a<=i){var h,p,s,c;switch(a){case 1:o<128&&(u=o);break;case 2:h=e[t+1],(h&192)===128&&(c=(o&31)<<6|h&63,c>127&&(u=c));break;case 3:h=e[t+1],p=e[t+2],(h&192)===128&&(p&192)===128&&(c=(o&15)<<12|(h&63)<<6|p&63,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:h=e[t+1],p=e[t+2],s=e[t+3],(h&192)===128&&(p&192)===128&&(s&192)===128&&(c=(o&15)<<18|(h&63)<<12|(p&63)<<6|s&63,c>65535&&c<1114112&&(u=c))}}u===null?(u=65533,a=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),t+=a}return xi(n)}var tr=4096;function xi(e){var r=e.length;if(r<=tr)return String.fromCharCode.apply(String,e);for(var i="",n=0;n<r;)i+=String.fromCharCode.apply(String,e.slice(n,n+=tr));return i}function Ei(e,r,i){var n="";i=Math.min(e.length,i);for(var t=r;t<i;++t)n+=String.fromCharCode(e[t]&127);return n}function mi(e,r,i){var n="";i=Math.min(e.length,i);for(var t=r;t<i;++t)n+=String.fromCharCode(e[t]);return n}function yi(e,r,i){var n=e.length;(!r||r<0)&&(r=0),(!i||i<0||i>n)&&(i=n);for(var t="",o=r;o<i;++o)t+=vi(e[o]);return t}function gi(e,r,i){for(var n=e.slice(r,i),t="",o=0;o<n.length;o+=2)t+=String.fromCharCode(n[o]+n[o+1]*256);return t}f.prototype.slice=function(r,i){var n=this.length;r=~~r,i=i===void 0?n:~~i,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),i<0?(i+=n,i<0&&(i=0)):i>n&&(i=n),i<r&&(i=r);var t;if(f.TYPED_ARRAY_SUPPORT)t=this.subarray(r,i),t.__proto__=f.prototype;else{var o=i-r;t=new f(o,void 0);for(var u=0;u<o;++u)t[u]=this[u+r]}return t};function l(e,r,i){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>i)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function(r,i,n){r=r|0,i=i|0,n||l(r,i,this.length);for(var t=this[r],o=1,u=0;++u<i&&(o*=256);)t+=this[r+u]*o;return t};f.prototype.readUIntBE=function(r,i,n){r=r|0,i=i|0,n||l(r,i,this.length);for(var t=this[r+--i],o=1;i>0&&(o*=256);)t+=this[r+--i]*o;return t};f.prototype.readUInt8=function(r,i){return i||l(r,1,this.length),this[r]};f.prototype.readUInt16LE=function(r,i){return i||l(r,2,this.length),this[r]|this[r+1]<<8};f.prototype.readUInt16BE=function(r,i){return i||l(r,2,this.length),this[r]<<8|this[r+1]};f.prototype.readUInt32LE=function(r,i){return i||l(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};f.prototype.readUInt32BE=function(r,i){return i||l(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};f.prototype.readIntLE=function(r,i,n){r=r|0,i=i|0,n||l(r,i,this.length);for(var t=this[r],o=1,u=0;++u<i&&(o*=256);)t+=this[r+u]*o;return o*=128,t>=o&&(t-=Math.pow(2,8*i)),t};f.prototype.readIntBE=function(r,i,n){r=r|0,i=i|0,n||l(r,i,this.length);for(var t=i,o=1,u=this[r+--t];t>0&&(o*=256);)u+=this[r+--t]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*i)),u};f.prototype.readInt8=function(r,i){return i||l(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};f.prototype.readInt16LE=function(r,i){i||l(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};f.prototype.readInt16BE=function(r,i){i||l(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};f.prototype.readInt32LE=function(r,i){return i||l(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};f.prototype.readInt32BE=function(r,i){return i||l(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};f.prototype.readFloatLE=function(r,i){return i||l(r,4,this.length),L(this,r,!0,23,4)};f.prototype.readFloatBE=function(r,i){return i||l(r,4,this.length),L(this,r,!1,23,4)};f.prototype.readDoubleLE=function(r,i){return i||l(r,8,this.length),L(this,r,!0,52,8)};f.prototype.readDoubleBE=function(r,i){return i||l(r,8,this.length),L(this,r,!1,52,8)};function w(e,r,i,n,t,o){if(!g(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<o)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}f.prototype.writeUIntLE=function(r,i,n,t){if(r=+r,i=i|0,n=n|0,!t){var o=Math.pow(2,8*n)-1;w(this,r,i,n,o,0)}var u=1,a=0;for(this[i]=r&255;++a<n&&(u*=256);)this[i+a]=r/u&255;return i+n};f.prototype.writeUIntBE=function(r,i,n,t){if(r=+r,i=i|0,n=n|0,!t){var o=Math.pow(2,8*n)-1;w(this,r,i,n,o,0)}var u=n-1,a=1;for(this[i+u]=r&255;--u>=0&&(a*=256);)this[i+u]=r/a&255;return i+n};f.prototype.writeUInt8=function(r,i,n){return r=+r,i=i|0,n||w(this,r,i,1,255,0),f.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[i]=r&255,i+1};function D(e,r,i,n){r<0&&(r=65535+r+1);for(var t=0,o=Math.min(e.length-i,2);t<o;++t)e[i+t]=(r&255<<8*(n?t:1-t))>>>(n?t:1-t)*8}f.prototype.writeUInt16LE=function(r,i,n){return r=+r,i=i|0,n||w(this,r,i,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):D(this,r,i,!0),i+2};f.prototype.writeUInt16BE=function(r,i,n){return r=+r,i=i|0,n||w(this,r,i,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):D(this,r,i,!1),i+2};function k(e,r,i,n){r<0&&(r=4294967295+r+1);for(var t=0,o=Math.min(e.length-i,4);t<o;++t)e[i+t]=r>>>(n?t:3-t)*8&255}f.prototype.writeUInt32LE=function(r,i,n){return r=+r,i=i|0,n||w(this,r,i,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[i+3]=r>>>24,this[i+2]=r>>>16,this[i+1]=r>>>8,this[i]=r&255):k(this,r,i,!0),i+4};f.prototype.writeUInt32BE=function(r,i,n){return r=+r,i=i|0,n||w(this,r,i,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):k(this,r,i,!1),i+4};f.prototype.writeIntLE=function(r,i,n,t){if(r=+r,i=i|0,!t){var o=Math.pow(2,8*n-1);w(this,r,i,n,o-1,-o)}var u=0,a=1,h=0;for(this[i]=r&255;++u<n&&(a*=256);)r<0&&h===0&&this[i+u-1]!==0&&(h=1),this[i+u]=(r/a>>0)-h&255;return i+n};f.prototype.writeIntBE=function(r,i,n,t){if(r=+r,i=i|0,!t){var o=Math.pow(2,8*n-1);w(this,r,i,n,o-1,-o)}var u=n-1,a=1,h=0;for(this[i+u]=r&255;--u>=0&&(a*=256);)r<0&&h===0&&this[i+u+1]!==0&&(h=1),this[i+u]=(r/a>>0)-h&255;return i+n};f.prototype.writeInt8=function(r,i,n){return r=+r,i=i|0,n||w(this,r,i,1,127,-128),f.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[i]=r&255,i+1};f.prototype.writeInt16LE=function(r,i,n){return r=+r,i=i|0,n||w(this,r,i,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):D(this,r,i,!0),i+2};f.prototype.writeInt16BE=function(r,i,n){return r=+r,i=i|0,n||w(this,r,i,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):D(this,r,i,!1),i+2};f.prototype.writeInt32LE=function(r,i,n){return r=+r,i=i|0,n||w(this,r,i,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8,this[i+2]=r>>>16,this[i+3]=r>>>24):k(this,r,i,!0),i+4};f.prototype.writeInt32BE=function(r,i,n){return r=+r,i=i|0,n||w(this,r,i,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),f.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):k(this,r,i,!1),i+4};function sr(e,r,i,n,t,o){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function lr(e,r,i,n,t){return t||sr(e,r,i,4,34028234663852886e22,-34028234663852886e22),mr(e,r,i,n,23,4),i+4}f.prototype.writeFloatLE=function(r,i,n){return lr(this,r,i,!0,n)};f.prototype.writeFloatBE=function(r,i,n){return lr(this,r,i,!1,n)};function wr(e,r,i,n,t){return t||sr(e,r,i,8,17976931348623157e292,-17976931348623157e292),mr(e,r,i,n,52,8),i+8}f.prototype.writeDoubleLE=function(r,i,n){return wr(this,r,i,!0,n)};f.prototype.writeDoubleBE=function(r,i,n){return wr(this,r,i,!1,n)};f.prototype.copy=function(r,i,n,t){if(n||(n=0),!t&&t!==0&&(t=this.length),i>=r.length&&(i=r.length),i||(i=0),t>0&&t<n&&(t=n),t===n||r.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-i<t-n&&(t=r.length-i+n);var o=t-n,u;if(this===r&&n<i&&i<t)for(u=o-1;u>=0;--u)r[u+i]=this[u+n];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(u=0;u<o;++u)r[u+i]=this[u+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),i);return o};f.prototype.fill=function(r,i,n,t){if(typeof r=="string"){if(typeof i=="string"?(t=i,i=0,n=this.length):typeof n=="string"&&(t=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!f.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(i<0||this.length<i||this.length<n)throw new RangeError("Out of range index");if(n<=i)return this;i=i>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var u;if(typeof r=="number")for(u=i;u<n;++u)this[u]=r;else{var a=g(r)?r:M(new f(r,t).toString()),h=a.length;for(u=0;u<n-i;++u)this[u+i]=a[u%h]}return this};var Ai=/[^+\/0-9A-Za-z-_]/g;function Ti(e){if(e=Ri(e).replace(Ai,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Ri(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function vi(e){return e<16?"0"+e.toString(16):e.toString(16)}function M(e,r){r=r||1/0;for(var i,n=e.length,t=null,o=[],u=0;u<n;++u){if(i=e.charCodeAt(u),i>55295&&i<57344){if(!t){if(i>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}t=i;continue}if(i<56320){(r-=3)>-1&&o.push(239,191,189),t=i;continue}i=(t-55296<<10|i-56320)+65536}else t&&(r-=3)>-1&&o.push(239,191,189);if(t=null,i<128){if((r-=1)<0)break;o.push(i)}else if(i<2048){if((r-=2)<0)break;o.push(i>>6|192,i&63|128)}else if(i<65536){if((r-=3)<0)break;o.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((r-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return o}function Ii(e){for(var r=[],i=0;i<e.length;++i)r.push(e.charCodeAt(i)&255);return r}function _i(e,r){for(var i,n,t,o=[],u=0;u<e.length&&!((r-=2)<0);++u)i=e.charCodeAt(u),n=i>>8,t=i%256,o.push(t),o.push(n);return o}function xr(e){return ii(Ti(e))}function N(e,r,i,n){for(var t=0;t<n&&!(t+i>=r.length||t>=e.length);++t)r[t+i]=e[t];return t}function Ui(e){return e!==e}function di(e){return e!=null&&(!!e._isBuffer||Er(e)||Bi(e))}function Er(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Bi(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&Er(e.slice(0,0))}function L(e,r,i,n,t){var o,u,a=t*8-n-1,h=(1<<a)-1,p=h>>1,s=-7,c=i?t-1:0,m=i?-1:1,x=e[r+c];for(c+=m,o=x&(1<<-s)-1,x>>=-s,s+=a;s>0;o=o*256+e[r+c],c+=m,s-=8);for(u=o&(1<<-s)-1,o>>=-s,s+=n;s>0;u=u*256+e[r+c],c+=m,s-=8);if(o===0)o=1-p;else{if(o===h)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,n),o=o-p}return(x?-1:1)*u*Math.pow(2,o-n)}function mr(e,r,i,n,t,o){var u,a,h,p=o*8-t-1,s=(1<<p)-1,c=s>>1,m=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=n?0:o-1,d=n?1:-1,yr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=s):(u=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-u))<1&&(u--,h*=2),u+c>=1?r+=m/h:r+=m*Math.pow(2,1-c),r*h>=2&&(u++,h/=2),u+c>=s?(a=0,u=s):u+c>=1?(a=(r*h-1)*Math.pow(2,t),u=u+c):(a=r*Math.pow(2,c-1)*Math.pow(2,t),u=0));t>=8;e[i+x]=a&255,x+=d,a/=256,t-=8);for(u=u<<t|a,p+=t;p>0;e[i+x]=u&255,x+=d,u/=256,p-=8);e[i+x-d]|=yr*128}var Si={Critical:"CRITICAL",Warning:"WARNING"},V=class e{constructor(){W(this,"errors");W(this,"path");this.errors=[],this.path=[]}add(r){this.errors.push(q(X({},r),{path:[...this.path]}))}scope(r){this.path.push(r)}unscope(){this.path.pop()}getBySeverity(r){return this.errors.filter(i=>i.severity===r)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let r=new e;return r.errors=[...this.errors],r.path=[...this.path],r}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(r=>({severity:r.severity,path:r.path!=null?this.pathToStringArray(r.path):void 0,message:r.message}))}pathToStringArray(r){let i=[];for(let n of r){if(typeof n=="string"){i.push(n);continue}i[i.length-1]+=`[${n.index}]`}return i}};0&&(module.exports={ErrorReporter,Severity});
|
|
2
|
-
/*! Bundled license information:
|
|
3
|
-
|
|
4
|
-
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
5
|
-
(*!
|
|
6
|
-
* The buffer module from node.js, for the browser.
|
|
7
|
-
*
|
|
8
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
9
|
-
* @license MIT
|
|
10
|
-
*)
|
|
11
|
-
*/
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
declare const Severity: {
|
|
2
|
-
readonly Critical: "CRITICAL";
|
|
3
|
-
readonly Warning: "WARNING";
|
|
4
|
-
};
|
|
5
|
-
interface Error_ {
|
|
6
|
-
severity: "CRITICAL" | "WARNING";
|
|
7
|
-
path: string[] | undefined;
|
|
8
|
-
message: string;
|
|
9
|
-
}
|
|
10
|
-
declare namespace ErrorReporter {
|
|
11
|
-
type Path = readonly PathItem[];
|
|
12
|
-
type PathItem = string | ArrayPathItem;
|
|
13
|
-
type Severity = typeof Severity[keyof typeof Severity];
|
|
14
|
-
interface ArrayPathItem {
|
|
15
|
-
index: number;
|
|
16
|
-
}
|
|
17
|
-
interface Error {
|
|
18
|
-
path?: Path;
|
|
19
|
-
severity: Severity;
|
|
20
|
-
message: string;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
declare class ErrorReporter {
|
|
24
|
-
private errors;
|
|
25
|
-
private path;
|
|
26
|
-
constructor();
|
|
27
|
-
add(err: Omit<ErrorReporter.Error, "path">): void;
|
|
28
|
-
scope(path: ErrorReporter.PathItem): void;
|
|
29
|
-
unscope(): void;
|
|
30
|
-
getBySeverity(severity: ErrorReporter.Severity): ErrorReporter.Error[];
|
|
31
|
-
empty(): boolean;
|
|
32
|
-
size(): number;
|
|
33
|
-
clone(): ErrorReporter;
|
|
34
|
-
reset(): void;
|
|
35
|
-
toDynamicSnippetErrors(): Error_[];
|
|
36
|
-
private pathToStringArray;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export { ErrorReporter, Severity };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { NameAndWireValue, dynamic } from '@fern-fern/ir-sdk/api';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A discriminated union type instance that can be converted into a language-specific AST node.
|
|
5
|
-
*/
|
|
6
|
-
interface DiscriminatedUnionTypeInstance {
|
|
7
|
-
discriminantValue: NameAndWireValue;
|
|
8
|
-
singleDiscriminatedUnionType: dynamic.SingleDiscriminatedUnionType;
|
|
9
|
-
value: unknown;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type { DiscriminatedUnionTypeInstance };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as i,m as n}from"./chunk-2AZXIWKY.js";i();n();
|
package/esm/Result.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { D as DynamicSnippetsGeneratorContext } from './DynamicSnippetsGeneratorContext-Dyk9qWMy.js';
|
|
2
|
-
import { ErrorReporter } from './context/ErrorReporter.js';
|
|
3
|
-
import { dynamic } from '@fern-fern/ir-sdk/api';
|
|
4
|
-
import '@fern-api/browser-compatible-base-generator';
|
|
5
|
-
import '@fern-api/go-ast';
|
|
6
|
-
import './TypeInstance.js';
|
|
7
|
-
import './DiscriminatedUnionTypeInstance.js';
|
|
8
|
-
|
|
9
|
-
declare class Result {
|
|
10
|
-
reporter: ErrorReporter | undefined;
|
|
11
|
-
snippet: string | undefined;
|
|
12
|
-
err: Error | undefined;
|
|
13
|
-
constructor();
|
|
14
|
-
update({ context, snippet }: {
|
|
15
|
-
context: DynamicSnippetsGeneratorContext;
|
|
16
|
-
snippet: string;
|
|
17
|
-
}): void;
|
|
18
|
-
getResponseOrThrow({ endpoint }: {
|
|
19
|
-
endpoint: dynamic.EndpointLocation;
|
|
20
|
-
}): dynamic.EndpointSnippetResponse;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { Result };
|
package/esm/Result.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-5TA7XQOD.js";import"./chunk-2AZXIWKY.js";export{a as Result};
|
package/esm/Scope.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
declare const Scope: {
|
|
2
|
-
readonly PathParameters: "pathParameters";
|
|
3
|
-
readonly QueryParameters: "queryParameters";
|
|
4
|
-
readonly Headers: "headers";
|
|
5
|
-
readonly RequestBody: "requestBody";
|
|
6
|
-
};
|
|
7
|
-
declare type Scope = typeof Scope[keyof typeof Scope];
|
|
8
|
-
|
|
9
|
-
export { Scope };
|
package/esm/Scope.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-IIKN6XQS.js";import"./chunk-2AZXIWKY.js";export{a as Scope};
|
package/esm/TypeInstance.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { NameAndWireValue, dynamic } from '@fern-fern/ir-sdk/api';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A type instance that can be converted into a language-specific AST node.
|
|
5
|
-
*
|
|
6
|
-
* The 'type' and 'value' are used to convert the AST node itself, and the name
|
|
7
|
-
* is (optionally) used within the dynamic snippet, e.g. for named fields.
|
|
8
|
-
*/
|
|
9
|
-
interface TypeInstance {
|
|
10
|
-
name: NameAndWireValue;
|
|
11
|
-
typeReference: dynamic.TypeReference;
|
|
12
|
-
value: unknown;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type { TypeInstance };
|
package/esm/TypeInstance.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as e,m as n}from"./chunk-2AZXIWKY.js";e();n();
|
package/esm/chunk-2AZXIWKY.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var Tr=Object.create;var S=Object.defineProperty,Rr=Object.defineProperties,_r=Object.getOwnPropertyDescriptor,Ir=Object.getOwnPropertyDescriptors,vr=Object.getOwnPropertyNames,P=Object.getOwnPropertySymbols,Ur=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var W=(n,r,i)=>r in n?S(n,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[r]=i,Yi=(n,r)=>{for(var i in r||(r={}))H.call(r,i)&&W(n,i,r[i]);if(P)for(var i of P(r))q.call(r,i)&&W(n,i,r[i]);return n},Si=(n,r)=>Rr(n,Ir(r));var Pi=n=>typeof n=="symbol"?n:n+"",Mi=(n,r)=>{var i={};for(var e in n)H.call(n,e)&&r.indexOf(e)<0&&(i[e]=n[e]);if(n!=null&&P)for(var e of P(n))r.indexOf(e)<0&&q.call(n,e)&&(i[e]=n[e]);return i};var V=(n,r)=>()=>(n&&(r=n(n=0)),r);var Di=(n,r)=>()=>(r||n((r={exports:{}}).exports,r),r.exports),Ci=(n,r)=>{for(var i in r)S(n,i,{get:r[i],enumerable:!0})},Z=(n,r,i,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of vr(r))!H.call(n,t)&&t!==i&&S(n,t,{get:()=>r[t],enumerable:!(e=_r(r,t))||e.enumerable});return n};var ki=(n,r,i)=>(i=n!=null?Tr(Ur(n)):{},Z(r||!n||!n.__esModule?S(i,"default",{value:n,enumerable:!0}):i,n)),Ni=n=>Z(S({},"__esModule",{value:!0}),n);var Li=(n,r,i)=>W(n,typeof r!="symbol"?r+"":r,i);function $(){throw new Error("setTimeout has not been defined")}function b(){throw new Error("clearTimeout has not been defined")}function j(n){if(R===setTimeout)return setTimeout(n,0);if((R===$||!R)&&setTimeout)return R=setTimeout,setTimeout(n,0);try{return R(n,0)}catch(r){try{return R.call(null,n,0)}catch(i){return R.call(this,n,0)}}}function Br(n){if(_===clearTimeout)return clearTimeout(n);if((_===b||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(n);try{return _(n)}catch(r){try{return _.call(null,n)}catch(i){return _.call(this,n)}}}function dr(){!Y||!I||(Y=!1,I.length?y=I.concat(y):M=-1,y.length&&rr())}function rr(){if(!Y){var n=j(dr);Y=!0;for(var r=y.length;r;){for(I=y,y=[];++M<r;)I&&I[M].run();M=-1,r=y.length}I=null,Y=!1,Br(n)}}function Yr(n){var r=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)r[i-1]=arguments[i];y.push(new ir(n,r)),y.length===1&&!Y&&j(rr)}function ir(n,r){this.fun=n,this.array=r}function v(){}function Qr(n){throw new Error("process.binding is not supported")}function Xr(){return"/"}function qr(n){throw new Error("process.chdir is not supported")}function Zr(){return 0}function $r(n){var r=Kr.call(d)*.001,i=Math.floor(r),e=Math.floor(r%1*1e9);return n&&(i=i-n[0],e=e-n[1],e<0&&(i--,e+=1e9)),[i,e]}function jr(){var n=new Date,r=n-br;return r/1e3}var R,_,y,Y,I,M,Sr,Pr,Mr,Dr,Cr,kr,Nr,Lr,Fr,Wr,Hr,Vr,zr,Gr,Jr,Or,d,Kr,br,nr,K,z=V(()=>{"use strict";R=$,_=b;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(_=clearTimeout);y=[],Y=!1,M=-1;ir.prototype.run=function(){this.fun.apply(null,this.array)};Sr="browser",Pr="browser",Mr=!0,Dr={},Cr=[],kr="",Nr={},Lr={},Fr={};Wr=v,Hr=v,Vr=v,zr=v,Gr=v,Jr=v,Or=v;d=globalThis.performance||{},Kr=d.now||d.mozNow||d.msNow||d.oNow||d.webkitNow||function(){return new Date().getTime()};br=new Date;nr={nextTick:Yr,title:Sr,browser:Mr,env:Dr,argv:Cr,version:kr,versions:Nr,on:Wr,addListener:Hr,once:Vr,off:zr,removeListener:Gr,removeAllListeners:Jr,emit:Or,binding:Qr,cwd:Xr,chdir:qr,umask:Zr,hrtime:$r,platform:Pr,release:Lr,config:Fr,uptime:jr},K={};Object.keys(K).forEach(n=>{let r=n.split("."),i=nr;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?i[t]=K[n]:i=i[t]||(i[t]={})}})});function ur(){O=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,i=n.length;r<i;++r)A[r]=n[r],E[n.charCodeAt(r)]=r;E[45]=62,E[95]=63}function ii(n){O||ur();var r,i,e,t,f,u,h=n.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f=n[h-2]==="="?2:n[h-1]==="="?1:0,u=new ri(h*3/4-f),e=f>0?h-4:h;var a=0;for(r=0,i=0;r<e;r+=4,i+=3)t=E[n.charCodeAt(r)]<<18|E[n.charCodeAt(r+1)]<<12|E[n.charCodeAt(r+2)]<<6|E[n.charCodeAt(r+3)],u[a++]=t>>16&255,u[a++]=t>>8&255,u[a++]=t&255;return f===2?(t=E[n.charCodeAt(r)]<<2|E[n.charCodeAt(r+1)]>>4,u[a++]=t&255):f===1&&(t=E[n.charCodeAt(r)]<<10|E[n.charCodeAt(r+1)]<<4|E[n.charCodeAt(r+2)]>>2,u[a++]=t>>8&255,u[a++]=t&255),u}function ni(n){return A[n>>18&63]+A[n>>12&63]+A[n>>6&63]+A[n&63]}function ei(n,r,i){for(var e,t=[],f=r;f<i;f+=3)e=(n[f]<<16)+(n[f+1]<<8)+n[f+2],t.push(ni(e));return t.join("")}function er(n){O||ur();for(var r,i=n.length,e=i%3,t="",f=[],u=16383,h=0,a=i-e;h<a;h+=u)f.push(ei(n,h,h+u>a?a:h+u));return e===1?(r=n[i-1],t+=A[r>>2],t+=A[r<<4&63],t+="=="):e===2&&(r=(n[i-2]<<8)+n[i-1],t+=A[r>>10],t+=A[r>>4&63],t+=A[r<<2&63],t+="="),f.push(t),f.join("")}function D(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(n,r){if(D()<r)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(r),n.__proto__=o.prototype):(n===null&&(n=new o(r)),n.length=r),n}function o(n,r,i){if(!o.TYPED_ARRAY_SUPPORT&&!(this instanceof o))return new o(n,r,i);if(typeof n=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return Q(this,n)}return or(this,n,r,i)}function or(n,r,i,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&r instanceof ArrayBuffer?ui(n,r,i,e):typeof r=="string"?fi(n,r,i):oi(n,r)}function hr(n){if(typeof n!="number")throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative')}function ti(n,r,i,e){return hr(r),r<=0?T(n,r):i!==void 0?typeof e=="string"?T(n,r).fill(i,e):T(n,r).fill(i):T(n,r)}function Q(n,r){if(hr(r),n=T(n,r<0?0:X(r)|0),!o.TYPED_ARRAY_SUPPORT)for(var i=0;i<r;++i)n[i]=0;return n}function fi(n,r,i){if((typeof i!="string"||i==="")&&(i="utf8"),!o.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var e=ar(r,i)|0;n=T(n,e);var t=n.write(r,i);return t!==e&&(n=n.slice(0,t)),n}function G(n,r){var i=r.length<0?0:X(r.length)|0;n=T(n,i);for(var e=0;e<i;e+=1)n[e]=r[e]&255;return n}function ui(n,r,i,e){if(r.byteLength,i<0||r.byteLength<i)throw new RangeError("'offset' is out of bounds");if(r.byteLength<i+(e||0))throw new RangeError("'length' is out of bounds");return i===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,i):r=new Uint8Array(r,i,e),o.TYPED_ARRAY_SUPPORT?(n=r,n.__proto__=o.prototype):n=G(n,r),n}function oi(n,r){if(g(r)){var i=X(r.length)|0;return n=T(n,i),n.length===0||r.copy(n,0,0,i),n}if(r){if(typeof ArrayBuffer!="undefined"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ui(r.length)?T(n,0):G(n,r);if(r.type==="Buffer"&&Array.isArray(r.data))return G(n,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function X(n){if(n>=D())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+D().toString(16)+" bytes");return n|0}function g(n){return!!(n!=null&&n._isBuffer)}function ar(n,r){if(g(n))return n.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var i=n.length;if(i===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return C(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Er(n).length;default:if(e)return C(n).length;r=(""+r).toLowerCase(),e=!0}}function hi(n,r,i){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,r>>>=0,i<=r))return"";for(n||(n="utf8");;)switch(n){case"hex":return Ai(this,r,i);case"utf8":case"utf-8":return pr(this,r,i);case"ascii":return Ei(this,r,i);case"latin1":case"binary":return mi(this,r,i);case"base64":return wi(this,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gi(this,r,i);default:if(e)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),e=!0}}function U(n,r,i){var e=n[r];n[r]=n[i],n[i]=e}function cr(n,r,i,e,t){if(n.length===0)return-1;if(typeof i=="string"?(e=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=t?0:n.length-1),i<0&&(i=n.length+i),i>=n.length){if(t)return-1;i=n.length-1}else if(i<0)if(t)i=0;else return-1;if(typeof r=="string"&&(r=o.from(r,e)),g(r))return r.length===0?-1:tr(n,r,i,e,t);if(typeof r=="number")return r=r&255,o.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(n,r,i):Uint8Array.prototype.lastIndexOf.call(n,r,i):tr(n,[r],i,e,t);throw new TypeError("val must be string, number or Buffer")}function tr(n,r,i,e,t){var f=1,u=n.length,h=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(n.length<2||r.length<2)return-1;f=2,u/=2,h/=2,i/=2}function a(x,B){return f===1?x[B]:x.readUInt16BE(B*f)}var l;if(t){var p=-1;for(l=i;l<u;l++)if(a(n,l)===a(r,p===-1?0:l-p)){if(p===-1&&(p=l),l-p+1===h)return p*f}else p!==-1&&(l-=l-p),p=-1}else for(i+h>u&&(i=u-h),l=i;l>=0;l--){for(var c=!0,m=0;m<h;m++)if(a(n,l+m)!==a(r,m)){c=!1;break}if(c)return l}return-1}function ai(n,r,i,e){i=Number(i)||0;var t=n.length-i;e?(e=Number(e),e>t&&(e=t)):e=t;var f=r.length;if(f%2!==0)throw new TypeError("Invalid hex string");e>f/2&&(e=f/2);for(var u=0;u<e;++u){var h=parseInt(r.substr(u*2,2),16);if(isNaN(h))return u;n[i+u]=h}return u}function ci(n,r,i,e){return L(C(r,n.length-i),n,i,e)}function lr(n,r,i,e){return L(Ii(r),n,i,e)}function li(n,r,i,e){return lr(n,r,i,e)}function pi(n,r,i,e){return L(Er(r),n,i,e)}function si(n,r,i,e){return L(vi(r,n.length-i),n,i,e)}function wi(n,r,i){return r===0&&i===n.length?er(n):er(n.slice(r,i))}function pr(n,r,i){i=Math.min(n.length,i);for(var e=[],t=r;t<i;){var f=n[t],u=null,h=f>239?4:f>223?3:f>191?2:1;if(t+h<=i){var a,l,p,c;switch(h){case 1:f<128&&(u=f);break;case 2:a=n[t+1],(a&192)===128&&(c=(f&31)<<6|a&63,c>127&&(u=c));break;case 3:a=n[t+1],l=n[t+2],(a&192)===128&&(l&192)===128&&(c=(f&15)<<12|(a&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:a=n[t+1],l=n[t+2],p=n[t+3],(a&192)===128&&(l&192)===128&&(p&192)===128&&(c=(f&15)<<18|(a&63)<<12|(l&63)<<6|p&63,c>65535&&c<1114112&&(u=c))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=h}return xi(e)}function xi(n){var r=n.length;if(r<=fr)return String.fromCharCode.apply(String,n);for(var i="",e=0;e<r;)i+=String.fromCharCode.apply(String,n.slice(e,e+=fr));return i}function Ei(n,r,i){var e="";i=Math.min(n.length,i);for(var t=r;t<i;++t)e+=String.fromCharCode(n[t]&127);return e}function mi(n,r,i){var e="";i=Math.min(n.length,i);for(var t=r;t<i;++t)e+=String.fromCharCode(n[t]);return e}function Ai(n,r,i){var e=n.length;(!r||r<0)&&(r=0),(!i||i<0||i>e)&&(i=e);for(var t="",f=r;f<i;++f)t+=_i(n[f]);return t}function gi(n,r,i){for(var e=n.slice(r,i),t="",f=0;f<e.length;f+=2)t+=String.fromCharCode(e[f]+e[f+1]*256);return t}function s(n,r,i){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+r>i)throw new RangeError("Trying to access beyond buffer length")}function w(n,r,i,e,t,f){if(!g(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<f)throw new RangeError('"value" argument is out of bounds');if(i+e>n.length)throw new RangeError("Index out of range")}function k(n,r,i,e){r<0&&(r=65535+r+1);for(var t=0,f=Math.min(n.length-i,2);t<f;++t)n[i+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}function N(n,r,i,e){r<0&&(r=4294967295+r+1);for(var t=0,f=Math.min(n.length-i,4);t<f;++t)n[i+t]=r>>>(e?t:3-t)*8&255}function sr(n,r,i,e,t,f){if(i+e>n.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function wr(n,r,i,e,t){return t||sr(n,r,i,4,34028234663852886e22,-34028234663852886e22),Ar(n,r,i,e,23,4),i+4}function xr(n,r,i,e,t){return t||sr(n,r,i,8,17976931348623157e292,-17976931348623157e292),Ar(n,r,i,e,52,8),i+8}function Ti(n){if(n=Ri(n).replace(yi,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function Ri(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function _i(n){return n<16?"0"+n.toString(16):n.toString(16)}function C(n,r){r=r||1/0;for(var i,e=n.length,t=null,f=[],u=0;u<e;++u){if(i=n.charCodeAt(u),i>55295&&i<57344){if(!t){if(i>56319){(r-=3)>-1&&f.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&f.push(239,191,189);continue}t=i;continue}if(i<56320){(r-=3)>-1&&f.push(239,191,189),t=i;continue}i=(t-55296<<10|i-56320)+65536}else t&&(r-=3)>-1&&f.push(239,191,189);if(t=null,i<128){if((r-=1)<0)break;f.push(i)}else if(i<2048){if((r-=2)<0)break;f.push(i>>6|192,i&63|128)}else if(i<65536){if((r-=3)<0)break;f.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((r-=4)<0)break;f.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return f}function Ii(n){for(var r=[],i=0;i<n.length;++i)r.push(n.charCodeAt(i)&255);return r}function vi(n,r){for(var i,e,t,f=[],u=0;u<n.length&&!((r-=2)<0);++u)i=n.charCodeAt(u),e=i>>8,t=i%256,f.push(t),f.push(e);return f}function Er(n){return ii(Ti(n))}function L(n,r,i,e){for(var t=0;t<e&&!(t+i>=r.length||t>=n.length);++t)r[t+i]=n[t];return t}function Ui(n){return n!==n}function Bi(n){return n!=null&&(!!n._isBuffer||mr(n)||di(n))}function mr(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function di(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&mr(n.slice(0,0))}function F(n,r,i,e,t){var f,u,h=t*8-e-1,a=(1<<h)-1,l=a>>1,p=-7,c=i?t-1:0,m=i?-1:1,x=n[r+c];for(c+=m,f=x&(1<<-p)-1,x>>=-p,p+=h;p>0;f=f*256+n[r+c],c+=m,p-=8);for(u=f&(1<<-p)-1,f>>=-p,p+=e;p>0;u=u*256+n[r+c],c+=m,p-=8);if(f===0)f=1-l;else{if(f===a)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,e),f=f-l}return(x?-1:1)*u*Math.pow(2,f-e)}function Ar(n,r,i,e,t,f){var u,h,a,l=f*8-t-1,p=(1<<l)-1,c=p>>1,m=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=e?0:f-1,B=e?1:-1,yr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,u=p):(u=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-u))<1&&(u--,a*=2),u+c>=1?r+=m/a:r+=m*Math.pow(2,1-c),r*a>=2&&(u++,a/=2),u+c>=p?(h=0,u=p):u+c>=1?(h=(r*a-1)*Math.pow(2,t),u=u+c):(h=r*Math.pow(2,c-1)*Math.pow(2,t),u=0));t>=8;n[i+x]=h&255,x+=B,h/=256,t-=8);for(u=u<<t|h,l+=t;l>0;n[i+x]=u&255,x+=B,u/=256,l-=8);n[i+x-B]|=yr*128}var A,E,ri,O,fr,yi,gr=V(()=>{"use strict";z();J();A=[],E=[],ri=typeof Uint8Array!="undefined"?Uint8Array:Array,O=!1;o.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;o.poolSize=8192;o._augment=function(n){return n.__proto__=o.prototype,n};o.from=function(n,r,i){return or(null,n,r,i)};o.kMaxLength=D();o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&o[Symbol.species]);o.alloc=function(n,r,i){return ti(null,n,r,i)};o.allocUnsafe=function(n){return Q(null,n)};o.allocUnsafeSlow=function(n){return Q(null,n)};o.isBuffer=Bi;o.compare=function(r,i){if(!g(r)||!g(i))throw new TypeError("Arguments must be Buffers");if(r===i)return 0;for(var e=r.length,t=i.length,f=0,u=Math.min(e,t);f<u;++f)if(r[f]!==i[f]){e=r[f],t=i[f];break}return e<t?-1:t<e?1:0};o.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};o.concat=function(r,i){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);var e;if(i===void 0)for(i=0,e=0;e<r.length;++e)i+=r[e].length;var t=o.allocUnsafe(i),f=0;for(e=0;e<r.length;++e){var u=r[e];if(!g(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,f),f+=u.length}return t};o.byteLength=ar;o.prototype._isBuffer=!0;o.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<r;i+=2)U(this,i,i+1);return this};o.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<r;i+=4)U(this,i,i+3),U(this,i+1,i+2);return this};o.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<r;i+=8)U(this,i,i+7),U(this,i+1,i+6),U(this,i+2,i+5),U(this,i+3,i+4);return this};o.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?pr(this,0,r):hi.apply(this,arguments)};o.prototype.equals=function(r){if(!g(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0};o.prototype.compare=function(r,i,e,t,f){if(!g(r))throw new TypeError("Argument must be a Buffer");if(i===void 0&&(i=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),f===void 0&&(f=this.length),i<0||e>r.length||t<0||f>this.length)throw new RangeError("out of range index");if(t>=f&&i>=e)return 0;if(t>=f)return-1;if(i>=e)return 1;if(i>>>=0,e>>>=0,t>>>=0,f>>>=0,this===r)return 0;for(var u=f-t,h=e-i,a=Math.min(u,h),l=this.slice(t,f),p=r.slice(i,e),c=0;c<a;++c)if(l[c]!==p[c]){u=l[c],h=p[c];break}return u<h?-1:h<u?1:0};o.prototype.includes=function(r,i,e){return this.indexOf(r,i,e)!==-1};o.prototype.indexOf=function(r,i,e){return cr(this,r,i,e,!0)};o.prototype.lastIndexOf=function(r,i,e){return cr(this,r,i,e,!1)};o.prototype.write=function(r,i,e,t){if(i===void 0)t="utf8",e=this.length,i=0;else if(e===void 0&&typeof i=="string")t=i,e=this.length,i=0;else if(isFinite(i))i=i|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-i;if((e===void 0||e>f)&&(e=f),r.length>0&&(e<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return ai(this,r,i,e);case"utf8":case"utf-8":return ci(this,r,i,e);case"ascii":return lr(this,r,i,e);case"latin1":case"binary":return li(this,r,i,e);case"base64":return pi(this,r,i,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return si(this,r,i,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};fr=4096;o.prototype.slice=function(r,i){var e=this.length;r=~~r,i=i===void 0?e:~~i,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),i<0?(i+=e,i<0&&(i=0)):i>e&&(i=e),i<r&&(i=r);var t;if(o.TYPED_ARRAY_SUPPORT)t=this.subarray(r,i),t.__proto__=o.prototype;else{var f=i-r;t=new o(f,void 0);for(var u=0;u<f;++u)t[u]=this[u+r]}return t};o.prototype.readUIntLE=function(r,i,e){r=r|0,i=i|0,e||s(r,i,this.length);for(var t=this[r],f=1,u=0;++u<i&&(f*=256);)t+=this[r+u]*f;return t};o.prototype.readUIntBE=function(r,i,e){r=r|0,i=i|0,e||s(r,i,this.length);for(var t=this[r+--i],f=1;i>0&&(f*=256);)t+=this[r+--i]*f;return t};o.prototype.readUInt8=function(r,i){return i||s(r,1,this.length),this[r]};o.prototype.readUInt16LE=function(r,i){return i||s(r,2,this.length),this[r]|this[r+1]<<8};o.prototype.readUInt16BE=function(r,i){return i||s(r,2,this.length),this[r]<<8|this[r+1]};o.prototype.readUInt32LE=function(r,i){return i||s(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};o.prototype.readUInt32BE=function(r,i){return i||s(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};o.prototype.readIntLE=function(r,i,e){r=r|0,i=i|0,e||s(r,i,this.length);for(var t=this[r],f=1,u=0;++u<i&&(f*=256);)t+=this[r+u]*f;return f*=128,t>=f&&(t-=Math.pow(2,8*i)),t};o.prototype.readIntBE=function(r,i,e){r=r|0,i=i|0,e||s(r,i,this.length);for(var t=i,f=1,u=this[r+--t];t>0&&(f*=256);)u+=this[r+--t]*f;return f*=128,u>=f&&(u-=Math.pow(2,8*i)),u};o.prototype.readInt8=function(r,i){return i||s(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};o.prototype.readInt16LE=function(r,i){i||s(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};o.prototype.readInt16BE=function(r,i){i||s(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};o.prototype.readInt32LE=function(r,i){return i||s(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};o.prototype.readInt32BE=function(r,i){return i||s(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};o.prototype.readFloatLE=function(r,i){return i||s(r,4,this.length),F(this,r,!0,23,4)};o.prototype.readFloatBE=function(r,i){return i||s(r,4,this.length),F(this,r,!1,23,4)};o.prototype.readDoubleLE=function(r,i){return i||s(r,8,this.length),F(this,r,!0,52,8)};o.prototype.readDoubleBE=function(r,i){return i||s(r,8,this.length),F(this,r,!1,52,8)};o.prototype.writeUIntLE=function(r,i,e,t){if(r=+r,i=i|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,i,e,f,0)}var u=1,h=0;for(this[i]=r&255;++h<e&&(u*=256);)this[i+h]=r/u&255;return i+e};o.prototype.writeUIntBE=function(r,i,e,t){if(r=+r,i=i|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,i,e,f,0)}var u=e-1,h=1;for(this[i+u]=r&255;--u>=0&&(h*=256);)this[i+u]=r/h&255;return i+e};o.prototype.writeUInt8=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,1,255,0),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[i]=r&255,i+1};o.prototype.writeUInt16LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):k(this,r,i,!0),i+2};o.prototype.writeUInt16BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):k(this,r,i,!1),i+2};o.prototype.writeUInt32LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[i+3]=r>>>24,this[i+2]=r>>>16,this[i+1]=r>>>8,this[i]=r&255):N(this,r,i,!0),i+4};o.prototype.writeUInt32BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):N(this,r,i,!1),i+4};o.prototype.writeIntLE=function(r,i,e,t){if(r=+r,i=i|0,!t){var f=Math.pow(2,8*e-1);w(this,r,i,e,f-1,-f)}var u=0,h=1,a=0;for(this[i]=r&255;++u<e&&(h*=256);)r<0&&a===0&&this[i+u-1]!==0&&(a=1),this[i+u]=(r/h>>0)-a&255;return i+e};o.prototype.writeIntBE=function(r,i,e,t){if(r=+r,i=i|0,!t){var f=Math.pow(2,8*e-1);w(this,r,i,e,f-1,-f)}var u=e-1,h=1,a=0;for(this[i+u]=r&255;--u>=0&&(h*=256);)r<0&&a===0&&this[i+u+1]!==0&&(a=1),this[i+u]=(r/h>>0)-a&255;return i+e};o.prototype.writeInt8=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,1,127,-128),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[i]=r&255,i+1};o.prototype.writeInt16LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):k(this,r,i,!0),i+2};o.prototype.writeInt16BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):k(this,r,i,!1),i+2};o.prototype.writeInt32LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8,this[i+2]=r>>>16,this[i+3]=r>>>24):N(this,r,i,!0),i+4};o.prototype.writeInt32BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):N(this,r,i,!1),i+4};o.prototype.writeFloatLE=function(r,i,e){return wr(this,r,i,!0,e)};o.prototype.writeFloatBE=function(r,i,e){return wr(this,r,i,!1,e)};o.prototype.writeDoubleLE=function(r,i,e){return xr(this,r,i,!0,e)};o.prototype.writeDoubleBE=function(r,i,e){return xr(this,r,i,!1,e)};o.prototype.copy=function(r,i,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),i>=r.length&&(i=r.length),i||(i=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-i<t-e&&(t=r.length-i+e);var f=t-e,u;if(this===r&&e<i&&i<t)for(u=f-1;u>=0;--u)r[u+i]=this[u+e];else if(f<1e3||!o.TYPED_ARRAY_SUPPORT)for(u=0;u<f;++u)r[u+i]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+f),i);return f};o.prototype.fill=function(r,i,e,t){if(typeof r=="string"){if(typeof i=="string"?(t=i,i=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var f=r.charCodeAt(0);f<256&&(r=f)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(i<0||this.length<i||this.length<e)throw new RangeError("Out of range index");if(e<=i)return this;i=i>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=i;u<e;++u)this[u]=r;else{var h=g(r)?r:C(new o(r,t).toString()),a=h.length;for(u=0;u<e-i;++u)this[u+i]=h[u%a]}return this};yi=/[^+\/0-9A-Za-z-_]/g});var J=V(()=>{"use strict";gr()});export{Yi as a,Si as b,Pi as c,Mi as d,V as e,Di as f,Ci as g,ki as h,Ni as i,Li as j,z as k,o as l,J as m};
|
|
2
|
-
/*! Bundled license information:
|
|
3
|
-
|
|
4
|
-
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
5
|
-
(*!
|
|
6
|
-
* The buffer module from node.js, for the browser.
|
|
7
|
-
*
|
|
8
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
9
|
-
* @license MIT
|
|
10
|
-
*)
|
|
11
|
-
*/
|
package/esm/chunk-575DWQWD.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as p}from"./chunk-IIKN6XQS.js";import{c as r}from"./chunk-E5FOYV6P.js";import{a}from"./chunk-ZI6CAI2V.js";import{j as d,k as g,m as f}from"./chunk-2AZXIWKY.js";g();f();var P="example",v="fern",I="do",S="client",A=class{constructor({context:e,formatter:t}){d(this,"context");d(this,"formatter");this.context=e,this.formatter=t}async generateSnippet({endpoint:e,request:t}){var i;return await this.buildCodeBlock({endpoint:e,snippet:t}).toString({packageName:P,importPath:v,rootImportPath:this.context.rootImportPath,customConfig:(i=this.context.customConfig)!=null?i:{},formatter:this.formatter})}generateSnippetSync({endpoint:e,request:t}){var i;return this.buildCodeBlock({endpoint:e,snippet:t}).toStringSync({packageName:P,importPath:v,rootImportPath:this.context.rootImportPath,customConfig:(i=this.context.customConfig)!=null?i:{},formatter:this.formatter})}buildCodeBlock({endpoint:e,snippet:t}){return r.func({name:I,parameters:[],return_:[],body:r.codeblock(n=>{n.writeNode(this.constructClient({endpoint:e,snippet:t})),n.writeLine(),n.writeNode(this.callMethod({endpoint:e,snippet:t}))})})}constructClient({endpoint:e,snippet:t}){return r.codeblock(n=>{n.write(`${S} := `),n.writeNode(this.getRootClientFuncInvocation(this.getConstructorArgs({endpoint:e,snippet:t})))})}callMethod({endpoint:e,snippet:t}){return r.invokeMethod({on:r.codeblock(S),method:this.getMethod({endpoint:e}),arguments_:[this.context.getContextTodoFunctionInvocation(),...this.getMethodArgs({endpoint:e,snippet:t})]})}getConstructorArgs({endpoint:e,snippet:t}){let n=[],i=this.getConstructorBaseUrlArg({baseUrl:t.baseUrl,environment:t.environment});return i!=null&&n.push(i),e.auth!=null&&(t.auth!=null?n.push(this.getConstructorAuthArg({auth:e.auth,values:t.auth})):this.context.errors.add({severity:a.Warning,message:`Auth with ${e.auth.type} configuration is required for this endpoint`})),this.context.errors.scope(p.Headers),this.context.ir.headers!=null&&t.headers!=null&&n.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:t.headers})),this.context.errors.unscope(),n}getConstructorAuthArg({auth:e,values:t}){switch(e.type){case"basic":return t.type!=="basic"?(this.context.errors.add({severity:a.Critical,message:this.newAuthMismatchError({auth:e,values:t}).message}),r.TypeInstantiation.nop()):this.getConstructorBasicAuthArg({auth:e,values:t});case"bearer":return t.type!=="bearer"?(this.context.errors.add({severity:a.Critical,message:this.newAuthMismatchError({auth:e,values:t}).message}),r.TypeInstantiation.nop()):this.getConstructorBearerAuthArg({auth:e,values:t});case"header":return t.type!=="header"?(this.context.errors.add({severity:a.Critical,message:this.newAuthMismatchError({auth:e,values:t}).message}),r.TypeInstantiation.nop()):this.getConstructorHeaderAuthArg({auth:e,values:t})}}getConstructorBasicAuthArg({auth:e,values:t}){return r.codeblock(n=>{n.writeNode(r.invokeFunc({func:r.typeReference({name:"WithBasicAuth",importPath:this.context.getOptionImportPath()}),arguments_:[r.TypeInstantiation.string(t.username),r.TypeInstantiation.string(t.password)]}))})}getConstructorBaseUrlArg({baseUrl:e,environment:t}){let n=this.getBaseUrlArg({baseUrl:e,environment:t});if(n!=null)return r.codeblock(i=>{i.writeNode(r.invokeFunc({func:r.typeReference({name:"WithBaseURL",importPath:this.context.getOptionImportPath()}),arguments_:[n]}))})}getBaseUrlArg({baseUrl:e,environment:t}){if(e!=null&&t!=null){this.context.errors.add({severity:a.Critical,message:"Cannot specify both baseUrl and environment options"});return}if(e!=null)return r.TypeInstantiation.string(e);if(t!=null){if(this.context.isSingleEnvironmentID(t)){let n=this.context.getEnvironmentTypeReferenceFromID(t);if(n==null){this.context.errors.add({severity:a.Warning,message:`Environment "${t}" was not found`});return}return r.TypeInstantiation.reference(n)}this.context.isMultiEnvironmentValues(t)&&this.context.errors.add({severity:a.Warning,message:"The Go SDK doesn't support a multi-environment client option yet; use the baseUrl option instead"})}}getConstructorBearerAuthArg({auth:e,values:t}){return r.codeblock(n=>{n.writeNode(r.invokeFunc({func:r.typeReference({name:`With${e.token.pascalCase.unsafeName}`,importPath:this.context.getOptionImportPath()}),arguments_:[r.TypeInstantiation.string(t.token)]}))})}getConstructorHeaderAuthArg({auth:e,values:t}){return r.codeblock(n=>{n.writeNode(r.invokeFunc({func:r.typeReference({name:`With${e.header.name.name.pascalCase.unsafeName}`,importPath:this.context.getOptionImportPath()}),arguments_:[this.context.dynamicTypeInstantiationMapper.convert({typeReference:e.header.typeReference,value:t.value})]}))})}getConstructorHeaderArgs({headers:e,values:t}){let n=[];for(let i of e){let o=this.getConstructorHeaderArg({header:i,value:t.value});o!=null&&n.push(o)}return n}getConstructorHeaderArg({header:e,value:t}){let n=this.context.dynamicTypeInstantiationMapper.convert({typeReference:e.typeReference,value:t});if(!r.TypeInstantiation.isNop(n))return r.codeblock(i=>{i.writeNode(r.invokeFunc({func:r.typeReference({name:`With${e.name.name.pascalCase.unsafeName}`,importPath:this.context.getOptionImportPath()}),arguments_:[n]}))})}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})}}getMethodArgsForBodyRequest({request:e,snippet:t}){let n=[];if(this.context.errors.scope(p.PathParameters),e.pathParameters!=null){let i=this.getPathParameters({namedParameters:e.pathParameters,snippet:t});n.push(...i.map(o=>o.value))}return this.context.errors.unscope(),this.context.errors.scope(p.RequestBody),e.body!=null&&n.push(this.getBodyRequestArg({body:e.body,value:t.requestBody})),this.context.errors.unscope(),n}getBodyRequestArg({body:e,value:t}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:t});case"typeReference":return this.context.dynamicTypeInstantiationMapper.convert({typeReference:e.value,value:t})}}getBytesBodyRequestArg({value:e}){return typeof e!="string"?(this.context.errors.add({severity:a.Critical,message:`Expected bytes value to be a string, got ${typeof e}`}),r.TypeInstantiation.nop()):r.TypeInstantiation.bytes(e)}getMethodArgsForInlinedRequest({request:e,snippet:t}){var s;let n=[];this.context.errors.scope(p.PathParameters);let i=[];e.pathParameters!=null&&i.push(...this.getPathParameters({namedParameters:e.pathParameters,snippet:t})),this.context.errors.unscope(),this.context.errors.scope(p.RequestBody);let o=this.getFilePropertyInfo({request:e,snippet:t});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:e})||n.push(...i.map(u=>u.value)),(s=this.context.customConfig)!=null&&s.inlineFileProperties||n.push(...o.fileFields.map(u=>u.value)),this.context.needsRequestParameter({request:e})&&n.push(this.getInlinedRequestArg({request:e,snippet:t,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:e})?i:[],filePropertyInfo:o})),n}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:n,filePropertyInfo:i}){var h,m,y,l;this.context.errors.scope(p.QueryParameters);let s=this.context.associateQueryParametersByWireValue({parameters:(h=e.queryParameters)!=null?h:[],values:(m=t.queryParameters)!=null?m:{}}).map(c=>({name:c.name.name.pascalCase.unsafeName,value:this.context.dynamicTypeInstantiationMapper.convert(c)}));this.context.errors.unscope(),this.context.errors.scope(p.Headers);let x=this.context.associateByWireValue({parameters:(y=e.headers)!=null?y:[],values:(l=t.headers)!=null?l:{}}).map(c=>({name:c.name.name.pascalCase.unsafeName,value:this.context.dynamicTypeInstantiationMapper.convert(c)}));this.context.errors.unscope(),this.context.errors.scope(p.RequestBody);let R=e.body!=null?this.getInlinedRequestBodyStructFields({body:e.body,value:t.requestBody,filePropertyInfo:i}):[];return this.context.errors.unscope(),r.TypeInstantiation.structPointer({typeReference:r.typeReference({name:this.context.getMethodName(e.declaration.name),importPath:this.context.getImportPath(e.declaration.fernFilepath)}),fields:[...n,...s,...x,...R]})}getInlinedRequestBodyStructFields({body:e,value:t,filePropertyInfo:n}){switch(e.type){case"properties":return this.getInlinedRequestBodyPropertyStructFields({parameters:e.value,value:t});case"referenced":return[this.getReferencedRequestBodyPropertyStructField({body:e,value:t})];case"fileUpload":return this.getFileUploadRequestBodyStructFields({filePropertyInfo:n})}}getFileUploadRequestBodyStructFields({filePropertyInfo:e}){var t;return(t=this.context.customConfig)!=null&&t.inlineFileProperties?[...e.fileFields,...e.bodyPropertyFields]:e.bodyPropertyFields}getReferencedRequestBodyPropertyStructField({body:e,value:t}){return{name:this.context.getTypeName(e.bodyKey),value:this.getReferencedRequestBodyPropertyTypeInstantiation({body:e.bodyType,value:t})}}getReferencedRequestBodyPropertyTypeInstantiation({body:e,value:t}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:t});case"typeReference":return this.context.dynamicTypeInstantiationMapper.convert({typeReference:e.value,value:t})}}getInlinedRequestBodyPropertyStructFields({parameters:e,value:t}){var o;let n=[],i=this.context.associateByWireValue({parameters:e,values:(o=this.context.getRecord(t))!=null?o:{}});for(let s of i)n.push({name:this.context.getTypeName(s.name.name),value:this.context.dynamicTypeInstantiationMapper.convert(s)});return n}getPathParameters({namedParameters:e,snippet:t}){var o;let n=[],i=this.context.associateByWireValue({parameters:e,values:(o=t.pathParameters)!=null?o:{}});for(let s of i)n.push({name:this.context.getTypeName(s.name.name),value:this.context.dynamicTypeInstantiationMapper.convert(s)});return n}getMethod({endpoint:e}){return e.declaration.fernFilepath.allParts.length>0?`${e.declaration.fernFilepath.allParts.map(t=>this.context.getMethodName(t)).join(".")}.${this.context.getMethodName(e.declaration.name)}`:this.context.getMethodName(e.declaration.name)}getRootClientFuncInvocation(e){return r.invokeFunc({func:r.typeReference({name:this.context.getClientConstructorName(),importPath:this.context.getClientImportPath()}),arguments_:e})}newAuthMismatchError({auth:e,values:t}){return new Error(`Expected auth type ${e.type}, got ${t.type}`)}};export{A as a};
|
package/esm/chunk-5TA7XQOD.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,k as i,m as n}from"./chunk-2AZXIWKY.js";i();n();var p=class{constructor(){t(this,"reporter");t(this,"snippet");t(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:r,snippet:e}){(this.reporter==null||this.reporter.size()>r.errors.size())&&(this.reporter=r.errors.clone(),this.snippet=e)}getResponseOrThrow({endpoint:r}){var e;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(e=this.err)!=null?e:new Error(`Failed to generate snippet for endpoint "${r.method} ${r.path}"`)}};export{p as a};
|