@hey-api/openapi-ts 0.84.3 → 0.85.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/bin/index.cjs +2 -9
- package/dist/chunk-JIKOAZJ5.js +47 -0
- package/dist/chunk-JIKOAZJ5.js.map +1 -0
- package/dist/clients/angular/index.ts +1 -0
- package/dist/clients/axios/index.ts +1 -0
- package/dist/clients/core/queryKeySerializer.ts +134 -0
- package/dist/clients/fetch/index.ts +1 -0
- package/dist/clients/next/index.ts +1 -0
- package/dist/clients/nuxt/index.ts +1 -0
- package/dist/clients/ofetch/index.ts +1 -0
- package/dist/clients/ofetch/utils.ts +1 -0
- package/dist/index.cjs +87 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -12
- package/dist/index.d.ts +18 -12
- package/dist/index.js +182 -163
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +19 -19
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +26 -18
- package/dist/internal.d.ts +26 -18
- package/dist/internal.js +1 -1
- package/dist/{types.d-fB2fiwrL.d.cts → types.d-DIu3K5QP.d.cts} +253 -126
- package/dist/{types.d-fB2fiwrL.d.ts → types.d-DIu3K5QP.d.ts} +253 -126
- package/package.json +3 -3
- package/dist/chunk-7LVATX6U.js +0 -54
- package/dist/chunk-7LVATX6U.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,27 @@
|
|
|
1
|
-
import {createRequire}from'module';import {b,a,c,u,K,
|
|
2
|
-
var $e=b((oo,je)=>{je.exports=Be;Be.sync=wt;var De=a("fs");function kt(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 Ie(e,n,o){return !e.isSymbolicLink()&&!e.isFile()?false:kt(n,o)}function Be(e,n,o){De.stat(e,function(r,t){o(r,r?false:Ie(t,e,n));});}function wt(e,n){return Ie(De.statSync(e),e,n)}});var Me=b((so,Le)=>{Le.exports=_e;_e.sync=St;var Ne=a("fs");function _e(e,n,o){Ne.stat(e,function(r,t){o(r,r?false:Fe(t,n));});}function St(e,n){return Fe(Ne.statSync(e),n)}function Fe(e,n){return e.isFile()&&Ot(e,n)}function Ot(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),p=parseInt("010",8),l=parseInt("001",8),c=i|p,f=o&l||o&p&&t===a||o&i&&r===s||o&c&&s===0;return f}});var Ue=b((ao,We)=>{a("fs");var W;process.platform==="win32"||global.TESTING_WINDOWS?W=$e():W=Me();We.exports=X;X.sync=Ht;function X(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){X(e,n||{},function(s,a){s?t(s):r(a);});})}W(e,n||{},function(r,t){r&&(r.code==="EACCES"||n&&n.ignoreErrors)&&(r=null,t=false),o(r,t);});}function Ht(e,n){try{return W.sync(e,n||{})}catch(o){if(n&&n.ignoreErrors||o.code==="EACCES")return false;throw o}}});var Je=b((lo,Qe)=>{var H=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Ve=a("path"),Dt=H?";":":",Ge=Ue(),ze=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Ke=(e,n)=>{let o=n.colon||Dt,r=e.match(/\//)||H&&e.match(/\\/)?[""]:[...H?[process.cwd()]:[],...(n.path||process.env.PATH||"").split(o)],t=H?n.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=H?t.split(o):[""];return H&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:r,pathExt:s,pathExtExe:t}},Xe=(e,n,o)=>{typeof n=="function"&&(o=n,n={}),n||(n={});let{pathEnv:r,pathExt:t,pathExtExe:s}=Ke(e,n),a=[],i=l=>new Promise((c,f)=>{if(l===r.length)return n.all&&a.length?c(a):f(ze(e));let m=r[l],d=/^".*"$/.test(m)?m.slice(1,-1):m,y=Ve.join(d,e),b=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+y:y;c(p(b,l,0));}),p=(l,c,f)=>new Promise((m,d)=>{if(f===t.length)return m(i(c+1));let y=t[f];Ge(l+y,{pathExt:s},(b,k)=>{if(!b&&k)if(n.all)a.push(l+y);else return m(l+y);return m(p(l,c,f+1))});});return o?i(0).then(l=>o(null,l),o):i(0)},It=(e,n)=>{n=n||{};let{pathEnv:o,pathExt:r,pathExtExe:t}=Ke(e,n),s=[];for(let a=0;a<o.length;a++){let i=o[a],p=/^".*"$/.test(i)?i.slice(1,-1):i,l=Ve.join(p,e),c=!p&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let f=0;f<r.length;f++){let m=c+r[f];try{if(Ge.sync(m,{pathExt:t}))if(n.all)s.push(m);else return m}catch{}}}if(n.all&&s.length)return s;if(n.nothrow)return null;throw ze(e)};Qe.exports=Xe;Xe.sync=It;});var Ze=b((po,Q)=>{var Ye=(e={})=>{let n=e.env||process.env;return (e.platform||process.platform)!=="win32"?"PATH":Object.keys(n).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};Q.exports=Ye;Q.exports.default=Ye;});var rn=b((uo,tn)=>{var en=a("path"),Bt=Je(),jt=Ze();function nn(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=Bt.sync(e.command,{path:o[jt({env:o})],pathExt:n?en.delimiter:void 0});}catch{}finally{s&&process.chdir(r);}return a&&(a=en.resolve(t?e.options.cwd:"",a)),a}function $t(e){return nn(e)||nn(e,true)}tn.exports=$t;});var on=b((co,Y)=>{var J=/([()\][%!^"`<>&|;, *?])/g;function Nt(e){return e=e.replace(J,"^$1"),e}function _t(e,n){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(J,"^$1"),n&&(e=e.replace(J,"^$1")),e}Y.exports.command=Nt;Y.exports.argument=_t;});var an=b((fo,sn)=>{sn.exports=/^#!(.*)/;});var pn=b((mo,ln)=>{var Ft=an();ln.exports=(e="")=>{let n=e.match(Ft);if(!n)return null;let[o,r]=n[0].replace(/#! ?/,"").split(" "),t=o.split("/").pop();return t==="env"?r:r?`${t} ${r}`:t};});var cn=b((go,un)=>{var Z=a("fs"),Lt=pn();function Mt(e){let o=Buffer.alloc(150),r;try{r=Z.openSync(e,"r"),Z.readSync(r,o,0,150,0),Z.closeSync(r);}catch{}return Lt(o.toString())}un.exports=Mt;});var gn=b((yo,dn)=>{var Wt=a("path"),fn=rn(),mn=on(),Ut=cn(),Vt=process.platform==="win32",Gt=/\.(?:com|exe)$/i,zt=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Kt(e){e.file=fn(e);let n=e.file&&Ut(e.file);return n?(e.args.unshift(e.file),e.command=n,fn(e)):e.file}function Xt(e){if(!Vt)return e;let n=Kt(e),o=!Gt.test(n);if(e.options.forceShell||o){let r=zt.test(n);e.command=Wt.normalize(e.command),e.command=mn.command(e.command),e.args=e.args.map(s=>mn.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 Qt(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:Xt(r)}dn.exports=Qt;});var vn=b((ho,hn)=>{var ee=process.platform==="win32";function ne(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 Jt(e,n){if(!ee)return;let o=e.emit;e.emit=function(r,t){if(r==="exit"){let s=yn(t,n);if(s)return o.call(e,"error",s)}return o.apply(e,arguments)};}function yn(e,n){return ee&&e===1&&!n.file?ne(n.original,"spawn"):null}function Yt(e,n){return ee&&e===1&&!n.file?ne(n.original,"spawnSync"):null}hn.exports={hookChildProcess:Jt,verifyENOENT:yn,verifyENOENTSync:Yt,notFoundError:ne};});var xn=b((vo,D)=>{var Rn=a("child_process"),te=gn(),re=vn();function Pn(e,n,o){let r=te(e,n,o),t=Rn.spawn(r.command,r.args,r.options);return re.hookChildProcess(t,r),t}function Zt(e,n,o){let r=te(e,n,o),t=Rn.spawnSync(r.command,r.args,r.options);return t.error=t.error||re.verifyENOENTSync(t.status,r),t}D.exports=Pn;D.exports.spawn=Pn;D.exports.sync=Zt;D.exports._parse=te;D.exports._enoent=re;});var Ae=()=>{if(typeof Bun<"u"){let[e]=Bun.version.split(".").map(Number);if(e<1)throw new h(`Unsupported Bun version ${Bun.version}. Please use Bun 1.0.0 or newer.`)}else if(typeof process<"u"&&process.versions?.node){let[e]=process.versions.node.split(".").map(Number);if(e<18)throw new h(`Unsupported Node version ${process.versions.node}. Please use Node 18 or newer.`)}};var M=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 Te=async(e,n$1,o,r)=>{let t=n(),s=m(t),a=r.client({$config:t,...o,httpRequest:M(s.name),models:B$1(o.models),services:B$1(o.services)});p(t)&&(f(n$1),R.writeFileSync(P.resolve(n$1,`${p(t)}.ts`),a));};var Ee=async(e,n$1,o)=>{let r=n();if(r.exportCore){let t=m(r),s={httpRequest:M(t.name),server:r.base!==void 0?r.base:n$1.server,version:n$1.version};if(R.rmSync(P.resolve(e),{force:true,recursive:true}),R.mkdirSync(P.resolve(e),{recursive:true}),await R.writeFileSync(P.resolve(e,"OpenAPI.ts"),o.core.settings({$config:r,...s})),await R.writeFileSync(P.resolve(e,"ApiError.ts"),o.core.apiError({$config:r,...s})),await R.writeFileSync(P.resolve(e,"ApiRequestOptions.ts"),o.core.apiRequestOptions({$config:r,...s})),await R.writeFileSync(P.resolve(e,"ApiResult.ts"),o.core.apiResult({$config:r,...s})),t.name!=="legacy/angular"&&await R.writeFileSync(P.resolve(e,"CancelablePromise.ts"),o.core.cancelablePromise({$config:r,...s})),await R.writeFileSync(P.resolve(e,"request.ts"),o.core.request({$config:r,...s})),p(r)&&(await R.writeFileSync(P.resolve(e,"BaseHttpRequest.ts"),o.core.baseHttpRequest({$config:r,...s})),await R.writeFileSync(P.resolve(e,`${s.httpRequest}.ts`),o.core.httpRequest({$config:r,...s}))),r.request){let a=P.resolve(process.cwd(),r.request);if(!await R.existsSync(a))throw new Error(`Custom request file "${a}" does not exists`);await R.copyFileSync(a,P.resolve(e,"request.ts"));}}};var ke=({files:e})=>{let n$1=n();e.index=new I({dir:n$1.output.path,id:"index",name:"index.ts"}),p(n$1)&&e.index.add(v.exportNamedDeclaration({exports:p(n$1),module:`./${p(n$1)}`})),n$1.exportCore&&(e.index.add(v.exportNamedDeclaration({exports:"ApiError",module:"./core/ApiError"})),n$1.plugins["@hey-api/sdk"]?.config.response==="response"&&e.index.add(v.exportNamedDeclaration({exports:{asType:true,name:"ApiResult"},module:"./core/ApiResult"})),p(n$1)&&e.index.add(v.exportNamedDeclaration({exports:"BaseHttpRequest",module:"./core/BaseHttpRequest"})),m(n$1).name!=="legacy/angular"&&e.index.add(v.exportNamedDeclaration({exports:["CancelablePromise","CancelError"],module:"./core/CancelablePromise"})),e.index.add(v.exportNamedDeclaration({exports:["OpenAPI",{asType:true,name:"OpenAPIConfig"}],module:"./core/OpenAPI"}))),Object.keys(e).sort().forEach(o=>{let r=e[o];o==="index"||r.isEmpty()||r.exportFromIndex&&e.index.add(v.exportAllDeclaration({module:`./${r.nameWithoutExtension()}`}));});};var we=async({client:e$1,openApi:n$1,templates:o$1})=>{let r=n(),t=n$1;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=P.resolve(r.output.path);r.output.clean&&g(s);let a=e(d(r.output.tsConfigPath)),i=m(r);if(!o(r)&&"bundle"in i.config&&i.config.bundle){let l={moduleResolution:a?.options.moduleResolution};G({meta:l,outputPath:s,plugin:i});}await Te(t,s,e$1,o$1),await Ee(P.resolve(r.output.path,"core"),e$1,o$1);let p={};for(let l of r.pluginOrder){let c=r.plugins[l],f=(c.output??"").split("/"),m=P.resolve(r.output.path,...f.slice(0,f.length-1));p[c.name]=new I({dir:m,id:`legacy-unused-${c.name}`,name:`${f[f.length-1]}.ts`}),c.handlerLegacy?.({client:e$1,files:p,openApi:t,plugin:c});}ke({files:p}),Object.entries(p).forEach(([l,c])=>{r.dryRun||(l==="index"?c.write(`
|
|
3
|
-
`,
|
|
4
|
-
|
|
5
|
-
`,
|
|
1
|
+
import {createRequire}from'module';import {b,a,c,u,r,K,h as h$1,i,j,l,m,k,g,d,p,q,D,C,o,y,L,f,n,G,I,z,A,B as B$1,e,v,x}from'./chunk-JIKOAZJ5.js';export{E as clientDefaultConfig,F as clientDefaultMeta,H as clientPluginHandler,w as compiler,s as defaultPaginationKeywords,J as defaultPlugins,t as definePluginConfig,v as tsc}from'./chunk-JIKOAZJ5.js';import'@hey-api/codegen-core';import h from'ansi-colors';import xr from'color-support';import q$1 from'node:path';import {$RefParser}from'@hey-api/json-schema-ref-parser';import C$1 from'node:fs';import u$1 from'handlebars';createRequire(import.meta.url);
|
|
2
|
+
var Be=b((ao,$e)=>{$e.exports=De;De.sync=Ot;var He=a("fs");function St(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 t=0;t<o.length;t++){var r=o[t].toLowerCase();if(r&&e.substr(-r.length).toLowerCase()===r)return true}return false}function Ie(e,n,o){return !e.isSymbolicLink()&&!e.isFile()?false:St(n,o)}function De(e,n,o){He.stat(e,function(t,r){o(t,t?false:Ie(r,e,n));});}function Ot(e,n){return Ie(He.statSync(e),e,n)}});var Le=b((lo,Fe)=>{Fe.exports=_e;_e.sync=Ht;var je=a("fs");function _e(e,n,o){je.stat(e,function(t,r){o(t,t?false:Ne(r,n));});}function Ht(e,n){return Ne(je.statSync(e),n)}function Ne(e,n){return e.isFile()&&It(e,n)}function It(e,n){var o=e.mode,t=e.uid,r=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),p=parseInt("010",8),l=parseInt("001",8),c=i|p,f=o&l||o&p&&r===a||o&i&&t===s||o&c&&s===0;return f}});var We=b((uo,Me)=>{a("fs");var W;process.platform==="win32"||global.TESTING_WINDOWS?W=Be():W=Le();Me.exports=K;K.sync=Dt;function K(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(t,r){K(e,n||{},function(s,a){s?r(s):t(a);});})}W(e,n||{},function(t,r){t&&(t.code==="EACCES"||n&&n.ignoreErrors)&&(t=null,r=false),o(t,r);});}function Dt(e,n){try{return W.sync(e,n||{})}catch(o){if(n&&n.ignoreErrors||o.code==="EACCES")return false;throw o}}});var Ke=b((co,Je)=>{var I=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Ue=a("path"),$t=I?";":":",Ve=We(),Ge=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),ze=(e,n)=>{let o=n.colon||$t,t=e.match(/\//)||I&&e.match(/\\/)?[""]:[...I?[process.cwd()]:[],...(n.path||process.env.PATH||"").split(o)],r=I?n.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=I?r.split(o):[""];return I&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:t,pathExt:s,pathExtExe:r}},Ye=(e,n,o)=>{typeof n=="function"&&(o=n,n={}),n||(n={});let{pathEnv:t,pathExt:r,pathExtExe:s}=ze(e,n),a=[],i=l=>new Promise((c,f)=>{if(l===t.length)return n.all&&a.length?c(a):f(Ge(e));let m=t[l],d=/^".*"$/.test(m)?m.slice(1,-1):m,g=Ue.join(d,e),y=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+g:g;c(p(y,l,0));}),p=(l,c,f)=>new Promise((m,d)=>{if(f===r.length)return m(i(c+1));let g=r[f];Ve(l+g,{pathExt:s},(y,R)=>{if(!y&&R)if(n.all)a.push(l+g);else return m(l+g);return m(p(l,c,f+1))});});return o?i(0).then(l=>o(null,l),o):i(0)},Bt=(e,n)=>{n=n||{};let{pathEnv:o,pathExt:t,pathExtExe:r}=ze(e,n),s=[];for(let a=0;a<o.length;a++){let i=o[a],p=/^".*"$/.test(i)?i.slice(1,-1):i,l=Ue.join(p,e),c=!p&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let f=0;f<t.length;f++){let m=c+t[f];try{if(Ve.sync(m,{pathExt:r}))if(n.all)s.push(m);else return m}catch{}}}if(n.all&&s.length)return s;if(n.nothrow)return null;throw Ge(e)};Je.exports=Ye;Ye.sync=Bt;});var Qe=b((fo,X)=>{var Xe=(e={})=>{let n=e.env||process.env;return (e.platform||process.platform)!=="win32"?"PATH":Object.keys(n).reverse().find(t=>t.toUpperCase()==="PATH")||"Path"};X.exports=Xe;X.exports.default=Xe;});var tn=b((mo,nn)=>{var Ze=a("path"),jt=Ke(),_t=Qe();function en(e,n){let o=e.options.env||process.env,t=process.cwd(),r=e.options.cwd!=null,s=r&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd);}catch{}let a;try{a=jt.sync(e.command,{path:o[_t({env:o})],pathExt:n?Ze.delimiter:void 0});}catch{}finally{s&&process.chdir(t);}return a&&(a=Ze.resolve(r?e.options.cwd:"",a)),a}function Nt(e){return en(e)||en(e,true)}nn.exports=Nt;});var rn=b((go,Z)=>{var Q=/([()\][%!^"`<>&|;, *?])/g;function Ft(e){return e=e.replace(Q,"^$1"),e}function Lt(e,n){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Q,"^$1"),n&&(e=e.replace(Q,"^$1")),e}Z.exports.command=Ft;Z.exports.argument=Lt;});var sn=b((yo,on)=>{on.exports=/^#!(.*)/;});var ln=b((ho,an)=>{var Mt=sn();an.exports=(e="")=>{let n=e.match(Mt);if(!n)return null;let[o,t]=n[0].replace(/#! ?/,"").split(" "),r=o.split("/").pop();return r==="env"?t:t?`${r} ${t}`:r};});var un=b((vo,pn)=>{var ee=a("fs"),Wt=ln();function Ut(e){let o=Buffer.alloc(150),t;try{t=ee.openSync(e,"r"),ee.readSync(t,o,0,150,0),ee.closeSync(t);}catch{}return Wt(o.toString())}pn.exports=Ut;});var dn=b((Ro,mn)=>{var Vt=a("path"),cn=tn(),fn=rn(),Gt=un(),zt=process.platform==="win32",Yt=/\.(?:com|exe)$/i,Jt=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Kt(e){e.file=cn(e);let n=e.file&&Gt(e.file);return n?(e.args.unshift(e.file),e.command=n,cn(e)):e.file}function Xt(e){if(!zt)return e;let n=Kt(e),o=!Yt.test(n);if(e.options.forceShell||o){let t=Jt.test(n);e.command=Vt.normalize(e.command),e.command=fn.command(e.command),e.args=e.args.map(s=>fn.argument(s,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 Qt(e,n,o){n&&!Array.isArray(n)&&(o=n,n=null),n=n?n.slice(0):[],o=Object.assign({},o);let t={command:e,args:n,options:o,file:void 0,original:{command:e,args:n}};return o.shell?t:Xt(t)}mn.exports=Qt;});var hn=b((xo,yn)=>{var ne=process.platform==="win32";function te(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 Zt(e,n){if(!ne)return;let o=e.emit;e.emit=function(t,r){if(t==="exit"){let s=gn(r,n);if(s)return o.call(e,"error",s)}return o.apply(e,arguments)};}function gn(e,n){return ne&&e===1&&!n.file?te(n.original,"spawn"):null}function er(e,n){return ne&&e===1&&!n.file?te(n.original,"spawnSync"):null}yn.exports={hookChildProcess:Zt,verifyENOENT:gn,verifyENOENTSync:er,notFoundError:te};});var xn=b((Po,D)=>{var vn=a("child_process"),re=dn(),oe=hn();function Rn(e,n,o){let t=re(e,n,o),r=vn.spawn(t.command,t.args,t.options);return oe.hookChildProcess(r,t),r}function nr(e,n,o){let t=re(e,n,o),r=vn.spawnSync(t.command,t.args,t.options);return r.error=r.error||oe.verifyENOENTSync(r.status,t),r}D.exports=Rn;D.exports.spawn=Rn;D.exports.sync=nr;D.exports._parse=re;D.exports._enoent=oe;});var qe=()=>{if(typeof Bun<"u"){let[e]=Bun.version.split(".").map(Number);if(e<1)throw new g(`Unsupported Bun version ${Bun.version}. Please use Bun 1.0.0 or newer.`)}else if(typeof process<"u"&&process.versions?.node){let[e]=process.versions.node.split(".").map(Number);if(e<18)throw new g(`Unsupported Node version ${process.versions.node}. Please use Node 18 or newer.`)}};var M=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 Ae=async(e$1,n$1,o$1,t)=>{let r=o(),s=n(r),a=t.client({$config:r,...o$1,httpRequest:M(s.name),models:B$1(o$1.models),services:B$1(o$1.services)});q(r)&&(e(n$1),C$1.writeFileSync(q$1.resolve(n$1,`${q(r)}.ts`),a));};var Ee=async(e,n$1,o$1)=>{let t=o();if(t.exportCore){let r=n(t),s={httpRequest:M(r.name),server:t.base!==void 0?t.base:n$1.server,version:n$1.version};if(C$1.rmSync(q$1.resolve(e),{force:true,recursive:true}),C$1.mkdirSync(q$1.resolve(e),{recursive:true}),await C$1.writeFileSync(q$1.resolve(e,"OpenAPI.ts"),o$1.core.settings({$config:t,...s})),await C$1.writeFileSync(q$1.resolve(e,"ApiError.ts"),o$1.core.apiError({$config:t,...s})),await C$1.writeFileSync(q$1.resolve(e,"ApiRequestOptions.ts"),o$1.core.apiRequestOptions({$config:t,...s})),await C$1.writeFileSync(q$1.resolve(e,"ApiResult.ts"),o$1.core.apiResult({$config:t,...s})),r.name!=="legacy/angular"&&await C$1.writeFileSync(q$1.resolve(e,"CancelablePromise.ts"),o$1.core.cancelablePromise({$config:t,...s})),await C$1.writeFileSync(q$1.resolve(e,"request.ts"),o$1.core.request({$config:t,...s})),q(t)&&(await C$1.writeFileSync(q$1.resolve(e,"BaseHttpRequest.ts"),o$1.core.baseHttpRequest({$config:t,...s})),await C$1.writeFileSync(q$1.resolve(e,`${s.httpRequest}.ts`),o$1.core.httpRequest({$config:t,...s}))),t.request){let a=q$1.resolve(process.cwd(),t.request);if(!await C$1.existsSync(a))throw new Error(`Custom request file "${a}" does not exists`);await C$1.copyFileSync(a,q$1.resolve(e,"request.ts"));}}};var Te=({files:e})=>{let n$1=o();e.index=new I({dir:n$1.output.path,id:"index",name:"index.ts"}),q(n$1)&&e.index.add(v.exportNamedDeclaration({exports:q(n$1),module:`./${q(n$1)}`})),n$1.exportCore&&(e.index.add(v.exportNamedDeclaration({exports:"ApiError",module:"./core/ApiError"})),n$1.plugins["@hey-api/sdk"]?.config.response==="response"&&e.index.add(v.exportNamedDeclaration({exports:{asType:true,name:"ApiResult"},module:"./core/ApiResult"})),q(n$1)&&e.index.add(v.exportNamedDeclaration({exports:"BaseHttpRequest",module:"./core/BaseHttpRequest"})),n(n$1).name!=="legacy/angular"&&e.index.add(v.exportNamedDeclaration({exports:["CancelablePromise","CancelError"],module:"./core/CancelablePromise"})),e.index.add(v.exportNamedDeclaration({exports:["OpenAPI",{asType:true,name:"OpenAPIConfig"}],module:"./core/OpenAPI"}))),Object.keys(e).sort().forEach(o=>{let t=e[o];o==="index"||t.isEmpty()||t.exportFromIndex&&e.index.add(v.exportAllDeclaration({module:`./${t.nameWithoutExtension()}`}));});};var we=async({client:e,openApi:n$1,templates:o$1})=>{let t=o(),r=n$1;if(e){if(t.plugins["@hey-api/sdk"]?.config.include&&t.plugins["@hey-api/sdk"].config.asClass){let p=new RegExp(t.plugins["@hey-api/sdk"].config.include);e.services=e.services.filter(l=>p.test(l.name));}if(t.plugins["@hey-api/typescript"]?.config.include){let p=new RegExp(t.plugins["@hey-api/typescript"].config.include);e.models=e.models.filter(l=>p.test(l.name));}}let s=q$1.resolve(t.output.path);t.output.clean&&f(s);let a=n(t);if(!p(t)&&"bundle"in a.config&&a.config.bundle){let p={importFileExtension:t.output.importFileExtension};G({meta:p,outputPath:s,plugin:a});}await Ae(r,s,e,o$1),await Ee(q$1.resolve(t.output.path,"core"),e,o$1);let i={};for(let p of t.pluginOrder){let l=t.plugins[p],c=(l.output??"").split("/"),f=q$1.resolve(t.output.path,...c.slice(0,c.length-1));i[l.name]=new I({dir:f,id:`legacy-unused-${l.name}`,name:`${c[c.length-1]}.ts`}),l.handlerLegacy?.({client:e,files:i,openApi:r,plugin:l});}Te({files:i}),Object.entries(i).forEach(([p,l])=>{t.dryRun||(p==="index"?l.write(`
|
|
3
|
+
`,t.output.tsConfig):l.write(`
|
|
4
|
+
|
|
5
|
+
`,t.output.tsConfig));});};var Se=async({context:e})=>{let n$1=q$1.resolve(e.config.output.path);e.config.output.clean&&f(n$1);let o={importFileExtension:e.config.output.importFileExtension},t=n(e.config);"bundle"in t.config&&t.config.bundle&&(e.config._FRAGILE_CLIENT_BUNDLE_RENAMED=G({meta:o,outputPath:n$1,plugin:t,project:e.gen}));for(let r of e.registerPlugins())await r.run();for(let r of e.gen.render(o)){let s=q$1.resolve(n$1,r.path),a=q$1.dirname(s);e.config.dryRun||(C$1.mkdirSync(a,{recursive:true}),C$1.writeFileSync(s,r.content,{encoding:"utf8"}));}};var Oe=({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 t in e.schemas){let r=o.definitions[t];if(!r||typeof r!="object")continue;let s=e.schemas[t];s(r);}if(e.operations&&o.paths)for(let t in e.operations){let[r,s]=t.split(" ");if(!r||!s)continue;let a=o.paths[s];if(!a)continue;let i=a[r.toLocaleLowerCase()]||a[r.toLocaleUpperCase()];if(!i||typeof i!="object")continue;let p=e.operations[t];p(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 t in e.schemas){let r=o.components.schemas[t];if(!r||typeof r!="object")continue;let s=e.schemas[t];s(r);}if(e.parameters&&o.components.parameters)for(let t in e.parameters){let r=o.components.parameters[t];if(!r||typeof r!="object")continue;let s=e.parameters[t];s(r);}if(e.requestBodies&&o.components.requestBodies)for(let t in e.requestBodies){let r=o.components.requestBodies[t];if(!r||typeof r!="object")continue;let s=e.requestBodies[t];s(r);}if(e.responses&&o.components.responses)for(let t in e.responses){let r=o.components.responses[t];if(!r||typeof r!="object")continue;let s=e.responses[t];s(r);}}if(e.operations&&o.paths)for(let t in e.operations){let[r,s]=t.split(" ");if(!r||!s)continue;let a=o.paths[s];if(!a)continue;let i=a[r.toLocaleLowerCase()]||a[r.toLocaleUpperCase()];if(!i||typeof i!="object")continue;let p=e.operations[t];p(i);}};var se=c(xn(),1),tr={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"}},rr={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"}},Pn=({config:e})=>{if(e.output.format){let n=tr[e.output.format];console.log(`\u2728 Running ${n.name}`),(0, se.sync)(n.command,n.args(e.output.path));}if(e.output.lint){let n=rr[e.output.lint];console.log(`\u2728 Running ${n.name}`),(0, se.sync)(n.command,n.args(e.output.path));}};function bn(e,n){return {...e,config:n,models:e.models.map(o=>or(o)),services:sr(e.operations).map(ir),types:{}}}var or=e=>({...e,$refs:e.$refs.filter((n,o,t)=>z(n,o,t)),enum:e.enum.filter((n,o,t)=>t.findIndex(r=>r.value===n.value)===o),enums:e.enums.filter((n,o,t)=>t.findIndex(r=>r.name===n.name)===o),imports:e.imports.filter((n,o,t)=>z(n,o,t)&&n!==e.name).sort(A)}),sr=e=>{let n=o(),o$1=new Map;return e.forEach(t=>{(t.tags?.length&&(n.plugins["@hey-api/sdk"]?.config.asClass||q(n))?t.tags.filter(z):["Default"]).forEach(s=>{let a={...t,service:pr(s)},i=o$1.get(a.service)||lr(a);i.$refs=[...i.$refs,...a.$refs],i.imports=[...i.imports,...a.imports],i.operations=[...i.operations,a],o$1.set(a.service,i);});}),Array.from(o$1.values())},ir=e=>{let n={...e};return n.operations=ar(n),n.operations.forEach(o=>{n.imports.push(...o.imports);}),n.imports=n.imports.filter(z).sort(A),n},ar=e=>{let n=new Map;return e.operations.map(o=>{let t={...o};t.imports.push(...t.parameters.flatMap(i=>i.imports));let r=t.responses.filter(i=>i.responseTypes.includes("success"));t.imports.push(...r.flatMap(i=>i.imports));let s=t.name,a=n.get(s)||0;return a>0&&(t.name=`${s}${a}`),n.set(s,a+1),t})},lr=e=>({$refs:[],imports:[],name:e.service,operations:[]}),pr=e=>u({case:"PascalCase",value:x(e)});var fr=e=>{let n={...e,path:""};if(e.path&&(typeof e.path!="string"||e.registry!=="hey-api"))return n.path=e.path,n;let[o,t]=e.path.split("?"),s=(t||"").split("&").map(A=>A.split("=")),a=o||"";a.endsWith("/")&&(a=a.slice(0,a.length-1));let[,i]=a.split("://"),[p,l,c]=(i||"").split("/");n.organization=l||e.organization,n.project=c||e.project;let f=[],m="api_key";n.api_key=s.find(([A])=>A===m)?.[1]||e.api_key||process.env.HEY_API_TOKEN,n.api_key&&f.push(`${m}=${n.api_key}`);let d="branch";n.branch=s.find(([A])=>A===d)?.[1]||e.branch,n.branch&&f.push(`${d}=${n.branch}`);let g="commit_sha";n.commit_sha=s.find(([A])=>A===g)?.[1]||e.commit_sha,n.commit_sha&&f.push(`${g}=${n.commit_sha}`);let y="tags";n.tags=s.find(([A])=>A===y)?.[1]?.split(",")||e.tags,n.tags?.length&&f.push(`${y}=${n.tags.join(",")}`);let R="version";if(n.version=s.find(([A])=>A===R)?.[1]||e.version,n.version&&f.push(`${R}=${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 E=f.join("&"),k=p||"get.heyapi.dev",x=k.startsWith("localhost"),j=[x?"http":"https",k].join("://"),pe=x?[j,"v1","get",n.organization,n.project].join("/"):[j,n.organization,n.project].join("/");return n.path=E?`${pe}?${E}`:pe,n},Cn=(e,n)=>{let o=[],t=h.gray(`[Job ${n+1}] `),r=e.length,s=h.cyan(`Generating from ${r} ${r===1?"input":"inputs"}:`);o.push(`${t}\u23F3 ${s}`),e.forEach((a,i)=>{let p=` [${i+1}] `,l=h.cyan(p),c=" ".repeat(p.length);if(typeof a.path!="string"){o.push(`${t}${l}raw OpenAPI specification`);return}switch(a.registry){case "hey-api":{let f=[a.organization,a.project].filter(Boolean).join("/");o.push(`${t}${l}${f}`),a.branch&&o.push(`${t}${c}${h.gray("branch:")} ${h.green(a.branch)}`),a.commit_sha&&o.push(`${t}${c}${h.gray("commit:")} ${h.green(a.commit_sha)}`),a.tags?.length&&o.push(`${t}${c}${h.gray("tags:")} ${h.green(a.tags.join(", "))}`),a.version&&o.push(`${t}${c}${h.gray("version:")} ${h.green(a.version)}`),o.push(`${t}${c}${h.gray("registry:")} ${h.green("Hey API")}`);break}case "readme":{let f=[a.organization,a.project].filter(Boolean).join("/");f?o.push(`${t}${l}${f}`):o.push(`${t}${l}${a.path}`),a.uuid&&o.push(`${t}${c}${h.gray("uuid:")} ${h.green(a.uuid)}`),o.push(`${t}${c}${h.gray("registry:")} ${h.green("ReadMe")}`);break}case "scalar":{let f=[a.organization,a.project].filter(Boolean).join("/");o.push(`${t}${l}${f}`),o.push(`${t}${c}${h.gray("registry:")} ${h.green("Scalar")}`);break}default:o.push(`${t}${l}${a.path}`);break}});for(let a of o)console.log(a);},ie=async({config:e,dependencies:n,jobIndex:o,logger:t,templates:r,watches:s})=>{let a=s||Array.from({length:e.input.length},()=>({headers:new Headers})),i=e.input.map(d=>fr(d));e.logs.level!=="silent"&&!s&&Cn(i,o);let p$1=async(d,g)=>{let y=t.timeEvent("spec"),{arrayBuffer:R,error:E,resolvedInput:k,response:x}=await L({fetchOptions:d.fetch,inputPath:i[g].path,timeout:d.watch.timeout,watch:a[g]});if(y.timeEnd(),E&&!s)throw new Error(`Request failed with status ${x.status}: ${x.statusText}`);return {arrayBuffer:R,resolvedInput:k}},l=(await Promise.all(e.input.map((d,g)=>p$1(d,g)))).filter(d=>d.arrayBuffer||d.resolvedInput),c,f;if(l.length){let d=new $RefParser,g=l.length>1?await d.bundleMany({arrayBuffer:l.map(x=>x.arrayBuffer),pathOrUrlOrSchemas:[],resolvedInputs:l.map(x=>x.resolvedInput)}):await d.bundle({arrayBuffer:l[0].arrayBuffer,pathOrUrlOrSchema:void 0,resolvedInput:l[0].resolvedInput});e.logs.level!=="silent"&&s&&(console.clear(),Cn(i,o));let y=t.timeEvent("input.patch");Oe({patchOptions:e.parser.patch,spec:g}),y.timeEnd();let R=t.timeEvent("parser");if(e.experimentalParser&&!p(e)&&!q(e)&&(f=D({config:e,dependencies:n,logger:t,spec:g})),!f){let x=C({openApi:g});c=bn(x,e);}R.timeEnd();let E=t.timeEvent("generator");f?await Se({context:f}):c&&await we({client:c,openApi:g,templates:r}),E.timeEnd();let k=t.timeEvent("postprocess");if(!e.dryRun&&(Pn({config:e}),e.logs.level!=="silent")){let x=process.env.INIT_CWD?`./${q$1.relative(process.env.INIT_CWD,e.output.path)}`:e.output.path,j=h.gray(`[Job ${o+1}] `);console.log(`${j}${h.green("\u2705 Done!")} Your output is in ${h.cyanBright(x)}`);}k.timeEnd();}let m=e.input.find((d,g)=>d.watch.enabled&&typeof i[g].path=="string");return m&&setTimeout(()=>{ie({config:e,dependencies:n,jobIndex:o,logger:t,templates:r,watches:a});},m.watch.interval),f||c};var mr=`
|
|
6
|
+
db e888888e
|
|
7
|
+
d8 Y88Y ~8b
|
|
8
|
+
dY "" "" Yb
|
|
9
|
+
8 88 88 8
|
|
10
|
+
8 o 8 8
|
|
11
|
+
Yb b8d eb ,b
|
|
12
|
+
Yb_____Y ,b
|
|
13
|
+
8 dY
|
|
14
|
+
8 e 8
|
|
15
|
+
`,dr=`
|
|
16
|
+
888 | e 888~-_ 888
|
|
17
|
+
888___| e88~~8e Y88b / d8b 888 \\ 888
|
|
18
|
+
888 | d888 88b Y888/ /Y88b 888 | 888
|
|
19
|
+
888 | 8888__888 Y8/ / Y88b 888 / 888
|
|
20
|
+
888 | Y888 , Y /____Y88b 888_-~ 888
|
|
21
|
+
888 | "88___/ / / Y88b 888 888
|
|
22
|
+
_/
|
|
23
|
+
`,An=e=>{let n=[],o=0,t="";for(let r of e)r===`
|
|
24
|
+
`?t&&(n.push(t),o=Math.max(o,t.length),t=""):t+=r;return {lines:n,maxLineLength:o}};function En(){let e=d(),n=An(mr),o=An(dr),t=Math.floor((n.lines.length-o.lines.length)/2),r=n.lines.map((s,a)=>{let i=s.padEnd(n.maxLineLength);return a>=t&&n.lines.length-a-1>=t&&(i+=` ${o.lines[a-t]}`),i});for(let s of r)console.log(h.cyan(s));console.log(""),console.log(h.gray(`${e.name} v${e.version}`)),console.log("");}var Tn={1:function(e,n,o,t,r){return `import { NgModule} from '@angular/core';
|
|
6
25
|
import { HttpClientModule } from '@angular/common/http';
|
|
7
26
|
|
|
8
27
|
import { AngularHttpRequest } from './core/AngularHttpRequest';
|
|
@@ -10,12 +29,12 @@ import { BaseHttpRequest } from './core/BaseHttpRequest';
|
|
|
10
29
|
import type { OpenAPIConfig } from './core/OpenAPI';
|
|
11
30
|
import { OpenAPI } from './core/OpenAPI';
|
|
12
31
|
import { Interceptors } from './core/OpenAPI';
|
|
13
|
-
`},3:function(e,n,o,r
|
|
32
|
+
`},3:function(e,n,o,t,r){var s,a=e.strict,i=e.lambda;return `import type { BaseHttpRequest } from './core/BaseHttpRequest';
|
|
14
33
|
import type { OpenAPIConfig } from './core/OpenAPI';
|
|
15
34
|
import { Interceptors } from './core/OpenAPI';
|
|
16
35
|
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:"")+`';
|
|
17
|
-
`},5:function(e,n,o,r
|
|
18
|
-
`},8:function(e,n,o,r
|
|
36
|
+
`},5:function(e,n,o,t,r){var s,a=e.lookupProperty||function(i,p){if(Object.prototype.hasOwnProperty.call(i,p))return i[p]};return (s=a(o,"each").call(n??(e.nullContext||{}),a(n,"services"),{name:"each",hash:{},fn:e.program(6,r,0),inverse:e.noop,data:r,loc:{start:{line:18,column:0},end:{line:20,column:9}}}))!=null?s:""},6:function(e,n,o,t,r){var s,a=e.lookupProperty||function(i,p){if(Object.prototype.hasOwnProperty.call(i,p))return i[p]};return "import { "+((s=a(o,"transformServiceName").call(n??(e.nullContext||{}),a(n,"name"),{name:"transformServiceName",hash:{},data:r,loc:{start:{line:19,column:9},end:{line:19,column:40}}}))!=null?s:"")+` } from './sdk.gen';
|
|
37
|
+
`},8:function(e,n,o,t,r){var s,a=e.strict,i=e.lambda,p=e.lookupProperty||function(l,c){if(Object.prototype.hasOwnProperty.call(l,c))return l[c]};return `@NgModule({
|
|
19
38
|
imports: [HttpClientModule],
|
|
20
39
|
providers: [
|
|
21
40
|
{
|
|
@@ -39,15 +58,15 @@ import { `+((s=i(a(n,"httpRequest",{start:{line:14,column:12},end:{line:14,colum
|
|
|
39
58
|
provide: BaseHttpRequest,
|
|
40
59
|
useClass: AngularHttpRequest,
|
|
41
60
|
},
|
|
42
|
-
`+((s=p(o,"each").call(n??(e.nullContext||{}),p(n,"services"),{name:"each",hash:{},fn:e.program(9,
|
|
61
|
+
`+((s=p(o,"each").call(n??(e.nullContext||{}),p(n,"services"),{name:"each",hash:{},fn:e.program(9,r,0),inverse:e.noop,data:r,loc:{start:{line:48,column:2},end:{line:50,column:11}}}))!=null?s:"")+` ]
|
|
43
62
|
})
|
|
44
|
-
export class `+((s=i(a(p(p(
|
|
45
|
-
`},9:function(e,n,o,r
|
|
46
|
-
`},11:function(e,n,o,r
|
|
63
|
+
export class `+((s=i(a(p(p(r,"root"),"$config"),"name",{start:{line:53,column:16},end:{line:53,column:34}}),n))!=null?s:"")+` {}
|
|
64
|
+
`},9:function(e,n,o,t,r){var s,a=e.lookupProperty||function(i,p){if(Object.prototype.hasOwnProperty.call(i,p))return i[p]};return " "+((s=a(o,"transformServiceName").call(n??(e.nullContext||{}),a(n,"name"),{name:"transformServiceName",hash:{},data:r,loc:{start:{line:49,column:2},end:{line:49,column:33}}}))!=null?s:"")+`,
|
|
65
|
+
`},11:function(e,n,o,t,r){var s,a=e.strict,i=e.lambda,p=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;
|
|
47
66
|
|
|
48
|
-
export class `+((s=i(a(l(l(
|
|
67
|
+
export class `+((s=i(a(l(l(r,"root"),"$config"),"name",{start:{line:57,column:16},end:{line:57,column:34}}),n))!=null?s:"")+` {
|
|
49
68
|
|
|
50
|
-
`+((s=l(o,"each").call(p,l(n,"services"),{name:"each",hash:{},fn:e.program(12,
|
|
69
|
+
`+((s=l(o,"each").call(p,l(n,"services"),{name:"each",hash:{},fn:e.program(12,r,0),inverse:e.noop,data:r,loc:{start:{line:59,column:1},end:{line:61,column:10}}}))!=null?s:"")+`
|
|
51
70
|
public readonly request: BaseHttpRequest;
|
|
52
71
|
|
|
53
72
|
constructor(config?: Partial<OpenAPIConfig>, HttpRequest: HttpRequestConstructor = `+((s=i(a(n,"httpRequest",{start:{line:65,column:87},end:{line:65,column:98}}),n))!=null?s:"")+`) {
|
|
@@ -67,13 +86,13 @@ export class `+((s=i(a(l(l(t,"root"),"$config"),"name",{start:{line:57,column:16
|
|
|
67
86
|
},
|
|
68
87
|
});
|
|
69
88
|
|
|
70
|
-
`+((s=l(o,"each").call(p,l(n,"services"),{name:"each",hash:{},fn:e.program(14,
|
|
89
|
+
`+((s=l(o,"each").call(p,l(n,"services"),{name:"each",hash:{},fn:e.program(14,r,0),inverse:e.noop,data:r,loc:{start:{line:82,column:2},end:{line:84,column:11}}}))!=null?s:"")+` }
|
|
71
90
|
}
|
|
72
|
-
`},12:function(e,n,o,r
|
|
73
|
-
`},14:function(e,n,o,r
|
|
74
|
-
`},compiler:[8,">= 4.3.0"],main:function(e,n,o,r
|
|
75
|
-
`+((s=i(o,"if").call(a,i(n,"services"),{name:"if",hash:{},fn:e.program(5,
|
|
76
|
-
`+((s=i(o,"equals").call(a,i(i(i(i(
|
|
91
|
+
`},12:function(e,n,o,t,r){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(p,l){if(Object.prototype.hasOwnProperty.call(p,l))return p[l]};return " public readonly "+((s=i(o,"camelCase").call(a,i(n,"name"),{name:"camelCase",hash:{},data:r,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:r,loc:{start:{line:60,column:39},end:{line:60,column:70}}}))!=null?s:"")+`;
|
|
92
|
+
`},14:function(e,n,o,t,r){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(p,l){if(Object.prototype.hasOwnProperty.call(p,l))return p[l]};return " this."+((s=i(o,"camelCase").call(a,i(n,"name"),{name:"camelCase",hash:{},data:r,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:r,loc:{start:{line:83,column:34},end:{line:83,column:65}}}))!=null?s:"")+`(this.request);
|
|
93
|
+
`},compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(p,l){if(Object.prototype.hasOwnProperty.call(p,l))return p[l]};return ((s=i(o,"equals").call(a,i(i(i(i(r,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(1,r,0),inverse:e.program(3,r,0),data:r,loc:{start:{line:1,column:0},end:{line:15,column:11}}}))!=null?s:"")+`
|
|
94
|
+
`+((s=i(o,"if").call(a,i(n,"services"),{name:"if",hash:{},fn:e.program(5,r,0),inverse:e.noop,data:r,loc:{start:{line:17,column:0},end:{line:21,column:7}}}))!=null?s:"")+`
|
|
95
|
+
`+((s=i(o,"equals").call(a,i(i(i(i(r,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(8,r,0),inverse:e.program(11,r,0),data:r,loc:{start:{line:23,column:0},end:{line:87,column:11}}}))!=null?s:"")},useData:true};var wn={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getHeaders = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>): Observable<HttpHeaders> => {
|
|
77
96
|
return forkJoin({
|
|
78
97
|
// @ts-ignore
|
|
79
98
|
token: resolve(options, config.TOKEN),
|
|
@@ -120,7 +139,7 @@ export class `+((s=i(a(l(l(t,"root"),"$config"),"name",{start:{line:57,column:16
|
|
|
120
139
|
return new HttpHeaders(headers);
|
|
121
140
|
}),
|
|
122
141
|
);
|
|
123
|
-
};`},useData:true};var
|
|
142
|
+
};`},useData:true};var kn={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getRequestBody = (options: ApiRequestOptions): unknown => {
|
|
124
143
|
if (options.body) {
|
|
125
144
|
if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) {
|
|
126
145
|
return JSON.stringify(options.body);
|
|
@@ -131,12 +150,12 @@ export class `+((s=i(a(l(l(t,"root"),"$config"),"name",{start:{line:57,column:16
|
|
|
131
150
|
}
|
|
132
151
|
}
|
|
133
152
|
return undefined;
|
|
134
|
-
};`},useData:true};var
|
|
153
|
+
};`},useData:true};var Sn={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getResponseBody = <T>(response: HttpResponse<T>): T | undefined => {
|
|
135
154
|
if (response.status !== 204 && response.body !== null) {
|
|
136
155
|
return response.body;
|
|
137
156
|
}
|
|
138
157
|
return undefined;
|
|
139
|
-
};`},useData:true};var
|
|
158
|
+
};`},useData:true};var On={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getResponseHeader = <T>(response: HttpResponse<T>, responseHeader?: string): string | undefined => {
|
|
140
159
|
if (responseHeader) {
|
|
141
160
|
const value = response.headers.get(responseHeader);
|
|
142
161
|
if (isString(value)) {
|
|
@@ -144,7 +163,7 @@ export class `+((s=i(a(l(l(t,"root"),"$config"),"name",{start:{line:57,column:16
|
|
|
144
163
|
}
|
|
145
164
|
}
|
|
146
165
|
return undefined;
|
|
147
|
-
};`},useData:true};var
|
|
166
|
+
};`},useData:true};var Hn={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){var s,a=e.lookupProperty||function(i,p){if(Object.prototype.hasOwnProperty.call(i,p))return i[p]};return `import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
148
167
|
import type { HttpResponse, HttpErrorResponse } from '@angular/common/http';
|
|
149
168
|
import { forkJoin, of, throwError } from 'rxjs';
|
|
150
169
|
import { catchError, map, switchMap } from 'rxjs/operators';
|
|
@@ -155,35 +174,35 @@ import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
|
155
174
|
import type { ApiResult } from './ApiResult';
|
|
156
175
|
import type { OpenAPIConfig } from './OpenAPI';
|
|
157
176
|
|
|
158
|
-
`+((s=e.invokePartial(a(
|
|
177
|
+
`+((s=e.invokePartial(a(t,"functions/isString"),n,{name:"functions/isString",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
159
178
|
|
|
160
|
-
`+((s=e.invokePartial(a(
|
|
179
|
+
`+((s=e.invokePartial(a(t,"functions/isStringWithValue"),n,{name:"functions/isStringWithValue",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
161
180
|
|
|
162
|
-
`+((s=e.invokePartial(a(
|
|
181
|
+
`+((s=e.invokePartial(a(t,"functions/isBlob"),n,{name:"functions/isBlob",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
163
182
|
|
|
164
|
-
`+((s=e.invokePartial(a(
|
|
183
|
+
`+((s=e.invokePartial(a(t,"functions/isFormData"),n,{name:"functions/isFormData",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
165
184
|
|
|
166
|
-
`+((s=e.invokePartial(a(
|
|
185
|
+
`+((s=e.invokePartial(a(t,"functions/base64"),n,{name:"functions/base64",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
167
186
|
|
|
168
|
-
`+((s=e.invokePartial(a(
|
|
187
|
+
`+((s=e.invokePartial(a(t,"functions/getQueryString"),n,{name:"functions/getQueryString",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
169
188
|
|
|
170
|
-
`+((s=e.invokePartial(a(
|
|
189
|
+
`+((s=e.invokePartial(a(t,"functions/getUrl"),n,{name:"functions/getUrl",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
171
190
|
|
|
172
|
-
`+((s=e.invokePartial(a(
|
|
191
|
+
`+((s=e.invokePartial(a(t,"functions/getFormData"),n,{name:"functions/getFormData",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
173
192
|
|
|
174
|
-
`+((s=e.invokePartial(a(
|
|
193
|
+
`+((s=e.invokePartial(a(t,"functions/resolve"),n,{name:"functions/resolve",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
175
194
|
|
|
176
|
-
`+((s=e.invokePartial(a(
|
|
195
|
+
`+((s=e.invokePartial(a(t,"angular/getHeaders"),n,{name:"angular/getHeaders",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
177
196
|
|
|
178
|
-
`+((s=e.invokePartial(a(
|
|
197
|
+
`+((s=e.invokePartial(a(t,"angular/getRequestBody"),n,{name:"angular/getRequestBody",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
179
198
|
|
|
180
|
-
`+((s=e.invokePartial(a(
|
|
199
|
+
`+((s=e.invokePartial(a(t,"angular/sendRequest"),n,{name:"angular/sendRequest",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
181
200
|
|
|
182
|
-
`+((s=e.invokePartial(a(
|
|
201
|
+
`+((s=e.invokePartial(a(t,"angular/getResponseHeader"),n,{name:"angular/getResponseHeader",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
183
202
|
|
|
184
|
-
`+((s=e.invokePartial(a(
|
|
203
|
+
`+((s=e.invokePartial(a(t,"angular/getResponseBody"),n,{name:"angular/getResponseBody",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
185
204
|
|
|
186
|
-
`+((s=e.invokePartial(a(
|
|
205
|
+
`+((s=e.invokePartial(a(t,"functions/catchErrorCodes"),n,{name:"functions/catchErrorCodes",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
187
206
|
|
|
188
207
|
/**
|
|
189
208
|
* Request method
|
|
@@ -242,7 +261,7 @@ export const request = <T>(config: OpenAPIConfig, http: HttpClient, options: Api
|
|
|
242
261
|
return throwError(() => error);
|
|
243
262
|
}),
|
|
244
263
|
);
|
|
245
|
-
};`},usePartial:true,useData:true};var
|
|
264
|
+
};`},usePartial:true,useData:true};var In={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const sendRequest = <T>(
|
|
246
265
|
config: OpenAPIConfig,
|
|
247
266
|
options: ApiRequestOptions<T>,
|
|
248
267
|
http: HttpClient,
|
|
@@ -257,7 +276,7 @@ export const request = <T>(config: OpenAPIConfig, http: HttpClient, options: Api
|
|
|
257
276
|
withCredentials: config.WITH_CREDENTIALS,
|
|
258
277
|
observe: 'response',
|
|
259
278
|
});
|
|
260
|
-
};`},useData:true};var
|
|
279
|
+
};`},useData:true};var Dn={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
261
280
|
import type { ApiResult } from './ApiResult';
|
|
262
281
|
|
|
263
282
|
export class ApiError extends Error {
|
|
@@ -277,7 +296,7 @@ export class ApiError extends Error {
|
|
|
277
296
|
this.body = response.body;
|
|
278
297
|
this.request = request;
|
|
279
298
|
}
|
|
280
|
-
}`},useData:true};var
|
|
299
|
+
}`},useData:true};var $n={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export type ApiRequestOptions<T = unknown> = {
|
|
281
300
|
readonly body?: any;
|
|
282
301
|
readonly cookies?: Record<string, unknown>;
|
|
283
302
|
readonly errors?: Record<number | string, string>;
|
|
@@ -297,13 +316,13 @@ export class ApiError extends Error {
|
|
|
297
316
|
readonly responseHeader?: string;
|
|
298
317
|
readonly responseTransformer?: (data: unknown) => Promise<T>;
|
|
299
318
|
readonly url: string;
|
|
300
|
-
};`},useData:true};var
|
|
319
|
+
};`},useData:true};var Bn={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export type ApiResult<TData = any> = {
|
|
301
320
|
readonly body: TData;
|
|
302
321
|
readonly ok: boolean;
|
|
303
322
|
readonly status: number;
|
|
304
323
|
readonly statusText: string;
|
|
305
324
|
readonly url: string;
|
|
306
|
-
};`},useData:true};var
|
|
325
|
+
};`},useData:true};var jn={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getHeaders = async <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>): Promise<Record<string, string>> => {
|
|
307
326
|
const [token, username, password, additionalHeaders] = await Promise.all([
|
|
308
327
|
// @ts-ignore
|
|
309
328
|
resolve(options, config.TOKEN),
|
|
@@ -352,17 +371,17 @@ export class ApiError extends Error {
|
|
|
352
371
|
}
|
|
353
372
|
|
|
354
373
|
return headers;
|
|
355
|
-
};`},useData:true};var
|
|
374
|
+
};`},useData:true};var _n={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getRequestBody = (options: ApiRequestOptions): unknown => {
|
|
356
375
|
if (options.body) {
|
|
357
376
|
return options.body;
|
|
358
377
|
}
|
|
359
378
|
return undefined;
|
|
360
|
-
};`},useData:true};var
|
|
379
|
+
};`},useData:true};var Nn={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getResponseBody = (response: AxiosResponse<unknown>): unknown => {
|
|
361
380
|
if (response.status !== 204) {
|
|
362
381
|
return response.data;
|
|
363
382
|
}
|
|
364
383
|
return undefined;
|
|
365
|
-
};`},useData:true};var
|
|
384
|
+
};`},useData:true};var Fn={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getResponseHeader = (response: AxiosResponse<unknown>, responseHeader?: string): string | undefined => {
|
|
366
385
|
if (responseHeader) {
|
|
367
386
|
const content = response.headers[responseHeader];
|
|
368
387
|
if (isString(content)) {
|
|
@@ -370,7 +389,7 @@ export class ApiError extends Error {
|
|
|
370
389
|
}
|
|
371
390
|
}
|
|
372
391
|
return undefined;
|
|
373
|
-
};`},useData:true};var
|
|
392
|
+
};`},useData:true};var Ln={1:function(e,n,o,t,r){return "ApiResult<T>"},3:function(e,n,o,t,r){return "T"},5:function(e,n,o,t,r){return "result.body"},7:function(e,n,o,t,r){return "result"},compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(p,l){if(Object.prototype.hasOwnProperty.call(p,l))return p[l]};return `import axios from 'axios';
|
|
374
393
|
import type { AxiosError, AxiosRequestConfig, AxiosResponse, AxiosInstance } from 'axios';
|
|
375
394
|
|
|
376
395
|
import { ApiError } from './ApiError';
|
|
@@ -380,47 +399,47 @@ import { CancelablePromise } from './CancelablePromise';
|
|
|
380
399
|
import type { OnCancel } from './CancelablePromise';
|
|
381
400
|
import type { OpenAPIConfig } from './OpenAPI';
|
|
382
401
|
|
|
383
|
-
`+((s=e.invokePartial(i(
|
|
402
|
+
`+((s=e.invokePartial(i(t,"functions/isString"),n,{name:"functions/isString",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
384
403
|
|
|
385
|
-
`+((s=e.invokePartial(i(
|
|
404
|
+
`+((s=e.invokePartial(i(t,"functions/isStringWithValue"),n,{name:"functions/isStringWithValue",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
386
405
|
|
|
387
|
-
`+((s=e.invokePartial(i(
|
|
406
|
+
`+((s=e.invokePartial(i(t,"functions/isBlob"),n,{name:"functions/isBlob",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
388
407
|
|
|
389
|
-
`+((s=e.invokePartial(i(
|
|
408
|
+
`+((s=e.invokePartial(i(t,"functions/isFormData"),n,{name:"functions/isFormData",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
390
409
|
|
|
391
|
-
`+((s=e.invokePartial(i(
|
|
410
|
+
`+((s=e.invokePartial(i(t,"functions/isSuccess"),n,{name:"functions/isSuccess",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
392
411
|
|
|
393
|
-
`+((s=e.invokePartial(i(
|
|
412
|
+
`+((s=e.invokePartial(i(t,"functions/base64"),n,{name:"functions/base64",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
394
413
|
|
|
395
|
-
`+((s=e.invokePartial(i(
|
|
414
|
+
`+((s=e.invokePartial(i(t,"functions/getQueryString"),n,{name:"functions/getQueryString",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
396
415
|
|
|
397
|
-
`+((s=e.invokePartial(i(
|
|
416
|
+
`+((s=e.invokePartial(i(t,"functions/getUrl"),n,{name:"functions/getUrl",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
398
417
|
|
|
399
|
-
`+((s=e.invokePartial(i(
|
|
418
|
+
`+((s=e.invokePartial(i(t,"functions/getFormData"),n,{name:"functions/getFormData",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
400
419
|
|
|
401
|
-
`+((s=e.invokePartial(i(
|
|
420
|
+
`+((s=e.invokePartial(i(t,"functions/resolve"),n,{name:"functions/resolve",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
402
421
|
|
|
403
|
-
`+((s=e.invokePartial(i(
|
|
422
|
+
`+((s=e.invokePartial(i(t,"axios/getHeaders"),n,{name:"axios/getHeaders",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
404
423
|
|
|
405
|
-
`+((s=e.invokePartial(i(
|
|
424
|
+
`+((s=e.invokePartial(i(t,"axios/getRequestBody"),n,{name:"axios/getRequestBody",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
406
425
|
|
|
407
|
-
`+((s=e.invokePartial(i(
|
|
426
|
+
`+((s=e.invokePartial(i(t,"axios/sendRequest"),n,{name:"axios/sendRequest",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
408
427
|
|
|
409
|
-
`+((s=e.invokePartial(i(
|
|
428
|
+
`+((s=e.invokePartial(i(t,"axios/getResponseHeader"),n,{name:"axios/getResponseHeader",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
410
429
|
|
|
411
|
-
`+((s=e.invokePartial(i(
|
|
430
|
+
`+((s=e.invokePartial(i(t,"axios/getResponseBody"),n,{name:"axios/getResponseBody",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
412
431
|
|
|
413
|
-
`+((s=e.invokePartial(i(
|
|
432
|
+
`+((s=e.invokePartial(i(t,"functions/catchErrorCodes"),n,{name:"functions/catchErrorCodes",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
414
433
|
|
|
415
434
|
/**
|
|
416
435
|
* Request method
|
|
417
436
|
* @param config The OpenAPI configuration object
|
|
418
437
|
* @param options The request options from the service
|
|
419
438
|
* @param axiosClient The axios client instance to use
|
|
420
|
-
* @returns CancelablePromise<`+((s=i(o,"ifServicesResponse").call(a,"response",{name:"ifServicesResponse",hash:{},fn:e.program(1,
|
|
439
|
+
* @returns CancelablePromise<`+((s=i(o,"ifServicesResponse").call(a,"response",{name:"ifServicesResponse",hash:{},fn:e.program(1,r,0),inverse:e.program(3,r,0),data:r,loc:{start:{line:64,column:30},end:{line:64,column:108}}}))!=null?s:"")+`>
|
|
421
440
|
* @throws ApiError
|
|
422
441
|
*/
|
|
423
|
-
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,
|
|
442
|
+
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,r,0),inverse:e.program(3,r,0),data:r,loc:{start:{line:67,column:136},end:{line:67,column:214}}}))!=null?s:"")+`> => {
|
|
424
443
|
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
|
425
444
|
try {
|
|
426
445
|
const url = getUrl(config, options);
|
|
@@ -453,13 +472,13 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>,
|
|
|
453
472
|
|
|
454
473
|
catchErrorCodes(options, result);
|
|
455
474
|
|
|
456
|
-
resolve(`+((s=i(o,"ifServicesResponse").call(a,"body",{name:"ifServicesResponse",hash:{},fn:e.program(5,
|
|
475
|
+
resolve(`+((s=i(o,"ifServicesResponse").call(a,"body",{name:"ifServicesResponse",hash:{},fn:e.program(5,r,0),inverse:e.program(7,r,0),data:r,loc:{start:{line:100,column:12},end:{line:100,column:90}}}))!=null?s:"")+`);
|
|
457
476
|
}
|
|
458
477
|
} catch (error) {
|
|
459
478
|
reject(error);
|
|
460
479
|
}
|
|
461
480
|
});
|
|
462
|
-
};`},usePartial:true,useData:true};var
|
|
481
|
+
};`},usePartial:true,useData:true};var Mn={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const sendRequest = async <T>(
|
|
463
482
|
config: OpenAPIConfig,
|
|
464
483
|
options: ApiRequestOptions<T>,
|
|
465
484
|
url: string,
|
|
@@ -495,26 +514,26 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>,
|
|
|
495
514
|
}
|
|
496
515
|
throw error;
|
|
497
516
|
}
|
|
498
|
-
};`},useData:true};var
|
|
517
|
+
};`},useData:true};var Wn={1:function(e,n,o,t,r){return `import type { HttpClient } from '@angular/common/http';
|
|
499
518
|
import type { Observable } from 'rxjs';
|
|
500
519
|
|
|
501
520
|
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
502
521
|
import type { OpenAPIConfig } from './OpenAPI';
|
|
503
|
-
`},3:function(e,n,o,r
|
|
522
|
+
`},3:function(e,n,o,t,r){return `import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
504
523
|
import type { CancelablePromise } from './CancelablePromise';
|
|
505
524
|
import type { OpenAPIConfig } from './OpenAPI';
|
|
506
|
-
`},5:function(e,n,o,r
|
|
525
|
+
`},5:function(e,n,o,t,r){return ` constructor(
|
|
507
526
|
public readonly config: OpenAPIConfig,
|
|
508
527
|
public readonly http: HttpClient,
|
|
509
528
|
) {}
|
|
510
|
-
`},7:function(e,n,o,r
|
|
511
|
-
`},9:function(e,n,o,r
|
|
512
|
-
`},11:function(e,n,o,r
|
|
513
|
-
`},compiler:[8,">= 4.3.0"],main:function(e,n,o,r
|
|
529
|
+
`},7:function(e,n,o,t,r){return ` constructor(public readonly config: OpenAPIConfig) {}
|
|
530
|
+
`},9:function(e,n,o,t,r){return ` public abstract request<T>(options: ApiRequestOptions<T>): Observable<T>;
|
|
531
|
+
`},11:function(e,n,o,t,r){return ` public abstract request<T>(options: ApiRequestOptions<T>): CancelablePromise<T>;
|
|
532
|
+
`},compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(p,l){if(Object.prototype.hasOwnProperty.call(p,l))return p[l]};return ((s=i(o,"equals").call(a,i(i(i(i(r,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(1,r,0),inverse:e.program(3,r,0),data:r,loc:{start:{line:1,column:0},end:{line:11,column:11}}}))!=null?s:"")+`
|
|
514
533
|
export abstract class BaseHttpRequest {
|
|
515
534
|
|
|
516
|
-
`+((s=i(o,"equals").call(a,i(i(i(i(
|
|
517
|
-
`+((s=i(o,"equals").call(a,i(i(i(i(
|
|
535
|
+
`+((s=i(o,"equals").call(a,i(i(i(i(r,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(5,r,0),inverse:e.program(7,r,0),data:r,loc:{start:{line:15,column:1},end:{line:22,column:12}}}))!=null?s:"")+`
|
|
536
|
+
`+((s=i(o,"equals").call(a,i(i(i(i(r,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(9,r,0),inverse:e.program(11,r,0),data:r,loc:{start:{line:24,column:1},end:{line:28,column:12}}}))!=null?s:"")+"}"},useData:true};var Un={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export class CancelError extends Error {
|
|
518
537
|
constructor(message: string) {
|
|
519
538
|
super(message);
|
|
520
539
|
this.name = 'CancelError';
|
|
@@ -639,7 +658,7 @@ export class CancelablePromise<T> implements Promise<T> {
|
|
|
639
658
|
public get isCancelled(): boolean {
|
|
640
659
|
return this._isCancelled;
|
|
641
660
|
}
|
|
642
|
-
}`},useData:true};var
|
|
661
|
+
}`},useData:true};var Vn={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getHeaders = async <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>): Promise<Headers> => {
|
|
643
662
|
const [token, username, password, additionalHeaders] = await Promise.all([
|
|
644
663
|
// @ts-ignore
|
|
645
664
|
resolve(options, config.TOKEN),
|
|
@@ -684,7 +703,7 @@ export class CancelablePromise<T> implements Promise<T> {
|
|
|
684
703
|
}
|
|
685
704
|
|
|
686
705
|
return new Headers(headers);
|
|
687
|
-
};`},useData:true};var
|
|
706
|
+
};`},useData:true};var Gn={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getRequestBody = (options: ApiRequestOptions): unknown => {
|
|
688
707
|
if (options.body !== undefined) {
|
|
689
708
|
if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) {
|
|
690
709
|
return JSON.stringify(options.body);
|
|
@@ -695,7 +714,7 @@ export class CancelablePromise<T> implements Promise<T> {
|
|
|
695
714
|
}
|
|
696
715
|
}
|
|
697
716
|
return undefined;
|
|
698
|
-
};`},useData:true};var
|
|
717
|
+
};`},useData:true};var zn={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getResponseBody = async (response: Response): Promise<unknown> => {
|
|
699
718
|
if (response.status !== 204) {
|
|
700
719
|
try {
|
|
701
720
|
const contentType = response.headers.get('Content-Type');
|
|
@@ -716,7 +735,7 @@ export class CancelablePromise<T> implements Promise<T> {
|
|
|
716
735
|
}
|
|
717
736
|
}
|
|
718
737
|
return undefined;
|
|
719
|
-
};`},useData:true};var
|
|
738
|
+
};`},useData:true};var Yn={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => {
|
|
720
739
|
if (responseHeader) {
|
|
721
740
|
const content = response.headers.get(responseHeader);
|
|
722
741
|
if (isString(content)) {
|
|
@@ -724,54 +743,54 @@ export class CancelablePromise<T> implements Promise<T> {
|
|
|
724
743
|
}
|
|
725
744
|
}
|
|
726
745
|
return undefined;
|
|
727
|
-
};`},useData:true};var
|
|
746
|
+
};`},useData:true};var Jn={1:function(e,n,o,t,r){return `import fetch, { FormData, Headers } from 'node-fetch';
|
|
728
747
|
import type { RequestInit, Response } from 'node-fetch';
|
|
729
748
|
|
|
730
|
-
`},3:function(e,n,o,r
|
|
749
|
+
`},3:function(e,n,o,t,r){return "ApiResult<T>"},5:function(e,n,o,t,r){return "T"},7:function(e,n,o,t,r){return "result.body"},9:function(e,n,o,t,r){return "result"},compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(p,l){if(Object.prototype.hasOwnProperty.call(p,l))return p[l]};return ((s=i(o,"equals").call(a,i(i(i(i(r,"root"),"$config"),"client"),"name"),"legacy/node",{name:"equals",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r,loc:{start:{line:1,column:0},end:{line:5,column:11}}}))!=null?s:"")+`import { ApiError } from './ApiError';
|
|
731
750
|
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
732
751
|
import type { ApiResult } from './ApiResult';
|
|
733
752
|
import { CancelablePromise } from './CancelablePromise';
|
|
734
753
|
import type { OnCancel } from './CancelablePromise';
|
|
735
754
|
import type { OpenAPIConfig } from './OpenAPI';
|
|
736
755
|
|
|
737
|
-
`+((s=e.invokePartial(i(
|
|
756
|
+
`+((s=e.invokePartial(i(t,"functions/isString"),n,{name:"functions/isString",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
738
757
|
|
|
739
|
-
`+((s=e.invokePartial(i(
|
|
758
|
+
`+((s=e.invokePartial(i(t,"functions/isStringWithValue"),n,{name:"functions/isStringWithValue",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
740
759
|
|
|
741
|
-
`+((s=e.invokePartial(i(
|
|
760
|
+
`+((s=e.invokePartial(i(t,"functions/isBlob"),n,{name:"functions/isBlob",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
742
761
|
|
|
743
|
-
`+((s=e.invokePartial(i(
|
|
762
|
+
`+((s=e.invokePartial(i(t,"functions/isFormData"),n,{name:"functions/isFormData",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
744
763
|
|
|
745
|
-
`+((s=e.invokePartial(i(
|
|
764
|
+
`+((s=e.invokePartial(i(t,"functions/base64"),n,{name:"functions/base64",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
746
765
|
|
|
747
|
-
`+((s=e.invokePartial(i(
|
|
766
|
+
`+((s=e.invokePartial(i(t,"functions/getQueryString"),n,{name:"functions/getQueryString",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
748
767
|
|
|
749
|
-
`+((s=e.invokePartial(i(
|
|
768
|
+
`+((s=e.invokePartial(i(t,"functions/getUrl"),n,{name:"functions/getUrl",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
750
769
|
|
|
751
|
-
`+((s=e.invokePartial(i(
|
|
770
|
+
`+((s=e.invokePartial(i(t,"functions/getFormData"),n,{name:"functions/getFormData",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
752
771
|
|
|
753
|
-
`+((s=e.invokePartial(i(
|
|
772
|
+
`+((s=e.invokePartial(i(t,"functions/resolve"),n,{name:"functions/resolve",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
754
773
|
|
|
755
|
-
`+((s=e.invokePartial(i(
|
|
774
|
+
`+((s=e.invokePartial(i(t,"fetch/getHeaders"),n,{name:"fetch/getHeaders",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
756
775
|
|
|
757
|
-
`+((s=e.invokePartial(i(
|
|
776
|
+
`+((s=e.invokePartial(i(t,"fetch/getRequestBody"),n,{name:"fetch/getRequestBody",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
758
777
|
|
|
759
|
-
`+((s=e.invokePartial(i(
|
|
778
|
+
`+((s=e.invokePartial(i(t,"fetch/sendRequest"),n,{name:"fetch/sendRequest",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
760
779
|
|
|
761
|
-
`+((s=e.invokePartial(i(
|
|
780
|
+
`+((s=e.invokePartial(i(t,"fetch/getResponseHeader"),n,{name:"fetch/getResponseHeader",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
762
781
|
|
|
763
|
-
`+((s=e.invokePartial(i(
|
|
782
|
+
`+((s=e.invokePartial(i(t,"fetch/getResponseBody"),n,{name:"fetch/getResponseBody",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
764
783
|
|
|
765
|
-
`+((s=e.invokePartial(i(
|
|
784
|
+
`+((s=e.invokePartial(i(t,"functions/catchErrorCodes"),n,{name:"functions/catchErrorCodes",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
766
785
|
|
|
767
786
|
/**
|
|
768
787
|
* Request method
|
|
769
788
|
* @param config The OpenAPI configuration object
|
|
770
789
|
* @param options The request options from the service
|
|
771
|
-
* @returns CancelablePromise<`+((s=i(o,"ifServicesResponse").call(a,"response",{name:"ifServicesResponse",hash:{},fn:e.program(3,
|
|
790
|
+
* @returns CancelablePromise<`+((s=i(o,"ifServicesResponse").call(a,"response",{name:"ifServicesResponse",hash:{},fn:e.program(3,r,0),inverse:e.program(5,r,0),data:r,loc:{start:{line:62,column:30},end:{line:62,column:108}}}))!=null?s:"")+`>
|
|
772
791
|
* @throws ApiError
|
|
773
792
|
*/
|
|
774
|
-
export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>): CancelablePromise<`+((s=i(o,"ifServicesResponse").call(a,"response",{name:"ifServicesResponse",hash:{},fn:e.program(3,
|
|
793
|
+
export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>): CancelablePromise<`+((s=i(o,"ifServicesResponse").call(a,"response",{name:"ifServicesResponse",hash:{},fn:e.program(3,r,0),inverse:e.program(5,r,0),data:r,loc:{start:{line:65,column:100},end:{line:65,column:178}}}))!=null?s:"")+`> => {
|
|
775
794
|
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
|
776
795
|
try {
|
|
777
796
|
const url = getUrl(config, options);
|
|
@@ -804,16 +823,16 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
804
823
|
|
|
805
824
|
catchErrorCodes(options, result);
|
|
806
825
|
|
|
807
|
-
resolve(`+((s=i(o,"ifServicesResponse").call(a,"body",{name:"ifServicesResponse",hash:{},fn:e.program(7,
|
|
826
|
+
resolve(`+((s=i(o,"ifServicesResponse").call(a,"body",{name:"ifServicesResponse",hash:{},fn:e.program(7,r,0),inverse:e.program(9,r,0),data:r,loc:{start:{line:98,column:12},end:{line:98,column:90}}}))!=null?s:"")+`);
|
|
808
827
|
}
|
|
809
828
|
} catch (error) {
|
|
810
829
|
reject(error);
|
|
811
830
|
}
|
|
812
831
|
});
|
|
813
|
-
};`},usePartial:true,useData:true};var Kn={1:function(e,n,o,r
|
|
832
|
+
};`},usePartial:true,useData:true};var Kn={1:function(e,n,o,t,r){return ` if (config.WITH_CREDENTIALS) {
|
|
814
833
|
request.credentials = config.CREDENTIALS;
|
|
815
834
|
}
|
|
816
|
-
`},compiler:[8,">= 4.3.0"],main:function(e,n,o,r
|
|
835
|
+
`},compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){var s,a=e.lookupProperty||function(i,p){if(Object.prototype.hasOwnProperty.call(i,p))return i[p]};return `export const sendRequest = async (
|
|
817
836
|
config: OpenAPIConfig,
|
|
818
837
|
options: ApiRequestOptions,
|
|
819
838
|
url: string,
|
|
@@ -831,7 +850,7 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
831
850
|
signal: controller.signal,
|
|
832
851
|
};
|
|
833
852
|
|
|
834
|
-
`+((s=a(o,"equals").call(n??(e.nullContext||{}),a(a(a(a(
|
|
853
|
+
`+((s=a(o,"equals").call(n??(e.nullContext||{}),a(a(a(a(r,"root"),"$config"),"client"),"name"),"legacy/fetch",{name:"equals",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r,loc:{start:{line:19,column:1},end:{line:23,column:12}}}))!=null?s:"")+`
|
|
835
854
|
for (const fn of config.interceptors.request._fns) {
|
|
836
855
|
request = await fn(request);
|
|
837
856
|
}
|
|
@@ -839,14 +858,14 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
839
858
|
onCancel(() => controller.abort());
|
|
840
859
|
|
|
841
860
|
return await fetch(url, request);
|
|
842
|
-
};`},useData:true};var Xn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r
|
|
861
|
+
};`},useData:true};var Xn={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const base64 = (str: string): string => {
|
|
843
862
|
try {
|
|
844
863
|
return btoa(str);
|
|
845
864
|
} catch (err) {
|
|
846
865
|
// @ts-ignore
|
|
847
866
|
return Buffer.from(str).toString('base64');
|
|
848
867
|
}
|
|
849
|
-
};`},useData:true};var Qn={compiler:[8,">= 4.3.0"],main:function(e,n,o,r
|
|
868
|
+
};`},useData:true};var Qn={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => {
|
|
850
869
|
const errors: Record<number, string> = {
|
|
851
870
|
400: 'Bad Request',
|
|
852
871
|
401: 'Unauthorized',
|
|
@@ -911,7 +930,7 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
911
930
|
\`Generic Error: status: \${errorStatus}; status text: \${errorStatusText}; body: \${errorBody}\`
|
|
912
931
|
);
|
|
913
932
|
}
|
|
914
|
-
};`},useData:true};var
|
|
933
|
+
};`},useData:true};var Zn={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getFormData = (options: ApiRequestOptions): FormData | undefined => {
|
|
915
934
|
if (options.formData) {
|
|
916
935
|
const formData = new FormData();
|
|
917
936
|
|
|
@@ -936,7 +955,7 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
936
955
|
return formData;
|
|
937
956
|
}
|
|
938
957
|
return undefined;
|
|
939
|
-
};`},useData:true};var
|
|
958
|
+
};`},useData:true};var et={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getQueryString = (params: Record<string, unknown>): string => {
|
|
940
959
|
const qs: string[] = [];
|
|
941
960
|
|
|
942
961
|
const append = (key: string, value: unknown) => {
|
|
@@ -962,7 +981,7 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
962
981
|
Object.entries(params).forEach(([key, value]) => encodePair(key, value));
|
|
963
982
|
|
|
964
983
|
return qs.length ? \`?\${qs.join('&')}\` : '';
|
|
965
|
-
};`},useData:true};var
|
|
984
|
+
};`},useData:true};var nt={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {
|
|
966
985
|
const encoder = config.ENCODE_PATH || encodeURI;
|
|
967
986
|
|
|
968
987
|
const path = options.url
|
|
@@ -976,24 +995,24 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
976
995
|
|
|
977
996
|
const url = config.BASE + path;
|
|
978
997
|
return options.query ? url + getQueryString(options.query) : url;
|
|
979
|
-
};`},useData:true};var
|
|
998
|
+
};`},useData:true};var tt={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const isBlob = (value: any): value is Blob => {
|
|
980
999
|
return value instanceof Blob;
|
|
981
|
-
};`},useData:true};var
|
|
1000
|
+
};`},useData:true};var rt={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const isFormData = (value: unknown): value is FormData => {
|
|
982
1001
|
return value instanceof FormData;
|
|
983
|
-
};`},useData:true};var
|
|
1002
|
+
};`},useData:true};var ot={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const isString = (value: unknown): value is string => {
|
|
984
1003
|
return typeof value === 'string';
|
|
985
|
-
};`},useData:true};var
|
|
1004
|
+
};`},useData:true};var st={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const isStringWithValue = (value: unknown): value is string => {
|
|
986
1005
|
return isString(value) && value !== '';
|
|
987
|
-
};`},useData:true};var
|
|
1006
|
+
};`},useData:true};var it={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const isSuccess = (status: number): boolean => {
|
|
988
1007
|
return status >= 200 && status < 300;
|
|
989
|
-
};`},useData:true};var
|
|
1008
|
+
};`},useData:true};var at={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `type Resolver<T> = (options: ApiRequestOptions<T>) => Promise<T>;
|
|
990
1009
|
|
|
991
1010
|
export const resolve = async <T>(options: ApiRequestOptions<T>, resolver?: T | Resolver<T>): Promise<T | undefined> => {
|
|
992
1011
|
if (typeof resolver === 'function') {
|
|
993
1012
|
return (resolver as Resolver<T>)(options);
|
|
994
1013
|
}
|
|
995
1014
|
return resolver;
|
|
996
|
-
};`},useData:true};var
|
|
1015
|
+
};`},useData:true};var lt={1:function(e,n,o,t,r){return `import { Inject, Injectable } from '@angular/core';
|
|
997
1016
|
import { HttpClient } from '@angular/common/http';
|
|
998
1017
|
import type { Observable } from 'rxjs';
|
|
999
1018
|
|
|
@@ -1002,23 +1021,23 @@ import { BaseHttpRequest } from './BaseHttpRequest';
|
|
|
1002
1021
|
import type { OpenAPIConfig } from './OpenAPI';
|
|
1003
1022
|
import { OpenAPI } from './OpenAPI';
|
|
1004
1023
|
import { request as __request } from './request';
|
|
1005
|
-
`},3:function(e,n,o,r
|
|
1024
|
+
`},3:function(e,n,o,t,r){return `import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
1006
1025
|
import { BaseHttpRequest } from './BaseHttpRequest';
|
|
1007
1026
|
import type { CancelablePromise } from './CancelablePromise';
|
|
1008
1027
|
import type { OpenAPIConfig } from './OpenAPI';
|
|
1009
1028
|
import { request as __request } from './request';
|
|
1010
|
-
`},5:function(e,n,o,r
|
|
1011
|
-
`},7:function(e,n,o,r
|
|
1029
|
+
`},5:function(e,n,o,t,r){return `@Injectable()
|
|
1030
|
+
`},7:function(e,n,o,t,r){return ` constructor(
|
|
1012
1031
|
@Inject(OpenAPI)
|
|
1013
1032
|
config: OpenAPIConfig,
|
|
1014
1033
|
http: HttpClient,
|
|
1015
1034
|
) {
|
|
1016
1035
|
super(config, http);
|
|
1017
1036
|
}
|
|
1018
|
-
`},9:function(e,n,o,r
|
|
1037
|
+
`},9:function(e,n,o,t,r){return ` constructor(config: OpenAPIConfig) {
|
|
1019
1038
|
super(config);
|
|
1020
1039
|
}
|
|
1021
|
-
`},11:function(e,n,o,r
|
|
1040
|
+
`},11:function(e,n,o,t,r){return ` /**
|
|
1022
1041
|
* Request method
|
|
1023
1042
|
* @param options The request options from the service
|
|
1024
1043
|
* @returns Observable<T>
|
|
@@ -1027,7 +1046,7 @@ import { request as __request } from './request';
|
|
|
1027
1046
|
public override request<T>(options: ApiRequestOptions<T>): Observable<T> {
|
|
1028
1047
|
return __request(this.config, this.http, options);
|
|
1029
1048
|
}
|
|
1030
|
-
`},13:function(e,n,o,r
|
|
1049
|
+
`},13:function(e,n,o,t,r){return ` /**
|
|
1031
1050
|
* Request method
|
|
1032
1051
|
* @param options The request options from the service
|
|
1033
1052
|
* @returns CancelablePromise<T>
|
|
@@ -1036,22 +1055,22 @@ import { request as __request } from './request';
|
|
|
1036
1055
|
public override request<T>(options: ApiRequestOptions<T>): CancelablePromise<T> {
|
|
1037
1056
|
return __request(this.config, options);
|
|
1038
1057
|
}
|
|
1039
|
-
`},compiler:[8,">= 4.3.0"],main:function(e,n,o,r
|
|
1040
|
-
`+((s=i(o,"equals").call(a,i(i(i(i(
|
|
1041
|
-
|
|
1042
|
-
`+((s=i(o,"equals").call(a,i(i(i(i(
|
|
1043
|
-
`+((s=i(o,"equals").call(a,i(i(i(i(
|
|
1044
|
-
`},3:function(e,n,o,r
|
|
1045
|
-
`},5:function(e,n,o,r
|
|
1046
|
-
`},7:function(e,n,o,r
|
|
1047
|
-
`},9:function(e,n,o,r
|
|
1058
|
+
`},compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(p,l){if(Object.prototype.hasOwnProperty.call(p,l))return p[l]};return ((s=i(o,"equals").call(a,i(i(i(i(r,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(1,r,0),inverse:e.program(3,r,0),data:r,loc:{start:{line:1,column:0},end:{line:17,column:11}}}))!=null?s:"")+`
|
|
1059
|
+
`+((s=i(o,"equals").call(a,i(i(i(i(r,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(5,r,0),inverse:e.noop,data:r,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 {
|
|
1060
|
+
|
|
1061
|
+
`+((s=i(o,"equals").call(a,i(i(i(i(r,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(7,r,0),inverse:e.program(9,r,0),data:r,loc:{start:{line:24,column:1},end:{line:36,column:12}}}))!=null?s:"")+`
|
|
1062
|
+
`+((s=i(o,"equals").call(a,i(i(i(i(r,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(11,r,0),inverse:e.program(13,r,0),data:r,loc:{start:{line:38,column:1},end:{line:58,column:12}}}))!=null?s:"")+"}"},useData:true};var pt={1:function(e,n,o,t,r){return `import type { HttpResponse } from '@angular/common/http';
|
|
1063
|
+
`},3:function(e,n,o,t,r){return `import type { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
1064
|
+
`},5:function(e,n,o,t,r){return `import type { RequestInit, Response } from 'node-fetch';
|
|
1065
|
+
`},7:function(e,n,o,t,r){return ` response: Interceptors<HttpResponse<any>>;
|
|
1066
|
+
`},9:function(e,n,o,t,r){return ` request: Interceptors<AxiosRequestConfig>;
|
|
1048
1067
|
response: Interceptors<AxiosResponse>;
|
|
1049
|
-
`},11:function(e,n,o,r
|
|
1068
|
+
`},11:function(e,n,o,t,r){return ` request: Interceptors<RequestInit>;
|
|
1050
1069
|
response: Interceptors<Response>;
|
|
1051
|
-
`},13:function(e,n,o,r
|
|
1070
|
+
`},13:function(e,n,o,t,r){return ` request: Interceptors<XMLHttpRequest>;
|
|
1052
1071
|
response: Interceptors<XMLHttpRequest>;
|
|
1053
|
-
`},15:function(e,n,o,r
|
|
1054
|
-
`},compiler:[8,">= 4.3.0"],main:function(e,n,o,r
|
|
1072
|
+
`},15:function(e,n,o,t,r){return ` request: new Interceptors(),
|
|
1073
|
+
`},compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){var s,a=n??(e.nullContext||{}),i=e.strict,p=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(r,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r,loc:{start:{line:1,column:0},end:{line:3,column:11}}}))!=null?s:"")+((s=l(o,"equals").call(a,l(l(l(l(r,"root"),"$config"),"client"),"name"),"legacy/axios",{name:"equals",hash:{},fn:e.program(3,r,0),inverse:e.noop,data:r,loc:{start:{line:4,column:0},end:{line:6,column:11}}}))!=null?s:"")+((s=l(o,"equals").call(a,l(l(l(l(r,"root"),"$config"),"client"),"name"),"legacy/node",{name:"equals",hash:{},fn:e.program(5,r,0),inverse:e.noop,data:r,loc:{start:{line:7,column:0},end:{line:9,column:11}}}))!=null?s:"")+`import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
1055
1074
|
|
|
1056
1075
|
type Headers = Record<string, string>;
|
|
1057
1076
|
type Middleware<T> = (value: T) => T | Promise<T>;
|
|
@@ -1087,7 +1106,7 @@ export type OpenAPIConfig = {
|
|
|
1087
1106
|
VERSION: string;
|
|
1088
1107
|
WITH_CREDENTIALS: boolean;
|
|
1089
1108
|
interceptors: {
|
|
1090
|
-
`+((s=l(o,"equals").call(a,l(l(l(l(
|
|
1109
|
+
`+((s=l(o,"equals").call(a,l(l(l(l(r,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(7,r,0),inverse:e.noop,data:r,loc:{start:{line:46,column:2},end:{line:48,column:13}}}))!=null?s:"")+((s=l(o,"equals").call(a,l(l(l(l(r,"root"),"$config"),"client"),"name"),"legacy/axios",{name:"equals",hash:{},fn:e.program(9,r,0),inverse:e.noop,data:r,loc:{start:{line:49,column:2},end:{line:52,column:13}}}))!=null?s:"")+((s=l(o,"equals").call(a,l(l(l(l(r,"root"),"$config"),"client"),"name"),"legacy/fetch",{name:"equals",hash:{},fn:e.program(11,r,0),inverse:e.noop,data:r,loc:{start:{line:53,column:2},end:{line:56,column:13}}}))!=null?s:"")+((s=l(o,"equals").call(a,l(l(l(l(r,"root"),"$config"),"client"),"name"),"legacy/node",{name:"equals",hash:{},fn:e.program(11,r,0),inverse:e.noop,data:r,loc:{start:{line:57,column:2},end:{line:60,column:13}}}))!=null?s:"")+((s=l(o,"equals").call(a,l(l(l(l(r,"root"),"$config"),"client"),"name"),"legacy/xhr",{name:"equals",hash:{},fn:e.program(13,r,0),inverse:e.noop,data:r,loc:{start:{line:61,column:2},end:{line:64,column:13}}}))!=null?s:"")+` };
|
|
1091
1110
|
};
|
|
1092
1111
|
|
|
1093
1112
|
export const OpenAPI: OpenAPIConfig = {
|
|
@@ -1101,9 +1120,9 @@ export const OpenAPI: OpenAPIConfig = {
|
|
|
1101
1120
|
VERSION: '`+((s=p(i(n,"version",{start:{line:76,column:14},end:{line:76,column:21}}),n))!=null?s:"")+`',
|
|
1102
1121
|
WITH_CREDENTIALS: false,
|
|
1103
1122
|
interceptors: {
|
|
1104
|
-
`+((s=l(o,"notEquals").call(a,l(l(l(l(
|
|
1123
|
+
`+((s=l(o,"notEquals").call(a,l(l(l(l(r,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"notEquals",hash:{},fn:e.program(15,r,0),inverse:e.noop,data:r,loc:{start:{line:79,column:2},end:{line:81,column:16}}}))!=null?s:"")+` response: new Interceptors(),
|
|
1105
1124
|
},
|
|
1106
|
-
};`},useData:true};var
|
|
1125
|
+
};`},useData:true};var ut={1:function(e,n,o,t,r){var s,a=e.lookupProperty||function(i,p){if(Object.prototype.hasOwnProperty.call(i,p))return i[p]};return (s=e.invokePartial(a(t,"angular/request"),n,{name:"angular/request",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:""},3:function(e,n,o,t,r){var s,a=e.lookupProperty||function(i,p){if(Object.prototype.hasOwnProperty.call(i,p))return i[p]};return (s=e.invokePartial(a(t,"axios/request"),n,{name:"axios/request",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:""},5:function(e,n,o,t,r){var s,a=e.lookupProperty||function(i,p){if(Object.prototype.hasOwnProperty.call(i,p))return i[p]};return (s=e.invokePartial(a(t,"fetch/request"),n,{name:"fetch/request",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:""},7:function(e,n,o,t,r){var s,a=e.lookupProperty||function(i,p){if(Object.prototype.hasOwnProperty.call(i,p))return i[p]};return (s=e.invokePartial(a(t,"xhr/request"),n,{name:"xhr/request",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:""},compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(p,l){if(Object.prototype.hasOwnProperty.call(p,l))return p[l]};return ((s=i(o,"equals").call(a,i(i(i(i(r,"root"),"$config"),"client"),"name"),"legacy/angular",{name:"equals",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r,loc:{start:{line:1,column:0},end:{line:1,column:87}}}))!=null?s:"")+((s=i(o,"equals").call(a,i(i(i(i(r,"root"),"$config"),"client"),"name"),"legacy/axios",{name:"equals",hash:{},fn:e.program(3,r,0),inverse:e.noop,data:r,loc:{start:{line:2,column:0},end:{line:2,column:83}}}))!=null?s:"")+((s=i(o,"equals").call(a,i(i(i(i(r,"root"),"$config"),"client"),"name"),"legacy/fetch",{name:"equals",hash:{},fn:e.program(5,r,0),inverse:e.noop,data:r,loc:{start:{line:3,column:0},end:{line:3,column:83}}}))!=null?s:"")+((s=i(o,"equals").call(a,i(i(i(i(r,"root"),"$config"),"client"),"name"),"legacy/node",{name:"equals",hash:{},fn:e.program(5,r,0),inverse:e.noop,data:r,loc:{start:{line:4,column:0},end:{line:4,column:82}}}))!=null?s:"")+((s=i(o,"equals").call(a,i(i(i(i(r,"root"),"$config"),"client"),"name"),"legacy/xhr",{name:"equals",hash:{},fn:e.program(7,r,0),inverse:e.noop,data:r,loc:{start:{line:5,column:0},end:{line:5,column:79}}}))!=null?s:"")},usePartial:true,useData:true};var ct={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getHeaders = async <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>): Promise<Headers> => {
|
|
1107
1126
|
const [token, username, password, additionalHeaders] = await Promise.all([
|
|
1108
1127
|
// @ts-ignore
|
|
1109
1128
|
resolve(options, config.TOKEN),
|
|
@@ -1148,7 +1167,7 @@ export const OpenAPI: OpenAPIConfig = {
|
|
|
1148
1167
|
}
|
|
1149
1168
|
|
|
1150
1169
|
return new Headers(headers);
|
|
1151
|
-
};`},useData:true};var
|
|
1170
|
+
};`},useData:true};var ft={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getRequestBody = (options: ApiRequestOptions): unknown => {
|
|
1152
1171
|
if (options.body !== undefined) {
|
|
1153
1172
|
if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) {
|
|
1154
1173
|
return JSON.stringify(options.body);
|
|
@@ -1159,7 +1178,7 @@ export const OpenAPI: OpenAPIConfig = {
|
|
|
1159
1178
|
}
|
|
1160
1179
|
}
|
|
1161
1180
|
return undefined;
|
|
1162
|
-
};`},useData:true};var
|
|
1181
|
+
};`},useData:true};var mt={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getResponseBody = (xhr: XMLHttpRequest): unknown => {
|
|
1163
1182
|
if (xhr.status !== 204) {
|
|
1164
1183
|
try {
|
|
1165
1184
|
const contentType = xhr.getResponseHeader('Content-Type');
|
|
@@ -1175,7 +1194,7 @@ export const OpenAPI: OpenAPIConfig = {
|
|
|
1175
1194
|
}
|
|
1176
1195
|
}
|
|
1177
1196
|
return undefined;
|
|
1178
|
-
};`},useData:true};var
|
|
1197
|
+
};`},useData:true};var dt={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const getResponseHeader = (xhr: XMLHttpRequest, responseHeader?: string): string | undefined => {
|
|
1179
1198
|
if (responseHeader) {
|
|
1180
1199
|
const content = xhr.getResponseHeader(responseHeader);
|
|
1181
1200
|
if (isString(content)) {
|
|
@@ -1183,53 +1202,53 @@ export const OpenAPI: OpenAPIConfig = {
|
|
|
1183
1202
|
}
|
|
1184
1203
|
}
|
|
1185
1204
|
return undefined;
|
|
1186
|
-
};`},useData:true};var
|
|
1205
|
+
};`},useData:true};var gt={1:function(e,n,o,t,r){return "ApiResult<T>"},3:function(e,n,o,t,r){return "T"},5:function(e,n,o,t,r){return "result.body"},7:function(e,n,o,t,r){return "result"},compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){var s,a=n??(e.nullContext||{}),i=e.lookupProperty||function(p,l){if(Object.prototype.hasOwnProperty.call(p,l))return p[l]};return `import { ApiError } from './ApiError';
|
|
1187
1206
|
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
1188
1207
|
import type { ApiResult } from './ApiResult';
|
|
1189
1208
|
import { CancelablePromise } from './CancelablePromise';
|
|
1190
1209
|
import type { OnCancel } from './CancelablePromise';
|
|
1191
1210
|
import type { OpenAPIConfig } from './OpenAPI';
|
|
1192
1211
|
|
|
1193
|
-
`+((s=e.invokePartial(i(
|
|
1212
|
+
`+((s=e.invokePartial(i(t,"functions/isString"),n,{name:"functions/isString",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
1194
1213
|
|
|
1195
|
-
`+((s=e.invokePartial(i(
|
|
1214
|
+
`+((s=e.invokePartial(i(t,"functions/isStringWithValue"),n,{name:"functions/isStringWithValue",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
1196
1215
|
|
|
1197
|
-
`+((s=e.invokePartial(i(
|
|
1216
|
+
`+((s=e.invokePartial(i(t,"functions/isBlob"),n,{name:"functions/isBlob",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
1198
1217
|
|
|
1199
|
-
`+((s=e.invokePartial(i(
|
|
1218
|
+
`+((s=e.invokePartial(i(t,"functions/isFormData"),n,{name:"functions/isFormData",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
1200
1219
|
|
|
1201
|
-
`+((s=e.invokePartial(i(
|
|
1220
|
+
`+((s=e.invokePartial(i(t,"functions/isSuccess"),n,{name:"functions/isSuccess",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
1202
1221
|
|
|
1203
|
-
`+((s=e.invokePartial(i(
|
|
1222
|
+
`+((s=e.invokePartial(i(t,"functions/base64"),n,{name:"functions/base64",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
1204
1223
|
|
|
1205
|
-
`+((s=e.invokePartial(i(
|
|
1224
|
+
`+((s=e.invokePartial(i(t,"functions/getQueryString"),n,{name:"functions/getQueryString",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
1206
1225
|
|
|
1207
|
-
`+((s=e.invokePartial(i(
|
|
1226
|
+
`+((s=e.invokePartial(i(t,"functions/getUrl"),n,{name:"functions/getUrl",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
1208
1227
|
|
|
1209
|
-
`+((s=e.invokePartial(i(
|
|
1228
|
+
`+((s=e.invokePartial(i(t,"functions/getFormData"),n,{name:"functions/getFormData",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
1210
1229
|
|
|
1211
|
-
`+((s=e.invokePartial(i(
|
|
1230
|
+
`+((s=e.invokePartial(i(t,"functions/resolve"),n,{name:"functions/resolve",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
1212
1231
|
|
|
1213
|
-
`+((s=e.invokePartial(i(
|
|
1232
|
+
`+((s=e.invokePartial(i(t,"fetch/getHeaders"),n,{name:"fetch/getHeaders",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
1214
1233
|
|
|
1215
|
-
`+((s=e.invokePartial(i(
|
|
1234
|
+
`+((s=e.invokePartial(i(t,"xhr/getRequestBody"),n,{name:"xhr/getRequestBody",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
1216
1235
|
|
|
1217
|
-
`+((s=e.invokePartial(i(
|
|
1236
|
+
`+((s=e.invokePartial(i(t,"xhr/sendRequest"),n,{name:"xhr/sendRequest",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
1218
1237
|
|
|
1219
|
-
`+((s=e.invokePartial(i(
|
|
1238
|
+
`+((s=e.invokePartial(i(t,"xhr/getResponseHeader"),n,{name:"xhr/getResponseHeader",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
1220
1239
|
|
|
1221
|
-
`+((s=e.invokePartial(i(
|
|
1240
|
+
`+((s=e.invokePartial(i(t,"xhr/getResponseBody"),n,{name:"xhr/getResponseBody",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
1222
1241
|
|
|
1223
|
-
`+((s=e.invokePartial(i(
|
|
1242
|
+
`+((s=e.invokePartial(i(t,"functions/catchErrorCodes"),n,{name:"functions/catchErrorCodes",data:r,helpers:o,partials:t,decorators:e.decorators}))!=null?s:"")+`
|
|
1224
1243
|
|
|
1225
1244
|
/**
|
|
1226
1245
|
* Request method
|
|
1227
1246
|
* @param config The OpenAPI configuration object
|
|
1228
1247
|
* @param options The request options from the service
|
|
1229
|
-
* @returns CancelablePromise<`+((s=i(o,"ifServicesResponse").call(a,"response",{name:"ifServicesResponse",hash:{},fn:e.program(1,
|
|
1248
|
+
* @returns CancelablePromise<`+((s=i(o,"ifServicesResponse").call(a,"response",{name:"ifServicesResponse",hash:{},fn:e.program(1,r,0),inverse:e.program(3,r,0),data:r,loc:{start:{line:60,column:30},end:{line:60,column:108}}}))!=null?s:"")+`>
|
|
1230
1249
|
* @throws ApiError
|
|
1231
1250
|
*/
|
|
1232
|
-
export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>): CancelablePromise<`+((s=i(o,"ifServicesResponse").call(a,"response",{name:"ifServicesResponse",hash:{},fn:e.program(1,
|
|
1251
|
+
export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>): CancelablePromise<`+((s=i(o,"ifServicesResponse").call(a,"response",{name:"ifServicesResponse",hash:{},fn:e.program(1,r,0),inverse:e.program(3,r,0),data:r,loc:{start:{line:63,column:100},end:{line:63,column:178}}}))!=null?s:"")+`> => {
|
|
1233
1252
|
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
|
1234
1253
|
try {
|
|
1235
1254
|
const url = getUrl(config, options);
|
|
@@ -1262,13 +1281,13 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
1262
1281
|
|
|
1263
1282
|
catchErrorCodes(options, result);
|
|
1264
1283
|
|
|
1265
|
-
resolve(`+((s=i(o,"ifServicesResponse").call(a,"body",{name:"ifServicesResponse",hash:{},fn:e.program(5,
|
|
1284
|
+
resolve(`+((s=i(o,"ifServicesResponse").call(a,"body",{name:"ifServicesResponse",hash:{},fn:e.program(5,r,0),inverse:e.program(7,r,0),data:r,loc:{start:{line:96,column:12},end:{line:96,column:90}}}))!=null?s:"")+`);
|
|
1266
1285
|
}
|
|
1267
1286
|
} catch (error) {
|
|
1268
1287
|
reject(error);
|
|
1269
1288
|
}
|
|
1270
1289
|
});
|
|
1271
|
-
};`},usePartial:true,useData:true};var
|
|
1290
|
+
};`},usePartial:true,useData:true};var yt={compiler:[8,">= 4.3.0"],main:function(e,n,o,t,r){return `export const sendRequest = async (
|
|
1272
1291
|
config: OpenAPIConfig,
|
|
1273
1292
|
options: ApiRequestOptions,
|
|
1274
1293
|
url: string,
|
|
@@ -1298,5 +1317,5 @@ export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>)
|
|
|
1298
1317
|
|
|
1299
1318
|
onCancel(() => xhr.abort());
|
|
1300
1319
|
});
|
|
1301
|
-
};`},useData:true};var
|
|
1320
|
+
};`},useData:true};var gr=()=>{u$1.registerHelper("camelCase",function(e){return u({case:"camelCase",value:e})}),u$1.registerHelper("equals",function(e,n,o){return e===n?o.fn(this):o.inverse(this)}),u$1.registerHelper("ifServicesResponse",function(e,n){return o().plugins["@hey-api/sdk"]?.config.response===e?n.fn(this):n.inverse(this)}),u$1.registerHelper("ifdef",function(...e){let n=e.pop();return e.every(o=>!o)?n.inverse(this):n.fn(this)}),u$1.registerHelper("notEquals",function(e,n,o){return e!==n?o.fn(this):o.inverse(this)}),u$1.registerHelper("transformServiceName",function(e){return y({config:o(),name:e})});},ht=()=>{gr();let e={client:u$1.template(Tn),core:{apiError:u$1.template(Dn),apiRequestOptions:u$1.template($n),apiResult:u$1.template(Bn),baseHttpRequest:u$1.template(Wn),cancelablePromise:u$1.template(Un),httpRequest:u$1.template(lt),request:u$1.template(ut),settings:u$1.template(pt)}};return u$1.registerPartial("functions/base64",u$1.template(Xn)),u$1.registerPartial("functions/catchErrorCodes",u$1.template(Qn)),u$1.registerPartial("functions/getFormData",u$1.template(Zn)),u$1.registerPartial("functions/getQueryString",u$1.template(et)),u$1.registerPartial("functions/getUrl",u$1.template(nt)),u$1.registerPartial("functions/isBlob",u$1.template(tt)),u$1.registerPartial("functions/isFormData",u$1.template(rt)),u$1.registerPartial("functions/isString",u$1.template(ot)),u$1.registerPartial("functions/isStringWithValue",u$1.template(st)),u$1.registerPartial("functions/isSuccess",u$1.template(it)),u$1.registerPartial("functions/resolve",u$1.template(at)),u$1.registerPartial("fetch/getHeaders",u$1.template(Vn)),u$1.registerPartial("fetch/getRequestBody",u$1.template(Gn)),u$1.registerPartial("fetch/getResponseBody",u$1.template(zn)),u$1.registerPartial("fetch/getResponseHeader",u$1.template(Yn)),u$1.registerPartial("fetch/request",u$1.template(Jn)),u$1.registerPartial("fetch/sendRequest",u$1.template(Kn)),u$1.registerPartial("xhr/getHeaders",u$1.template(ct)),u$1.registerPartial("xhr/getRequestBody",u$1.template(ft)),u$1.registerPartial("xhr/getResponseBody",u$1.template(mt)),u$1.registerPartial("xhr/getResponseHeader",u$1.template(dt)),u$1.registerPartial("xhr/request",u$1.template(gt)),u$1.registerPartial("xhr/sendRequest",u$1.template(yt)),u$1.registerPartial("axios/getHeaders",u$1.template(jn)),u$1.registerPartial("axios/getRequestBody",u$1.template(_n)),u$1.registerPartial("axios/getResponseBody",u$1.template(Nn)),u$1.registerPartial("axios/getResponseHeader",u$1.template(Fn)),u$1.registerPartial("axios/request",u$1.template(Ln)),u$1.registerPartial("axios/sendRequest",u$1.template(Mn)),u$1.registerPartial("angular/getHeaders",u$1.template(wn)),u$1.registerPartial("angular/getRequestBody",u$1.template(kn)),u$1.registerPartial("angular/getResponseBody",u$1.template(Sn)),u$1.registerPartial("angular/getResponseHeader",u$1.template(On)),u$1.registerPartial("angular/request",u$1.template(Hn)),u$1.registerPartial("angular/sendRequest",u$1.template(In)),e};var yr=0,vt=e=>`${e}-${yr++}`,ae=e=>`${e}-end`,Rt=e=>`${e}-length`,le=e=>`${e}-start`,hr=(e,n)=>{if(e>200)return {color:h.red,type:"duration"};if(n>30)return {color:h.red,type:"percentage"};if(e>50)return {color:h.yellow,type:"duration"};if(n>10)return {color:h.yellow,type:"percentage"}},B=class{events=[];end(n){let o,t=this.events;for(let r of n.position)o=t[r],o?.events&&(t=o.events);o&&!o.end&&(o.end=performance.mark(ae(o.id)));}report(n=true){let o=this.events[0];if(!o)return;let t=this.events[this.events.length-1],r="root",s=vt(r),a=performance.measure(Rt(s),le(o.id),ae(t.id));return n&&this.reportEvent({end:t.end,events:this.events,id:s,indent:0,measure:a,name:r,start:o.start}),a}reportEvent({indent:n,...o}){let t=n?h.gray:h.cyan,r=o.events.length-1;o.events.forEach((s,a)=>{let i=performance.measure(Rt(s.id),le(s.id),ae(s.id)),p=Math.ceil(i.duration*100)/100,l=Math.ceil(i.duration/o.measure.duration*100*100)/100,c=n?hr(p,l):void 0,f=`${p.toFixed(2).padStart(8)}ms`;c?.type==="duration"&&(f=c.color(f));let m=a===r?"\u2514\u2500 ":"\u251C\u2500 ",d=n?"\u2502 ".repeat(n-1)+m:"",g=38-d.length,y=n?"\u21B3 ":"",E=`${n?" ".repeat(n-1)+y:""}${l.toFixed(2)}%`;c?.type==="percentage"&&(E=c.color(E));let k=h.gray("[root] ");console.log(`${k}${h.gray(d)}${t(`${s.name.padEnd(g)} ${f} (${E})`)}`),this.reportEvent({...s,indent:n+1,measure:i});});}start(n){return performance.mark(le(n))}storeEvent({result:n,...o}){let t=o.events.length-1,r=o.events[t];if(r&&!r.end){n.position=[...n.position,t],this.storeEvent({...o,events:r.events,result:n});return}let s=o.events.push({...o,events:[]});n.position=[...n.position,s-1];}timeEvent(n){let o=vt(n),t=this.start(o),r={events:this.events,id:o,name:n,start:t},s={position:[]};return this.storeEvent({...r,result:s}),{mark:t,timeEnd:()=>this.end(s)}}};var vr={stringCase:u};h.enabled=xr().hasBasic;var Ui=async(e,n=new B)=>{let o=typeof e=="function"?await e():e,t=o?o instanceof Array?o:[o]:[],r$1=t.find(a=>r(a).level!=="silent")?.logs;typeof r$1=="string"&&(r$1=r({logs:r$1}));let s;try{qe();let a=n.timeEvent("createClient"),i$1=n.timeEvent("config");s=await K({logger:n,userConfigs:t}),s.results.some(y=>y.config.logs.level!=="silent")&&En(),i$1.timeEnd();let l=s.results.flatMap(y=>y.errors.map(R=>({error:R,jobIndex:y.jobIndex})));if(l.length)throw new h$1(l);let c=n.timeEvent("handlebars"),f=ht();c.timeEnd();let d=(await Promise.all(s.results.map(async y=>{try{return await ie({config:y.config,dependencies:s.dependencies,jobIndex:y.jobIndex,logger:n,templates:f})}catch(R){throw new i("",{error:R,jobIndex:y.jobIndex})}}))).filter(y=>!!y);a.timeEnd();let g=s.results.some(y=>y.config.logs.level==="debug");return n.report(g),d}catch(a){let i=s?.results??[],p=i.find(l=>l.config.logs.level!=="silent")?.config.logs??r$1;if(!p||p.level!=="silent"){let l$1=i.some(m=>m.config.dryRun)??t.some(m=>m.dryRun)??false,c=p?.file&&!l$1?j(a,p.path??""):void 0;l({error:a,logPath:c});let f=i.some(m=>m.config.interactive)??t.some(m=>m.interactive)??false;await m({error:a,isInteractive:f})&&await k(a);}throw a}},Vi=async e=>typeof e=="function"?await e():e;export{B as Logger,Ui as createClient,Vi as defineConfig,vr as utils};//# sourceMappingURL=index.js.map
|
|
1302
1321
|
//# sourceMappingURL=index.js.map
|