@hey-api/openapi-ts 0.77.0 → 0.78.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -14
- package/dist/chunk-RASXZ2HF.js +39 -0
- package/dist/chunk-RASXZ2HF.js.map +1 -0
- package/dist/index.cjs +65 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +171 -171
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +11 -11
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +10 -3
- package/dist/internal.d.ts +10 -3
- package/dist/internal.js +1 -1
- package/dist/{types.d-CBVwu8Hi.d.cts → types.d-BsTxgeRq.d.cts} +682 -302
- package/dist/{types.d-CBVwu8Hi.d.ts → types.d-BsTxgeRq.d.ts} +682 -302
- package/package.json +1 -1
- package/dist/chunk-EH476QS3.js +0 -39
- package/dist/chunk-EH476QS3.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {createRequire}from'module';import {b,a,c,
|
|
2
|
-
var Se=b((Xr,we)=>{we.exports=Ee;Ee.sync=qt;var ke=a("fs");function bt(e,n){var s=n.pathExt!==void 0?n.pathExt:process.env.PATHEXT;if(!s||(s=s.split(";"),s.indexOf("")!==-1))return true;for(var t=0;t<s.length;t++){var r=s[t].toLowerCase();if(r&&e.substr(-r.length).toLowerCase()===r)return true}return false}function Oe(e,n,s){return !e.isSymbolicLink()&&!e.isFile()?false:bt(n,s)}function Ee(e,n,s){ke.stat(e,function(t,r){s(t,t?false:Oe(r,e,n));});}function qt(e,n){return Oe(ke.statSync(e),e,n)}});var $e=b((Qr,Be)=>{Be.exports=De;De.sync=At;var He=a("fs");function De(e,n,s){He.stat(e,function(t,r){s(t,t?false:Ie(r,n));});}function At(e,n){return Ie(He.statSync(e),n)}function Ie(e,n){return e.isFile()&&Tt(e,n)}function Tt(e,n){var s=e.mode,t=e.uid,r=e.gid,o=n.uid!==void 0?n.uid:process.getuid&&process.getuid(),a=n.gid!==void 0?n.gid:process.getgid&&process.getgid(),i=parseInt("100",8),u=parseInt("010",8),l=parseInt("001",8),c=i|u,m=s&l||s&u&&r===a||s&i&&t===o||s&c&&o===0;return m}});var Ne=b((Yr,je)=>{a("fs");var _;process.platform==="win32"||global.TESTING_WINDOWS?_=Se():_=$e();je.exports=V;V.sync=kt;function V(e,n,s){if(typeof n=="function"&&(s=n,n={}),!s){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(t,r){V(e,n||{},function(o,a){o?r(o):t(a);});})}_(e,n||{},function(t,r){t&&(t.code==="EACCES"||n&&n.ignoreErrors)&&(t=null,r=false),s(t,r);});}function kt(e,n){try{return _.sync(e,n||{})}catch(s){if(n&&n.ignoreErrors||s.code==="EACCES")return false;throw s}}});var Ve=b((Zr,Ue)=>{var E=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Fe=a("path"),Ot=E?";":":",_e=Ne(),Me=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),We=(e,n)=>{let s=n.colon||Ot,t=e.match(/\//)||E&&e.match(/\\/)?[""]:[...E?[process.cwd()]:[],...(n.path||process.env.PATH||"").split(s)],r=E?n.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=E?r.split(s):[""];return E&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:t,pathExt:o,pathExtExe:r}},Le=(e,n,s)=>{typeof n=="function"&&(s=n,n={}),n||(n={});let{pathEnv:t,pathExt:r,pathExtExe:o}=We(e,n),a=[],i=l=>new Promise((c,m)=>{if(l===t.length)return n.all&&a.length?c(a):m(Me(e));let d=t[l],A=/^".*"$/.test(d)?d.slice(1,-1):d,q=Fe.join(A,e),k=!A&&/^\.[\\\/]/.test(e)?e.slice(0,2)+q:q;c(u(k,l,0));}),u=(l,c,m)=>new Promise((d,A)=>{if(m===r.length)return d(i(c+1));let q=r[m];_e(l+q,{pathExt:o},(k,H)=>{if(!k&&H)if(n.all)a.push(l+q);else return d(l+q);return d(u(l,c,m+1))});});return s?i(0).then(l=>s(null,l),s):i(0)},Et=(e,n)=>{n=n||{};let{pathEnv:s,pathExt:t,pathExtExe:r}=We(e,n),o=[];for(let a=0;a<s.length;a++){let i=s[a],u=/^".*"$/.test(i)?i.slice(1,-1):i,l=Fe.join(u,e),c=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let m=0;m<t.length;m++){let d=c+t[m];try{if(_e.sync(d,{pathExt:r}))if(n.all)o.push(d);else return d}catch{}}}if(n.all&&o.length)return o;if(n.nothrow)return null;throw Me(e)};Ue.exports=Le;Le.sync=Et;});var ze=b((eo,G)=>{var Ge=(e={})=>{let n=e.env||process.env;return (e.platform||process.platform)!=="win32"?"PATH":Object.keys(n).reverse().find(t=>t.toUpperCase()==="PATH")||"Path"};G.exports=Ge;G.exports.default=Ge;});var Je=b((no,Qe)=>{var Ke=a("path"),wt=Ve(),St=ze();function Xe(e,n){let s=e.options.env||process.env,t=process.cwd(),r=e.options.cwd!=null,o=r&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd);}catch{}let a;try{a=wt.sync(e.command,{path:s[St({env:s})],pathExt:n?Ke.delimiter:void 0});}catch{}finally{o&&process.chdir(t);}return a&&(a=Ke.resolve(r?e.options.cwd:"",a)),a}function Ht(e){return Xe(e)||Xe(e,true)}Qe.exports=Ht;});var Ye=b((to,K)=>{var z=/([()\][%!^"`<>&|;, *?])/g;function Dt(e){return e=e.replace(z,"^$1"),e}function It(e,n){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(z,"^$1"),n&&(e=e.replace(z,"^$1")),e}K.exports.command=Dt;K.exports.argument=It;});var en=b((ro,Ze)=>{Ze.exports=/^#!(.*)/;});var tn=b((oo,nn)=>{var Bt=en();nn.exports=(e="")=>{let n=e.match(Bt);if(!n)return null;let[s,t]=n[0].replace(/#! ?/,"").split(" "),r=s.split("/").pop();return r==="env"?t:t?`${r} ${t}`:r};});var on=b((so,rn)=>{var X=a("fs"),$t=tn();function jt(e){let s=Buffer.alloc(150),t;try{t=X.openSync(e,"r"),X.readSync(t,s,0,150,0),X.closeSync(t);}catch{}return $t(s.toString())}rn.exports=jt;});var un=b((io,ln)=>{var Nt=a("path"),sn=Je(),an=Ye(),Ft=on(),_t=process.platform==="win32",Mt=/\.(?:com|exe)$/i,Wt=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Lt(e){e.file=sn(e);let n=e.file&&Ft(e.file);return n?(e.args.unshift(e.file),e.command=n,sn(e)):e.file}function Ut(e){if(!_t)return e;let n=Lt(e),s=!Mt.test(n);if(e.options.forceShell||s){let t=Wt.test(n);e.command=Nt.normalize(e.command),e.command=an.command(e.command),e.args=e.args.map(o=>an.argument(o,t));let r=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${r}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=true;}return e}function Vt(e,n,s){n&&!Array.isArray(n)&&(s=n,n=null),n=n?n.slice(0):[],s=Object.assign({},s);let t={command:e,args:n,options:s,file:void 0,original:{command:e,args:n}};return s.shell?t:Ut(t)}ln.exports=Vt;});var mn=b((ao,cn)=>{var Q=process.platform==="win32";function J(e,n){return Object.assign(new Error(`${n} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${n} ${e.command}`,path:e.command,spawnargs:e.args})}function Gt(e,n){if(!Q)return;let s=e.emit;e.emit=function(t,r){if(t==="exit"){let o=pn(r,n);if(o)return s.call(e,"error",o)}return s.apply(e,arguments)};}function pn(e,n){return Q&&e===1&&!n.file?J(n.original,"spawn"):null}function zt(e,n){return Q&&e===1&&!n.file?J(n.original,"spawnSync"):null}cn.exports={hookChildProcess:Gt,verifyENOENT:pn,verifyENOENTSync:zt,notFoundError:J};});var gn=b((lo,w)=>{var fn=a("child_process"),Y=un(),Z=mn();function dn(e,n,s){let t=Y(e,n,s),r=fn.spawn(t.command,t.args,t.options);return Z.hookChildProcess(r,t),r}function Kt(e,n,s){let t=Y(e,n,s),r=fn.spawnSync(t.command,t.args,t.options);return r.error=r.error||Z.verifyENOENTSync(r.status,t),r}w.exports=dn;w.exports.spawn=dn;w.exports.sync=Kt;w.exports._parse=Y;w.exports._enoent=Z;});var F=e=>{switch(e){case "legacy/angular":return "AngularHttpRequest";case "legacy/axios":return "AxiosHttpRequest";case "legacy/fetch":return "FetchHttpRequest";case "legacy/node":return "NodeHttpRequest";case "legacy/xhr":return "XHRHttpRequest";default:return ""}};var xe=async(e$1,n,s,t)=>{let r=e(),o=d(r),a=t.client({$config:r,...s,httpRequest:F(o.name),models:i(s.models),services:i(s.services)});g(r)&&(j(n),v$1.writeFileSync(R.resolve(n,`${g(r)}.ts`),a));};var Ce=async(e$1,n,s)=>{let t=e();if(t.exportCore){let r=d(t),o={httpRequest:F(r.name),server:t.base!==void 0?t.base:n.server,version:n.version};if(v$1.rmSync(R.resolve(e$1),{force:true,recursive:true}),v$1.mkdirSync(R.resolve(e$1),{recursive:true}),await v$1.writeFileSync(R.resolve(e$1,"OpenAPI.ts"),s.core.settings({$config:t,...o})),await v$1.writeFileSync(R.resolve(e$1,"ApiError.ts"),s.core.apiError({$config:t,...o})),await v$1.writeFileSync(R.resolve(e$1,"ApiRequestOptions.ts"),s.core.apiRequestOptions({$config:t,...o})),await v$1.writeFileSync(R.resolve(e$1,"ApiResult.ts"),s.core.apiResult({$config:t,...o})),r.name!=="legacy/angular"&&await v$1.writeFileSync(R.resolve(e$1,"CancelablePromise.ts"),s.core.cancelablePromise({$config:t,...o})),await v$1.writeFileSync(R.resolve(e$1,"request.ts"),s.core.request({$config:t,...o})),g(t)&&(await v$1.writeFileSync(R.resolve(e$1,"BaseHttpRequest.ts"),s.core.baseHttpRequest({$config:t,...o})),await v$1.writeFileSync(R.resolve(e$1,`${o.httpRequest}.ts`),s.core.httpRequest({$config:t,...o}))),t.request){let a=R.resolve(process.cwd(),t.request);if(!await v$1.existsSync(a))throw new Error(`Custom request file "${a}" does not exists`);await v$1.copyFileSync(a,R.resolve(e$1,"request.ts"));}}};var be=({files:e$1})=>{let n=e();e$1.index=new o({dir:n.output.path,id:"index",name:"index.ts"}),g(n)&&e$1.index.add(m.exportNamedDeclaration({exports:g(n),module:`./${g(n)}`})),n.exportCore&&(e$1.index.add(m.exportNamedDeclaration({exports:"ApiError",module:"./core/ApiError"})),n.plugins["@hey-api/sdk"]?.config.response==="response"&&e$1.index.add(m.exportNamedDeclaration({exports:{asType:true,name:"ApiResult"},module:"./core/ApiResult"})),g(n)&&e$1.index.add(m.exportNamedDeclaration({exports:"BaseHttpRequest",module:"./core/BaseHttpRequest"})),d(n).name!=="legacy/angular"&&e$1.index.add(m.exportNamedDeclaration({exports:["CancelablePromise","CancelError"],module:"./core/CancelablePromise"})),e$1.index.add(m.exportNamedDeclaration({exports:["OpenAPI",{asType:true,name:"OpenAPIConfig"}],module:"./core/OpenAPI"}))),Object.keys(e$1).sort().forEach(s=>{let t=e$1[s];s==="index"||t.isEmpty()||t.exportFromIndex&&e$1.index.add(m.exportAllDeclaration({module:`./${t.nameWithoutExtension()}`}));});};var qe=async({client:e$1,openApi:n,templates:s})=>{let t=e(),r=n;if(e$1){if(t.plugins["@hey-api/sdk"]?.config.include&&t.plugins["@hey-api/sdk"].config.asClass){let l=new RegExp(t.plugins["@hey-api/sdk"].config.include);e$1.services=e$1.services.filter(c=>l.test(c.name));}if(t.plugins["@hey-api/typescript"]?.config.include){let l=new RegExp(t.plugins["@hey-api/typescript"].config.include);e$1.models=e$1.models.filter(c=>l.test(c.name));}}let o$1=R.resolve(t.output.path);t.output.clean&&k(o$1);let a=q(p$1(t.output.tsConfigPath)),i=d(t);!f$1(t)&&"bundle"in i.config&&i.config.bundle&&l({outputPath:o$1,plugin:i,tsConfig:a}),await xe(r,o$1,e$1,s),await Ce(R.resolve(t.output.path,"core"),e$1,s);let u={};for(let l of t.pluginOrder){let c=t.plugins[l],m=(c.output??"").split("/"),d=R.resolve(t.output.path,...m.slice(0,m.length-1));u[c.name]=new o({dir:d,id:`legacy-unused-${c.name}`,name:`${m[m.length-1]}.ts`}),c.handlerLegacy?.({client:e$1,files:u,openApi:r,plugin:c});}be({files:u}),Object.entries(u).forEach(([l,c])=>{t.dryRun||(l==="index"?c.write(`
|
|
1
|
+
import {createRequire}from'module';import {b,a,c,q,H,h,v,x as x$1,y,w,I,f,g,F as F$1,E,e,A,o,u,t,d,p as p$1,m as m$1,s,B,C,D,n,z}from'./chunk-RASXZ2HF.js';export{k as clientDefaultConfig,l as clientDefaultMeta,r as clientPluginHandler,i as defaultPaginationKeywords,G as defaultPlugins,j as definePluginConfig}from'./chunk-RASXZ2HF.js';import x from'ansi-colors';import lr from'color-support';import R from'node:path';import v$1 from'node:fs';import Ct from'typescript';import p from'handlebars';createRequire(import.meta.url);
|
|
2
|
+
var Se=b((Xr,Ee)=>{Ee.exports=we;we.sync=qt;var ke=a("fs");function bt(e,n){var o=n.pathExt!==void 0?n.pathExt:process.env.PATHEXT;if(!o||(o=o.split(";"),o.indexOf("")!==-1))return true;for(var r=0;r<o.length;r++){var t=o[r].toLowerCase();if(t&&e.substr(-t.length).toLowerCase()===t)return true}return false}function Oe(e,n,o){return !e.isSymbolicLink()&&!e.isFile()?false:bt(n,o)}function we(e,n,o){ke.stat(e,function(r,t){o(r,r?false:Oe(t,e,n));});}function qt(e,n){return Oe(ke.statSync(e),e,n)}});var je=b((Qr,Be)=>{Be.exports=De;De.sync=At;var He=a("fs");function De(e,n,o){He.stat(e,function(r,t){o(r,r?false:Ie(t,n));});}function At(e,n){return Ie(He.statSync(e),n)}function Ie(e,n){return e.isFile()&&Tt(e,n)}function Tt(e,n){var o=e.mode,r=e.uid,t=e.gid,s=n.uid!==void 0?n.uid:process.getuid&&process.getuid(),a=n.gid!==void 0?n.gid:process.getgid&&process.getgid(),i=parseInt("100",8),u=parseInt("010",8),l=parseInt("001",8),c=i|u,f=o&l||o&u&&t===a||o&i&&r===s||o&c&&s===0;return f}});var Ne=b((Yr,$e)=>{a("fs");var _;process.platform==="win32"||global.TESTING_WINDOWS?_=Se():_=je();$e.exports=V;V.sync=kt;function V(e,n,o){if(typeof n=="function"&&(o=n,n={}),!o){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,t){V(e,n||{},function(s,a){s?t(s):r(a);});})}_(e,n||{},function(r,t){r&&(r.code==="EACCES"||n&&n.ignoreErrors)&&(r=null,t=false),o(r,t);});}function kt(e,n){try{return _.sync(e,n||{})}catch(o){if(n&&n.ignoreErrors||o.code==="EACCES")return false;throw o}}});var Ve=b((Zr,Ue)=>{var w=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Fe=a("path"),Ot=w?";":":",_e=Ne(),Le=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Me=(e,n)=>{let o=n.colon||Ot,r=e.match(/\//)||w&&e.match(/\\/)?[""]:[...w?[process.cwd()]:[],...(n.path||process.env.PATH||"").split(o)],t=w?n.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=w?t.split(o):[""];return w&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:r,pathExt:s,pathExtExe:t}},We=(e,n,o)=>{typeof n=="function"&&(o=n,n={}),n||(n={});let{pathEnv:r,pathExt:t,pathExtExe:s}=Me(e,n),a=[],i=l=>new Promise((c,f)=>{if(l===r.length)return n.all&&a.length?c(a):f(Le(e));let d=r[l],A=/^".*"$/.test(d)?d.slice(1,-1):d,q=Fe.join(A,e),k=!A&&/^\.[\\\/]/.test(e)?e.slice(0,2)+q:q;c(u(k,l,0));}),u=(l,c,f)=>new Promise((d,A)=>{if(f===t.length)return d(i(c+1));let q=t[f];_e(l+q,{pathExt:s},(k,H)=>{if(!k&&H)if(n.all)a.push(l+q);else return d(l+q);return d(u(l,c,f+1))});});return o?i(0).then(l=>o(null,l),o):i(0)},wt=(e,n)=>{n=n||{};let{pathEnv:o,pathExt:r,pathExtExe:t}=Me(e,n),s=[];for(let a=0;a<o.length;a++){let i=o[a],u=/^".*"$/.test(i)?i.slice(1,-1):i,l=Fe.join(u,e),c=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let f=0;f<r.length;f++){let d=c+r[f];try{if(_e.sync(d,{pathExt:t}))if(n.all)s.push(d);else return d}catch{}}}if(n.all&&s.length)return s;if(n.nothrow)return null;throw Le(e)};Ue.exports=We;We.sync=wt;});var ze=b((eo,G)=>{var Ge=(e={})=>{let n=e.env||process.env;return (e.platform||process.platform)!=="win32"?"PATH":Object.keys(n).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};G.exports=Ge;G.exports.default=Ge;});var Je=b((no,Qe)=>{var Ke=a("path"),Et=Ve(),St=ze();function Xe(e,n){let o=e.options.env||process.env,r=process.cwd(),t=e.options.cwd!=null,s=t&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd);}catch{}let a;try{a=Et.sync(e.command,{path:o[St({env:o})],pathExt:n?Ke.delimiter:void 0});}catch{}finally{s&&process.chdir(r);}return a&&(a=Ke.resolve(t?e.options.cwd:"",a)),a}function Ht(e){return Xe(e)||Xe(e,true)}Qe.exports=Ht;});var Ye=b((to,K)=>{var z=/([()\][%!^"`<>&|;, *?])/g;function Dt(e){return e=e.replace(z,"^$1"),e}function It(e,n){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(z,"^$1"),n&&(e=e.replace(z,"^$1")),e}K.exports.command=Dt;K.exports.argument=It;});var en=b((ro,Ze)=>{Ze.exports=/^#!(.*)/;});var tn=b((oo,nn)=>{var Bt=en();nn.exports=(e="")=>{let n=e.match(Bt);if(!n)return null;let[o,r]=n[0].replace(/#! ?/,"").split(" "),t=o.split("/").pop();return t==="env"?r:r?`${t} ${r}`:t};});var on=b((so,rn)=>{var X=a("fs"),jt=tn();function $t(e){let o=Buffer.alloc(150),r;try{r=X.openSync(e,"r"),X.readSync(r,o,0,150,0),X.closeSync(r);}catch{}return jt(o.toString())}rn.exports=$t;});var un=b((io,ln)=>{var Nt=a("path"),sn=Je(),an=Ye(),Ft=on(),_t=process.platform==="win32",Lt=/\.(?:com|exe)$/i,Mt=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Wt(e){e.file=sn(e);let n=e.file&&Ft(e.file);return n?(e.args.unshift(e.file),e.command=n,sn(e)):e.file}function Ut(e){if(!_t)return e;let n=Wt(e),o=!Lt.test(n);if(e.options.forceShell||o){let r=Mt.test(n);e.command=Nt.normalize(e.command),e.command=an.command(e.command),e.args=e.args.map(s=>an.argument(s,r));let t=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${t}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=true;}return e}function Vt(e,n,o){n&&!Array.isArray(n)&&(o=n,n=null),n=n?n.slice(0):[],o=Object.assign({},o);let r={command:e,args:n,options:o,file:void 0,original:{command:e,args:n}};return o.shell?r:Ut(r)}ln.exports=Vt;});var fn=b((ao,cn)=>{var Q=process.platform==="win32";function J(e,n){return Object.assign(new Error(`${n} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${n} ${e.command}`,path:e.command,spawnargs:e.args})}function Gt(e,n){if(!Q)return;let o=e.emit;e.emit=function(r,t){if(r==="exit"){let s=pn(t,n);if(s)return o.call(e,"error",s)}return o.apply(e,arguments)};}function pn(e,n){return Q&&e===1&&!n.file?J(n.original,"spawn"):null}function zt(e,n){return Q&&e===1&&!n.file?J(n.original,"spawnSync"):null}cn.exports={hookChildProcess:Gt,verifyENOENT:pn,verifyENOENTSync:zt,notFoundError:J};});var gn=b((lo,E)=>{var mn=a("child_process"),Y=un(),Z=fn();function dn(e,n,o){let r=Y(e,n,o),t=mn.spawn(r.command,r.args,r.options);return Z.hookChildProcess(t,r),t}function Kt(e,n,o){let r=Y(e,n,o),t=mn.spawnSync(r.command,r.args,r.options);return t.error=t.error||Z.verifyENOENTSync(t.status,r),t}E.exports=dn;E.exports.spawn=dn;E.exports.sync=Kt;E.exports._parse=Y;E.exports._enoent=Z;});var F=e=>{switch(e){case "legacy/angular":return "AngularHttpRequest";case "legacy/axios":return "AxiosHttpRequest";case "legacy/fetch":return "FetchHttpRequest";case "legacy/node":return "NodeHttpRequest";case "legacy/xhr":return "XHRHttpRequest";default:return ""}};var xe=async(e$1,n$1,o,r)=>{let t=e(),s=d(t),a=r.client({$config:t,...o,httpRequest:F(s.name),models:D(o.models),services:D(o.services)});g(t)&&(n(n$1),v$1.writeFileSync(R.resolve(n$1,`${g(t)}.ts`),a));};var Ce=async(e$1,n,o)=>{let r=e();if(r.exportCore){let t=d(r),s={httpRequest:F(t.name),server:r.base!==void 0?r.base:n.server,version:n.version};if(v$1.rmSync(R.resolve(e$1),{force:true,recursive:true}),v$1.mkdirSync(R.resolve(e$1),{recursive:true}),await v$1.writeFileSync(R.resolve(e$1,"OpenAPI.ts"),o.core.settings({$config:r,...s})),await v$1.writeFileSync(R.resolve(e$1,"ApiError.ts"),o.core.apiError({$config:r,...s})),await v$1.writeFileSync(R.resolve(e$1,"ApiRequestOptions.ts"),o.core.apiRequestOptions({$config:r,...s})),await v$1.writeFileSync(R.resolve(e$1,"ApiResult.ts"),o.core.apiResult({$config:r,...s})),t.name!=="legacy/angular"&&await v$1.writeFileSync(R.resolve(e$1,"CancelablePromise.ts"),o.core.cancelablePromise({$config:r,...s})),await v$1.writeFileSync(R.resolve(e$1,"request.ts"),o.core.request({$config:r,...s})),g(r)&&(await v$1.writeFileSync(R.resolve(e$1,"BaseHttpRequest.ts"),o.core.baseHttpRequest({$config:r,...s})),await v$1.writeFileSync(R.resolve(e$1,`${s.httpRequest}.ts`),o.core.httpRequest({$config:r,...s}))),r.request){let a=R.resolve(process.cwd(),r.request);if(!await v$1.existsSync(a))throw new Error(`Custom request file "${a}" does not exists`);await v$1.copyFileSync(a,R.resolve(e$1,"request.ts"));}}};var be=({files:e$1})=>{let n=e();e$1.index=new s({dir:n.output.path,id:"index",name:"index.ts"}),g(n)&&e$1.index.add(m$1.exportNamedDeclaration({exports:g(n),module:`./${g(n)}`})),n.exportCore&&(e$1.index.add(m$1.exportNamedDeclaration({exports:"ApiError",module:"./core/ApiError"})),n.plugins["@hey-api/sdk"]?.config.response==="response"&&e$1.index.add(m$1.exportNamedDeclaration({exports:{asType:true,name:"ApiResult"},module:"./core/ApiResult"})),g(n)&&e$1.index.add(m$1.exportNamedDeclaration({exports:"BaseHttpRequest",module:"./core/BaseHttpRequest"})),d(n).name!=="legacy/angular"&&e$1.index.add(m$1.exportNamedDeclaration({exports:["CancelablePromise","CancelError"],module:"./core/CancelablePromise"})),e$1.index.add(m$1.exportNamedDeclaration({exports:["OpenAPI",{asType:true,name:"OpenAPIConfig"}],module:"./core/OpenAPI"}))),Object.keys(e$1).sort().forEach(o=>{let r=e$1[o];o==="index"||r.isEmpty()||r.exportFromIndex&&e$1.index.add(m$1.exportAllDeclaration({module:`./${r.nameWithoutExtension()}`}));});};var qe=async({client:e$1,openApi:n,templates:o$1})=>{let r=e(),t$1=n;if(e$1){if(r.plugins["@hey-api/sdk"]?.config.include&&r.plugins["@hey-api/sdk"].config.asClass){let l=new RegExp(r.plugins["@hey-api/sdk"].config.include);e$1.services=e$1.services.filter(c=>l.test(c.name));}if(r.plugins["@hey-api/typescript"]?.config.include){let l=new RegExp(r.plugins["@hey-api/typescript"].config.include);e$1.models=e$1.models.filter(c=>l.test(c.name));}}let s$1=R.resolve(r.output.path);r.output.clean&&o(s$1);let a=u(t(r.output.tsConfigPath)),i=d(r);!f(r)&&"bundle"in i.config&&i.config.bundle&&p$1({outputPath:s$1,plugin:i,tsConfig:a}),await xe(t$1,s$1,e$1,o$1),await Ce(R.resolve(r.output.path,"core"),e$1,o$1);let u$1={};for(let l of r.pluginOrder){let c=r.plugins[l],f=(c.output??"").split("/"),d=R.resolve(r.output.path,...f.slice(0,f.length-1));u$1[c.name]=new s({dir:d,id:`legacy-unused-${c.name}`,name:`${f[f.length-1]}.ts`}),c.handlerLegacy?.({client:e$1,files:u$1,openApi:t$1,plugin:c});}be({files:u$1}),Object.entries(u$1).forEach(([l,c])=>{r.dryRun||(l==="index"?c.write(`
|
|
3
3
|
`,a):c.write(`
|
|
4
4
|
|
|
5
|
-
`,a));});};var Ae=async({context:e})=>{let n=R.resolve(e.config.output.path);e.config.output.clean&&
|
|
5
|
+
`,a));});};var Ae=async({context:e})=>{let n=R.resolve(e.config.output.path);e.config.output.clean&&o(n);let o$1=u(t(e.config.output.tsConfigPath)),r=o$1?.options.moduleResolution===Ct.ModuleResolutionKind.NodeNext,t$1=d(e.config);"bundle"in t$1.config&&t$1.config.bundle&&p$1({outputPath:n,plugin:t$1,tsConfig:o$1});for(let s of e.registerPlugins())await s.run();if(!e.config.dryRun){let s=e.createFile({id:"_index",path:"index"});for(let a of Object.values(e.files))if(a.nameWithoutExtension()!==s.nameWithoutExtension()){if(!a.isEmpty()&&a.exportFromIndex&&e.config.output.indexFile){let u=s.relativePathToFile({context:e,id:a.id});r&&(u.startsWith("./")||u.startsWith("../"))&&(u==="./client"?u="./client/index.js":u=`${u}.js`),s.add(m$1.exportAllDeclaration({module:u}));}a.write(`
|
|
6
6
|
|
|
7
|
-
`,
|
|
8
|
-
`,
|
|
7
|
+
`,o$1);}e.config.output.indexFile&&s.write(`
|
|
8
|
+
`,o$1);}};var Te=({patchOptions:e,spec:n})=>{if(!e)return;let o=n;if("swagger"in o){if(e.version&&o.swagger&&(o.swagger=typeof e.version=="string"?e.version:e.version(o.swagger)),e.meta&&o.info&&e.meta(o.info),e.schemas&&o.definitions)for(let r in e.schemas){let t=o.definitions[r];if(!t||typeof t!="object")continue;let s=e.schemas[r];s(t);}if(e.operations&&o.paths)for(let r in e.operations){let[t,s]=r.split(" ");if(!t||!s)continue;let a=o.paths[s];if(!a)continue;let i=a[t.toLocaleLowerCase()]||a[t.toLocaleUpperCase()];if(!i||typeof i!="object")continue;let u=e.operations[r];u(i);}return}if(e.version&&o.openapi&&(o.openapi=typeof e.version=="string"?e.version:e.version(o.openapi)),e.meta&&o.info&&e.meta(o.info),o.components){if(e.schemas&&o.components.schemas)for(let r in e.schemas){let t=o.components.schemas[r];if(!t||typeof t!="object")continue;let s=e.schemas[r];s(t);}if(e.parameters&&o.components.parameters)for(let r in e.parameters){let t=o.components.parameters[r];if(!t||typeof t!="object")continue;let s=e.parameters[r];s(t);}if(e.requestBodies&&o.components.requestBodies)for(let r in e.requestBodies){let t=o.components.requestBodies[r];if(!t||typeof t!="object")continue;let s=e.requestBodies[r];s(t);}if(e.responses&&o.components.responses)for(let r in e.responses){let t=o.components.responses[r];if(!t||typeof t!="object")continue;let s=e.responses[r];s(t);}}if(e.operations&&o.paths)for(let r in e.operations){let[t,s]=r.split(" ");if(!t||!s)continue;let a=o.paths[s];if(!a)continue;let i=a[t.toLocaleLowerCase()]||a[t.toLocaleUpperCase()];if(!i||typeof i!="object")continue;let u=e.operations[r];u(i);}};var ee=c(gn(),1),Xt={biome:{args:e=>["format","--write",e],command:"biome",name:"Biome (Format)"},prettier:{args:e=>["--ignore-unknown",e,"--write","--ignore-path","./.prettierignore"],command:"prettier",name:"Prettier"}},Qt={biome:{args:e=>["lint","--apply",e],command:"biome",name:"Biome (Lint)"},eslint:{args:e=>[e,"--fix"],command:"eslint",name:"ESLint"},oxlint:{args:e=>["--fix",e],command:"oxlint",name:"oxlint"}},yn=({config:e})=>{if(e.output.format){let n=Xt[e.output.format];console.log(`\u2728 Running ${n.name}`),(0, ee.sync)(n.command,n.args(e.output.path));}if(e.output.lint){let n=Qt[e.output.lint];console.log(`\u2728 Running ${n.name}`),(0, ee.sync)(n.command,n.args(e.output.path));}};var hn=e=>`${e}-end`,ne=e=>`${e}-length`,vn=e=>`${e}-start`,m={clear:()=>{performance.clearMarks(),performance.clearMeasures();},end:e=>performance.mark(hn(e)),getEntriesByName:e=>performance.getEntriesByName(ne(e)),measure:e=>performance.measure(ne(e),vn(e),hn(e)),start:e=>performance.mark(vn(e))},L=class{totalMeasure;constructor({totalMark:n}){this.totalMeasure=m.measure(n);}report({marks:n}){let o=Math.ceil(this.totalMeasure.duration*100)/100,r=this.totalMeasure.name;console.warn(`${r.substring(0,r.length-ne("").length)}: ${o.toFixed(2)}ms`),n.forEach(t=>{try{let s=m.measure(t),a=Math.ceil(s.duration*100)/100,i=Math.ceil(s.duration/this.totalMeasure.duration*100*100)/100;console.warn(`${t}: ${a.toFixed(2)}ms (${i.toFixed(2)}%)`);}catch{}});}};function Rn(e,n){return {...e,config:n,models:e.models.map(o=>Jt(o)),services:Yt(e.operations).map(Zt),types:{}}}var Jt=e=>({...e,$refs:e.$refs.filter((n,o,r)=>B(n,o,r)),enum:e.enum.filter((n,o,r)=>r.findIndex(t=>t.value===n.value)===o),enums:e.enums.filter((n,o,r)=>r.findIndex(t=>t.name===n.name)===o),imports:e.imports.filter((n,o,r)=>B(n,o,r)&&n!==e.name).sort(C)}),Yt=e$1=>{let n=e(),o=new Map;return e$1.forEach(r=>{(r.tags?.length&&(n.plugins["@hey-api/sdk"]?.config.asClass||g(n))?r.tags.filter(B):["Default"]).forEach(s=>{let a={...r,service:tr(s)},i=o.get(a.service)||nr(a);i.$refs=[...i.$refs,...a.$refs],i.imports=[...i.imports,...a.imports],i.operations=[...i.operations,a],o.set(a.service,i);});}),Array.from(o.values())},Zt=e=>{let n={...e};return n.operations=er(n),n.operations.forEach(o=>{n.imports.push(...o.imports);}),n.imports=n.imports.filter(B).sort(C),n},er=e=>{let n=new Map;return e.operations.map(o=>{let r={...o};r.imports.push(...r.parameters.flatMap(i=>i.imports));let t=r.responses.filter(i=>i.responseTypes.includes("success"));r.imports.push(...t.flatMap(i=>i.imports));let s=r.name,a=n.get(s)||0;return a>0&&(r.name=`${s}${a}`),n.set(s,a+1),r})},nr=e=>({$refs:[],imports:[],name:e.service,operations:[]}),tr=e=>q({case:"PascalCase",value:z(e)});var te=e=>e.startsWith("https://get.heyapi.dev"),or=e=>{let n={path:""};if(e.path&&(typeof e.path!="string"||!te(e.path)))return n.path=e.path,n;let[o,r]=e.path.split("?"),s=(r||"").split("&").map(P=>P.split("=")),a=o||"";a.endsWith("/")&&(a=a.slice(0,a.length-1));let[,i]=a.split("://"),[u,l,c]=(i||"").split("/");n.organization=l||e.organization,n.project=c||e.project;let f=[],d="api_key";n.api_key=s.find(([P])=>P===d)?.[1]||e.api_key||process.env.HEY_API_TOKEN,n.api_key&&f.push(`${d}=${n.api_key}`);let A="branch";n.branch=s.find(([P])=>P===A)?.[1]||e.branch,n.branch&&f.push(`${A}=${n.branch}`);let q="commit_sha";n.commit_sha=s.find(([P])=>P===q)?.[1]||e.commit_sha,n.commit_sha&&f.push(`${q}=${n.commit_sha}`);let k="tags";n.tags=s.find(([P])=>P===k)?.[1]?.split(",")||e.tags,n.tags?.length&&f.push(`${k}=${n.tags.join(",")}`);let H="version";if(n.version=s.find(([P])=>P===H)?.[1]||e.version,n.version&&f.push(`${H}=${n.version}`),!n.organization)throw new Error("missing organization - from which Hey API Platform organization do you want to generate your output?");if(!n.project)throw new Error("missing project - from which Hey API Platform project do you want to generate your output?");let oe=f.join("&"),se=u||"get.heyapi.dev",ie=se.startsWith("localhost"),ae=[ie?"http":"https",se].join("://"),le=ie?[ae,"v1","get",n.organization,n.project].join("/"):[ae,n.organization,n.project].join("/");return n.path=oe?`${le}?${oe}`:le,n},Pn=e=>{let n=x.cyan("Generating from");if(typeof e.path=="string"){let o=te(e.path)?`${e.organization??""}/${e.project??""}`:e.path;console.log(`\u23F3 ${n} ${o}`),te(e.path)&&(e.branch&&console.log(`${x.gray("branch:")} ${x.green(e.branch)}`),e.commit_sha&&console.log(`${x.gray("commit:")} ${x.green(e.commit_sha)}`),e.tags?.length&&console.log(`${x.gray("tags:")} ${x.green(e.tags.join(", "))}`),e.version&&console.log(`${x.gray("version:")} ${x.green(e.version)}`));}else console.log(`\u23F3 ${n} raw OpenAPI specification`);},re=async({config:e,templates:n,watch:o})=>{let r=or(e.input),{timeout:t}=e.input.watch,s=o||{headers:new Headers};e.logs.level!=="silent"&&!o&&Pn(r),m.start("spec");let{data:a,error:i,response:u}=await I({fetchOptions:e.input.fetch,inputPath:r.path,timeout:t,watch:s});if(m.end("spec"),i&&!o)throw new Error(`Request failed with status ${u.status}: ${u.statusText}`);let l,c;if(a){if(e.logs.level!=="silent"&&o&&(console.clear(),Pn(r)),m.start("input.patch"),Te({patchOptions:e.parser.patch,spec:a}),m.end("input.patch"),m.start("parser"),e.experimentalParser&&!f(e)&&!g(e)&&(c=F$1({config:e,spec:a})),!c){let f=E({openApi:a});l=Rn(f,e);}if(m.end("parser"),m.start("generator"),c?await Ae({context:c}):l&&await qe({client:l,openApi:a,templates:n}),m.end("generator"),m.start("postprocess"),!e.dryRun&&(yn({config:e}),e.logs.level!=="silent")){let f=process.env.INIT_CWD?`./${R.relative(process.env.INIT_CWD,e.output.path)}`:e.output.path;console.log(`${x.green("\u{1F680} Done!")} Your output is in ${x.cyanBright(f)}`);}m.end("postprocess");}return e.input.watch.enabled&&typeof r.path=="string"&&setTimeout(()=>{re({config:e,templates:n,watch:s});},e.input.watch.interval),c||l};var xn={1:function(e,n,o,r,t){return `import { NgModule} from '@angular/core';
|
|
9
9
|
import { HttpClientModule } from '@angular/common/http';
|
|
10
10
|
|
|
11
11
|
import { AngularHttpRequest } from './core/AngularHttpRequest';
|
|
@@ -13,19 +13,19 @@ import { BaseHttpRequest } from './core/BaseHttpRequest';
|
|
|
13
13
|
import type { OpenAPIConfig } from './core/OpenAPI';
|
|
14
14
|
import { OpenAPI } from './core/OpenAPI';
|
|
15
15
|
import { Interceptors } from './core/OpenAPI';
|
|
16
|
-
`},3:function(e,n,
|
|
16
|
+
`},3:function(e,n,o,r,t){var s,a=e.strict,i=e.lambda;return `import type { BaseHttpRequest } from './core/BaseHttpRequest';
|
|
17
17
|
import type { OpenAPIConfig } from './core/OpenAPI';
|
|
18
18
|
import { Interceptors } from './core/OpenAPI';
|
|
19
|
-
import { `+((
|
|
20
|
-
`},5:function(e,n,
|
|
21
|
-
`},8:function(e,n,
|
|
19
|
+
import { `+((s=i(a(n,"httpRequest",{start:{line:14,column:12},end:{line:14,column:23}}),n))!=null?s:"")+" } from './core/"+((s=i(a(n,"httpRequest",{start:{line:14,column:45},end:{line:14,column:56}}),n))!=null?s:"")+`';
|
|
20
|
+
`},5:function(e,n,o,r,t){var s,a=e.lookupProperty||function(i,u){if(Object.prototype.hasOwnProperty.call(i,u))return i[u]};return (s=a(o,"each").call(n??(e.nullContext||{}),a(n,"services"),{name:"each",hash:{},fn:e.program(6,t,0),inverse:e.noop,data:t,loc:{start:{line:18,column:0},end:{line:20,column:9}}}))!=null?s:""},6:function(e,n,o,r,t){var s,a=e.lookupProperty||function(i,u){if(Object.prototype.hasOwnProperty.call(i,u))return i[u]};return "import { "+((s=a(o,"transformServiceName").call(n??(e.nullContext||{}),a(n,"name"),{name:"transformServiceName",hash:{},data:t,loc:{start:{line:19,column:9},end:{line:19,column:40}}}))!=null?s:"")+` } from './sdk.gen';
|
|
21
|
+
`},8:function(e,n,o,r,t){var s,a=e.strict,i=e.lambda,u=e.lookupProperty||function(l,c){if(Object.prototype.hasOwnProperty.call(l,c))return l[c]};return `@NgModule({
|
|
22
22
|
imports: [HttpClientModule],
|
|
23
23
|
providers: [
|
|
24
24
|
{
|
|
25
25
|
provide: OpenAPI,
|
|
26
26
|
useValue: {
|
|
27
|
-
BASE: OpenAPI?.BASE ?? '`+((
|
|
28
|
-
VERSION: OpenAPI?.VERSION ?? '`+((
|
|
27
|
+
BASE: OpenAPI?.BASE ?? '`+((s=i(a(n,"server",{start:{line:30,column:31},end:{line:30,column:37}}),n))!=null?s:"")+`',
|
|
28
|
+
VERSION: OpenAPI?.VERSION ?? '`+((s=i(a(n,"version",{start:{line:31,column:37},end:{line:31,column:44}}),n))!=null?s:"")+`',
|
|
29
29
|
WITH_CREDENTIALS: OpenAPI?.WITH_CREDENTIALS ?? false,
|
|
30
30
|
CREDENTIALS: OpenAPI?.CREDENTIALS ?? 'include',
|
|
31
31
|
TOKEN: OpenAPI?.TOKEN,
|
|
@@ -42,21 +42,21 @@ import { `+((o=i(a(n,"httpRequest",{start:{line:14,column:12},end:{line:14,colum
|
|
|
42
42
|
provide: BaseHttpRequest,
|
|
43
43
|
useClass: AngularHttpRequest,
|
|
44
44
|
},
|
|
45
|
-
`+((
|
|
45
|
+
`+((s=u(o,"each").call(n??(e.nullContext||{}),u(n,"services"),{name:"each",hash:{},fn:e.program(9,t,0),inverse:e.noop,data:t,loc:{start:{line:48,column:2},end:{line:50,column:11}}}))!=null?s:"")+` ]
|
|
46
46
|
})
|
|
47
|
-
export class `+((
|
|
48
|
-
`},9:function(e,n,
|
|
49
|
-
`},11:function(e,n,
|
|
47
|
+
export class `+((s=i(a(u(u(t,"root"),"$config"),"name",{start:{line:53,column:16},end:{line:53,column:34}}),n))!=null?s:"")+` {}
|
|
48
|
+
`},9:function(e,n,o,r,t){var s,a=e.lookupProperty||function(i,u){if(Object.prototype.hasOwnProperty.call(i,u))return i[u]};return " "+((s=a(o,"transformServiceName").call(n??(e.nullContext||{}),a(n,"name"),{name:"transformServiceName",hash:{},data:t,loc:{start:{line:49,column:2},end:{line:49,column:33}}}))!=null?s:"")+`,
|
|
49
|
+
`},11:function(e,n,o,r,t){var s,a=e.strict,i=e.lambda,u=n??(e.nullContext||{}),l=e.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return `type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;
|
|
50
50
|
|
|
51
|
-
export class `+((
|
|
51
|
+
export class `+((s=i(a(l(l(t,"root"),"$config"),"name",{start:{line:57,column:16},end:{line:57,column:34}}),n))!=null?s:"")+` {
|
|
52
52
|
|
|
53
|
-
`+((
|
|
53
|
+
`+((s=l(o,"each").call(u,l(n,"services"),{name:"each",hash:{},fn:e.program(12,t,0),inverse:e.noop,data:t,loc:{start:{line:59,column:1},end:{line:61,column:10}}}))!=null?s:"")+`
|
|
54
54
|
public readonly request: BaseHttpRequest;
|
|
55
55
|
|
|
56
|
-
constructor(config?: Partial<OpenAPIConfig>, HttpRequest: HttpRequestConstructor = `+((
|
|
56
|
+
constructor(config?: Partial<OpenAPIConfig>, HttpRequest: HttpRequestConstructor = `+((s=i(a(n,"httpRequest",{start:{line:65,column:87},end:{line:65,column:98}}),n))!=null?s:"")+`) {
|
|
57
57
|
this.request = new HttpRequest({
|
|
58
|
-
BASE: config?.BASE ?? '`+((
|
|
59
|
-
VERSION: config?.VERSION ?? '`+((
|
|
58
|
+
BASE: config?.BASE ?? '`+((s=i(a(n,"server",{start:{line:67,column:29},end:{line:67,column:35}}),n))!=null?s:"")+`',
|
|
59
|
+
VERSION: config?.VERSION ?? '`+((s=i(a(n,"version",{start:{line:68,column:35},end:{line:68,column:42}}),n))!=null?s:"")+`',
|
|
60
60
|
WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
|
|
61
61
|
CREDENTIALS: config?.CREDENTIALS ?? 'include',
|
|
62
62
|
TOKEN: config?.TOKEN,
|
|
@@ -70,13 +70,13 @@ export class `+((o=i(a(l(l(r,"root"),"$config"),"name",{start:{line:57,column:16
|
|
|
70
70
|
},
|
|
71
71
|
});
|
|
72
72
|
|
|
73
|
-
`+((
|
|
73
|
+
`+((s=l(o,"each").call(u,l(n,"services"),{name:"each",hash:{},fn:e.program(14,t,0),inverse:e.noop,data:t,loc:{start:{line:82,column:2},end:{line:84,column:11}}}))!=null?s:"")+` }
|
|
74
74
|
}
|
|
75
|
-
`},12:function(e,n,
|
|
76
|
-
`},14:function(e,n,
|
|
77
|
-
`},compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
78
|
-
`+((
|
|
79
|
-
`+((
|
|
75
|
+
`},12:function(e,n,o,r,t){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(u,l){if(Object.prototype.hasOwnProperty.call(u,l))return u[l]};return " public readonly "+((s=i(o,"camelCase").call(a,i(n,"name"),{name:"camelCase",hash:{},data:t,loc:{start:{line:60,column:17},end:{line:60,column:37}}}))!=null?s:"")+": "+((s=i(o,"transformServiceName").call(a,i(n,"name"),{name:"transformServiceName",hash:{},data:t,loc:{start:{line:60,column:39},end:{line:60,column:70}}}))!=null?s:"")+`;
|
|
76
|
+
`},14:function(e,n,o,r,t){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(u,l){if(Object.prototype.hasOwnProperty.call(u,l))return u[l]};return " this."+((s=i(o,"camelCase").call(a,i(n,"name"),{name:"camelCase",hash:{},data:t,loc:{start:{line:83,column:7},end:{line:83,column:27}}}))!=null?s:"")+" = new "+((s=i(o,"transformServiceName").call(a,i(n,"name"),{name:"transformServiceName",hash:{},data:t,loc:{start:{line:83,column:34},end:{line:83,column:65}}}))!=null?s:"")+`(this.request);
|
|
77
|
+
`},compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(u,l){if(Object.prototype.hasOwnProperty.call(u,l))return u[l]};return ((s=i(o,"equals").call(a,i(i(i(i(t,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(1,t,0),inverse:e.program(3,t,0),data:t,loc:{start:{line:1,column:0},end:{line:15,column:11}}}))!=null?s:"")+`
|
|
78
|
+
`+((s=i(o,"if").call(a,i(n,"services"),{name:"if",hash:{},fn:e.program(5,t,0),inverse:e.noop,data:t,loc:{start:{line:17,column:0},end:{line:21,column:7}}}))!=null?s:"")+`
|
|
79
|
+
`+((s=i(o,"equals").call(a,i(i(i(i(t,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(8,t,0),inverse:e.program(11,t,0),data:t,loc:{start:{line:23,column:0},end:{line:87,column:11}}}))!=null?s:"")},useData:true};var Cn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getHeaders = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>): Observable<HttpHeaders> => {
|
|
80
80
|
return forkJoin({
|
|
81
81
|
// @ts-ignore
|
|
82
82
|
token: resolve(options, config.TOKEN),
|
|
@@ -123,7 +123,7 @@ export class `+((o=i(a(l(l(r,"root"),"$config"),"name",{start:{line:57,column:16
|
|
|
123
123
|
return new HttpHeaders(headers);
|
|
124
124
|
}),
|
|
125
125
|
);
|
|
126
|
-
};`},useData:true};var bn={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
126
|
+
};`},useData:true};var bn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getRequestBody = (options: ApiRequestOptions): unknown => {
|
|
127
127
|
if (options.body) {
|
|
128
128
|
if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) {
|
|
129
129
|
return JSON.stringify(options.body);
|
|
@@ -134,12 +134,12 @@ export class `+((o=i(a(l(l(r,"root"),"$config"),"name",{start:{line:57,column:16
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
return undefined;
|
|
137
|
-
};`},useData:true};var qn={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
137
|
+
};`},useData:true};var qn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getResponseBody = <T>(response: HttpResponse<T>): T | undefined => {
|
|
138
138
|
if (response.status !== 204 && response.body !== null) {
|
|
139
139
|
return response.body;
|
|
140
140
|
}
|
|
141
141
|
return undefined;
|
|
142
|
-
};`},useData:true};var An={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
142
|
+
};`},useData:true};var An={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getResponseHeader = <T>(response: HttpResponse<T>, responseHeader?: string): string | undefined => {
|
|
143
143
|
if (responseHeader) {
|
|
144
144
|
const value = response.headers.get(responseHeader);
|
|
145
145
|
if (isString(value)) {
|
|
@@ -147,7 +147,7 @@ export class `+((o=i(a(l(l(r,"root"),"$config"),"name",{start:{line:57,column:16
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
return undefined;
|
|
150
|
-
};`},useData:true};var Tn={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
150
|
+
};`},useData:true};var Tn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){var s,a=e.lookupProperty||function(i,u){if(Object.prototype.hasOwnProperty.call(i,u))return i[u]};return `import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
151
151
|
import type { HttpResponse, HttpErrorResponse } from '@angular/common/http';
|
|
152
152
|
import { forkJoin, of, throwError } from 'rxjs';
|
|
153
153
|
import { catchError, map, switchMap } from 'rxjs/operators';
|
|
@@ -158,35 +158,35 @@ import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
|
158
158
|
import type { ApiResult } from './ApiResult';
|
|
159
159
|
import type { OpenAPIConfig } from './OpenAPI';
|
|
160
160
|
|
|
161
|
-
`+((
|
|
161
|
+
`+((s=e.invokePartial(a(r,"functions/isString"),n,{name:"functions/isString",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
162
162
|
|
|
163
|
-
`+((
|
|
163
|
+
`+((s=e.invokePartial(a(r,"functions/isStringWithValue"),n,{name:"functions/isStringWithValue",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
164
164
|
|
|
165
|
-
`+((
|
|
165
|
+
`+((s=e.invokePartial(a(r,"functions/isBlob"),n,{name:"functions/isBlob",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
166
166
|
|
|
167
|
-
`+((
|
|
167
|
+
`+((s=e.invokePartial(a(r,"functions/isFormData"),n,{name:"functions/isFormData",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
168
168
|
|
|
169
|
-
`+((
|
|
169
|
+
`+((s=e.invokePartial(a(r,"functions/base64"),n,{name:"functions/base64",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
170
170
|
|
|
171
|
-
`+((
|
|
171
|
+
`+((s=e.invokePartial(a(r,"functions/getQueryString"),n,{name:"functions/getQueryString",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
172
172
|
|
|
173
|
-
`+((
|
|
173
|
+
`+((s=e.invokePartial(a(r,"functions/getUrl"),n,{name:"functions/getUrl",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
174
174
|
|
|
175
|
-
`+((
|
|
175
|
+
`+((s=e.invokePartial(a(r,"functions/getFormData"),n,{name:"functions/getFormData",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
176
176
|
|
|
177
|
-
`+((
|
|
177
|
+
`+((s=e.invokePartial(a(r,"functions/resolve"),n,{name:"functions/resolve",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
178
178
|
|
|
179
|
-
`+((
|
|
179
|
+
`+((s=e.invokePartial(a(r,"angular/getHeaders"),n,{name:"angular/getHeaders",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
180
180
|
|
|
181
|
-
`+((
|
|
181
|
+
`+((s=e.invokePartial(a(r,"angular/getRequestBody"),n,{name:"angular/getRequestBody",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
182
182
|
|
|
183
|
-
`+((
|
|
183
|
+
`+((s=e.invokePartial(a(r,"angular/sendRequest"),n,{name:"angular/sendRequest",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
184
184
|
|
|
185
|
-
`+((
|
|
185
|
+
`+((s=e.invokePartial(a(r,"angular/getResponseHeader"),n,{name:"angular/getResponseHeader",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
186
186
|
|
|
187
|
-
`+((
|
|
187
|
+
`+((s=e.invokePartial(a(r,"angular/getResponseBody"),n,{name:"angular/getResponseBody",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
188
188
|
|
|
189
|
-
`+((
|
|
189
|
+
`+((s=e.invokePartial(a(r,"functions/catchErrorCodes"),n,{name:"functions/catchErrorCodes",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
192
|
* Request method
|
|
@@ -245,7 +245,7 @@ export const request = <T>(config: OpenAPIConfig, http: HttpClient, options: Api
|
|
|
245
245
|
return throwError(() => error);
|
|
246
246
|
}),
|
|
247
247
|
);
|
|
248
|
-
};`},usePartial:true,useData:true};var kn={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
248
|
+
};`},usePartial:true,useData:true};var kn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const sendRequest = <T>(
|
|
249
249
|
config: OpenAPIConfig,
|
|
250
250
|
options: ApiRequestOptions<T>,
|
|
251
251
|
http: HttpClient,
|
|
@@ -260,7 +260,7 @@ export const request = <T>(config: OpenAPIConfig, http: HttpClient, options: Api
|
|
|
260
260
|
withCredentials: config.WITH_CREDENTIALS,
|
|
261
261
|
observe: 'response',
|
|
262
262
|
});
|
|
263
|
-
};`},useData:true};var On={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
263
|
+
};`},useData:true};var On={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
264
264
|
import type { ApiResult } from './ApiResult';
|
|
265
265
|
|
|
266
266
|
export class ApiError extends Error {
|
|
@@ -280,7 +280,7 @@ export class ApiError extends Error {
|
|
|
280
280
|
this.body = response.body;
|
|
281
281
|
this.request = request;
|
|
282
282
|
}
|
|
283
|
-
}`},useData:true};var
|
|
283
|
+
}`},useData:true};var wn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export type ApiRequestOptions<T = unknown> = {
|
|
284
284
|
readonly body?: any;
|
|
285
285
|
readonly cookies?: Record<string, unknown>;
|
|
286
286
|
readonly errors?: Record<number | string, string>;
|
|
@@ -300,13 +300,13 @@ export class ApiError extends Error {
|
|
|
300
300
|
readonly responseHeader?: string;
|
|
301
301
|
readonly responseTransformer?: (data: unknown) => Promise<T>;
|
|
302
302
|
readonly url: string;
|
|
303
|
-
};`},useData:true};var
|
|
303
|
+
};`},useData:true};var En={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export type ApiResult<TData = any> = {
|
|
304
304
|
readonly body: TData;
|
|
305
305
|
readonly ok: boolean;
|
|
306
306
|
readonly status: number;
|
|
307
307
|
readonly statusText: string;
|
|
308
308
|
readonly url: string;
|
|
309
|
-
};`},useData:true};var Sn={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
309
|
+
};`},useData:true};var Sn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getHeaders = async <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>): Promise<Record<string, string>> => {
|
|
310
310
|
const [token, username, password, additionalHeaders] = await Promise.all([
|
|
311
311
|
// @ts-ignore
|
|
312
312
|
resolve(options, config.TOKEN),
|
|
@@ -355,17 +355,17 @@ export class ApiError extends Error {
|
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
return headers;
|
|
358
|
-
};`},useData:true};var Hn={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
358
|
+
};`},useData:true};var Hn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getRequestBody = (options: ApiRequestOptions): unknown => {
|
|
359
359
|
if (options.body) {
|
|
360
360
|
return options.body;
|
|
361
361
|
}
|
|
362
362
|
return undefined;
|
|
363
|
-
};`},useData:true};var Dn={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
363
|
+
};`},useData:true};var Dn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getResponseBody = (response: AxiosResponse<unknown>): unknown => {
|
|
364
364
|
if (response.status !== 204) {
|
|
365
365
|
return response.data;
|
|
366
366
|
}
|
|
367
367
|
return undefined;
|
|
368
|
-
};`},useData:true};var In={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
368
|
+
};`},useData:true};var In={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getResponseHeader = (response: AxiosResponse<unknown>, responseHeader?: string): string | undefined => {
|
|
369
369
|
if (responseHeader) {
|
|
370
370
|
const content = response.headers[responseHeader];
|
|
371
371
|
if (isString(content)) {
|
|
@@ -373,7 +373,7 @@ export class ApiError extends Error {
|
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
return undefined;
|
|
376
|
-
};`},useData:true};var Bn={1:function(e,n,
|
|
376
|
+
};`},useData:true};var Bn={1:function(e,n,o,r,t){return "ApiResult<T>"},3:function(e,n,o,r,t){return "T"},5:function(e,n,o,r,t){return "result.body"},7:function(e,n,o,r,t){return "result"},compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(u,l){if(Object.prototype.hasOwnProperty.call(u,l))return u[l]};return `import axios from 'axios';
|
|
377
377
|
import type { AxiosError, AxiosRequestConfig, AxiosResponse, AxiosInstance } from 'axios';
|
|
378
378
|
|
|
379
379
|
import { ApiError } from './ApiError';
|
|
@@ -383,47 +383,47 @@ import { CancelablePromise } from './CancelablePromise';
|
|
|
383
383
|
import type { OnCancel } from './CancelablePromise';
|
|
384
384
|
import type { OpenAPIConfig } from './OpenAPI';
|
|
385
385
|
|
|
386
|
-
`+((
|
|
386
|
+
`+((s=e.invokePartial(i(r,"functions/isString"),n,{name:"functions/isString",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
387
387
|
|
|
388
|
-
`+((
|
|
388
|
+
`+((s=e.invokePartial(i(r,"functions/isStringWithValue"),n,{name:"functions/isStringWithValue",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
389
389
|
|
|
390
|
-
`+((
|
|
390
|
+
`+((s=e.invokePartial(i(r,"functions/isBlob"),n,{name:"functions/isBlob",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
391
391
|
|
|
392
|
-
`+((
|
|
392
|
+
`+((s=e.invokePartial(i(r,"functions/isFormData"),n,{name:"functions/isFormData",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
393
393
|
|
|
394
|
-
`+((
|
|
394
|
+
`+((s=e.invokePartial(i(r,"functions/isSuccess"),n,{name:"functions/isSuccess",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
395
395
|
|
|
396
|
-
`+((
|
|
396
|
+
`+((s=e.invokePartial(i(r,"functions/base64"),n,{name:"functions/base64",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
397
397
|
|
|
398
|
-
`+((
|
|
398
|
+
`+((s=e.invokePartial(i(r,"functions/getQueryString"),n,{name:"functions/getQueryString",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
399
399
|
|
|
400
|
-
`+((
|
|
400
|
+
`+((s=e.invokePartial(i(r,"functions/getUrl"),n,{name:"functions/getUrl",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
401
401
|
|
|
402
|
-
`+((
|
|
402
|
+
`+((s=e.invokePartial(i(r,"functions/getFormData"),n,{name:"functions/getFormData",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
403
403
|
|
|
404
|
-
`+((
|
|
404
|
+
`+((s=e.invokePartial(i(r,"functions/resolve"),n,{name:"functions/resolve",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
405
405
|
|
|
406
|
-
`+((
|
|
406
|
+
`+((s=e.invokePartial(i(r,"axios/getHeaders"),n,{name:"axios/getHeaders",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
407
407
|
|
|
408
|
-
`+((
|
|
408
|
+
`+((s=e.invokePartial(i(r,"axios/getRequestBody"),n,{name:"axios/getRequestBody",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
409
409
|
|
|
410
|
-
`+((
|
|
410
|
+
`+((s=e.invokePartial(i(r,"axios/sendRequest"),n,{name:"axios/sendRequest",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
411
411
|
|
|
412
|
-
`+((
|
|
412
|
+
`+((s=e.invokePartial(i(r,"axios/getResponseHeader"),n,{name:"axios/getResponseHeader",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
413
413
|
|
|
414
|
-
`+((
|
|
414
|
+
`+((s=e.invokePartial(i(r,"axios/getResponseBody"),n,{name:"axios/getResponseBody",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
415
415
|
|
|
416
|
-
`+((
|
|
416
|
+
`+((s=e.invokePartial(i(r,"functions/catchErrorCodes"),n,{name:"functions/catchErrorCodes",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
417
417
|
|
|
418
418
|
/**
|
|
419
419
|
* Request method
|
|
420
420
|
* @param config The OpenAPI configuration object
|
|
421
421
|
* @param options The request options from the service
|
|
422
422
|
* @param axiosClient The axios client instance to use
|
|
423
|
-
* @returns CancelablePromise<`+((
|
|
423
|
+
* @returns CancelablePromise<`+((s=i(o,"ifServicesResponse").call(a,"response",{name:"ifServicesResponse",hash:{},fn:e.program(1,t,0),inverse:e.program(3,t,0),data:t,loc:{start:{line:64,column:30},end:{line:64,column:108}}}))!=null?s:"")+`>
|
|
424
424
|
* @throws ApiError
|
|
425
425
|
*/
|
|
426
|
-
export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>, axiosClient: AxiosInstance = axios): CancelablePromise<`+((
|
|
426
|
+
export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>, axiosClient: AxiosInstance = axios): CancelablePromise<`+((s=i(o,"ifServicesResponse").call(a,"response",{name:"ifServicesResponse",hash:{},fn:e.program(1,t,0),inverse:e.program(3,t,0),data:t,loc:{start:{line:67,column:136},end:{line:67,column:214}}}))!=null?s:"")+`> => {
|
|
427
427
|
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
|
428
428
|
try {
|
|
429
429
|
const url = getUrl(config, options);
|
|
@@ -456,13 +456,13 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>,
|
|
|
456
456
|
|
|
457
457
|
catchErrorCodes(options, result);
|
|
458
458
|
|
|
459
|
-
resolve(`+((
|
|
459
|
+
resolve(`+((s=i(o,"ifServicesResponse").call(a,"body",{name:"ifServicesResponse",hash:{},fn:e.program(5,t,0),inverse:e.program(7,t,0),data:t,loc:{start:{line:100,column:12},end:{line:100,column:90}}}))!=null?s:"")+`);
|
|
460
460
|
}
|
|
461
461
|
} catch (error) {
|
|
462
462
|
reject(error);
|
|
463
463
|
}
|
|
464
464
|
});
|
|
465
|
-
};`},usePartial:true,useData:true};var
|
|
465
|
+
};`},usePartial:true,useData:true};var jn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const sendRequest = async <T>(
|
|
466
466
|
config: OpenAPIConfig,
|
|
467
467
|
options: ApiRequestOptions<T>,
|
|
468
468
|
url: string,
|
|
@@ -498,26 +498,26 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>,
|
|
|
498
498
|
}
|
|
499
499
|
throw error;
|
|
500
500
|
}
|
|
501
|
-
};`},useData:true};var
|
|
501
|
+
};`},useData:true};var $n={1:function(e,n,o,r,t){return `import type { HttpClient } from '@angular/common/http';
|
|
502
502
|
import type { Observable } from 'rxjs';
|
|
503
503
|
|
|
504
504
|
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
505
505
|
import type { OpenAPIConfig } from './OpenAPI';
|
|
506
|
-
`},3:function(e,n,
|
|
506
|
+
`},3:function(e,n,o,r,t){return `import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
507
507
|
import type { CancelablePromise } from './CancelablePromise';
|
|
508
508
|
import type { OpenAPIConfig } from './OpenAPI';
|
|
509
|
-
`},5:function(e,n,
|
|
509
|
+
`},5:function(e,n,o,r,t){return ` constructor(
|
|
510
510
|
public readonly config: OpenAPIConfig,
|
|
511
511
|
public readonly http: HttpClient,
|
|
512
512
|
) {}
|
|
513
|
-
`},7:function(e,n,
|
|
514
|
-
`},9:function(e,n,
|
|
515
|
-
`},11:function(e,n,
|
|
516
|
-
`},compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
513
|
+
`},7:function(e,n,o,r,t){return ` constructor(public readonly config: OpenAPIConfig) {}
|
|
514
|
+
`},9:function(e,n,o,r,t){return ` public abstract request<T>(options: ApiRequestOptions<T>): Observable<T>;
|
|
515
|
+
`},11:function(e,n,o,r,t){return ` public abstract request<T>(options: ApiRequestOptions<T>): CancelablePromise<T>;
|
|
516
|
+
`},compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(u,l){if(Object.prototype.hasOwnProperty.call(u,l))return u[l]};return ((s=i(o,"equals").call(a,i(i(i(i(t,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(1,t,0),inverse:e.program(3,t,0),data:t,loc:{start:{line:1,column:0},end:{line:11,column:11}}}))!=null?s:"")+`
|
|
517
517
|
export abstract class BaseHttpRequest {
|
|
518
518
|
|
|
519
|
-
`+((
|
|
520
|
-
`+((
|
|
519
|
+
`+((s=i(o,"equals").call(a,i(i(i(i(t,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(5,t,0),inverse:e.program(7,t,0),data:t,loc:{start:{line:15,column:1},end:{line:22,column:12}}}))!=null?s:"")+`
|
|
520
|
+
`+((s=i(o,"equals").call(a,i(i(i(i(t,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(9,t,0),inverse:e.program(11,t,0),data:t,loc:{start:{line:24,column:1},end:{line:28,column:12}}}))!=null?s:"")+"}"},useData:true};var Nn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export class CancelError extends Error {
|
|
521
521
|
constructor(message: string) {
|
|
522
522
|
super(message);
|
|
523
523
|
this.name = 'CancelError';
|
|
@@ -642,7 +642,7 @@ export class CancelablePromise<T> implements Promise<T> {
|
|
|
642
642
|
public get isCancelled(): boolean {
|
|
643
643
|
return this._isCancelled;
|
|
644
644
|
}
|
|
645
|
-
}`},useData:true};var Fn={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
645
|
+
}`},useData:true};var Fn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getHeaders = async <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>): Promise<Headers> => {
|
|
646
646
|
const [token, username, password, additionalHeaders] = await Promise.all([
|
|
647
647
|
// @ts-ignore
|
|
648
648
|
resolve(options, config.TOKEN),
|
|
@@ -687,7 +687,7 @@ export class CancelablePromise<T> implements Promise<T> {
|
|
|
687
687
|
}
|
|
688
688
|
|
|
689
689
|
return new Headers(headers);
|
|
690
|
-
};`},useData:true};var _n={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
690
|
+
};`},useData:true};var _n={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getRequestBody = (options: ApiRequestOptions): unknown => {
|
|
691
691
|
if (options.body !== undefined) {
|
|
692
692
|
if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) {
|
|
693
693
|
return JSON.stringify(options.body);
|
|
@@ -698,7 +698,7 @@ export class CancelablePromise<T> implements Promise<T> {
|
|
|
698
698
|
}
|
|
699
699
|
}
|
|
700
700
|
return undefined;
|
|
701
|
-
};`},useData:true};var
|
|
701
|
+
};`},useData:true};var Ln={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getResponseBody = async (response: Response): Promise<unknown> => {
|
|
702
702
|
if (response.status !== 204) {
|
|
703
703
|
try {
|
|
704
704
|
const contentType = response.headers.get('Content-Type');
|
|
@@ -719,7 +719,7 @@ export class CancelablePromise<T> implements Promise<T> {
|
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
721
|
return undefined;
|
|
722
|
-
};`},useData:true};var
|
|
722
|
+
};`},useData:true};var Mn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => {
|
|
723
723
|
if (responseHeader) {
|
|
724
724
|
const content = response.headers.get(responseHeader);
|
|
725
725
|
if (isString(content)) {
|
|
@@ -727,54 +727,54 @@ export class CancelablePromise<T> implements Promise<T> {
|
|
|
727
727
|
}
|
|
728
728
|
}
|
|
729
729
|
return undefined;
|
|
730
|
-
};`},useData:true};var
|
|
730
|
+
};`},useData:true};var Wn={1:function(e,n,o,r,t){return `import fetch, { FormData, Headers } from 'node-fetch';
|
|
731
731
|
import type { RequestInit, Response } from 'node-fetch';
|
|
732
732
|
|
|
733
|
-
`},3:function(e,n,
|
|
733
|
+
`},3:function(e,n,o,r,t){return "ApiResult<T>"},5:function(e,n,o,r,t){return "T"},7:function(e,n,o,r,t){return "result.body"},9:function(e,n,o,r,t){return "result"},compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(u,l){if(Object.prototype.hasOwnProperty.call(u,l))return u[l]};return ((s=i(o,"equals").call(a,i(i(i(i(t,"root"),"$config"),"client"),"name"),"legacy/node",{name:"equals",hash:{},fn:e.program(1,t,0),inverse:e.noop,data:t,loc:{start:{line:1,column:0},end:{line:5,column:11}}}))!=null?s:"")+`import { ApiError } from './ApiError';
|
|
734
734
|
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
735
735
|
import type { ApiResult } from './ApiResult';
|
|
736
736
|
import { CancelablePromise } from './CancelablePromise';
|
|
737
737
|
import type { OnCancel } from './CancelablePromise';
|
|
738
738
|
import type { OpenAPIConfig } from './OpenAPI';
|
|
739
739
|
|
|
740
|
-
`+((
|
|
740
|
+
`+((s=e.invokePartial(i(r,"functions/isString"),n,{name:"functions/isString",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
741
741
|
|
|
742
|
-
`+((
|
|
742
|
+
`+((s=e.invokePartial(i(r,"functions/isStringWithValue"),n,{name:"functions/isStringWithValue",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
743
743
|
|
|
744
|
-
`+((
|
|
744
|
+
`+((s=e.invokePartial(i(r,"functions/isBlob"),n,{name:"functions/isBlob",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
745
745
|
|
|
746
|
-
`+((
|
|
746
|
+
`+((s=e.invokePartial(i(r,"functions/isFormData"),n,{name:"functions/isFormData",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
747
747
|
|
|
748
|
-
`+((
|
|
748
|
+
`+((s=e.invokePartial(i(r,"functions/base64"),n,{name:"functions/base64",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
749
749
|
|
|
750
|
-
`+((
|
|
750
|
+
`+((s=e.invokePartial(i(r,"functions/getQueryString"),n,{name:"functions/getQueryString",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
751
751
|
|
|
752
|
-
`+((
|
|
752
|
+
`+((s=e.invokePartial(i(r,"functions/getUrl"),n,{name:"functions/getUrl",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
753
753
|
|
|
754
|
-
`+((
|
|
754
|
+
`+((s=e.invokePartial(i(r,"functions/getFormData"),n,{name:"functions/getFormData",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
755
755
|
|
|
756
|
-
`+((
|
|
756
|
+
`+((s=e.invokePartial(i(r,"functions/resolve"),n,{name:"functions/resolve",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
757
757
|
|
|
758
|
-
`+((
|
|
758
|
+
`+((s=e.invokePartial(i(r,"fetch/getHeaders"),n,{name:"fetch/getHeaders",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
759
759
|
|
|
760
|
-
`+((
|
|
760
|
+
`+((s=e.invokePartial(i(r,"fetch/getRequestBody"),n,{name:"fetch/getRequestBody",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
761
761
|
|
|
762
|
-
`+((
|
|
762
|
+
`+((s=e.invokePartial(i(r,"fetch/sendRequest"),n,{name:"fetch/sendRequest",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
763
763
|
|
|
764
|
-
`+((
|
|
764
|
+
`+((s=e.invokePartial(i(r,"fetch/getResponseHeader"),n,{name:"fetch/getResponseHeader",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
765
765
|
|
|
766
|
-
`+((
|
|
766
|
+
`+((s=e.invokePartial(i(r,"fetch/getResponseBody"),n,{name:"fetch/getResponseBody",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
767
767
|
|
|
768
|
-
`+((
|
|
768
|
+
`+((s=e.invokePartial(i(r,"functions/catchErrorCodes"),n,{name:"functions/catchErrorCodes",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
769
769
|
|
|
770
770
|
/**
|
|
771
771
|
* Request method
|
|
772
772
|
* @param config The OpenAPI configuration object
|
|
773
773
|
* @param options The request options from the service
|
|
774
|
-
* @returns CancelablePromise<`+((
|
|
774
|
+
* @returns CancelablePromise<`+((s=i(o,"ifServicesResponse").call(a,"response",{name:"ifServicesResponse",hash:{},fn:e.program(3,t,0),inverse:e.program(5,t,0),data:t,loc:{start:{line:62,column:30},end:{line:62,column:108}}}))!=null?s:"")+`>
|
|
775
775
|
* @throws ApiError
|
|
776
776
|
*/
|
|
777
|
-
export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>): CancelablePromise<`+((
|
|
777
|
+
export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>): CancelablePromise<`+((s=i(o,"ifServicesResponse").call(a,"response",{name:"ifServicesResponse",hash:{},fn:e.program(3,t,0),inverse:e.program(5,t,0),data:t,loc:{start:{line:65,column:100},end:{line:65,column:178}}}))!=null?s:"")+`> => {
|
|
778
778
|
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
|
779
779
|
try {
|
|
780
780
|
const url = getUrl(config, options);
|
|
@@ -807,16 +807,16 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
807
807
|
|
|
808
808
|
catchErrorCodes(options, result);
|
|
809
809
|
|
|
810
|
-
resolve(`+((
|
|
810
|
+
resolve(`+((s=i(o,"ifServicesResponse").call(a,"body",{name:"ifServicesResponse",hash:{},fn:e.program(7,t,0),inverse:e.program(9,t,0),data:t,loc:{start:{line:98,column:12},end:{line:98,column:90}}}))!=null?s:"")+`);
|
|
811
811
|
}
|
|
812
812
|
} catch (error) {
|
|
813
813
|
reject(error);
|
|
814
814
|
}
|
|
815
815
|
});
|
|
816
|
-
};`},usePartial:true,useData:true};var Un={1:function(e,n,
|
|
816
|
+
};`},usePartial:true,useData:true};var Un={1:function(e,n,o,r,t){return ` if (config.WITH_CREDENTIALS) {
|
|
817
817
|
request.credentials = config.CREDENTIALS;
|
|
818
818
|
}
|
|
819
|
-
`},compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
819
|
+
`},compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){var s,a=e.lookupProperty||function(i,u){if(Object.prototype.hasOwnProperty.call(i,u))return i[u]};return `export const sendRequest = async (
|
|
820
820
|
config: OpenAPIConfig,
|
|
821
821
|
options: ApiRequestOptions,
|
|
822
822
|
url: string,
|
|
@@ -834,7 +834,7 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
834
834
|
signal: controller.signal,
|
|
835
835
|
};
|
|
836
836
|
|
|
837
|
-
`+((
|
|
837
|
+
`+((s=a(o,"equals").call(n??(e.nullContext||{}),a(a(a(a(t,"root"),"$config"),"client"),"name"),"legacy/fetch",{name:"equals",hash:{},fn:e.program(1,t,0),inverse:e.noop,data:t,loc:{start:{line:19,column:1},end:{line:23,column:12}}}))!=null?s:"")+`
|
|
838
838
|
for (const fn of config.interceptors.request._fns) {
|
|
839
839
|
request = await fn(request);
|
|
840
840
|
}
|
|
@@ -842,14 +842,14 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
842
842
|
onCancel(() => controller.abort());
|
|
843
843
|
|
|
844
844
|
return await fetch(url, request);
|
|
845
|
-
};`},useData:true};var Vn={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
845
|
+
};`},useData:true};var Vn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const base64 = (str: string): string => {
|
|
846
846
|
try {
|
|
847
847
|
return btoa(str);
|
|
848
848
|
} catch (err) {
|
|
849
849
|
// @ts-ignore
|
|
850
850
|
return Buffer.from(str).toString('base64');
|
|
851
851
|
}
|
|
852
|
-
};`},useData:true};var Gn={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
852
|
+
};`},useData:true};var Gn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => {
|
|
853
853
|
const errors: Record<number, string> = {
|
|
854
854
|
400: 'Bad Request',
|
|
855
855
|
401: 'Unauthorized',
|
|
@@ -914,7 +914,7 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
914
914
|
\`Generic Error: status: \${errorStatus}; status text: \${errorStatusText}; body: \${errorBody}\`
|
|
915
915
|
);
|
|
916
916
|
}
|
|
917
|
-
};`},useData:true};var zn={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
917
|
+
};`},useData:true};var zn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getFormData = (options: ApiRequestOptions): FormData | undefined => {
|
|
918
918
|
if (options.formData) {
|
|
919
919
|
const formData = new FormData();
|
|
920
920
|
|
|
@@ -939,7 +939,7 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
939
939
|
return formData;
|
|
940
940
|
}
|
|
941
941
|
return undefined;
|
|
942
|
-
};`},useData:true};var Kn={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
942
|
+
};`},useData:true};var Kn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getQueryString = (params: Record<string, unknown>): string => {
|
|
943
943
|
const qs: string[] = [];
|
|
944
944
|
|
|
945
945
|
const append = (key: string, value: unknown) => {
|
|
@@ -965,7 +965,7 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
965
965
|
Object.entries(params).forEach(([key, value]) => encodePair(key, value));
|
|
966
966
|
|
|
967
967
|
return qs.length ? \`?\${qs.join('&')}\` : '';
|
|
968
|
-
};`},useData:true};var Xn={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
968
|
+
};`},useData:true};var Xn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {
|
|
969
969
|
const encoder = config.ENCODE_PATH || encodeURI;
|
|
970
970
|
|
|
971
971
|
const path = options.url
|
|
@@ -979,24 +979,24 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
979
979
|
|
|
980
980
|
const url = config.BASE + path;
|
|
981
981
|
return options.query ? url + getQueryString(options.query) : url;
|
|
982
|
-
};`},useData:true};var Qn={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
982
|
+
};`},useData:true};var Qn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const isBlob = (value: any): value is Blob => {
|
|
983
983
|
return value instanceof Blob;
|
|
984
|
-
};`},useData:true};var Jn={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
984
|
+
};`},useData:true};var Jn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const isFormData = (value: unknown): value is FormData => {
|
|
985
985
|
return value instanceof FormData;
|
|
986
|
-
};`},useData:true};var Yn={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
986
|
+
};`},useData:true};var Yn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const isString = (value: unknown): value is string => {
|
|
987
987
|
return typeof value === 'string';
|
|
988
|
-
};`},useData:true};var Zn={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
988
|
+
};`},useData:true};var Zn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const isStringWithValue = (value: unknown): value is string => {
|
|
989
989
|
return isString(value) && value !== '';
|
|
990
|
-
};`},useData:true};var et={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
990
|
+
};`},useData:true};var et={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const isSuccess = (status: number): boolean => {
|
|
991
991
|
return status >= 200 && status < 300;
|
|
992
|
-
};`},useData:true};var nt={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
992
|
+
};`},useData:true};var nt={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `type Resolver<T> = (options: ApiRequestOptions<T>) => Promise<T>;
|
|
993
993
|
|
|
994
994
|
export const resolve = async <T>(options: ApiRequestOptions<T>, resolver?: T | Resolver<T>): Promise<T | undefined> => {
|
|
995
995
|
if (typeof resolver === 'function') {
|
|
996
996
|
return (resolver as Resolver<T>)(options);
|
|
997
997
|
}
|
|
998
998
|
return resolver;
|
|
999
|
-
};`},useData:true};var tt={1:function(e,n,
|
|
999
|
+
};`},useData:true};var tt={1:function(e,n,o,r,t){return `import { Inject, Injectable } from '@angular/core';
|
|
1000
1000
|
import { HttpClient } from '@angular/common/http';
|
|
1001
1001
|
import type { Observable } from 'rxjs';
|
|
1002
1002
|
|
|
@@ -1005,23 +1005,23 @@ import { BaseHttpRequest } from './BaseHttpRequest';
|
|
|
1005
1005
|
import type { OpenAPIConfig } from './OpenAPI';
|
|
1006
1006
|
import { OpenAPI } from './OpenAPI';
|
|
1007
1007
|
import { request as __request } from './request';
|
|
1008
|
-
`},3:function(e,n,
|
|
1008
|
+
`},3:function(e,n,o,r,t){return `import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
1009
1009
|
import { BaseHttpRequest } from './BaseHttpRequest';
|
|
1010
1010
|
import type { CancelablePromise } from './CancelablePromise';
|
|
1011
1011
|
import type { OpenAPIConfig } from './OpenAPI';
|
|
1012
1012
|
import { request as __request } from './request';
|
|
1013
|
-
`},5:function(e,n,
|
|
1014
|
-
`},7:function(e,n,
|
|
1013
|
+
`},5:function(e,n,o,r,t){return `@Injectable()
|
|
1014
|
+
`},7:function(e,n,o,r,t){return ` constructor(
|
|
1015
1015
|
@Inject(OpenAPI)
|
|
1016
1016
|
config: OpenAPIConfig,
|
|
1017
1017
|
http: HttpClient,
|
|
1018
1018
|
) {
|
|
1019
1019
|
super(config, http);
|
|
1020
1020
|
}
|
|
1021
|
-
`},9:function(e,n,
|
|
1021
|
+
`},9:function(e,n,o,r,t){return ` constructor(config: OpenAPIConfig) {
|
|
1022
1022
|
super(config);
|
|
1023
1023
|
}
|
|
1024
|
-
`},11:function(e,n,
|
|
1024
|
+
`},11:function(e,n,o,r,t){return ` /**
|
|
1025
1025
|
* Request method
|
|
1026
1026
|
* @param options The request options from the service
|
|
1027
1027
|
* @returns Observable<T>
|
|
@@ -1030,7 +1030,7 @@ import { request as __request } from './request';
|
|
|
1030
1030
|
public override request<T>(options: ApiRequestOptions<T>): Observable<T> {
|
|
1031
1031
|
return __request(this.config, this.http, options);
|
|
1032
1032
|
}
|
|
1033
|
-
`},13:function(e,n,
|
|
1033
|
+
`},13:function(e,n,o,r,t){return ` /**
|
|
1034
1034
|
* Request method
|
|
1035
1035
|
* @param options The request options from the service
|
|
1036
1036
|
* @returns CancelablePromise<T>
|
|
@@ -1039,22 +1039,22 @@ import { request as __request } from './request';
|
|
|
1039
1039
|
public override request<T>(options: ApiRequestOptions<T>): CancelablePromise<T> {
|
|
1040
1040
|
return __request(this.config, options);
|
|
1041
1041
|
}
|
|
1042
|
-
`},compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
1043
|
-
`+((
|
|
1044
|
-
|
|
1045
|
-
`+((
|
|
1046
|
-
`+((
|
|
1047
|
-
`},3:function(e,n,
|
|
1048
|
-
`},5:function(e,n,
|
|
1049
|
-
`},7:function(e,n,
|
|
1050
|
-
`},9:function(e,n,
|
|
1042
|
+
`},compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(u,l){if(Object.prototype.hasOwnProperty.call(u,l))return u[l]};return ((s=i(o,"equals").call(a,i(i(i(i(t,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(1,t,0),inverse:e.program(3,t,0),data:t,loc:{start:{line:1,column:0},end:{line:17,column:11}}}))!=null?s:"")+`
|
|
1043
|
+
`+((s=i(o,"equals").call(a,i(i(i(i(t,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(5,t,0),inverse:e.noop,data:t,loc:{start:{line:19,column:0},end:{line:21,column:11}}}))!=null?s:"")+"export class "+((s=e.lambda(e.strict(n,"httpRequest",{start:{line:22,column:15},end:{line:22,column:26}}),n))!=null?s:"")+` extends BaseHttpRequest {
|
|
1044
|
+
|
|
1045
|
+
`+((s=i(o,"equals").call(a,i(i(i(i(t,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(7,t,0),inverse:e.program(9,t,0),data:t,loc:{start:{line:24,column:1},end:{line:36,column:12}}}))!=null?s:"")+`
|
|
1046
|
+
`+((s=i(o,"equals").call(a,i(i(i(i(t,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(11,t,0),inverse:e.program(13,t,0),data:t,loc:{start:{line:38,column:1},end:{line:58,column:12}}}))!=null?s:"")+"}"},useData:true};var rt={1:function(e,n,o,r,t){return `import type { HttpResponse } from '@angular/common/http';
|
|
1047
|
+
`},3:function(e,n,o,r,t){return `import type { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
1048
|
+
`},5:function(e,n,o,r,t){return `import type { RequestInit, Response } from 'node-fetch';
|
|
1049
|
+
`},7:function(e,n,o,r,t){return ` response: Interceptors<HttpResponse<any>>;
|
|
1050
|
+
`},9:function(e,n,o,r,t){return ` request: Interceptors<AxiosRequestConfig>;
|
|
1051
1051
|
response: Interceptors<AxiosResponse>;
|
|
1052
|
-
`},11:function(e,n,
|
|
1052
|
+
`},11:function(e,n,o,r,t){return ` request: Interceptors<RequestInit>;
|
|
1053
1053
|
response: Interceptors<Response>;
|
|
1054
|
-
`},13:function(e,n,
|
|
1054
|
+
`},13:function(e,n,o,r,t){return ` request: Interceptors<XMLHttpRequest>;
|
|
1055
1055
|
response: Interceptors<XMLHttpRequest>;
|
|
1056
|
-
`},15:function(e,n,
|
|
1057
|
-
`},compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
1056
|
+
`},15:function(e,n,o,r,t){return ` request: new Interceptors(),
|
|
1057
|
+
`},compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){var s,a=n??(e.nullContext||{}),i=e.strict,u=e.lambda,l=e.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return ((s=l(o,"equals").call(a,l(l(l(l(t,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(1,t,0),inverse:e.noop,data:t,loc:{start:{line:1,column:0},end:{line:3,column:11}}}))!=null?s:"")+((s=l(o,"equals").call(a,l(l(l(l(t,"root"),"$config"),"client"),"name"),"legacy/axios",{name:"equals",hash:{},fn:e.program(3,t,0),inverse:e.noop,data:t,loc:{start:{line:4,column:0},end:{line:6,column:11}}}))!=null?s:"")+((s=l(o,"equals").call(a,l(l(l(l(t,"root"),"$config"),"client"),"name"),"legacy/node",{name:"equals",hash:{},fn:e.program(5,t,0),inverse:e.noop,data:t,loc:{start:{line:7,column:0},end:{line:9,column:11}}}))!=null?s:"")+`import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
1058
1058
|
|
|
1059
1059
|
type Headers = Record<string, string>;
|
|
1060
1060
|
type Middleware<T> = (value: T) => T | Promise<T>;
|
|
@@ -1090,23 +1090,23 @@ export type OpenAPIConfig = {
|
|
|
1090
1090
|
VERSION: string;
|
|
1091
1091
|
WITH_CREDENTIALS: boolean;
|
|
1092
1092
|
interceptors: {
|
|
1093
|
-
`+((
|
|
1093
|
+
`+((s=l(o,"equals").call(a,l(l(l(l(t,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(7,t,0),inverse:e.noop,data:t,loc:{start:{line:46,column:2},end:{line:48,column:13}}}))!=null?s:"")+((s=l(o,"equals").call(a,l(l(l(l(t,"root"),"$config"),"client"),"name"),"legacy/axios",{name:"equals",hash:{},fn:e.program(9,t,0),inverse:e.noop,data:t,loc:{start:{line:49,column:2},end:{line:52,column:13}}}))!=null?s:"")+((s=l(o,"equals").call(a,l(l(l(l(t,"root"),"$config"),"client"),"name"),"legacy/fetch",{name:"equals",hash:{},fn:e.program(11,t,0),inverse:e.noop,data:t,loc:{start:{line:53,column:2},end:{line:56,column:13}}}))!=null?s:"")+((s=l(o,"equals").call(a,l(l(l(l(t,"root"),"$config"),"client"),"name"),"legacy/node",{name:"equals",hash:{},fn:e.program(11,t,0),inverse:e.noop,data:t,loc:{start:{line:57,column:2},end:{line:60,column:13}}}))!=null?s:"")+((s=l(o,"equals").call(a,l(l(l(l(t,"root"),"$config"),"client"),"name"),"legacy/xhr",{name:"equals",hash:{},fn:e.program(13,t,0),inverse:e.noop,data:t,loc:{start:{line:61,column:2},end:{line:64,column:13}}}))!=null?s:"")+` };
|
|
1094
1094
|
};
|
|
1095
1095
|
|
|
1096
1096
|
export const OpenAPI: OpenAPIConfig = {
|
|
1097
|
-
BASE: '`+((
|
|
1097
|
+
BASE: '`+((s=u(i(n,"server",{start:{line:69,column:11},end:{line:69,column:17}}),n))!=null?s:"")+`',
|
|
1098
1098
|
CREDENTIALS: 'include',
|
|
1099
1099
|
ENCODE_PATH: undefined,
|
|
1100
1100
|
HEADERS: undefined,
|
|
1101
1101
|
PASSWORD: undefined,
|
|
1102
1102
|
TOKEN: undefined,
|
|
1103
1103
|
USERNAME: undefined,
|
|
1104
|
-
VERSION: '`+((
|
|
1104
|
+
VERSION: '`+((s=u(i(n,"version",{start:{line:76,column:14},end:{line:76,column:21}}),n))!=null?s:"")+`',
|
|
1105
1105
|
WITH_CREDENTIALS: false,
|
|
1106
1106
|
interceptors: {
|
|
1107
|
-
`+((
|
|
1107
|
+
`+((s=l(o,"notEquals").call(a,l(l(l(l(t,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"notEquals",hash:{},fn:e.program(15,t,0),inverse:e.noop,data:t,loc:{start:{line:79,column:2},end:{line:81,column:16}}}))!=null?s:"")+` response: new Interceptors(),
|
|
1108
1108
|
},
|
|
1109
|
-
};`},useData:true};var ot={1:function(e,n,
|
|
1109
|
+
};`},useData:true};var ot={1:function(e,n,o,r,t){var s,a=e.lookupProperty||function(i,u){if(Object.prototype.hasOwnProperty.call(i,u))return i[u]};return (s=e.invokePartial(a(r,"angular/request"),n,{name:"angular/request",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:""},3:function(e,n,o,r,t){var s,a=e.lookupProperty||function(i,u){if(Object.prototype.hasOwnProperty.call(i,u))return i[u]};return (s=e.invokePartial(a(r,"axios/request"),n,{name:"axios/request",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:""},5:function(e,n,o,r,t){var s,a=e.lookupProperty||function(i,u){if(Object.prototype.hasOwnProperty.call(i,u))return i[u]};return (s=e.invokePartial(a(r,"fetch/request"),n,{name:"fetch/request",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:""},7:function(e,n,o,r,t){var s,a=e.lookupProperty||function(i,u){if(Object.prototype.hasOwnProperty.call(i,u))return i[u]};return (s=e.invokePartial(a(r,"xhr/request"),n,{name:"xhr/request",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:""},compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(u,l){if(Object.prototype.hasOwnProperty.call(u,l))return u[l]};return ((s=i(o,"equals").call(a,i(i(i(i(t,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(1,t,0),inverse:e.noop,data:t,loc:{start:{line:1,column:0},end:{line:1,column:87}}}))!=null?s:"")+((s=i(o,"equals").call(a,i(i(i(i(t,"root"),"$config"),"client"),"name"),"legacy/axios",{name:"equals",hash:{},fn:e.program(3,t,0),inverse:e.noop,data:t,loc:{start:{line:2,column:0},end:{line:2,column:83}}}))!=null?s:"")+((s=i(o,"equals").call(a,i(i(i(i(t,"root"),"$config"),"client"),"name"),"legacy/fetch",{name:"equals",hash:{},fn:e.program(5,t,0),inverse:e.noop,data:t,loc:{start:{line:3,column:0},end:{line:3,column:83}}}))!=null?s:"")+((s=i(o,"equals").call(a,i(i(i(i(t,"root"),"$config"),"client"),"name"),"legacy/node",{name:"equals",hash:{},fn:e.program(5,t,0),inverse:e.noop,data:t,loc:{start:{line:4,column:0},end:{line:4,column:82}}}))!=null?s:"")+((s=i(o,"equals").call(a,i(i(i(i(t,"root"),"$config"),"client"),"name"),"legacy/xhr",{name:"equals",hash:{},fn:e.program(7,t,0),inverse:e.noop,data:t,loc:{start:{line:5,column:0},end:{line:5,column:79}}}))!=null?s:"")},usePartial:true,useData:true};var st={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getHeaders = async <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>): Promise<Headers> => {
|
|
1110
1110
|
const [token, username, password, additionalHeaders] = await Promise.all([
|
|
1111
1111
|
// @ts-ignore
|
|
1112
1112
|
resolve(options, config.TOKEN),
|
|
@@ -1151,7 +1151,7 @@ export const OpenAPI: OpenAPIConfig = {
|
|
|
1151
1151
|
}
|
|
1152
1152
|
|
|
1153
1153
|
return new Headers(headers);
|
|
1154
|
-
};`},useData:true};var it={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
1154
|
+
};`},useData:true};var it={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getRequestBody = (options: ApiRequestOptions): unknown => {
|
|
1155
1155
|
if (options.body !== undefined) {
|
|
1156
1156
|
if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) {
|
|
1157
1157
|
return JSON.stringify(options.body);
|
|
@@ -1162,7 +1162,7 @@ export const OpenAPI: OpenAPIConfig = {
|
|
|
1162
1162
|
}
|
|
1163
1163
|
}
|
|
1164
1164
|
return undefined;
|
|
1165
|
-
};`},useData:true};var at={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
1165
|
+
};`},useData:true};var at={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getResponseBody = (xhr: XMLHttpRequest): unknown => {
|
|
1166
1166
|
if (xhr.status !== 204) {
|
|
1167
1167
|
try {
|
|
1168
1168
|
const contentType = xhr.getResponseHeader('Content-Type');
|
|
@@ -1178,7 +1178,7 @@ export const OpenAPI: OpenAPIConfig = {
|
|
|
1178
1178
|
}
|
|
1179
1179
|
}
|
|
1180
1180
|
return undefined;
|
|
1181
|
-
};`},useData:true};var lt={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
1181
|
+
};`},useData:true};var lt={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const getResponseHeader = (xhr: XMLHttpRequest, responseHeader?: string): string | undefined => {
|
|
1182
1182
|
if (responseHeader) {
|
|
1183
1183
|
const content = xhr.getResponseHeader(responseHeader);
|
|
1184
1184
|
if (isString(content)) {
|
|
@@ -1186,53 +1186,53 @@ export const OpenAPI: OpenAPIConfig = {
|
|
|
1186
1186
|
}
|
|
1187
1187
|
}
|
|
1188
1188
|
return undefined;
|
|
1189
|
-
};`},useData:true};var ut={1:function(e,n,
|
|
1189
|
+
};`},useData:true};var ut={1:function(e,n,o,r,t){return "ApiResult<T>"},3:function(e,n,o,r,t){return "T"},5:function(e,n,o,r,t){return "result.body"},7:function(e,n,o,r,t){return "result"},compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(u,l){if(Object.prototype.hasOwnProperty.call(u,l))return u[l]};return `import { ApiError } from './ApiError';
|
|
1190
1190
|
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
1191
1191
|
import type { ApiResult } from './ApiResult';
|
|
1192
1192
|
import { CancelablePromise } from './CancelablePromise';
|
|
1193
1193
|
import type { OnCancel } from './CancelablePromise';
|
|
1194
1194
|
import type { OpenAPIConfig } from './OpenAPI';
|
|
1195
1195
|
|
|
1196
|
-
`+((
|
|
1196
|
+
`+((s=e.invokePartial(i(r,"functions/isString"),n,{name:"functions/isString",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
1197
1197
|
|
|
1198
|
-
`+((
|
|
1198
|
+
`+((s=e.invokePartial(i(r,"functions/isStringWithValue"),n,{name:"functions/isStringWithValue",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
1199
1199
|
|
|
1200
|
-
`+((
|
|
1200
|
+
`+((s=e.invokePartial(i(r,"functions/isBlob"),n,{name:"functions/isBlob",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
1201
1201
|
|
|
1202
|
-
`+((
|
|
1202
|
+
`+((s=e.invokePartial(i(r,"functions/isFormData"),n,{name:"functions/isFormData",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
1203
1203
|
|
|
1204
|
-
`+((
|
|
1204
|
+
`+((s=e.invokePartial(i(r,"functions/isSuccess"),n,{name:"functions/isSuccess",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
1205
1205
|
|
|
1206
|
-
`+((
|
|
1206
|
+
`+((s=e.invokePartial(i(r,"functions/base64"),n,{name:"functions/base64",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
1207
1207
|
|
|
1208
|
-
`+((
|
|
1208
|
+
`+((s=e.invokePartial(i(r,"functions/getQueryString"),n,{name:"functions/getQueryString",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
1209
1209
|
|
|
1210
|
-
`+((
|
|
1210
|
+
`+((s=e.invokePartial(i(r,"functions/getUrl"),n,{name:"functions/getUrl",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
1211
1211
|
|
|
1212
|
-
`+((
|
|
1212
|
+
`+((s=e.invokePartial(i(r,"functions/getFormData"),n,{name:"functions/getFormData",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
1213
1213
|
|
|
1214
|
-
`+((
|
|
1214
|
+
`+((s=e.invokePartial(i(r,"functions/resolve"),n,{name:"functions/resolve",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
1215
1215
|
|
|
1216
|
-
`+((
|
|
1216
|
+
`+((s=e.invokePartial(i(r,"fetch/getHeaders"),n,{name:"fetch/getHeaders",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
1217
1217
|
|
|
1218
|
-
`+((
|
|
1218
|
+
`+((s=e.invokePartial(i(r,"xhr/getRequestBody"),n,{name:"xhr/getRequestBody",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
1219
1219
|
|
|
1220
|
-
`+((
|
|
1220
|
+
`+((s=e.invokePartial(i(r,"xhr/sendRequest"),n,{name:"xhr/sendRequest",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
1221
1221
|
|
|
1222
|
-
`+((
|
|
1222
|
+
`+((s=e.invokePartial(i(r,"xhr/getResponseHeader"),n,{name:"xhr/getResponseHeader",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
1223
1223
|
|
|
1224
|
-
`+((
|
|
1224
|
+
`+((s=e.invokePartial(i(r,"xhr/getResponseBody"),n,{name:"xhr/getResponseBody",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
1225
1225
|
|
|
1226
|
-
`+((
|
|
1226
|
+
`+((s=e.invokePartial(i(r,"functions/catchErrorCodes"),n,{name:"functions/catchErrorCodes",data:t,helpers:o,partials:r,decorators:e.decorators}))!=null?s:"")+`
|
|
1227
1227
|
|
|
1228
1228
|
/**
|
|
1229
1229
|
* Request method
|
|
1230
1230
|
* @param config The OpenAPI configuration object
|
|
1231
1231
|
* @param options The request options from the service
|
|
1232
|
-
* @returns CancelablePromise<`+((
|
|
1232
|
+
* @returns CancelablePromise<`+((s=i(o,"ifServicesResponse").call(a,"response",{name:"ifServicesResponse",hash:{},fn:e.program(1,t,0),inverse:e.program(3,t,0),data:t,loc:{start:{line:60,column:30},end:{line:60,column:108}}}))!=null?s:"")+`>
|
|
1233
1233
|
* @throws ApiError
|
|
1234
1234
|
*/
|
|
1235
|
-
export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>): CancelablePromise<`+((
|
|
1235
|
+
export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>): CancelablePromise<`+((s=i(o,"ifServicesResponse").call(a,"response",{name:"ifServicesResponse",hash:{},fn:e.program(1,t,0),inverse:e.program(3,t,0),data:t,loc:{start:{line:63,column:100},end:{line:63,column:178}}}))!=null?s:"")+`> => {
|
|
1236
1236
|
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
|
1237
1237
|
try {
|
|
1238
1238
|
const url = getUrl(config, options);
|
|
@@ -1265,13 +1265,13 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
1265
1265
|
|
|
1266
1266
|
catchErrorCodes(options, result);
|
|
1267
1267
|
|
|
1268
|
-
resolve(`+((
|
|
1268
|
+
resolve(`+((s=i(o,"ifServicesResponse").call(a,"body",{name:"ifServicesResponse",hash:{},fn:e.program(5,t,0),inverse:e.program(7,t,0),data:t,loc:{start:{line:96,column:12},end:{line:96,column:90}}}))!=null?s:"")+`);
|
|
1269
1269
|
}
|
|
1270
1270
|
} catch (error) {
|
|
1271
1271
|
reject(error);
|
|
1272
1272
|
}
|
|
1273
1273
|
});
|
|
1274
|
-
};`},usePartial:true,useData:true};var pt={compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
1274
|
+
};`},usePartial:true,useData:true};var pt={compiler:[8,">= 4.3.0"],main:function(e,n,o,r,t){return `export const sendRequest = async (
|
|
1275
1275
|
config: OpenAPIConfig,
|
|
1276
1276
|
options: ApiRequestOptions,
|
|
1277
1277
|
url: string,
|
|
@@ -1301,5 +1301,5 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
1301
1301
|
|
|
1302
1302
|
onCancel(() => xhr.abort());
|
|
1303
1303
|
});
|
|
1304
|
-
};`},useData:true};var sr=()=>{p.registerHelper("camelCase",function(e){return
|
|
1304
|
+
};`},useData:true};var sr=()=>{p.registerHelper("camelCase",function(e){return q({case:"camelCase",value:e})}),p.registerHelper("equals",function(e,n,o){return e===n?o.fn(this):o.inverse(this)}),p.registerHelper("ifServicesResponse",function(e$1,n){return e().plugins["@hey-api/sdk"]?.config.response===e$1?n.fn(this):n.inverse(this)}),p.registerHelper("ifdef",function(...e){let n=e.pop();return e.every(o=>!o)?n.inverse(this):n.fn(this)}),p.registerHelper("notEquals",function(e,n,o){return e!==n?o.fn(this):o.inverse(this)}),p.registerHelper("transformServiceName",function(e$1){return A({config:e(),name:e$1})});},ct=()=>{sr();let e={client:p.template(xn),core:{apiError:p.template(On),apiRequestOptions:p.template(wn),apiResult:p.template(En),baseHttpRequest:p.template($n),cancelablePromise:p.template(Nn),httpRequest:p.template(tt),request:p.template(ot),settings:p.template(rt)}};return p.registerPartial("functions/base64",p.template(Vn)),p.registerPartial("functions/catchErrorCodes",p.template(Gn)),p.registerPartial("functions/getFormData",p.template(zn)),p.registerPartial("functions/getQueryString",p.template(Kn)),p.registerPartial("functions/getUrl",p.template(Xn)),p.registerPartial("functions/isBlob",p.template(Qn)),p.registerPartial("functions/isFormData",p.template(Jn)),p.registerPartial("functions/isString",p.template(Yn)),p.registerPartial("functions/isStringWithValue",p.template(Zn)),p.registerPartial("functions/isSuccess",p.template(et)),p.registerPartial("functions/resolve",p.template(nt)),p.registerPartial("fetch/getHeaders",p.template(Fn)),p.registerPartial("fetch/getRequestBody",p.template(_n)),p.registerPartial("fetch/getResponseBody",p.template(Ln)),p.registerPartial("fetch/getResponseHeader",p.template(Mn)),p.registerPartial("fetch/request",p.template(Wn)),p.registerPartial("fetch/sendRequest",p.template(Un)),p.registerPartial("xhr/getHeaders",p.template(st)),p.registerPartial("xhr/getRequestBody",p.template(it)),p.registerPartial("xhr/getResponseBody",p.template(at)),p.registerPartial("xhr/getResponseHeader",p.template(lt)),p.registerPartial("xhr/request",p.template(ut)),p.registerPartial("xhr/sendRequest",p.template(pt)),p.registerPartial("axios/getHeaders",p.template(Sn)),p.registerPartial("axios/getRequestBody",p.template(Hn)),p.registerPartial("axios/getResponseBody",p.template(Dn)),p.registerPartial("axios/getResponseHeader",p.template(In)),p.registerPartial("axios/request",p.template(Bn)),p.registerPartial("axios/sendRequest",p.template(jn)),p.registerPartial("angular/getHeaders",p.template(Cn)),p.registerPartial("angular/getRequestBody",p.template(bn)),p.registerPartial("angular/getResponseBody",p.template(qn)),p.registerPartial("angular/getResponseHeader",p.template(An)),p.registerPartial("angular/request",p.template(Tn)),p.registerPartial("angular/sendRequest",p.template(kn)),e};var ir={stringCase:q};x.enabled=lr().hasBasic;var Ai=async e=>{let n=typeof e=="function"?await e():e,o=[];try{m.start("createClient"),m.start("config");for(let i of await H(n))if(o.push(i.config),i.errors.length)throw i.errors[0];m.end("config"),m.start("handlebars");let r=ct();m.end("handlebars");let s=(await Promise.all(o.map(i=>re({config:i,templates:r})))).filter(i=>!!i);m.end("createClient");let a=o[0];return a&&a.logs.level==="debug"&&new L({totalMark:"createClient"}).report({marks:["config","openapi","handlebars","parser","generator","postprocess"]}),s}catch(r){let t=o[0],s=t?t.dryRun:n?.dryRun,a=t?.logs??h(n),i;throw a.level!=="silent"&&a.file&&!s&&(i=v(r,a.path??"")),a.level!=="silent"&&(x$1({error:r,logPath:i}),await y()&&await w(r)),r}},Ti=async e=>typeof e=="function"?await e():e;export{Ai as createClient,Ti as defineConfig,ir as utils};//# sourceMappingURL=index.js.map
|
|
1305
1305
|
//# sourceMappingURL=index.js.map
|