From 51e8666bef0e0736e467418dd92b78d13caf452d Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Mon, 8 Apr 2024 08:53:27 +0100 Subject: [PATCH 01/22] chore: npx create-next-app@latest --- .../typescript-nextjs/.gitignore | 36 +++ integration-tests/typescript-nextjs/README.md | 36 +++ .../typescript-nextjs/next.config.mjs | 4 + .../typescript-nextjs/package.json | 22 ++ .../typescript-nextjs/public/next.svg | 1 + .../typescript-nextjs/public/vercel.svg | 1 + .../typescript-nextjs/src/app/favicon.ico | Bin 0 -> 25931 bytes .../typescript-nextjs/src/app/globals.css | 107 ++++++++ .../typescript-nextjs/src/app/layout.tsx | 22 ++ .../typescript-nextjs/src/app/page.module.css | 230 ++++++++++++++++++ .../typescript-nextjs/src/app/page.tsx | 95 ++++++++ .../typescript-nextjs/tsconfig.json | 26 ++ 12 files changed, 580 insertions(+) create mode 100644 integration-tests/typescript-nextjs/.gitignore create mode 100644 integration-tests/typescript-nextjs/README.md create mode 100644 integration-tests/typescript-nextjs/next.config.mjs create mode 100644 integration-tests/typescript-nextjs/package.json create mode 100644 integration-tests/typescript-nextjs/public/next.svg create mode 100644 integration-tests/typescript-nextjs/public/vercel.svg create mode 100644 integration-tests/typescript-nextjs/src/app/favicon.ico create mode 100644 integration-tests/typescript-nextjs/src/app/globals.css create mode 100644 integration-tests/typescript-nextjs/src/app/layout.tsx create mode 100644 integration-tests/typescript-nextjs/src/app/page.module.css create mode 100644 integration-tests/typescript-nextjs/src/app/page.tsx create mode 100644 integration-tests/typescript-nextjs/tsconfig.json diff --git a/integration-tests/typescript-nextjs/.gitignore b/integration-tests/typescript-nextjs/.gitignore new file mode 100644 index 000000000..fd3dbb571 --- /dev/null +++ b/integration-tests/typescript-nextjs/.gitignore @@ -0,0 +1,36 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js +.yarn/install-state.gz + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/integration-tests/typescript-nextjs/README.md b/integration-tests/typescript-nextjs/README.md new file mode 100644 index 000000000..c4033664f --- /dev/null +++ b/integration-tests/typescript-nextjs/README.md @@ -0,0 +1,36 @@ +This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +# or +pnpm dev +# or +bun dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. + +This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/integration-tests/typescript-nextjs/next.config.mjs b/integration-tests/typescript-nextjs/next.config.mjs new file mode 100644 index 000000000..4678774e6 --- /dev/null +++ b/integration-tests/typescript-nextjs/next.config.mjs @@ -0,0 +1,4 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = {}; + +export default nextConfig; diff --git a/integration-tests/typescript-nextjs/package.json b/integration-tests/typescript-nextjs/package.json new file mode 100644 index 000000000..fb70e3326 --- /dev/null +++ b/integration-tests/typescript-nextjs/package.json @@ -0,0 +1,22 @@ +{ + "name": "typescript-nextjs", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "next": "14.1.4", + "react": "^18", + "react-dom": "^18" + }, + "devDependencies": { + "@types/node": "^20", + "@types/react": "^18", + "@types/react-dom": "^18", + "typescript": "^5" + } +} diff --git a/integration-tests/typescript-nextjs/public/next.svg b/integration-tests/typescript-nextjs/public/next.svg new file mode 100644 index 000000000..5174b28c5 --- /dev/null +++ b/integration-tests/typescript-nextjs/public/next.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/integration-tests/typescript-nextjs/public/vercel.svg b/integration-tests/typescript-nextjs/public/vercel.svg new file mode 100644 index 000000000..d2f842227 --- /dev/null +++ b/integration-tests/typescript-nextjs/public/vercel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/integration-tests/typescript-nextjs/src/app/favicon.ico b/integration-tests/typescript-nextjs/src/app/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..718d6fea4835ec2d246af9800eddb7ffb276240c GIT binary patch literal 25931 zcmeHv30#a{`}aL_*G&7qml|y<+KVaDM2m#dVr!KsA!#An?kSQM(q<_dDNCpjEux83 zLb9Z^XxbDl(w>%i@8hT6>)&Gu{h#Oeyszu?xtw#Zb1mO{pgX9699l+Qppw7jXaYf~-84xW z)w4x8?=youko|}Vr~(D$UXIbiXABHh`p1?nn8Po~fxRJv}|0e(BPs|G`(TT%kKVJAdg5*Z|x0leQq0 zkdUBvb#>9F()jo|T~kx@OM8$9wzs~t2l;K=woNssA3l6|sx2r3+kdfVW@e^8e*E}v zA1y5{bRi+3Z`uD3{F7LgFJDdvm;nJilkzDku>BwXH(8ItVCXk*-lSJnR?-2UN%hJ){&rlvg`CDTj z)Bzo!3v7Ou#83zEDEFcKt(f1E0~=rqeEbTnMvWR#{+9pg%7G8y>u1OVRUSoox-ovF z2Ydma(;=YuBY(eI|04{hXzZD6_f(v~H;C~y5=DhAC{MMS>2fm~1H_t2$56pc$NH8( z5bH|<)71dV-_oCHIrzrT`2s-5w_+2CM0$95I6X8p^r!gHp+j_gd;9O<1~CEQQGS8) zS9Qh3#p&JM-G8rHekNmKVewU;pJRcTAog68KYo^dRo}(M>36U4Us zfgYWSiHZL3;lpWT=zNAW>Dh#mB!_@Lg%$ms8N-;aPqMn+C2HqZgz&9~Eu z4|Kp<`$q)Uw1R?y(~S>ePdonHxpV1#eSP1B;Ogo+-Pk}6#0GsZZ5!||ev2MGdh}_m z{DeR7?0-1^zVs&`AV6Vt;r3`I`OI_wgs*w=eO%_#7Kepl{B@xiyCANc(l zzIyd4y|c6PXWq9-|KM8(zIk8LPk(>a)zyFWjhT!$HJ$qX1vo@d25W<fvZQ2zUz5WRc(UnFMKHwe1| zWmlB1qdbiA(C0jmnV<}GfbKtmcu^2*P^O?MBLZKt|As~ge8&AAO~2K@zbXelK|4T<{|y4`raF{=72kC2Kn(L4YyenWgrPiv z@^mr$t{#X5VuIMeL!7Ab6_kG$&#&5p*Z{+?5U|TZ`B!7llpVmp@skYz&n^8QfPJzL z0G6K_OJM9x+Wu2gfN45phANGt{7=C>i34CV{Xqlx(fWpeAoj^N0Biu`w+MVcCUyU* zDZuzO0>4Z6fbu^T_arWW5n!E45vX8N=bxTVeFoep_G#VmNlQzAI_KTIc{6>c+04vr zx@W}zE5JNSU>!THJ{J=cqjz+4{L4A{Ob9$ZJ*S1?Ggg3klFp!+Y1@K+pK1DqI|_gq z5ZDXVpge8-cs!o|;K73#YXZ3AShj50wBvuq3NTOZ`M&qtjj#GOFfgExjg8Gn8>Vq5 z`85n+9|!iLCZF5$HJ$Iu($dm?8~-ofu}tEc+-pyke=3!im#6pk_Wo8IA|fJwD&~~F zc16osQ)EBo58U7XDuMexaPRjU@h8tXe%S{fA0NH3vGJFhuyyO!Uyl2^&EOpX{9As0 zWj+P>{@}jxH)8|r;2HdupP!vie{sJ28b&bo!8`D^x}TE$%zXNb^X1p@0PJ86`dZyj z%ce7*{^oo+6%&~I!8hQy-vQ7E)0t0ybH4l%KltWOo~8cO`T=157JqL(oq_rC%ea&4 z2NcTJe-HgFjNg-gZ$6!Y`SMHrlj}Etf7?r!zQTPPSv}{so2e>Fjs1{gzk~LGeesX%r(Lh6rbhSo_n)@@G-FTQy93;l#E)hgP@d_SGvyCp0~o(Y;Ee8{ zdVUDbHm5`2taPUOY^MAGOw*>=s7=Gst=D+p+2yON!0%Hk` zz5mAhyT4lS*T3LS^WSxUy86q&GnoHxzQ6vm8)VS}_zuqG?+3td68_x;etQAdu@sc6 zQJ&5|4(I?~3d-QOAODHpZ=hlSg(lBZ!JZWCtHHSj`0Wh93-Uk)_S%zsJ~aD>{`A0~ z9{AG(e|q3g5B%wYKRxiL2Y$8(4w6bzchKuloQW#e&S3n+P- z8!ds-%f;TJ1>)v)##>gd{PdS2Oc3VaR`fr=`O8QIO(6(N!A?pr5C#6fc~Ge@N%Vvu zaoAX2&(a6eWy_q&UwOhU)|P3J0Qc%OdhzW=F4D|pt0E4osw;%<%Dn58hAWD^XnZD= z>9~H(3bmLtxpF?a7su6J7M*x1By7YSUbxGi)Ot0P77`}P3{)&5Un{KD?`-e?r21!4vTTnN(4Y6Lin?UkSM z`MXCTC1@4A4~mvz%Rh2&EwY))LeoT=*`tMoqcEXI>TZU9WTP#l?uFv+@Dn~b(>xh2 z;>B?;Tz2SR&KVb>vGiBSB`@U7VIWFSo=LDSb9F{GF^DbmWAfpms8Sx9OX4CnBJca3 zlj9(x!dIjN?OG1X4l*imJNvRCk}F%!?SOfiOq5y^mZW)jFL@a|r-@d#f7 z2gmU8L3IZq0ynIws=}~m^#@&C%J6QFo~Mo4V`>v7MI-_!EBMMtb%_M&kvAaN)@ZVw z+`toz&WG#HkWDjnZE!6nk{e-oFdL^$YnbOCN}JC&{$#$O27@|Tn-skXr)2ml2~O!5 zX+gYoxhoc7qoU?C^3~&!U?kRFtnSEecWuH0B0OvLodgUAi}8p1 zrO6RSXHH}DMc$&|?D004DiOVMHV8kXCP@7NKB zgaZq^^O<7PoKEp72kby@W0Z!Y*Ay{&vfg#C&gG@YVR9g?FEocMUi1gSN$+V+ayF45{a zuDZDTN}mS|;BO%gEf}pjBfN2-gIrU#G5~cucA;dokXW89%>AyXJJI z9X4UlIWA|ZYHgbI z5?oFk@A=Ik7lrEQPDH!H+b`7_Y~aDb_qa=B2^Y&Ow41cU=4WDd40dp5(QS-WMN-=Y z9g;6_-JdNU;|6cPwf$ak*aJIcwL@1n$#l~zi{c{EW?T;DaW*E8DYq?Umtz{nJ&w-M zEMyTDrC&9K$d|kZe2#ws6)L=7K+{ zQw{XnV6UC$6-rW0emqm8wJoeZK)wJIcV?dST}Z;G0Arq{dVDu0&4kd%N!3F1*;*pW zR&qUiFzK=@44#QGw7k1`3t_d8&*kBV->O##t|tonFc2YWrL7_eqg+=+k;!F-`^b8> z#KWCE8%u4k@EprxqiV$VmmtiWxDLgnGu$Vs<8rppV5EajBXL4nyyZM$SWVm!wnCj-B!Wjqj5-5dNXukI2$$|Bu3Lrw}z65Lc=1G z^-#WuQOj$hwNGG?*CM_TO8Bg-1+qc>J7k5c51U8g?ZU5n?HYor;~JIjoWH-G>AoUP ztrWWLbRNqIjW#RT*WqZgPJXU7C)VaW5}MiijYbABmzoru6EmQ*N8cVK7a3|aOB#O& zBl8JY2WKfmj;h#Q!pN%9o@VNLv{OUL?rixHwOZuvX7{IJ{(EdPpuVFoQqIOa7giLVkBOKL@^smUA!tZ1CKRK}#SSM)iQHk)*R~?M!qkCruaS!#oIL1c z?J;U~&FfH#*98^G?i}pA{ z9Jg36t4=%6mhY(quYq*vSxptes9qy|7xSlH?G=S@>u>Ebe;|LVhs~@+06N<4CViBk zUiY$thvX;>Tby6z9Y1edAMQaiH zm^r3v#$Q#2T=X>bsY#D%s!bhs^M9PMAcHbCc0FMHV{u-dwlL;a1eJ63v5U*?Q_8JO zT#50!RD619#j_Uf))0ooADz~*9&lN!bBDRUgE>Vud-i5ck%vT=r^yD*^?Mp@Q^v+V zG#-?gKlr}Eeqifb{|So?HM&g91P8|av8hQoCmQXkd?7wIJwb z_^v8bbg`SAn{I*4bH$u(RZ6*xUhuA~hc=8czK8SHEKTzSxgbwi~9(OqJB&gwb^l4+m`k*Q;_?>Y-APi1{k zAHQ)P)G)f|AyjSgcCFps)Fh6Bca*Xznq36!pV6Az&m{O8$wGFD? zY&O*3*J0;_EqM#jh6^gMQKpXV?#1?>$ml1xvh8nSN>-?H=V;nJIwB07YX$e6vLxH( zqYwQ>qxwR(i4f)DLd)-$P>T-no_c!LsN@)8`e;W@)-Hj0>nJ-}Kla4-ZdPJzI&Mce zv)V_j;(3ERN3_@I$N<^|4Lf`B;8n+bX@bHbcZTopEmDI*Jfl)-pFDvo6svPRoo@(x z);_{lY<;);XzT`dBFpRmGrr}z5u1=pC^S-{ce6iXQlLGcItwJ^mZx{m$&DA_oEZ)B{_bYPq-HA zcH8WGoBG(aBU_j)vEy+_71T34@4dmSg!|M8Vf92Zj6WH7Q7t#OHQqWgFE3ARt+%!T z?oLovLVlnf?2c7pTc)~cc^($_8nyKwsN`RA-23ed3sdj(ys%pjjM+9JrctL;dy8a( z@en&CQmnV(()bu|Y%G1-4a(6x{aLytn$T-;(&{QIJB9vMox11U-1HpD@d(QkaJdEb zG{)+6Dos_L+O3NpWo^=gR?evp|CqEG?L&Ut#D*KLaRFOgOEK(Kq1@!EGcTfo+%A&I z=dLbB+d$u{sh?u)xP{PF8L%;YPPW53+@{>5W=Jt#wQpN;0_HYdw1{ksf_XhO4#2F= zyPx6Lx2<92L-;L5PD`zn6zwIH`Jk($?Qw({erA$^bC;q33hv!d!>%wRhj# zal^hk+WGNg;rJtb-EB(?czvOM=H7dl=vblBwAv>}%1@{}mnpUznfq1cE^sgsL0*4I zJ##!*B?=vI_OEVis5o+_IwMIRrpQyT_Sq~ZU%oY7c5JMIADzpD!Upz9h@iWg_>>~j zOLS;wp^i$-E?4<_cp?RiS%Rd?i;f*mOz=~(&3lo<=@(nR!_Rqiprh@weZlL!t#NCc zO!QTcInq|%#>OVgobj{~ixEUec`E25zJ~*DofsQdzIa@5^nOXj2T;8O`l--(QyU^$t?TGY^7#&FQ+2SS3B#qK*k3`ye?8jUYSajE5iBbJls75CCc(m3dk{t?- zopcER9{Z?TC)mk~gpi^kbbu>b-+a{m#8-y2^p$ka4n60w;Sc2}HMf<8JUvhCL0B&Btk)T`ctE$*qNW8L$`7!r^9T+>=<=2qaq-;ll2{`{Rg zc5a0ZUI$oG&j-qVOuKa=*v4aY#IsoM+1|c4Z)<}lEDvy;5huB@1RJPquU2U*U-;gu z=En2m+qjBzR#DEJDO`WU)hdd{Vj%^0V*KoyZ|5lzV87&g_j~NCjwv0uQVqXOb*QrQ zy|Qn`hxx(58c70$E;L(X0uZZ72M1!6oeg)(cdKO ze0gDaTz+ohR-#d)NbAH4x{I(21yjwvBQfmpLu$)|m{XolbgF!pmsqJ#D}(ylp6uC> z{bqtcI#hT#HW=wl7>p!38sKsJ`r8}lt-q%Keqy%u(xk=yiIJiUw6|5IvkS+#?JTBl z8H5(Q?l#wzazujH!8o>1xtn8#_w+397*_cy8!pQGP%K(Ga3pAjsaTbbXJlQF_+m+-UpUUent@xM zg%jqLUExj~o^vQ3Gl*>wh=_gOr2*|U64_iXb+-111aH}$TjeajM+I20xw(((>fej-@CIz4S1pi$(#}P7`4({6QS2CaQS4NPENDp>sAqD z$bH4KGzXGffkJ7R>V>)>tC)uax{UsN*dbeNC*v}#8Y#OWYwL4t$ePR?VTyIs!wea+ z5Urmc)X|^`MG~*dS6pGSbU+gPJoq*^a=_>$n4|P^w$sMBBy@f*Z^Jg6?n5?oId6f{ z$LW4M|4m502z0t7g<#Bx%X;9<=)smFolV&(V^(7Cv2-sxbxopQ!)*#ZRhTBpx1)Fc zNm1T%bONzv6@#|dz(w02AH8OXe>kQ#1FMCzO}2J_mST)+ExmBr9cva-@?;wnmWMOk z{3_~EX_xadgJGv&H@zK_8{(x84`}+c?oSBX*Ge3VdfTt&F}yCpFP?CpW+BE^cWY0^ zb&uBN!Ja3UzYHK-CTyA5=L zEMW{l3Usky#ly=7px648W31UNV@K)&Ub&zP1c7%)`{);I4b0Q<)B}3;NMG2JH=X$U zfIW4)4n9ZM`-yRj67I)YSLDK)qfUJ_ij}a#aZN~9EXrh8eZY2&=uY%2N0UFF7<~%M zsB8=erOWZ>Ct_#^tHZ|*q`H;A)5;ycw*IcmVxi8_0Xk}aJA^ath+E;xg!x+As(M#0=)3!NJR6H&9+zd#iP(m0PIW8$ z1Y^VX`>jm`W!=WpF*{ioM?C9`yOR>@0q=u7o>BP-eSHqCgMDj!2anwH?s%i2p+Q7D zzszIf5XJpE)IG4;d_(La-xenmF(tgAxK`Y4sQ}BSJEPs6N_U2vI{8=0C_F?@7<(G; zo$~G=8p+076G;`}>{MQ>t>7cm=zGtfbdDXm6||jUU|?X?CaE?(<6bKDYKeHlz}DA8 zXT={X=yp_R;HfJ9h%?eWvQ!dRgz&Su*JfNt!Wu>|XfU&68iRikRrHRW|ZxzRR^`eIGt zIeiDgVS>IeExKVRWW8-=A=yA`}`)ZkWBrZD`hpWIxBGkh&f#ijr449~m`j6{4jiJ*C!oVA8ZC?$1RM#K(_b zL9TW)kN*Y4%^-qPpMP7d4)o?Nk#>aoYHT(*g)qmRUb?**F@pnNiy6Fv9rEiUqD(^O zzyS?nBrX63BTRYduaG(0VVG2yJRe%o&rVrLjbxTaAFTd8s;<<@Qs>u(<193R8>}2_ zuwp{7;H2a*X7_jryzriZXMg?bTuegABb^87@SsKkr2)0Gyiax8KQWstw^v#ix45EVrcEhr>!NMhprl$InQMzjSFH54x5k9qHc`@9uKQzvL4ihcq{^B zPrVR=o_ic%Y>6&rMN)hTZsI7I<3&`#(nl+3y3ys9A~&^=4?PL&nd8)`OfG#n zwAMN$1&>K++c{^|7<4P=2y(B{jJsQ0a#U;HTo4ZmWZYvI{+s;Td{Yzem%0*k#)vjpB zia;J&>}ICate44SFYY3vEelqStQWFihx%^vQ@Do(sOy7yR2@WNv7Y9I^yL=nZr3mb zXKV5t@=?-Sk|b{XMhA7ZGB@2hqsx}4xwCW!in#C zI@}scZlr3-NFJ@NFaJlhyfcw{k^vvtGl`N9xSo**rDW4S}i zM9{fMPWo%4wYDG~BZ18BD+}h|GQKc-g^{++3MY>}W_uq7jGHx{mwE9fZiPCoxN$+7 zrODGGJrOkcPQUB(FD5aoS4g~7#6NR^ma7-!>mHuJfY5kTe6PpNNKC9GGRiu^L31uG z$7v`*JknQHsYB!Tm_W{a32TM099djW%5e+j0Ve_ct}IM>XLF1Ap+YvcrLV=|CKo6S zb+9Nl3_YdKP6%Cxy@6TxZ>;4&nTneadr z_ES90ydCev)LV!dN=#(*f}|ZORFdvkYBni^aLbUk>BajeWIOcmHP#8S)*2U~QKI%S zyrLmtPqb&TphJ;>yAxri#;{uyk`JJqODDw%(Z=2`1uc}br^V%>j!gS)D*q*f_-qf8&D;W1dJgQMlaH5er zN2U<%Smb7==vE}dDI8K7cKz!vs^73o9f>2sgiTzWcwY|BMYHH5%Vn7#kiw&eItCqa zIkR2~Q}>X=Ar8W|^Ms41Fm8o6IB2_j60eOeBB1Br!boW7JnoeX6Gs)?7rW0^5psc- zjS16yb>dFn>KPOF;imD}e!enuIniFzv}n$m2#gCCv4jM#ArwlzZ$7@9&XkFxZ4n!V zj3dyiwW4Ki2QG{@i>yuZXQizw_OkZI^-3otXC{!(lUpJF33gI60ak;Uqitp74|B6I zgg{b=Iz}WkhCGj1M=hu4#Aw173YxIVbISaoc z-nLZC*6Tgivd5V`K%GxhBsp@SUU60-rfc$=wb>zdJzXS&-5(NRRodFk;Kxk!S(O(a0e7oY=E( zAyS;Ow?6Q&XA+cnkCb{28_1N8H#?J!*$MmIwLq^*T_9-z^&UE@A(z9oGYtFy6EZef LrJugUA?W`A8`#=m literal 0 HcmV?d00001 diff --git a/integration-tests/typescript-nextjs/src/app/globals.css b/integration-tests/typescript-nextjs/src/app/globals.css new file mode 100644 index 000000000..f4bd77c0c --- /dev/null +++ b/integration-tests/typescript-nextjs/src/app/globals.css @@ -0,0 +1,107 @@ +:root { + --max-width: 1100px; + --border-radius: 12px; + --font-mono: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", + "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", + "Fira Mono", "Droid Sans Mono", "Courier New", monospace; + + --foreground-rgb: 0, 0, 0; + --background-start-rgb: 214, 219, 220; + --background-end-rgb: 255, 255, 255; + + --primary-glow: conic-gradient( + from 180deg at 50% 50%, + #16abff33 0deg, + #0885ff33 55deg, + #54d6ff33 120deg, + #0071ff33 160deg, + transparent 360deg + ); + --secondary-glow: radial-gradient( + rgba(255, 255, 255, 1), + rgba(255, 255, 255, 0) + ); + + --tile-start-rgb: 239, 245, 249; + --tile-end-rgb: 228, 232, 233; + --tile-border: conic-gradient( + #00000080, + #00000040, + #00000030, + #00000020, + #00000010, + #00000010, + #00000080 + ); + + --callout-rgb: 238, 240, 241; + --callout-border-rgb: 172, 175, 176; + --card-rgb: 180, 185, 188; + --card-border-rgb: 131, 134, 135; +} + +@media (prefers-color-scheme: dark) { + :root { + --foreground-rgb: 255, 255, 255; + --background-start-rgb: 0, 0, 0; + --background-end-rgb: 0, 0, 0; + + --primary-glow: radial-gradient(rgba(1, 65, 255, 0.4), rgba(1, 65, 255, 0)); + --secondary-glow: linear-gradient( + to bottom right, + rgba(1, 65, 255, 0), + rgba(1, 65, 255, 0), + rgba(1, 65, 255, 0.3) + ); + + --tile-start-rgb: 2, 13, 46; + --tile-end-rgb: 2, 5, 19; + --tile-border: conic-gradient( + #ffffff80, + #ffffff40, + #ffffff30, + #ffffff20, + #ffffff10, + #ffffff10, + #ffffff80 + ); + + --callout-rgb: 20, 20, 20; + --callout-border-rgb: 108, 108, 108; + --card-rgb: 100, 100, 100; + --card-border-rgb: 200, 200, 200; + } +} + +* { + box-sizing: border-box; + padding: 0; + margin: 0; +} + +html, +body { + max-width: 100vw; + overflow-x: hidden; +} + +body { + color: rgb(var(--foreground-rgb)); + background: linear-gradient( + to bottom, + transparent, + rgb(var(--background-end-rgb)) + ) + rgb(var(--background-start-rgb)); +} + +a { + color: inherit; + text-decoration: none; +} + +@media (prefers-color-scheme: dark) { + html { + color-scheme: dark; + } +} diff --git a/integration-tests/typescript-nextjs/src/app/layout.tsx b/integration-tests/typescript-nextjs/src/app/layout.tsx new file mode 100644 index 000000000..3314e4780 --- /dev/null +++ b/integration-tests/typescript-nextjs/src/app/layout.tsx @@ -0,0 +1,22 @@ +import type { Metadata } from "next"; +import { Inter } from "next/font/google"; +import "./globals.css"; + +const inter = Inter({ subsets: ["latin"] }); + +export const metadata: Metadata = { + title: "Create Next App", + description: "Generated by create next app", +}; + +export default function RootLayout({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { + return ( + + {children} + + ); +} diff --git a/integration-tests/typescript-nextjs/src/app/page.module.css b/integration-tests/typescript-nextjs/src/app/page.module.css new file mode 100644 index 000000000..5c4b1e6a2 --- /dev/null +++ b/integration-tests/typescript-nextjs/src/app/page.module.css @@ -0,0 +1,230 @@ +.main { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; + padding: 6rem; + min-height: 100vh; +} + +.description { + display: inherit; + justify-content: inherit; + align-items: inherit; + font-size: 0.85rem; + max-width: var(--max-width); + width: 100%; + z-index: 2; + font-family: var(--font-mono); +} + +.description a { + display: flex; + justify-content: center; + align-items: center; + gap: 0.5rem; +} + +.description p { + position: relative; + margin: 0; + padding: 1rem; + background-color: rgba(var(--callout-rgb), 0.5); + border: 1px solid rgba(var(--callout-border-rgb), 0.3); + border-radius: var(--border-radius); +} + +.code { + font-weight: 700; + font-family: var(--font-mono); +} + +.grid { + display: grid; + grid-template-columns: repeat(4, minmax(25%, auto)); + max-width: 100%; + width: var(--max-width); +} + +.card { + padding: 1rem 1.2rem; + border-radius: var(--border-radius); + background: rgba(var(--card-rgb), 0); + border: 1px solid rgba(var(--card-border-rgb), 0); + transition: background 200ms, border 200ms; +} + +.card span { + display: inline-block; + transition: transform 200ms; +} + +.card h2 { + font-weight: 600; + margin-bottom: 0.7rem; +} + +.card p { + margin: 0; + opacity: 0.6; + font-size: 0.9rem; + line-height: 1.5; + max-width: 30ch; + text-wrap: balance; +} + +.center { + display: flex; + justify-content: center; + align-items: center; + position: relative; + padding: 4rem 0; +} + +.center::before { + background: var(--secondary-glow); + border-radius: 50%; + width: 480px; + height: 360px; + margin-left: -400px; +} + +.center::after { + background: var(--primary-glow); + width: 240px; + height: 180px; + z-index: -1; +} + +.center::before, +.center::after { + content: ""; + left: 50%; + position: absolute; + filter: blur(45px); + transform: translateZ(0); +} + +.logo { + position: relative; +} +/* Enable hover only on non-touch devices */ +@media (hover: hover) and (pointer: fine) { + .card:hover { + background: rgba(var(--card-rgb), 0.1); + border: 1px solid rgba(var(--card-border-rgb), 0.15); + } + + .card:hover span { + transform: translateX(4px); + } +} + +@media (prefers-reduced-motion) { + .card:hover span { + transform: none; + } +} + +/* Mobile */ +@media (max-width: 700px) { + .content { + padding: 4rem; + } + + .grid { + grid-template-columns: 1fr; + margin-bottom: 120px; + max-width: 320px; + text-align: center; + } + + .card { + padding: 1rem 2.5rem; + } + + .card h2 { + margin-bottom: 0.5rem; + } + + .center { + padding: 8rem 0 6rem; + } + + .center::before { + transform: none; + height: 300px; + } + + .description { + font-size: 0.8rem; + } + + .description a { + padding: 1rem; + } + + .description p, + .description div { + display: flex; + justify-content: center; + position: fixed; + width: 100%; + } + + .description p { + align-items: center; + inset: 0 0 auto; + padding: 2rem 1rem 1.4rem; + border-radius: 0; + border: none; + border-bottom: 1px solid rgba(var(--callout-border-rgb), 0.25); + background: linear-gradient( + to bottom, + rgba(var(--background-start-rgb), 1), + rgba(var(--callout-rgb), 0.5) + ); + background-clip: padding-box; + backdrop-filter: blur(24px); + } + + .description div { + align-items: flex-end; + pointer-events: none; + inset: auto 0 0; + padding: 2rem; + height: 200px; + background: linear-gradient( + to bottom, + transparent 0%, + rgb(var(--background-end-rgb)) 40% + ); + z-index: 1; + } +} + +/* Tablet and Smaller Desktop */ +@media (min-width: 701px) and (max-width: 1120px) { + .grid { + grid-template-columns: repeat(2, 50%); + } +} + +@media (prefers-color-scheme: dark) { + .vercelLogo { + filter: invert(1); + } + + .logo { + filter: invert(1) drop-shadow(0 0 0.3rem #ffffff70); + } +} + +@keyframes rotate { + from { + transform: rotate(360deg); + } + to { + transform: rotate(0deg); + } +} diff --git a/integration-tests/typescript-nextjs/src/app/page.tsx b/integration-tests/typescript-nextjs/src/app/page.tsx new file mode 100644 index 000000000..d2c63a496 --- /dev/null +++ b/integration-tests/typescript-nextjs/src/app/page.tsx @@ -0,0 +1,95 @@ +import Image from "next/image"; +import styles from "./page.module.css"; + +export default function Home() { + return ( +
+
+

+ Get started by editing  + src/app/page.tsx +

+ +
+ +
+ Next.js Logo +
+ + +
+ ); +} diff --git a/integration-tests/typescript-nextjs/tsconfig.json b/integration-tests/typescript-nextjs/tsconfig.json new file mode 100644 index 000000000..7b2858930 --- /dev/null +++ b/integration-tests/typescript-nextjs/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "plugins": [ + { + "name": "next" + } + ], + "paths": { + "@/*": ["./src/*"] + } + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "exclude": ["node_modules"] +} From 2fafb20df7a49698baec708c5d02c5ef06a6201e Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Mon, 8 Apr 2024 08:55:07 +0100 Subject: [PATCH 02/22] chore: add scripts --- integration-tests/typescript-nextjs/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/integration-tests/typescript-nextjs/package.json b/integration-tests/typescript-nextjs/package.json index fb70e3326..cd3406a6b 100644 --- a/integration-tests/typescript-nextjs/package.json +++ b/integration-tests/typescript-nextjs/package.json @@ -6,7 +6,9 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "clean": "rm -rf ./.next && rm -rf ./src/api", + "validate": "tsc -p ./tsconfig.json" }, "dependencies": { "next": "14.1.4", From a94512575bbe79b70a3712b9bd49fb47502ce305 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Mon, 8 Apr 2024 08:55:42 +0100 Subject: [PATCH 03/22] feat: add typescript-nextjs --- .../typescript-nextjs/next.config.mjs | 4 +- .../typescript-nextjs/package.json | 16 +- .../typescript-nextjs/src/app/globals.css | 3 +- .../typescript-nextjs/src/app/layout.tsx | 14 +- .../typescript-nextjs/src/app/page.tsx | 6 +- .../app/todo-lists.yaml/attachments/route.ts | 13 + .../list/[listId]/items/route.ts | 13 + .../todo-lists.yaml/list/[listId]/route.ts | 18 + .../src/app/todo-lists.yaml/list/route.ts | 6 + .../todo-lists.yaml/attachments/route.ts | 111 ++++ .../todo-lists.yaml/clients/client.ts | 317 +++++++++ .../list/[listId]/items/route.ts | 157 +++++ .../todo-lists.yaml/list/[listId]/route.ts | 211 ++++++ .../generated/todo-lists.yaml/list/route.ts | 82 +++ .../src/generated/todo-lists.yaml/models.ts | 67 ++ .../src/generated/todo-lists.yaml/schemas.ts | 25 + .../src/lib/playground/load-runtime-types.tsx | 26 +- packages/openapi-code-generator/package.json | 1 + packages/openapi-code-generator/src/config.ts | 1 + .../openapi-code-generator/src/core/input.ts | 14 +- .../src/core/loaders/tsconfig.loader.ts | 2 +- .../src/core/openapi-loader.ts | 2 +- .../src/core/schemas/tsconfig.schema.ts | 1 + .../openapi-code-generator/src/core/utils.ts | 4 + .../openapi-code-generator/src/templates.ts | 7 + .../typescript/common/compilation-units.ts | 3 +- .../src/typescript/common/import-builder.ts | 7 + .../typescript/common/typescript-emitter.ts | 2 +- .../typescript-nextjs.generator.ts | 613 ++++++++++++++++++ scripts/generate.mjs | 34 +- 30 files changed, 1743 insertions(+), 37 deletions(-) create mode 100644 integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts create mode 100644 integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/items/route.ts create mode 100644 integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/route.ts create mode 100644 integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/route.ts create mode 100644 integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts create mode 100644 integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/clients/client.ts create mode 100644 integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts create mode 100644 integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts create mode 100644 integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts create mode 100644 integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/models.ts create mode 100644 integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/schemas.ts create mode 100644 packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts diff --git a/integration-tests/typescript-nextjs/next.config.mjs b/integration-tests/typescript-nextjs/next.config.mjs index 4678774e6..1d6147825 100644 --- a/integration-tests/typescript-nextjs/next.config.mjs +++ b/integration-tests/typescript-nextjs/next.config.mjs @@ -1,4 +1,4 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {}; +const nextConfig = {} -export default nextConfig; +export default nextConfig diff --git a/integration-tests/typescript-nextjs/package.json b/integration-tests/typescript-nextjs/package.json index cd3406a6b..4afa64d1a 100644 --- a/integration-tests/typescript-nextjs/package.json +++ b/integration-tests/typescript-nextjs/package.json @@ -7,18 +7,18 @@ "build": "next build", "start": "next start", "lint": "next lint", - "clean": "rm -rf ./.next && rm -rf ./src/api", + "clean": "rm -rf ./.next && rm -rf ./src/generated && rm -rf -- ./src/app/*/", "validate": "tsc -p ./tsconfig.json" }, "dependencies": { - "next": "14.1.4", - "react": "^18", - "react-dom": "^18" + "next": "^15.3.1", + "react": "^19.1.0", + "react-dom": "^19.1.0" }, "devDependencies": { - "@types/node": "^20", - "@types/react": "^18", - "@types/react-dom": "^18", - "typescript": "^5" + "@types/node": "^22.15.3", + "@types/react": "^19.1.2", + "@types/react-dom": "^19.1.3", + "typescript": "^5.8.3" } } diff --git a/integration-tests/typescript-nextjs/src/app/globals.css b/integration-tests/typescript-nextjs/src/app/globals.css index f4bd77c0c..acf750815 100644 --- a/integration-tests/typescript-nextjs/src/app/globals.css +++ b/integration-tests/typescript-nextjs/src/app/globals.css @@ -1,7 +1,8 @@ :root { --max-width: 1100px; --border-radius: 12px; - --font-mono: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", + --font-mono: + ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace; diff --git a/integration-tests/typescript-nextjs/src/app/layout.tsx b/integration-tests/typescript-nextjs/src/app/layout.tsx index 3314e4780..24de49cbb 100644 --- a/integration-tests/typescript-nextjs/src/app/layout.tsx +++ b/integration-tests/typescript-nextjs/src/app/layout.tsx @@ -1,22 +1,22 @@ -import type { Metadata } from "next"; -import { Inter } from "next/font/google"; -import "./globals.css"; +import type {Metadata} from "next" +import {Inter} from "next/font/google" +import "./globals.css" -const inter = Inter({ subsets: ["latin"] }); +const inter = Inter({subsets: ["latin"]}) export const metadata: Metadata = { title: "Create Next App", description: "Generated by create next app", -}; +} export default function RootLayout({ children, }: Readonly<{ - children: React.ReactNode; + children: React.ReactNode }>) { return ( {children} - ); + ) } diff --git a/integration-tests/typescript-nextjs/src/app/page.tsx b/integration-tests/typescript-nextjs/src/app/page.tsx index d2c63a496..c6b15f1be 100644 --- a/integration-tests/typescript-nextjs/src/app/page.tsx +++ b/integration-tests/typescript-nextjs/src/app/page.tsx @@ -1,5 +1,5 @@ -import Image from "next/image"; -import styles from "./page.module.css"; +import Image from "next/image" +import styles from "./page.module.css" export default function Home() { return ( @@ -91,5 +91,5 @@ export default function Home() { - ); + ) } diff --git a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts new file mode 100644 index 000000000..e5fef071d --- /dev/null +++ b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts @@ -0,0 +1,13 @@ +import { + _GET, + _POST, +} from "../../../generated/todo-lists.yaml/attachments/route" + +export const GET = _GET(async ({}, respond, context) => { + // TODO: implementation + return respond.withStatus(501).body({ message: "not implemented" } as any) +}) +export const POST = _POST(async ({ body }, respond, context) => { + // TODO: implementation + return respond.withStatus(501).body({ message: "not implemented" } as any) +}) diff --git a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/items/route.ts b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/items/route.ts new file mode 100644 index 000000000..106807e70 --- /dev/null +++ b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/items/route.ts @@ -0,0 +1,13 @@ +import { + _GET, + _POST, +} from "../../../../../generated/todo-lists.yaml/list/[listId]/items/route" + +export const GET = _GET(async ({ params }, respond, context) => { + // TODO: implementation + return respond.withStatus(501).body({ message: "not implemented" } as any) +}) +export const POST = _POST(async ({ params, body }, respond, context) => { + // TODO: implementation + return respond.withStatus(501).body({ message: "not implemented" } as any) +}) diff --git a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/route.ts b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/route.ts new file mode 100644 index 000000000..17ad5c9d4 --- /dev/null +++ b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/route.ts @@ -0,0 +1,18 @@ +import { + _GET, + _PUT, + _DELETE, +} from "../../../../generated/todo-lists.yaml/list/[listId]/route" + +export const GET = _GET(async ({ params }, respond, context) => { + // TODO: implementation + return respond.withStatus(501).body({ message: "not implemented" } as any) +}) +export const PUT = _PUT(async ({ params, body }, respond, context) => { + // TODO: implementation + return respond.withStatus(501).body({ message: "not implemented" } as any) +}) +export const DELETE = _DELETE(async ({ params }, respond, context) => { + // TODO: implementation + return respond.withStatus(501).body({ message: "not implemented" } as any) +}) diff --git a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/route.ts b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/route.ts new file mode 100644 index 000000000..16410e64c --- /dev/null +++ b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/route.ts @@ -0,0 +1,6 @@ +import { _GET } from "../../../generated/todo-lists.yaml/list/route" + +export const GET = _GET(async ({ query }, respond, context) => { + // TODO: implementation + return respond.withStatus(501).body({ message: "not implemented" } as any) +}) diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts new file mode 100644 index 000000000..bdec23a52 --- /dev/null +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts @@ -0,0 +1,111 @@ +/** AUTOGENERATED - DO NOT EDIT **/ +/* tslint:disable */ +/* eslint-disable */ + +import { t_UnknownObject, t_UploadAttachmentBodySchema } from "../models" +import { + KoaRuntimeError, + RequestInputType, +} from "@nahkies/typescript-koa-runtime/errors" +import { + KoaRuntimeResponder, + KoaRuntimeResponse, + StatusCode, +} from "@nahkies/typescript-koa-runtime/server" +import { Params, parseRequestInput } from "@nahkies/typescript-koa-runtime/zod" +import { NextRequest } from "next/server" +import { z } from "zod" + +export type ListAttachmentsResponder = { + with200(): KoaRuntimeResponse +} & KoaRuntimeResponder + +export type ListAttachments = ( + params: Params, + respond: ListAttachmentsResponder, + ctx: { request: NextRequest }, +) => Promise> + +export type UploadAttachmentResponder = { + with202(): KoaRuntimeResponse +} & KoaRuntimeResponder + +export type UploadAttachment = ( + params: Params, + respond: UploadAttachmentResponder, + ctx: { request: NextRequest }, +) => Promise> + +export const _GET = + (implementation: ListAttachments) => + async ( + request: NextRequest, + { params }: { params: unknown }, + ): Promise => { + const input = { + params: undefined, + // TODO: this swallows repeated parameters + query: undefined, + body: undefined, + headers: undefined, + } + + const responder = { + with200() { + return new KoaRuntimeResponse(200) + }, + withStatus(status: StatusCode) { + return new KoaRuntimeResponse(status) + }, + } + + const { status, body } = await implementation(input, responder, { request }) + .then((it) => it.unpack()) + .catch((err) => { + throw KoaRuntimeError.HandlerError(err) + }) + + return body !== undefined + ? Response.json(body, { status }) + : new Response(undefined, { status }) + } + +const uploadAttachmentBodySchema = z.object({ file: z.unknown().optional() }) + +export const _POST = + (implementation: UploadAttachment) => + async ( + request: NextRequest, + { params }: { params: unknown }, + ): Promise => { + const input = { + params: undefined, + // TODO: this swallows repeated parameters + query: undefined, + body: parseRequestInput( + uploadAttachmentBodySchema, + await request.json(), + RequestInputType.RequestBody, + ), + headers: undefined, + } + + const responder = { + with202() { + return new KoaRuntimeResponse(202) + }, + withStatus(status: StatusCode) { + return new KoaRuntimeResponse(status) + }, + } + + const { status, body } = await implementation(input, responder, { request }) + .then((it) => it.unpack()) + .catch((err) => { + throw KoaRuntimeError.HandlerError(err) + }) + + return body !== undefined + ? Response.json(body, { status }) + : new Response(undefined, { status }) + } diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/clients/client.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/clients/client.ts new file mode 100644 index 000000000..e39c41ab9 --- /dev/null +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/clients/client.ts @@ -0,0 +1,317 @@ +/** AUTOGENERATED - DO NOT EDIT **/ +/* tslint:disable */ +/* eslint-disable */ + +import { + t_CreateUpdateTodoList, + t_Error, + t_Statuses, + t_TodoList, + t_UnknownObject, +} from "../models" +import { + AbstractFetchClient, + AbstractFetchClientConfig, + Res, + Server, + StatusCode, + StatusCode4xx, + StatusCode5xx, +} from "@nahkies/typescript-fetch-runtime/main" + +export class ApiClientServersOperations { + static listAttachments(url?: "{schema}://{tenant}.attachments.example.com"): { + build: ( + schema?: "http" | "https", + tenant?: string, + ) => Server<"listAttachments_ApiClient"> + } + static listAttachments(url?: "https://attachments.example.com"): { + build: () => Server<"listAttachments_ApiClient"> + } + static listAttachments( + url: string = "{schema}://{tenant}.attachments.example.com", + ): unknown { + switch (url) { + case "{schema}://{tenant}.attachments.example.com": + return { + build( + schema: "http" | "https" = "https", + tenant = "your-slug", + ): Server<"listAttachments_ApiClient"> { + return "{schema}://{tenant}.attachments.example.com" + .replace("{schema}", schema) + .replace( + "{tenant}", + tenant, + ) as Server<"listAttachments_ApiClient"> + }, + } + + case "https://attachments.example.com": + return { + build(): Server<"listAttachments_ApiClient"> { + return "https://attachments.example.com" as Server<"listAttachments_ApiClient"> + }, + } + + default: + throw new Error(`no matching server for url '${url}'`) + } + } + + static uploadAttachment( + url?: "{schema}://{tenant}.attachments.example.com", + ): { + build: ( + schema?: "http" | "https", + tenant?: string, + ) => Server<"uploadAttachment_ApiClient"> + } + static uploadAttachment(url?: "https://attachments.example.com"): { + build: () => Server<"uploadAttachment_ApiClient"> + } + static uploadAttachment( + url: string = "{schema}://{tenant}.attachments.example.com", + ): unknown { + switch (url) { + case "{schema}://{tenant}.attachments.example.com": + return { + build( + schema: "http" | "https" = "https", + tenant = "your-slug", + ): Server<"uploadAttachment_ApiClient"> { + return "{schema}://{tenant}.attachments.example.com" + .replace("{schema}", schema) + .replace( + "{tenant}", + tenant, + ) as Server<"uploadAttachment_ApiClient"> + }, + } + + case "https://attachments.example.com": + return { + build(): Server<"uploadAttachment_ApiClient"> { + return "https://attachments.example.com" as Server<"uploadAttachment_ApiClient"> + }, + } + + default: + throw new Error(`no matching server for url '${url}'`) + } + } +} + +export class ApiClientServers { + static default(): Server<"ApiClient"> { + return ApiClientServers.server().build() + } + + static server(url?: "{schema}://{tenant}.todo-lists.example.com"): { + build: (schema?: "http" | "https", tenant?: string) => Server<"ApiClient"> + } + static server(url?: "https://todo-lists.example.com"): { + build: () => Server<"ApiClient"> + } + static server( + url: string = "{schema}://{tenant}.todo-lists.example.com", + ): unknown { + switch (url) { + case "{schema}://{tenant}.todo-lists.example.com": + return { + build( + schema: "http" | "https" = "https", + tenant = "your-slug", + ): Server<"ApiClient"> { + return "{schema}://{tenant}.todo-lists.example.com" + .replace("{schema}", schema) + .replace("{tenant}", tenant) as Server<"ApiClient"> + }, + } + + case "https://todo-lists.example.com": + return { + build(): Server<"ApiClient"> { + return "https://todo-lists.example.com" as Server<"ApiClient"> + }, + } + + default: + throw new Error(`no matching server for url '${url}'`) + } + } + + static readonly operations = ApiClientServersOperations +} + +export interface ApiClientConfig extends AbstractFetchClientConfig { + basePath: Server<"ApiClient"> | string +} + +export class ApiClient extends AbstractFetchClient { + constructor(config: ApiClientConfig) { + super(config) + } + + async getTodoLists( + p: { + created?: string + statuses?: t_Statuses + tags?: string[] + } = {}, + timeout?: number, + opts: RequestInit = {}, + ): Promise> { + const url = this.basePath + `/list` + const headers = this._headers({}, opts.headers) + const query = this._query({ + created: p["created"], + statuses: p["statuses"], + tags: p["tags"], + }) + + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) + } + + async getTodoListById( + p: { + listId: string + }, + timeout?: number, + opts: RequestInit = {}, + ): Promise< + Res<200, t_TodoList> | Res | Res + > { + const url = this.basePath + `/list/${p["listId"]}` + const headers = this._headers({}, opts.headers) + + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) + } + + async updateTodoListById( + p: { + listId: string + requestBody: t_CreateUpdateTodoList + }, + timeout?: number, + opts: RequestInit = {}, + ): Promise< + Res<200, t_TodoList> | Res | Res + > { + const url = this.basePath + `/list/${p["listId"]}` + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) + const body = JSON.stringify(p.requestBody) + + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) + } + + async deleteTodoListById( + p: { + listId: string + }, + timeout?: number, + opts: RequestInit = {}, + ): Promise< + Res<204, void> | Res | Res + > { + const url = this.basePath + `/list/${p["listId"]}` + const headers = this._headers({}, opts.headers) + + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) + } + + async getTodoListItems( + p: { + listId: string + }, + timeout?: number, + opts: RequestInit = {}, + ): Promise< + | Res< + 200, + { + completedAt?: string + content: string + createdAt: string + id: string + } + > + | Res< + StatusCode5xx, + { + code: string + message: string + } + > + > { + const url = this.basePath + `/list/${p["listId"]}/items` + const headers = this._headers({}, opts.headers) + + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) + } + + async createTodoListItem( + p: { + listId: string + requestBody: { + completedAt?: string + content: string + id: string + } + }, + timeout?: number, + opts: RequestInit = {}, + ): Promise> { + const url = this.basePath + `/list/${p["listId"]}/items` + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) + const body = JSON.stringify(p.requestBody) + + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) + } + + async listAttachments( + basePath: + | Server<"listAttachments_ApiClient"> + | string = ApiClientServers.operations.listAttachments().build(), + timeout?: number, + opts: RequestInit = {}, + ): Promise> { + const url = basePath + `/attachments` + const headers = this._headers({}, opts.headers) + + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) + } + + async uploadAttachment( + p: { + requestBody: { + file?: unknown + } + }, + basePath: + | Server<"uploadAttachment_ApiClient"> + | string = ApiClientServers.operations.uploadAttachment().build(), + timeout?: number, + opts: RequestInit = {}, + ): Promise> { + const url = basePath + `/attachments` + const headers = this._headers( + { "Content-Type": "multipart/form-data" }, + opts.headers, + ) + const body = JSON.stringify(p.requestBody) + + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) + } +} diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts new file mode 100644 index 000000000..046cd0114 --- /dev/null +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts @@ -0,0 +1,157 @@ +/** AUTOGENERATED - DO NOT EDIT **/ +/* tslint:disable */ +/* eslint-disable */ + +import { + t_CreateTodoListItemBodySchema, + t_CreateTodoListItemParamSchema, + t_GetTodoListItemsParamSchema, +} from "../../../models" +import { + KoaRuntimeError, + RequestInputType, +} from "@nahkies/typescript-koa-runtime/errors" +import { + KoaRuntimeResponder, + KoaRuntimeResponse, + StatusCode, + StatusCode5xx, +} from "@nahkies/typescript-koa-runtime/server" +import { Params, parseRequestInput } from "@nahkies/typescript-koa-runtime/zod" +import { NextRequest } from "next/server" +import { z } from "zod" + +export type GetTodoListItemsResponder = { + with200(): KoaRuntimeResponse<{ + completedAt?: string + content: string + createdAt: string + id: string + }> + withStatusCode5xx(status: StatusCode5xx): KoaRuntimeResponse<{ + code: string + message: string + }> +} & KoaRuntimeResponder + +export type GetTodoListItems = ( + params: Params, + respond: GetTodoListItemsResponder, + ctx: { request: NextRequest }, +) => Promise> + +export type CreateTodoListItemResponder = { + with204(): KoaRuntimeResponse +} & KoaRuntimeResponder + +export type CreateTodoListItem = ( + params: Params< + t_CreateTodoListItemParamSchema, + void, + t_CreateTodoListItemBodySchema, + void + >, + respond: CreateTodoListItemResponder, + ctx: { request: NextRequest }, +) => Promise> + +const getTodoListItemsParamSchema = z.object({ listId: z.string() }) + +export const _GET = + (implementation: GetTodoListItems) => + async ( + request: NextRequest, + { params }: { params: unknown }, + ): Promise => { + const input = { + params: parseRequestInput( + getTodoListItemsParamSchema, + params, + RequestInputType.RouteParam, + ), + // TODO: this swallows repeated parameters + query: undefined, + body: undefined, + headers: undefined, + } + + const responder = { + with200() { + return new KoaRuntimeResponse<{ + completedAt?: string + content: string + createdAt: string + id: string + }>(200) + }, + withStatusCode5xx(status: StatusCode5xx) { + return new KoaRuntimeResponse<{ + code: string + message: string + }>(status) + }, + withStatus(status: StatusCode) { + return new KoaRuntimeResponse(status) + }, + } + + const { status, body } = await implementation(input, responder, { request }) + .then((it) => it.unpack()) + .catch((err) => { + throw KoaRuntimeError.HandlerError(err) + }) + + return body !== undefined + ? Response.json(body, { status }) + : new Response(undefined, { status }) + } + +const createTodoListItemParamSchema = z.object({ listId: z.string() }) + +const createTodoListItemBodySchema = z.object({ + id: z.string(), + content: z.string(), + completedAt: z.string().datetime({ offset: true }).optional(), +}) + +export const _POST = + (implementation: CreateTodoListItem) => + async ( + request: NextRequest, + { params }: { params: unknown }, + ): Promise => { + const input = { + params: parseRequestInput( + createTodoListItemParamSchema, + params, + RequestInputType.RouteParam, + ), + // TODO: this swallows repeated parameters + query: undefined, + body: parseRequestInput( + createTodoListItemBodySchema, + await request.json(), + RequestInputType.RequestBody, + ), + headers: undefined, + } + + const responder = { + with204() { + return new KoaRuntimeResponse(204) + }, + withStatus(status: StatusCode) { + return new KoaRuntimeResponse(status) + }, + } + + const { status, body } = await implementation(input, responder, { request }) + .then((it) => it.unpack()) + .catch((err) => { + throw KoaRuntimeError.HandlerError(err) + }) + + return body !== undefined + ? Response.json(body, { status }) + : new Response(undefined, { status }) + } diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts new file mode 100644 index 000000000..525de2b31 --- /dev/null +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts @@ -0,0 +1,211 @@ +/** AUTOGENERATED - DO NOT EDIT **/ +/* tslint:disable */ +/* eslint-disable */ + +import { + t_DeleteTodoListByIdParamSchema, + t_Error, + t_GetTodoListByIdParamSchema, + t_TodoList, + t_UpdateTodoListByIdBodySchema, + t_UpdateTodoListByIdParamSchema, +} from "../../models" +import { s_CreateUpdateTodoList } from "../../schemas" +import { + KoaRuntimeError, + RequestInputType, +} from "@nahkies/typescript-koa-runtime/errors" +import { + KoaRuntimeResponder, + KoaRuntimeResponse, + StatusCode, + StatusCode4xx, +} from "@nahkies/typescript-koa-runtime/server" +import { Params, parseRequestInput } from "@nahkies/typescript-koa-runtime/zod" +import { NextRequest } from "next/server" +import { z } from "zod" + +export type GetTodoListByIdResponder = { + with200(): KoaRuntimeResponse + withStatusCode4xx(status: StatusCode4xx): KoaRuntimeResponse + withDefault(status: StatusCode): KoaRuntimeResponse +} & KoaRuntimeResponder + +export type GetTodoListById = ( + params: Params, + respond: GetTodoListByIdResponder, + ctx: { request: NextRequest }, +) => Promise> + +export type UpdateTodoListByIdResponder = { + with200(): KoaRuntimeResponse + withStatusCode4xx(status: StatusCode4xx): KoaRuntimeResponse + withDefault(status: StatusCode): KoaRuntimeResponse +} & KoaRuntimeResponder + +export type UpdateTodoListById = ( + params: Params< + t_UpdateTodoListByIdParamSchema, + void, + t_UpdateTodoListByIdBodySchema, + void + >, + respond: UpdateTodoListByIdResponder, + ctx: { request: NextRequest }, +) => Promise> + +export type DeleteTodoListByIdResponder = { + with204(): KoaRuntimeResponse + withStatusCode4xx(status: StatusCode4xx): KoaRuntimeResponse + withDefault(status: StatusCode): KoaRuntimeResponse +} & KoaRuntimeResponder + +export type DeleteTodoListById = ( + params: Params, + respond: DeleteTodoListByIdResponder, + ctx: { request: NextRequest }, +) => Promise> + +const getTodoListByIdParamSchema = z.object({ listId: z.string() }) + +export const _GET = + (implementation: GetTodoListById) => + async ( + request: NextRequest, + { params }: { params: unknown }, + ): Promise => { + const input = { + params: parseRequestInput( + getTodoListByIdParamSchema, + params, + RequestInputType.RouteParam, + ), + // TODO: this swallows repeated parameters + query: undefined, + body: undefined, + headers: undefined, + } + + const responder = { + with200() { + return new KoaRuntimeResponse(200) + }, + withStatusCode4xx(status: StatusCode4xx) { + return new KoaRuntimeResponse(status) + }, + withDefault(status: StatusCode) { + return new KoaRuntimeResponse(status) + }, + withStatus(status: StatusCode) { + return new KoaRuntimeResponse(status) + }, + } + + const { status, body } = await implementation(input, responder, { request }) + .then((it) => it.unpack()) + .catch((err) => { + throw KoaRuntimeError.HandlerError(err) + }) + + return body !== undefined + ? Response.json(body, { status }) + : new Response(undefined, { status }) + } + +const updateTodoListByIdParamSchema = z.object({ listId: z.string() }) + +const updateTodoListByIdBodySchema = s_CreateUpdateTodoList + +export const _PUT = + (implementation: UpdateTodoListById) => + async ( + request: NextRequest, + { params }: { params: unknown }, + ): Promise => { + const input = { + params: parseRequestInput( + updateTodoListByIdParamSchema, + params, + RequestInputType.RouteParam, + ), + // TODO: this swallows repeated parameters + query: undefined, + body: parseRequestInput( + updateTodoListByIdBodySchema, + await request.json(), + RequestInputType.RequestBody, + ), + headers: undefined, + } + + const responder = { + with200() { + return new KoaRuntimeResponse(200) + }, + withStatusCode4xx(status: StatusCode4xx) { + return new KoaRuntimeResponse(status) + }, + withDefault(status: StatusCode) { + return new KoaRuntimeResponse(status) + }, + withStatus(status: StatusCode) { + return new KoaRuntimeResponse(status) + }, + } + + const { status, body } = await implementation(input, responder, { request }) + .then((it) => it.unpack()) + .catch((err) => { + throw KoaRuntimeError.HandlerError(err) + }) + + return body !== undefined + ? Response.json(body, { status }) + : new Response(undefined, { status }) + } + +const deleteTodoListByIdParamSchema = z.object({ listId: z.string() }) + +export const _DELETE = + (implementation: DeleteTodoListById) => + async ( + request: NextRequest, + { params }: { params: unknown }, + ): Promise => { + const input = { + params: parseRequestInput( + deleteTodoListByIdParamSchema, + params, + RequestInputType.RouteParam, + ), + // TODO: this swallows repeated parameters + query: undefined, + body: undefined, + headers: undefined, + } + + const responder = { + with204() { + return new KoaRuntimeResponse(204) + }, + withStatusCode4xx(status: StatusCode4xx) { + return new KoaRuntimeResponse(status) + }, + withDefault(status: StatusCode) { + return new KoaRuntimeResponse(status) + }, + withStatus(status: StatusCode) { + return new KoaRuntimeResponse(status) + }, + } + + const { status, body } = await implementation(input, responder, { request }) + .then((it) => it.unpack()) + .catch((err) => { + throw KoaRuntimeError.HandlerError(err) + }) + + return body !== undefined + ? Response.json(body, { status }) + : new Response(undefined, { status }) + } diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts new file mode 100644 index 000000000..6d351ccd8 --- /dev/null +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts @@ -0,0 +1,82 @@ +/** AUTOGENERATED - DO NOT EDIT **/ +/* tslint:disable */ +/* eslint-disable */ + +import { t_GetTodoListsQuerySchema, t_TodoList } from "../models" +import { s_Statuses } from "../schemas" +import { + KoaRuntimeError, + RequestInputType, +} from "@nahkies/typescript-koa-runtime/errors" +import { + KoaRuntimeResponder, + KoaRuntimeResponse, + StatusCode, +} from "@nahkies/typescript-koa-runtime/server" +import { Params, parseRequestInput } from "@nahkies/typescript-koa-runtime/zod" +import { NextRequest } from "next/server" +import { z } from "zod" + +export type GetTodoListsResponder = { + with200(): KoaRuntimeResponse +} & KoaRuntimeResponder + +export type GetTodoLists = ( + params: Params, + respond: GetTodoListsResponder, + ctx: { request: NextRequest }, +) => Promise> + +const getTodoListsQuerySchema = z.object({ + created: z.string().datetime({ offset: true }).optional(), + statuses: z + .preprocess( + (it: unknown) => (Array.isArray(it) || it === undefined ? it : [it]), + s_Statuses, + ) + .optional(), + tags: z + .preprocess( + (it: unknown) => (Array.isArray(it) || it === undefined ? it : [it]), + z.array(z.string()), + ) + .optional(), +}) + +export const _GET = + (implementation: GetTodoLists) => + async ( + request: NextRequest, + { params }: { params: unknown }, + ): Promise => { + const input = { + params: undefined, + // TODO: this swallows repeated parameters + query: parseRequestInput( + getTodoListsQuerySchema, + Object.fromEntries(request.nextUrl.searchParams.entries()), + RequestInputType.QueryString, + ), + body: undefined, + headers: undefined, + } + + const responder = { + with200() { + return new KoaRuntimeResponse(200) + }, + withStatus(status: StatusCode) { + return new KoaRuntimeResponse(status) + }, + } + + const { status, body } = await implementation(input, responder, { request }) + .then((it) => it.unpack()) + .catch((err) => { + throw KoaRuntimeError.HandlerError(err) + }) + + return body !== undefined + ? Response.json(body, { status }) + : new Response(undefined, { status }) + } diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/models.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/models.ts new file mode 100644 index 000000000..1e323db01 --- /dev/null +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/models.ts @@ -0,0 +1,67 @@ +/** AUTOGENERATED - DO NOT EDIT **/ +/* tslint:disable */ +/* eslint-disable */ + +export type t_Error = { + code?: number + message?: string +} + +export type t_CreateUpdateTodoList = { + name: string +} + +export type t_Statuses = ("incomplete" | "complete")[] + +export type t_TodoList = { + created: string + id: string + incompleteItemCount: number + name: string + totalItemCount: number + updated: string +} + +export type t_CreateTodoListItemBodySchema = { + completedAt?: string + content: string + id: string +} + +export type t_CreateTodoListItemParamSchema = { + listId: string +} + +export type t_DeleteTodoListByIdParamSchema = { + listId: string +} + +export type t_UnknownObject = { + [key: string]: unknown | undefined +} + +export type t_GetTodoListByIdParamSchema = { + listId: string +} + +export type t_GetTodoListItemsParamSchema = { + listId: string +} + +export type t_GetTodoListsQuerySchema = { + created?: string + statuses?: t_Statuses + tags?: string[] +} + +export type t_UpdateTodoListByIdBodySchema = { + name: string +} + +export type t_UpdateTodoListByIdParamSchema = { + listId: string +} + +export type t_UploadAttachmentBodySchema = { + file?: unknown +} diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/schemas.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/schemas.ts new file mode 100644 index 000000000..dd11359eb --- /dev/null +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/schemas.ts @@ -0,0 +1,25 @@ +/** AUTOGENERATED - DO NOT EDIT **/ +/* tslint:disable */ +/* eslint-disable */ + +import { z } from "zod" + +export const s_CreateUpdateTodoList = z.object({ name: z.string() }) + +export const s_Error = z.object({ + message: z.string().optional(), + code: z.coerce.number().optional(), +}) + +export const s_Statuses = z.array(z.enum(["incomplete", "complete"])) + +export const s_TodoList = z.object({ + id: z.string(), + name: z.string(), + totalItemCount: z.coerce.number(), + incompleteItemCount: z.coerce.number(), + created: z.string().datetime({ offset: true }), + updated: z.string().datetime({ offset: true }), +}) + +export const s_UnknownObject = z.record(z.unknown()) diff --git a/packages/documentation/src/lib/playground/load-runtime-types.tsx b/packages/documentation/src/lib/playground/load-runtime-types.tsx index 6a8a5e174..dd653a5cf 100644 --- a/packages/documentation/src/lib/playground/load-runtime-types.tsx +++ b/packages/documentation/src/lib/playground/load-runtime-types.tsx @@ -20,7 +20,8 @@ export const loadRuntimeTypes = async ( | "typescript-fetch" | "typescript-axios" | "typescript-koa" - | "typescript-express", + | "typescript-express" + | "typescript-nextjs", ) => { const fileRootPath = "file:///" @@ -127,6 +128,29 @@ export const loadRuntimeTypes = async ( path: "/node_modules/@nahkies/typescript-express-runtime/joi.d.ts", }, ], + // TODO: adjust + "typescript-nextjs": [ + { + uri: "https://unpkg.com/@nahkies/typescript-koa-runtime@latest/package.json", + path: "/node_modules/@nahkies/typescript-koa-runtime/package.json", + }, + { + uri: "https://unpkg.com/@nahkies/typescript-koa-runtime@latest/dist/server.d.ts", + path: "/node_modules/@nahkies/typescript-koa-runtime/server.d.ts", + }, + { + uri: "https://unpkg.com/@nahkies/typescript-koa-runtime@latest/dist/errors.d.ts", + path: "/node_modules/@nahkies/typescript-koa-runtime/errors.d.ts", + }, + { + uri: "https://unpkg.com/@nahkies/typescript-koa-runtime@latest/dist/zod.d.ts", + path: "/node_modules/@nahkies/typescript-koa-runtime/zod.d.ts", + }, + { + uri: "https://unpkg.com/@nahkies/typescript-koa-runtime@latest/dist/joi.d.ts", + path: "/node_modules/@nahkies/typescript-koa-runtime/joi.d.ts", + }, + ], } for (const file of files[template]) { diff --git a/packages/openapi-code-generator/package.json b/packages/openapi-code-generator/package.json index 60da8ffc7..576c39b63 100644 --- a/packages/openapi-code-generator/package.json +++ b/packages/openapi-code-generator/package.json @@ -74,6 +74,7 @@ "js-yaml": "^4.1.0", "json5": "^2.2.3", "lodash": "^4.17.21", + "ts-morph": "^22.0.0", "tslib": "^2.8.1", "typescript": "^5.9.3", "zod": "^3.25.74" diff --git a/packages/openapi-code-generator/src/config.ts b/packages/openapi-code-generator/src/config.ts index 1a9e226fc..36bb544a3 100644 --- a/packages/openapi-code-generator/src/config.ts +++ b/packages/openapi-code-generator/src/config.ts @@ -17,6 +17,7 @@ export type Config = { | "typescript-angular" | "typescript-koa" | "typescript-express" + | "typescript-nextjs" schemaBuilder: "zod-v3" | "zod-v4" | "joi" enableRuntimeResponseValidation: boolean enableTypedBasePaths: boolean diff --git a/packages/openapi-code-generator/src/core/input.ts b/packages/openapi-code-generator/src/core/input.ts index 200437dee..e67e27b0c 100644 --- a/packages/openapi-code-generator/src/core/input.ts +++ b/packages/openapi-code-generator/src/core/input.ts @@ -53,7 +53,11 @@ import { } from "./utils" export type OperationGroup = {name: string; operations: IROperation[]} -export type OperationGroupStrategy = "none" | "first-tag" | "first-slug" +export type OperationGroupStrategy = + | "none" + | "first-tag" + | "first-slug" + | "route" export type InputConfig = { extractInlineSchemas: boolean @@ -115,6 +119,8 @@ export class Input { return this.operationsByFirstTag() case "first-slug": return this.operationsByFirstSlug() + case "route": + return this.operationsByRoute() default: throw new Error(`unsupported grouping strategy '${strategy}'`) } @@ -222,6 +228,12 @@ export class Input { }) } + private operationsByRoute(): OperationGroup[] { + return this.groupOperations((operation) => { + return operation.route + }) + } + private groupOperations( groupBy: (operation: IROperation) => string | undefined, ): OperationGroup[] { diff --git a/packages/openapi-code-generator/src/core/loaders/tsconfig.loader.ts b/packages/openapi-code-generator/src/core/loaders/tsconfig.loader.ts index 80932c4e5..a06dcf867 100644 --- a/packages/openapi-code-generator/src/core/loaders/tsconfig.loader.ts +++ b/packages/openapi-code-generator/src/core/loaders/tsconfig.loader.ts @@ -11,7 +11,7 @@ import { export type CompilerOptions = Pick< TsCompilerOptions, - "exactOptionalPropertyTypes" | "rewriteRelativeImportExtensions" + "exactOptionalPropertyTypes" | "rewriteRelativeImportExtensions" | "paths" > export async function loadTsConfigCompilerOptions( diff --git a/packages/openapi-code-generator/src/core/openapi-loader.ts b/packages/openapi-code-generator/src/core/openapi-loader.ts index 44de93449..d5b3c88f6 100644 --- a/packages/openapi-code-generator/src/core/openapi-loader.ts +++ b/packages/openapi-code-generator/src/core/openapi-loader.ts @@ -23,7 +23,7 @@ export class OpenapiLoader { private readonly library = new Map() private constructor( - private readonly entryPointKey: string, + public readonly entryPointKey: string, private readonly config: {titleOverride: string | undefined}, private readonly validator: OpenapiValidator, private readonly genericLoader: GenericLoader, diff --git a/packages/openapi-code-generator/src/core/schemas/tsconfig.schema.ts b/packages/openapi-code-generator/src/core/schemas/tsconfig.schema.ts index 6eceb0a38..6bae94d4e 100644 --- a/packages/openapi-code-generator/src/core/schemas/tsconfig.schema.ts +++ b/packages/openapi-code-generator/src/core/schemas/tsconfig.schema.ts @@ -37,6 +37,7 @@ export const tsconfigSchema = z.object({ allowUnreachableCode: z.boolean(), rewriteRelativeImportExtensions: z.boolean(), verbatimModuleSyntax: z.boolean(), + paths: z.record(z.array(z.string())), }) .partial() .optional() diff --git a/packages/openapi-code-generator/src/core/utils.ts b/packages/openapi-code-generator/src/core/utils.ts index bc766d461..e25595e87 100644 --- a/packages/openapi-code-generator/src/core/utils.ts +++ b/packages/openapi-code-generator/src/core/utils.ts @@ -5,6 +5,10 @@ export function isDefined(it: T | undefined): it is T { return it !== undefined } +export function isTruthy(it: T | undefined | null | "" | 0): it is T { + return Boolean(it) +} + export function hasSingleElement(it: T[]): it is [T] { return it.length === 1 } diff --git a/packages/openapi-code-generator/src/templates.ts b/packages/openapi-code-generator/src/templates.ts index c5acc6f97..2f1de8d51 100644 --- a/packages/openapi-code-generator/src/templates.ts +++ b/packages/openapi-code-generator/src/templates.ts @@ -5,6 +5,7 @@ import {generateTypescriptAxios} from "./typescript/client/typescript-axios/type import {generateTypescriptFetch} from "./typescript/client/typescript-fetch/typescript-fetch.generator" import {generateTypescriptExpress} from "./typescript/server/typescript-express/typescript-express.generator" import {generateTypescriptKoa} from "./typescript/server/typescript-koa/typescript-koa.generator" +import {generateTypescriptNextJS} from "./typescript/server/typescript-nextjs/typescript-nextjs.generator" export const templates = { "typescript-fetch": { @@ -37,6 +38,11 @@ export const templates = { run: generateTypescriptExpress, syntheticNameGenerator: defaultSyntheticNameGenerator, }, + "typescript-nextjs": { + language: "typescript", + type: "server", + run: generateTypescriptNextJS, + }, } satisfies {[key: string]: OpenapiGenerator} export const templateNames = [ @@ -45,4 +51,5 @@ export const templateNames = [ "typescript-angular", "typescript-koa", "typescript-express", + "typescript-nextjs", ] as const satisfies Array diff --git a/packages/openapi-code-generator/src/typescript/common/compilation-units.ts b/packages/openapi-code-generator/src/typescript/common/compilation-units.ts index 837d3f3a3..bf9df947e 100644 --- a/packages/openapi-code-generator/src/typescript/common/compilation-units.ts +++ b/packages/openapi-code-generator/src/typescript/common/compilation-units.ts @@ -15,6 +15,7 @@ export class CompilationUnit { readonly filename: string, readonly imports: ImportBuilder | undefined, readonly code: string, + readonly isAutogenerated: boolean = true, ) {} hasCode() { @@ -29,7 +30,7 @@ export class CompilationUnit { includeHeader?: boolean }): string { return [ - includeHeader ? FILE_HEADER : "", + includeHeader && this.isAutogenerated ? FILE_HEADER : "", this.imports ? `${this.imports.toString(allowUnusedImports ? "" : this.code)}\n` : "", diff --git a/packages/openapi-code-generator/src/typescript/common/import-builder.ts b/packages/openapi-code-generator/src/typescript/common/import-builder.ts index 32a212d84..073f72057 100644 --- a/packages/openapi-code-generator/src/typescript/common/import-builder.ts +++ b/packages/openapi-code-generator/src/typescript/common/import-builder.ts @@ -85,6 +85,7 @@ export function categorizeImportSource(source: string): ImportCategory { export type ImportBuilderConfig = { unit?: {filename: string} | undefined includeFileExtensions: boolean + importAlias?: string } export class ImportBuilder { @@ -230,7 +231,13 @@ export class ImportBuilder { from = from.substring(0, from.length - ".ts".length) } + // TODO: does this work on windows? if (this.config.unit && from.startsWith("./")) { + + if (this.config.importAlias) { + return this.config.importAlias + from.split(path.sep).slice(1).join(path.sep) + } + const unitDirname = path.dirname(this.config.unit.filename) const fromDirname = path.dirname(from) diff --git a/packages/openapi-code-generator/src/typescript/common/typescript-emitter.ts b/packages/openapi-code-generator/src/typescript/common/typescript-emitter.ts index 7aeaaf2c4..24f88e21a 100644 --- a/packages/openapi-code-generator/src/typescript/common/typescript-emitter.ts +++ b/packages/openapi-code-generator/src/typescript/common/typescript-emitter.ts @@ -8,7 +8,7 @@ export class TypescriptEmitter { constructor( private readonly fsAdaptor: IFsAdaptor, private readonly formatter: IFormatter, - private readonly config: { + public readonly config: { destinationDirectory: string allowUnusedImports: boolean }, diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts new file mode 100644 index 000000000..b8d184136 --- /dev/null +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts @@ -0,0 +1,613 @@ +// biome-ignore lint/style/useNodejsImportProtocol: +import fs from "fs" +// biome-ignore lint/style/useNodejsImportProtocol: +import path from "path" +import _ from "lodash" +import { + Project, + type SourceFile, + StructureKind, + SyntaxKind, + VariableDeclarationKind, +} from "ts-morph" +import type {Input} from "../../../core/input" +import type {CompilerOptions} from "../../../core/loaders/tsconfig.loader" +import type { + IRModelObject, + IROperation, + IRParameter, +} from "../../../core/openapi-types-normalized" +import {isTruthy} from "../../../core/utils" +import { + type HttpMethod, + isDefined, + isHttpMethod, + titleCase, + upperFirst, +} from "../../../core/utils" +import type {OpenapiTypescriptGeneratorConfig} from "../../../templates.types" +import {TypescriptFetchClientBuilder} from "../../client/typescript-fetch/typescript-fetch-client-builder" +import {CompilationUnit, type ICompilable} from "../../common/compilation-units" +import {ImportBuilder} from "../../common/import-builder" +import {JoiBuilder} from "../../common/schema-builders/joi-schema-builder" +import { + type SchemaBuilder, + schemaBuilderFactory, +} from "../../common/schema-builders/schema-builder" +import {ZodBuilder} from "../../common/schema-builders/zod-schema-builder" +import {TypeBuilder} from "../../common/type-builder" +import {intersect, object} from "../../common/type-utils" +import { + buildExport, + requestBodyAsParameter, + statusStringToType, +} from "../../common/typescript-common" + +function reduceParamsToOpenApiSchema(parameters: IRParameter[]): IRModelObject { + return parameters.reduce( + (acc, parameter) => { + acc.properties[parameter.name] = parameter.schema + + if (parameter.required) { + acc.required.push(parameter.name) + } + + return acc + }, + { + type: "object", + properties: {}, + required: [], + oneOf: [], + allOf: [], + anyOf: [], + additionalProperties: false, + nullable: false, + readOnly: false, + } as IRModelObject, + ) +} + +export class ServerRouterBuilder implements ICompilable { + private readonly statements: string[] = [] + private readonly operationTypes: { + operationId: string + statements: string[] + }[] = [] + + constructor( + public readonly filename: string, + private readonly name: string, + private readonly input: Input, + private readonly imports: ImportBuilder, + public readonly types: TypeBuilder, + public readonly schemaBuilder: SchemaBuilder, + ) { + // todo: unsure why, but adding an export at `.` of index.ts doesn't work properly + this.imports + .from("@nahkies/typescript-koa-runtime/server") + .add( + "startServer", + "ServerConfig", + "KoaRuntimeResponse", + "KoaRuntimeResponder", + "StatusCode2xx", + "StatusCode3xx", + "StatusCode4xx", + "StatusCode5xx", + "StatusCode", + ) + + this.imports.from("next/server").add("NextRequest") + + this.imports + .from("@nahkies/typescript-koa-runtime/errors") + .add("KoaRuntimeError", "RequestInputType") + + if (schemaBuilder instanceof ZodBuilder) { + imports + .from("@nahkies/typescript-koa-runtime/zod") + .add("parseRequestInput", "Params", "responseValidationFactory") + } else if (schemaBuilder instanceof JoiBuilder) { + imports + .from("@nahkies/typescript-koa-runtime/joi") + .add("parseRequestInput", "Params", "responseValidationFactory") + } + } + + add(operation: IROperation): void { + const types = this.types + const schemaBuilder = this.schemaBuilder + + const pathParams = operation.parameters.filter((it) => it.in === "path") + const paramSchema = pathParams.length + ? schemaBuilder.fromParameters(pathParams) + : undefined + let pathParamsType = "void" + + const queryParams = operation.parameters.filter((it) => it.in === "query") + const querySchema = queryParams.length + ? schemaBuilder.fromParameters(queryParams) + : undefined + let queryParamsType = "void" + + const headerParams = operation.parameters + .filter((it) => it.in === "header") + .map((it) => ({...it, name: it.name.toLowerCase()})) + const headerSchema = headerParams.length + ? schemaBuilder.fromParameters(headerParams) + : undefined + + let headerParamsType = "void" + + const {requestBodyParameter} = requestBodyAsParameter(operation) + const bodyParamIsRequired = Boolean(requestBodyParameter?.required) + const bodyParamSchema = requestBodyParameter + ? schemaBuilder.fromModel( + requestBodyParameter.schema, + requestBodyParameter.required, + true, + ) + : undefined + let bodyParamsType = "void" + + if (paramSchema) { + const name = `${operation.operationId}ParamSchema` + pathParamsType = types.schemaObjectToType( + this.input.loader.addVirtualType( + operation.operationId, + _.upperFirst(name), + reduceParamsToOpenApiSchema(pathParams), + ), + ) + this.statements.push(`const ${name} = ${paramSchema.toString()}`) + } + + if (querySchema) { + const name = `${operation.operationId}QuerySchema` + queryParamsType = types.schemaObjectToType( + this.input.loader.addVirtualType( + operation.operationId, + _.upperFirst(name), + reduceParamsToOpenApiSchema(queryParams), + ), + ) + this.statements.push(`const ${name} = ${querySchema.toString()}`) + } + + if (headerSchema) { + const name = `${operation.operationId}HeaderSchema` + + headerParamsType = types.schemaObjectToType( + this.input.loader.addVirtualType( + operation.operationId, + upperFirst(name), + reduceParamsToOpenApiSchema(headerParams), + ), + ) + this.statements.push(`const ${name} = ${headerSchema.toString()}`) + } + + if (bodyParamSchema && requestBodyParameter) { + const name = `${operation.operationId}BodySchema` + bodyParamsType = types.schemaObjectToType( + this.input.loader.addVirtualType( + operation.operationId, + _.upperFirst(name), + this.input.schema(requestBodyParameter.schema), + ), + ) + this.statements.push(`const ${name} = ${bodyParamSchema}`) + } + + const responseSchemas = Object.entries(operation.responses ?? {}).reduce( + (acc, [status, response]) => { + const content = Object.values(response.content ?? {}).pop() + + if (status === "default") { + acc.defaultResponse = { + schema: content + ? schemaBuilder.fromModel(content.schema, true, true) + : schemaBuilder.void(), + type: content ? types.schemaObjectToType(content.schema) : "void", + } + } else { + acc.specific.push({ + statusString: status, + statusType: statusStringToType(status), + type: content ? types.schemaObjectToType(content.schema) : "void", + schema: content + ? schemaBuilder.fromModel(content.schema, true, true) + : schemaBuilder.void(), + isWildCard: /^\d[xX]{2}$/.test(status), + }) + } + + return acc + }, + {specific: [], defaultResponse: undefined} as { + specific: { + statusString: string + statusType: string + schema: string + type: string + isWildCard: boolean + }[] + defaultResponse?: + | { + type: string + schema: string + } + | undefined + }, + ) + + this.operationTypes.push({ + operationId: operation.operationId, + statements: [ + buildExport({ + name: `${titleCase(operation.operationId)}Responder`, + value: intersect( + object([ + ...responseSchemas.specific.map((it) => + it.isWildCard + ? `with${it.statusType}(status: ${it.statusType}): KoaRuntimeResponse<${it.type}>` + : `with${it.statusType}(): KoaRuntimeResponse<${it.type}>`, + ), + responseSchemas.defaultResponse && + `withDefault(status: StatusCode): KoaRuntimeResponse<${responseSchemas.defaultResponse.type}>`, + ]), + "KoaRuntimeResponder", + ), + kind: "type", + }), + buildExport({ + name: titleCase(operation.operationId), + value: `( + params: Params<${pathParamsType}, ${queryParamsType}, ${ + bodyParamsType + + (bodyParamsType === "void" || bodyParamIsRequired + ? "" + : " | undefined") + }, ${headerParamsType}>, + respond: ${titleCase(operation.operationId)}Responder, + ctx: {request: NextRequest} + ) => Promise>`, + kind: "type", + }), + ], + }) + + this.statements.push( + buildExport({ + name: `_${operation.method.toUpperCase()}`, + kind: "const", + value: `(implementation: ${titleCase(operation.operationId)}) => async (request: NextRequest, {params}: {params: unknown}): Promise => { + const input = { + params: ${ + paramSchema + ? `parseRequestInput(${operation.operationId}ParamSchema, params, RequestInputType.RouteParam)` + : "undefined" + }, + // TODO: this swallows repeated parameters + query: ${ + querySchema + ? `parseRequestInput(${operation.operationId}QuerySchema, Object.fromEntries(request.nextUrl.searchParams.entries()), RequestInputType.QueryString)` + : "undefined" + }, + body: ${ + bodyParamSchema + ? `parseRequestInput(${operation.operationId}BodySchema, await request.json(), RequestInputType.RequestBody)` + : "undefined" + }, + headers: ${ + headerSchema + ? `parseRequestInput(${operation.operationId}HeaderSchema, Reflect.get(ctx.request, "headers"), RequestInputType.RequestHeader)` + : "undefined" + } + } + + const responder = {${[ + ...responseSchemas.specific.map((it) => + it.isWildCard + ? `with${it.statusType}(status: ${it.statusType}) {return new KoaRuntimeResponse<${it.type}>(status) }` + : `with${it.statusType}() {return new KoaRuntimeResponse<${it.type}>(${it.statusType}) }`, + ), + responseSchemas.defaultResponse && + `withDefault(status: StatusCode) { return new KoaRuntimeResponse<${responseSchemas.defaultResponse.type}>(status) }`, + "withStatus(status: StatusCode) { return new KoaRuntimeResponse(status)}", + ] + .filter(Boolean) + .join(",\n")}} + + const { + status, + body, + } = await implementation(input, responder, {request}) + .then(it => it.unpack()) + .catch(err => { throw KoaRuntimeError.HandlerError(err) }) + + return body !== undefined ? Response.json(body, {status}) : new Response(undefined, {status}) + }`, + }), + ) + } + + toString(): string { + const routes = this.statements + const code = ` +${this.operationTypes.flatMap((it) => it.statements).join("\n\n")} + +${routes.join("\n\n")} +` + return code + } + + toCompilationUnit(): CompilationUnit { + return new CompilationUnit(this.filename, this.imports, this.toString()) + } +} + +export class NextJSAppRouterBuilder implements ICompilable { + constructor( + public readonly filename: string, + private readonly imports: ImportBuilder, + private readonly companionFilename: string, + private readonly sourceFile: SourceFile, + ) {} + + private readonly httpMethodsUsed = new Set() + + add(operation: IROperation): void { + const sourceFile = this.sourceFile + + const hasPathParam = + operation.parameters.filter((it) => it.in === "path").length > 0 + const hasQueryParam = + operation.parameters.filter((it) => it.in === "query").length > 0 + const hasBodyParam = Boolean( + requestBodyAsParameter(operation).requestBodyParameter, + ) + + const wrappingMethod = `_${operation.method.toUpperCase()}` + + this.httpMethodsUsed.add(operation.method) + + // Get the existing function, or create a new default one + const variableDeclaration = + sourceFile + .getVariableDeclaration(operation.method.toUpperCase()) + ?.getVariableStatement() || + sourceFile.addVariableStatement({ + isExported: true, + declarationKind: VariableDeclarationKind.Const, + declarations: [ + { + name: operation.method.toUpperCase(), + kind: StructureKind.VariableDeclaration, + initializer: `${wrappingMethod}(async (input, respond, context) => { + // TODO: implementation + return respond.withStatus(501).body({message: "not implemented"} as any) + })`, + }, + ], + }) + + // Replace the params based on what inputs we have + // biome-ignore lint/style/noNonNullAssertion: + const declarations = variableDeclaration.getDeclarations()[0]! + // biome-ignore lint/style/noNonNullAssertion: + const innerFunction = declarations + .getInitializerIfKindOrThrow(SyntaxKind.CallExpression) + .getArguments()[0]! + .asKind(SyntaxKind.ArrowFunction)! + + // biome-ignore lint/complexity/noForEach: + innerFunction?.getParameters().forEach((parameter) => { + parameter.remove() + }) + + innerFunction?.addParameter({ + name: `{${[ + hasPathParam ? "params" : undefined, + hasQueryParam ? "query" : undefined, + hasBodyParam ? "body" : undefined, + ] + .filter(isDefined) + .join(",")}}`, + }) + + innerFunction?.addParameter({name: "respond"}) + innerFunction?.addParameter({name: "context"}) + } + + toString(): string { + return this.sourceFile.getFullText() + } + + toCompilationUnit(): CompilationUnit { + // Reconcile imports - attempt to find an existing one and replace it with correct one + const imports = this.sourceFile.getImportDeclarations() + const from = this.imports.normalizeFrom( + `./${this.companionFilename}`, + `./${this.filename}`, + ) + // biome-ignore lint/complexity/noForEach: + imports + .filter((it) => it.getModuleSpecifierValue().includes(from)) + .forEach((it) => it.remove()) + + this.sourceFile.addImportDeclaration({ + namedImports: Array.from(this.httpMethodsUsed).map((it) => `_${it}`), + moduleSpecifier: from, + }) + + // Remove any methods that were removed from the spec + // biome-ignore lint/complexity/noForEach: + this.sourceFile + .getVariableDeclarations() + .filter((it) => { + const name = it.getName() + return isHttpMethod(name) && !this.httpMethodsUsed.has(name) + }) + .forEach((it) => it.remove()) + + return new CompilationUnit( + this.filename, + this.imports, + this.toString(), + false, + ) + } +} + +function findImportAlias(dest: string, compilerOptions: CompilerOptions) { + const relative = `./${path.relative(process.cwd(), dest)}/*` + + const alias = Object.entries(compilerOptions.paths || {}).find(([, paths]) => + paths.includes(relative), + ) + + return alias ? alias[0].replace("*", "") : undefined +} + +export async function generateTypescriptNextJS( + config: OpenapiTypescriptGeneratorConfig, +): Promise { + const {input, emitter, allowAny} = config + + const importAlias = findImportAlias( + config.emitter.config.destinationDirectory, + config.compilerOptions, + ) + + // biome-ignore lint/complexity/useLiteralKeys: + const subDirectory = process.env["OPENAPI_INTEGRATION_TESTS"] + ? path.basename(config.input.loader.entryPointKey) + : "" + + const appDirectory = [".", "app", subDirectory] + .filter(isTruthy) + .join(path.sep) + const generatedDirectory = [".", "generated", subDirectory] + .filter(isTruthy) + .join(path.sep) + + const rootTypeBuilder = await TypeBuilder.fromInput( + [generatedDirectory, "models.ts"].join(path.sep), + input, + config.compilerOptions, + {allowAny}, + ) + + const rootSchemaBuilder = await schemaBuilderFactory( + [generatedDirectory, "schemas.ts"].join(path.sep), + input, + config.schemaBuilder, + {allowAny}, + ) + + const project = new Project() + + const serverRouters = ( + await Promise.all( + input.groupedOperations("route").map(async (group) => { + const filename = path.join( + generatedDirectory, + routeToNextJSFilepath(group.name), + ) + + const imports = new ImportBuilder({filename}, importAlias) + + const routerBuilder = new ServerRouterBuilder( + filename, + group.name, + input, + imports, + rootTypeBuilder.withImports(imports), + rootSchemaBuilder.withImports(imports), + ) + + const nextJsAppRouterPath = path.join( + appDirectory, + routeToNextJSFilepath(group.name), + ) + + const existing = fs.existsSync( + path.join(emitter.config.destinationDirectory, nextJsAppRouterPath), + ) + ? fs + .readFileSync( + path.join( + emitter.config.destinationDirectory, + nextJsAppRouterPath, + ), + "utf-8", + ) + .toString() + : "" + const sourceFile = project.createSourceFile( + nextJsAppRouterPath, + existing, + ) + + const nextJSAppRouterBuilder = new NextJSAppRouterBuilder( + nextJsAppRouterPath, + imports, + filename, + sourceFile, + ) + + for (const operation of group.operations) { + routerBuilder.add(operation) + nextJSAppRouterBuilder.add(operation) + } + + return [ + routerBuilder.toCompilationUnit(), + nextJSAppRouterBuilder.toCompilationUnit(), + ] + }), + ) + ).flat() + + const clientOutputPath = [generatedDirectory, "clients", "client.ts"].join( + path.sep, + ) + const clientImportBuilder = new ImportBuilder( + {filename: clientOutputPath}, + importAlias, + ) + + const fetchClientBuilder = new TypescriptFetchClientBuilder( + clientOutputPath, + "ApiClient", + input, + clientImportBuilder, + rootTypeBuilder.withImports(clientImportBuilder), + rootSchemaBuilder.withImports(clientImportBuilder), + { + enableRuntimeResponseValidation: config.enableRuntimeResponseValidation, + enableTypedBasePaths: config.enableTypedBasePaths, + }, + ) + + input.allOperations().map((it) => fetchClientBuilder.add(it)) + + await emitter.emitGenerationResult([ + ...serverRouters, + fetchClientBuilder.toCompilationUnit(), + rootTypeBuilder.toCompilationUnit(), + rootSchemaBuilder.toCompilationUnit(), + ]) +} + +function routeToNextJSFilepath(route: string): string { + const parts = route + .split("/") + .map((part) => part.replaceAll("{", "[").replaceAll("}", "]")) + + parts.push("route.ts") + + return path.join(...parts) +} diff --git a/scripts/generate.mjs b/scripts/generate.mjs index 197b1722c..7826e8153 100755 --- a/scripts/generate.mjs +++ b/scripts/generate.mjs @@ -65,10 +65,20 @@ async function runSingle(templatePath, input) { const filename = path.basename(input) const template = path.basename(templatePath) + if (template === "typescript-nextjs" && !input.endsWith("todo-lists.yaml")) { + console.warn(`skipping generation of ${templatePath} using ${template}`) + return + } + + const output = + template === "typescript-nextjs" + ? `integration-tests/${template}/src` + : `integration-tests/${template}/src/generated/${filename}` + const args = [ `--input="${input}"`, `--input-type=${inputType}`, - `--output="integration-tests/${template}/src/generated/${filename}"`, + `--output="${output}"`, `--template="${template}"`, `--schema-builder=${schemaBuilder}`, ] @@ -95,15 +105,19 @@ function runCmd(cmd) { console.info(cmd) - const child = exec(cmd, (err) => { - if (err) { - err.output = output - reject(err) - return - } - - resolve(output) - }) + const child = exec( + cmd, + {env: {...process.env, OPENAPI_INTEGRATION_TESTS: "true"}}, + (err) => { + if (err) { + err.output = output + reject(err) + return + } + + resolve(output) + }, + ) child.stdout.on("data", (it) => { output.push(it.trim()) From d0f7d80d9c82c19c6d5d4b0a7a95db8e51f50d40 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Mon, 12 May 2025 08:45:31 +0100 Subject: [PATCH 04/22] refactor: split into multiple files --- .../typescript-nextjs-app-router-builder.ts | 124 +++++ .../typescript-nextjs-router-builder.ts | 297 +++++++++++ .../typescript-nextjs.generator.ts | 460 +----------------- 3 files changed, 427 insertions(+), 454 deletions(-) create mode 100644 packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts create mode 100644 packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts new file mode 100644 index 000000000..048c8ec00 --- /dev/null +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts @@ -0,0 +1,124 @@ +import { + type SourceFile, + StructureKind, + SyntaxKind, + VariableDeclarationKind, +} from "ts-morph" +import type {IROperation} from "../../../core/openapi-types-normalized" +import {type HttpMethod, isDefined, isHttpMethod} from "../../../core/utils" +import {CompilationUnit, type ICompilable} from "../../common/compilation-units" +import type {ImportBuilder} from "../../common/import-builder" +import {requestBodyAsParameter} from "../../common/typescript-common" + +export class TypescriptNextjsAppRouterBuilder implements ICompilable { + constructor( + public readonly filename: string, + private readonly imports: ImportBuilder, + private readonly companionFilename: string, + private readonly sourceFile: SourceFile, + ) {} + + private readonly httpMethodsUsed = new Set() + + add(operation: IROperation): void { + const sourceFile = this.sourceFile + + const hasPathParam = + operation.parameters.filter((it) => it.in === "path").length > 0 + const hasQueryParam = + operation.parameters.filter((it) => it.in === "query").length > 0 + const hasBodyParam = Boolean( + requestBodyAsParameter(operation).requestBodyParameter, + ) + + const wrappingMethod = `_${operation.method.toUpperCase()}` + + this.httpMethodsUsed.add(operation.method) + + // Get the existing function, or create a new default one + const variableDeclaration = + sourceFile + .getVariableDeclaration(operation.method.toUpperCase()) + ?.getVariableStatement() || + sourceFile.addVariableStatement({ + isExported: true, + declarationKind: VariableDeclarationKind.Const, + declarations: [ + { + name: operation.method.toUpperCase(), + kind: StructureKind.VariableDeclaration, + initializer: `${wrappingMethod}(async (input, respond, context) => { + // TODO: implementation + return respond.withStatus(501).body({message: "not implemented"} as any) + })`, + }, + ], + }) + + // Replace the params based on what inputs we have + // biome-ignore lint/style/noNonNullAssertion: + const declarations = variableDeclaration.getDeclarations()[0]! + // biome-ignore lint/style/noNonNullAssertion: + const innerFunction = declarations + .getInitializerIfKindOrThrow(SyntaxKind.CallExpression) + .getArguments()[0]! + .asKind(SyntaxKind.ArrowFunction)! + + // biome-ignore lint/complexity/noForEach: + innerFunction?.getParameters().forEach((parameter) => { + parameter.remove() + }) + + innerFunction?.addParameter({ + name: `{${[ + hasPathParam ? "params" : undefined, + hasQueryParam ? "query" : undefined, + hasBodyParam ? "body" : undefined, + ] + .filter(isDefined) + .join(",")}}`, + }) + + innerFunction?.addParameter({name: "respond"}) + innerFunction?.addParameter({name: "context"}) + } + + toString(): string { + return this.sourceFile.getFullText() + } + + toCompilationUnit(): CompilationUnit { + // Reconcile imports - attempt to find an existing one and replace it with correct one + const imports = this.sourceFile.getImportDeclarations() + const from = this.imports.normalizeFrom( + `./${this.companionFilename}`, + `./${this.filename}`, + ) + // biome-ignore lint/complexity/noForEach: + imports + .filter((it) => it.getModuleSpecifierValue().includes(from)) + .forEach((it) => it.remove()) + + this.sourceFile.addImportDeclaration({ + namedImports: Array.from(this.httpMethodsUsed).map((it) => `_${it}`), + moduleSpecifier: from, + }) + + // Remove any methods that were removed from the spec + // biome-ignore lint/complexity/noForEach: + this.sourceFile + .getVariableDeclarations() + .filter((it) => { + const name = it.getName() + return isHttpMethod(name) && !this.httpMethodsUsed.has(name) + }) + .forEach((it) => it.remove()) + + return new CompilationUnit( + this.filename, + this.imports, + this.toString(), + false, + ) + } +} diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts new file mode 100644 index 000000000..a4ae0d89d --- /dev/null +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts @@ -0,0 +1,297 @@ +import _ from "lodash" +import type {Input} from "../../../core/input" +import type {IROperation} from "../../../core/openapi-types-normalized" +import {titleCase, upperFirst} from "../../../core/utils" +import {CompilationUnit, type ICompilable} from "../../common/compilation-units" +import type {ImportBuilder} from "../../common/import-builder" +import {JoiBuilder} from "../../common/schema-builders/joi-schema-builder" +import type {SchemaBuilder} from "../../common/schema-builders/schema-builder" +import {ZodBuilder} from "../../common/schema-builders/zod-schema-builder" +import type {TypeBuilder} from "../../common/type-builder" +import {intersect, object} from "../../common/type-utils" +import { + buildExport, + requestBodyAsParameter, + statusStringToType, +} from "../../common/typescript-common" +import {reduceParamsToOpenApiSchema} from "../server-operation-builder" + +export class TypescriptNextjsRouterBuilder implements ICompilable { + private readonly statements: string[] = [] + private readonly operationTypes: { + operationId: string + statements: string[] + }[] = [] + + constructor( + public readonly filename: string, + private readonly name: string, + private readonly input: Input, + private readonly imports: ImportBuilder, + public readonly types: TypeBuilder, + public readonly schemaBuilder: SchemaBuilder, + ) { + // todo: unsure why, but adding an export at `.` of index.ts doesn't work properly + this.imports + .from("@nahkies/typescript-koa-runtime/server") + .add( + "startServer", + "ServerConfig", + "KoaRuntimeResponse", + "KoaRuntimeResponder", + "StatusCode2xx", + "StatusCode3xx", + "StatusCode4xx", + "StatusCode5xx", + "StatusCode", + ) + + this.imports.from("next/server").add("NextRequest") + + this.imports + .from("@nahkies/typescript-koa-runtime/errors") + .add("KoaRuntimeError", "RequestInputType") + + if (schemaBuilder instanceof ZodBuilder) { + imports + .from("@nahkies/typescript-koa-runtime/zod") + .add("parseRequestInput", "Params", "responseValidationFactory") + } else if (schemaBuilder instanceof JoiBuilder) { + imports + .from("@nahkies/typescript-koa-runtime/joi") + .add("parseRequestInput", "Params", "responseValidationFactory") + } + } + + add(operation: IROperation): void { + const types = this.types + const schemaBuilder = this.schemaBuilder + + const pathParams = operation.parameters.filter((it) => it.in === "path") + const paramSchema = pathParams.length + ? schemaBuilder.fromParameters(pathParams) + : undefined + let pathParamsType = "void" + + const queryParams = operation.parameters.filter((it) => it.in === "query") + const querySchema = queryParams.length + ? schemaBuilder.fromParameters(queryParams) + : undefined + let queryParamsType = "void" + + const headerParams = operation.parameters + .filter((it) => it.in === "header") + .map((it) => ({...it, name: it.name.toLowerCase()})) + const headerSchema = headerParams.length + ? schemaBuilder.fromParameters(headerParams) + : undefined + + let headerParamsType = "void" + + const {requestBodyParameter} = requestBodyAsParameter(operation) + const bodyParamIsRequired = Boolean(requestBodyParameter?.required) + const bodyParamSchema = requestBodyParameter + ? schemaBuilder.fromModel( + requestBodyParameter.schema, + requestBodyParameter.required, + true, + ) + : undefined + let bodyParamsType = "void" + + if (paramSchema) { + const name = `${operation.operationId}ParamSchema` + pathParamsType = types.schemaObjectToType( + this.input.loader.addVirtualType( + operation.operationId, + _.upperFirst(name), + reduceParamsToOpenApiSchema(pathParams), + ), + ) + this.statements.push(`const ${name} = ${paramSchema.toString()}`) + } + + if (querySchema) { + const name = `${operation.operationId}QuerySchema` + queryParamsType = types.schemaObjectToType( + this.input.loader.addVirtualType( + operation.operationId, + _.upperFirst(name), + reduceParamsToOpenApiSchema(queryParams), + ), + ) + this.statements.push(`const ${name} = ${querySchema.toString()}`) + } + + if (headerSchema) { + const name = `${operation.operationId}HeaderSchema` + + headerParamsType = types.schemaObjectToType( + this.input.loader.addVirtualType( + operation.operationId, + upperFirst(name), + reduceParamsToOpenApiSchema(headerParams), + ), + ) + this.statements.push(`const ${name} = ${headerSchema.toString()}`) + } + + if (bodyParamSchema && requestBodyParameter) { + const name = `${operation.operationId}BodySchema` + bodyParamsType = types.schemaObjectToType( + this.input.loader.addVirtualType( + operation.operationId, + _.upperFirst(name), + this.input.schema(requestBodyParameter.schema), + ), + ) + this.statements.push(`const ${name} = ${bodyParamSchema}`) + } + + const responseSchemas = Object.entries(operation.responses ?? {}).reduce( + (acc, [status, response]) => { + const content = Object.values(response.content ?? {}).pop() + + if (status === "default") { + acc.defaultResponse = { + schema: content + ? schemaBuilder.fromModel(content.schema, true, true) + : schemaBuilder.void(), + type: content ? types.schemaObjectToType(content.schema) : "void", + } + } else { + acc.specific.push({ + statusString: status, + statusType: statusStringToType(status), + type: content ? types.schemaObjectToType(content.schema) : "void", + schema: content + ? schemaBuilder.fromModel(content.schema, true, true) + : schemaBuilder.void(), + isWildCard: /^\d[xX]{2}$/.test(status), + }) + } + + return acc + }, + {specific: [], defaultResponse: undefined} as { + specific: { + statusString: string + statusType: string + schema: string + type: string + isWildCard: boolean + }[] + defaultResponse?: + | { + type: string + schema: string + } + | undefined + }, + ) + + this.operationTypes.push({ + operationId: operation.operationId, + statements: [ + buildExport({ + name: `${titleCase(operation.operationId)}Responder`, + value: intersect( + object([ + ...responseSchemas.specific.map((it) => + it.isWildCard + ? `with${it.statusType}(status: ${it.statusType}): KoaRuntimeResponse<${it.type}>` + : `with${it.statusType}(): KoaRuntimeResponse<${it.type}>`, + ), + responseSchemas.defaultResponse && + `withDefault(status: StatusCode): KoaRuntimeResponse<${responseSchemas.defaultResponse.type}>`, + ]), + "KoaRuntimeResponder", + ), + kind: "type", + }), + buildExport({ + name: titleCase(operation.operationId), + value: `( + params: Params<${pathParamsType}, ${queryParamsType}, ${ + bodyParamsType + + (bodyParamsType === "void" || bodyParamIsRequired + ? "" + : " | undefined") + }, ${headerParamsType}>, + respond: ${titleCase(operation.operationId)}Responder, + ctx: {request: NextRequest} + ) => Promise>`, + kind: "type", + }), + ], + }) + + this.statements.push( + buildExport({ + name: `_${operation.method.toUpperCase()}`, + kind: "const", + value: `(implementation: ${titleCase(operation.operationId)}) => async (request: NextRequest, {params}: {params: unknown}): Promise => { + const input = { + params: ${ + paramSchema + ? `parseRequestInput(${operation.operationId}ParamSchema, params, RequestInputType.RouteParam)` + : "undefined" + }, + // TODO: this swallows repeated parameters + query: ${ + querySchema + ? `parseRequestInput(${operation.operationId}QuerySchema, Object.fromEntries(request.nextUrl.searchParams.entries()), RequestInputType.QueryString)` + : "undefined" + }, + body: ${ + bodyParamSchema + ? `parseRequestInput(${operation.operationId}BodySchema, await request.json(), RequestInputType.RequestBody)` + : "undefined" + }, + headers: ${ + headerSchema + ? `parseRequestInput(${operation.operationId}HeaderSchema, Reflect.get(ctx.request, "headers"), RequestInputType.RequestHeader)` + : "undefined" + } + } + + const responder = {${[ + ...responseSchemas.specific.map((it) => + it.isWildCard + ? `with${it.statusType}(status: ${it.statusType}) {return new KoaRuntimeResponse<${it.type}>(status) }` + : `with${it.statusType}() {return new KoaRuntimeResponse<${it.type}>(${it.statusType}) }`, + ), + responseSchemas.defaultResponse && + `withDefault(status: StatusCode) { return new KoaRuntimeResponse<${responseSchemas.defaultResponse.type}>(status) }`, + "withStatus(status: StatusCode) { return new KoaRuntimeResponse(status)}", + ] + .filter(Boolean) + .join(",\n")}} + + const { + status, + body, + } = await implementation(input, responder, {request}) + .then(it => it.unpack()) + .catch(err => { throw KoaRuntimeError.HandlerError(err) }) + + return body !== undefined ? Response.json(body, {status}) : new Response(undefined, {status}) + }`, + }), + ) + } + + toString(): string { + const routes = this.statements + const code = ` +${this.operationTypes.flatMap((it) => it.statements).join("\n\n")} + +${routes.join("\n\n")} +` + return code + } + + toCompilationUnit(): CompilationUnit { + return new CompilationUnit(this.filename, this.imports, this.toString()) + } +} diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts index b8d184136..24bc00491 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts @@ -2,464 +2,16 @@ import fs from "fs" // biome-ignore lint/style/useNodejsImportProtocol: import path from "path" -import _ from "lodash" -import { - Project, - type SourceFile, - StructureKind, - SyntaxKind, - VariableDeclarationKind, -} from "ts-morph" -import type {Input} from "../../../core/input" +import {Project} from "ts-morph" import type {CompilerOptions} from "../../../core/loaders/tsconfig.loader" -import type { - IRModelObject, - IROperation, - IRParameter, -} from "../../../core/openapi-types-normalized" import {isTruthy} from "../../../core/utils" -import { - type HttpMethod, - isDefined, - isHttpMethod, - titleCase, - upperFirst, -} from "../../../core/utils" import type {OpenapiTypescriptGeneratorConfig} from "../../../templates.types" import {TypescriptFetchClientBuilder} from "../../client/typescript-fetch/typescript-fetch-client-builder" -import {CompilationUnit, type ICompilable} from "../../common/compilation-units" import {ImportBuilder} from "../../common/import-builder" -import {JoiBuilder} from "../../common/schema-builders/joi-schema-builder" -import { - type SchemaBuilder, - schemaBuilderFactory, -} from "../../common/schema-builders/schema-builder" -import {ZodBuilder} from "../../common/schema-builders/zod-schema-builder" +import {schemaBuilderFactory} from "../../common/schema-builders/schema-builder" import {TypeBuilder} from "../../common/type-builder" -import {intersect, object} from "../../common/type-utils" -import { - buildExport, - requestBodyAsParameter, - statusStringToType, -} from "../../common/typescript-common" - -function reduceParamsToOpenApiSchema(parameters: IRParameter[]): IRModelObject { - return parameters.reduce( - (acc, parameter) => { - acc.properties[parameter.name] = parameter.schema - - if (parameter.required) { - acc.required.push(parameter.name) - } - - return acc - }, - { - type: "object", - properties: {}, - required: [], - oneOf: [], - allOf: [], - anyOf: [], - additionalProperties: false, - nullable: false, - readOnly: false, - } as IRModelObject, - ) -} - -export class ServerRouterBuilder implements ICompilable { - private readonly statements: string[] = [] - private readonly operationTypes: { - operationId: string - statements: string[] - }[] = [] - - constructor( - public readonly filename: string, - private readonly name: string, - private readonly input: Input, - private readonly imports: ImportBuilder, - public readonly types: TypeBuilder, - public readonly schemaBuilder: SchemaBuilder, - ) { - // todo: unsure why, but adding an export at `.` of index.ts doesn't work properly - this.imports - .from("@nahkies/typescript-koa-runtime/server") - .add( - "startServer", - "ServerConfig", - "KoaRuntimeResponse", - "KoaRuntimeResponder", - "StatusCode2xx", - "StatusCode3xx", - "StatusCode4xx", - "StatusCode5xx", - "StatusCode", - ) - - this.imports.from("next/server").add("NextRequest") - - this.imports - .from("@nahkies/typescript-koa-runtime/errors") - .add("KoaRuntimeError", "RequestInputType") - - if (schemaBuilder instanceof ZodBuilder) { - imports - .from("@nahkies/typescript-koa-runtime/zod") - .add("parseRequestInput", "Params", "responseValidationFactory") - } else if (schemaBuilder instanceof JoiBuilder) { - imports - .from("@nahkies/typescript-koa-runtime/joi") - .add("parseRequestInput", "Params", "responseValidationFactory") - } - } - - add(operation: IROperation): void { - const types = this.types - const schemaBuilder = this.schemaBuilder - - const pathParams = operation.parameters.filter((it) => it.in === "path") - const paramSchema = pathParams.length - ? schemaBuilder.fromParameters(pathParams) - : undefined - let pathParamsType = "void" - - const queryParams = operation.parameters.filter((it) => it.in === "query") - const querySchema = queryParams.length - ? schemaBuilder.fromParameters(queryParams) - : undefined - let queryParamsType = "void" - - const headerParams = operation.parameters - .filter((it) => it.in === "header") - .map((it) => ({...it, name: it.name.toLowerCase()})) - const headerSchema = headerParams.length - ? schemaBuilder.fromParameters(headerParams) - : undefined - - let headerParamsType = "void" - - const {requestBodyParameter} = requestBodyAsParameter(operation) - const bodyParamIsRequired = Boolean(requestBodyParameter?.required) - const bodyParamSchema = requestBodyParameter - ? schemaBuilder.fromModel( - requestBodyParameter.schema, - requestBodyParameter.required, - true, - ) - : undefined - let bodyParamsType = "void" - - if (paramSchema) { - const name = `${operation.operationId}ParamSchema` - pathParamsType = types.schemaObjectToType( - this.input.loader.addVirtualType( - operation.operationId, - _.upperFirst(name), - reduceParamsToOpenApiSchema(pathParams), - ), - ) - this.statements.push(`const ${name} = ${paramSchema.toString()}`) - } - - if (querySchema) { - const name = `${operation.operationId}QuerySchema` - queryParamsType = types.schemaObjectToType( - this.input.loader.addVirtualType( - operation.operationId, - _.upperFirst(name), - reduceParamsToOpenApiSchema(queryParams), - ), - ) - this.statements.push(`const ${name} = ${querySchema.toString()}`) - } - - if (headerSchema) { - const name = `${operation.operationId}HeaderSchema` - - headerParamsType = types.schemaObjectToType( - this.input.loader.addVirtualType( - operation.operationId, - upperFirst(name), - reduceParamsToOpenApiSchema(headerParams), - ), - ) - this.statements.push(`const ${name} = ${headerSchema.toString()}`) - } - - if (bodyParamSchema && requestBodyParameter) { - const name = `${operation.operationId}BodySchema` - bodyParamsType = types.schemaObjectToType( - this.input.loader.addVirtualType( - operation.operationId, - _.upperFirst(name), - this.input.schema(requestBodyParameter.schema), - ), - ) - this.statements.push(`const ${name} = ${bodyParamSchema}`) - } - - const responseSchemas = Object.entries(operation.responses ?? {}).reduce( - (acc, [status, response]) => { - const content = Object.values(response.content ?? {}).pop() - - if (status === "default") { - acc.defaultResponse = { - schema: content - ? schemaBuilder.fromModel(content.schema, true, true) - : schemaBuilder.void(), - type: content ? types.schemaObjectToType(content.schema) : "void", - } - } else { - acc.specific.push({ - statusString: status, - statusType: statusStringToType(status), - type: content ? types.schemaObjectToType(content.schema) : "void", - schema: content - ? schemaBuilder.fromModel(content.schema, true, true) - : schemaBuilder.void(), - isWildCard: /^\d[xX]{2}$/.test(status), - }) - } - - return acc - }, - {specific: [], defaultResponse: undefined} as { - specific: { - statusString: string - statusType: string - schema: string - type: string - isWildCard: boolean - }[] - defaultResponse?: - | { - type: string - schema: string - } - | undefined - }, - ) - - this.operationTypes.push({ - operationId: operation.operationId, - statements: [ - buildExport({ - name: `${titleCase(operation.operationId)}Responder`, - value: intersect( - object([ - ...responseSchemas.specific.map((it) => - it.isWildCard - ? `with${it.statusType}(status: ${it.statusType}): KoaRuntimeResponse<${it.type}>` - : `with${it.statusType}(): KoaRuntimeResponse<${it.type}>`, - ), - responseSchemas.defaultResponse && - `withDefault(status: StatusCode): KoaRuntimeResponse<${responseSchemas.defaultResponse.type}>`, - ]), - "KoaRuntimeResponder", - ), - kind: "type", - }), - buildExport({ - name: titleCase(operation.operationId), - value: `( - params: Params<${pathParamsType}, ${queryParamsType}, ${ - bodyParamsType + - (bodyParamsType === "void" || bodyParamIsRequired - ? "" - : " | undefined") - }, ${headerParamsType}>, - respond: ${titleCase(operation.operationId)}Responder, - ctx: {request: NextRequest} - ) => Promise>`, - kind: "type", - }), - ], - }) - - this.statements.push( - buildExport({ - name: `_${operation.method.toUpperCase()}`, - kind: "const", - value: `(implementation: ${titleCase(operation.operationId)}) => async (request: NextRequest, {params}: {params: unknown}): Promise => { - const input = { - params: ${ - paramSchema - ? `parseRequestInput(${operation.operationId}ParamSchema, params, RequestInputType.RouteParam)` - : "undefined" - }, - // TODO: this swallows repeated parameters - query: ${ - querySchema - ? `parseRequestInput(${operation.operationId}QuerySchema, Object.fromEntries(request.nextUrl.searchParams.entries()), RequestInputType.QueryString)` - : "undefined" - }, - body: ${ - bodyParamSchema - ? `parseRequestInput(${operation.operationId}BodySchema, await request.json(), RequestInputType.RequestBody)` - : "undefined" - }, - headers: ${ - headerSchema - ? `parseRequestInput(${operation.operationId}HeaderSchema, Reflect.get(ctx.request, "headers"), RequestInputType.RequestHeader)` - : "undefined" - } - } - - const responder = {${[ - ...responseSchemas.specific.map((it) => - it.isWildCard - ? `with${it.statusType}(status: ${it.statusType}) {return new KoaRuntimeResponse<${it.type}>(status) }` - : `with${it.statusType}() {return new KoaRuntimeResponse<${it.type}>(${it.statusType}) }`, - ), - responseSchemas.defaultResponse && - `withDefault(status: StatusCode) { return new KoaRuntimeResponse<${responseSchemas.defaultResponse.type}>(status) }`, - "withStatus(status: StatusCode) { return new KoaRuntimeResponse(status)}", - ] - .filter(Boolean) - .join(",\n")}} - - const { - status, - body, - } = await implementation(input, responder, {request}) - .then(it => it.unpack()) - .catch(err => { throw KoaRuntimeError.HandlerError(err) }) - - return body !== undefined ? Response.json(body, {status}) : new Response(undefined, {status}) - }`, - }), - ) - } - - toString(): string { - const routes = this.statements - const code = ` -${this.operationTypes.flatMap((it) => it.statements).join("\n\n")} - -${routes.join("\n\n")} -` - return code - } - - toCompilationUnit(): CompilationUnit { - return new CompilationUnit(this.filename, this.imports, this.toString()) - } -} - -export class NextJSAppRouterBuilder implements ICompilable { - constructor( - public readonly filename: string, - private readonly imports: ImportBuilder, - private readonly companionFilename: string, - private readonly sourceFile: SourceFile, - ) {} - - private readonly httpMethodsUsed = new Set() - - add(operation: IROperation): void { - const sourceFile = this.sourceFile - - const hasPathParam = - operation.parameters.filter((it) => it.in === "path").length > 0 - const hasQueryParam = - operation.parameters.filter((it) => it.in === "query").length > 0 - const hasBodyParam = Boolean( - requestBodyAsParameter(operation).requestBodyParameter, - ) - - const wrappingMethod = `_${operation.method.toUpperCase()}` - - this.httpMethodsUsed.add(operation.method) - - // Get the existing function, or create a new default one - const variableDeclaration = - sourceFile - .getVariableDeclaration(operation.method.toUpperCase()) - ?.getVariableStatement() || - sourceFile.addVariableStatement({ - isExported: true, - declarationKind: VariableDeclarationKind.Const, - declarations: [ - { - name: operation.method.toUpperCase(), - kind: StructureKind.VariableDeclaration, - initializer: `${wrappingMethod}(async (input, respond, context) => { - // TODO: implementation - return respond.withStatus(501).body({message: "not implemented"} as any) - })`, - }, - ], - }) - - // Replace the params based on what inputs we have - // biome-ignore lint/style/noNonNullAssertion: - const declarations = variableDeclaration.getDeclarations()[0]! - // biome-ignore lint/style/noNonNullAssertion: - const innerFunction = declarations - .getInitializerIfKindOrThrow(SyntaxKind.CallExpression) - .getArguments()[0]! - .asKind(SyntaxKind.ArrowFunction)! - - // biome-ignore lint/complexity/noForEach: - innerFunction?.getParameters().forEach((parameter) => { - parameter.remove() - }) - - innerFunction?.addParameter({ - name: `{${[ - hasPathParam ? "params" : undefined, - hasQueryParam ? "query" : undefined, - hasBodyParam ? "body" : undefined, - ] - .filter(isDefined) - .join(",")}}`, - }) - - innerFunction?.addParameter({name: "respond"}) - innerFunction?.addParameter({name: "context"}) - } - - toString(): string { - return this.sourceFile.getFullText() - } - - toCompilationUnit(): CompilationUnit { - // Reconcile imports - attempt to find an existing one and replace it with correct one - const imports = this.sourceFile.getImportDeclarations() - const from = this.imports.normalizeFrom( - `./${this.companionFilename}`, - `./${this.filename}`, - ) - // biome-ignore lint/complexity/noForEach: - imports - .filter((it) => it.getModuleSpecifierValue().includes(from)) - .forEach((it) => it.remove()) - - this.sourceFile.addImportDeclaration({ - namedImports: Array.from(this.httpMethodsUsed).map((it) => `_${it}`), - moduleSpecifier: from, - }) - - // Remove any methods that were removed from the spec - // biome-ignore lint/complexity/noForEach: - this.sourceFile - .getVariableDeclarations() - .filter((it) => { - const name = it.getName() - return isHttpMethod(name) && !this.httpMethodsUsed.has(name) - }) - .forEach((it) => it.remove()) - - return new CompilationUnit( - this.filename, - this.imports, - this.toString(), - false, - ) - } -} +import {TypescriptNextjsAppRouterBuilder} from "./typescript-nextjs-app-router-builder" +import {TypescriptNextjsRouterBuilder} from "./typescript-nextjs-router-builder" function findImportAlias(dest: string, compilerOptions: CompilerOptions) { const relative = `./${path.relative(process.cwd(), dest)}/*` @@ -519,7 +71,7 @@ export async function generateTypescriptNextJS( const imports = new ImportBuilder({filename}, importAlias) - const routerBuilder = new ServerRouterBuilder( + const routerBuilder = new TypescriptNextjsRouterBuilder( filename, group.name, input, @@ -551,7 +103,7 @@ export async function generateTypescriptNextJS( existing, ) - const nextJSAppRouterBuilder = new NextJSAppRouterBuilder( + const nextJSAppRouterBuilder = new TypescriptNextjsAppRouterBuilder( nextJsAppRouterPath, imports, filename, From 91c1e3a2091b0e2c57487db42474a0b5303fda1b Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sat, 17 May 2025 09:11:19 +0100 Subject: [PATCH 05/22] refactor: use AbstractRouterBuilder --- .../todo-lists.yaml/attachments/route.ts | 13 +- .../list/[listId]/items/route.ts | 17 +- .../todo-lists.yaml/list/[listId]/route.ts | 25 +- .../generated/todo-lists.yaml/list/route.ts | 7 +- .../typescript-nextjs-router-builder.ts | 279 ++++++------------ 5 files changed, 119 insertions(+), 222 deletions(-) diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts index bdec23a52..38a3e0eec 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts @@ -16,6 +16,7 @@ import { Params, parseRequestInput } from "@nahkies/typescript-koa-runtime/zod" import { NextRequest } from "next/server" import { z } from "zod" +// /attachments export type ListAttachmentsResponder = { with200(): KoaRuntimeResponse } & KoaRuntimeResponder @@ -23,7 +24,7 @@ export type ListAttachmentsResponder = { export type ListAttachments = ( params: Params, respond: ListAttachmentsResponder, - ctx: { request: NextRequest }, + request: NextRequest, ) => Promise> export type UploadAttachmentResponder = { @@ -33,14 +34,14 @@ export type UploadAttachmentResponder = { export type UploadAttachment = ( params: Params, respond: UploadAttachmentResponder, - ctx: { request: NextRequest }, + request: NextRequest, ) => Promise> export const _GET = (implementation: ListAttachments) => async ( request: NextRequest, - { params }: { params: unknown }, + { params }: { params: Promise }, ): Promise => { const input = { params: undefined, @@ -59,7 +60,7 @@ export const _GET = }, } - const { status, body } = await implementation(input, responder, { request }) + const { status, body } = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { throw KoaRuntimeError.HandlerError(err) @@ -76,7 +77,7 @@ export const _POST = (implementation: UploadAttachment) => async ( request: NextRequest, - { params }: { params: unknown }, + { params }: { params: Promise }, ): Promise => { const input = { params: undefined, @@ -99,7 +100,7 @@ export const _POST = }, } - const { status, body } = await implementation(input, responder, { request }) + const { status, body } = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { throw KoaRuntimeError.HandlerError(err) diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts index 046cd0114..7f4adf529 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts @@ -21,6 +21,7 @@ import { Params, parseRequestInput } from "@nahkies/typescript-koa-runtime/zod" import { NextRequest } from "next/server" import { z } from "zod" +// /list/{listId}/items export type GetTodoListItemsResponder = { with200(): KoaRuntimeResponse<{ completedAt?: string @@ -37,7 +38,7 @@ export type GetTodoListItemsResponder = { export type GetTodoListItems = ( params: Params, respond: GetTodoListItemsResponder, - ctx: { request: NextRequest }, + request: NextRequest, ) => Promise> export type CreateTodoListItemResponder = { @@ -52,7 +53,7 @@ export type CreateTodoListItem = ( void >, respond: CreateTodoListItemResponder, - ctx: { request: NextRequest }, + request: NextRequest, ) => Promise> const getTodoListItemsParamSchema = z.object({ listId: z.string() }) @@ -61,12 +62,12 @@ export const _GET = (implementation: GetTodoListItems) => async ( request: NextRequest, - { params }: { params: unknown }, + { params }: { params: Promise }, ): Promise => { const input = { params: parseRequestInput( getTodoListItemsParamSchema, - params, + await params, RequestInputType.RouteParam, ), // TODO: this swallows repeated parameters @@ -95,7 +96,7 @@ export const _GET = }, } - const { status, body } = await implementation(input, responder, { request }) + const { status, body } = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { throw KoaRuntimeError.HandlerError(err) @@ -118,12 +119,12 @@ export const _POST = (implementation: CreateTodoListItem) => async ( request: NextRequest, - { params }: { params: unknown }, + { params }: { params: Promise }, ): Promise => { const input = { params: parseRequestInput( createTodoListItemParamSchema, - params, + await params, RequestInputType.RouteParam, ), // TODO: this swallows repeated parameters @@ -145,7 +146,7 @@ export const _POST = }, } - const { status, body } = await implementation(input, responder, { request }) + const { status, body } = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { throw KoaRuntimeError.HandlerError(err) diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts index 525de2b31..0ce76a2af 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts @@ -25,6 +25,7 @@ import { Params, parseRequestInput } from "@nahkies/typescript-koa-runtime/zod" import { NextRequest } from "next/server" import { z } from "zod" +// /list/{listId} export type GetTodoListByIdResponder = { with200(): KoaRuntimeResponse withStatusCode4xx(status: StatusCode4xx): KoaRuntimeResponse @@ -34,7 +35,7 @@ export type GetTodoListByIdResponder = { export type GetTodoListById = ( params: Params, respond: GetTodoListByIdResponder, - ctx: { request: NextRequest }, + request: NextRequest, ) => Promise> export type UpdateTodoListByIdResponder = { @@ -51,7 +52,7 @@ export type UpdateTodoListById = ( void >, respond: UpdateTodoListByIdResponder, - ctx: { request: NextRequest }, + request: NextRequest, ) => Promise> export type DeleteTodoListByIdResponder = { @@ -63,7 +64,7 @@ export type DeleteTodoListByIdResponder = { export type DeleteTodoListById = ( params: Params, respond: DeleteTodoListByIdResponder, - ctx: { request: NextRequest }, + request: NextRequest, ) => Promise> const getTodoListByIdParamSchema = z.object({ listId: z.string() }) @@ -72,12 +73,12 @@ export const _GET = (implementation: GetTodoListById) => async ( request: NextRequest, - { params }: { params: unknown }, + { params }: { params: Promise }, ): Promise => { const input = { params: parseRequestInput( getTodoListByIdParamSchema, - params, + await params, RequestInputType.RouteParam, ), // TODO: this swallows repeated parameters @@ -101,7 +102,7 @@ export const _GET = }, } - const { status, body } = await implementation(input, responder, { request }) + const { status, body } = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { throw KoaRuntimeError.HandlerError(err) @@ -120,12 +121,12 @@ export const _PUT = (implementation: UpdateTodoListById) => async ( request: NextRequest, - { params }: { params: unknown }, + { params }: { params: Promise }, ): Promise => { const input = { params: parseRequestInput( updateTodoListByIdParamSchema, - params, + await params, RequestInputType.RouteParam, ), // TODO: this swallows repeated parameters @@ -153,7 +154,7 @@ export const _PUT = }, } - const { status, body } = await implementation(input, responder, { request }) + const { status, body } = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { throw KoaRuntimeError.HandlerError(err) @@ -170,12 +171,12 @@ export const _DELETE = (implementation: DeleteTodoListById) => async ( request: NextRequest, - { params }: { params: unknown }, + { params }: { params: Promise }, ): Promise => { const input = { params: parseRequestInput( deleteTodoListByIdParamSchema, - params, + await params, RequestInputType.RouteParam, ), // TODO: this swallows repeated parameters @@ -199,7 +200,7 @@ export const _DELETE = }, } - const { status, body } = await implementation(input, responder, { request }) + const { status, body } = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { throw KoaRuntimeError.HandlerError(err) diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts index 6d351ccd8..a97f31e6f 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts @@ -17,6 +17,7 @@ import { Params, parseRequestInput } from "@nahkies/typescript-koa-runtime/zod" import { NextRequest } from "next/server" import { z } from "zod" +// /list export type GetTodoListsResponder = { with200(): KoaRuntimeResponse } & KoaRuntimeResponder @@ -24,7 +25,7 @@ export type GetTodoListsResponder = { export type GetTodoLists = ( params: Params, respond: GetTodoListsResponder, - ctx: { request: NextRequest }, + request: NextRequest, ) => Promise> const getTodoListsQuerySchema = z.object({ @@ -47,7 +48,7 @@ export const _GET = (implementation: GetTodoLists) => async ( request: NextRequest, - { params }: { params: unknown }, + { params }: { params: Promise }, ): Promise => { const input = { params: undefined, @@ -70,7 +71,7 @@ export const _GET = }, } - const { status, body } = await implementation(input, responder, { request }) + const { status, body } = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { throw KoaRuntimeError.HandlerError(err) diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts index a4ae0d89d..bdd9ad95d 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts @@ -1,36 +1,37 @@ -import _ from "lodash" import type {Input} from "../../../core/input" -import type {IROperation} from "../../../core/openapi-types-normalized" -import {titleCase, upperFirst} from "../../../core/utils" -import {CompilationUnit, type ICompilable} from "../../common/compilation-units" +import {titleCase} from "../../../core/utils" import type {ImportBuilder} from "../../common/import-builder" import {JoiBuilder} from "../../common/schema-builders/joi-schema-builder" import type {SchemaBuilder} from "../../common/schema-builders/schema-builder" import {ZodBuilder} from "../../common/schema-builders/zod-schema-builder" import type {TypeBuilder} from "../../common/type-builder" -import {intersect, object} from "../../common/type-utils" +import {constStatement} from "../../common/type-utils" +import {buildExport} from "../../common/typescript-common" import { - buildExport, - requestBodyAsParameter, - statusStringToType, -} from "../../common/typescript-common" -import {reduceParamsToOpenApiSchema} from "../server-operation-builder" + AbstractRouterBuilder, + type ServerSymbols, +} from "../abstract-router-builder" +import type {ServerOperationBuilder} from "../server-operation-builder" -export class TypescriptNextjsRouterBuilder implements ICompilable { - private readonly statements: string[] = [] +export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { private readonly operationTypes: { operationId: string statements: string[] }[] = [] + // biome-ignore lint/complexity/noUselessConstructor: constructor( - public readonly filename: string, - private readonly name: string, - private readonly input: Input, - private readonly imports: ImportBuilder, - public readonly types: TypeBuilder, - public readonly schemaBuilder: SchemaBuilder, + filename: string, + name: string, + input: Input, + imports: ImportBuilder, + types: TypeBuilder, + schemaBuilder: SchemaBuilder, ) { + super(filename, name, input, imports, types, schemaBuilder) + } + + protected buildImports(): void { // todo: unsure why, but adding an export at `.` of index.ts doesn't work properly this.imports .from("@nahkies/typescript-koa-runtime/server") @@ -46,232 +47,111 @@ export class TypescriptNextjsRouterBuilder implements ICompilable { "StatusCode", ) - this.imports.from("next/server").add("NextRequest") + this.imports.from("next/server").add("NextRequest", "NextResponse") this.imports .from("@nahkies/typescript-koa-runtime/errors") .add("KoaRuntimeError", "RequestInputType") - if (schemaBuilder instanceof ZodBuilder) { - imports + if (this.schemaBuilder instanceof ZodBuilder) { + this.imports .from("@nahkies/typescript-koa-runtime/zod") .add("parseRequestInput", "Params", "responseValidationFactory") - } else if (schemaBuilder instanceof JoiBuilder) { - imports + } else if (this.schemaBuilder instanceof JoiBuilder) { + this.imports .from("@nahkies/typescript-koa-runtime/joi") .add("parseRequestInput", "Params", "responseValidationFactory") } } - add(operation: IROperation): void { + protected buildOperation(builder: ServerOperationBuilder): string { + const statements: string[] = [] + const types = this.types const schemaBuilder = this.schemaBuilder - const pathParams = operation.parameters.filter((it) => it.in === "path") - const paramSchema = pathParams.length - ? schemaBuilder.fromParameters(pathParams) - : undefined - let pathParamsType = "void" - - const queryParams = operation.parameters.filter((it) => it.in === "query") - const querySchema = queryParams.length - ? schemaBuilder.fromParameters(queryParams) - : undefined - let queryParamsType = "void" - - const headerParams = operation.parameters - .filter((it) => it.in === "header") - .map((it) => ({...it, name: it.name.toLowerCase()})) - const headerSchema = headerParams.length - ? schemaBuilder.fromParameters(headerParams) - : undefined - - let headerParamsType = "void" + const symbols = this.operationSymbols(builder.operationId) + const params = builder.parameters(symbols) - const {requestBodyParameter} = requestBodyAsParameter(operation) - const bodyParamIsRequired = Boolean(requestBodyParameter?.required) - const bodyParamSchema = requestBodyParameter - ? schemaBuilder.fromModel( - requestBodyParameter.schema, - requestBodyParameter.required, - true, - ) - : undefined - let bodyParamsType = "void" - - if (paramSchema) { - const name = `${operation.operationId}ParamSchema` - pathParamsType = types.schemaObjectToType( - this.input.loader.addVirtualType( - operation.operationId, - _.upperFirst(name), - reduceParamsToOpenApiSchema(pathParams), - ), - ) - this.statements.push(`const ${name} = ${paramSchema.toString()}`) + if (params.path.schema) { + statements.push(constStatement(symbols.paramSchema, params.path.schema)) } - - if (querySchema) { - const name = `${operation.operationId}QuerySchema` - queryParamsType = types.schemaObjectToType( - this.input.loader.addVirtualType( - operation.operationId, - _.upperFirst(name), - reduceParamsToOpenApiSchema(queryParams), - ), - ) - this.statements.push(`const ${name} = ${querySchema.toString()}`) + if (params.query.schema) { + statements.push(constStatement(symbols.querySchema, params.query.schema)) } - - if (headerSchema) { - const name = `${operation.operationId}HeaderSchema` - - headerParamsType = types.schemaObjectToType( - this.input.loader.addVirtualType( - operation.operationId, - upperFirst(name), - reduceParamsToOpenApiSchema(headerParams), - ), + if (params.header.schema) { + statements.push( + constStatement(symbols.requestHeaderSchema, params.header.schema), ) - this.statements.push(`const ${name} = ${headerSchema.toString()}`) } - - if (bodyParamSchema && requestBodyParameter) { - const name = `${operation.operationId}BodySchema` - bodyParamsType = types.schemaObjectToType( - this.input.loader.addVirtualType( - operation.operationId, - _.upperFirst(name), - this.input.schema(requestBodyParameter.schema), - ), + if (params.body.schema) { + statements.push( + constStatement(symbols.requestBodySchema, params.body.schema), ) - this.statements.push(`const ${name} = ${bodyParamSchema}`) } - const responseSchemas = Object.entries(operation.responses ?? {}).reduce( - (acc, [status, response]) => { - const content = Object.values(response.content ?? {}).pop() - - if (status === "default") { - acc.defaultResponse = { - schema: content - ? schemaBuilder.fromModel(content.schema, true, true) - : schemaBuilder.void(), - type: content ? types.schemaObjectToType(content.schema) : "void", - } - } else { - acc.specific.push({ - statusString: status, - statusType: statusStringToType(status), - type: content ? types.schemaObjectToType(content.schema) : "void", - schema: content - ? schemaBuilder.fromModel(content.schema, true, true) - : schemaBuilder.void(), - isWildCard: /^\d[xX]{2}$/.test(status), - }) - } - - return acc - }, - {specific: [], defaultResponse: undefined} as { - specific: { - statusString: string - statusType: string - schema: string - type: string - isWildCard: boolean - }[] - defaultResponse?: - | { - type: string - schema: string - } - | undefined - }, + const responseSchemas = builder.responseSchemas() + const responder = builder.responder( + // TODO: nextjs types + "KoaRuntimeResponder", + "KoaRuntimeResponse", ) this.operationTypes.push({ - operationId: operation.operationId, + operationId: builder.operationId, statements: [ buildExport({ - name: `${titleCase(operation.operationId)}Responder`, - value: intersect( - object([ - ...responseSchemas.specific.map((it) => - it.isWildCard - ? `with${it.statusType}(status: ${it.statusType}): KoaRuntimeResponse<${it.type}>` - : `with${it.statusType}(): KoaRuntimeResponse<${it.type}>`, - ), - responseSchemas.defaultResponse && - `withDefault(status: StatusCode): KoaRuntimeResponse<${responseSchemas.defaultResponse.type}>`, - ]), - "KoaRuntimeResponder", - ), + name: symbols.responderName, + value: responder.type, kind: "type", }), buildExport({ - name: titleCase(operation.operationId), + name: symbols.implTypeName, value: `( - params: Params<${pathParamsType}, ${queryParamsType}, ${ - bodyParamsType + - (bodyParamsType === "void" || bodyParamIsRequired - ? "" - : " | undefined") - }, ${headerParamsType}>, - respond: ${titleCase(operation.operationId)}Responder, - ctx: {request: NextRequest} + params: ${params.type}, + respond: ${symbols.responderName}, + request: NextRequest, ) => Promise>`, kind: "type", }), ], }) - this.statements.push( + statements.push( buildExport({ - name: `_${operation.method.toUpperCase()}`, + name: `_${builder.method.toUpperCase()}`, kind: "const", - value: `(implementation: ${titleCase(operation.operationId)}) => async (request: NextRequest, {params}: {params: unknown}): Promise => { + value: `(implementation: ${symbols.implTypeName}) => async (request: NextRequest, {params}: {params: Promise}): Promise => { const input = { params: ${ - paramSchema - ? `parseRequestInput(${operation.operationId}ParamSchema, params, RequestInputType.RouteParam)` + params.path.schema + ? `parseRequestInput(${symbols.paramSchema}, await params, RequestInputType.RouteParam)` : "undefined" }, // TODO: this swallows repeated parameters query: ${ - querySchema - ? `parseRequestInput(${operation.operationId}QuerySchema, Object.fromEntries(request.nextUrl.searchParams.entries()), RequestInputType.QueryString)` + params.query.schema + ? `parseRequestInput(${symbols.querySchema}, Object.fromEntries(request.nextUrl.searchParams.entries()), RequestInputType.QueryString)` : "undefined" }, body: ${ - bodyParamSchema - ? `parseRequestInput(${operation.operationId}BodySchema, await request.json(), RequestInputType.RequestBody)` + params.body.schema + ? `parseRequestInput(${symbols.requestBodySchema}, await request.json(), RequestInputType.RequestBody)` : "undefined" }, headers: ${ - headerSchema - ? `parseRequestInput(${operation.operationId}HeaderSchema, Reflect.get(ctx.request, "headers"), RequestInputType.RequestHeader)` + params.header.schema + ? `parseRequestInput(${symbols.requestHeaderSchema}, Reflect.get(request, "headers"), RequestInputType.RequestHeader)` : "undefined" } } - const responder = {${[ - ...responseSchemas.specific.map((it) => - it.isWildCard - ? `with${it.statusType}(status: ${it.statusType}) {return new KoaRuntimeResponse<${it.type}>(status) }` - : `with${it.statusType}() {return new KoaRuntimeResponse<${it.type}>(${it.statusType}) }`, - ), - responseSchemas.defaultResponse && - `withDefault(status: StatusCode) { return new KoaRuntimeResponse<${responseSchemas.defaultResponse.type}>(status) }`, - "withStatus(status: StatusCode) { return new KoaRuntimeResponse(status)}", - ] - .filter(Boolean) - .join(",\n")}} + const responder = ${responder.implementation} const { status, body, - } = await implementation(input, responder, {request}) + } = await implementation(input, responder, request) .then(it => it.unpack()) .catch(err => { throw KoaRuntimeError.HandlerError(err) }) @@ -279,19 +159,32 @@ export class TypescriptNextjsRouterBuilder implements ICompilable { }`, }), ) + + return statements.join("\n\n") } - toString(): string { - const routes = this.statements - const code = ` + protected operationSymbols(operationId: string): ServerSymbols { + return { + implPropName: operationId, + implTypeName: titleCase(operationId), + responderName: `${titleCase(operationId)}Responder`, + paramSchema: `${operationId}ParamSchema`, + querySchema: `${operationId}QuerySchema`, + requestBodySchema: `${operationId}BodySchema`, + requestHeaderSchema: `${operationId}HeaderSchema`, + responseBodyValidator: `${operationId}ResponseValidator`, + } + } + + protected buildRouter( + routerName: string, + routerStatements: string[], + ): string { + return ` +// ${routerName} ${this.operationTypes.flatMap((it) => it.statements).join("\n\n")} -${routes.join("\n\n")} +${routerStatements.join("\n\n")} ` - return code - } - - toCompilationUnit(): CompilationUnit { - return new CompilationUnit(this.filename, this.imports, this.toString()) } } From 4b66ce0a936bfe6cf35858bb83c8ddcb069bbd8b Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sat, 17 May 2025 09:35:31 +0100 Subject: [PATCH 06/22] fix: smarter params, nextjs 15 support --- .../app/todo-lists.yaml/attachments/route.ts | 13 ++-- .../list/[listId]/items/route.ts | 8 +-- .../todo-lists.yaml/list/[listId]/route.ts | 14 ++-- .../src/app/todo-lists.yaml/list/route.ts | 6 +- .../todo-lists.yaml/attachments/route.ts | 13 +--- .../generated/todo-lists.yaml/list/route.ts | 5 +- .../server/server-operation-builder.ts | 12 +++- .../typescript-nextjs-app-router-builder.ts | 72 +++++++++++++------ .../typescript-nextjs-router-builder.ts | 21 +++--- .../typescript-nextjs.generator.ts | 4 ++ 10 files changed, 100 insertions(+), 68 deletions(-) diff --git a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts index e5fef071d..17adde126 100644 --- a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts +++ b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts @@ -1,13 +1,10 @@ -import { - _GET, - _POST, -} from "../../../generated/todo-lists.yaml/attachments/route" +import {_GET, _POST} from "../../../generated/todo-lists.yaml/attachments/route" -export const GET = _GET(async ({}, respond, context) => { +export const GET = _GET(async (respond, context) => { // TODO: implementation - return respond.withStatus(501).body({ message: "not implemented" } as any) + return respond.withStatus(501).body({message: "not implemented"} as any) }) -export const POST = _POST(async ({ body }, respond, context) => { +export const POST = _POST(async ({body}, respond, context) => { // TODO: implementation - return respond.withStatus(501).body({ message: "not implemented" } as any) + return respond.withStatus(501).body({message: "not implemented"} as any) }) diff --git a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/items/route.ts b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/items/route.ts index 106807e70..b3d877530 100644 --- a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/items/route.ts +++ b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/items/route.ts @@ -3,11 +3,11 @@ import { _POST, } from "../../../../../generated/todo-lists.yaml/list/[listId]/items/route" -export const GET = _GET(async ({ params }, respond, context) => { +export const GET = _GET(async ({params}, respond, context) => { // TODO: implementation - return respond.withStatus(501).body({ message: "not implemented" } as any) + return respond.withStatus(501).body({message: "not implemented"} as any) }) -export const POST = _POST(async ({ params, body }, respond, context) => { +export const POST = _POST(async ({params, body}, respond, context) => { // TODO: implementation - return respond.withStatus(501).body({ message: "not implemented" } as any) + return respond.withStatus(501).body({message: "not implemented"} as any) }) diff --git a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/route.ts b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/route.ts index 17ad5c9d4..d9fa40af0 100644 --- a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/route.ts +++ b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/route.ts @@ -1,18 +1,18 @@ import { + _DELETE, _GET, _PUT, - _DELETE, } from "../../../../generated/todo-lists.yaml/list/[listId]/route" -export const GET = _GET(async ({ params }, respond, context) => { +export const GET = _GET(async ({params}, respond, context) => { // TODO: implementation - return respond.withStatus(501).body({ message: "not implemented" } as any) + return respond.withStatus(501).body({message: "not implemented"} as any) }) -export const PUT = _PUT(async ({ params, body }, respond, context) => { +export const PUT = _PUT(async ({params, body}, respond, context) => { // TODO: implementation - return respond.withStatus(501).body({ message: "not implemented" } as any) + return respond.withStatus(501).body({message: "not implemented"} as any) }) -export const DELETE = _DELETE(async ({ params }, respond, context) => { +export const DELETE = _DELETE(async ({params}, respond, context) => { // TODO: implementation - return respond.withStatus(501).body({ message: "not implemented" } as any) + return respond.withStatus(501).body({message: "not implemented"} as any) }) diff --git a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/route.ts b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/route.ts index 16410e64c..84539220c 100644 --- a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/route.ts +++ b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/route.ts @@ -1,6 +1,6 @@ -import { _GET } from "../../../generated/todo-lists.yaml/list/route" +import {_GET} from "../../../generated/todo-lists.yaml/list/route" -export const GET = _GET(async ({ query }, respond, context) => { +export const GET = _GET(async ({query}, respond, context) => { // TODO: implementation - return respond.withStatus(501).body({ message: "not implemented" } as any) + return respond.withStatus(501).body({message: "not implemented"} as any) }) diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts index 38a3e0eec..61ecc5278 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts @@ -22,7 +22,6 @@ export type ListAttachmentsResponder = { } & KoaRuntimeResponder export type ListAttachments = ( - params: Params, respond: ListAttachmentsResponder, request: NextRequest, ) => Promise> @@ -39,10 +38,7 @@ export type UploadAttachment = ( export const _GET = (implementation: ListAttachments) => - async ( - request: NextRequest, - { params }: { params: Promise }, - ): Promise => { + async (request: NextRequest): Promise => { const input = { params: undefined, // TODO: this swallows repeated parameters @@ -60,7 +56,7 @@ export const _GET = }, } - const { status, body } = await implementation(input, responder, request) + const { status, body } = await implementation(responder, request) .then((it) => it.unpack()) .catch((err) => { throw KoaRuntimeError.HandlerError(err) @@ -75,10 +71,7 @@ const uploadAttachmentBodySchema = z.object({ file: z.unknown().optional() }) export const _POST = (implementation: UploadAttachment) => - async ( - request: NextRequest, - { params }: { params: Promise }, - ): Promise => { + async (request: NextRequest): Promise => { const input = { params: undefined, // TODO: this swallows repeated parameters diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts index a97f31e6f..4cd58b721 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts @@ -46,10 +46,7 @@ const getTodoListsQuerySchema = z.object({ export const _GET = (implementation: GetTodoLists) => - async ( - request: NextRequest, - { params }: { params: Promise }, - ): Promise => { + async (request: NextRequest): Promise => { const input = { params: undefined, // TODO: this swallows repeated parameters diff --git a/packages/openapi-code-generator/src/typescript/server/server-operation-builder.ts b/packages/openapi-code-generator/src/typescript/server/server-operation-builder.ts index 9e26f8cc1..bebf67ccf 100644 --- a/packages/openapi-code-generator/src/typescript/server/server-operation-builder.ts +++ b/packages/openapi-code-generator/src/typescript/server/server-operation-builder.ts @@ -38,6 +38,7 @@ export type ServerOperationResponseSchemas = { } export type Parameters = { + hasParams: boolean type: string path: { name: string @@ -121,7 +122,16 @@ export class ServerOperationBuilder { ${header.type} >` - return {type, path, query, header, body} + return { + hasParams: Boolean( + path.schema || query.schema || header.schema || body.schema, + ), + type, + path, + query, + header, + body, + } } responseValidator(): string { diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts index 048c8ec00..6f87642c3 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts @@ -4,16 +4,29 @@ import { SyntaxKind, VariableDeclarationKind, } from "ts-morph" +import type {Input} from "../../../core/input" import type {IROperation} from "../../../core/openapi-types-normalized" -import {type HttpMethod, isDefined, isHttpMethod} from "../../../core/utils" +import { + type HttpMethod, + isDefined, + isHttpMethod, + titleCase, +} from "../../../core/utils" import {CompilationUnit, type ICompilable} from "../../common/compilation-units" import type {ImportBuilder} from "../../common/import-builder" -import {requestBodyAsParameter} from "../../common/typescript-common" +import type {SchemaBuilder} from "../../common/schema-builders/schema-builder" +import type {TypeBuilder} from "../../common/type-builder" +import type {ServerSymbols} from "../abstract-router-builder" +import {ServerOperationBuilder} from "../server-operation-builder" export class TypescriptNextjsAppRouterBuilder implements ICompilable { constructor( - public readonly filename: string, + private readonly filename: string, + private readonly name: string, + private readonly input: Input, private readonly imports: ImportBuilder, + private readonly types: TypeBuilder, + private readonly schemaBuilder: SchemaBuilder, private readonly companionFilename: string, private readonly sourceFile: SourceFile, ) {} @@ -21,16 +34,18 @@ export class TypescriptNextjsAppRouterBuilder implements ICompilable { private readonly httpMethodsUsed = new Set() add(operation: IROperation): void { - const sourceFile = this.sourceFile - - const hasPathParam = - operation.parameters.filter((it) => it.in === "path").length > 0 - const hasQueryParam = - operation.parameters.filter((it) => it.in === "query").length > 0 - const hasBodyParam = Boolean( - requestBodyAsParameter(operation).requestBodyParameter, + const builder = new ServerOperationBuilder( + operation, + this.input, + this.types, + this.schemaBuilder, ) + const symbols = this.operationSymbols(builder.operationId) + const params = builder.parameters(symbols) + + const sourceFile = this.sourceFile + const wrappingMethod = `_${operation.method.toUpperCase()}` this.httpMethodsUsed.add(operation.method) @@ -69,20 +84,37 @@ export class TypescriptNextjsAppRouterBuilder implements ICompilable { parameter.remove() }) - innerFunction?.addParameter({ - name: `{${[ - hasPathParam ? "params" : undefined, - hasQueryParam ? "query" : undefined, - hasBodyParam ? "body" : undefined, - ] - .filter(isDefined) - .join(",")}}`, - }) + if (params.hasParams) { + innerFunction?.addParameter({ + name: `{${[ + params.path.schema ? "params" : undefined, + params.query.schema ? "query" : undefined, + params.body.schema ? "body" : undefined, + params.header.schema ? "headers" : undefined, + ] + .filter(isDefined) + .join(",")}}`, + }) + } innerFunction?.addParameter({name: "respond"}) innerFunction?.addParameter({name: "context"}) } + // TODO: duplication - should be shared with router builder + protected operationSymbols(operationId: string): ServerSymbols { + return { + implPropName: operationId, + implTypeName: titleCase(operationId), + responderName: `${titleCase(operationId)}Responder`, + paramSchema: `${operationId}ParamSchema`, + querySchema: `${operationId}QuerySchema`, + requestBodySchema: `${operationId}BodySchema`, + requestHeaderSchema: `${operationId}HeaderSchema`, + responseBodyValidator: `${operationId}ResponseValidator`, + } + } + toString(): string { return this.sourceFile.getFullText() } diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts index bdd9ad95d..aaacdce87 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts @@ -1,5 +1,5 @@ import type {Input} from "../../../core/input" -import {titleCase} from "../../../core/utils" +import {isDefined, titleCase} from "../../../core/utils" import type {ImportBuilder} from "../../common/import-builder" import {JoiBuilder} from "../../common/schema-builders/joi-schema-builder" import type {SchemaBuilder} from "../../common/schema-builders/schema-builder" @@ -67,9 +67,6 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { protected buildOperation(builder: ServerOperationBuilder): string { const statements: string[] = [] - const types = this.types - const schemaBuilder = this.schemaBuilder - const symbols = this.operationSymbols(builder.operationId) const params = builder.parameters(symbols) @@ -107,11 +104,13 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { }), buildExport({ name: symbols.implTypeName, - value: `( - params: ${params.type}, - respond: ${symbols.responderName}, - request: NextRequest, - ) => Promise>`, + value: `(${[ + params.hasParams ? `params: ${params.type}` : undefined, + `respond: ${symbols.responderName}`, + "request: NextRequest", + ] + .filter(isDefined) + .join(",")}) => Promise>`, kind: "type", }), ], @@ -121,7 +120,7 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { buildExport({ name: `_${builder.method.toUpperCase()}`, kind: "const", - value: `(implementation: ${symbols.implTypeName}) => async (request: NextRequest, {params}: {params: Promise}): Promise => { + value: `(implementation: ${symbols.implTypeName}) => async (${["request: NextRequest", params.path.schema ? "{params}: {params: Promise}" : undefined].filter(isDefined).join(",")}): Promise => { const input = { params: ${ params.path.schema @@ -151,7 +150,7 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { const { status, body, - } = await implementation(input, responder, request) + } = await implementation(${[params.hasParams ? "input" : undefined, "responder", "request"].filter(isDefined).join(",")}) .then(it => it.unpack()) .catch(err => { throw KoaRuntimeError.HandlerError(err) }) diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts index 24bc00491..4e9a77a12 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts @@ -105,7 +105,11 @@ export async function generateTypescriptNextJS( const nextJSAppRouterBuilder = new TypescriptNextjsAppRouterBuilder( nextJsAppRouterPath, + group.name, + input, imports, + rootTypeBuilder.withImports(imports), + rootSchemaBuilder.withImports(imports), filename, sourceFile, ) From b26b420b45ffb37b2b0e7cdfb1f79b8d7360b002 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sun, 1 Jun 2025 12:36:01 +0100 Subject: [PATCH 07/22] fix: align deps --- integration-tests/typescript-nextjs/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration-tests/typescript-nextjs/package.json b/integration-tests/typescript-nextjs/package.json index 4afa64d1a..e54039bad 100644 --- a/integration-tests/typescript-nextjs/package.json +++ b/integration-tests/typescript-nextjs/package.json @@ -11,14 +11,14 @@ "validate": "tsc -p ./tsconfig.json" }, "dependencies": { - "next": "^15.3.1", + "next": "^15.3.5", "react": "^19.1.0", "react-dom": "^19.1.0" }, "devDependencies": { - "@types/node": "^22.15.3", - "@types/react": "^19.1.2", - "@types/react-dom": "^19.1.3", + "@types/node": "^22.16.0", + "@types/react": "^19.1.8", + "@types/react-dom": "^19.1.6", "typescript": "^5.8.3" } } From 0c028195d250cc54fce5520a0a5cfb72cddeade7 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sat, 5 Jul 2025 13:03:23 +0100 Subject: [PATCH 08/22] chore: regenerate --- .../todo-lists.yaml/attachments/route.ts | 22 +++++------ .../todo-lists.yaml/clients/client.ts | 26 ++++++------- .../list/[listId]/items/route.ts | 28 +++++++------- .../todo-lists.yaml/list/[listId]/route.ts | 38 +++++++++---------- .../generated/todo-lists.yaml/list/route.ts | 18 ++++----- .../src/generated/todo-lists.yaml/schemas.ts | 8 ++-- 6 files changed, 68 insertions(+), 72 deletions(-) diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts index 61ecc5278..184c1a860 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts @@ -2,7 +2,7 @@ /* tslint:disable */ /* eslint-disable */ -import { t_UnknownObject, t_UploadAttachmentBodySchema } from "../models" +import {t_UnknownObject, t_UploadAttachmentBodySchema} from "../models" import { KoaRuntimeError, RequestInputType, @@ -12,9 +12,9 @@ import { KoaRuntimeResponse, StatusCode, } from "@nahkies/typescript-koa-runtime/server" -import { Params, parseRequestInput } from "@nahkies/typescript-koa-runtime/zod" -import { NextRequest } from "next/server" -import { z } from "zod" +import {Params, parseRequestInput} from "@nahkies/typescript-koa-runtime/zod" +import {NextRequest} from "next/server" +import {z} from "zod" // /attachments export type ListAttachmentsResponder = { @@ -56,18 +56,18 @@ export const _GET = }, } - const { status, body } = await implementation(responder, request) + const {status, body} = await implementation(responder, request) .then((it) => it.unpack()) .catch((err) => { throw KoaRuntimeError.HandlerError(err) }) return body !== undefined - ? Response.json(body, { status }) - : new Response(undefined, { status }) + ? Response.json(body, {status}) + : new Response(undefined, {status}) } -const uploadAttachmentBodySchema = z.object({ file: z.unknown().optional() }) +const uploadAttachmentBodySchema = z.object({file: z.unknown().optional()}) export const _POST = (implementation: UploadAttachment) => @@ -93,13 +93,13 @@ export const _POST = }, } - const { status, body } = await implementation(input, responder, request) + const {status, body} = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { throw KoaRuntimeError.HandlerError(err) }) return body !== undefined - ? Response.json(body, { status }) - : new Response(undefined, { status }) + ? Response.json(body, {status}) + : new Response(undefined, {status}) } diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/clients/client.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/clients/client.ts index e39c41ab9..925e0e07e 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/clients/client.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/clients/client.ts @@ -171,11 +171,7 @@ export class ApiClient extends AbstractFetchClient { tags: p["tags"], }) - return this._fetch( - url + query, - { method: "GET", ...opts, headers }, - timeout, - ) + return this._fetch(url + query, {method: "GET", ...opts, headers}, timeout) } async getTodoListById( @@ -190,7 +186,7 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/list/${p["listId"]}` const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...opts, headers }, timeout) + return this._fetch(url, {method: "GET", ...opts, headers}, timeout) } async updateTodoListById( @@ -205,12 +201,12 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/list/${p["listId"]}` const headers = this._headers( - { "Content-Type": "application/json" }, + {"Content-Type": "application/json"}, opts.headers, ) const body = JSON.stringify(p.requestBody) - return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) + return this._fetch(url, {method: "PUT", body, ...opts, headers}, timeout) } async deleteTodoListById( @@ -225,7 +221,7 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/list/${p["listId"]}` const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) + return this._fetch(url, {method: "DELETE", ...opts, headers}, timeout) } async getTodoListItems( @@ -255,7 +251,7 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/list/${p["listId"]}/items` const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...opts, headers }, timeout) + return this._fetch(url, {method: "GET", ...opts, headers}, timeout) } async createTodoListItem( @@ -272,12 +268,12 @@ export class ApiClient extends AbstractFetchClient { ): Promise> { const url = this.basePath + `/list/${p["listId"]}/items` const headers = this._headers( - { "Content-Type": "application/json" }, + {"Content-Type": "application/json"}, opts.headers, ) const body = JSON.stringify(p.requestBody) - return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) + return this._fetch(url, {method: "POST", body, ...opts, headers}, timeout) } async listAttachments( @@ -290,7 +286,7 @@ export class ApiClient extends AbstractFetchClient { const url = basePath + `/attachments` const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...opts, headers }, timeout) + return this._fetch(url, {method: "GET", ...opts, headers}, timeout) } async uploadAttachment( @@ -307,11 +303,11 @@ export class ApiClient extends AbstractFetchClient { ): Promise> { const url = basePath + `/attachments` const headers = this._headers( - { "Content-Type": "multipart/form-data" }, + {"Content-Type": "multipart/form-data"}, opts.headers, ) const body = JSON.stringify(p.requestBody) - return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) + return this._fetch(url, {method: "POST", body, ...opts, headers}, timeout) } } diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts index 7f4adf529..3c2393ce0 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts @@ -17,9 +17,9 @@ import { StatusCode, StatusCode5xx, } from "@nahkies/typescript-koa-runtime/server" -import { Params, parseRequestInput } from "@nahkies/typescript-koa-runtime/zod" -import { NextRequest } from "next/server" -import { z } from "zod" +import {Params, parseRequestInput} from "@nahkies/typescript-koa-runtime/zod" +import {NextRequest} from "next/server" +import {z} from "zod" // /list/{listId}/items export type GetTodoListItemsResponder = { @@ -56,13 +56,13 @@ export type CreateTodoListItem = ( request: NextRequest, ) => Promise> -const getTodoListItemsParamSchema = z.object({ listId: z.string() }) +const getTodoListItemsParamSchema = z.object({listId: z.string()}) export const _GET = (implementation: GetTodoListItems) => async ( request: NextRequest, - { params }: { params: Promise }, + {params}: {params: Promise}, ): Promise => { const input = { params: parseRequestInput( @@ -96,30 +96,30 @@ export const _GET = }, } - const { status, body } = await implementation(input, responder, request) + const {status, body} = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { throw KoaRuntimeError.HandlerError(err) }) return body !== undefined - ? Response.json(body, { status }) - : new Response(undefined, { status }) + ? Response.json(body, {status}) + : new Response(undefined, {status}) } -const createTodoListItemParamSchema = z.object({ listId: z.string() }) +const createTodoListItemParamSchema = z.object({listId: z.string()}) const createTodoListItemBodySchema = z.object({ id: z.string(), content: z.string(), - completedAt: z.string().datetime({ offset: true }).optional(), + completedAt: z.string().datetime({offset: true}).optional(), }) export const _POST = (implementation: CreateTodoListItem) => async ( request: NextRequest, - { params }: { params: Promise }, + {params}: {params: Promise}, ): Promise => { const input = { params: parseRequestInput( @@ -146,13 +146,13 @@ export const _POST = }, } - const { status, body } = await implementation(input, responder, request) + const {status, body} = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { throw KoaRuntimeError.HandlerError(err) }) return body !== undefined - ? Response.json(body, { status }) - : new Response(undefined, { status }) + ? Response.json(body, {status}) + : new Response(undefined, {status}) } diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts index 0ce76a2af..a814e4e35 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts @@ -10,7 +10,7 @@ import { t_UpdateTodoListByIdBodySchema, t_UpdateTodoListByIdParamSchema, } from "../../models" -import { s_CreateUpdateTodoList } from "../../schemas" +import {s_CreateUpdateTodoList} from "../../schemas" import { KoaRuntimeError, RequestInputType, @@ -21,9 +21,9 @@ import { StatusCode, StatusCode4xx, } from "@nahkies/typescript-koa-runtime/server" -import { Params, parseRequestInput } from "@nahkies/typescript-koa-runtime/zod" -import { NextRequest } from "next/server" -import { z } from "zod" +import {Params, parseRequestInput} from "@nahkies/typescript-koa-runtime/zod" +import {NextRequest} from "next/server" +import {z} from "zod" // /list/{listId} export type GetTodoListByIdResponder = { @@ -67,13 +67,13 @@ export type DeleteTodoListById = ( request: NextRequest, ) => Promise> -const getTodoListByIdParamSchema = z.object({ listId: z.string() }) +const getTodoListByIdParamSchema = z.object({listId: z.string()}) export const _GET = (implementation: GetTodoListById) => async ( request: NextRequest, - { params }: { params: Promise }, + {params}: {params: Promise}, ): Promise => { const input = { params: parseRequestInput( @@ -102,18 +102,18 @@ export const _GET = }, } - const { status, body } = await implementation(input, responder, request) + const {status, body} = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { throw KoaRuntimeError.HandlerError(err) }) return body !== undefined - ? Response.json(body, { status }) - : new Response(undefined, { status }) + ? Response.json(body, {status}) + : new Response(undefined, {status}) } -const updateTodoListByIdParamSchema = z.object({ listId: z.string() }) +const updateTodoListByIdParamSchema = z.object({listId: z.string()}) const updateTodoListByIdBodySchema = s_CreateUpdateTodoList @@ -121,7 +121,7 @@ export const _PUT = (implementation: UpdateTodoListById) => async ( request: NextRequest, - { params }: { params: Promise }, + {params}: {params: Promise}, ): Promise => { const input = { params: parseRequestInput( @@ -154,24 +154,24 @@ export const _PUT = }, } - const { status, body } = await implementation(input, responder, request) + const {status, body} = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { throw KoaRuntimeError.HandlerError(err) }) return body !== undefined - ? Response.json(body, { status }) - : new Response(undefined, { status }) + ? Response.json(body, {status}) + : new Response(undefined, {status}) } -const deleteTodoListByIdParamSchema = z.object({ listId: z.string() }) +const deleteTodoListByIdParamSchema = z.object({listId: z.string()}) export const _DELETE = (implementation: DeleteTodoListById) => async ( request: NextRequest, - { params }: { params: Promise }, + {params}: {params: Promise}, ): Promise => { const input = { params: parseRequestInput( @@ -200,13 +200,13 @@ export const _DELETE = }, } - const { status, body } = await implementation(input, responder, request) + const {status, body} = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { throw KoaRuntimeError.HandlerError(err) }) return body !== undefined - ? Response.json(body, { status }) - : new Response(undefined, { status }) + ? Response.json(body, {status}) + : new Response(undefined, {status}) } diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts index 4cd58b721..fcc18aa45 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts @@ -2,8 +2,8 @@ /* tslint:disable */ /* eslint-disable */ -import { t_GetTodoListsQuerySchema, t_TodoList } from "../models" -import { s_Statuses } from "../schemas" +import {t_GetTodoListsQuerySchema, t_TodoList} from "../models" +import {s_Statuses} from "../schemas" import { KoaRuntimeError, RequestInputType, @@ -13,9 +13,9 @@ import { KoaRuntimeResponse, StatusCode, } from "@nahkies/typescript-koa-runtime/server" -import { Params, parseRequestInput } from "@nahkies/typescript-koa-runtime/zod" -import { NextRequest } from "next/server" -import { z } from "zod" +import {Params, parseRequestInput} from "@nahkies/typescript-koa-runtime/zod" +import {NextRequest} from "next/server" +import {z} from "zod" // /list export type GetTodoListsResponder = { @@ -29,7 +29,7 @@ export type GetTodoLists = ( ) => Promise> const getTodoListsQuerySchema = z.object({ - created: z.string().datetime({ offset: true }).optional(), + created: z.string().datetime({offset: true}).optional(), statuses: z .preprocess( (it: unknown) => (Array.isArray(it) || it === undefined ? it : [it]), @@ -68,13 +68,13 @@ export const _GET = }, } - const { status, body } = await implementation(input, responder, request) + const {status, body} = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { throw KoaRuntimeError.HandlerError(err) }) return body !== undefined - ? Response.json(body, { status }) - : new Response(undefined, { status }) + ? Response.json(body, {status}) + : new Response(undefined, {status}) } diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/schemas.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/schemas.ts index dd11359eb..241573572 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/schemas.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/schemas.ts @@ -2,9 +2,9 @@ /* tslint:disable */ /* eslint-disable */ -import { z } from "zod" +import {z} from "zod" -export const s_CreateUpdateTodoList = z.object({ name: z.string() }) +export const s_CreateUpdateTodoList = z.object({name: z.string()}) export const s_Error = z.object({ message: z.string().optional(), @@ -18,8 +18,8 @@ export const s_TodoList = z.object({ name: z.string(), totalItemCount: z.coerce.number(), incompleteItemCount: z.coerce.number(), - created: z.string().datetime({ offset: true }), - updated: z.string().datetime({ offset: true }), + created: z.string().datetime({offset: true}), + updated: z.string().datetime({offset: true}), }) export const s_UnknownObject = z.record(z.unknown()) From e92d1bb543a0af94188ed0cdc926d12de1a71fb5 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sat, 5 Jul 2025 13:19:15 +0100 Subject: [PATCH 09/22] fix: use fs adaptor --- .../src/templates.types.ts | 2 + .../typescript-nextjs.generator.ts | 51 ++++++++++++------- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/packages/openapi-code-generator/src/templates.types.ts b/packages/openapi-code-generator/src/templates.types.ts index 1832e0889..cc2631050 100644 --- a/packages/openapi-code-generator/src/templates.types.ts +++ b/packages/openapi-code-generator/src/templates.types.ts @@ -1,3 +1,4 @@ +import type {IFsAdaptor} from "./core/file-system/fs-adaptor" import type {Input, OperationGroupStrategy} from "./core/input" import type {CompilerOptions} from "./core/loaders/tsconfig.loader" import type {SyntheticNameGenerator} from "./core/synthetic-name-generator" @@ -21,6 +22,7 @@ export interface OpenapiGeneratorConfig { enableTypedBasePaths: boolean groupingStrategy: OperationGroupStrategy filenameConvention: IdentifierConvention + fsAdaptor: IFsAdaptor } export interface OpenapiTypescriptGeneratorConfig diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts index 4e9a77a12..966b0d6ce 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts @@ -1,8 +1,7 @@ // biome-ignore lint/style/useNodejsImportProtocol: -import fs from "fs" -// biome-ignore lint/style/useNodejsImportProtocol: import path from "path" -import {Project} from "ts-morph" +import {Project, type SourceFile} from "ts-morph" +import type {IFsAdaptor} from "../../../core/file-system/fs-adaptor" import type {CompilerOptions} from "../../../core/loaders/tsconfig.loader" import {isTruthy} from "../../../core/utils" import type {OpenapiTypescriptGeneratorConfig} from "../../../templates.types" @@ -41,6 +40,7 @@ export async function generateTypescriptNextJS( const appDirectory = [".", "app", subDirectory] .filter(isTruthy) .join(path.sep) + const generatedDirectory = [".", "generated", subDirectory] .filter(isTruthy) .join(path.sep) @@ -85,23 +85,12 @@ export async function generateTypescriptNextJS( routeToNextJSFilepath(group.name), ) - const existing = fs.existsSync( - path.join(emitter.config.destinationDirectory, nextJsAppRouterPath), - ) - ? fs - .readFileSync( - path.join( - emitter.config.destinationDirectory, - nextJsAppRouterPath, - ), - "utf-8", - ) - .toString() - : "" - const sourceFile = project.createSourceFile( + const sourceFile = await loadExistingRouteImplementation({ + fsAdaptor: config.fsAdaptor, + project, + destinationDirectory: emitter.config.destinationDirectory, nextJsAppRouterPath, - existing, - ) + }) const nextJSAppRouterBuilder = new TypescriptNextjsAppRouterBuilder( nextJsAppRouterPath, @@ -158,6 +147,30 @@ export async function generateTypescriptNextJS( ]) } +async function loadExistingRouteImplementation({ + fsAdaptor, + project, + destinationDirectory, + nextJsAppRouterPath, +}: { + fsAdaptor: IFsAdaptor + project: Project + destinationDirectory: string + nextJsAppRouterPath: string +}): Promise { + const exists = await fsAdaptor.exists( + path.join(destinationDirectory, nextJsAppRouterPath), + ) + + const source = exists + ? await fsAdaptor.readFile( + path.join(destinationDirectory, nextJsAppRouterPath), + ) + : "" + + return project.createSourceFile(nextJsAppRouterPath, source) +} + function routeToNextJSFilepath(route: string): string { const parts = route .split("/") From 4ed4a942d95a86d3016e7db080729f2b5cd9806b Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sat, 5 Jul 2025 13:34:07 +0100 Subject: [PATCH 10/22] chore: upgrade ts-morph --- packages/openapi-code-generator/package.json | 2 +- .../server/typescript-nextjs/typescript-nextjs.generator.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/openapi-code-generator/package.json b/packages/openapi-code-generator/package.json index 576c39b63..75159a617 100644 --- a/packages/openapi-code-generator/package.json +++ b/packages/openapi-code-generator/package.json @@ -74,7 +74,7 @@ "js-yaml": "^4.1.0", "json5": "^2.2.3", "lodash": "^4.17.21", - "ts-morph": "^22.0.0", + "ts-morph": "^26.0.0", "tslib": "^2.8.1", "typescript": "^5.9.3", "zod": "^3.25.74" diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts index 966b0d6ce..6f5975bf1 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts @@ -59,7 +59,7 @@ export async function generateTypescriptNextJS( {allowAny}, ) - const project = new Project() + const project = new Project({useInMemoryFileSystem: true}) const serverRouters = ( await Promise.all( From 9389c69ab5d1d35399b8db90ad42981b3a22bda7 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sat, 5 Jul 2025 13:58:14 +0100 Subject: [PATCH 11/22] fix: sort imports --- .../typescript-nextjs/typescript-nextjs-app-router-builder.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts index 6f87642c3..9b476fbfc 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts @@ -132,7 +132,9 @@ export class TypescriptNextjsAppRouterBuilder implements ICompilable { .forEach((it) => it.remove()) this.sourceFile.addImportDeclaration({ - namedImports: Array.from(this.httpMethodsUsed).map((it) => `_${it}`), + namedImports: Array.from(this.httpMethodsUsed) + .map((it) => `_${it}`) + .sort(), moduleSpecifier: from, }) From cf85c8dd50b5a61f3feb3ea30eda63fc3f466f36 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sat, 5 Jul 2025 14:15:14 +0100 Subject: [PATCH 12/22] feat: nextjs runtime package --- .../typescript-nextjs/package.json | 1 + .../todo-lists.yaml/attachments/route.ts | 37 +++++---- .../list/[listId]/items/route.ts | 41 +++++----- .../todo-lists.yaml/list/[listId]/route.ts | 73 +++++++++-------- .../generated/todo-lists.yaml/list/route.ts | 25 +++--- .../typescript-nextjs-router-builder.ts | 31 ++++--- packages/typescript-nextjs-runtime/README.md | 10 +++ .../typescript-nextjs-runtime/jest.config.js | 12 +++ .../typescript-nextjs-runtime/package.json | 82 +++++++++++++++++++ .../typescript-nextjs-runtime/src/errors.ts | 50 +++++++++++ packages/typescript-nextjs-runtime/src/joi.ts | 80 ++++++++++++++++++ .../typescript-nextjs-runtime/src/server.ts | 62 ++++++++++++++ packages/typescript-nextjs-runtime/src/zod.ts | 56 +++++++++++++ .../typescript-nextjs-runtime/tsconfig.json | 9 ++ tsconfig.json | 3 +- 15 files changed, 468 insertions(+), 104 deletions(-) create mode 100644 packages/typescript-nextjs-runtime/README.md create mode 100644 packages/typescript-nextjs-runtime/jest.config.js create mode 100644 packages/typescript-nextjs-runtime/package.json create mode 100644 packages/typescript-nextjs-runtime/src/errors.ts create mode 100644 packages/typescript-nextjs-runtime/src/joi.ts create mode 100644 packages/typescript-nextjs-runtime/src/server.ts create mode 100644 packages/typescript-nextjs-runtime/src/zod.ts create mode 100644 packages/typescript-nextjs-runtime/tsconfig.json diff --git a/integration-tests/typescript-nextjs/package.json b/integration-tests/typescript-nextjs/package.json index e54039bad..8a24950c8 100644 --- a/integration-tests/typescript-nextjs/package.json +++ b/integration-tests/typescript-nextjs/package.json @@ -11,6 +11,7 @@ "validate": "tsc -p ./tsconfig.json" }, "dependencies": { + "@nahkies/typescript-nextjs-runtime": "*", "next": "^15.3.5", "react": "^19.1.0", "react-dom": "^19.1.0" diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts index 184c1a860..d0636f656 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts @@ -4,37 +4,38 @@ import {t_UnknownObject, t_UploadAttachmentBodySchema} from "../models" import { - KoaRuntimeError, + OpenAPIRuntimeError, RequestInputType, -} from "@nahkies/typescript-koa-runtime/errors" +} from "@nahkies/typescript-nextjs-runtime/errors" import { - KoaRuntimeResponder, - KoaRuntimeResponse, + OpenAPIRuntimeResponder, + OpenAPIRuntimeResponse, + Params, StatusCode, -} from "@nahkies/typescript-koa-runtime/server" -import {Params, parseRequestInput} from "@nahkies/typescript-koa-runtime/zod" +} from "@nahkies/typescript-nextjs-runtime/server" +import {parseRequestInput} from "@nahkies/typescript-nextjs-runtime/zod" import {NextRequest} from "next/server" import {z} from "zod" // /attachments export type ListAttachmentsResponder = { - with200(): KoaRuntimeResponse -} & KoaRuntimeResponder + with200(): OpenAPIRuntimeResponse +} & OpenAPIRuntimeResponder export type ListAttachments = ( respond: ListAttachmentsResponder, request: NextRequest, -) => Promise> +) => Promise> export type UploadAttachmentResponder = { - with202(): KoaRuntimeResponse -} & KoaRuntimeResponder + with202(): OpenAPIRuntimeResponse +} & OpenAPIRuntimeResponder export type UploadAttachment = ( params: Params, respond: UploadAttachmentResponder, request: NextRequest, -) => Promise> +) => Promise> export const _GET = (implementation: ListAttachments) => @@ -49,17 +50,17 @@ export const _GET = const responder = { with200() { - return new KoaRuntimeResponse(200) + return new OpenAPIRuntimeResponse(200) }, withStatus(status: StatusCode) { - return new KoaRuntimeResponse(status) + return new OpenAPIRuntimeResponse(status) }, } const {status, body} = await implementation(responder, request) .then((it) => it.unpack()) .catch((err) => { - throw KoaRuntimeError.HandlerError(err) + throw OpenAPIRuntimeError.HandlerError(err) }) return body !== undefined @@ -86,17 +87,17 @@ export const _POST = const responder = { with202() { - return new KoaRuntimeResponse(202) + return new OpenAPIRuntimeResponse(202) }, withStatus(status: StatusCode) { - return new KoaRuntimeResponse(status) + return new OpenAPIRuntimeResponse(status) }, } const {status, body} = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { - throw KoaRuntimeError.HandlerError(err) + throw OpenAPIRuntimeError.HandlerError(err) }) return body !== undefined diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts index 3c2393ce0..1e15413f1 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts @@ -8,42 +8,43 @@ import { t_GetTodoListItemsParamSchema, } from "../../../models" import { - KoaRuntimeError, + OpenAPIRuntimeError, RequestInputType, -} from "@nahkies/typescript-koa-runtime/errors" +} from "@nahkies/typescript-nextjs-runtime/errors" import { - KoaRuntimeResponder, - KoaRuntimeResponse, + OpenAPIRuntimeResponder, + OpenAPIRuntimeResponse, + Params, StatusCode, StatusCode5xx, -} from "@nahkies/typescript-koa-runtime/server" -import {Params, parseRequestInput} from "@nahkies/typescript-koa-runtime/zod" +} from "@nahkies/typescript-nextjs-runtime/server" +import {parseRequestInput} from "@nahkies/typescript-nextjs-runtime/zod" import {NextRequest} from "next/server" import {z} from "zod" // /list/{listId}/items export type GetTodoListItemsResponder = { - with200(): KoaRuntimeResponse<{ + with200(): OpenAPIRuntimeResponse<{ completedAt?: string content: string createdAt: string id: string }> - withStatusCode5xx(status: StatusCode5xx): KoaRuntimeResponse<{ + withStatusCode5xx(status: StatusCode5xx): OpenAPIRuntimeResponse<{ code: string message: string }> -} & KoaRuntimeResponder +} & OpenAPIRuntimeResponder export type GetTodoListItems = ( params: Params, respond: GetTodoListItemsResponder, request: NextRequest, -) => Promise> +) => Promise> export type CreateTodoListItemResponder = { - with204(): KoaRuntimeResponse -} & KoaRuntimeResponder + with204(): OpenAPIRuntimeResponse +} & OpenAPIRuntimeResponder export type CreateTodoListItem = ( params: Params< @@ -54,7 +55,7 @@ export type CreateTodoListItem = ( >, respond: CreateTodoListItemResponder, request: NextRequest, -) => Promise> +) => Promise> const getTodoListItemsParamSchema = z.object({listId: z.string()}) @@ -78,7 +79,7 @@ export const _GET = const responder = { with200() { - return new KoaRuntimeResponse<{ + return new OpenAPIRuntimeResponse<{ completedAt?: string content: string createdAt: string @@ -86,20 +87,20 @@ export const _GET = }>(200) }, withStatusCode5xx(status: StatusCode5xx) { - return new KoaRuntimeResponse<{ + return new OpenAPIRuntimeResponse<{ code: string message: string }>(status) }, withStatus(status: StatusCode) { - return new KoaRuntimeResponse(status) + return new OpenAPIRuntimeResponse(status) }, } const {status, body} = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { - throw KoaRuntimeError.HandlerError(err) + throw OpenAPIRuntimeError.HandlerError(err) }) return body !== undefined @@ -139,17 +140,17 @@ export const _POST = const responder = { with204() { - return new KoaRuntimeResponse(204) + return new OpenAPIRuntimeResponse(204) }, withStatus(status: StatusCode) { - return new KoaRuntimeResponse(status) + return new OpenAPIRuntimeResponse(status) }, } const {status, body} = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { - throw KoaRuntimeError.HandlerError(err) + throw OpenAPIRuntimeError.HandlerError(err) }) return body !== undefined diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts index a814e4e35..5fed57e82 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts @@ -12,37 +12,38 @@ import { } from "../../models" import {s_CreateUpdateTodoList} from "../../schemas" import { - KoaRuntimeError, + OpenAPIRuntimeError, RequestInputType, -} from "@nahkies/typescript-koa-runtime/errors" +} from "@nahkies/typescript-nextjs-runtime/errors" import { - KoaRuntimeResponder, - KoaRuntimeResponse, + OpenAPIRuntimeResponder, + OpenAPIRuntimeResponse, + Params, StatusCode, StatusCode4xx, -} from "@nahkies/typescript-koa-runtime/server" -import {Params, parseRequestInput} from "@nahkies/typescript-koa-runtime/zod" +} from "@nahkies/typescript-nextjs-runtime/server" +import {parseRequestInput} from "@nahkies/typescript-nextjs-runtime/zod" import {NextRequest} from "next/server" import {z} from "zod" // /list/{listId} export type GetTodoListByIdResponder = { - with200(): KoaRuntimeResponse - withStatusCode4xx(status: StatusCode4xx): KoaRuntimeResponse - withDefault(status: StatusCode): KoaRuntimeResponse -} & KoaRuntimeResponder + with200(): OpenAPIRuntimeResponse + withStatusCode4xx(status: StatusCode4xx): OpenAPIRuntimeResponse + withDefault(status: StatusCode): OpenAPIRuntimeResponse +} & OpenAPIRuntimeResponder export type GetTodoListById = ( params: Params, respond: GetTodoListByIdResponder, request: NextRequest, -) => Promise> +) => Promise> export type UpdateTodoListByIdResponder = { - with200(): KoaRuntimeResponse - withStatusCode4xx(status: StatusCode4xx): KoaRuntimeResponse - withDefault(status: StatusCode): KoaRuntimeResponse -} & KoaRuntimeResponder + with200(): OpenAPIRuntimeResponse + withStatusCode4xx(status: StatusCode4xx): OpenAPIRuntimeResponse + withDefault(status: StatusCode): OpenAPIRuntimeResponse +} & OpenAPIRuntimeResponder export type UpdateTodoListById = ( params: Params< @@ -53,19 +54,19 @@ export type UpdateTodoListById = ( >, respond: UpdateTodoListByIdResponder, request: NextRequest, -) => Promise> +) => Promise> export type DeleteTodoListByIdResponder = { - with204(): KoaRuntimeResponse - withStatusCode4xx(status: StatusCode4xx): KoaRuntimeResponse - withDefault(status: StatusCode): KoaRuntimeResponse -} & KoaRuntimeResponder + with204(): OpenAPIRuntimeResponse + withStatusCode4xx(status: StatusCode4xx): OpenAPIRuntimeResponse + withDefault(status: StatusCode): OpenAPIRuntimeResponse +} & OpenAPIRuntimeResponder export type DeleteTodoListById = ( params: Params, respond: DeleteTodoListByIdResponder, request: NextRequest, -) => Promise> +) => Promise> const getTodoListByIdParamSchema = z.object({listId: z.string()}) @@ -89,23 +90,23 @@ export const _GET = const responder = { with200() { - return new KoaRuntimeResponse(200) + return new OpenAPIRuntimeResponse(200) }, withStatusCode4xx(status: StatusCode4xx) { - return new KoaRuntimeResponse(status) + return new OpenAPIRuntimeResponse(status) }, withDefault(status: StatusCode) { - return new KoaRuntimeResponse(status) + return new OpenAPIRuntimeResponse(status) }, withStatus(status: StatusCode) { - return new KoaRuntimeResponse(status) + return new OpenAPIRuntimeResponse(status) }, } const {status, body} = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { - throw KoaRuntimeError.HandlerError(err) + throw OpenAPIRuntimeError.HandlerError(err) }) return body !== undefined @@ -141,23 +142,23 @@ export const _PUT = const responder = { with200() { - return new KoaRuntimeResponse(200) + return new OpenAPIRuntimeResponse(200) }, withStatusCode4xx(status: StatusCode4xx) { - return new KoaRuntimeResponse(status) + return new OpenAPIRuntimeResponse(status) }, withDefault(status: StatusCode) { - return new KoaRuntimeResponse(status) + return new OpenAPIRuntimeResponse(status) }, withStatus(status: StatusCode) { - return new KoaRuntimeResponse(status) + return new OpenAPIRuntimeResponse(status) }, } const {status, body} = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { - throw KoaRuntimeError.HandlerError(err) + throw OpenAPIRuntimeError.HandlerError(err) }) return body !== undefined @@ -187,23 +188,23 @@ export const _DELETE = const responder = { with204() { - return new KoaRuntimeResponse(204) + return new OpenAPIRuntimeResponse(204) }, withStatusCode4xx(status: StatusCode4xx) { - return new KoaRuntimeResponse(status) + return new OpenAPIRuntimeResponse(status) }, withDefault(status: StatusCode) { - return new KoaRuntimeResponse(status) + return new OpenAPIRuntimeResponse(status) }, withStatus(status: StatusCode) { - return new KoaRuntimeResponse(status) + return new OpenAPIRuntimeResponse(status) }, } const {status, body} = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { - throw KoaRuntimeError.HandlerError(err) + throw OpenAPIRuntimeError.HandlerError(err) }) return body !== undefined diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts index fcc18aa45..40d6da0b7 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts @@ -5,28 +5,29 @@ import {t_GetTodoListsQuerySchema, t_TodoList} from "../models" import {s_Statuses} from "../schemas" import { - KoaRuntimeError, + OpenAPIRuntimeError, RequestInputType, -} from "@nahkies/typescript-koa-runtime/errors" +} from "@nahkies/typescript-nextjs-runtime/errors" import { - KoaRuntimeResponder, - KoaRuntimeResponse, + OpenAPIRuntimeResponder, + OpenAPIRuntimeResponse, + Params, StatusCode, -} from "@nahkies/typescript-koa-runtime/server" -import {Params, parseRequestInput} from "@nahkies/typescript-koa-runtime/zod" +} from "@nahkies/typescript-nextjs-runtime/server" +import {parseRequestInput} from "@nahkies/typescript-nextjs-runtime/zod" import {NextRequest} from "next/server" import {z} from "zod" // /list export type GetTodoListsResponder = { - with200(): KoaRuntimeResponse -} & KoaRuntimeResponder + with200(): OpenAPIRuntimeResponse +} & OpenAPIRuntimeResponder export type GetTodoLists = ( params: Params, respond: GetTodoListsResponder, request: NextRequest, -) => Promise> +) => Promise> const getTodoListsQuerySchema = z.object({ created: z.string().datetime({offset: true}).optional(), @@ -61,17 +62,17 @@ export const _GET = const responder = { with200() { - return new KoaRuntimeResponse(200) + return new OpenAPIRuntimeResponse(200) }, withStatus(status: StatusCode) { - return new KoaRuntimeResponse(status) + return new OpenAPIRuntimeResponse(status) }, } const {status, body} = await implementation(input, responder, request) .then((it) => it.unpack()) .catch((err) => { - throw KoaRuntimeError.HandlerError(err) + throw OpenAPIRuntimeError.HandlerError(err) }) return body !== undefined diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts index aaacdce87..f05e79b2e 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts @@ -32,14 +32,12 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { } protected buildImports(): void { - // todo: unsure why, but adding an export at `.` of index.ts doesn't work properly this.imports - .from("@nahkies/typescript-koa-runtime/server") + .from("@nahkies/typescript-nextjs-runtime/server") .add( - "startServer", - "ServerConfig", - "KoaRuntimeResponse", - "KoaRuntimeResponder", + "OpenAPIRuntimeResponse", + "OpenAPIRuntimeResponder", + "Params", "StatusCode2xx", "StatusCode3xx", "StatusCode4xx", @@ -50,17 +48,17 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { this.imports.from("next/server").add("NextRequest", "NextResponse") this.imports - .from("@nahkies/typescript-koa-runtime/errors") - .add("KoaRuntimeError", "RequestInputType") + .from("@nahkies/typescript-nextjs-runtime/errors") + .add("OpenAPIRuntimeError", "RequestInputType") if (this.schemaBuilder instanceof ZodBuilder) { this.imports - .from("@nahkies/typescript-koa-runtime/zod") - .add("parseRequestInput", "Params", "responseValidationFactory") + .from("@nahkies/typescript-nextjs-runtime/zod") + .add("parseRequestInput", "responseValidationFactory") } else if (this.schemaBuilder instanceof JoiBuilder) { this.imports - .from("@nahkies/typescript-koa-runtime/joi") - .add("parseRequestInput", "Params", "responseValidationFactory") + .from("@nahkies/typescript-nextjs-runtime/joi") + .add("parseRequestInput", "responseValidationFactory") } } @@ -89,9 +87,8 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { const responseSchemas = builder.responseSchemas() const responder = builder.responder( - // TODO: nextjs types - "KoaRuntimeResponder", - "KoaRuntimeResponse", + "OpenAPIRuntimeResponder", + "OpenAPIRuntimeResponse", ) this.operationTypes.push({ @@ -110,7 +107,7 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { "request: NextRequest", ] .filter(isDefined) - .join(",")}) => Promise>`, + .join(",")}) => Promise>`, kind: "type", }), ], @@ -152,7 +149,7 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { body, } = await implementation(${[params.hasParams ? "input" : undefined, "responder", "request"].filter(isDefined).join(",")}) .then(it => it.unpack()) - .catch(err => { throw KoaRuntimeError.HandlerError(err) }) + .catch(err => { throw OpenAPIRuntimeError.HandlerError(err) }) return body !== undefined ? Response.json(body, {status}) : new Response(undefined, {status}) }`, diff --git a/packages/typescript-nextjs-runtime/README.md b/packages/typescript-nextjs-runtime/README.md new file mode 100644 index 000000000..483c37be5 --- /dev/null +++ b/packages/typescript-nextjs-runtime/README.md @@ -0,0 +1,10 @@ +# @nahkies/typescript-nextjs-runtime + +[![CI/CD](https://github.com/mnahkies/openapi-code-generator/actions/workflows/ci.yml/badge.svg)](https://github.com/mnahkies/openapi-code-generator/actions?query=branch%3Amain+event%3Apush) +[![npm](https://img.shields.io/npm/dm/%40nahkies%2Ftypescript-nextjs-runtime.svg)](https://www.npmjs.com/package/@nahkies/typescript-nextjs-runtime) + +This is a supporting package for code generated using [@nahkies/openapi-code-generator](https://www.npmjs.com/package/@nahkies/openapi-code-generator) using the Typescript NextJS server stubs template. + +You can [read the docs](https://openapi-code-generator.nahkies.co.nz/guides/server-templates/typescript-nextjs) to find out more! + +It's not intended by be used standalone. Similar in spirit to [tslib](https://www.npmjs.com/package/tslib) diff --git a/packages/typescript-nextjs-runtime/jest.config.js b/packages/typescript-nextjs-runtime/jest.config.js new file mode 100644 index 000000000..e4604b03a --- /dev/null +++ b/packages/typescript-nextjs-runtime/jest.config.js @@ -0,0 +1,12 @@ +const base = require("../../jest.base") +const {name: displayName} = require("./package.json") + +/** + * @type { import('@jest/types').Config.ProjectConfig } + */ +const config = { + ...base, + displayName, +} + +module.exports = config diff --git a/packages/typescript-nextjs-runtime/package.json b/packages/typescript-nextjs-runtime/package.json new file mode 100644 index 000000000..b4c35f7e4 --- /dev/null +++ b/packages/typescript-nextjs-runtime/package.json @@ -0,0 +1,82 @@ +{ + "name": "@nahkies/typescript-nextjs-runtime", + "version": "0.20.1", + "description": "Runtime package for code generated by @nahkies/openapi-code-generator using the typescript-nextjs template", + "license": "MIT", + "author": { + "name": "Michael Nahkies", + "email": "support@nahkies.co.nz" + }, + "homepage": "https://openapi-code-generator.nahkies.co.nz/", + "repository": { + "type": "git", + "url": "https://github.com/mnahkies/openapi-code-generator.git", + "directory": "packages/typescript-nextjs-runtime" + }, + "bugs": { + "url": "https://github.com/mnahkies/openapi-code-generator/issues" + }, + "exports": { + "./errors": { + "require": "./dist/errors.js", + "import": "./dist/errors.js", + "types": "./dist/errors.d.ts" + }, + "./server": { + "require": "./dist/server.js", + "import": "./dist/server.js", + "types": "./dist/server.d.ts" + }, + "./joi": { + "require": "./dist/joi.js", + "import": "./dist/joi.js", + "types": "./dist/joi.d.ts" + }, + "./zod": { + "require": "./dist/zod.js", + "import": "./dist/zod.js", + "types": "./dist/zod.d.ts" + } + }, + "scripts": { + "clean": "rm -rf ./dist && rm tsconfig.tsbuildinfo", + "build": "tsc -p ./tsconfig.json", + "test": "jest" + }, + "peerDependencies": { + "joi": "^17.1.1", + "next": "^15.3.5", + "zod": "^3.20.6" + }, + "peerDependenciesMeta": { + "joi": { + "optional": true + }, + "zod": { + "optional": true + } + }, + "devDependencies": { + "jest": "^30.0.4", + "joi": "^17.13.3", + "typescript": "~5.8.3", + "zod": "^3.25.74" + }, + "files": [ + "src", + "dist", + "README.md", + "CHANGELOG.md", + "tsconfig.json" + ], + "keywords": [ + "@nahkies/openapi-code-generator", + "runtime", + "typescript-nextjs", + "nextjs", + "zod" + ], + "publishConfig": { + "access": "public" + } +} diff --git a/packages/typescript-nextjs-runtime/src/errors.ts b/packages/typescript-nextjs-runtime/src/errors.ts new file mode 100644 index 000000000..4410ef1d5 --- /dev/null +++ b/packages/typescript-nextjs-runtime/src/errors.ts @@ -0,0 +1,50 @@ +export enum RequestInputType { + RouteParam = "route params", + QueryString = "querystring", + RequestBody = "request body", + RequestHeader = "request header", +} + +export class OpenAPIRuntimeError extends Error { + private constructor( + message: string, + cause: unknown, + public readonly phase: + | "request_validation" + | "request_handler" + | "response_validation", + ) { + super(message, {cause}) + } + + static RequestError( + cause: unknown, + inputType: RequestInputType, + ): OpenAPIRuntimeError { + return new OpenAPIRuntimeError( + `Request validation failed parsing ${inputType}`, + cause, + "request_validation", + ) + } + + static HandlerError(cause: unknown) { + return new OpenAPIRuntimeError( + "Request handler threw unhandled exception", + cause, + "request_handler", + ) + } + + static ResponseError(cause: unknown) { + return new OpenAPIRuntimeError( + "Response body failed validation", + cause, + "response_validation", + ) + } + + static isOpenAPIError(err: unknown): err is OpenAPIRuntimeError { + return err instanceof OpenAPIRuntimeError + } +} diff --git a/packages/typescript-nextjs-runtime/src/joi.ts b/packages/typescript-nextjs-runtime/src/joi.ts new file mode 100644 index 000000000..8cfb06d91 --- /dev/null +++ b/packages/typescript-nextjs-runtime/src/joi.ts @@ -0,0 +1,80 @@ +import type {Schema as JoiSchema} from "joi" +import {OpenAPIRuntimeError, type RequestInputType} from "./errors" + +// Note: joi types don't appear to have an equivalent of z.infer, +// hence any seems about as good as we can do here. +export function parseRequestInput( + schema: Schema, + input: unknown, + type: RequestInputType, + // biome-ignore lint/suspicious/noExplicitAny: +): any +export function parseRequestInput( + schema: undefined, + input: unknown, + type: RequestInputType, +): undefined +export function parseRequestInput( + schema: Schema | undefined, + input: unknown, + type: RequestInputType, + // biome-ignore lint/suspicious/noExplicitAny: +): any { + try { + if (!schema) { + return undefined + } + + const result = schema.validate(input, {stripUnknown: true}) + + if (result.error) { + throw result.error + } + + return result.value + } catch (err) { + throw OpenAPIRuntimeError.RequestError(err, type) + } +} + +export function responseValidationFactory( + possibleResponses: [string, JoiSchema][], + defaultResponse?: JoiSchema, +) { + // Exploit the natural ordering matching the desired specificity of eg: 404 vs 4xx + possibleResponses.sort((x, y) => (x[0] < y[0] ? -1 : 1)) + + return (status: number, value: unknown) => { + try { + for (const [match, schema] of possibleResponses) { + const isMatch = + (/^\d+$/.test(match) && String(status) === match) || + (/^\d[xX]{2}$/.test(match) && String(status)[0] === match[0]) + + if (isMatch) { + const result = schema.validate(value) + + if (result.error) { + throw result.error + } + + return result.value + } + } + + if (defaultResponse) { + const result = defaultResponse.validate(value) + + if (result.error) { + throw result.error + } + + return result.value + } + + return value + } catch (err) { + throw OpenAPIRuntimeError.ResponseError(err) + } + } +} diff --git a/packages/typescript-nextjs-runtime/src/server.ts b/packages/typescript-nextjs-runtime/src/server.ts new file mode 100644 index 000000000..3a9c01860 --- /dev/null +++ b/packages/typescript-nextjs-runtime/src/server.ts @@ -0,0 +1,62 @@ +// from https://stackoverflow.com/questions/39494689/is-it-possible-to-restrict-number-to-a-certain-range +type Enumerate< + N extends number, + Acc extends number[] = [], +> = Acc["length"] extends N + ? Acc[number] + : Enumerate + +type IntRange = F extends T + ? F + : Exclude, Enumerate> extends never + ? never + : Exclude, Enumerate> | T + +export type StatusCode1xx = IntRange<100, 199> // `1${number}${number}` +export type StatusCode2xx = IntRange<200, 299> // `2${number}${number}` +export type StatusCode3xx = IntRange<300, 399> // `3${number}${number}` +export type StatusCode4xx = IntRange<400, 499> // `4${number}${number}` +export type StatusCode5xx = IntRange<500, 599> // `5${number}${number}` +export type StatusCode = + | StatusCode1xx + | StatusCode2xx + | StatusCode3xx + | StatusCode4xx + | StatusCode5xx + +export type Response = { + status: Status + body: Type +} + +export const SkipResponse = Symbol("skip response processing") + +export class OpenAPIRuntimeResponse { + private _body?: Type + + constructor(private readonly status: StatusCode) {} + + body(body: Type): this { + this._body = body + return this + } + + unpack(): Response { + return {status: this.status, body: this._body} + } +} + +export type OpenAPIRuntimeResponder< + Status extends StatusCode = StatusCode, + // biome-ignore lint/suspicious/noExplicitAny: + Type = any, +> = { + withStatus: (status: Status) => OpenAPIRuntimeResponse +} + +export type Params = { + params: Params + query: Query + body: Body + headers: Header +} diff --git a/packages/typescript-nextjs-runtime/src/zod.ts b/packages/typescript-nextjs-runtime/src/zod.ts new file mode 100644 index 000000000..76dac8251 --- /dev/null +++ b/packages/typescript-nextjs-runtime/src/zod.ts @@ -0,0 +1,56 @@ +import type {z} from "zod" +import {OpenAPIRuntimeError, type RequestInputType} from "./errors" + +export function parseRequestInput( + schema: Schema, + input: unknown, + type: RequestInputType, +): z.infer +export function parseRequestInput( + schema: undefined, + input: unknown, + type: RequestInputType, +): undefined +export function parseRequestInput( + schema: Schema | undefined, + input: unknown, + type: RequestInputType, +): z.infer | undefined { + try { + return schema?.parse(input) + } catch (err) { + throw OpenAPIRuntimeError.RequestError(err, type) + } +} + +// TODO: optional response validation +export function responseValidationFactory( + possibleResponses: [string, z.ZodTypeAny][], + defaultResponse?: z.ZodTypeAny, +) { + // Exploit the natural ordering matching the desired specificity of eg: 404 vs 4xx + possibleResponses.sort((x, y) => (x[0] < y[0] ? -1 : 1)) + + return (status: number, value: unknown) => { + try { + for (const [match, schema] of possibleResponses) { + const isMatch = + (/^\d+$/.test(match) && String(status) === match) || + (/^\d[xX]{2}$/.test(match) && String(status)[0] === match[0]) + + if (isMatch) { + return schema.parse(value) + } + } + + if (defaultResponse) { + return defaultResponse.parse(value) + } + + // TODO: throw on unmatched response + return value + } catch (err) { + throw OpenAPIRuntimeError.ResponseError(err) + } + } +} diff --git a/packages/typescript-nextjs-runtime/tsconfig.json b/packages/typescript-nextjs-runtime/tsconfig.json new file mode 100644 index 000000000..76e65dcfb --- /dev/null +++ b/packages/typescript-nextjs-runtime/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src" + }, + "include": ["src/**/*"], + "references": [] +} diff --git a/tsconfig.json b/tsconfig.json index 4d2528718..d90c713b0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,7 @@ { "path": "./packages/typescript-axios-runtime" }, { "path": "./packages/typescript-express-runtime" }, { "path": "./packages/typescript-fetch-runtime" }, - { "path": "./packages/typescript-koa-runtime" } + { "path": "./packages/typescript-koa-runtime" }, + { "path": "./packages/typescript-nextjs-runtime" } ] } From 45a9490f5e7231c14fe0576affe331df4026faf9 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sat, 5 Jul 2025 15:12:01 +0100 Subject: [PATCH 13/22] feat: wip documentation --- .../app/todo-lists.yaml/attachments/route.ts | 4 +- .../list/[listId]/items/route.ts | 4 +- .../todo-lists.yaml/list/[listId]/route.ts | 6 +- .../src/app/todo-lists.yaml/list/route.ts | 2 +- .../typescript-nextjs/page.mdx | 173 ++++++++++++++++++ .../typescript-nextjs-app-router-builder.ts | 2 +- .../typescript-nextjs.generator.ts | 4 +- 7 files changed, 183 insertions(+), 12 deletions(-) create mode 100644 packages/documentation/src/app/guides/server-templates/typescript-nextjs/page.mdx diff --git a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts index 17adde126..1941329f7 100644 --- a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts +++ b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts @@ -1,10 +1,10 @@ import {_GET, _POST} from "../../../generated/todo-lists.yaml/attachments/route" -export const GET = _GET(async (respond, context) => { +export const GET = _GET(async (respond, request) => { // TODO: implementation return respond.withStatus(501).body({message: "not implemented"} as any) }) -export const POST = _POST(async ({body}, respond, context) => { +export const POST = _POST(async ({body}, respond, request) => { // TODO: implementation return respond.withStatus(501).body({message: "not implemented"} as any) }) diff --git a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/items/route.ts b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/items/route.ts index b3d877530..002c82e4b 100644 --- a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/items/route.ts +++ b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/items/route.ts @@ -3,11 +3,11 @@ import { _POST, } from "../../../../../generated/todo-lists.yaml/list/[listId]/items/route" -export const GET = _GET(async ({params}, respond, context) => { +export const GET = _GET(async ({params}, respond, request) => { // TODO: implementation return respond.withStatus(501).body({message: "not implemented"} as any) }) -export const POST = _POST(async ({params, body}, respond, context) => { +export const POST = _POST(async ({params, body}, respond, request) => { // TODO: implementation return respond.withStatus(501).body({message: "not implemented"} as any) }) diff --git a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/route.ts b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/route.ts index d9fa40af0..e305d93de 100644 --- a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/route.ts +++ b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/route.ts @@ -4,15 +4,15 @@ import { _PUT, } from "../../../../generated/todo-lists.yaml/list/[listId]/route" -export const GET = _GET(async ({params}, respond, context) => { +export const GET = _GET(async ({params}, respond, request) => { // TODO: implementation return respond.withStatus(501).body({message: "not implemented"} as any) }) -export const PUT = _PUT(async ({params, body}, respond, context) => { +export const PUT = _PUT(async ({params, body}, respond, request) => { // TODO: implementation return respond.withStatus(501).body({message: "not implemented"} as any) }) -export const DELETE = _DELETE(async ({params}, respond, context) => { +export const DELETE = _DELETE(async ({params}, respond, request) => { // TODO: implementation return respond.withStatus(501).body({message: "not implemented"} as any) }) diff --git a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/route.ts b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/route.ts index 84539220c..1eeb847f0 100644 --- a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/route.ts +++ b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/route.ts @@ -1,6 +1,6 @@ import {_GET} from "../../../generated/todo-lists.yaml/list/route" -export const GET = _GET(async ({query}, respond, context) => { +export const GET = _GET(async ({query}, respond, request) => { // TODO: implementation return respond.withStatus(501).body({message: "not implemented"} as any) }) diff --git a/packages/documentation/src/app/guides/server-templates/typescript-nextjs/page.mdx b/packages/documentation/src/app/guides/server-templates/typescript-nextjs/page.mdx new file mode 100644 index 000000000..836fb5cf0 --- /dev/null +++ b/packages/documentation/src/app/guides/server-templates/typescript-nextjs/page.mdx @@ -0,0 +1,173 @@ +import {Tabs} from 'nextra/components' + +# Using the `typescript-nextjs` template + +> ⚠️ **Alpha Template** ⚠️ +> +> This template is currently in **alpha**. APIs and features are subject to change.
+> It might break in unexpected ways, or **mangle** your code. +> +> You can see an example of it used on a real project here:
+> https://github.com/mnahkies/spdx-dependency-track + + +The `typescript-nextjs` template outputs scaffolding code that handles the following: + +- Generates route handlers in the Next.js App Router (app/api/.../route.ts) for every operation in your OpenAPI spec +- Parses and validates request input (query, params, headers, and body) using `zod`, or `joi` +- Validates response types at runtime before sending them, ensuring they conform to your OpenAPI spec +- Enforces full type safety for each handler’s inputs and outputs +- Additionally, emits a [typescript-fetch](../client-templates/typescript-fetch) client for making requests to the routes from your react code + +See [integration-tests/typescript-nextjs](https://github.com/mnahkies/openapi-code-generator/tree/main/integration-tests/typescript-nextjs) for more samples. + +### Install dependencies +First install the CLI and the required runtime packages to your project: +```sh npm2yarn +npm i --dev @nahkies/openapi-code-generator +npm i @nahkies/typescript-nextjs-runtime next zod +``` + +See also [quick start](../../getting-started/quick-start) guide + +### Run generation + + + + ```sh npm2yarn + npm run openapi-code-generator \ + --input ./openapi.yaml \ + --input-type openapi3 \ + --output ./src \ + --template typescript-nextjs \ + --schema-builder zod + ``` + + + ```sh npm2yarn + npm run openapi-code-generator \ + --input ./typespec.tsp \ + --input-type typespec \ + --output ./src \ + --template typescript-nextjs \ + --schema-builder zod + ``` + + + + +### Using the generated code +Running the above will output a bunch of files into `./src`. Here's an example of the files output for a todo-list api specification: +```shell +src +├── app +│ ├── api +│ │ └── list +│ │ ├── [listId] +│ │ │ ├── items +│ │ │ │ └── route.ts +│ │ │ └── route.ts +│ │ └── route.ts +│ ├── layout.tsx +│ └── page.tsx +└── generated + ├── api + │ └── list + │ ├── [listId] + │ │ ├── items + │ │ │ └── route.ts + │ │ └── route.ts + │ └── route.ts + ├── client.ts + ├── models.ts + └── schemas.ts +```` + +`./src/app/../route.ts` +- a `route.ts` file is generated per operation, following Next.js App Router conventions +- exports handlers (GET, POST, etc.) for each HTTP method defined +- safe to edit, your route handler implementations go here +- calls into `./src/generated/...` for input/output validation logic + +`./src/generated/../route.ts` +- mirror structure of the `./src/app/.../route.ts` files +- contains glue code that parses input, validates responses, and calls your implementation + +`./src/generated/models.ts` +- exports plain TypeScript types for all schemas in your OpenAPI spec + +`./src/generated/schemas.ts` +- exports runtime schema validators (`zod` / `joi` depending on configuration) + +`./src/generated/client.ts` +- exports a [typescript-fetch](../client-templates/typescript-fetch) client for calling your API from frontend code +- see [use-with-react-query](../use-with-react-query) for integration with `react-query` + +#### Implementing routes + +Once generated usage should look something like this: + +```typescript +import {db} from "../../../../../db" +import { + _GET, + _POST, +} from "../../../../../generated/todo-lists.yaml/list/[listId]/items/route" + +export const GET = _GET(async ({params}, respond, request) => { + const items = db.getTodoItems({listId: params.listId}) + + if (items) { + return respond.with200().body(items) + } + return respond + .with404() + .body({code: "not-found", message: `listId ${params.listId} not found`}) +}) + +export const POST = _POST(async ({params, body}, respond, request) => { + await db.insertTodoItem({ + listId: params.listId, + itemId: body.id, + content: body.content, + completedAt: body.completedAt, + }) + + return respond.with204() +}) + +``` + +#### Its safe to regenerate! +The template uses [ts-morph](https://ts-morph.com/) to **non-destructively generate and update** route.ts files. + +This means you can safely add your own logic to the scaffolded files, and future regenerations will preserve your +implementation code while updating the generated boilerplate. + +#### Error Handling + +> 🚧 Under construction +> +> Errors will be thrown for req/res validation issues, but currently its impossible to catch them. +> More thought is needed... + +### Escape Hatches + +> 🚧 Under construction +> +> The raw nextjs `request` object is passed to your implementation, however there is not yet +> a way to skip response processing. + +Most APIs won't need this, but in some cases (e.g. unsupported features), you can use escape hatches to drop out of +the generated scaffolding. + +For example, we pass the raw nextjs `request` object to your handler implementations, +allowing you full control where its needed. +```typescript +export const GET = _GET(async ({params}, respond, request) => { + console.log(request.nextUrl.buildId) + // ...your implementation here +}) +``` + +Use sparingly - the goal is to reduce the need for escape hatches over time. diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts index 9b476fbfc..0d0e76026 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts @@ -98,7 +98,7 @@ export class TypescriptNextjsAppRouterBuilder implements ICompilable { } innerFunction?.addParameter({name: "respond"}) - innerFunction?.addParameter({name: "context"}) + innerFunction?.addParameter({name: "request"}) } // TODO: duplication - should be shared with router builder diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts index 6f5975bf1..2cac55d49 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts @@ -116,9 +116,7 @@ export async function generateTypescriptNextJS( ) ).flat() - const clientOutputPath = [generatedDirectory, "clients", "client.ts"].join( - path.sep, - ) + const clientOutputPath = [generatedDirectory, "client.ts"].join(path.sep) const clientImportBuilder = new ImportBuilder( {filename: clientOutputPath}, importAlias, From 71119f7b81c7568a4df5f6868bb35c9e8ef7bc08 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sat, 5 Jul 2025 15:50:21 +0100 Subject: [PATCH 14/22] feat: onError handler --- .../app/todo-lists.yaml/attachments/route.ts | 32 ++- .../list/[listId]/items/route.ts | 32 ++- .../todo-lists.yaml/list/[listId]/route.ts | 48 +++- .../src/app/todo-lists.yaml/list/route.ts | 16 +- .../todo-lists.yaml/attachments/route.ts | 118 +++++---- .../todo-lists.yaml/{clients => }/client.ts | 2 +- .../list/[listId]/items/route.ts | 164 ++++++------ .../todo-lists.yaml/list/[listId]/route.ts | 245 ++++++++++-------- .../generated/todo-lists.yaml/list/route.ts | 63 +++-- .../typescript-nextjs-app-router-builder.ts | 42 ++- .../typescript-nextjs-router-builder.ts | 6 +- 11 files changed, 460 insertions(+), 308 deletions(-) rename integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/{clients => }/client.ts (99%) diff --git a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts index 1941329f7..c471fabe4 100644 --- a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts +++ b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts @@ -1,10 +1,26 @@ import {_GET, _POST} from "../../../generated/todo-lists.yaml/attachments/route" -export const GET = _GET(async (respond, request) => { - // TODO: implementation - return respond.withStatus(501).body({message: "not implemented"} as any) -}) -export const POST = _POST(async ({body}, respond, request) => { - // TODO: implementation - return respond.withStatus(501).body({message: "not implemented"} as any) -}) +export const GET = _GET( + async (respond, request) => { + // TODO: implementation + return respond.withStatus(501).body({message: "not implemented"} as any) + }, + async (err) => { + // TODO: implementation + return new Response(JSON.stringify({message: "not implemented"}), { + status: 501, + }) + }, +) +export const POST = _POST( + async ({body}, respond, request) => { + // TODO: implementation + return respond.withStatus(501).body({message: "not implemented"} as any) + }, + async (err) => { + // TODO: implementation + return new Response(JSON.stringify({message: "not implemented"}), { + status: 501, + }) + }, +) diff --git a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/items/route.ts b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/items/route.ts index 002c82e4b..a6485c654 100644 --- a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/items/route.ts +++ b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/items/route.ts @@ -3,11 +3,27 @@ import { _POST, } from "../../../../../generated/todo-lists.yaml/list/[listId]/items/route" -export const GET = _GET(async ({params}, respond, request) => { - // TODO: implementation - return respond.withStatus(501).body({message: "not implemented"} as any) -}) -export const POST = _POST(async ({params, body}, respond, request) => { - // TODO: implementation - return respond.withStatus(501).body({message: "not implemented"} as any) -}) +export const GET = _GET( + async ({params}, respond, request) => { + // TODO: implementation + return respond.withStatus(501).body({message: "not implemented"} as any) + }, + async (err) => { + // TODO: implementation + return new Response(JSON.stringify({message: "not implemented"}), { + status: 501, + }) + }, +) +export const POST = _POST( + async ({params, body}, respond, request) => { + // TODO: implementation + return respond.withStatus(501).body({message: "not implemented"} as any) + }, + async (err) => { + // TODO: implementation + return new Response(JSON.stringify({message: "not implemented"}), { + status: 501, + }) + }, +) diff --git a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/route.ts b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/route.ts index e305d93de..cd5430ff6 100644 --- a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/route.ts +++ b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/[listId]/route.ts @@ -4,15 +4,39 @@ import { _PUT, } from "../../../../generated/todo-lists.yaml/list/[listId]/route" -export const GET = _GET(async ({params}, respond, request) => { - // TODO: implementation - return respond.withStatus(501).body({message: "not implemented"} as any) -}) -export const PUT = _PUT(async ({params, body}, respond, request) => { - // TODO: implementation - return respond.withStatus(501).body({message: "not implemented"} as any) -}) -export const DELETE = _DELETE(async ({params}, respond, request) => { - // TODO: implementation - return respond.withStatus(501).body({message: "not implemented"} as any) -}) +export const GET = _GET( + async ({params}, respond, request) => { + // TODO: implementation + return respond.withStatus(501).body({message: "not implemented"} as any) + }, + async (err) => { + // TODO: implementation + return new Response(JSON.stringify({message: "not implemented"}), { + status: 501, + }) + }, +) +export const PUT = _PUT( + async ({params, body}, respond, request) => { + // TODO: implementation + return respond.withStatus(501).body({message: "not implemented"} as any) + }, + async (err) => { + // TODO: implementation + return new Response(JSON.stringify({message: "not implemented"}), { + status: 501, + }) + }, +) +export const DELETE = _DELETE( + async ({params}, respond, request) => { + // TODO: implementation + return respond.withStatus(501).body({message: "not implemented"} as any) + }, + async (err) => { + // TODO: implementation + return new Response(JSON.stringify({message: "not implemented"}), { + status: 501, + }) + }, +) diff --git a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/route.ts b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/route.ts index 1eeb847f0..9765805fa 100644 --- a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/route.ts +++ b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/list/route.ts @@ -1,6 +1,14 @@ import {_GET} from "../../../generated/todo-lists.yaml/list/route" -export const GET = _GET(async ({query}, respond, request) => { - // TODO: implementation - return respond.withStatus(501).body({message: "not implemented"} as any) -}) +export const GET = _GET( + async ({query}, respond, request) => { + // TODO: implementation + return respond.withStatus(501).body({message: "not implemented"} as any) + }, + async (err) => { + // TODO: implementation + return new Response(JSON.stringify({message: "not implemented"}), { + status: 501, + }) + }, +) diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts index d0636f656..de9aea186 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts @@ -38,69 +38,83 @@ export type UploadAttachment = ( ) => Promise> export const _GET = - (implementation: ListAttachments) => + ( + implementation: ListAttachments, + onError: (err: unknown) => Promise, + ) => async (request: NextRequest): Promise => { - const input = { - params: undefined, - // TODO: this swallows repeated parameters - query: undefined, - body: undefined, - headers: undefined, - } + try { + const input = { + params: undefined, + // TODO: this swallows repeated parameters + query: undefined, + body: undefined, + headers: undefined, + } - const responder = { - with200() { - return new OpenAPIRuntimeResponse(200) - }, - withStatus(status: StatusCode) { - return new OpenAPIRuntimeResponse(status) - }, - } + const responder = { + with200() { + return new OpenAPIRuntimeResponse(200) + }, + withStatus(status: StatusCode) { + return new OpenAPIRuntimeResponse(status) + }, + } - const {status, body} = await implementation(responder, request) - .then((it) => it.unpack()) - .catch((err) => { - throw OpenAPIRuntimeError.HandlerError(err) - }) + const {status, body} = await implementation(responder, request) + .then((it) => it.unpack()) + .catch((err) => { + throw OpenAPIRuntimeError.HandlerError(err) + }) - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) + return body !== undefined + ? Response.json(body, {status}) + : new Response(undefined, {status}) + } catch (err) { + return await onError(err) + } } const uploadAttachmentBodySchema = z.object({file: z.unknown().optional()}) export const _POST = - (implementation: UploadAttachment) => + ( + implementation: UploadAttachment, + onError: (err: unknown) => Promise, + ) => async (request: NextRequest): Promise => { - const input = { - params: undefined, - // TODO: this swallows repeated parameters - query: undefined, - body: parseRequestInput( - uploadAttachmentBodySchema, - await request.json(), - RequestInputType.RequestBody, - ), - headers: undefined, - } + try { + const input = { + params: undefined, + // TODO: this swallows repeated parameters + query: undefined, + body: parseRequestInput( + uploadAttachmentBodySchema, + await request.json(), + RequestInputType.RequestBody, + ), + headers: undefined, + } - const responder = { - with202() { - return new OpenAPIRuntimeResponse(202) - }, - withStatus(status: StatusCode) { - return new OpenAPIRuntimeResponse(status) - }, - } + const responder = { + with202() { + return new OpenAPIRuntimeResponse(202) + }, + withStatus(status: StatusCode) { + return new OpenAPIRuntimeResponse(status) + }, + } - const {status, body} = await implementation(input, responder, request) - .then((it) => it.unpack()) - .catch((err) => { - throw OpenAPIRuntimeError.HandlerError(err) - }) + const {status, body} = await implementation(input, responder, request) + .then((it) => it.unpack()) + .catch((err) => { + throw OpenAPIRuntimeError.HandlerError(err) + }) - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) + return body !== undefined + ? Response.json(body, {status}) + : new Response(undefined, {status}) + } catch (err) { + return await onError(err) + } } diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/clients/client.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/client.ts similarity index 99% rename from integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/clients/client.ts rename to integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/client.ts index 925e0e07e..053a38dcc 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/clients/client.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/client.ts @@ -8,7 +8,7 @@ import { t_Statuses, t_TodoList, t_UnknownObject, -} from "../models" +} from "./models" import { AbstractFetchClient, AbstractFetchClientConfig, diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts index 1e15413f1..0450b1a88 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts @@ -60,52 +60,59 @@ export type CreateTodoListItem = ( const getTodoListItemsParamSchema = z.object({listId: z.string()}) export const _GET = - (implementation: GetTodoListItems) => + ( + implementation: GetTodoListItems, + onError: (err: unknown) => Promise, + ) => async ( request: NextRequest, {params}: {params: Promise}, ): Promise => { - const input = { - params: parseRequestInput( - getTodoListItemsParamSchema, - await params, - RequestInputType.RouteParam, - ), - // TODO: this swallows repeated parameters - query: undefined, - body: undefined, - headers: undefined, + try { + const input = { + params: parseRequestInput( + getTodoListItemsParamSchema, + await params, + RequestInputType.RouteParam, + ), + // TODO: this swallows repeated parameters + query: undefined, + body: undefined, + headers: undefined, + } + + const responder = { + with200() { + return new OpenAPIRuntimeResponse<{ + completedAt?: string + content: string + createdAt: string + id: string + }>(200) + }, + withStatusCode5xx(status: StatusCode5xx) { + return new OpenAPIRuntimeResponse<{ + code: string + message: string + }>(status) + }, + withStatus(status: StatusCode) { + return new OpenAPIRuntimeResponse(status) + }, + } + + const {status, body} = await implementation(input, responder, request) + .then((it) => it.unpack()) + .catch((err) => { + throw OpenAPIRuntimeError.HandlerError(err) + }) + + return body !== undefined + ? Response.json(body, {status}) + : new Response(undefined, {status}) + } catch (err) { + return await onError(err) } - - const responder = { - with200() { - return new OpenAPIRuntimeResponse<{ - completedAt?: string - content: string - createdAt: string - id: string - }>(200) - }, - withStatusCode5xx(status: StatusCode5xx) { - return new OpenAPIRuntimeResponse<{ - code: string - message: string - }>(status) - }, - withStatus(status: StatusCode) { - return new OpenAPIRuntimeResponse(status) - }, - } - - const {status, body} = await implementation(input, responder, request) - .then((it) => it.unpack()) - .catch((err) => { - throw OpenAPIRuntimeError.HandlerError(err) - }) - - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) } const createTodoListItemParamSchema = z.object({listId: z.string()}) @@ -117,43 +124,50 @@ const createTodoListItemBodySchema = z.object({ }) export const _POST = - (implementation: CreateTodoListItem) => + ( + implementation: CreateTodoListItem, + onError: (err: unknown) => Promise, + ) => async ( request: NextRequest, {params}: {params: Promise}, ): Promise => { - const input = { - params: parseRequestInput( - createTodoListItemParamSchema, - await params, - RequestInputType.RouteParam, - ), - // TODO: this swallows repeated parameters - query: undefined, - body: parseRequestInput( - createTodoListItemBodySchema, - await request.json(), - RequestInputType.RequestBody, - ), - headers: undefined, + try { + const input = { + params: parseRequestInput( + createTodoListItemParamSchema, + await params, + RequestInputType.RouteParam, + ), + // TODO: this swallows repeated parameters + query: undefined, + body: parseRequestInput( + createTodoListItemBodySchema, + await request.json(), + RequestInputType.RequestBody, + ), + headers: undefined, + } + + const responder = { + with204() { + return new OpenAPIRuntimeResponse(204) + }, + withStatus(status: StatusCode) { + return new OpenAPIRuntimeResponse(status) + }, + } + + const {status, body} = await implementation(input, responder, request) + .then((it) => it.unpack()) + .catch((err) => { + throw OpenAPIRuntimeError.HandlerError(err) + }) + + return body !== undefined + ? Response.json(body, {status}) + : new Response(undefined, {status}) + } catch (err) { + return await onError(err) } - - const responder = { - with204() { - return new OpenAPIRuntimeResponse(204) - }, - withStatus(status: StatusCode) { - return new OpenAPIRuntimeResponse(status) - }, - } - - const {status, body} = await implementation(input, responder, request) - .then((it) => it.unpack()) - .catch((err) => { - throw OpenAPIRuntimeError.HandlerError(err) - }) - - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) } diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts index 5fed57e82..eea0caa3c 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts @@ -71,47 +71,54 @@ export type DeleteTodoListById = ( const getTodoListByIdParamSchema = z.object({listId: z.string()}) export const _GET = - (implementation: GetTodoListById) => + ( + implementation: GetTodoListById, + onError: (err: unknown) => Promise, + ) => async ( request: NextRequest, {params}: {params: Promise}, ): Promise => { - const input = { - params: parseRequestInput( - getTodoListByIdParamSchema, - await params, - RequestInputType.RouteParam, - ), - // TODO: this swallows repeated parameters - query: undefined, - body: undefined, - headers: undefined, + try { + const input = { + params: parseRequestInput( + getTodoListByIdParamSchema, + await params, + RequestInputType.RouteParam, + ), + // TODO: this swallows repeated parameters + query: undefined, + body: undefined, + headers: undefined, + } + + const responder = { + with200() { + return new OpenAPIRuntimeResponse(200) + }, + withStatusCode4xx(status: StatusCode4xx) { + return new OpenAPIRuntimeResponse(status) + }, + withDefault(status: StatusCode) { + return new OpenAPIRuntimeResponse(status) + }, + withStatus(status: StatusCode) { + return new OpenAPIRuntimeResponse(status) + }, + } + + const {status, body} = await implementation(input, responder, request) + .then((it) => it.unpack()) + .catch((err) => { + throw OpenAPIRuntimeError.HandlerError(err) + }) + + return body !== undefined + ? Response.json(body, {status}) + : new Response(undefined, {status}) + } catch (err) { + return await onError(err) } - - const responder = { - with200() { - return new OpenAPIRuntimeResponse(200) - }, - withStatusCode4xx(status: StatusCode4xx) { - return new OpenAPIRuntimeResponse(status) - }, - withDefault(status: StatusCode) { - return new OpenAPIRuntimeResponse(status) - }, - withStatus(status: StatusCode) { - return new OpenAPIRuntimeResponse(status) - }, - } - - const {status, body} = await implementation(input, responder, request) - .then((it) => it.unpack()) - .catch((err) => { - throw OpenAPIRuntimeError.HandlerError(err) - }) - - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) } const updateTodoListByIdParamSchema = z.object({listId: z.string()}) @@ -119,95 +126,109 @@ const updateTodoListByIdParamSchema = z.object({listId: z.string()}) const updateTodoListByIdBodySchema = s_CreateUpdateTodoList export const _PUT = - (implementation: UpdateTodoListById) => + ( + implementation: UpdateTodoListById, + onError: (err: unknown) => Promise, + ) => async ( request: NextRequest, {params}: {params: Promise}, ): Promise => { - const input = { - params: parseRequestInput( - updateTodoListByIdParamSchema, - await params, - RequestInputType.RouteParam, - ), - // TODO: this swallows repeated parameters - query: undefined, - body: parseRequestInput( - updateTodoListByIdBodySchema, - await request.json(), - RequestInputType.RequestBody, - ), - headers: undefined, - } - - const responder = { - with200() { - return new OpenAPIRuntimeResponse(200) - }, - withStatusCode4xx(status: StatusCode4xx) { - return new OpenAPIRuntimeResponse(status) - }, - withDefault(status: StatusCode) { - return new OpenAPIRuntimeResponse(status) - }, - withStatus(status: StatusCode) { - return new OpenAPIRuntimeResponse(status) - }, + try { + const input = { + params: parseRequestInput( + updateTodoListByIdParamSchema, + await params, + RequestInputType.RouteParam, + ), + // TODO: this swallows repeated parameters + query: undefined, + body: parseRequestInput( + updateTodoListByIdBodySchema, + await request.json(), + RequestInputType.RequestBody, + ), + headers: undefined, + } + + const responder = { + with200() { + return new OpenAPIRuntimeResponse(200) + }, + withStatusCode4xx(status: StatusCode4xx) { + return new OpenAPIRuntimeResponse(status) + }, + withDefault(status: StatusCode) { + return new OpenAPIRuntimeResponse(status) + }, + withStatus(status: StatusCode) { + return new OpenAPIRuntimeResponse(status) + }, + } + + const {status, body} = await implementation(input, responder, request) + .then((it) => it.unpack()) + .catch((err) => { + throw OpenAPIRuntimeError.HandlerError(err) + }) + + return body !== undefined + ? Response.json(body, {status}) + : new Response(undefined, {status}) + } catch (err) { + return await onError(err) } - - const {status, body} = await implementation(input, responder, request) - .then((it) => it.unpack()) - .catch((err) => { - throw OpenAPIRuntimeError.HandlerError(err) - }) - - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) } const deleteTodoListByIdParamSchema = z.object({listId: z.string()}) export const _DELETE = - (implementation: DeleteTodoListById) => + ( + implementation: DeleteTodoListById, + onError: (err: unknown) => Promise, + ) => async ( request: NextRequest, {params}: {params: Promise}, ): Promise => { - const input = { - params: parseRequestInput( - deleteTodoListByIdParamSchema, - await params, - RequestInputType.RouteParam, - ), - // TODO: this swallows repeated parameters - query: undefined, - body: undefined, - headers: undefined, - } - - const responder = { - with204() { - return new OpenAPIRuntimeResponse(204) - }, - withStatusCode4xx(status: StatusCode4xx) { - return new OpenAPIRuntimeResponse(status) - }, - withDefault(status: StatusCode) { - return new OpenAPIRuntimeResponse(status) - }, - withStatus(status: StatusCode) { - return new OpenAPIRuntimeResponse(status) - }, + try { + const input = { + params: parseRequestInput( + deleteTodoListByIdParamSchema, + await params, + RequestInputType.RouteParam, + ), + // TODO: this swallows repeated parameters + query: undefined, + body: undefined, + headers: undefined, + } + + const responder = { + with204() { + return new OpenAPIRuntimeResponse(204) + }, + withStatusCode4xx(status: StatusCode4xx) { + return new OpenAPIRuntimeResponse(status) + }, + withDefault(status: StatusCode) { + return new OpenAPIRuntimeResponse(status) + }, + withStatus(status: StatusCode) { + return new OpenAPIRuntimeResponse(status) + }, + } + + const {status, body} = await implementation(input, responder, request) + .then((it) => it.unpack()) + .catch((err) => { + throw OpenAPIRuntimeError.HandlerError(err) + }) + + return body !== undefined + ? Response.json(body, {status}) + : new Response(undefined, {status}) + } catch (err) { + return await onError(err) } - - const {status, body} = await implementation(input, responder, request) - .then((it) => it.unpack()) - .catch((err) => { - throw OpenAPIRuntimeError.HandlerError(err) - }) - - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) } diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts index 40d6da0b7..6d8971848 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts @@ -46,36 +46,43 @@ const getTodoListsQuerySchema = z.object({ }) export const _GET = - (implementation: GetTodoLists) => + ( + implementation: GetTodoLists, + onError: (err: unknown) => Promise, + ) => async (request: NextRequest): Promise => { - const input = { - params: undefined, - // TODO: this swallows repeated parameters - query: parseRequestInput( - getTodoListsQuerySchema, - Object.fromEntries(request.nextUrl.searchParams.entries()), - RequestInputType.QueryString, - ), - body: undefined, - headers: undefined, - } + try { + const input = { + params: undefined, + // TODO: this swallows repeated parameters + query: parseRequestInput( + getTodoListsQuerySchema, + Object.fromEntries(request.nextUrl.searchParams.entries()), + RequestInputType.QueryString, + ), + body: undefined, + headers: undefined, + } - const responder = { - with200() { - return new OpenAPIRuntimeResponse(200) - }, - withStatus(status: StatusCode) { - return new OpenAPIRuntimeResponse(status) - }, - } + const responder = { + with200() { + return new OpenAPIRuntimeResponse(200) + }, + withStatus(status: StatusCode) { + return new OpenAPIRuntimeResponse(status) + }, + } - const {status, body} = await implementation(input, responder, request) - .then((it) => it.unpack()) - .catch((err) => { - throw OpenAPIRuntimeError.HandlerError(err) - }) + const {status, body} = await implementation(input, responder, request) + .then((it) => it.unpack()) + .catch((err) => { + throw OpenAPIRuntimeError.HandlerError(err) + }) - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) + return body !== undefined + ? Response.json(body, {status}) + : new Response(undefined, {status}) + } catch (err) { + return await onError(err) + } } diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts index 0d0e76026..05abce8c7 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts @@ -1,8 +1,8 @@ import { type SourceFile, StructureKind, - SyntaxKind, VariableDeclarationKind, + ts, } from "ts-morph" import type {Input} from "../../../core/input" import type {IROperation} from "../../../core/openapi-types-normalized" @@ -18,6 +18,7 @@ import type {SchemaBuilder} from "../../common/schema-builders/schema-builder" import type {TypeBuilder} from "../../common/type-builder" import type {ServerSymbols} from "../abstract-router-builder" import {ServerOperationBuilder} from "../server-operation-builder" +import SyntaxKind = ts.SyntaxKind export class TypescriptNextjsAppRouterBuilder implements ICompilable { constructor( @@ -65,6 +66,9 @@ export class TypescriptNextjsAppRouterBuilder implements ICompilable { initializer: `${wrappingMethod}(async (input, respond, context) => { // TODO: implementation return respond.withStatus(501).body({message: "not implemented"} as any) + }, async (err) => { + // TODO: implementation + return new Response(JSON.stringify({message: "not implemented"}), {status: 501}) })`, }, ], @@ -73,19 +77,22 @@ export class TypescriptNextjsAppRouterBuilder implements ICompilable { // Replace the params based on what inputs we have // biome-ignore lint/style/noNonNullAssertion: const declarations = variableDeclaration.getDeclarations()[0]! + const callExpression = declarations.getInitializerIfKindOrThrow( + SyntaxKind.CallExpression, + ) + // biome-ignore lint/style/noNonNullAssertion: - const innerFunction = declarations - .getInitializerIfKindOrThrow(SyntaxKind.CallExpression) + const implementationFunction = callExpression .getArguments()[0]! .asKind(SyntaxKind.ArrowFunction)! // biome-ignore lint/complexity/noForEach: - innerFunction?.getParameters().forEach((parameter) => { + implementationFunction?.getParameters().forEach((parameter) => { parameter.remove() }) if (params.hasParams) { - innerFunction?.addParameter({ + implementationFunction?.addParameter({ name: `{${[ params.path.schema ? "params" : undefined, params.query.schema ? "query" : undefined, @@ -97,8 +104,29 @@ export class TypescriptNextjsAppRouterBuilder implements ICompilable { }) } - innerFunction?.addParameter({name: "respond"}) - innerFunction?.addParameter({name: "request"}) + implementationFunction?.addParameter({name: "respond"}) + implementationFunction?.addParameter({name: "request"}) + + const onErrorFunction = callExpression.getArguments()[1] + + if (!onErrorFunction) { + callExpression.addArgument(`async (err) => { + // TODO: implementation + return new Response(JSON.stringify({message: "not implemented"}), {status: 501}) + }`) + } else if (onErrorFunction.getKind() === SyntaxKind.ArrowFunction) { + for (const param of onErrorFunction + .asKind(SyntaxKind.ArrowFunction) + ?.getParameters() ?? []) { + param.remove() + } + + onErrorFunction + ?.asKind(SyntaxKind.ArrowFunction) + ?.addParameter({name: "err"}) + } else if (onErrorFunction.getKind() === SyntaxKind.FunctionExpression) { + // todo + } } // TODO: duplication - should be shared with router builder diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts index f05e79b2e..2e12d82ab 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts @@ -117,7 +117,8 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { buildExport({ name: `_${builder.method.toUpperCase()}`, kind: "const", - value: `(implementation: ${symbols.implTypeName}) => async (${["request: NextRequest", params.path.schema ? "{params}: {params: Promise}" : undefined].filter(isDefined).join(",")}): Promise => { + value: `(implementation: ${symbols.implTypeName}, onError: (err: unknown) => Promise) => async (${["request: NextRequest", params.path.schema ? "{params}: {params: Promise}" : undefined].filter(isDefined).join(",")}): Promise => { +try { const input = { params: ${ params.path.schema @@ -152,6 +153,9 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { .catch(err => { throw OpenAPIRuntimeError.HandlerError(err) }) return body !== undefined ? Response.json(body, {status}) : new Response(undefined, {status}) + } catch (err) { + return await onError(err) + } }`, }), ) From ee393afb09e38a43f9a0c393f97da2b12c60fdec Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sat, 5 Jul 2025 16:15:03 +0100 Subject: [PATCH 15/22] feat: support returning a raw Response --- .../todo-lists.yaml/attachments/route.ts | 34 +++++++++---- .../list/[listId]/items/route.ts | 34 +++++++++---- .../todo-lists.yaml/list/[listId]/route.ts | 51 +++++++++++++------ .../generated/todo-lists.yaml/list/route.ts | 17 +++++-- .../typescript-nextjs-router-builder.ts | 16 +++--- .../typescript-nextjs-runtime/src/server.ts | 2 - 6 files changed, 106 insertions(+), 48 deletions(-) diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts index de9aea186..f1bcb2668 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts @@ -61,15 +61,22 @@ export const _GET = }, } - const {status, body} = await implementation(responder, request) - .then((it) => it.unpack()) + const res = await implementation(responder, request) + .then((it) => { + if (it instanceof Response) { + return it + } + const {status, body} = it.unpack() + + return body !== undefined + ? Response.json(body, {status}) + : new Response(undefined, {status}) + }) .catch((err) => { throw OpenAPIRuntimeError.HandlerError(err) }) - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) + return res } catch (err) { return await onError(err) } @@ -105,15 +112,22 @@ export const _POST = }, } - const {status, body} = await implementation(input, responder, request) - .then((it) => it.unpack()) + const res = await implementation(input, responder, request) + .then((it) => { + if (it instanceof Response) { + return it + } + const {status, body} = it.unpack() + + return body !== undefined + ? Response.json(body, {status}) + : new Response(undefined, {status}) + }) .catch((err) => { throw OpenAPIRuntimeError.HandlerError(err) }) - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) + return res } catch (err) { return await onError(err) } diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts index 0450b1a88..bf394fb06 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts @@ -101,15 +101,22 @@ export const _GET = }, } - const {status, body} = await implementation(input, responder, request) - .then((it) => it.unpack()) + const res = await implementation(input, responder, request) + .then((it) => { + if (it instanceof Response) { + return it + } + const {status, body} = it.unpack() + + return body !== undefined + ? Response.json(body, {status}) + : new Response(undefined, {status}) + }) .catch((err) => { throw OpenAPIRuntimeError.HandlerError(err) }) - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) + return res } catch (err) { return await onError(err) } @@ -158,15 +165,22 @@ export const _POST = }, } - const {status, body} = await implementation(input, responder, request) - .then((it) => it.unpack()) + const res = await implementation(input, responder, request) + .then((it) => { + if (it instanceof Response) { + return it + } + const {status, body} = it.unpack() + + return body !== undefined + ? Response.json(body, {status}) + : new Response(undefined, {status}) + }) .catch((err) => { throw OpenAPIRuntimeError.HandlerError(err) }) - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) + return res } catch (err) { return await onError(err) } diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts index eea0caa3c..52b3d1ff9 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts @@ -107,15 +107,22 @@ export const _GET = }, } - const {status, body} = await implementation(input, responder, request) - .then((it) => it.unpack()) + const res = await implementation(input, responder, request) + .then((it) => { + if (it instanceof Response) { + return it + } + const {status, body} = it.unpack() + + return body !== undefined + ? Response.json(body, {status}) + : new Response(undefined, {status}) + }) .catch((err) => { throw OpenAPIRuntimeError.HandlerError(err) }) - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) + return res } catch (err) { return await onError(err) } @@ -166,15 +173,22 @@ export const _PUT = }, } - const {status, body} = await implementation(input, responder, request) - .then((it) => it.unpack()) + const res = await implementation(input, responder, request) + .then((it) => { + if (it instanceof Response) { + return it + } + const {status, body} = it.unpack() + + return body !== undefined + ? Response.json(body, {status}) + : new Response(undefined, {status}) + }) .catch((err) => { throw OpenAPIRuntimeError.HandlerError(err) }) - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) + return res } catch (err) { return await onError(err) } @@ -219,15 +233,22 @@ export const _DELETE = }, } - const {status, body} = await implementation(input, responder, request) - .then((it) => it.unpack()) + const res = await implementation(input, responder, request) + .then((it) => { + if (it instanceof Response) { + return it + } + const {status, body} = it.unpack() + + return body !== undefined + ? Response.json(body, {status}) + : new Response(undefined, {status}) + }) .catch((err) => { throw OpenAPIRuntimeError.HandlerError(err) }) - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) + return res } catch (err) { return await onError(err) } diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts index 6d8971848..10a1938e2 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts @@ -73,15 +73,22 @@ export const _GET = }, } - const {status, body} = await implementation(input, responder, request) - .then((it) => it.unpack()) + const res = await implementation(input, responder, request) + .then((it) => { + if (it instanceof Response) { + return it + } + const {status, body} = it.unpack() + + return body !== undefined + ? Response.json(body, {status}) + : new Response(undefined, {status}) + }) .catch((err) => { throw OpenAPIRuntimeError.HandlerError(err) }) - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) + return res } catch (err) { return await onError(err) } diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts index 2e12d82ab..a6ab0fa61 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts @@ -145,14 +145,18 @@ try { const responder = ${responder.implementation} - const { - status, - body, - } = await implementation(${[params.hasParams ? "input" : undefined, "responder", "request"].filter(isDefined).join(",")}) - .then(it => it.unpack()) + const res = await implementation(${[params.hasParams ? "input" : undefined, "responder", "request"].filter(isDefined).join(",")}) + .then(it => { + if(it instanceof Response) { + return it + } + const {status, body} = it.unpack() + + return body !== undefined ? Response.json(body, {status}) : new Response(undefined, {status}) + }) .catch(err => { throw OpenAPIRuntimeError.HandlerError(err) }) - return body !== undefined ? Response.json(body, {status}) : new Response(undefined, {status}) + return res } catch (err) { return await onError(err) } diff --git a/packages/typescript-nextjs-runtime/src/server.ts b/packages/typescript-nextjs-runtime/src/server.ts index 3a9c01860..6767e06c8 100644 --- a/packages/typescript-nextjs-runtime/src/server.ts +++ b/packages/typescript-nextjs-runtime/src/server.ts @@ -29,8 +29,6 @@ export type Response = { body: Type } -export const SkipResponse = Symbol("skip response processing") - export class OpenAPIRuntimeResponse { private _body?: Type From 8dc1e2e5d8e7d2bc2d56b935bb04abb142501cea Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Mon, 22 Dec 2025 15:35:16 +0000 Subject: [PATCH 16/22] fix: lock --- .../typescript-nextjs/package.json | 2 +- .../typescript-nextjs-runtime/package.json | 2 +- pnpm-lock.yaml | 114 ++++++++++++++++++ 3 files changed, 116 insertions(+), 2 deletions(-) diff --git a/integration-tests/typescript-nextjs/package.json b/integration-tests/typescript-nextjs/package.json index 8a24950c8..e96b1378c 100644 --- a/integration-tests/typescript-nextjs/package.json +++ b/integration-tests/typescript-nextjs/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@nahkies/typescript-nextjs-runtime": "*", - "next": "^15.3.5", + "next": "^16.1.0", "react": "^19.1.0", "react-dom": "^19.1.0" }, diff --git a/packages/typescript-nextjs-runtime/package.json b/packages/typescript-nextjs-runtime/package.json index b4c35f7e4..706115240 100644 --- a/packages/typescript-nextjs-runtime/package.json +++ b/packages/typescript-nextjs-runtime/package.json @@ -45,7 +45,7 @@ }, "peerDependencies": { "joi": "^17.1.1", - "next": "^15.3.5", + "next": "^16.1.0", "zod": "^3.20.6" }, "peerDependenciesMeta": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ef3660d12..ed5a87603 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -274,6 +274,34 @@ importers: specifier: ^5.9.3 version: 5.9.3 + integration-tests/typescript-nextjs: + dependencies: + '@nahkies/typescript-nextjs-runtime': + specifier: '*' + version: link:../../packages/typescript-nextjs-runtime + next: + specifier: ^16.1.0 + version: 16.1.0(@babel/core@7.28.5)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.93.2) + react: + specifier: ^19.1.0 + version: 19.2.3 + react-dom: + specifier: ^19.1.0 + version: 19.2.3(react@19.2.3) + devDependencies: + '@types/node': + specifier: 22.16.5 + version: 22.16.5 + '@types/react': + specifier: ^19.1.8 + version: 19.2.7 + '@types/react-dom': + specifier: ^19.1.6 + version: 19.2.3(@types/react@19.2.7) + typescript: + specifier: ^5.8.3 + version: 5.9.3 + packages/documentation: dependencies: '@hookform/resolvers': @@ -382,6 +410,9 @@ importers: lodash: specifier: ^4.17.21 version: 4.17.21 + ts-morph: + specifier: ^26.0.0 + version: 26.0.0 tslib: specifier: ^2.8.1 version: 2.8.1 @@ -608,6 +639,25 @@ importers: specifier: ^3.25.74 version: 3.25.76 + packages/typescript-nextjs-runtime: + dependencies: + next: + specifier: ^16.1.0 + version: 16.1.0(@babel/core@7.28.5)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.93.2) + devDependencies: + jest: + specifier: ^30.0.4 + version: 30.2.0(@types/node@22.16.5) + joi: + specifier: ^17.13.3 + version: 17.13.3 + typescript: + specifier: ~5.8.3 + version: 5.8.3 + zod: + specifier: ^3.25.74 + version: 3.25.76 + packages: '@algolia/abtesting@1.6.1': @@ -1645,6 +1695,9 @@ packages: '@hapi/hoek@11.0.7': resolution: {integrity: sha512-HV5undWkKzcB4RZUusqOpcgxOaq6VOAH7zhhIr2g3G8NF/MlFO75SjOr2NfuSx0Mh40+1FqCkagKLJRykUWoFQ==} + '@hapi/hoek@9.3.0': + resolution: {integrity: sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==} + '@hapi/pinpoint@2.0.1': resolution: {integrity: sha512-EKQmr16tM8s16vTT3cA5L0kZZcTMU5DUOZTuvpnY738m+jyP3JIUj+Mm1xc1rsLkGBQ/gVnfKYPwOmPg1tUR4Q==} @@ -1652,6 +1705,9 @@ packages: resolution: {integrity: sha512-Fq+20dxsxLaUn5jSSWrdtSRcIUba2JquuorF9UW1wIJS5cSUwxIsO2GIhaWynPRflvxSzFN+gxKte2HEW1OuoA==} engines: {node: '>=14.0.0'} + '@hapi/topo@5.1.0': + resolution: {integrity: sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==} + '@hapi/topo@6.0.2': resolution: {integrity: sha512-KR3rD5inZbGMrHmgPxsJ9dbi6zEK+C3ZwUwTa+eMwWLz7oijWUTWD2pMSNNYJAU6Qq+65NkxXjqHr/7LM2Xkqg==} @@ -3265,6 +3321,15 @@ packages: '@shikijs/vscode-textmate@10.0.2': resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==} + '@sideway/address@4.1.5': + resolution: {integrity: sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==} + + '@sideway/formula@3.0.1': + resolution: {integrity: sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==} + + '@sideway/pinpoint@2.0.0': + resolution: {integrity: sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==} + '@sigstore/bundle@4.0.0': resolution: {integrity: sha512-NwCl5Y0V6Di0NexvkTqdoVfmjTaQwoLM236r89KEojGmq/jMls8S+zb7yOwAPdXvbwfKDlP+lmXgAL4vKSQT+A==} engines: {node: ^20.17.0 || >=22.9.0} @@ -3416,6 +3481,9 @@ packages: '@theguild/remark-npm2yarn@0.3.3': resolution: {integrity: sha512-ma6DvR03gdbvwqfKx1omqhg9May/VYGdMHvTzB4VuxkyS7KzfZ/lzrj43hmcsggpMje0x7SADA/pcMph0ejRnA==} + '@ts-morph/common@0.27.0': + resolution: {integrity: sha512-Wf29UqxWDpc+i61k3oIOzcUfQt79PIT9y/MWfAGlrkjg6lBC1hwDECLXPVJAhWjiGbfBCxZd65F/LIZF3+jeJQ==} + '@ts-morph/common@0.28.1': resolution: {integrity: sha512-W74iWf7ILp1ZKNYXY5qbddNaml7e9Sedv5lvU1V8lftlitkc9Pq1A+jlH23ltDgWYeZFFEqGCD1Ies9hqu3O+g==} @@ -5969,6 +6037,9 @@ packages: node-notifier: optional: true + joi@17.13.3: + resolution: {integrity: sha512-otDA4ldcIx+ZXsKHWmp0YizCweVRZG96J10b0FevjfuncLO1oX59THoAmHkNubYJ+9gWsYsp5k8v4ib6oDv1fA==} + joi@18.0.2: resolution: {integrity: sha512-RuCOQMIt78LWnktPoeBL0GErkNaJPTBGcYuyaBvUOQSpcpcLfWrHPPihYdOGbV5pam9VTWbeoF7TsGiHugcjGA==} engines: {node: '>= 20'} @@ -7898,6 +7969,9 @@ packages: resolution: {integrity: sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==} engines: {node: '>=6.10'} + ts-morph@26.0.0: + resolution: {integrity: sha512-ztMO++owQnz8c/gIENcM9XfCEzgoGphTv+nKpYNM1bgsdOVC/jRZuEBf6N+mLLDNg68Kl+GgUZfOySaRiG1/Ug==} + ts-morph@27.0.2: resolution: {integrity: sha512-fhUhgeljcrdZ+9DZND1De1029PrE+cMkIP7ooqkLRTrRLTqcki2AstsyJm0vRNbTbVCNJ0idGlbBrfqc7/nA8w==} @@ -7964,6 +8038,11 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} + typescript@5.8.3: + resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} + engines: {node: '>=14.17'} + hasBin: true + typescript@5.9.3: resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} engines: {node: '>=14.17'} @@ -9239,10 +9318,16 @@ snapshots: '@hapi/hoek@11.0.7': {} + '@hapi/hoek@9.3.0': {} + '@hapi/pinpoint@2.0.1': {} '@hapi/tlds@1.1.4': {} + '@hapi/topo@5.1.0': + dependencies: + '@hapi/hoek': 9.3.0 + '@hapi/topo@6.0.2': dependencies: '@hapi/hoek': 11.0.7 @@ -10867,6 +10952,14 @@ snapshots: '@shikijs/vscode-textmate@10.0.2': {} + '@sideway/address@4.1.5': + dependencies: + '@hapi/hoek': 9.3.0 + + '@sideway/formula@3.0.1': {} + + '@sideway/pinpoint@2.0.0': {} + '@sigstore/bundle@4.0.0': dependencies: '@sigstore/protobuf-specs': 0.5.0 @@ -11002,6 +11095,12 @@ snapshots: npm-to-yarn: 3.0.1 unist-util-visit: 5.0.0 + '@ts-morph/common@0.27.0': + dependencies: + fast-glob: 3.3.3 + minimatch: 10.1.1 + path-browserify: 1.0.1 + '@ts-morph/common@0.28.1': dependencies: minimatch: 10.1.1 @@ -13977,6 +14076,14 @@ snapshots: - supports-color - ts-node + joi@17.13.3: + dependencies: + '@hapi/hoek': 9.3.0 + '@hapi/topo': 5.1.0 + '@sideway/address': 4.1.5 + '@sideway/formula': 3.0.1 + '@sideway/pinpoint': 2.0.0 + joi@18.0.2: dependencies: '@hapi/address': 5.1.1 @@ -16718,6 +16825,11 @@ snapshots: ts-dedent@2.2.0: {} + ts-morph@26.0.0: + dependencies: + '@ts-morph/common': 0.27.0 + code-block-writer: 13.0.3 + ts-morph@27.0.2: dependencies: '@ts-morph/common': 0.28.1 @@ -16783,6 +16895,8 @@ snapshots: typedarray@0.0.6: {} + typescript@5.8.3: {} + typescript@5.9.3: {} ufo@1.6.1: {} From cf583070bdd517329f58b1ca8c1fd6f39192c938 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Mon, 22 Dec 2025 15:51:06 +0000 Subject: [PATCH 17/22] fix: after rebase --- .../openapi-code-generator/src/core/input.ts | 2 +- .../src/core/schemas/tsconfig.schema.ts | 2 +- .../openapi-code-generator/src/generate.ts | 1 + .../openapi-code-generator/src/templates.ts | 1 + .../src/typescript/common/import-builder.ts | 9 +-- .../typescript-nextjs-app-router-builder.ts | 46 +++++++++---- .../typescript-nextjs-router-builder.ts | 69 ++++++++++--------- .../typescript-nextjs.generator.ts | 22 ++++-- 8 files changed, 95 insertions(+), 57 deletions(-) diff --git a/packages/openapi-code-generator/src/core/input.ts b/packages/openapi-code-generator/src/core/input.ts index e67e27b0c..8122edd36 100644 --- a/packages/openapi-code-generator/src/core/input.ts +++ b/packages/openapi-code-generator/src/core/input.ts @@ -66,7 +66,7 @@ export type InputConfig = { export class Input { constructor( - private loader: OpenapiLoader, + readonly loader: OpenapiLoader, readonly config: InputConfig, private readonly syntheticNameGenerator: SyntheticNameGenerator = defaultSyntheticNameGenerator, private readonly schemaNormalizer = new SchemaNormalizer(config), diff --git a/packages/openapi-code-generator/src/core/schemas/tsconfig.schema.ts b/packages/openapi-code-generator/src/core/schemas/tsconfig.schema.ts index 6bae94d4e..493beed04 100644 --- a/packages/openapi-code-generator/src/core/schemas/tsconfig.schema.ts +++ b/packages/openapi-code-generator/src/core/schemas/tsconfig.schema.ts @@ -37,7 +37,7 @@ export const tsconfigSchema = z.object({ allowUnreachableCode: z.boolean(), rewriteRelativeImportExtensions: z.boolean(), verbatimModuleSyntax: z.boolean(), - paths: z.record(z.array(z.string())), + paths: z.record(z.string(), z.array(z.string())), }) .partial() .optional() diff --git a/packages/openapi-code-generator/src/generate.ts b/packages/openapi-code-generator/src/generate.ts index 301f331ad..7bb052bee 100644 --- a/packages/openapi-code-generator/src/generate.ts +++ b/packages/openapi-code-generator/src/generate.ts @@ -93,5 +93,6 @@ export async function generate( isEsmProject: config.tsIsEsmProject, allowAny: config.tsAllowAny, serverImplementationMethod: config.tsServerImplementationMethod, + fsAdaptor, }) } diff --git a/packages/openapi-code-generator/src/templates.ts b/packages/openapi-code-generator/src/templates.ts index 2f1de8d51..59e904c1c 100644 --- a/packages/openapi-code-generator/src/templates.ts +++ b/packages/openapi-code-generator/src/templates.ts @@ -42,6 +42,7 @@ export const templates = { language: "typescript", type: "server", run: generateTypescriptNextJS, + syntheticNameGenerator: defaultSyntheticNameGenerator, }, } satisfies {[key: string]: OpenapiGenerator} diff --git a/packages/openapi-code-generator/src/typescript/common/import-builder.ts b/packages/openapi-code-generator/src/typescript/common/import-builder.ts index 073f72057..014f5d619 100644 --- a/packages/openapi-code-generator/src/typescript/common/import-builder.ts +++ b/packages/openapi-code-generator/src/typescript/common/import-builder.ts @@ -85,7 +85,7 @@ export function categorizeImportSource(source: string): ImportCategory { export type ImportBuilderConfig = { unit?: {filename: string} | undefined includeFileExtensions: boolean - importAlias?: string + importAlias?: string | undefined } export class ImportBuilder { @@ -225,7 +225,7 @@ export class ImportBuilder { } } - private normalizeFrom(from: string) { + normalizeFrom(from: string) { if (!this.config.includeFileExtensions && from.endsWith(".ts")) { // biome-ignore lint/style/noParameterAssign: normalization from = from.substring(0, from.length - ".ts".length) @@ -233,9 +233,10 @@ export class ImportBuilder { // TODO: does this work on windows? if (this.config.unit && from.startsWith("./")) { - if (this.config.importAlias) { - return this.config.importAlias + from.split(path.sep).slice(1).join(path.sep) + return ( + this.config.importAlias + from.split(path.sep).slice(1).join(path.sep) + ) } const unitDirname = path.dirname(this.config.unit.filename) diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts index 05abce8c7..0ebc09c92 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts @@ -1,8 +1,8 @@ import { type SourceFile, StructureKind, - VariableDeclarationKind, ts, + VariableDeclarationKind, } from "ts-morph" import type {Input} from "../../../core/input" import type {IROperation} from "../../../core/openapi-types-normalized" @@ -16,11 +16,28 @@ import {CompilationUnit, type ICompilable} from "../../common/compilation-units" import type {ImportBuilder} from "../../common/import-builder" import type {SchemaBuilder} from "../../common/schema-builders/schema-builder" import type {TypeBuilder} from "../../common/type-builder" -import type {ServerSymbols} from "../abstract-router-builder" -import {ServerOperationBuilder} from "../server-operation-builder" +import { + ServerOperationBuilder, + type ServerSymbols, +} from "../server-operation-builder" + import SyntaxKind = ts.SyntaxKind export class TypescriptNextjsAppRouterBuilder implements ICompilable { + protected readonly capabilities = { + requestBody: { + mediaTypes: [ + "application/json", + "application/scim+json", + "application/merge-patch+json", + "application/x-www-form-urlencoded", + "text/json", + "text/plain", + "text/x-markdown", + ], + }, + } + constructor( private readonly filename: string, private readonly name: string, @@ -40,10 +57,14 @@ export class TypescriptNextjsAppRouterBuilder implements ICompilable { this.input, this.types, this.schemaBuilder, + { + requestBody: { + supportedMediaTypes: this.capabilities.requestBody.mediaTypes, + }, + }, ) - const symbols = this.operationSymbols(builder.operationId) - const params = builder.parameters(symbols) + const params = builder.parameters() const sourceFile = this.sourceFile @@ -135,10 +156,6 @@ export class TypescriptNextjsAppRouterBuilder implements ICompilable { implPropName: operationId, implTypeName: titleCase(operationId), responderName: `${titleCase(operationId)}Responder`, - paramSchema: `${operationId}ParamSchema`, - querySchema: `${operationId}QuerySchema`, - requestBodySchema: `${operationId}BodySchema`, - requestHeaderSchema: `${operationId}HeaderSchema`, responseBodyValidator: `${operationId}ResponseValidator`, } } @@ -152,12 +169,15 @@ export class TypescriptNextjsAppRouterBuilder implements ICompilable { const imports = this.sourceFile.getImportDeclarations() const from = this.imports.normalizeFrom( `./${this.companionFilename}`, - `./${this.filename}`, + // todo + // `./${this.filename}`, ) // biome-ignore lint/complexity/noForEach: imports .filter((it) => it.getModuleSpecifierValue().includes(from)) - .forEach((it) => it.remove()) + .forEach((it) => { + it.remove() + }) this.sourceFile.addImportDeclaration({ namedImports: Array.from(this.httpMethodsUsed) @@ -174,7 +194,9 @@ export class TypescriptNextjsAppRouterBuilder implements ICompilable { const name = it.getName() return isHttpMethod(name) && !this.httpMethodsUsed.has(name) }) - .forEach((it) => it.remove()) + .forEach((it) => { + it.remove() + }) return new CompilationUnit( this.filename, diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts index a6ab0fa61..abdd00128 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts @@ -1,17 +1,15 @@ import type {Input} from "../../../core/input" import {isDefined, titleCase} from "../../../core/utils" import type {ImportBuilder} from "../../common/import-builder" -import {JoiBuilder} from "../../common/schema-builders/joi-schema-builder" import type {SchemaBuilder} from "../../common/schema-builders/schema-builder" -import {ZodBuilder} from "../../common/schema-builders/zod-schema-builder" import type {TypeBuilder} from "../../common/type-builder" import {constStatement} from "../../common/type-utils" import {buildExport} from "../../common/typescript-common" -import { - AbstractRouterBuilder, - type ServerSymbols, -} from "../abstract-router-builder" -import type {ServerOperationBuilder} from "../server-operation-builder" +import {AbstractRouterBuilder} from "../abstract-router-builder" +import type { + ServerOperationBuilder, + ServerSymbols, +} from "../server-operation-builder" export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { private readonly operationTypes: { @@ -51,14 +49,27 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { .from("@nahkies/typescript-nextjs-runtime/errors") .add("OpenAPIRuntimeError", "RequestInputType") - if (this.schemaBuilder instanceof ZodBuilder) { - this.imports - .from("@nahkies/typescript-nextjs-runtime/zod") - .add("parseRequestInput", "responseValidationFactory") - } else if (this.schemaBuilder instanceof JoiBuilder) { - this.imports - .from("@nahkies/typescript-nextjs-runtime/joi") - .add("parseRequestInput", "responseValidationFactory") + const schemaBuilderType = this.schemaBuilder.type + + switch (schemaBuilderType) { + case "joi": { + this.imports + .from("@nahkies/typescript-nextjs-runtime/joi") + .add("parseRequestInput", "responseValidationFactory") + break + } + case "zod-v3": + case "zod-v4": { + this.imports + .from("@nahkies/typescript-nextjs-runtime/zod") + .add("parseRequestInput", "responseValidationFactory") + break + } + default: { + throw new Error( + `unsupported schema builder type '${schemaBuilderType satisfies never}'`, + ) + } } } @@ -66,23 +77,16 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { const statements: string[] = [] const symbols = this.operationSymbols(builder.operationId) - const params = builder.parameters(symbols) + const params = builder.parameters() if (params.path.schema) { - statements.push(constStatement(symbols.paramSchema, params.path.schema)) + statements.push(constStatement(params.path.name, params.path.schema)) } if (params.query.schema) { - statements.push(constStatement(symbols.querySchema, params.query.schema)) + statements.push(constStatement(params.query.name, params.query.schema)) } if (params.header.schema) { - statements.push( - constStatement(symbols.requestHeaderSchema, params.header.schema), - ) - } - if (params.body.schema) { - statements.push( - constStatement(symbols.requestBodySchema, params.body.schema), - ) + statements.push(constStatement(params.header.name, params.header.schema)) } const responseSchemas = builder.responseSchemas() @@ -122,23 +126,24 @@ try { const input = { params: ${ params.path.schema - ? `parseRequestInput(${symbols.paramSchema}, await params, RequestInputType.RouteParam)` + ? `parseRequestInput(${params.path.name}, await params, RequestInputType.RouteParam)` : "undefined" }, // TODO: this swallows repeated parameters query: ${ params.query.schema - ? `parseRequestInput(${symbols.querySchema}, Object.fromEntries(request.nextUrl.searchParams.entries()), RequestInputType.QueryString)` + ? `parseRequestInput(${params.query.name}, Object.fromEntries(request.nextUrl.searchParams.entries()), RequestInputType.QueryString)` : "undefined" }, + ${params.body.schema && !params.body.isSupported ? `// todo: request bodies with content-type '${params.body.contentType}' not yet supported\n` : ""} body: ${ params.body.schema - ? `parseRequestInput(${symbols.requestBodySchema}, await request.json(), RequestInputType.RequestBody)` + ? `parseRequestInput(${params.body.schema}, await request.json(), RequestInputType.RequestBody)${!params.body.isSupported ? " as never" : ""}` : "undefined" }, headers: ${ params.header.schema - ? `parseRequestInput(${symbols.requestHeaderSchema}, Reflect.get(request, "headers"), RequestInputType.RequestHeader)` + ? `parseRequestInput(${params.header.name}, Reflect.get(request, "headers"), RequestInputType.RequestHeader)` : "undefined" } } @@ -172,10 +177,6 @@ try { implPropName: operationId, implTypeName: titleCase(operationId), responderName: `${titleCase(operationId)}Responder`, - paramSchema: `${operationId}ParamSchema`, - querySchema: `${operationId}QuerySchema`, - requestBodySchema: `${operationId}BodySchema`, - requestHeaderSchema: `${operationId}HeaderSchema`, responseBodyValidator: `${operationId}ResponseValidator`, } } diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts index 2cac55d49..fe2c1aebf 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs.generator.ts @@ -32,6 +32,13 @@ export async function generateTypescriptNextJS( config.compilerOptions, ) + const importBuilderConfig = { + includeFileExtensions: config.isEsmProject, + importAlias, + } + + const schemaBuilderImports = new ImportBuilder(importBuilderConfig) + // biome-ignore lint/complexity/useLiteralKeys: const subDirectory = process.env["OPENAPI_INTEGRATION_TESTS"] ? path.basename(config.input.loader.entryPointKey) @@ -57,6 +64,8 @@ export async function generateTypescriptNextJS( input, config.schemaBuilder, {allowAny}, + schemaBuilderImports, + rootTypeBuilder, ) const project = new Project({useInMemoryFileSystem: true}) @@ -69,7 +78,10 @@ export async function generateTypescriptNextJS( routeToNextJSFilepath(group.name), ) - const imports = new ImportBuilder({filename}, importAlias) + const imports = new ImportBuilder({ + ...importBuilderConfig, + unit: {filename}, + }) const routerBuilder = new TypescriptNextjsRouterBuilder( filename, @@ -117,10 +129,10 @@ export async function generateTypescriptNextJS( ).flat() const clientOutputPath = [generatedDirectory, "client.ts"].join(path.sep) - const clientImportBuilder = new ImportBuilder( - {filename: clientOutputPath}, - importAlias, - ) + const clientImportBuilder = new ImportBuilder({ + ...importBuilderConfig, + unit: {filename: clientOutputPath}, + }) const fetchClientBuilder = new TypescriptFetchClientBuilder( clientOutputPath, From 26240b7069a875dc8f3a8a529e49417c4736bec2 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Tue, 23 Dec 2025 11:02:17 +0000 Subject: [PATCH 18/22] fix: rebase --- .../src/typescript/common/import-builder.ts | 8 +-- .../typescript-nextjs-app-router-builder.ts | 17 +++--- .../typescript-nextjs-router-builder.ts | 37 ++++++------ .../typescript-nextjs-runtime/package.json | 23 +++++--- .../typescript-nextjs-runtime/src/errors.ts | 6 ++ packages/typescript-nextjs-runtime/src/joi.ts | 4 +- .../typescript-nextjs-runtime/src/server.ts | 17 +++++- .../src/{zod.ts => zod-v3.ts} | 2 +- .../typescript-nextjs-runtime/src/zod-v4.ts | 56 +++++++++++++++++++ 9 files changed, 125 insertions(+), 45 deletions(-) rename packages/typescript-nextjs-runtime/src/{zod.ts => zod-v3.ts} (98%) create mode 100644 packages/typescript-nextjs-runtime/src/zod-v4.ts diff --git a/packages/openapi-code-generator/src/typescript/common/import-builder.ts b/packages/openapi-code-generator/src/typescript/common/import-builder.ts index 014f5d619..df8338059 100644 --- a/packages/openapi-code-generator/src/typescript/common/import-builder.ts +++ b/packages/openapi-code-generator/src/typescript/common/import-builder.ts @@ -195,7 +195,7 @@ export class ImportBuilder { isType: boolean, ): void { // biome-ignore lint/style/noParameterAssign: normalization - from = this.normalizeFrom(from) + from = this.normalizeFrom(from, this.config.unit?.filename) if (!this.imports[from]) { this.imports[from] = { @@ -225,21 +225,21 @@ export class ImportBuilder { } } - normalizeFrom(from: string) { + normalizeFrom(from: string, filename?: string) { if (!this.config.includeFileExtensions && from.endsWith(".ts")) { // biome-ignore lint/style/noParameterAssign: normalization from = from.substring(0, from.length - ".ts".length) } // TODO: does this work on windows? - if (this.config.unit && from.startsWith("./")) { + if (filename && from.startsWith("./")) { if (this.config.importAlias) { return ( this.config.importAlias + from.split(path.sep).slice(1).join(path.sep) ) } - const unitDirname = path.dirname(this.config.unit.filename) + const unitDirname = path.dirname(filename) const fromDirname = path.dirname(from) const relative = path.relative(unitDirname, fromDirname) diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts index 0ebc09c92..7ea921d43 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-app-router-builder.ts @@ -96,18 +96,18 @@ export class TypescriptNextjsAppRouterBuilder implements ICompilable { }) // Replace the params based on what inputs we have - // biome-ignore lint/style/noNonNullAssertion: + // biome-ignore lint/style/noNonNullAssertion: ignore const declarations = variableDeclaration.getDeclarations()[0]! const callExpression = declarations.getInitializerIfKindOrThrow( SyntaxKind.CallExpression, ) - // biome-ignore lint/style/noNonNullAssertion: + // biome-ignore lint/style/noNonNullAssertion: ignore const implementationFunction = callExpression .getArguments()[0]! .asKind(SyntaxKind.ArrowFunction)! - // biome-ignore lint/complexity/noForEach: + // biome-ignore lint/complexity/noForEach: ignore implementationFunction?.getParameters().forEach((parameter) => { parameter.remove() }) @@ -123,6 +123,10 @@ export class TypescriptNextjsAppRouterBuilder implements ICompilable { .filter(isDefined) .join(",")}}`, }) + } else { + implementationFunction?.addParameter({ + name: "_params", + }) } implementationFunction?.addParameter({name: "respond"}) @@ -169,10 +173,9 @@ export class TypescriptNextjsAppRouterBuilder implements ICompilable { const imports = this.sourceFile.getImportDeclarations() const from = this.imports.normalizeFrom( `./${this.companionFilename}`, - // todo - // `./${this.filename}`, + `./${this.filename}`, ) - // biome-ignore lint/complexity/noForEach: + // biome-ignore lint/complexity/noForEach: ignore imports .filter((it) => it.getModuleSpecifierValue().includes(from)) .forEach((it) => { @@ -187,7 +190,7 @@ export class TypescriptNextjsAppRouterBuilder implements ICompilable { }) // Remove any methods that were removed from the spec - // biome-ignore lint/complexity/noForEach: + // biome-ignore lint/complexity/noForEach: ignore this.sourceFile .getVariableDeclarations() .filter((it) => { diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts index abdd00128..595a87662 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-nextjs/typescript-nextjs-router-builder.ts @@ -17,7 +17,7 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { statements: string[] }[] = [] - // biome-ignore lint/complexity/noUselessConstructor: + // biome-ignore lint/complexity/noUselessConstructor: ignore constructor( filename: string, name: string, @@ -32,8 +32,8 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { protected buildImports(): void { this.imports .from("@nahkies/typescript-nextjs-runtime/server") - .add( - "OpenAPIRuntimeResponse", + .add("OpenAPIRuntimeResponse") + .addType( "OpenAPIRuntimeResponder", "Params", "StatusCode2xx", @@ -43,7 +43,7 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { "StatusCode", ) - this.imports.from("next/server").add("NextRequest", "NextResponse") + this.imports.from("next/server").addType("NextRequest", "NextResponse") this.imports .from("@nahkies/typescript-nextjs-runtime/errors") @@ -58,10 +58,15 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { .add("parseRequestInput", "responseValidationFactory") break } - case "zod-v3": + case "zod-v3": { + this.imports + .from("@nahkies/typescript-nextjs-runtime/zod-v3") + .add("parseRequestInput", "responseValidationFactory") + break + } case "zod-v4": { this.imports - .from("@nahkies/typescript-nextjs-runtime/zod") + .from("@nahkies/typescript-nextjs-runtime/zod-v4") .add("parseRequestInput", "responseValidationFactory") break } @@ -106,7 +111,7 @@ export class TypescriptNextjsRouterBuilder extends AbstractRouterBuilder { buildExport({ name: symbols.implTypeName, value: `(${[ - params.hasParams ? `params: ${params.type}` : undefined, + `params: ${params.type}`, `respond: ${symbols.responderName}`, "request: NextRequest", ] @@ -129,14 +134,13 @@ try { ? `parseRequestInput(${params.path.name}, await params, RequestInputType.RouteParam)` : "undefined" }, - // TODO: this swallows repeated parameters + // todo: this swallows repeated parameters query: ${ params.query.schema ? `parseRequestInput(${params.query.name}, Object.fromEntries(request.nextUrl.searchParams.entries()), RequestInputType.QueryString)` : "undefined" }, - ${params.body.schema && !params.body.isSupported ? `// todo: request bodies with content-type '${params.body.contentType}' not yet supported\n` : ""} - body: ${ + ${params.body.schema && !params.body.isSupported ? `// todo: request bodies with content-type '${params.body.contentType}' not yet supported\n` : ""}body: ${ params.body.schema ? `parseRequestInput(${params.body.schema}, await request.json(), RequestInputType.RequestBody)${!params.body.isSupported ? " as never" : ""}` : "undefined" @@ -150,16 +154,9 @@ try { const responder = ${responder.implementation} - const res = await implementation(${[params.hasParams ? "input" : undefined, "responder", "request"].filter(isDefined).join(",")}) - .then(it => { - if(it instanceof Response) { - return it - } - const {status, body} = it.unpack() - - return body !== undefined ? Response.json(body, {status}) : new Response(undefined, {status}) - }) - .catch(err => { throw OpenAPIRuntimeError.HandlerError(err) }) + const res = await implementation(input, responder, request) + .then(OpenAPIRuntimeResponse.unwrap) + .catch(OpenAPIRuntimeError.wrapped(OpenAPIRuntimeError.HandlerError)) return res } catch (err) { diff --git a/packages/typescript-nextjs-runtime/package.json b/packages/typescript-nextjs-runtime/package.json index 706115240..34cfae930 100644 --- a/packages/typescript-nextjs-runtime/package.json +++ b/packages/typescript-nextjs-runtime/package.json @@ -32,10 +32,15 @@ "import": "./dist/joi.js", "types": "./dist/joi.d.ts" }, - "./zod": { - "require": "./dist/zod.js", - "import": "./dist/zod.js", - "types": "./dist/zod.d.ts" + "./zod-v3": { + "require": "./dist/zod-v3.js", + "import": "./dist/zod-v3.js", + "types": "./dist/zod-v3.d.ts" + }, + "./zod-v4": { + "require": "./dist/zod-v4.js", + "import": "./dist/zod-v4.js", + "types": "./dist/zod-v4.d.ts" } }, "scripts": { @@ -44,9 +49,9 @@ "test": "jest" }, "peerDependencies": { - "joi": "^17.1.1", + "joi": "^17.13.3 || ^18.0.1", "next": "^16.1.0", - "zod": "^3.20.6" + "zod": "^3.25.74 || ^4.1.12" }, "peerDependenciesMeta": { "joi": { @@ -57,9 +62,9 @@ } }, "devDependencies": { - "jest": "^30.0.4", - "joi": "^17.13.3", - "typescript": "~5.8.3", + "jest": "^30.2.0", + "joi": "^18.0.2", + "typescript": "^5.9.3", "zod": "^3.25.74" }, "files": [ diff --git a/packages/typescript-nextjs-runtime/src/errors.ts b/packages/typescript-nextjs-runtime/src/errors.ts index 4410ef1d5..40db7708a 100644 --- a/packages/typescript-nextjs-runtime/src/errors.ts +++ b/packages/typescript-nextjs-runtime/src/errors.ts @@ -47,4 +47,10 @@ export class OpenAPIRuntimeError extends Error { static isOpenAPIError(err: unknown): err is OpenAPIRuntimeError { return err instanceof OpenAPIRuntimeError } + + static wrapped(fn: (err: unknown) => OpenAPIRuntimeError) { + return (err: unknown) => { + throw fn(err) + } + } } diff --git a/packages/typescript-nextjs-runtime/src/joi.ts b/packages/typescript-nextjs-runtime/src/joi.ts index 8cfb06d91..d5573006a 100644 --- a/packages/typescript-nextjs-runtime/src/joi.ts +++ b/packages/typescript-nextjs-runtime/src/joi.ts @@ -7,7 +7,7 @@ export function parseRequestInput( schema: Schema, input: unknown, type: RequestInputType, - // biome-ignore lint/suspicious/noExplicitAny: + // biome-ignore lint/suspicious/noExplicitAny: needed ): any export function parseRequestInput( schema: undefined, @@ -18,7 +18,7 @@ export function parseRequestInput( schema: Schema | undefined, input: unknown, type: RequestInputType, - // biome-ignore lint/suspicious/noExplicitAny: + // biome-ignore lint/suspicious/noExplicitAny: needed ): any { try { if (!schema) { diff --git a/packages/typescript-nextjs-runtime/src/server.ts b/packages/typescript-nextjs-runtime/src/server.ts index 6767e06c8..53e770f87 100644 --- a/packages/typescript-nextjs-runtime/src/server.ts +++ b/packages/typescript-nextjs-runtime/src/server.ts @@ -1,4 +1,6 @@ // from https://stackoverflow.com/questions/39494689/is-it-possible-to-restrict-number-to-a-certain-range +import {OpenAPIRuntimeError} from "./errors" + type Enumerate< N extends number, Acc extends number[] = [], @@ -24,7 +26,7 @@ export type StatusCode = | StatusCode4xx | StatusCode5xx -export type Response = { +export type Res = { status: Status body: Type } @@ -39,9 +41,20 @@ export class OpenAPIRuntimeResponse { return this } - unpack(): Response { + unpack(): Res { return {status: this.status, body: this._body} } + + static unwrap(it: OpenAPIRuntimeResponse | Response): Response { + if (it instanceof Response) { + return it + } + const {status, body} = it.unpack() + + return body !== undefined + ? Response.json(body, {status}) + : new Response(undefined, {status}) + } } export type OpenAPIRuntimeResponder< diff --git a/packages/typescript-nextjs-runtime/src/zod.ts b/packages/typescript-nextjs-runtime/src/zod-v3.ts similarity index 98% rename from packages/typescript-nextjs-runtime/src/zod.ts rename to packages/typescript-nextjs-runtime/src/zod-v3.ts index 76dac8251..3664aaf9d 100644 --- a/packages/typescript-nextjs-runtime/src/zod.ts +++ b/packages/typescript-nextjs-runtime/src/zod-v3.ts @@ -1,4 +1,4 @@ -import type {z} from "zod" +import type {z} from "zod/v3" import {OpenAPIRuntimeError, type RequestInputType} from "./errors" export function parseRequestInput( diff --git a/packages/typescript-nextjs-runtime/src/zod-v4.ts b/packages/typescript-nextjs-runtime/src/zod-v4.ts new file mode 100644 index 000000000..575816ef7 --- /dev/null +++ b/packages/typescript-nextjs-runtime/src/zod-v4.ts @@ -0,0 +1,56 @@ +import type {z} from "zod/v4" +import {OpenAPIRuntimeError, type RequestInputType} from "./errors" + +export function parseRequestInput( + schema: Schema, + input: unknown, + type: RequestInputType, +): z.infer +export function parseRequestInput( + schema: undefined, + input: unknown, + type: RequestInputType, +): undefined +export function parseRequestInput( + schema: Schema | undefined, + input: unknown, + type: RequestInputType, +): z.infer | undefined { + try { + return schema?.parse(input) + } catch (err) { + throw OpenAPIRuntimeError.RequestError(err, type) + } +} + +// TODO: optional response validation +export function responseValidationFactory( + possibleResponses: [string, z.ZodTypeAny][], + defaultResponse?: z.ZodTypeAny, +) { + // Exploit the natural ordering matching the desired specificity of eg: 404 vs 4xx + possibleResponses.sort((x, y) => (x[0] < y[0] ? -1 : 1)) + + return (status: number, value: unknown) => { + try { + for (const [match, schema] of possibleResponses) { + const isMatch = + (/^\d+$/.test(match) && String(status) === match) || + (/^\d[xX]{2}$/.test(match) && String(status)[0] === match[0]) + + if (isMatch) { + return schema.parse(value) + } + } + + if (defaultResponse) { + return defaultResponse.parse(value) + } + + // TODO: throw on unmatched response + return value + } catch (err) { + throw OpenAPIRuntimeError.ResponseError(err) + } + } +} From 466f89c3a6ba2310c06437bacda1ca377aed9b4f Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Tue, 23 Dec 2025 11:02:38 +0000 Subject: [PATCH 19/22] fix: deps --- .../typescript-nextjs/package.json | 11 ++- pnpm-lock.yaml | 79 ++++++------------- 2 files changed, 30 insertions(+), 60 deletions(-) diff --git a/integration-tests/typescript-nextjs/package.json b/integration-tests/typescript-nextjs/package.json index e96b1378c..0b9305f17 100644 --- a/integration-tests/typescript-nextjs/package.json +++ b/integration-tests/typescript-nextjs/package.json @@ -11,15 +11,20 @@ "validate": "tsc -p ./tsconfig.json" }, "dependencies": { - "@nahkies/typescript-nextjs-runtime": "*", + "@nahkies/typescript-fetch-runtime": "workspace:*", + "@nahkies/typescript-nextjs-runtime": "workspace:*", + "joi": "^18.0.2", "next": "^16.1.0", "react": "^19.1.0", - "react-dom": "^19.1.0" + "react-dom": "^19.1.0", + "tslib": "^2.8.1", + "zod": "^3.25.74" + }, "devDependencies": { "@types/node": "^22.16.0", "@types/react": "^19.1.8", "@types/react-dom": "^19.1.6", - "typescript": "^5.8.3" + "typescript": "^5.9.3" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ed5a87603..87ab93bbe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -276,9 +276,15 @@ importers: integration-tests/typescript-nextjs: dependencies: + '@nahkies/typescript-fetch-runtime': + specifier: workspace:* + version: link:../../packages/typescript-fetch-runtime '@nahkies/typescript-nextjs-runtime': - specifier: '*' + specifier: workspace:* version: link:../../packages/typescript-nextjs-runtime + joi: + specifier: ^18.0.2 + version: 18.0.2 next: specifier: ^16.1.0 version: 16.1.0(@babel/core@7.28.5)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.93.2) @@ -288,6 +294,12 @@ importers: react-dom: specifier: ^19.1.0 version: 19.2.3(react@19.2.3) + tslib: + specifier: ^2.8.1 + version: 2.8.1 + zod: + specifier: ^3.25.74 + version: 3.25.76 devDependencies: '@types/node': specifier: 22.16.5 @@ -299,7 +311,7 @@ importers: specifier: ^19.1.6 version: 19.2.3(@types/react@19.2.7) typescript: - specifier: ^5.8.3 + specifier: ^5.9.3 version: 5.9.3 packages/documentation: @@ -646,14 +658,14 @@ importers: version: 16.1.0(@babel/core@7.28.5)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.93.2) devDependencies: jest: - specifier: ^30.0.4 + specifier: ^30.2.0 version: 30.2.0(@types/node@22.16.5) joi: - specifier: ^17.13.3 - version: 17.13.3 + specifier: ^18.0.2 + version: 18.0.2 typescript: - specifier: ~5.8.3 - version: 5.8.3 + specifier: ^5.9.3 + version: 5.9.3 zod: specifier: ^3.25.74 version: 3.25.76 @@ -1695,9 +1707,6 @@ packages: '@hapi/hoek@11.0.7': resolution: {integrity: sha512-HV5undWkKzcB4RZUusqOpcgxOaq6VOAH7zhhIr2g3G8NF/MlFO75SjOr2NfuSx0Mh40+1FqCkagKLJRykUWoFQ==} - '@hapi/hoek@9.3.0': - resolution: {integrity: sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==} - '@hapi/pinpoint@2.0.1': resolution: {integrity: sha512-EKQmr16tM8s16vTT3cA5L0kZZcTMU5DUOZTuvpnY738m+jyP3JIUj+Mm1xc1rsLkGBQ/gVnfKYPwOmPg1tUR4Q==} @@ -1705,9 +1714,6 @@ packages: resolution: {integrity: sha512-Fq+20dxsxLaUn5jSSWrdtSRcIUba2JquuorF9UW1wIJS5cSUwxIsO2GIhaWynPRflvxSzFN+gxKte2HEW1OuoA==} engines: {node: '>=14.0.0'} - '@hapi/topo@5.1.0': - resolution: {integrity: sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==} - '@hapi/topo@6.0.2': resolution: {integrity: sha512-KR3rD5inZbGMrHmgPxsJ9dbi6zEK+C3ZwUwTa+eMwWLz7oijWUTWD2pMSNNYJAU6Qq+65NkxXjqHr/7LM2Xkqg==} @@ -3321,15 +3327,6 @@ packages: '@shikijs/vscode-textmate@10.0.2': resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==} - '@sideway/address@4.1.5': - resolution: {integrity: sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==} - - '@sideway/formula@3.0.1': - resolution: {integrity: sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==} - - '@sideway/pinpoint@2.0.0': - resolution: {integrity: sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==} - '@sigstore/bundle@4.0.0': resolution: {integrity: sha512-NwCl5Y0V6Di0NexvkTqdoVfmjTaQwoLM236r89KEojGmq/jMls8S+zb7yOwAPdXvbwfKDlP+lmXgAL4vKSQT+A==} engines: {node: ^20.17.0 || >=22.9.0} @@ -6037,9 +6034,6 @@ packages: node-notifier: optional: true - joi@17.13.3: - resolution: {integrity: sha512-otDA4ldcIx+ZXsKHWmp0YizCweVRZG96J10b0FevjfuncLO1oX59THoAmHkNubYJ+9gWsYsp5k8v4ib6oDv1fA==} - joi@18.0.2: resolution: {integrity: sha512-RuCOQMIt78LWnktPoeBL0GErkNaJPTBGcYuyaBvUOQSpcpcLfWrHPPihYdOGbV5pam9VTWbeoF7TsGiHugcjGA==} engines: {node: '>= 20'} @@ -8038,11 +8032,6 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} - typescript@5.8.3: - resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} - engines: {node: '>=14.17'} - hasBin: true - typescript@5.9.3: resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} engines: {node: '>=14.17'} @@ -9318,16 +9307,10 @@ snapshots: '@hapi/hoek@11.0.7': {} - '@hapi/hoek@9.3.0': {} - '@hapi/pinpoint@2.0.1': {} '@hapi/tlds@1.1.4': {} - '@hapi/topo@5.1.0': - dependencies: - '@hapi/hoek': 9.3.0 - '@hapi/topo@6.0.2': dependencies: '@hapi/hoek': 11.0.7 @@ -10952,14 +10935,6 @@ snapshots: '@shikijs/vscode-textmate@10.0.2': {} - '@sideway/address@4.1.5': - dependencies: - '@hapi/hoek': 9.3.0 - - '@sideway/formula@3.0.1': {} - - '@sideway/pinpoint@2.0.0': {} - '@sigstore/bundle@4.0.0': dependencies: '@sigstore/protobuf-specs': 0.5.0 @@ -14076,14 +14051,6 @@ snapshots: - supports-color - ts-node - joi@17.13.3: - dependencies: - '@hapi/hoek': 9.3.0 - '@hapi/topo': 5.1.0 - '@sideway/address': 4.1.5 - '@sideway/formula': 3.0.1 - '@sideway/pinpoint': 2.0.0 - joi@18.0.2: dependencies: '@hapi/address': 5.1.1 @@ -14383,7 +14350,7 @@ snapshots: log-symbols@4.1.0: dependencies: - chalk: 4.1.0 + chalk: 4.1.2 is-unicode-supported: 0.1.0 log-symbols@7.0.1: @@ -15407,7 +15374,7 @@ snapshots: dependencies: hosted-git-info: 8.1.0 proc-log: 5.0.0 - semver: 7.7.2 + semver: 7.7.3 validate-npm-package-name: 6.0.2 npm-package-arg@13.0.1: @@ -15569,7 +15536,7 @@ snapshots: ora@5.3.0: dependencies: bl: 4.1.0 - chalk: 4.1.0 + chalk: 4.1.2 cli-cursor: 3.1.0 cli-spinners: 2.6.1 is-interactive: 1.0.0 @@ -16895,8 +16862,6 @@ snapshots: typedarray@0.0.6: {} - typescript@5.8.3: {} - typescript@5.9.3: {} ufo@1.6.1: {} From 8974ef32d0b4caf1d36b9c8506c3a88b0918b4a5 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Tue, 23 Dec 2025 11:03:42 +0000 Subject: [PATCH 20/22] chore: regenerate --- .../typescript-nextjs/src/app/page.module.css | 4 +- .../app/todo-lists.yaml/attachments/route.ts | 2 +- .../todo-lists.yaml/attachments/route.ts | 60 ++++--------- .../src/generated/todo-lists.yaml/client.ts | 78 +++++++++-------- .../list/[listId]/items/route.ts | 69 +++++---------- .../todo-lists.yaml/list/[listId]/route.ts | 87 ++++++------------- .../generated/todo-lists.yaml/list/route.ts | 35 +++----- .../src/generated/todo-lists.yaml/models.ts | 18 ++-- .../src/generated/todo-lists.yaml/schemas.ts | 14 ++- 9 files changed, 140 insertions(+), 227 deletions(-) diff --git a/integration-tests/typescript-nextjs/src/app/page.module.css b/integration-tests/typescript-nextjs/src/app/page.module.css index 5c4b1e6a2..d979f776c 100644 --- a/integration-tests/typescript-nextjs/src/app/page.module.css +++ b/integration-tests/typescript-nextjs/src/app/page.module.css @@ -51,7 +51,9 @@ border-radius: var(--border-radius); background: rgba(var(--card-rgb), 0); border: 1px solid rgba(var(--card-border-rgb), 0); - transition: background 200ms, border 200ms; + transition: + background 200ms, + border 200ms; } .card span { diff --git a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts index c471fabe4..87d8204bb 100644 --- a/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts +++ b/integration-tests/typescript-nextjs/src/app/todo-lists.yaml/attachments/route.ts @@ -1,7 +1,7 @@ import {_GET, _POST} from "../../../generated/todo-lists.yaml/attachments/route" export const GET = _GET( - async (respond, request) => { + async (_params, respond, request) => { // TODO: implementation return respond.withStatus(501).body({message: "not implemented"} as any) }, diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts index f1bcb2668..2fae68bef 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts @@ -2,20 +2,20 @@ /* tslint:disable */ /* eslint-disable */ -import {t_UnknownObject, t_UploadAttachmentBodySchema} from "../models" import { OpenAPIRuntimeError, RequestInputType, } from "@nahkies/typescript-nextjs-runtime/errors" import { - OpenAPIRuntimeResponder, + type OpenAPIRuntimeResponder, OpenAPIRuntimeResponse, - Params, - StatusCode, + type Params, + type StatusCode, } from "@nahkies/typescript-nextjs-runtime/server" -import {parseRequestInput} from "@nahkies/typescript-nextjs-runtime/zod" -import {NextRequest} from "next/server" -import {z} from "zod" +import {parseRequestInput} from "@nahkies/typescript-nextjs-runtime/zod-v4" +import type {NextRequest} from "next/server" +import {z} from "zod/v4" +import type {t_UnknownObject} from "../models" // /attachments export type ListAttachmentsResponder = { @@ -23,6 +23,7 @@ export type ListAttachmentsResponder = { } & OpenAPIRuntimeResponder export type ListAttachments = ( + params: Params, respond: ListAttachmentsResponder, request: NextRequest, ) => Promise> @@ -32,7 +33,7 @@ export type UploadAttachmentResponder = { } & OpenAPIRuntimeResponder export type UploadAttachment = ( - params: Params, + params: Params, respond: UploadAttachmentResponder, request: NextRequest, ) => Promise> @@ -46,7 +47,7 @@ export const _GET = try { const input = { params: undefined, - // TODO: this swallows repeated parameters + // todo: this swallows repeated parameters query: undefined, body: undefined, headers: undefined, @@ -61,20 +62,9 @@ export const _GET = }, } - const res = await implementation(responder, request) - .then((it) => { - if (it instanceof Response) { - return it - } - const {status, body} = it.unpack() - - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) - }) - .catch((err) => { - throw OpenAPIRuntimeError.HandlerError(err) - }) + const res = await implementation(input, responder, request) + .then(OpenAPIRuntimeResponse.unwrap) + .catch(OpenAPIRuntimeError.wrapped(OpenAPIRuntimeError.HandlerError)) return res } catch (err) { @@ -82,8 +72,6 @@ export const _GET = } } -const uploadAttachmentBodySchema = z.object({file: z.unknown().optional()}) - export const _POST = ( implementation: UploadAttachment, @@ -93,13 +81,14 @@ export const _POST = try { const input = { params: undefined, - // TODO: this swallows repeated parameters + // todo: this swallows repeated parameters query: undefined, + // todo: request bodies with content-type 'multipart/form-data' not yet supported body: parseRequestInput( - uploadAttachmentBodySchema, + z.never(), await request.json(), RequestInputType.RequestBody, - ), + ) as never, headers: undefined, } @@ -113,19 +102,8 @@ export const _POST = } const res = await implementation(input, responder, request) - .then((it) => { - if (it instanceof Response) { - return it - } - const {status, body} = it.unpack() - - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) - }) - .catch((err) => { - throw OpenAPIRuntimeError.HandlerError(err) - }) + .then(OpenAPIRuntimeResponse.unwrap) + .catch(OpenAPIRuntimeError.wrapped(OpenAPIRuntimeError.HandlerError)) return res } catch (err) { diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/client.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/client.ts index 053a38dcc..a6f28d2a3 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/client.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/client.ts @@ -3,21 +3,22 @@ /* eslint-disable */ import { + AbstractFetchClient, + type AbstractFetchClientConfig, + type Res, + type Server, + type StatusCode, + type StatusCode4xx, + type StatusCode5xx, +} from "@nahkies/typescript-fetch-runtime/main" +import type { + t_CreateTodoListItemRequestBody, t_CreateUpdateTodoList, t_Error, t_Statuses, t_TodoList, t_UnknownObject, } from "./models" -import { - AbstractFetchClient, - AbstractFetchClientConfig, - Res, - Server, - StatusCode, - StatusCode4xx, - StatusCode5xx, -} from "@nahkies/typescript-fetch-runtime/main" export class ApiClientServersOperations { static listAttachments(url?: "{schema}://{tenant}.attachments.example.com"): { @@ -164,12 +165,20 @@ export class ApiClient extends AbstractFetchClient { opts: RequestInit = {}, ): Promise> { const url = this.basePath + `/list` - const headers = this._headers({}, opts.headers) - const query = this._query({ - created: p["created"], - statuses: p["statuses"], - tags: p["tags"], - }) + const headers = this._headers({Accept: "application/json"}, opts.headers) + const query = this._query( + {created: p["created"], statuses: p["statuses"], tags: p["tags"]}, + { + statuses: { + style: "form", + explode: true, + }, + tags: { + style: "form", + explode: true, + }, + }, + ) return this._fetch(url + query, {method: "GET", ...opts, headers}, timeout) } @@ -184,7 +193,7 @@ export class ApiClient extends AbstractFetchClient { Res<200, t_TodoList> | Res | Res > { const url = this.basePath + `/list/${p["listId"]}` - const headers = this._headers({}, opts.headers) + const headers = this._headers({Accept: "application/json"}, opts.headers) return this._fetch(url, {method: "GET", ...opts, headers}, timeout) } @@ -201,7 +210,7 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/list/${p["listId"]}` const headers = this._headers( - {"Content-Type": "application/json"}, + {Accept: "application/json", "Content-Type": "application/json"}, opts.headers, ) const body = JSON.stringify(p.requestBody) @@ -219,7 +228,7 @@ export class ApiClient extends AbstractFetchClient { Res<204, void> | Res | Res > { const url = this.basePath + `/list/${p["listId"]}` - const headers = this._headers({}, opts.headers) + const headers = this._headers({Accept: "application/json"}, opts.headers) return this._fetch(url, {method: "DELETE", ...opts, headers}, timeout) } @@ -249,7 +258,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/list/${p["listId"]}/items` - const headers = this._headers({}, opts.headers) + const headers = this._headers({Accept: "application/json"}, opts.headers) return this._fetch(url, {method: "GET", ...opts, headers}, timeout) } @@ -257,18 +266,14 @@ export class ApiClient extends AbstractFetchClient { async createTodoListItem( p: { listId: string - requestBody: { - completedAt?: string - content: string - id: string - } + requestBody: t_CreateTodoListItemRequestBody }, timeout?: number, opts: RequestInit = {}, ): Promise> { const url = this.basePath + `/list/${p["listId"]}/items` const headers = this._headers( - {"Content-Type": "application/json"}, + {Accept: "application/json", "Content-Type": "application/json"}, opts.headers, ) const body = JSON.stringify(p.requestBody) @@ -284,16 +289,14 @@ export class ApiClient extends AbstractFetchClient { opts: RequestInit = {}, ): Promise> { const url = basePath + `/attachments` - const headers = this._headers({}, opts.headers) + const headers = this._headers({Accept: "application/json"}, opts.headers) return this._fetch(url, {method: "GET", ...opts, headers}, timeout) } async uploadAttachment( p: { - requestBody: { - file?: unknown - } + requestBody: never }, basePath: | Server<"uploadAttachment_ApiClient"> @@ -302,12 +305,17 @@ export class ApiClient extends AbstractFetchClient { opts: RequestInit = {}, ): Promise> { const url = basePath + `/attachments` - const headers = this._headers( - {"Content-Type": "multipart/form-data"}, - opts.headers, - ) - const body = JSON.stringify(p.requestBody) + const headers = this._headers({Accept: "application/json"}, opts.headers) - return this._fetch(url, {method: "POST", body, ...opts, headers}, timeout) + return this._fetch( + url, + { + method: "POST", + // todo: request bodies with content-type 'multipart/form-data' not yet supported, + ...opts, + headers, + }, + timeout, + ) } } diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts index bf394fb06..66ad35712 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/items/route.ts @@ -2,25 +2,26 @@ /* tslint:disable */ /* eslint-disable */ -import { - t_CreateTodoListItemBodySchema, - t_CreateTodoListItemParamSchema, - t_GetTodoListItemsParamSchema, -} from "../../../models" import { OpenAPIRuntimeError, RequestInputType, } from "@nahkies/typescript-nextjs-runtime/errors" import { - OpenAPIRuntimeResponder, + type OpenAPIRuntimeResponder, OpenAPIRuntimeResponse, - Params, - StatusCode, - StatusCode5xx, + type Params, + type StatusCode, + type StatusCode5xx, } from "@nahkies/typescript-nextjs-runtime/server" -import {parseRequestInput} from "@nahkies/typescript-nextjs-runtime/zod" -import {NextRequest} from "next/server" -import {z} from "zod" +import {parseRequestInput} from "@nahkies/typescript-nextjs-runtime/zod-v4" +import type {NextRequest} from "next/server" +import {z} from "zod/v4" +import type { + t_CreateTodoListItemParamSchema, + t_CreateTodoListItemRequestBody, + t_GetTodoListItemsParamSchema, +} from "../../../models" +import {s_CreateTodoListItemRequestBody} from "../../../schemas" // /list/{listId}/items export type GetTodoListItemsResponder = { @@ -50,7 +51,7 @@ export type CreateTodoListItem = ( params: Params< t_CreateTodoListItemParamSchema, void, - t_CreateTodoListItemBodySchema, + t_CreateTodoListItemRequestBody, void >, respond: CreateTodoListItemResponder, @@ -75,7 +76,7 @@ export const _GET = await params, RequestInputType.RouteParam, ), - // TODO: this swallows repeated parameters + // todo: this swallows repeated parameters query: undefined, body: undefined, headers: undefined, @@ -102,19 +103,8 @@ export const _GET = } const res = await implementation(input, responder, request) - .then((it) => { - if (it instanceof Response) { - return it - } - const {status, body} = it.unpack() - - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) - }) - .catch((err) => { - throw OpenAPIRuntimeError.HandlerError(err) - }) + .then(OpenAPIRuntimeResponse.unwrap) + .catch(OpenAPIRuntimeError.wrapped(OpenAPIRuntimeError.HandlerError)) return res } catch (err) { @@ -124,12 +114,6 @@ export const _GET = const createTodoListItemParamSchema = z.object({listId: z.string()}) -const createTodoListItemBodySchema = z.object({ - id: z.string(), - content: z.string(), - completedAt: z.string().datetime({offset: true}).optional(), -}) - export const _POST = ( implementation: CreateTodoListItem, @@ -146,10 +130,10 @@ export const _POST = await params, RequestInputType.RouteParam, ), - // TODO: this swallows repeated parameters + // todo: this swallows repeated parameters query: undefined, body: parseRequestInput( - createTodoListItemBodySchema, + s_CreateTodoListItemRequestBody, await request.json(), RequestInputType.RequestBody, ), @@ -166,19 +150,8 @@ export const _POST = } const res = await implementation(input, responder, request) - .then((it) => { - if (it instanceof Response) { - return it - } - const {status, body} = it.unpack() - - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) - }) - .catch((err) => { - throw OpenAPIRuntimeError.HandlerError(err) - }) + .then(OpenAPIRuntimeResponse.unwrap) + .catch(OpenAPIRuntimeError.wrapped(OpenAPIRuntimeError.HandlerError)) return res } catch (err) { diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts index 52b3d1ff9..11cbdac1c 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/[listId]/route.ts @@ -3,28 +3,28 @@ /* eslint-disable */ import { + OpenAPIRuntimeError, + RequestInputType, +} from "@nahkies/typescript-nextjs-runtime/errors" +import { + type OpenAPIRuntimeResponder, + OpenAPIRuntimeResponse, + type Params, + type StatusCode, + type StatusCode4xx, +} from "@nahkies/typescript-nextjs-runtime/server" +import {parseRequestInput} from "@nahkies/typescript-nextjs-runtime/zod-v4" +import type {NextRequest} from "next/server" +import {z} from "zod/v4" +import type { + t_CreateUpdateTodoList, t_DeleteTodoListByIdParamSchema, t_Error, t_GetTodoListByIdParamSchema, t_TodoList, - t_UpdateTodoListByIdBodySchema, t_UpdateTodoListByIdParamSchema, } from "../../models" import {s_CreateUpdateTodoList} from "../../schemas" -import { - OpenAPIRuntimeError, - RequestInputType, -} from "@nahkies/typescript-nextjs-runtime/errors" -import { - OpenAPIRuntimeResponder, - OpenAPIRuntimeResponse, - Params, - StatusCode, - StatusCode4xx, -} from "@nahkies/typescript-nextjs-runtime/server" -import {parseRequestInput} from "@nahkies/typescript-nextjs-runtime/zod" -import {NextRequest} from "next/server" -import {z} from "zod" // /list/{listId} export type GetTodoListByIdResponder = { @@ -49,7 +49,7 @@ export type UpdateTodoListById = ( params: Params< t_UpdateTodoListByIdParamSchema, void, - t_UpdateTodoListByIdBodySchema, + t_CreateUpdateTodoList, void >, respond: UpdateTodoListByIdResponder, @@ -86,7 +86,7 @@ export const _GET = await params, RequestInputType.RouteParam, ), - // TODO: this swallows repeated parameters + // todo: this swallows repeated parameters query: undefined, body: undefined, headers: undefined, @@ -108,19 +108,8 @@ export const _GET = } const res = await implementation(input, responder, request) - .then((it) => { - if (it instanceof Response) { - return it - } - const {status, body} = it.unpack() - - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) - }) - .catch((err) => { - throw OpenAPIRuntimeError.HandlerError(err) - }) + .then(OpenAPIRuntimeResponse.unwrap) + .catch(OpenAPIRuntimeError.wrapped(OpenAPIRuntimeError.HandlerError)) return res } catch (err) { @@ -130,8 +119,6 @@ export const _GET = const updateTodoListByIdParamSchema = z.object({listId: z.string()}) -const updateTodoListByIdBodySchema = s_CreateUpdateTodoList - export const _PUT = ( implementation: UpdateTodoListById, @@ -148,10 +135,10 @@ export const _PUT = await params, RequestInputType.RouteParam, ), - // TODO: this swallows repeated parameters + // todo: this swallows repeated parameters query: undefined, body: parseRequestInput( - updateTodoListByIdBodySchema, + s_CreateUpdateTodoList, await request.json(), RequestInputType.RequestBody, ), @@ -174,19 +161,8 @@ export const _PUT = } const res = await implementation(input, responder, request) - .then((it) => { - if (it instanceof Response) { - return it - } - const {status, body} = it.unpack() - - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) - }) - .catch((err) => { - throw OpenAPIRuntimeError.HandlerError(err) - }) + .then(OpenAPIRuntimeResponse.unwrap) + .catch(OpenAPIRuntimeError.wrapped(OpenAPIRuntimeError.HandlerError)) return res } catch (err) { @@ -212,7 +188,7 @@ export const _DELETE = await params, RequestInputType.RouteParam, ), - // TODO: this swallows repeated parameters + // todo: this swallows repeated parameters query: undefined, body: undefined, headers: undefined, @@ -234,19 +210,8 @@ export const _DELETE = } const res = await implementation(input, responder, request) - .then((it) => { - if (it instanceof Response) { - return it - } - const {status, body} = it.unpack() - - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) - }) - .catch((err) => { - throw OpenAPIRuntimeError.HandlerError(err) - }) + .then(OpenAPIRuntimeResponse.unwrap) + .catch(OpenAPIRuntimeError.wrapped(OpenAPIRuntimeError.HandlerError)) return res } catch (err) { diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts index 10a1938e2..edd12be7e 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/list/route.ts @@ -2,21 +2,21 @@ /* tslint:disable */ /* eslint-disable */ -import {t_GetTodoListsQuerySchema, t_TodoList} from "../models" -import {s_Statuses} from "../schemas" import { OpenAPIRuntimeError, RequestInputType, } from "@nahkies/typescript-nextjs-runtime/errors" import { - OpenAPIRuntimeResponder, + type OpenAPIRuntimeResponder, OpenAPIRuntimeResponse, - Params, - StatusCode, + type Params, + type StatusCode, } from "@nahkies/typescript-nextjs-runtime/server" -import {parseRequestInput} from "@nahkies/typescript-nextjs-runtime/zod" -import {NextRequest} from "next/server" -import {z} from "zod" +import {parseRequestInput} from "@nahkies/typescript-nextjs-runtime/zod-v4" +import type {NextRequest} from "next/server" +import {z} from "zod/v4" +import type {t_GetTodoListsQuerySchema, t_TodoList} from "../models" +import {s_Statuses} from "../schemas" // /list export type GetTodoListsResponder = { @@ -30,7 +30,7 @@ export type GetTodoLists = ( ) => Promise> const getTodoListsQuerySchema = z.object({ - created: z.string().datetime({offset: true}).optional(), + created: z.iso.datetime({offset: true}).optional(), statuses: z .preprocess( (it: unknown) => (Array.isArray(it) || it === undefined ? it : [it]), @@ -54,7 +54,7 @@ export const _GET = try { const input = { params: undefined, - // TODO: this swallows repeated parameters + // todo: this swallows repeated parameters query: parseRequestInput( getTodoListsQuerySchema, Object.fromEntries(request.nextUrl.searchParams.entries()), @@ -74,19 +74,8 @@ export const _GET = } const res = await implementation(input, responder, request) - .then((it) => { - if (it instanceof Response) { - return it - } - const {status, body} = it.unpack() - - return body !== undefined - ? Response.json(body, {status}) - : new Response(undefined, {status}) - }) - .catch((err) => { - throw OpenAPIRuntimeError.HandlerError(err) - }) + .then(OpenAPIRuntimeResponse.unwrap) + .catch(OpenAPIRuntimeError.wrapped(OpenAPIRuntimeError.HandlerError)) return res } catch (err) { diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/models.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/models.ts index 1e323db01..57c6728ba 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/models.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/models.ts @@ -22,16 +22,16 @@ export type t_TodoList = { updated: string } -export type t_CreateTodoListItemBodySchema = { +export type t_CreateTodoListItemParamSchema = { + listId: string +} + +export type t_CreateTodoListItemRequestBody = { completedAt?: string content: string id: string } -export type t_CreateTodoListItemParamSchema = { - listId: string -} - export type t_DeleteTodoListByIdParamSchema = { listId: string } @@ -54,14 +54,6 @@ export type t_GetTodoListsQuerySchema = { tags?: string[] } -export type t_UpdateTodoListByIdBodySchema = { - name: string -} - export type t_UpdateTodoListByIdParamSchema = { listId: string } - -export type t_UploadAttachmentBodySchema = { - file?: unknown -} diff --git a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/schemas.ts b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/schemas.ts index 241573572..8c92f6005 100644 --- a/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/schemas.ts +++ b/integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/schemas.ts @@ -2,7 +2,7 @@ /* tslint:disable */ /* eslint-disable */ -import {z} from "zod" +import {z} from "zod/v4" export const s_CreateUpdateTodoList = z.object({name: z.string()}) @@ -18,8 +18,14 @@ export const s_TodoList = z.object({ name: z.string(), totalItemCount: z.coerce.number(), incompleteItemCount: z.coerce.number(), - created: z.string().datetime({offset: true}), - updated: z.string().datetime({offset: true}), + created: z.iso.datetime({offset: true}), + updated: z.iso.datetime({offset: true}), }) -export const s_UnknownObject = z.record(z.unknown()) +export const s_UnknownObject = z.record(z.string(), z.unknown()) + +export const s_CreateTodoListItemRequestBody = z.object({ + id: z.string(), + content: z.string(), + completedAt: z.iso.datetime({offset: true}).optional(), +}) From 79d82e075bfb24344b61db158832ccf47b9d8be3 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Tue, 23 Dec 2025 11:20:45 +0000 Subject: [PATCH 21/22] fix: use common --- .../typescript-koa-router-builder.ts | 6 +-- .../typescript-common-runtime/src/types.ts | 9 +++- .../typescript-express-runtime/src/server.ts | 17 ++----- packages/typescript-koa-runtime/src/server.ts | 17 ++----- .../typescript-nextjs-runtime/package.json | 3 ++ .../typescript-nextjs-runtime/src/errors.ts | 21 ++++---- packages/typescript-nextjs-runtime/src/joi.ts | 20 ++++---- .../typescript-nextjs-runtime/src/server.ts | 51 +++++-------------- .../typescript-nextjs-runtime/src/zod-v3.ts | 11 ++-- .../typescript-nextjs-runtime/src/zod-v4.ts | 11 ++-- pnpm-lock.yaml | 3 ++ 11 files changed, 63 insertions(+), 106 deletions(-) diff --git a/packages/openapi-code-generator/src/typescript/server/typescript-koa/typescript-koa-router-builder.ts b/packages/openapi-code-generator/src/typescript/server/typescript-koa/typescript-koa-router-builder.ts index 3aafd501b..d6b58e327 100644 --- a/packages/openapi-code-generator/src/typescript/server/typescript-koa/typescript-koa-router-builder.ts +++ b/packages/openapi-code-generator/src/typescript/server/typescript-koa/typescript-koa-router-builder.ts @@ -42,7 +42,7 @@ export class KoaRouterBuilder extends AbstractRouterBuilder { .addType( "KoaRuntimeResponder", "Params", - "Response", + "Res", "StatusCode", "StatusCode2xx", "StatusCode3xx", @@ -127,10 +127,10 @@ export class KoaRouterBuilder extends AbstractRouterBuilder { next: Next ) => Promise | ${[ ...responseSchemas.specific.map( - (it) => `Response<${it.statusType}, ${it.type}>`, + (it) => `Res<${it.statusType}, ${it.type}>`, ), responseSchemas.defaultResponse && - `Response`, + `Res`, "typeof SkipResponse", ] .filter(isDefined) diff --git a/packages/typescript-common-runtime/src/types.ts b/packages/typescript-common-runtime/src/types.ts index 04d6b12cc..5b365a5bf 100644 --- a/packages/typescript-common-runtime/src/types.ts +++ b/packages/typescript-common-runtime/src/types.ts @@ -24,11 +24,18 @@ export type StatusCode = | StatusCode4xx | StatusCode5xx -export type Response = { +export type Res = { status: Status body: Type } +export type Params = { + params: Params + query: Query + body: Body + headers: Header +} + export type QueryParams = { [name: string]: | string diff --git a/packages/typescript-express-runtime/src/server.ts b/packages/typescript-express-runtime/src/server.ts index 193ed4e07..63e9b02ef 100644 --- a/packages/typescript-express-runtime/src/server.ts +++ b/packages/typescript-express-runtime/src/server.ts @@ -1,9 +1,6 @@ import type {Server} from "node:http" import type {AddressInfo, ListenOptions} from "node:net" -import type { - Response, - StatusCode, -} from "@nahkies/typescript-common-runtime/types" +import type {Res, StatusCode} from "@nahkies/typescript-common-runtime/types" import type {OptionsJson, OptionsText, OptionsUrlencoded} from "body-parser" import Cors, {type CorsOptions, type CorsOptionsDelegate} from "cors" @@ -16,7 +13,8 @@ import express, { export {parseQueryParameters} from "@nahkies/typescript-common-runtime/query-parser" export type { - Response, + Params, + Res, StatusCode, StatusCode1xx, StatusCode2xx, @@ -37,7 +35,7 @@ export class ExpressRuntimeResponse { return this } - unpack(): Response { + unpack(): Res { return {status: this.status, body: this._body} } } @@ -104,13 +102,6 @@ export type ServerConfig = { port?: number | ListenOptions } -export type Params = { - params: Params - query: Query - body: Body - headers: Header -} - /** * Starts an Express server and listens on `port` or a randomly allocated port if none provided. * Enables CORS and body parsing by default. It's recommended to customize the CORS options diff --git a/packages/typescript-koa-runtime/src/server.ts b/packages/typescript-koa-runtime/src/server.ts index 7e0584a7b..f44dff0cd 100644 --- a/packages/typescript-koa-runtime/src/server.ts +++ b/packages/typescript-koa-runtime/src/server.ts @@ -2,10 +2,7 @@ import type {Server} from "node:http" import type {AddressInfo, ListenOptions} from "node:net" import Cors from "@koa/cors" import type Router from "@koa/router" -import type { - Response, - StatusCode, -} from "@nahkies/typescript-common-runtime/types" +import type {Res, StatusCode} from "@nahkies/typescript-common-runtime/types" import Koa, {type Middleware} from "koa" import KoaBody from "koa-body" @@ -13,7 +10,8 @@ import type {KoaBodyMiddlewareOptions} from "koa-body/lib/types" export {parseQueryParameters} from "@nahkies/typescript-common-runtime/query-parser" export type { - Response, + Params, + Res, StatusCode, StatusCode1xx, StatusCode2xx, @@ -34,7 +32,7 @@ export class KoaRuntimeResponse { return this } - unpack(): Response { + unpack(): Res { return {status: this.status, body: this._body} } } @@ -83,13 +81,6 @@ export type ServerConfig = { port?: number | ListenOptions } -export type Params = { - params: Params - query: Query - body: Body - headers: Header -} - /** * Starts a Koa server and listens on `port` or a randomly allocated port if none provided. * Enables CORS and body parsing by default. It's recommended to customize the CORS options diff --git a/packages/typescript-nextjs-runtime/package.json b/packages/typescript-nextjs-runtime/package.json index 34cfae930..877c7f89a 100644 --- a/packages/typescript-nextjs-runtime/package.json +++ b/packages/typescript-nextjs-runtime/package.json @@ -48,6 +48,9 @@ "build": "tsc -p ./tsconfig.json", "test": "jest" }, + "dependencies": { + "@nahkies/typescript-common-runtime": "workspace:^" + }, "peerDependencies": { "joi": "^17.13.3 || ^18.0.1", "next": "^16.1.0", diff --git a/packages/typescript-nextjs-runtime/src/errors.ts b/packages/typescript-nextjs-runtime/src/errors.ts index 40db7708a..1c8925873 100644 --- a/packages/typescript-nextjs-runtime/src/errors.ts +++ b/packages/typescript-nextjs-runtime/src/errors.ts @@ -1,20 +1,17 @@ -export enum RequestInputType { - RouteParam = "route params", - QueryString = "querystring", - RequestBody = "request body", - RequestHeader = "request header", -} +import { + AbstractRuntimeError, + RequestInputType, +} from "@nahkies/typescript-common-runtime/errors" + +export {RequestInputType} -export class OpenAPIRuntimeError extends Error { +export class OpenAPIRuntimeError extends AbstractRuntimeError { private constructor( message: string, cause: unknown, - public readonly phase: - | "request_validation" - | "request_handler" - | "response_validation", + phase: "request_validation" | "request_handler" | "response_validation", ) { - super(message, {cause}) + super(message, cause, phase) } static RequestError( diff --git a/packages/typescript-nextjs-runtime/src/joi.ts b/packages/typescript-nextjs-runtime/src/joi.ts index d5573006a..749088459 100644 --- a/packages/typescript-nextjs-runtime/src/joi.ts +++ b/packages/typescript-nextjs-runtime/src/joi.ts @@ -1,3 +1,5 @@ +import {findMatchingSchema} from "@nahkies/typescript-common-runtime/validation" + import type {Schema as JoiSchema} from "joi" import {OpenAPIRuntimeError, type RequestInputType} from "./errors" @@ -46,20 +48,16 @@ export function responseValidationFactory( return (status: number, value: unknown) => { try { - for (const [match, schema] of possibleResponses) { - const isMatch = - (/^\d+$/.test(match) && String(status) === match) || - (/^\d[xX]{2}$/.test(match) && String(status)[0] === match[0]) - - if (isMatch) { - const result = schema.validate(value) + const schema = findMatchingSchema(status, possibleResponses) - if (result.error) { - throw result.error - } + if (schema) { + const result = schema.validate(value) - return result.value + if (result.error) { + throw result.error } + + return result.value } if (defaultResponse) { diff --git a/packages/typescript-nextjs-runtime/src/server.ts b/packages/typescript-nextjs-runtime/src/server.ts index 53e770f87..f0ec6f58a 100644 --- a/packages/typescript-nextjs-runtime/src/server.ts +++ b/packages/typescript-nextjs-runtime/src/server.ts @@ -1,35 +1,15 @@ -// from https://stackoverflow.com/questions/39494689/is-it-possible-to-restrict-number-to-a-certain-range -import {OpenAPIRuntimeError} from "./errors" - -type Enumerate< - N extends number, - Acc extends number[] = [], -> = Acc["length"] extends N - ? Acc[number] - : Enumerate - -type IntRange = F extends T - ? F - : Exclude, Enumerate> extends never - ? never - : Exclude, Enumerate> | T - -export type StatusCode1xx = IntRange<100, 199> // `1${number}${number}` -export type StatusCode2xx = IntRange<200, 299> // `2${number}${number}` -export type StatusCode3xx = IntRange<300, 399> // `3${number}${number}` -export type StatusCode4xx = IntRange<400, 499> // `4${number}${number}` -export type StatusCode5xx = IntRange<500, 599> // `5${number}${number}` -export type StatusCode = - | StatusCode1xx - | StatusCode2xx - | StatusCode3xx - | StatusCode4xx - | StatusCode5xx - -export type Res = { - status: Status - body: Type -} +import type {Res, StatusCode} from "@nahkies/typescript-common-runtime/types" + +export type { + Params, + Res, + StatusCode, + StatusCode1xx, + StatusCode2xx, + StatusCode3xx, + StatusCode4xx, + StatusCode5xx, +} from "@nahkies/typescript-common-runtime/types" export class OpenAPIRuntimeResponse { private _body?: Type @@ -64,10 +44,3 @@ export type OpenAPIRuntimeResponder< > = { withStatus: (status: Status) => OpenAPIRuntimeResponse } - -export type Params = { - params: Params - query: Query - body: Body - headers: Header -} diff --git a/packages/typescript-nextjs-runtime/src/zod-v3.ts b/packages/typescript-nextjs-runtime/src/zod-v3.ts index 3664aaf9d..068a455b1 100644 --- a/packages/typescript-nextjs-runtime/src/zod-v3.ts +++ b/packages/typescript-nextjs-runtime/src/zod-v3.ts @@ -1,3 +1,4 @@ +import {findMatchingSchema} from "@nahkies/typescript-common-runtime/validation" import type {z} from "zod/v3" import {OpenAPIRuntimeError, type RequestInputType} from "./errors" @@ -33,14 +34,10 @@ export function responseValidationFactory( return (status: number, value: unknown) => { try { - for (const [match, schema] of possibleResponses) { - const isMatch = - (/^\d+$/.test(match) && String(status) === match) || - (/^\d[xX]{2}$/.test(match) && String(status)[0] === match[0]) + const schema = findMatchingSchema(status, possibleResponses) - if (isMatch) { - return schema.parse(value) - } + if (schema) { + return schema.parse(value) } if (defaultResponse) { diff --git a/packages/typescript-nextjs-runtime/src/zod-v4.ts b/packages/typescript-nextjs-runtime/src/zod-v4.ts index 575816ef7..60b66de28 100644 --- a/packages/typescript-nextjs-runtime/src/zod-v4.ts +++ b/packages/typescript-nextjs-runtime/src/zod-v4.ts @@ -1,3 +1,4 @@ +import {findMatchingSchema} from "@nahkies/typescript-common-runtime/validation" import type {z} from "zod/v4" import {OpenAPIRuntimeError, type RequestInputType} from "./errors" @@ -33,14 +34,10 @@ export function responseValidationFactory( return (status: number, value: unknown) => { try { - for (const [match, schema] of possibleResponses) { - const isMatch = - (/^\d+$/.test(match) && String(status) === match) || - (/^\d[xX]{2}$/.test(match) && String(status)[0] === match[0]) + const schema = findMatchingSchema(status, possibleResponses) - if (isMatch) { - return schema.parse(value) - } + if (schema) { + return schema.parse(value) } if (defaultResponse) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 87ab93bbe..a324e6518 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -653,6 +653,9 @@ importers: packages/typescript-nextjs-runtime: dependencies: + '@nahkies/typescript-common-runtime': + specifier: workspace:^ + version: link:../typescript-common-runtime next: specifier: ^16.1.0 version: 16.1.0(@babel/core@7.28.5)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.93.2) From d87a2d53d8e9d95adec8bb1d66d1d7c853746395 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Tue, 23 Dec 2025 11:21:00 +0000 Subject: [PATCH 22/22] fix: regenerate --- .../api.github.com.yaml/generated.ts | 5743 ++++++++--------- .../generated.ts | 92 +- .../azure-resource-manager.tsp/generated.ts | 44 +- .../src/generated/okta.idp.yaml/generated.ts | 232 +- .../generated/okta.oauth.yaml/generated.ts | 278 +- .../petstore-expanded.yaml/generated.ts | 18 +- .../src/generated/stripe.yaml/generated.ts | 2282 +++---- .../generated/todo-lists.yaml/generated.ts | 38 +- 8 files changed, 4224 insertions(+), 4503 deletions(-) diff --git a/integration-tests/typescript-koa/src/generated/api.github.com.yaml/generated.ts b/integration-tests/typescript-koa/src/generated/api.github.com.yaml/generated.ts index a22530244..e5cc488e3 100644 --- a/integration-tests/typescript-koa/src/generated/api.github.com.yaml/generated.ts +++ b/integration-tests/typescript-koa/src/generated/api.github.com.yaml/generated.ts @@ -11,7 +11,7 @@ import { type KoaRuntimeResponder, KoaRuntimeResponse, type Params, - type Response, + type Res, type ServerConfig, SkipResponse, type StatusCode, @@ -2400,7 +2400,7 @@ export type MetaRoot = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_root> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_root> | typeof SkipResponse > export type SecurityAdvisoriesListGlobalAdvisoriesResponder = { @@ -2421,9 +2421,9 @@ export type SecurityAdvisoriesListGlobalAdvisories = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_global_advisory[]> - | Response<422, t_validation_error_simple> - | Response<429, t_basic_error> + | Res<200, t_global_advisory[]> + | Res<422, t_validation_error_simple> + | Res<429, t_basic_error> | typeof SkipResponse > @@ -2444,8 +2444,8 @@ export type SecurityAdvisoriesGetGlobalAdvisory = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_global_advisory> - | Response<404, t_basic_error> + | Res<200, t_global_advisory> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -2459,9 +2459,7 @@ export type AppsGetAuthenticated = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_integration> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_integration> | typeof SkipResponse > export type AppsCreateFromManifestResponder = { @@ -2485,7 +2483,7 @@ export type AppsCreateFromManifest = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 201, t_integration & { client_id: string @@ -2495,8 +2493,8 @@ export type AppsCreateFromManifest = ( [key: string]: unknown | undefined } > - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -2510,9 +2508,7 @@ export type AppsGetWebhookConfigForApp = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_webhook_config> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_webhook_config> | typeof SkipResponse > export type AppsUpdateWebhookConfigForAppResponder = { @@ -2525,9 +2521,7 @@ export type AppsUpdateWebhookConfigForApp = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_webhook_config> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_webhook_config> | typeof SkipResponse > export type AppsListWebhookDeliveriesResponder = { @@ -2543,9 +2537,9 @@ export type AppsListWebhookDeliveries = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_hook_delivery_item[]> - | Response<400, t_scim_error> - | Response<422, t_validation_error> + | Res<200, t_hook_delivery_item[]> + | Res<400, t_scim_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -2562,9 +2556,9 @@ export type AppsGetWebhookDelivery = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_hook_delivery> - | Response<400, t_scim_error> - | Response<422, t_validation_error> + | Res<200, t_hook_delivery> + | Res<400, t_scim_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -2583,14 +2577,14 @@ export type AppsRedeliverWebhookDelivery = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { [key: string]: unknown | undefined } > - | Response<400, t_scim_error> - | Response<422, t_validation_error> + | Res<400, t_scim_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -2612,9 +2606,9 @@ export type AppsListInstallationRequestsForAuthenticatedApp = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_integration_installation_request[]> - | Response<304, void> - | Response<401, t_basic_error> + | Res<200, t_integration_installation_request[]> + | Res<304, void> + | Res<401, t_basic_error> | typeof SkipResponse > @@ -2628,9 +2622,7 @@ export type AppsListInstallations = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_installation[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_installation[]> | typeof SkipResponse > export type AppsGetInstallationResponder = { @@ -2645,8 +2637,8 @@ export type AppsGetInstallation = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_installation> - | Response<404, t_basic_error> + | Res<200, t_installation> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -2662,8 +2654,8 @@ export type AppsDeleteInstallation = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -2687,11 +2679,11 @@ export type AppsCreateInstallationAccessToken = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_installation_token> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_installation_token> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -2707,8 +2699,8 @@ export type AppsSuspendInstallation = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -2724,8 +2716,8 @@ export type AppsUnsuspendInstallation = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -2746,8 +2738,8 @@ export type AppsDeleteAuthorization = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<422, t_validation_error> + | Res<204, void> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -2769,9 +2761,9 @@ export type AppsCheckToken = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_authorization> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_authorization> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -2792,8 +2784,8 @@ export type AppsResetToken = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_authorization> - | Response<422, t_validation_error> + | Res<200, t_authorization> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -2814,8 +2806,8 @@ export type AppsDeleteToken = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<422, t_validation_error> + | Res<204, void> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -2839,11 +2831,11 @@ export type AppsScopeToken = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_authorization> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_authorization> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -2860,9 +2852,9 @@ export type AppsGetBySlug = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_integration> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_integration> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -2878,8 +2870,8 @@ export type ClassroomGetAnAssignment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_classroom_assignment> - | Response<404, t_basic_error> + | Res<200, t_classroom_assignment> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -2899,7 +2891,7 @@ export type ClassroomListAcceptedAssignmentsForAnAssignment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_classroom_accepted_assignment[]> + | Res<200, t_classroom_accepted_assignment[]> | typeof SkipResponse > @@ -2915,8 +2907,8 @@ export type ClassroomGetAssignmentGrades = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_classroom_assignment_grade[]> - | Response<404, t_basic_error> + | Res<200, t_classroom_assignment_grade[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -2931,7 +2923,7 @@ export type ClassroomListClassrooms = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_simple_classroom[]> + | Res<200, t_simple_classroom[]> | typeof SkipResponse > @@ -2947,8 +2939,8 @@ export type ClassroomGetAClassroom = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_classroom> - | Response<404, t_basic_error> + | Res<200, t_classroom> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -2968,7 +2960,7 @@ export type ClassroomListAssignmentsForAClassroom = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_simple_classroom_assignment[]> + | Res<200, t_simple_classroom_assignment[]> | typeof SkipResponse > @@ -2984,8 +2976,8 @@ export type CodesOfConductGetAllCodesOfConduct = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_of_conduct[]> - | Response<304, void> + | Res<200, t_code_of_conduct[]> + | Res<304, void> | typeof SkipResponse > @@ -3002,9 +2994,9 @@ export type CodesOfConductGetConductCode = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_of_conduct> - | Response<304, void> - | Response<404, t_basic_error> + | Res<200, t_code_of_conduct> + | Res<304, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -3023,14 +3015,14 @@ export type CredentialsRevoke = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { [key: string]: unknown | undefined } > - | Response<422, t_validation_error_simple> - | Response<500, t_basic_error> + | Res<422, t_validation_error_simple> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -3048,13 +3040,13 @@ export type EmojisGet = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { [key: string]: string | undefined } > - | Response<304, void> + | Res<304, void> | typeof SkipResponse > @@ -3076,9 +3068,9 @@ export type CodeSecurityGetConfigurationsForEnterprise = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_security_configuration[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_code_security_configuration[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -3101,10 +3093,10 @@ export type CodeSecurityCreateConfigurationForEnterprise = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_code_security_configuration> - | Response<400, t_scim_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<201, t_code_security_configuration> + | Res<400, t_scim_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -3124,7 +3116,7 @@ export type CodeSecurityGetDefaultConfigurationsForEnterprise = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_security_default_configurations> + | Res<200, t_code_security_default_configurations> | typeof SkipResponse > @@ -3147,10 +3139,10 @@ export type CodeSecurityGetSingleConfigurationForEnterprise = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_security_configuration> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_code_security_configuration> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -3174,11 +3166,11 @@ export type CodeSecurityUpdateEnterpriseConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_security_configuration> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<409, t_basic_error> + | Res<200, t_code_security_configuration> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<409, t_basic_error> | typeof SkipResponse > @@ -3202,11 +3194,11 @@ export type CodeSecurityDeleteConfigurationForEnterprise = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<400, t_scim_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<409, t_basic_error> + | Res<204, void> + | Res<400, t_scim_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<409, t_basic_error> | typeof SkipResponse > @@ -3231,15 +3223,15 @@ export type CodeSecurityAttachEnterpriseConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { [key: string]: unknown | undefined } > - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<409, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<409, t_basic_error> | typeof SkipResponse > @@ -3264,7 +3256,7 @@ export type CodeSecuritySetConfigurationAsDefaultForEnterprise = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { configuration?: t_code_security_configuration @@ -3275,8 +3267,8 @@ export type CodeSecuritySetConfigurationAsDefaultForEnterprise = ( | "public" } > - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -3298,9 +3290,9 @@ export type CodeSecurityGetRepositoriesForEnterpriseConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_security_configuration_repositories[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_code_security_configuration_repositories[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -3324,11 +3316,11 @@ export type DependabotListAlertsForEnterprise = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_dependabot_alert_with_repository[]> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<200, t_dependabot_alert_with_repository[]> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -3354,9 +3346,9 @@ export type SecretScanningListAlertsForEnterprise = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_organization_secret_scanning_alert[]> - | Response<404, t_basic_error> - | Response< + | Res<200, t_organization_secret_scanning_alert[]> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -3385,10 +3377,10 @@ export type ActivityListPublicEvents = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_event[]> - | Response<304, void> - | Response<403, t_basic_error> - | Response< + | Res<200, t_event[]> + | Res<304, void> + | Res<403, t_basic_error> + | Res< 503, { code?: string @@ -3409,7 +3401,7 @@ export type ActivityGetFeeds = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_feed> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_feed> | typeof SkipResponse > export type GistsListResponder = { @@ -3425,9 +3417,9 @@ export type GistsList = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_base_gist[]> - | Response<304, void> - | Response<403, t_basic_error> + | Res<200, t_base_gist[]> + | Res<304, void> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -3446,11 +3438,11 @@ export type GistsCreate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_gist_simple> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_gist_simple> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -3468,10 +3460,10 @@ export type GistsListPublic = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_base_gist[]> - | Response<304, void> - | Response<403, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_base_gist[]> + | Res<304, void> + | Res<403, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -3489,10 +3481,10 @@ export type GistsListStarred = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_base_gist[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_base_gist[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -3518,9 +3510,9 @@ export type GistsGet = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_gist_simple> - | Response<304, void> - | Response< + | Res<200, t_gist_simple> + | Res<304, void> + | Res< 403, { block?: { @@ -3532,7 +3524,7 @@ export type GistsGet = ( message?: string } > - | Response<404, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -3554,9 +3546,9 @@ export type GistsUpdate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_gist_simple> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_gist_simple> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -3574,10 +3566,10 @@ export type GistsDelete = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -3600,10 +3592,10 @@ export type GistsListComments = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_gist_comment[]> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_gist_comment[]> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -3626,10 +3618,10 @@ export type GistsCreateComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_gist_comment> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<201, t_gist_comment> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -3655,9 +3647,9 @@ export type GistsGetComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_gist_comment> - | Response<304, void> - | Response< + | Res<200, t_gist_comment> + | Res<304, void> + | Res< 403, { block?: { @@ -3669,7 +3661,7 @@ export type GistsGetComment = ( message?: string } > - | Response<404, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -3690,8 +3682,8 @@ export type GistsUpdateComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_gist_comment> - | Response<404, t_basic_error> + | Res<200, t_gist_comment> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -3709,10 +3701,10 @@ export type GistsDeleteComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -3735,10 +3727,10 @@ export type GistsListCommits = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_gist_commit[]> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_gist_commit[]> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -3761,10 +3753,10 @@ export type GistsListForks = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_gist_simple[]> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_gist_simple[]> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -3783,11 +3775,11 @@ export type GistsFork = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_base_gist> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_base_gist> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -3805,10 +3797,10 @@ export type GistsCheckIsStarred = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, EmptyObject> + | Res<204, void> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, EmptyObject> | typeof SkipResponse > @@ -3826,10 +3818,10 @@ export type GistsStar = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -3847,10 +3839,10 @@ export type GistsUnstar = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -3868,10 +3860,10 @@ export type GistsGetRevision = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_gist_simple> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_gist_simple> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -3887,8 +3879,8 @@ export type GitignoreGetAllTemplates = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, string[]> - | Response<304, void> + | Res<200, string[]> + | Res<304, void> | typeof SkipResponse > @@ -3904,8 +3896,8 @@ export type GitignoreGetTemplate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_gitignore_template> - | Response<304, void> + | Res<200, t_gitignore_template> + | Res<304, void> | typeof SkipResponse > @@ -3932,7 +3924,7 @@ export type AppsListReposAccessibleToInstallation = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { repositories: t_repository[] @@ -3940,9 +3932,9 @@ export type AppsListReposAccessibleToInstallation = ( total_count: number } > - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -3955,9 +3947,7 @@ export type AppsRevokeInstallationAccessToken = ( respond: AppsRevokeInstallationAccessTokenResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type IssuesListResponder = { with200(): KoaRuntimeResponse @@ -3973,10 +3963,10 @@ export type IssuesList = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue[]> - | Response<304, void> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_issue[]> + | Res<304, void> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -3992,8 +3982,8 @@ export type LicensesGetAllCommonlyUsed = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_license_simple[]> - | Response<304, void> + | Res<200, t_license_simple[]> + | Res<304, void> | typeof SkipResponse > @@ -4011,10 +4001,10 @@ export type LicensesGet = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_license> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_license> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -4030,8 +4020,8 @@ export type MarkdownRender = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, string> - | Response<304, void> + | Res<200, string> + | Res<304, void> | typeof SkipResponse > @@ -4047,8 +4037,8 @@ export type MarkdownRenderRaw = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, string> - | Response<304, void> + | Res<200, string> + | Res<304, void> | typeof SkipResponse > @@ -4070,9 +4060,9 @@ export type AppsGetSubscriptionPlanForAccount = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_marketplace_purchase> - | Response<401, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_marketplace_purchase> + | Res<401, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -4089,9 +4079,9 @@ export type AppsListPlans = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_marketplace_listing_plan[]> - | Response<401, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_marketplace_listing_plan[]> + | Res<401, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -4114,10 +4104,10 @@ export type AppsListAccountsForPlan = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_marketplace_purchase[]> - | Response<401, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_marketplace_purchase[]> + | Res<401, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -4139,9 +4129,9 @@ export type AppsGetSubscriptionPlanForAccountStubbed = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_marketplace_purchase> - | Response<401, t_basic_error> - | Response<404, void> + | Res<200, t_marketplace_purchase> + | Res<401, t_basic_error> + | Res<404, void> | typeof SkipResponse > @@ -4157,8 +4147,8 @@ export type AppsListPlansStubbed = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_marketplace_listing_plan[]> - | Response<401, t_basic_error> + | Res<200, t_marketplace_listing_plan[]> + | Res<401, t_basic_error> | typeof SkipResponse > @@ -4179,8 +4169,8 @@ export type AppsListAccountsForPlanStubbed = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_marketplace_purchase[]> - | Response<401, t_basic_error> + | Res<200, t_marketplace_purchase[]> + | Res<401, t_basic_error> | typeof SkipResponse > @@ -4196,8 +4186,8 @@ export type MetaGet = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_api_overview> - | Response<304, void> + | Res<200, t_api_overview> + | Res<304, void> | typeof SkipResponse > @@ -4221,11 +4211,11 @@ export type ActivityListPublicEventsForRepoNetwork = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_event[]> - | Response<301, t_basic_error> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_event[]> + | Res<301, t_basic_error> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -4249,11 +4239,11 @@ export type ActivityListNotificationsForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_thread[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_thread[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -4279,16 +4269,16 @@ export type ActivityMarkNotificationsAsRead = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { message?: string } > - | Response<205, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<205, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -4306,10 +4296,10 @@ export type ActivityGetThread = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_thread> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_thread> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -4326,9 +4316,9 @@ export type ActivityMarkThreadAsRead = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<205, void> - | Response<304, void> - | Response<403, t_basic_error> + | Res<205, void> + | Res<304, void> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -4341,9 +4331,7 @@ export type ActivityMarkThreadAsDone = ( respond: ActivityMarkThreadAsDoneResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActivityGetThreadSubscriptionForAuthenticatedUserResponder = { with200(): KoaRuntimeResponse @@ -4364,10 +4352,10 @@ export type ActivityGetThreadSubscriptionForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_thread_subscription> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_thread_subscription> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -4390,10 +4378,10 @@ export type ActivitySetThreadSubscription = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_thread_subscription> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_thread_subscription> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -4416,10 +4404,10 @@ export type ActivityDeleteThreadSubscription = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -4433,7 +4421,7 @@ export type MetaGetOctocat = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, string> | typeof SkipResponse + KoaRuntimeResponse | Res<200, string> | typeof SkipResponse > export type OrgsListResponder = { @@ -4448,8 +4436,8 @@ export type OrgsList = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_organization_simple[]> - | Response<304, void> + | Res<200, t_organization_simple[]> + | Res<304, void> | typeof SkipResponse > @@ -4471,9 +4459,9 @@ export type DependabotRepositoryAccessForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_dependabot_repository_access_details> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_dependabot_repository_access_details> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -4495,9 +4483,9 @@ export type DependabotUpdateRepositoryAccessForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -4519,9 +4507,9 @@ export type DependabotSetRepositoryAccessDefaultLevel = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -4549,11 +4537,11 @@ export type BillingGetGithubBillingUsageReportOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_usage_report> - | Response<400, t_scim_error> - | Response<403, t_basic_error> - | Response<500, t_basic_error> - | Response< + | Res<200, t_billing_usage_report> + | Res<400, t_scim_error> + | Res<403, t_basic_error> + | Res<500, t_basic_error> + | Res< 503, { code?: string @@ -4576,8 +4564,8 @@ export type OrgsGet = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_organization_full> - | Response<404, t_basic_error> + | Res<200, t_organization_full> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -4599,9 +4587,9 @@ export type OrgsUpdate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_organization_full> - | Response<409, t_basic_error> - | Response<422, t_validation_error | t_validation_error_simple> + | Res<200, t_organization_full> + | Res<409, t_basic_error> + | Res<422, t_validation_error | t_validation_error_simple> | typeof SkipResponse > @@ -4620,14 +4608,14 @@ export type OrgsDelete = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { [key: string]: unknown | undefined } > - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -4647,7 +4635,7 @@ export type ActionsGetActionsCacheUsageForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_cache_usage_org_enterprise> + | Res<200, t_actions_cache_usage_org_enterprise> | typeof SkipResponse > @@ -4670,7 +4658,7 @@ export type ActionsGetActionsCacheUsageByRepoForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { repository_cache_usages: t_actions_cache_usage_by_repository[] @@ -4699,7 +4687,7 @@ export type ActionsListHostedRunnersForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { runners: t_actions_hosted_runner[] @@ -4725,7 +4713,7 @@ export type ActionsCreateHostedRunnerForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_actions_hosted_runner> + | Res<201, t_actions_hosted_runner> | typeof SkipResponse > @@ -4748,7 +4736,7 @@ export type ActionsGetHostedRunnersGithubOwnedImagesForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { images: t_actions_hosted_runner_image[] @@ -4777,7 +4765,7 @@ export type ActionsGetHostedRunnersPartnerImagesForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { images: t_actions_hosted_runner_image[] @@ -4803,7 +4791,7 @@ export type ActionsGetHostedRunnersLimitsForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_hosted_runner_limits> + | Res<200, t_actions_hosted_runner_limits> | typeof SkipResponse > @@ -4826,7 +4814,7 @@ export type ActionsGetHostedRunnersMachineSpecsForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { machine_specs: t_actions_hosted_runner_machine_spec[] @@ -4855,7 +4843,7 @@ export type ActionsGetHostedRunnersPlatformsForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { platforms: string[] @@ -4876,7 +4864,7 @@ export type ActionsGetHostedRunnerForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_hosted_runner> + | Res<200, t_actions_hosted_runner> | typeof SkipResponse > @@ -4896,7 +4884,7 @@ export type ActionsUpdateHostedRunnerForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_hosted_runner> + | Res<200, t_actions_hosted_runner> | typeof SkipResponse > @@ -4916,7 +4904,7 @@ export type ActionsDeleteHostedRunnerForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<202, t_actions_hosted_runner> + | Res<202, t_actions_hosted_runner> | typeof SkipResponse > @@ -4936,7 +4924,7 @@ export type OidcGetOidcCustomSubTemplateForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_oidc_custom_sub> + | Res<200, t_oidc_custom_sub> | typeof SkipResponse > @@ -4958,9 +4946,9 @@ export type OidcUpdateOidcCustomSubTemplateForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_empty_object> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<201, t_empty_object> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -4980,7 +4968,7 @@ export type ActionsGetGithubActionsPermissionsOrganization = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_organization_permissions> + | Res<200, t_actions_organization_permissions> | typeof SkipResponse > @@ -4998,9 +4986,7 @@ export type ActionsSetGithubActionsPermissionsOrganization = ( respond: ActionsSetGithubActionsPermissionsOrganizationResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationResponder = { @@ -5022,7 +5008,7 @@ export type ActionsListSelectedRepositoriesEnabledGithubActionsOrganization = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { repositories: t_repository[] @@ -5047,9 +5033,7 @@ export type ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization = ( respond: ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsEnableSelectedRepositoryGithubActionsOrganizationResponder = { @@ -5066,9 +5050,7 @@ export type ActionsEnableSelectedRepositoryGithubActionsOrganization = ( respond: ActionsEnableSelectedRepositoryGithubActionsOrganizationResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsDisableSelectedRepositoryGithubActionsOrganizationResponder = { @@ -5085,9 +5067,7 @@ export type ActionsDisableSelectedRepositoryGithubActionsOrganization = ( respond: ActionsDisableSelectedRepositoryGithubActionsOrganizationResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsGetAllowedActionsOrganizationResponder = { with200(): KoaRuntimeResponse @@ -5105,7 +5085,7 @@ export type ActionsGetAllowedActionsOrganization = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_selected_actions> + | Res<200, t_selected_actions> | typeof SkipResponse > @@ -5123,9 +5103,7 @@ export type ActionsSetAllowedActionsOrganization = ( respond: ActionsSetAllowedActionsOrganizationResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsGetGithubActionsDefaultWorkflowPermissionsOrganizationResponder = { @@ -5144,7 +5122,7 @@ export type ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_get_default_workflow_permissions> + | Res<200, t_actions_get_default_workflow_permissions> | typeof SkipResponse > @@ -5163,9 +5141,7 @@ export type ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization = ( respond: ActionsSetGithubActionsDefaultWorkflowPermissionsOrganizationResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsListSelfHostedRunnerGroupsForOrgResponder = { with200(): KoaRuntimeResponse<{ @@ -5186,7 +5162,7 @@ export type ActionsListSelfHostedRunnerGroupsForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { runner_groups: t_runner_groups_org[] @@ -5212,7 +5188,7 @@ export type ActionsCreateSelfHostedRunnerGroupForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_runner_groups_org> + | Res<201, t_runner_groups_org> | typeof SkipResponse > @@ -5232,7 +5208,7 @@ export type ActionsGetSelfHostedRunnerGroupForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_runner_groups_org> + | Res<200, t_runner_groups_org> | typeof SkipResponse > @@ -5252,7 +5228,7 @@ export type ActionsUpdateSelfHostedRunnerGroupForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_runner_groups_org> + | Res<200, t_runner_groups_org> | typeof SkipResponse > @@ -5270,9 +5246,7 @@ export type ActionsDeleteSelfHostedRunnerGroupFromOrg = ( respond: ActionsDeleteSelfHostedRunnerGroupFromOrgResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsListGithubHostedRunnersInGroupForOrgResponder = { with200(): KoaRuntimeResponse<{ @@ -5293,7 +5267,7 @@ export type ActionsListGithubHostedRunnersInGroupForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { runners: t_actions_hosted_runner[] @@ -5322,7 +5296,7 @@ export type ActionsListRepoAccessToSelfHostedRunnerGroupInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { repositories: t_minimal_repository[] @@ -5346,9 +5320,7 @@ export type ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg = ( respond: ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgResponder = { with204(): KoaRuntimeResponse @@ -5364,9 +5336,7 @@ export type ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg = ( respond: ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgResponder = { with204(): KoaRuntimeResponse @@ -5382,9 +5352,7 @@ export type ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg = ( respond: ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsListSelfHostedRunnersInGroupForOrgResponder = { with200(): KoaRuntimeResponse<{ @@ -5405,7 +5373,7 @@ export type ActionsListSelfHostedRunnersInGroupForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { runners: t_runner[] @@ -5429,9 +5397,7 @@ export type ActionsSetSelfHostedRunnersInGroupForOrg = ( respond: ActionsSetSelfHostedRunnersInGroupForOrgResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsAddSelfHostedRunnerToGroupForOrgResponder = { with204(): KoaRuntimeResponse @@ -5447,9 +5413,7 @@ export type ActionsAddSelfHostedRunnerToGroupForOrg = ( respond: ActionsAddSelfHostedRunnerToGroupForOrgResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsRemoveSelfHostedRunnerFromGroupForOrgResponder = { with204(): KoaRuntimeResponse @@ -5465,9 +5429,7 @@ export type ActionsRemoveSelfHostedRunnerFromGroupForOrg = ( respond: ActionsRemoveSelfHostedRunnerFromGroupForOrgResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsListSelfHostedRunnersForOrgResponder = { with200(): KoaRuntimeResponse<{ @@ -5488,7 +5450,7 @@ export type ActionsListSelfHostedRunnersForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { runners: t_runner[] @@ -5514,7 +5476,7 @@ export type ActionsListRunnerApplicationsForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_runner_application[]> + | Res<200, t_runner_application[]> | typeof SkipResponse > @@ -5540,16 +5502,16 @@ export type ActionsGenerateRunnerJitconfigForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 201, { encoded_jit_config: string runner: t_runner } > - | Response<404, t_basic_error> - | Response<409, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<404, t_basic_error> + | Res<409, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -5569,7 +5531,7 @@ export type ActionsCreateRegistrationTokenForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_authentication_token> + | Res<201, t_authentication_token> | typeof SkipResponse > @@ -5584,7 +5546,7 @@ export type ActionsCreateRemoveTokenForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_authentication_token> + | Res<201, t_authentication_token> | typeof SkipResponse > @@ -5603,7 +5565,7 @@ export type ActionsGetSelfHostedRunnerForOrg = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_runner> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_runner> | typeof SkipResponse > export type ActionsDeleteSelfHostedRunnerFromOrgResponder = { @@ -5623,8 +5585,8 @@ export type ActionsDeleteSelfHostedRunnerFromOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<422, t_validation_error_simple> + | Res<204, void> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -5648,14 +5610,14 @@ export type ActionsListLabelsForSelfHostedRunnerForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { labels: t_runner_label[] total_count: number } > - | Response<404, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -5680,15 +5642,15 @@ export type ActionsAddCustomLabelsToSelfHostedRunnerForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { labels: t_runner_label[] total_count: number } > - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -5713,15 +5675,15 @@ export type ActionsSetCustomLabelsForSelfHostedRunnerForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { labels: t_runner_label[] total_count: number } > - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -5745,14 +5707,14 @@ export type ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { labels: t_runner_label[] total_count: number } > - | Response<404, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -5777,15 +5739,15 @@ export type ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { labels: t_runner_label[] total_count: number } > - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -5808,7 +5770,7 @@ export type ActionsListOrgSecrets = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { secrets: t_organization_actions_secret[] @@ -5829,7 +5791,7 @@ export type ActionsGetOrgPublicKey = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_public_key> + | Res<200, t_actions_public_key> | typeof SkipResponse > @@ -5844,7 +5806,7 @@ export type ActionsGetOrgSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_organization_actions_secret> + | Res<200, t_organization_actions_secret> | typeof SkipResponse > @@ -5865,8 +5827,8 @@ export type ActionsCreateOrUpdateOrgSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_empty_object> - | Response<204, void> + | Res<201, t_empty_object> + | Res<204, void> | typeof SkipResponse > @@ -5879,9 +5841,7 @@ export type ActionsDeleteOrgSecret = ( respond: ActionsDeleteOrgSecretResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsListSelectedReposForOrgSecretResponder = { with200(): KoaRuntimeResponse<{ @@ -5902,7 +5862,7 @@ export type ActionsListSelectedReposForOrgSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { repositories: t_minimal_repository[] @@ -5926,9 +5886,7 @@ export type ActionsSetSelectedReposForOrgSecret = ( respond: ActionsSetSelectedReposForOrgSecretResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsAddSelectedRepoToOrgSecretResponder = { with204(): KoaRuntimeResponse @@ -5947,8 +5905,8 @@ export type ActionsAddSelectedRepoToOrgSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<409, void> + | Res<204, void> + | Res<409, void> | typeof SkipResponse > @@ -5969,8 +5927,8 @@ export type ActionsRemoveSelectedRepoFromOrgSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<409, void> + | Res<204, void> + | Res<409, void> | typeof SkipResponse > @@ -5993,7 +5951,7 @@ export type ActionsListOrgVariables = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { total_count: number @@ -6018,9 +5976,7 @@ export type ActionsCreateOrgVariable = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<201, t_empty_object> - | typeof SkipResponse + KoaRuntimeResponse | Res<201, t_empty_object> | typeof SkipResponse > export type ActionsGetOrgVariableResponder = { @@ -6034,7 +5990,7 @@ export type ActionsGetOrgVariable = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_organization_actions_variable> + | Res<200, t_organization_actions_variable> | typeof SkipResponse > @@ -6052,9 +6008,7 @@ export type ActionsUpdateOrgVariable = ( respond: ActionsUpdateOrgVariableResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsDeleteOrgVariableResponder = { with204(): KoaRuntimeResponse @@ -6065,9 +6019,7 @@ export type ActionsDeleteOrgVariable = ( respond: ActionsDeleteOrgVariableResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsListSelectedReposForOrgVariableResponder = { with200(): KoaRuntimeResponse<{ @@ -6089,14 +6041,14 @@ export type ActionsListSelectedReposForOrgVariable = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { repositories: t_minimal_repository[] total_count: number } > - | Response<409, void> + | Res<409, void> | typeof SkipResponse > @@ -6117,8 +6069,8 @@ export type ActionsSetSelectedReposForOrgVariable = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<409, void> + | Res<204, void> + | Res<409, void> | typeof SkipResponse > @@ -6139,8 +6091,8 @@ export type ActionsAddSelectedRepoToOrgVariable = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<409, void> + | Res<204, void> + | Res<409, void> | typeof SkipResponse > @@ -6161,8 +6113,8 @@ export type ActionsRemoveSelectedRepoFromOrgVariable = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<409, void> + | Res<204, void> + | Res<409, void> | typeof SkipResponse > @@ -6209,7 +6161,7 @@ export type OrgsListAttestationsBulk = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { attestations_subject_digests?: { @@ -6260,8 +6212,8 @@ export type OrgsDeleteAttestationsBulk = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, void> - | Response<404, t_basic_error> + | Res<200, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -6283,9 +6235,9 @@ export type OrgsDeleteAttestationsBySubjectDigest = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, void> - | Response<204, void> - | Response<404, t_basic_error> + | Res<200, void> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -6303,10 +6255,10 @@ export type OrgsDeleteAttestationsById = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, void> - | Response<204, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, void> + | Res<204, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -6340,7 +6292,7 @@ export type OrgsListAttestations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { attestations?: { @@ -6376,9 +6328,7 @@ export type OrgsListBlockedUsers = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_simple_user[]> | typeof SkipResponse > export type OrgsCheckBlockedUserResponder = { @@ -6393,8 +6343,8 @@ export type OrgsCheckBlockedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -6410,8 +6360,8 @@ export type OrgsBlockUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<422, t_validation_error> + | Res<204, void> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -6424,9 +6374,7 @@ export type OrgsUnblockUser = ( respond: OrgsUnblockUserResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type CampaignsListOrgCampaignsResponder = { with200(): KoaRuntimeResponse @@ -6450,9 +6398,9 @@ export type CampaignsListOrgCampaigns = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_campaign_summary[]> - | Response<404, t_basic_error> - | Response< + | Res<200, t_campaign_summary[]> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -6488,12 +6436,12 @@ export type CampaignsCreateCampaign = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_campaign_summary> - | Response<400, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_basic_error> - | Response<429, void> - | Response< + | Res<200, t_campaign_summary> + | Res<400, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_basic_error> + | Res<429, void> + | Res< 503, { code?: string @@ -6522,10 +6470,10 @@ export type CampaignsGetCampaignSummary = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_campaign_summary> - | Response<404, t_basic_error> - | Response<422, t_basic_error> - | Response< + | Res<200, t_campaign_summary> + | Res<404, t_basic_error> + | Res<422, t_basic_error> + | Res< 503, { code?: string @@ -6560,11 +6508,11 @@ export type CampaignsUpdateCampaign = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_campaign_summary> - | Response<400, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_basic_error> - | Response< + | Res<200, t_campaign_summary> + | Res<400, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_basic_error> + | Res< 503, { code?: string @@ -6592,9 +6540,9 @@ export type CampaignsDeleteCampaign = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> - | Response< + | Res<204, void> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -6627,9 +6575,9 @@ export type CodeScanningListAlertsForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_scanning_organization_alert_items[]> - | Response<404, t_basic_error> - | Response< + | Res<200, t_code_scanning_organization_alert_items[]> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -6658,9 +6606,9 @@ export type CodeSecurityGetConfigurationsForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_security_configuration[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_code_security_configuration[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -6680,7 +6628,7 @@ export type CodeSecurityCreateConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_code_security_configuration> + | Res<201, t_code_security_configuration> | typeof SkipResponse > @@ -6703,10 +6651,10 @@ export type CodeSecurityGetDefaultConfigurations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_security_default_configurations> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_code_security_default_configurations> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -6730,11 +6678,11 @@ export type CodeSecurityDetachConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<400, t_scim_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<409, t_basic_error> + | Res<204, void> + | Res<400, t_scim_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<409, t_basic_error> | typeof SkipResponse > @@ -6752,10 +6700,10 @@ export type CodeSecurityGetConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_security_configuration> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_code_security_configuration> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -6776,8 +6724,8 @@ export type CodeSecurityUpdateConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_security_configuration> - | Response<204, void> + | Res<200, t_code_security_configuration> + | Res<204, void> | typeof SkipResponse > @@ -6801,11 +6749,11 @@ export type CodeSecurityDeleteConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<400, t_scim_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<409, t_basic_error> + | Res<204, void> + | Res<400, t_scim_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<409, t_basic_error> | typeof SkipResponse > @@ -6827,7 +6775,7 @@ export type CodeSecurityAttachConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { [key: string]: unknown | undefined @@ -6857,7 +6805,7 @@ export type CodeSecuritySetConfigurationAsDefault = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { configuration?: t_code_security_configuration @@ -6868,8 +6816,8 @@ export type CodeSecuritySetConfigurationAsDefault = ( | "public" } > - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -6891,9 +6839,9 @@ export type CodeSecurityGetRepositoriesForConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_security_configuration_repositories[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_code_security_configuration_repositories[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -6921,18 +6869,18 @@ export type CodespacesListInOrganization = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { codespaces: t_codespace[] total_count: number } > - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -6957,12 +6905,12 @@ export type CodespacesSetCodespacesAccess = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<400, void> - | Response<404, t_basic_error> - | Response<422, t_validation_error> - | Response<500, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<400, void> + | Res<404, t_basic_error> + | Res<422, t_validation_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -6987,12 +6935,12 @@ export type CodespacesSetCodespacesAccessUsers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<400, void> - | Response<404, t_basic_error> - | Response<422, t_validation_error> - | Response<500, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<400, void> + | Res<404, t_basic_error> + | Res<422, t_validation_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -7017,12 +6965,12 @@ export type CodespacesDeleteCodespacesAccessUsers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<400, void> - | Response<404, t_basic_error> - | Response<422, t_validation_error> - | Response<500, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<400, void> + | Res<404, t_basic_error> + | Res<422, t_validation_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -7045,7 +6993,7 @@ export type CodespacesListOrgSecrets = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { secrets: t_codespaces_org_secret[] @@ -7066,7 +7014,7 @@ export type CodespacesGetOrgPublicKey = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_codespaces_public_key> + | Res<200, t_codespaces_public_key> | typeof SkipResponse > @@ -7081,7 +7029,7 @@ export type CodespacesGetOrgSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_codespaces_org_secret> + | Res<200, t_codespaces_org_secret> | typeof SkipResponse > @@ -7104,10 +7052,10 @@ export type CodespacesCreateOrUpdateOrgSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_empty_object> - | Response<204, void> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_empty_object> + | Res<204, void> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -7123,8 +7071,8 @@ export type CodespacesDeleteOrgSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -7148,14 +7096,14 @@ export type CodespacesListSelectedReposForOrgSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { repositories: t_minimal_repository[] total_count: number } > - | Response<404, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -7177,9 +7125,9 @@ export type CodespacesSetSelectedReposForOrgSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> - | Response<409, void> + | Res<204, void> + | Res<404, t_basic_error> + | Res<409, void> | typeof SkipResponse > @@ -7202,10 +7150,10 @@ export type CodespacesAddSelectedRepoToOrgSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> - | Response<409, void> - | Response<422, t_validation_error> + | Res<204, void> + | Res<404, t_basic_error> + | Res<409, void> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -7228,10 +7176,10 @@ export type CodespacesRemoveSelectedRepoFromOrgSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> - | Response<409, void> - | Response<422, t_validation_error> + | Res<204, void> + | Res<404, t_basic_error> + | Res<409, void> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -7256,12 +7204,12 @@ export type CopilotGetCopilotOrganizationDetails = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_copilot_organization_details> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, void> - | Response<500, t_basic_error> + | Res<200, t_copilot_organization_details> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, void> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -7288,17 +7236,17 @@ export type CopilotListCopilotSeats = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { seats?: t_copilot_seat_details[] total_seats?: number } > - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -7325,17 +7273,17 @@ export type CopilotAddCopilotSeatsForTeams = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 201, { seats_created: number } > - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, void> - | Response<500, t_basic_error> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, void> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -7362,17 +7310,17 @@ export type CopilotCancelCopilotSeatAssignmentForTeams = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { seats_cancelled: number } > - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, void> - | Response<500, t_basic_error> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, void> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -7399,17 +7347,17 @@ export type CopilotAddCopilotSeatsForUsers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 201, { seats_created: number } > - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, void> - | Response<500, t_basic_error> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, void> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -7436,17 +7384,17 @@ export type CopilotCancelCopilotSeatAssignmentForUsers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { seats_cancelled: number } > - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, void> - | Response<500, t_basic_error> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, void> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -7470,11 +7418,11 @@ export type CopilotCopilotMetricsForOrganization = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_copilot_usage_metrics_day[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_copilot_usage_metrics_day[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -7499,12 +7447,12 @@ export type DependabotListAlertsForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_dependabot_alert_with_repository[]> - | Response<304, void> - | Response<400, t_scim_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<200, t_dependabot_alert_with_repository[]> + | Res<304, void> + | Res<400, t_scim_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -7527,7 +7475,7 @@ export type DependabotListOrgSecrets = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { secrets: t_organization_dependabot_secret[] @@ -7548,7 +7496,7 @@ export type DependabotGetOrgPublicKey = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_dependabot_public_key> + | Res<200, t_dependabot_public_key> | typeof SkipResponse > @@ -7563,7 +7511,7 @@ export type DependabotGetOrgSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_organization_dependabot_secret> + | Res<200, t_organization_dependabot_secret> | typeof SkipResponse > @@ -7584,8 +7532,8 @@ export type DependabotCreateOrUpdateOrgSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_empty_object> - | Response<204, void> + | Res<201, t_empty_object> + | Res<204, void> | typeof SkipResponse > @@ -7598,9 +7546,7 @@ export type DependabotDeleteOrgSecret = ( respond: DependabotDeleteOrgSecretResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type DependabotListSelectedReposForOrgSecretResponder = { with200(): KoaRuntimeResponse<{ @@ -7621,7 +7567,7 @@ export type DependabotListSelectedReposForOrgSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { repositories: t_minimal_repository[] @@ -7645,9 +7591,7 @@ export type DependabotSetSelectedReposForOrgSecret = ( respond: DependabotSetSelectedReposForOrgSecretResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type DependabotAddSelectedRepoToOrgSecretResponder = { with204(): KoaRuntimeResponse @@ -7666,8 +7610,8 @@ export type DependabotAddSelectedRepoToOrgSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<409, void> + | Res<204, void> + | Res<409, void> | typeof SkipResponse > @@ -7688,8 +7632,8 @@ export type DependabotRemoveSelectedRepoFromOrgSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<409, void> + | Res<204, void> + | Res<409, void> | typeof SkipResponse > @@ -7712,9 +7656,9 @@ export type PackagesListDockerMigrationConflictingPackagesForOrganization = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_package[]> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_package[]> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -7733,7 +7677,7 @@ export type ActivityListPublicOrgEvents = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_event[]> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_event[]> | typeof SkipResponse > export type OrgsListFailedInvitationsResponder = { @@ -7753,8 +7697,8 @@ export type OrgsListFailedInvitations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_organization_invitation[]> - | Response<404, t_basic_error> + | Res<200, t_organization_invitation[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -7775,8 +7719,8 @@ export type OrgsListWebhooks = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_org_hook[]> - | Response<404, t_basic_error> + | Res<200, t_org_hook[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -7798,9 +7742,9 @@ export type OrgsCreateWebhook = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_org_hook> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_org_hook> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -7816,8 +7760,8 @@ export type OrgsGetWebhook = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_org_hook> - | Response<404, t_basic_error> + | Res<200, t_org_hook> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -7839,9 +7783,9 @@ export type OrgsUpdateWebhook = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_org_hook> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_org_hook> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -7857,8 +7801,8 @@ export type OrgsDeleteWebhook = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -7872,9 +7816,7 @@ export type OrgsGetWebhookConfigForOrg = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_webhook_config> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_webhook_config> | typeof SkipResponse > export type OrgsUpdateWebhookConfigForOrgResponder = { @@ -7892,9 +7834,7 @@ export type OrgsUpdateWebhookConfigForOrg = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_webhook_config> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_webhook_config> | typeof SkipResponse > export type OrgsListWebhookDeliveriesResponder = { @@ -7915,9 +7855,9 @@ export type OrgsListWebhookDeliveries = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_hook_delivery_item[]> - | Response<400, t_scim_error> - | Response<422, t_validation_error> + | Res<200, t_hook_delivery_item[]> + | Res<400, t_scim_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -7934,9 +7874,9 @@ export type OrgsGetWebhookDelivery = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_hook_delivery> - | Response<400, t_scim_error> - | Response<422, t_validation_error> + | Res<200, t_hook_delivery> + | Res<400, t_scim_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -7955,14 +7895,14 @@ export type OrgsRedeliverWebhookDelivery = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { [key: string]: unknown | undefined } > - | Response<400, t_scim_error> - | Response<422, t_validation_error> + | Res<400, t_scim_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -7978,8 +7918,8 @@ export type OrgsPingWebhook = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -7999,7 +7939,7 @@ export type ApiInsightsGetRouteStatsByActor = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_api_insights_route_stats> + | Res<200, t_api_insights_route_stats> | typeof SkipResponse > @@ -8019,7 +7959,7 @@ export type ApiInsightsGetSubjectStats = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_api_insights_subject_stats> + | Res<200, t_api_insights_subject_stats> | typeof SkipResponse > @@ -8039,7 +7979,7 @@ export type ApiInsightsGetSummaryStats = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_api_insights_summary_stats> + | Res<200, t_api_insights_summary_stats> | typeof SkipResponse > @@ -8059,7 +7999,7 @@ export type ApiInsightsGetSummaryStatsByUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_api_insights_summary_stats> + | Res<200, t_api_insights_summary_stats> | typeof SkipResponse > @@ -8079,7 +8019,7 @@ export type ApiInsightsGetSummaryStatsByActor = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_api_insights_summary_stats> + | Res<200, t_api_insights_summary_stats> | typeof SkipResponse > @@ -8099,7 +8039,7 @@ export type ApiInsightsGetTimeStats = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_api_insights_time_stats> + | Res<200, t_api_insights_time_stats> | typeof SkipResponse > @@ -8119,7 +8059,7 @@ export type ApiInsightsGetTimeStatsByUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_api_insights_time_stats> + | Res<200, t_api_insights_time_stats> | typeof SkipResponse > @@ -8139,7 +8079,7 @@ export type ApiInsightsGetTimeStatsByActor = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_api_insights_time_stats> + | Res<200, t_api_insights_time_stats> | typeof SkipResponse > @@ -8159,7 +8099,7 @@ export type ApiInsightsGetUserStats = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_api_insights_user_stats> + | Res<200, t_api_insights_user_stats> | typeof SkipResponse > @@ -8173,9 +8113,7 @@ export type AppsGetOrgInstallation = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_installation> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_installation> | typeof SkipResponse > export type OrgsListAppInstallationsResponder = { @@ -8197,7 +8135,7 @@ export type OrgsListAppInstallations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { installations: t_installation[] @@ -8223,7 +8161,7 @@ export type InteractionsGetRestrictionsForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_interaction_limit_response | EmptyObject> + | Res<200, t_interaction_limit_response | EmptyObject> | typeof SkipResponse > @@ -8244,8 +8182,8 @@ export type InteractionsSetRestrictionsForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_interaction_limit_response> - | Response<422, t_validation_error> + | Res<200, t_interaction_limit_response> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -8263,9 +8201,7 @@ export type InteractionsRemoveRestrictionsForOrg = ( respond: InteractionsRemoveRestrictionsForOrgResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type OrgsListPendingInvitationsResponder = { with200(): KoaRuntimeResponse @@ -8284,8 +8220,8 @@ export type OrgsListPendingInvitations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_organization_invitation[]> - | Response<404, t_basic_error> + | Res<200, t_organization_invitation[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -8307,9 +8243,9 @@ export type OrgsCreateInvitation = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_organization_invitation> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_organization_invitation> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -8326,9 +8262,9 @@ export type OrgsCancelInvitation = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -8349,8 +8285,8 @@ export type OrgsListInvitationTeams = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team[]> - | Response<404, t_basic_error> + | Res<200, t_team[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -8366,8 +8302,8 @@ export type OrgsListIssueTypes = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue_type[]> - | Response<404, t_basic_error> + | Res<200, t_issue_type[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -8389,9 +8325,9 @@ export type OrgsCreateIssueType = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue_type> - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<200, t_issue_type> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -8413,9 +8349,9 @@ export type OrgsUpdateIssueType = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue_type> - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<200, t_issue_type> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -8432,9 +8368,9 @@ export type OrgsDeleteIssueType = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<204, void> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -8455,8 +8391,8 @@ export type IssuesListForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue[]> - | Response<404, t_basic_error> + | Res<200, t_issue[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -8477,8 +8413,8 @@ export type OrgsListMembers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | Response<422, t_validation_error> + | Res<200, t_simple_user[]> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -8495,9 +8431,9 @@ export type OrgsCheckMembershipForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<302, void> - | Response<404, void> + | Res<204, void> + | Res<302, void> + | Res<404, void> | typeof SkipResponse > @@ -8513,8 +8449,8 @@ export type OrgsRemoveMember = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> + | Res<204, void> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -8542,18 +8478,18 @@ export type CodespacesGetCodespacesForUserInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { codespaces: t_codespace[] total_count: number } > - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -8580,17 +8516,17 @@ export type CodespacesDeleteFromOrganization = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { [key: string]: unknown | undefined } > - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -8610,12 +8546,12 @@ export type CodespacesStopInOrganization = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_codespace> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_codespace> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -8640,12 +8576,12 @@ export type CopilotGetCopilotSeatDetailsForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_copilot_seat_details> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, void> - | Response<500, t_basic_error> + | Res<200, t_copilot_seat_details> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, void> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -8662,9 +8598,9 @@ export type OrgsGetMembershipForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_org_membership> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_org_membership> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -8686,9 +8622,9 @@ export type OrgsSetMembershipForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_org_membership> - | Response<403, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_org_membership> + | Res<403, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -8705,9 +8641,9 @@ export type OrgsRemoveMembershipForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -8726,9 +8662,7 @@ export type MigrationsListForOrg = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_migration[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_migration[]> | typeof SkipResponse > export type MigrationsStartForOrgResponder = { @@ -8749,9 +8683,9 @@ export type MigrationsStartForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_migration> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_migration> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -8772,8 +8706,8 @@ export type MigrationsGetStatusForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_migration> - | Response<404, t_basic_error> + | Res<200, t_migration> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -8794,8 +8728,8 @@ export type MigrationsDownloadArchiveForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<302, void> - | Response<404, t_basic_error> + | Res<302, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -8811,8 +8745,8 @@ export type MigrationsDeleteArchiveForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -8828,8 +8762,8 @@ export type MigrationsUnlockRepoForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -8850,8 +8784,8 @@ export type MigrationsListReposForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_minimal_repository[]> - | Response<404, t_basic_error> + | Res<200, t_minimal_repository[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -8871,15 +8805,15 @@ export type OrgsListOrgRoles = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { roles?: t_organization_role[] total_count?: number } > - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -8892,9 +8826,7 @@ export type OrgsRevokeAllOrgRolesTeam = ( respond: OrgsRevokeAllOrgRolesTeamResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type OrgsAssignTeamToOrgRoleResponder = { with204(): KoaRuntimeResponse @@ -8909,9 +8841,9 @@ export type OrgsAssignTeamToOrgRole = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, void> - | Response<422, void> + | Res<204, void> + | Res<404, void> + | Res<422, void> | typeof SkipResponse > @@ -8924,9 +8856,7 @@ export type OrgsRevokeOrgRoleTeam = ( respond: OrgsRevokeOrgRoleTeamResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type OrgsRevokeAllOrgRolesUserResponder = { with204(): KoaRuntimeResponse @@ -8937,9 +8867,7 @@ export type OrgsRevokeAllOrgRolesUser = ( respond: OrgsRevokeAllOrgRolesUserResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type OrgsAssignUserToOrgRoleResponder = { with204(): KoaRuntimeResponse @@ -8954,9 +8882,9 @@ export type OrgsAssignUserToOrgRole = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, void> - | Response<422, void> + | Res<204, void> + | Res<404, void> + | Res<422, void> | typeof SkipResponse > @@ -8969,9 +8897,7 @@ export type OrgsRevokeOrgRoleUser = ( respond: OrgsRevokeOrgRoleUserResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type OrgsGetOrgRoleResponder = { with200(): KoaRuntimeResponse @@ -8986,9 +8912,9 @@ export type OrgsGetOrgRole = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_organization_role> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_organization_role> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -9010,9 +8936,9 @@ export type OrgsListOrgRoleTeams = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_role_assignment[]> - | Response<404, void> - | Response<422, void> + | Res<200, t_team_role_assignment[]> + | Res<404, void> + | Res<422, void> | typeof SkipResponse > @@ -9034,9 +8960,9 @@ export type OrgsListOrgRoleUsers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_user_role_assignment[]> - | Response<404, void> - | Response<422, void> + | Res<200, t_user_role_assignment[]> + | Res<404, void> + | Res<422, void> | typeof SkipResponse > @@ -9055,9 +8981,7 @@ export type OrgsListOutsideCollaborators = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_simple_user[]> | typeof SkipResponse > export type OrgsConvertMemberToOutsideCollaboratorResponder = { @@ -9079,10 +9003,10 @@ export type OrgsConvertMemberToOutsideCollaborator = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<202, EmptyObject> - | Response<204, void> - | Response<403, void> - | Response<404, t_basic_error> + | Res<202, EmptyObject> + | Res<204, void> + | Res<403, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -9101,8 +9025,8 @@ export type OrgsRemoveOutsideCollaborator = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response< + | Res<204, void> + | Res< 422, { documentation_url?: string @@ -9131,10 +9055,10 @@ export type PackagesListPackagesForOrganization = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_package[]> - | Response<400, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_package[]> + | Res<400, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -9153,7 +9077,7 @@ export type PackagesGetPackageForOrganization = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_package> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_package> | typeof SkipResponse > export type PackagesDeletePackageForOrgResponder = { @@ -9170,10 +9094,10 @@ export type PackagesDeletePackageForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -9196,10 +9120,10 @@ export type PackagesRestorePackageForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -9222,10 +9146,10 @@ export type PackagesGetAllPackageVersionsForPackageOwnedByOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_package_version[]> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_package_version[]> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -9245,7 +9169,7 @@ export type PackagesGetPackageVersionForOrganization = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_package_version> + | Res<200, t_package_version> | typeof SkipResponse > @@ -9268,10 +9192,10 @@ export type PackagesDeletePackageVersionForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -9294,10 +9218,10 @@ export type PackagesRestorePackageVersionForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -9323,11 +9247,11 @@ export type OrgsListPatGrantRequests = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_organization_programmatic_access_grant_request[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> - | Response<500, t_basic_error> + | Res<200, t_organization_programmatic_access_grant_request[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -9353,16 +9277,16 @@ export type OrgsReviewPatGrantRequestsInBulk = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { [key: string]: unknown | undefined } > - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> - | Response<500, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -9386,11 +9310,11 @@ export type OrgsReviewPatGrantRequest = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> - | Response<500, t_basic_error> + | Res<204, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -9413,10 +9337,10 @@ export type OrgsListPatGrantRequestRepositories = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_minimal_repository[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_minimal_repository[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -9440,11 +9364,11 @@ export type OrgsListPatGrants = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_organization_programmatic_access_grant[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> - | Response<500, t_basic_error> + | Res<200, t_organization_programmatic_access_grant[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -9470,16 +9394,16 @@ export type OrgsUpdatePatAccesses = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { [key: string]: unknown | undefined } > - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> - | Response<500, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -9503,11 +9427,11 @@ export type OrgsUpdatePatAccess = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> - | Response<500, t_basic_error> + | Res<204, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -9530,10 +9454,10 @@ export type OrgsListPatGrantRepositories = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_minimal_repository[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_minimal_repository[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -9558,15 +9482,15 @@ export type PrivateRegistriesListOrgPrivateRegistries = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { configurations: t_org_private_registry_configuration[] total_count: number } > - | Response<400, t_scim_error> - | Response<404, t_basic_error> + | Res<400, t_scim_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -9588,12 +9512,9 @@ export type PrivateRegistriesCreateOrgPrivateRegistry = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< - 201, - t_org_private_registry_configuration_with_selected_repositories - > - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_org_private_registry_configuration_with_selected_repositories> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -9617,14 +9538,14 @@ export type PrivateRegistriesGetOrgPublicKey = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { key: string key_id: string } > - | Response<404, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -9645,8 +9566,8 @@ export type PrivateRegistriesGetOrgPrivateRegistry = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_org_private_registry_configuration> - | Response<404, t_basic_error> + | Res<200, t_org_private_registry_configuration> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -9668,9 +9589,9 @@ export type PrivateRegistriesUpdateOrgPrivateRegistry = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -9692,9 +9613,9 @@ export type PrivateRegistriesDeleteOrgPrivateRegistry = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<400, t_scim_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<400, t_scim_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -9715,8 +9636,8 @@ export type ProjectsClassicListForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_project[]> - | Response<422, t_validation_error_simple> + | Res<200, t_project[]> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -9741,12 +9662,12 @@ export type ProjectsClassicCreateForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_project> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<410, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<201, t_project> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<410, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -9763,9 +9684,9 @@ export type OrgsGetAllCustomProperties = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_custom_property[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_custom_property[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -9787,9 +9708,9 @@ export type OrgsCreateOrUpdateCustomProperties = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_custom_property[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_custom_property[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -9806,9 +9727,9 @@ export type OrgsGetCustomProperty = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_custom_property> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_custom_property> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -9830,9 +9751,9 @@ export type OrgsCreateOrUpdateCustomProperty = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_custom_property> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_custom_property> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -9849,9 +9770,9 @@ export type OrgsRemoveCustomProperty = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -9873,9 +9794,9 @@ export type OrgsListCustomPropertiesValuesForRepos = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_org_repo_custom_property_values[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_org_repo_custom_property_values[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -9898,10 +9819,10 @@ export type OrgsCreateOrUpdateCustomPropertiesValuesForRepos = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -9920,9 +9841,7 @@ export type OrgsListPublicMembers = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_simple_user[]> | typeof SkipResponse > export type OrgsCheckPublicMembershipForUserResponder = { @@ -9942,8 +9861,8 @@ export type OrgsCheckPublicMembershipForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, void> + | Res<204, void> + | Res<404, void> | typeof SkipResponse > @@ -9964,8 +9883,8 @@ export type OrgsSetPublicMembershipForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> + | Res<204, void> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -9983,9 +9902,7 @@ export type OrgsRemovePublicMembershipForAuthenticatedUser = ( respond: OrgsRemovePublicMembershipForAuthenticatedUserResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReposListForOrgResponder = { with200(): KoaRuntimeResponse @@ -10003,7 +9920,7 @@ export type ReposListForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_minimal_repository[]> + | Res<200, t_minimal_repository[]> | typeof SkipResponse > @@ -10025,9 +9942,9 @@ export type ReposCreateInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_full_repository> - | Response<403, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_full_repository> + | Res<403, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -10049,9 +9966,9 @@ export type ReposGetOrgRulesets = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository_ruleset[]> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_repository_ruleset[]> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -10073,9 +9990,9 @@ export type ReposCreateOrgRuleset = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_repository_ruleset> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<201, t_repository_ruleset> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -10097,9 +10014,9 @@ export type ReposGetOrgRuleSuites = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_rule_suites> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_rule_suites> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -10116,9 +10033,9 @@ export type ReposGetOrgRuleSuite = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_rule_suite> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_rule_suite> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -10135,9 +10052,9 @@ export type ReposGetOrgRuleset = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository_ruleset> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_repository_ruleset> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -10159,9 +10076,9 @@ export type ReposUpdateOrgRuleset = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository_ruleset> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_repository_ruleset> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -10178,9 +10095,9 @@ export type ReposDeleteOrgRuleset = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -10202,9 +10119,9 @@ export type OrgsGetOrgRulesetHistory = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_ruleset_version[]> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_ruleset_version[]> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -10221,9 +10138,9 @@ export type OrgsGetOrgRulesetVersion = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_ruleset_version_with_state> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_ruleset_version_with_state> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -10249,9 +10166,9 @@ export type SecretScanningListAlertsForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_organization_secret_scanning_alert[]> - | Response<404, t_basic_error> - | Response< + | Res<200, t_organization_secret_scanning_alert[]> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -10280,9 +10197,9 @@ export type SecurityAdvisoriesListOrgRepositoryAdvisories = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository_advisory[]> - | Response<400, t_scim_error> - | Response<404, t_basic_error> + | Res<200, t_repository_advisory[]> + | Res<400, t_scim_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -10296,9 +10213,7 @@ export type OrgsListSecurityManagerTeams = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_team_simple[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_team_simple[]> | typeof SkipResponse > export type OrgsAddSecurityManagerTeamResponder = { @@ -10310,9 +10225,7 @@ export type OrgsAddSecurityManagerTeam = ( respond: OrgsAddSecurityManagerTeamResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type OrgsRemoveSecurityManagerTeamResponder = { with204(): KoaRuntimeResponse @@ -10323,9 +10236,7 @@ export type OrgsRemoveSecurityManagerTeam = ( respond: OrgsRemoveSecurityManagerTeamResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type BillingGetGithubActionsBillingOrgResponder = { with200(): KoaRuntimeResponse @@ -10343,7 +10254,7 @@ export type BillingGetGithubActionsBillingOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_billing_usage> + | Res<200, t_actions_billing_usage> | typeof SkipResponse > @@ -10363,7 +10274,7 @@ export type BillingGetGithubPackagesBillingOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_packages_billing_usage> + | Res<200, t_packages_billing_usage> | typeof SkipResponse > @@ -10383,7 +10294,7 @@ export type BillingGetSharedStorageBillingOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_combined_billing_usage> + | Res<200, t_combined_billing_usage> | typeof SkipResponse > @@ -10406,7 +10317,7 @@ export type HostedComputeListNetworkConfigurationsForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { network_configurations: t_network_configuration[] @@ -10432,7 +10343,7 @@ export type HostedComputeCreateNetworkConfigurationForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_network_configuration> + | Res<201, t_network_configuration> | typeof SkipResponse > @@ -10452,7 +10363,7 @@ export type HostedComputeGetNetworkConfigurationForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_network_configuration> + | Res<200, t_network_configuration> | typeof SkipResponse > @@ -10472,7 +10383,7 @@ export type HostedComputeUpdateNetworkConfigurationForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_network_configuration> + | Res<200, t_network_configuration> | typeof SkipResponse > @@ -10490,9 +10401,7 @@ export type HostedComputeDeleteNetworkConfigurationFromOrg = ( respond: HostedComputeDeleteNetworkConfigurationFromOrgResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type HostedComputeGetNetworkSettingsForOrgResponder = { with200(): KoaRuntimeResponse @@ -10510,7 +10419,7 @@ export type HostedComputeGetNetworkSettingsForOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_network_settings> + | Res<200, t_network_settings> | typeof SkipResponse > @@ -10534,11 +10443,11 @@ export type CopilotCopilotMetricsForTeam = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_copilot_usage_metrics_day[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_copilot_usage_metrics_day[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -10554,8 +10463,8 @@ export type TeamsList = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team[]> - | Response<403, t_basic_error> + | Res<200, t_team[]> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -10577,9 +10486,9 @@ export type TeamsCreate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_team_full> - | Response<403, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_team_full> + | Res<403, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -10595,8 +10504,8 @@ export type TeamsGetByName = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_full> - | Response<404, t_basic_error> + | Res<200, t_team_full> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -10620,11 +10529,11 @@ export type TeamsUpdateInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_full> - | Response<201, t_team_full> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_team_full> + | Res<201, t_team_full> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -10637,9 +10546,7 @@ export type TeamsDeleteInOrg = ( respond: TeamsDeleteInOrgResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type TeamsListDiscussionsInOrgResponder = { with200(): KoaRuntimeResponse @@ -10657,7 +10564,7 @@ export type TeamsListDiscussionsInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_discussion[]> + | Res<200, t_team_discussion[]> | typeof SkipResponse > @@ -10677,7 +10584,7 @@ export type TeamsCreateDiscussionInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_team_discussion> + | Res<201, t_team_discussion> | typeof SkipResponse > @@ -10692,7 +10599,7 @@ export type TeamsGetDiscussionInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_discussion> + | Res<200, t_team_discussion> | typeof SkipResponse > @@ -10712,7 +10619,7 @@ export type TeamsUpdateDiscussionInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_discussion> + | Res<200, t_team_discussion> | typeof SkipResponse > @@ -10725,9 +10632,7 @@ export type TeamsDeleteDiscussionInOrg = ( respond: TeamsDeleteDiscussionInOrgResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type TeamsListDiscussionCommentsInOrgResponder = { with200(): KoaRuntimeResponse @@ -10745,7 +10650,7 @@ export type TeamsListDiscussionCommentsInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_discussion_comment[]> + | Res<200, t_team_discussion_comment[]> | typeof SkipResponse > @@ -10765,7 +10670,7 @@ export type TeamsCreateDiscussionCommentInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_team_discussion_comment> + | Res<201, t_team_discussion_comment> | typeof SkipResponse > @@ -10780,7 +10685,7 @@ export type TeamsGetDiscussionCommentInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_discussion_comment> + | Res<200, t_team_discussion_comment> | typeof SkipResponse > @@ -10800,7 +10705,7 @@ export type TeamsUpdateDiscussionCommentInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_discussion_comment> + | Res<200, t_team_discussion_comment> | typeof SkipResponse > @@ -10818,9 +10723,7 @@ export type TeamsDeleteDiscussionCommentInOrg = ( respond: TeamsDeleteDiscussionCommentInOrgResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReactionsListForTeamDiscussionCommentInOrgResponder = { with200(): KoaRuntimeResponse @@ -10837,9 +10740,7 @@ export type ReactionsListForTeamDiscussionCommentInOrg = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_reaction[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_reaction[]> | typeof SkipResponse > export type ReactionsCreateForTeamDiscussionCommentInOrgResponder = { @@ -10859,8 +10760,8 @@ export type ReactionsCreateForTeamDiscussionCommentInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_reaction> - | Response<201, t_reaction> + | Res<200, t_reaction> + | Res<201, t_reaction> | typeof SkipResponse > @@ -10878,9 +10779,7 @@ export type ReactionsDeleteForTeamDiscussionComment = ( respond: ReactionsDeleteForTeamDiscussionCommentResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReactionsListForTeamDiscussionInOrgResponder = { with200(): KoaRuntimeResponse @@ -10897,9 +10796,7 @@ export type ReactionsListForTeamDiscussionInOrg = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_reaction[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_reaction[]> | typeof SkipResponse > export type ReactionsCreateForTeamDiscussionInOrgResponder = { @@ -10919,8 +10816,8 @@ export type ReactionsCreateForTeamDiscussionInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_reaction> - | Response<201, t_reaction> + | Res<200, t_reaction> + | Res<201, t_reaction> | typeof SkipResponse > @@ -10938,9 +10835,7 @@ export type ReactionsDeleteForTeamDiscussion = ( respond: ReactionsDeleteForTeamDiscussionResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type TeamsListPendingInvitationsInOrgResponder = { with200(): KoaRuntimeResponse @@ -10958,7 +10853,7 @@ export type TeamsListPendingInvitationsInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_organization_invitation[]> + | Res<200, t_organization_invitation[]> | typeof SkipResponse > @@ -10977,9 +10872,7 @@ export type TeamsListMembersInOrg = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_simple_user[]> | typeof SkipResponse > export type TeamsGetMembershipForUserInOrgResponder = { @@ -10994,8 +10887,8 @@ export type TeamsGetMembershipForUserInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_membership> - | Response<404, void> + | Res<200, t_team_membership> + | Res<404, void> | typeof SkipResponse > @@ -11017,9 +10910,9 @@ export type TeamsAddOrUpdateMembershipForUserInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_membership> - | Response<403, void> - | Response<422, void> + | Res<200, t_team_membership> + | Res<403, void> + | Res<422, void> | typeof SkipResponse > @@ -11040,8 +10933,8 @@ export type TeamsRemoveMembershipForUserInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, void> + | Res<204, void> + | Res<403, void> | typeof SkipResponse > @@ -11060,9 +10953,7 @@ export type TeamsListProjectsInOrg = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_team_project[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_team_project[]> | typeof SkipResponse > export type TeamsCheckPermissionsForProjectInOrgResponder = { @@ -11082,8 +10973,8 @@ export type TeamsCheckPermissionsForProjectInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_project> - | Response<404, void> + | Res<200, t_team_project> + | Res<404, void> | typeof SkipResponse > @@ -11107,8 +10998,8 @@ export type TeamsAddOrUpdateProjectPermissionsInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response< + | Res<204, void> + | Res< 403, { documentation_url?: string @@ -11127,9 +11018,7 @@ export type TeamsRemoveProjectInOrg = ( respond: TeamsRemoveProjectInOrgResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type TeamsListReposInOrgResponder = { with200(): KoaRuntimeResponse @@ -11147,7 +11036,7 @@ export type TeamsListReposInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_minimal_repository[]> + | Res<200, t_minimal_repository[]> | typeof SkipResponse > @@ -11169,9 +11058,9 @@ export type TeamsCheckPermissionsForRepoInOrg = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_repository> - | Response<204, void> - | Response<404, void> + | Res<200, t_team_repository> + | Res<204, void> + | Res<404, void> | typeof SkipResponse > @@ -11189,9 +11078,7 @@ export type TeamsAddOrUpdateRepoPermissionsInOrg = ( respond: TeamsAddOrUpdateRepoPermissionsInOrgResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type TeamsRemoveRepoInOrgResponder = { with204(): KoaRuntimeResponse @@ -11202,9 +11089,7 @@ export type TeamsRemoveRepoInOrg = ( respond: TeamsRemoveRepoInOrgResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type TeamsListChildInOrgResponder = { with200(): KoaRuntimeResponse @@ -11221,7 +11106,7 @@ export type TeamsListChildInOrg = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_team[]> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_team[]> | typeof SkipResponse > export type OrgsEnableOrDisableSecurityProductOnAllOrgReposResponder = { @@ -11241,8 +11126,8 @@ export type OrgsEnableOrDisableSecurityProductOnAllOrgRepos = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<422, void> + | Res<204, void> + | Res<422, void> | typeof SkipResponse > @@ -11261,11 +11146,11 @@ export type ProjectsClassicGetCard = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_project_card> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_project_card> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -11290,12 +11175,12 @@ export type ProjectsClassicUpdateCard = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_project_card> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<200, t_project_card> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -11318,10 +11203,10 @@ export type ProjectsClassicDeleteCard = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response< + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res< 403, { documentation_url?: string @@ -11329,7 +11214,7 @@ export type ProjectsClassicDeleteCard = ( message?: string } > - | Response<404, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -11371,10 +11256,10 @@ export type ProjectsClassicMoveCard = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, EmptyObject> - | Response<304, void> - | Response<401, t_basic_error> - | Response< + | Res<201, EmptyObject> + | Res<304, void> + | Res<401, t_basic_error> + | Res< 403, { documentation_url?: string @@ -11387,8 +11272,8 @@ export type ProjectsClassicMoveCard = ( message?: string } > - | Response<422, t_validation_error> - | Response< + | Res<422, t_validation_error> + | Res< 503, { code?: string @@ -11418,11 +11303,11 @@ export type ProjectsClassicGetColumn = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_project_column> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_project_column> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -11445,10 +11330,10 @@ export type ProjectsClassicUpdateColumn = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_project_column> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_project_column> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -11466,10 +11351,10 @@ export type ProjectsClassicDeleteColumn = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -11492,10 +11377,10 @@ export type ProjectsClassicListCards = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_project_card[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_project_card[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -11528,12 +11413,12 @@ export type ProjectsClassicCreateCard = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_project_card> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<422, t_validation_error | t_validation_error_simple> - | Response< + | Res<201, t_project_card> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<422, t_validation_error | t_validation_error_simple> + | Res< 503, { code?: string @@ -11568,11 +11453,11 @@ export type ProjectsClassicMoveColumn = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, EmptyObject> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<201, EmptyObject> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -11590,10 +11475,10 @@ export type ProjectsClassicGet = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_project> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_project> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -11623,10 +11508,10 @@ export type ProjectsClassicUpdate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_project> - | Response<304, void> - | Response<401, t_basic_error> - | Response< + | Res<200, t_project> + | Res<304, void> + | Res<401, t_basic_error> + | Res< 403, { documentation_url?: string @@ -11634,9 +11519,9 @@ export type ProjectsClassicUpdate = ( message?: string } > - | Response<404, void> - | Response<410, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<404, void> + | Res<410, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -11660,10 +11545,10 @@ export type ProjectsClassicDelete = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response< + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res< 403, { documentation_url?: string @@ -11671,8 +11556,8 @@ export type ProjectsClassicDelete = ( message?: string } > - | Response<404, t_basic_error> - | Response<410, t_basic_error> + | Res<404, t_basic_error> + | Res<410, t_basic_error> | typeof SkipResponse > @@ -11697,12 +11582,12 @@ export type ProjectsClassicListCollaborators = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_simple_user[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -11727,12 +11612,12 @@ export type ProjectsClassicAddCollaborator = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -11757,12 +11642,12 @@ export type ProjectsClassicRemoveCollaborator = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -11787,12 +11672,12 @@ export type ProjectsClassicGetPermissionForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_project_collaborator_permission> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_project_collaborator_permission> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -11815,10 +11700,10 @@ export type ProjectsClassicListColumns = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_project_column[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_project_column[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -11842,11 +11727,11 @@ export type ProjectsClassicCreateColumn = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_project_column> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<201, t_project_column> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -11863,9 +11748,9 @@ export type RateLimitGet = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_rate_limit_overview> - | Response<304, void> - | Response<404, t_basic_error> + | Res<200, t_rate_limit_overview> + | Res<304, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -11883,10 +11768,10 @@ export type ReposGet = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_full_repository> - | Response<301, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_full_repository> + | Res<301, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -11910,11 +11795,11 @@ export type ReposUpdate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_full_repository> - | Response<307, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_full_repository> + | Res<307, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -11936,17 +11821,17 @@ export type ReposDelete = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<307, t_basic_error> - | Response< + | Res<204, void> + | Res<307, t_basic_error> + | Res< 403, { documentation_url?: string message?: string } > - | Response<404, t_basic_error> - | Response<409, t_basic_error> + | Res<404, t_basic_error> + | Res<409, t_basic_error> | typeof SkipResponse > @@ -11969,7 +11854,7 @@ export type ActionsListArtifactsForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { artifacts: t_artifact[] @@ -11989,7 +11874,7 @@ export type ActionsGetArtifact = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_artifact> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_artifact> | typeof SkipResponse > export type ActionsDeleteArtifactResponder = { @@ -12001,9 +11886,7 @@ export type ActionsDeleteArtifact = ( respond: ActionsDeleteArtifactResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsDownloadArtifactResponder = { with302(): KoaRuntimeResponse @@ -12017,8 +11900,8 @@ export type ActionsDownloadArtifact = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<302, void> - | Response<410, t_basic_error> + | Res<302, void> + | Res<410, t_basic_error> | typeof SkipResponse > @@ -12033,7 +11916,7 @@ export type ActionsGetActionsCacheUsage = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_cache_usage_by_repository> + | Res<200, t_actions_cache_usage_by_repository> | typeof SkipResponse > @@ -12053,7 +11936,7 @@ export type ActionsGetActionsCacheList = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_cache_list> + | Res<200, t_actions_cache_list> | typeof SkipResponse > @@ -12073,7 +11956,7 @@ export type ActionsDeleteActionsCacheByKey = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_cache_list> + | Res<200, t_actions_cache_list> | typeof SkipResponse > @@ -12086,9 +11969,7 @@ export type ActionsDeleteActionsCacheById = ( respond: ActionsDeleteActionsCacheByIdResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsGetJobForWorkflowRunResponder = { with200(): KoaRuntimeResponse @@ -12100,7 +11981,7 @@ export type ActionsGetJobForWorkflowRun = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_job> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_job> | typeof SkipResponse > export type ActionsDownloadJobLogsForWorkflowRunResponder = { @@ -12117,9 +11998,7 @@ export type ActionsDownloadJobLogsForWorkflowRun = ( respond: ActionsDownloadJobLogsForWorkflowRunResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<302, void> | typeof SkipResponse -> +) => Promise | Res<302, void> | typeof SkipResponse> export type ActionsReRunJobForWorkflowRunResponder = { with201(): KoaRuntimeResponse @@ -12138,8 +12017,8 @@ export type ActionsReRunJobForWorkflowRun = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_empty_object> - | Response<403, t_basic_error> + | Res<201, t_empty_object> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -12161,9 +12040,9 @@ export type ActionsGetCustomOidcSubClaimForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_oidc_custom_sub_repo> - | Response<400, t_scim_error> - | Response<404, t_basic_error> + | Res<200, t_oidc_custom_sub_repo> + | Res<400, t_scim_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -12186,10 +12065,10 @@ export type ActionsSetCustomOidcSubClaimForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_empty_object> - | Response<400, t_scim_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<201, t_empty_object> + | Res<400, t_scim_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -12212,7 +12091,7 @@ export type ActionsListRepoOrganizationSecrets = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { secrets: t_actions_secret[] @@ -12241,7 +12120,7 @@ export type ActionsListRepoOrganizationVariables = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { total_count: number @@ -12267,7 +12146,7 @@ export type ActionsGetGithubActionsPermissionsRepository = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_repository_permissions> + | Res<200, t_actions_repository_permissions> | typeof SkipResponse > @@ -12285,9 +12164,7 @@ export type ActionsSetGithubActionsPermissionsRepository = ( respond: ActionsSetGithubActionsPermissionsRepositoryResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsGetWorkflowAccessToRepositoryResponder = { with200(): KoaRuntimeResponse @@ -12305,7 +12182,7 @@ export type ActionsGetWorkflowAccessToRepository = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_workflow_access_to_repository> + | Res<200, t_actions_workflow_access_to_repository> | typeof SkipResponse > @@ -12323,9 +12200,7 @@ export type ActionsSetWorkflowAccessToRepository = ( respond: ActionsSetWorkflowAccessToRepositoryResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsGetAllowedActionsRepositoryResponder = { with200(): KoaRuntimeResponse @@ -12343,7 +12218,7 @@ export type ActionsGetAllowedActionsRepository = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_selected_actions> + | Res<200, t_selected_actions> | typeof SkipResponse > @@ -12361,9 +12236,7 @@ export type ActionsSetAllowedActionsRepository = ( respond: ActionsSetAllowedActionsRepositoryResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsGetGithubActionsDefaultWorkflowPermissionsRepositoryResponder = { @@ -12382,7 +12255,7 @@ export type ActionsGetGithubActionsDefaultWorkflowPermissionsRepository = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_get_default_workflow_permissions> + | Res<200, t_actions_get_default_workflow_permissions> | typeof SkipResponse > @@ -12404,8 +12277,8 @@ export type ActionsSetGithubActionsDefaultWorkflowPermissionsRepository = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<409, void> + | Res<204, void> + | Res<409, void> | typeof SkipResponse > @@ -12428,7 +12301,7 @@ export type ActionsListSelfHostedRunnersForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { runners: t_runner[] @@ -12454,7 +12327,7 @@ export type ActionsListRunnerApplicationsForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_runner_application[]> + | Res<200, t_runner_application[]> | typeof SkipResponse > @@ -12480,16 +12353,16 @@ export type ActionsGenerateRunnerJitconfigForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 201, { encoded_jit_config: string runner: t_runner } > - | Response<404, t_basic_error> - | Response<409, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<404, t_basic_error> + | Res<409, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -12509,7 +12382,7 @@ export type ActionsCreateRegistrationTokenForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_authentication_token> + | Res<201, t_authentication_token> | typeof SkipResponse > @@ -12529,7 +12402,7 @@ export type ActionsCreateRemoveTokenForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_authentication_token> + | Res<201, t_authentication_token> | typeof SkipResponse > @@ -12548,7 +12421,7 @@ export type ActionsGetSelfHostedRunnerForRepo = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_runner> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_runner> | typeof SkipResponse > export type ActionsDeleteSelfHostedRunnerFromRepoResponder = { @@ -12568,8 +12441,8 @@ export type ActionsDeleteSelfHostedRunnerFromRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<422, t_validation_error_simple> + | Res<204, void> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -12593,14 +12466,14 @@ export type ActionsListLabelsForSelfHostedRunnerForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { labels: t_runner_label[] total_count: number } > - | Response<404, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -12625,15 +12498,15 @@ export type ActionsAddCustomLabelsToSelfHostedRunnerForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { labels: t_runner_label[] total_count: number } > - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -12658,15 +12531,15 @@ export type ActionsSetCustomLabelsForSelfHostedRunnerForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { labels: t_runner_label[] total_count: number } > - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -12690,14 +12563,14 @@ export type ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { labels: t_runner_label[] total_count: number } > - | Response<404, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -12722,15 +12595,15 @@ export type ActionsRemoveCustomLabelFromSelfHostedRunnerForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { labels: t_runner_label[] total_count: number } > - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -12753,7 +12626,7 @@ export type ActionsListWorkflowRunsForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { total_count: number @@ -12778,9 +12651,7 @@ export type ActionsGetWorkflowRun = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_workflow_run> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_workflow_run> | typeof SkipResponse > export type ActionsDeleteWorkflowRunResponder = { @@ -12792,9 +12663,7 @@ export type ActionsDeleteWorkflowRun = ( respond: ActionsDeleteWorkflowRunResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsGetReviewsForRunResponder = { with200(): KoaRuntimeResponse @@ -12807,7 +12676,7 @@ export type ActionsGetReviewsForRun = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_environment_approvals[]> + | Res<200, t_environment_approvals[]> | typeof SkipResponse > @@ -12824,9 +12693,9 @@ export type ActionsApproveWorkflowRun = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_empty_object> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<201, t_empty_object> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -12849,7 +12718,7 @@ export type ActionsListWorkflowRunArtifacts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { artifacts: t_artifact[] @@ -12874,9 +12743,7 @@ export type ActionsGetWorkflowRunAttempt = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_workflow_run> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_workflow_run> | typeof SkipResponse > export type ActionsListJobsForWorkflowRunAttemptResponder = { @@ -12899,14 +12766,14 @@ export type ActionsListJobsForWorkflowRunAttempt = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { jobs: t_job[] total_count: number } > - | Response<404, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -12924,9 +12791,7 @@ export type ActionsDownloadWorkflowRunAttemptLogs = ( respond: ActionsDownloadWorkflowRunAttemptLogsResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<302, void> | typeof SkipResponse -> +) => Promise | Res<302, void> | typeof SkipResponse> export type ActionsCancelWorkflowRunResponder = { with202(): KoaRuntimeResponse @@ -12940,8 +12805,8 @@ export type ActionsCancelWorkflowRun = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<202, t_empty_object> - | Response<409, t_basic_error> + | Res<202, t_empty_object> + | Res<409, t_basic_error> | typeof SkipResponse > @@ -12959,9 +12824,7 @@ export type ActionsReviewCustomGatesForRun = ( respond: ActionsReviewCustomGatesForRunResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsForceCancelWorkflowRunResponder = { with202(): KoaRuntimeResponse @@ -12975,8 +12838,8 @@ export type ActionsForceCancelWorkflowRun = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<202, t_empty_object> - | Response<409, t_basic_error> + | Res<202, t_empty_object> + | Res<409, t_basic_error> | typeof SkipResponse > @@ -12999,7 +12862,7 @@ export type ActionsListJobsForWorkflowRun = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { jobs: t_job[] @@ -13018,9 +12881,7 @@ export type ActionsDownloadWorkflowRunLogs = ( respond: ActionsDownloadWorkflowRunLogsResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<302, void> | typeof SkipResponse -> +) => Promise | Res<302, void> | typeof SkipResponse> export type ActionsDeleteWorkflowRunLogsResponder = { with204(): KoaRuntimeResponse @@ -13035,9 +12896,9 @@ export type ActionsDeleteWorkflowRunLogs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> - | Response<500, t_basic_error> + | Res<204, void> + | Res<403, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -13057,7 +12918,7 @@ export type ActionsGetPendingDeploymentsForRun = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pending_deployment[]> + | Res<200, t_pending_deployment[]> | typeof SkipResponse > @@ -13076,9 +12937,7 @@ export type ActionsReviewPendingDeploymentsForRun = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_deployment[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_deployment[]> | typeof SkipResponse > export type ActionsReRunWorkflowResponder = { @@ -13096,9 +12955,7 @@ export type ActionsReRunWorkflow = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<201, t_empty_object> - | typeof SkipResponse + KoaRuntimeResponse | Res<201, t_empty_object> | typeof SkipResponse > export type ActionsReRunWorkflowFailedJobsResponder = { @@ -13116,9 +12973,7 @@ export type ActionsReRunWorkflowFailedJobs = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<201, t_empty_object> - | typeof SkipResponse + KoaRuntimeResponse | Res<201, t_empty_object> | typeof SkipResponse > export type ActionsGetWorkflowRunUsageResponder = { @@ -13132,7 +12987,7 @@ export type ActionsGetWorkflowRunUsage = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_workflow_run_usage> + | Res<200, t_workflow_run_usage> | typeof SkipResponse > @@ -13155,7 +13010,7 @@ export type ActionsListRepoSecrets = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { secrets: t_actions_secret[] @@ -13176,7 +13031,7 @@ export type ActionsGetRepoPublicKey = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_public_key> + | Res<200, t_actions_public_key> | typeof SkipResponse > @@ -13190,9 +13045,7 @@ export type ActionsGetRepoSecret = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_actions_secret> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_actions_secret> | typeof SkipResponse > export type ActionsCreateOrUpdateRepoSecretResponder = { @@ -13212,8 +13065,8 @@ export type ActionsCreateOrUpdateRepoSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_empty_object> - | Response<204, void> + | Res<201, t_empty_object> + | Res<204, void> | typeof SkipResponse > @@ -13226,9 +13079,7 @@ export type ActionsDeleteRepoSecret = ( respond: ActionsDeleteRepoSecretResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsListRepoVariablesResponder = { with200(): KoaRuntimeResponse<{ @@ -13249,7 +13100,7 @@ export type ActionsListRepoVariables = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { total_count: number @@ -13274,9 +13125,7 @@ export type ActionsCreateRepoVariable = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<201, t_empty_object> - | typeof SkipResponse + KoaRuntimeResponse | Res<201, t_empty_object> | typeof SkipResponse > export type ActionsGetRepoVariableResponder = { @@ -13290,7 +13139,7 @@ export type ActionsGetRepoVariable = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_variable> + | Res<200, t_actions_variable> | typeof SkipResponse > @@ -13308,9 +13157,7 @@ export type ActionsUpdateRepoVariable = ( respond: ActionsUpdateRepoVariableResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsDeleteRepoVariableResponder = { with204(): KoaRuntimeResponse @@ -13321,9 +13168,7 @@ export type ActionsDeleteRepoVariable = ( respond: ActionsDeleteRepoVariableResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsListRepoWorkflowsResponder = { with200(): KoaRuntimeResponse<{ @@ -13344,7 +13189,7 @@ export type ActionsListRepoWorkflows = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { total_count: number @@ -13364,7 +13209,7 @@ export type ActionsGetWorkflow = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_workflow> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_workflow> | typeof SkipResponse > export type ActionsDisableWorkflowResponder = { @@ -13376,9 +13221,7 @@ export type ActionsDisableWorkflow = ( respond: ActionsDisableWorkflowResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsCreateWorkflowDispatchResponder = { with204(): KoaRuntimeResponse @@ -13394,9 +13237,7 @@ export type ActionsCreateWorkflowDispatch = ( respond: ActionsCreateWorkflowDispatchResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsEnableWorkflowResponder = { with204(): KoaRuntimeResponse @@ -13407,9 +13248,7 @@ export type ActionsEnableWorkflow = ( respond: ActionsEnableWorkflowResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsListWorkflowRunsResponder = { with200(): KoaRuntimeResponse<{ @@ -13430,7 +13269,7 @@ export type ActionsListWorkflowRuns = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { total_count: number @@ -13450,9 +13289,7 @@ export type ActionsGetWorkflowUsage = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_workflow_usage> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_workflow_usage> | typeof SkipResponse > export type ReposListActivitiesResponder = { @@ -13472,8 +13309,8 @@ export type ReposListActivities = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_activity[]> - | Response<422, t_validation_error_simple> + | Res<200, t_activity[]> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -13494,8 +13331,8 @@ export type IssuesListAssignees = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | Response<404, t_basic_error> + | Res<200, t_simple_user[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -13511,8 +13348,8 @@ export type IssuesCheckUserCanBeAssigned = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -13536,14 +13373,14 @@ export type ReposCreateAttestation = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 201, { id?: number } > - | Response<403, t_basic_error> - | Response<422, t_validation_error> + | Res<403, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -13577,7 +13414,7 @@ export type ReposListAttestations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { attestations?: { @@ -13608,9 +13445,7 @@ export type ReposListAutolinks = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_autolink[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_autolink[]> | typeof SkipResponse > export type ReposCreateAutolinkResponder = { @@ -13630,8 +13465,8 @@ export type ReposCreateAutolink = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_autolink> - | Response<422, t_validation_error> + | Res<201, t_autolink> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -13647,8 +13482,8 @@ export type ReposGetAutolink = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_autolink> - | Response<404, t_basic_error> + | Res<200, t_autolink> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -13664,8 +13499,8 @@ export type ReposDeleteAutolink = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -13686,8 +13521,8 @@ export type ReposCheckAutomatedSecurityFixes = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_check_automated_security_fixes> - | Response<404, void> + | Res<200, t_check_automated_security_fixes> + | Res<404, void> | typeof SkipResponse > @@ -13705,9 +13540,7 @@ export type ReposEnableAutomatedSecurityFixes = ( respond: ReposEnableAutomatedSecurityFixesResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReposDisableAutomatedSecurityFixesResponder = { with204(): KoaRuntimeResponse @@ -13723,9 +13556,7 @@ export type ReposDisableAutomatedSecurityFixes = ( respond: ReposDisableAutomatedSecurityFixesResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReposListBranchesResponder = { with200(): KoaRuntimeResponse @@ -13744,8 +13575,8 @@ export type ReposListBranches = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_short_branch[]> - | Response<404, t_basic_error> + | Res<200, t_short_branch[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -13762,9 +13593,9 @@ export type ReposGetBranch = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_branch_with_protection> - | Response<301, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_branch_with_protection> + | Res<301, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -13780,8 +13611,8 @@ export type ReposGetBranchProtection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_branch_protection> - | Response<404, t_basic_error> + | Res<200, t_branch_protection> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -13804,10 +13635,10 @@ export type ReposUpdateBranchProtection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_protected_branch> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<200, t_protected_branch> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -13823,8 +13654,8 @@ export type ReposDeleteBranchProtection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> + | Res<204, void> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -13839,7 +13670,7 @@ export type ReposGetAdminBranchProtection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_protected_branch_admin_enforced> + | Res<200, t_protected_branch_admin_enforced> | typeof SkipResponse > @@ -13854,7 +13685,7 @@ export type ReposSetAdminBranchProtection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_protected_branch_admin_enforced> + | Res<200, t_protected_branch_admin_enforced> | typeof SkipResponse > @@ -13875,8 +13706,8 @@ export type ReposDeleteAdminBranchProtection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -13896,7 +13727,7 @@ export type ReposGetPullRequestReviewProtection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_protected_branch_pull_request_review> + | Res<200, t_protected_branch_pull_request_review> | typeof SkipResponse > @@ -13917,8 +13748,8 @@ export type ReposUpdatePullRequestReviewProtection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_protected_branch_pull_request_review> - | Response<422, t_validation_error> + | Res<200, t_protected_branch_pull_request_review> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -13939,8 +13770,8 @@ export type ReposDeletePullRequestReviewProtection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -13961,8 +13792,8 @@ export type ReposGetCommitSignatureProtection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_protected_branch_admin_enforced> - | Response<404, t_basic_error> + | Res<200, t_protected_branch_admin_enforced> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -13983,8 +13814,8 @@ export type ReposCreateCommitSignatureProtection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_protected_branch_admin_enforced> - | Response<404, t_basic_error> + | Res<200, t_protected_branch_admin_enforced> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -14005,8 +13836,8 @@ export type ReposDeleteCommitSignatureProtection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -14022,8 +13853,8 @@ export type ReposGetStatusChecksProtection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_status_check_policy> - | Response<404, t_basic_error> + | Res<200, t_status_check_policy> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -14045,9 +13876,9 @@ export type ReposUpdateStatusCheckProtection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_status_check_policy> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_status_check_policy> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -14065,9 +13896,7 @@ export type ReposRemoveStatusCheckProtection = ( respond: ReposRemoveStatusCheckProtectionResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReposGetAllStatusCheckContextsResponder = { with200(): KoaRuntimeResponse @@ -14081,8 +13910,8 @@ export type ReposGetAllStatusCheckContexts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, string[]> - | Response<404, t_basic_error> + | Res<200, string[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -14105,10 +13934,10 @@ export type ReposAddStatusCheckContexts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, string[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, string[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -14130,9 +13959,9 @@ export type ReposSetStatusCheckContexts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, string[]> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, string[]> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -14154,9 +13983,9 @@ export type ReposRemoveStatusCheckContexts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, string[]> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, string[]> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -14172,8 +14001,8 @@ export type ReposGetAccessRestrictions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_branch_restriction_policy> - | Response<404, t_basic_error> + | Res<200, t_branch_restriction_policy> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -14186,9 +14015,7 @@ export type ReposDeleteAccessRestrictions = ( respond: ReposDeleteAccessRestrictionsResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReposGetAppsWithAccessToProtectedBranchResponder = { with200(): KoaRuntimeResponse @@ -14207,8 +14034,8 @@ export type ReposGetAppsWithAccessToProtectedBranch = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_integration[]> - | Response<404, t_basic_error> + | Res<200, t_integration[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -14229,8 +14056,8 @@ export type ReposAddAppAccessRestrictions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_integration[]> - | Response<422, t_validation_error> + | Res<200, t_integration[]> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -14251,8 +14078,8 @@ export type ReposSetAppAccessRestrictions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_integration[]> - | Response<422, t_validation_error> + | Res<200, t_integration[]> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -14273,8 +14100,8 @@ export type ReposRemoveAppAccessRestrictions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_integration[]> - | Response<422, t_validation_error> + | Res<200, t_integration[]> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -14295,8 +14122,8 @@ export type ReposGetTeamsWithAccessToProtectedBranch = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team[]> - | Response<404, t_basic_error> + | Res<200, t_team[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -14317,8 +14144,8 @@ export type ReposAddTeamAccessRestrictions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team[]> - | Response<422, t_validation_error> + | Res<200, t_team[]> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -14339,8 +14166,8 @@ export type ReposSetTeamAccessRestrictions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team[]> - | Response<422, t_validation_error> + | Res<200, t_team[]> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -14361,8 +14188,8 @@ export type ReposRemoveTeamAccessRestrictions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team[]> - | Response<422, t_validation_error> + | Res<200, t_team[]> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -14383,8 +14210,8 @@ export type ReposGetUsersWithAccessToProtectedBranch = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | Response<404, t_basic_error> + | Res<200, t_simple_user[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -14405,8 +14232,8 @@ export type ReposAddUserAccessRestrictions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | Response<422, t_validation_error> + | Res<200, t_simple_user[]> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -14427,8 +14254,8 @@ export type ReposSetUserAccessRestrictions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | Response<422, t_validation_error> + | Res<200, t_simple_user[]> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -14449,8 +14276,8 @@ export type ReposRemoveUserAccessRestrictions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | Response<422, t_validation_error> + | Res<200, t_simple_user[]> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -14473,10 +14300,10 @@ export type ReposRenameBranch = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_branch_with_protection> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_branch_with_protection> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -14495,7 +14322,7 @@ export type ChecksCreate = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<201, t_check_run> | typeof SkipResponse + KoaRuntimeResponse | Res<201, t_check_run> | typeof SkipResponse > export type ChecksGetResponder = { @@ -14508,7 +14335,7 @@ export type ChecksGet = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_check_run> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_check_run> | typeof SkipResponse > export type ChecksUpdateResponder = { @@ -14526,7 +14353,7 @@ export type ChecksUpdate = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_check_run> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_check_run> | typeof SkipResponse > export type ChecksListAnnotationsResponder = { @@ -14545,7 +14372,7 @@ export type ChecksListAnnotations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_check_annotation[]> + | Res<200, t_check_annotation[]> | typeof SkipResponse > @@ -14563,10 +14390,10 @@ export type ChecksRerequestRun = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_empty_object> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_basic_error> + | Res<201, t_empty_object> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_basic_error> | typeof SkipResponse > @@ -14587,8 +14414,8 @@ export type ChecksCreateSuite = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_check_suite> - | Response<201, t_check_suite> + | Res<200, t_check_suite> + | Res<201, t_check_suite> | typeof SkipResponse > @@ -14608,7 +14435,7 @@ export type ChecksSetSuitesPreferences = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_check_suite_preference> + | Res<200, t_check_suite_preference> | typeof SkipResponse > @@ -14622,9 +14449,7 @@ export type ChecksGetSuite = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_check_suite> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_check_suite> | typeof SkipResponse > export type ChecksListForSuiteResponder = { @@ -14646,7 +14471,7 @@ export type ChecksListForSuite = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { check_runs: t_check_run[] @@ -14666,9 +14491,7 @@ export type ChecksRerequestSuite = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<201, t_empty_object> - | typeof SkipResponse + KoaRuntimeResponse | Res<201, t_empty_object> | typeof SkipResponse > export type CodeScanningListAlertsForRepoResponder = { @@ -14695,11 +14518,11 @@ export type CodeScanningListAlertsForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_scanning_alert_items[]> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response< + | Res<200, t_code_scanning_alert_items[]> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -14729,11 +14552,11 @@ export type CodeScanningGetAlert = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_scanning_alert> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response< + | Res<200, t_code_scanning_alert> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -14768,11 +14591,11 @@ export type CodeScanningUpdateAlert = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_scanning_alert> - | Response<400, t_scim_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response< + | Res<200, t_code_scanning_alert> + | Res<400, t_scim_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -14802,11 +14625,11 @@ export type CodeScanningGetAutofix = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_scanning_autofix> - | Response<400, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response< + | Res<200, t_code_scanning_autofix> + | Res<400, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -14838,13 +14661,13 @@ export type CodeScanningCreateAutofix = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_scanning_autofix> - | Response<202, t_code_scanning_autofix> - | Response<400, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, void> - | Response< + | Res<200, t_code_scanning_autofix> + | Res<202, t_code_scanning_autofix> + | Res<400, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, void> + | Res< 503, { code?: string @@ -14880,12 +14703,12 @@ export type CodeScanningCommitAutofix = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_code_scanning_autofix_commits_response> - | Response<400, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, void> - | Response< + | Res<201, t_code_scanning_autofix_commits_response> + | Res<400, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, void> + | Res< 503, { code?: string @@ -14919,10 +14742,10 @@ export type CodeScanningListAlertInstances = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_scanning_alert_instance[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response< + | Res<200, t_code_scanning_alert_instance[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -14956,10 +14779,10 @@ export type CodeScanningListRecentAnalyses = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_scanning_analysis[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response< + | Res<200, t_code_scanning_analysis[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -14991,16 +14814,16 @@ export type CodeScanningGetAnalysis = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { [key: string]: unknown | undefined } > - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_basic_error> - | Response< + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_basic_error> + | Res< 503, { code?: string @@ -15035,11 +14858,11 @@ export type CodeScanningDeleteAnalysis = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_scanning_analysis_deletion> - | Response<400, t_scim_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response< + | Res<200, t_code_scanning_analysis_deletion> + | Res<400, t_scim_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -15073,10 +14896,10 @@ export type CodeScanningListCodeqlDatabases = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_scanning_codeql_database[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response< + | Res<200, t_code_scanning_codeql_database[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -15106,11 +14929,11 @@ export type CodeScanningGetCodeqlDatabase = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_scanning_codeql_database> - | Response<302, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response< + | Res<200, t_code_scanning_codeql_database> + | Res<302, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -15144,10 +14967,10 @@ export type CodeScanningDeleteCodeqlDatabase = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response< + | Res<204, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -15181,10 +15004,10 @@ export type CodeScanningCreateVariantAnalysis = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_code_scanning_variant_analysis> - | Response<404, t_basic_error> - | Response<422, t_basic_error> - | Response< + | Res<201, t_code_scanning_variant_analysis> + | Res<404, t_basic_error> + | Res<422, t_basic_error> + | Res< 503, { code?: string @@ -15212,9 +15035,9 @@ export type CodeScanningGetVariantAnalysis = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_scanning_variant_analysis> - | Response<404, t_basic_error> - | Response< + | Res<200, t_code_scanning_variant_analysis> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -15247,9 +15070,9 @@ export type CodeScanningGetVariantAnalysisRepoTask = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_scanning_variant_analysis_repo_task> - | Response<404, t_basic_error> - | Response< + | Res<200, t_code_scanning_variant_analysis_repo_task> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -15278,10 +15101,10 @@ export type CodeScanningGetDefaultSetup = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_scanning_default_setup> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response< + | Res<200, t_code_scanning_default_setup> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -15318,13 +15141,13 @@ export type CodeScanningUpdateDefaultSetup = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_empty_object> - | Response<202, t_code_scanning_default_setup_update_response> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<409, t_basic_error> - | Response<422, t_basic_error> - | Response< + | Res<200, t_empty_object> + | Res<202, t_code_scanning_default_setup_update_response> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<409, t_basic_error> + | Res<422, t_basic_error> + | Res< 503, { code?: string @@ -15360,12 +15183,12 @@ export type CodeScanningUploadSarif = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<202, t_code_scanning_sarifs_receipt> - | Response<400, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<413, void> - | Response< + | Res<202, t_code_scanning_sarifs_receipt> + | Res<400, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<413, void> + | Res< 503, { code?: string @@ -15394,10 +15217,10 @@ export type CodeScanningGetSarif = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_scanning_sarifs_status> - | Response<403, t_basic_error> - | Response<404, void> - | Response< + | Res<200, t_code_scanning_sarifs_status> + | Res<403, t_basic_error> + | Res<404, void> + | Res< 503, { code?: string @@ -15428,11 +15251,11 @@ export type CodeSecurityGetConfigurationForRepository = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_security_configuration_for_repository> - | Response<204, void> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_code_security_configuration_for_repository> + | Res<204, void> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -15453,8 +15276,8 @@ export type ReposCodeownersErrors = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_codeowners_errors> - | Response<404, void> + | Res<200, t_codeowners_errors> + | Res<404, void> | typeof SkipResponse > @@ -15481,17 +15304,17 @@ export type CodespacesListInRepositoryForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { codespaces: t_codespace[] total_count: number } > - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -15521,13 +15344,13 @@ export type CodespacesCreateWithRepoForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_codespace> - | Response<202, t_codespace> - | Response<400, t_scim_error> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response< + | Res<201, t_codespace> + | Res<202, t_codespace> + | Res<400, t_scim_error> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -15567,7 +15390,7 @@ export type CodespacesListDevcontainersInRepositoryForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { devcontainers: { @@ -15578,11 +15401,11 @@ export type CodespacesListDevcontainersInRepositoryForAuthenticatedUser = ( total_count: number } > - | Response<400, t_scim_error> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<400, t_scim_error> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -15610,18 +15433,18 @@ export type CodespacesRepoMachinesForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { machines: t_codespace_machine[] total_count: number } > - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -15650,7 +15473,7 @@ export type CodespacesPreFlightWithRepoForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { billable_owner?: t_simple_user @@ -15660,9 +15483,9 @@ export type CodespacesPreFlightWithRepoForAuthenticatedUser = ( } } > - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -15691,12 +15514,12 @@ export type CodespacesCheckPermissionsForDevcontainer = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_codespaces_permissions_check_for_devcontainer> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> - | Response< + | Res<200, t_codespaces_permissions_check_for_devcontainer> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> + | Res< 503, { code?: string @@ -15726,7 +15549,7 @@ export type CodespacesListRepoSecrets = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { secrets: t_repo_codespaces_secret[] @@ -15747,7 +15570,7 @@ export type CodespacesGetRepoPublicKey = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_codespaces_public_key> + | Res<200, t_codespaces_public_key> | typeof SkipResponse > @@ -15762,7 +15585,7 @@ export type CodespacesGetRepoSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repo_codespaces_secret> + | Res<200, t_repo_codespaces_secret> | typeof SkipResponse > @@ -15783,8 +15606,8 @@ export type CodespacesCreateOrUpdateRepoSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_empty_object> - | Response<204, void> + | Res<201, t_empty_object> + | Res<204, void> | typeof SkipResponse > @@ -15797,9 +15620,7 @@ export type CodespacesDeleteRepoSecret = ( respond: CodespacesDeleteRepoSecretResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReposListCollaboratorsResponder = { with200(): KoaRuntimeResponse @@ -15818,8 +15639,8 @@ export type ReposListCollaborators = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_collaborator[]> - | Response<404, t_basic_error> + | Res<200, t_collaborator[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -15835,8 +15656,8 @@ export type ReposCheckCollaborator = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, void> + | Res<204, void> + | Res<404, void> | typeof SkipResponse > @@ -15859,10 +15680,10 @@ export type ReposAddCollaborator = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_repository_invitation> - | Response<204, void> - | Response<403, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_repository_invitation> + | Res<204, void> + | Res<403, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -15879,9 +15700,9 @@ export type ReposRemoveCollaborator = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<403, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -15902,8 +15723,8 @@ export type ReposGetCollaboratorPermissionLevel = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository_collaborator_permission> - | Response<404, t_basic_error> + | Res<200, t_repository_collaborator_permission> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -15923,7 +15744,7 @@ export type ReposListCommitCommentsForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_commit_comment[]> + | Res<200, t_commit_comment[]> | typeof SkipResponse > @@ -15939,8 +15760,8 @@ export type ReposGetCommitComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_commit_comment> - | Response<404, t_basic_error> + | Res<200, t_commit_comment> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -15961,8 +15782,8 @@ export type ReposUpdateCommitComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_commit_comment> - | Response<404, t_basic_error> + | Res<200, t_commit_comment> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -15978,8 +15799,8 @@ export type ReposDeleteCommitComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -16000,8 +15821,8 @@ export type ReactionsListForCommitComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_reaction[]> - | Response<404, t_basic_error> + | Res<200, t_reaction[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -16023,9 +15844,9 @@ export type ReactionsCreateForCommitComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_reaction> - | Response<201, t_reaction> - | Response<422, t_validation_error> + | Res<200, t_reaction> + | Res<201, t_reaction> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -16043,9 +15864,7 @@ export type ReactionsDeleteForCommitComment = ( respond: ReactionsDeleteForCommitCommentResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReposListCommitsResponder = { with200(): KoaRuntimeResponse @@ -16067,11 +15886,11 @@ export type ReposListCommits = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_commit[]> - | Response<400, t_scim_error> - | Response<404, t_basic_error> - | Response<409, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_commit[]> + | Res<400, t_scim_error> + | Res<404, t_basic_error> + | Res<409, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -16088,9 +15907,9 @@ export type ReposListBranchesForHeadCommit = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_branch_short[]> - | Response<409, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_branch_short[]> + | Res<409, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -16110,7 +15929,7 @@ export type ReposListCommentsForCommit = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_commit_comment[]> + | Res<200, t_commit_comment[]> | typeof SkipResponse > @@ -16132,9 +15951,9 @@ export type ReposCreateCommitComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_commit_comment> - | Response<403, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_commit_comment> + | Res<403, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -16155,8 +15974,8 @@ export type ReposListPullRequestsAssociatedWithCommit = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request_simple[]> - | Response<409, t_basic_error> + | Res<200, t_pull_request_simple[]> + | Res<409, t_basic_error> | typeof SkipResponse > @@ -16185,12 +16004,12 @@ export type ReposGetCommit = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_commit> - | Response<404, t_basic_error> - | Response<409, t_basic_error> - | Response<422, t_validation_error> - | Response<500, t_basic_error> - | Response< + | Res<200, t_commit> + | Res<404, t_basic_error> + | Res<409, t_basic_error> + | Res<422, t_validation_error> + | Res<500, t_basic_error> + | Res< 503, { code?: string @@ -16220,7 +16039,7 @@ export type ChecksListForRef = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { check_runs: t_check_run[] @@ -16249,7 +16068,7 @@ export type ChecksListSuitesForRef = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { check_suites: t_check_suite[] @@ -16276,8 +16095,8 @@ export type ReposGetCombinedStatusForRef = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_combined_commit_status> - | Response<404, t_basic_error> + | Res<200, t_combined_commit_status> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -16298,8 +16117,8 @@ export type ReposListCommitStatusesForRef = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_status[]> - | Response<301, t_basic_error> + | Res<200, t_status[]> + | Res<301, t_basic_error> | typeof SkipResponse > @@ -16319,7 +16138,7 @@ export type ReposGetCommunityProfileMetrics = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_community_profile> + | Res<200, t_community_profile> | typeof SkipResponse > @@ -16346,10 +16165,10 @@ export type ReposCompareCommits = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_commit_comparison> - | Response<404, t_basic_error> - | Response<500, t_basic_error> - | Response< + | Res<200, t_commit_comparison> + | Res<404, t_basic_error> + | Res<500, t_basic_error> + | Res< 503, { code?: string @@ -16385,17 +16204,17 @@ export type ReposGetContent = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, | t_content_directory | t_content_file | t_content_symlink | t_content_submodule > - | Response<302, void> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<302, void> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -16421,11 +16240,11 @@ export type ReposCreateOrUpdateFileContents = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_file_commit> - | Response<201, t_file_commit> - | Response<404, t_basic_error> - | Response<409, t_basic_error | t_repository_rule_violation_error> - | Response<422, t_validation_error> + | Res<200, t_file_commit> + | Res<201, t_file_commit> + | Res<404, t_basic_error> + | Res<409, t_basic_error | t_repository_rule_violation_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -16453,11 +16272,11 @@ export type ReposDeleteFile = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_file_commit> - | Response<404, t_basic_error> - | Response<409, t_basic_error> - | Response<422, t_validation_error> - | Response< + | Res<200, t_file_commit> + | Res<404, t_basic_error> + | Res<409, t_basic_error> + | Res<422, t_validation_error> + | Res< 503, { code?: string @@ -16487,10 +16306,10 @@ export type ReposListContributors = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_contributor[]> - | Response<204, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_contributor[]> + | Res<204, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -16515,12 +16334,12 @@ export type DependabotListAlertsForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_dependabot_alert[]> - | Response<304, void> - | Response<400, t_scim_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<200, t_dependabot_alert[]> + | Res<304, void> + | Res<400, t_scim_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -16538,10 +16357,10 @@ export type DependabotGetAlert = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_dependabot_alert> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_dependabot_alert> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -16566,12 +16385,12 @@ export type DependabotUpdateAlert = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_dependabot_alert> - | Response<400, t_scim_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<409, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<200, t_dependabot_alert> + | Res<400, t_scim_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<409, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -16594,7 +16413,7 @@ export type DependabotListRepoSecrets = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { secrets: t_dependabot_secret[] @@ -16615,7 +16434,7 @@ export type DependabotGetRepoPublicKey = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_dependabot_public_key> + | Res<200, t_dependabot_public_key> | typeof SkipResponse > @@ -16630,7 +16449,7 @@ export type DependabotGetRepoSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_dependabot_secret> + | Res<200, t_dependabot_secret> | typeof SkipResponse > @@ -16651,8 +16470,8 @@ export type DependabotCreateOrUpdateRepoSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_empty_object> - | Response<204, void> + | Res<201, t_empty_object> + | Res<204, void> | typeof SkipResponse > @@ -16665,9 +16484,7 @@ export type DependabotDeleteRepoSecret = ( respond: DependabotDeleteRepoSecretResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type DependencyGraphDiffRangeResponder = { with200(): KoaRuntimeResponse @@ -16687,9 +16504,9 @@ export type DependencyGraphDiffRange = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_dependency_graph_diff> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_dependency_graph_diff> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -16706,9 +16523,9 @@ export type DependencyGraphExportSbom = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_dependency_graph_spdx_sbom> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_dependency_graph_spdx_sbom> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -16733,7 +16550,7 @@ export type DependencyGraphCreateRepositorySnapshot = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 201, { created_at: string @@ -16760,9 +16577,7 @@ export type ReposListDeployments = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_deployment[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_deployment[]> | typeof SkipResponse > export type ReposCreateDeploymentResponder = { @@ -16786,15 +16601,15 @@ export type ReposCreateDeployment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_deployment> - | Response< + | Res<201, t_deployment> + | Res< 202, { message?: string } > - | Response<409, void> - | Response<422, t_validation_error> + | Res<409, void> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -16810,8 +16625,8 @@ export type ReposGetDeployment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deployment> - | Response<404, t_basic_error> + | Res<200, t_deployment> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -16828,9 +16643,9 @@ export type ReposDeleteDeployment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<204, void> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -16851,8 +16666,8 @@ export type ReposListDeploymentStatuses = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deployment_status[]> - | Response<404, t_basic_error> + | Res<200, t_deployment_status[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -16873,8 +16688,8 @@ export type ReposCreateDeploymentStatus = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_deployment_status> - | Response<422, t_validation_error> + | Res<201, t_deployment_status> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -16890,8 +16705,8 @@ export type ReposGetDeploymentStatus = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deployment_status> - | Response<404, t_basic_error> + | Res<200, t_deployment_status> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -16913,9 +16728,9 @@ export type ReposCreateDispatchEvent = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -16938,7 +16753,7 @@ export type ReposGetAllEnvironments = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { environments?: t_environment[] @@ -16958,9 +16773,7 @@ export type ReposGetEnvironment = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_environment> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_environment> | typeof SkipResponse > export type ReposCreateOrUpdateEnvironmentResponder = { @@ -16980,8 +16793,8 @@ export type ReposCreateOrUpdateEnvironment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_environment> - | Response<422, t_basic_error> + | Res<200, t_environment> + | Res<422, t_basic_error> | typeof SkipResponse > @@ -16994,9 +16807,7 @@ export type ReposDeleteAnEnvironment = ( respond: ReposDeleteAnEnvironmentResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReposListDeploymentBranchPoliciesResponder = { with200(): KoaRuntimeResponse<{ @@ -17017,7 +16828,7 @@ export type ReposListDeploymentBranchPolicies = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { branch_policies: t_deployment_branch_policy[] @@ -17045,9 +16856,9 @@ export type ReposCreateDeploymentBranchPolicy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deployment_branch_policy> - | Response<303, void> - | Response<404, void> + | Res<200, t_deployment_branch_policy> + | Res<303, void> + | Res<404, void> | typeof SkipResponse > @@ -17062,7 +16873,7 @@ export type ReposGetDeploymentBranchPolicy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deployment_branch_policy> + | Res<200, t_deployment_branch_policy> | typeof SkipResponse > @@ -17082,7 +16893,7 @@ export type ReposUpdateDeploymentBranchPolicy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deployment_branch_policy> + | Res<200, t_deployment_branch_policy> | typeof SkipResponse > @@ -17100,9 +16911,7 @@ export type ReposDeleteDeploymentBranchPolicy = ( respond: ReposDeleteDeploymentBranchPolicyResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReposGetAllDeploymentProtectionRulesResponder = { with200(): KoaRuntimeResponse<{ @@ -17123,7 +16932,7 @@ export type ReposGetAllDeploymentProtectionRules = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { custom_deployment_protection_rules?: t_deployment_protection_rule[] @@ -17149,7 +16958,7 @@ export type ReposCreateDeploymentProtectionRule = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_deployment_protection_rule> + | Res<201, t_deployment_protection_rule> | typeof SkipResponse > @@ -17172,7 +16981,7 @@ export type ReposListCustomDeploymentRuleIntegrations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { available_custom_deployment_protection_rule_integrations?: t_custom_deployment_rule_app[] @@ -17198,7 +17007,7 @@ export type ReposGetCustomDeploymentProtectionRule = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deployment_protection_rule> + | Res<200, t_deployment_protection_rule> | typeof SkipResponse > @@ -17216,9 +17025,7 @@ export type ReposDisableDeploymentProtectionRule = ( respond: ReposDisableDeploymentProtectionRuleResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsListEnvironmentSecretsResponder = { with200(): KoaRuntimeResponse<{ @@ -17239,7 +17046,7 @@ export type ActionsListEnvironmentSecrets = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { secrets: t_actions_secret[] @@ -17260,7 +17067,7 @@ export type ActionsGetEnvironmentPublicKey = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_public_key> + | Res<200, t_actions_public_key> | typeof SkipResponse > @@ -17274,9 +17081,7 @@ export type ActionsGetEnvironmentSecret = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_actions_secret> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_actions_secret> | typeof SkipResponse > export type ActionsCreateOrUpdateEnvironmentSecretResponder = { @@ -17296,8 +17101,8 @@ export type ActionsCreateOrUpdateEnvironmentSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_empty_object> - | Response<204, void> + | Res<201, t_empty_object> + | Res<204, void> | typeof SkipResponse > @@ -17310,9 +17115,7 @@ export type ActionsDeleteEnvironmentSecret = ( respond: ActionsDeleteEnvironmentSecretResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsListEnvironmentVariablesResponder = { with200(): KoaRuntimeResponse<{ @@ -17333,7 +17136,7 @@ export type ActionsListEnvironmentVariables = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { total_count: number @@ -17358,9 +17161,7 @@ export type ActionsCreateEnvironmentVariable = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<201, t_empty_object> - | typeof SkipResponse + KoaRuntimeResponse | Res<201, t_empty_object> | typeof SkipResponse > export type ActionsGetEnvironmentVariableResponder = { @@ -17374,7 +17175,7 @@ export type ActionsGetEnvironmentVariable = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_variable> + | Res<200, t_actions_variable> | typeof SkipResponse > @@ -17392,9 +17193,7 @@ export type ActionsUpdateEnvironmentVariable = ( respond: ActionsUpdateEnvironmentVariableResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActionsDeleteEnvironmentVariableResponder = { with204(): KoaRuntimeResponse @@ -17410,9 +17209,7 @@ export type ActionsDeleteEnvironmentVariable = ( respond: ActionsDeleteEnvironmentVariableResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ActivityListRepoEventsResponder = { with200(): KoaRuntimeResponse @@ -17429,7 +17226,7 @@ export type ActivityListRepoEvents = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_event[]> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_event[]> | typeof SkipResponse > export type ReposListForksResponder = { @@ -17449,8 +17246,8 @@ export type ReposListForks = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_minimal_repository[]> - | Response<400, t_scim_error> + | Res<200, t_minimal_repository[]> + | Res<400, t_scim_error> | typeof SkipResponse > @@ -17474,11 +17271,11 @@ export type ReposCreateFork = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<202, t_full_repository> - | Response<400, t_scim_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<202, t_full_repository> + | Res<400, t_scim_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -17504,11 +17301,11 @@ export type GitCreateBlob = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_short_blob> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<409, t_basic_error> - | Response<422, t_validation_error | t_repository_rule_violation_error> + | Res<201, t_short_blob> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<409, t_basic_error> + | Res<422, t_validation_error | t_repository_rule_violation_error> | typeof SkipResponse > @@ -17527,11 +17324,11 @@ export type GitGetBlob = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_blob> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<409, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_blob> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<409, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -17554,10 +17351,10 @@ export type GitCreateCommit = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_git_commit> - | Response<404, t_basic_error> - | Response<409, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_git_commit> + | Res<404, t_basic_error> + | Res<409, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -17574,9 +17371,9 @@ export type GitGetCommit = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_git_commit> - | Response<404, t_basic_error> - | Response<409, t_basic_error> + | Res<200, t_git_commit> + | Res<404, t_basic_error> + | Res<409, t_basic_error> | typeof SkipResponse > @@ -17592,8 +17389,8 @@ export type GitListMatchingRefs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_git_ref[]> - | Response<409, t_basic_error> + | Res<200, t_git_ref[]> + | Res<409, t_basic_error> | typeof SkipResponse > @@ -17610,9 +17407,9 @@ export type GitGetRef = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_git_ref> - | Response<404, t_basic_error> - | Response<409, t_basic_error> + | Res<200, t_git_ref> + | Res<404, t_basic_error> + | Res<409, t_basic_error> | typeof SkipResponse > @@ -17634,9 +17431,9 @@ export type GitCreateRef = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_git_ref> - | Response<409, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_git_ref> + | Res<409, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -17658,9 +17455,9 @@ export type GitUpdateRef = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_git_ref> - | Response<409, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_git_ref> + | Res<409, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -17677,9 +17474,9 @@ export type GitDeleteRef = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<409, t_basic_error> - | Response<422, void> + | Res<204, void> + | Res<409, t_basic_error> + | Res<422, void> | typeof SkipResponse > @@ -17701,9 +17498,9 @@ export type GitCreateTag = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_git_tag> - | Response<409, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_git_tag> + | Res<409, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -17720,9 +17517,9 @@ export type GitGetTag = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_git_tag> - | Response<404, t_basic_error> - | Response<409, t_basic_error> + | Res<200, t_git_tag> + | Res<404, t_basic_error> + | Res<409, t_basic_error> | typeof SkipResponse > @@ -17746,11 +17543,11 @@ export type GitCreateTree = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_git_tree> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<409, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_git_tree> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<409, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -17768,10 +17565,10 @@ export type GitGetTree = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_git_tree> - | Response<404, t_basic_error> - | Response<409, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_git_tree> + | Res<404, t_basic_error> + | Res<409, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -17792,8 +17589,8 @@ export type ReposListWebhooks = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_hook[]> - | Response<404, t_basic_error> + | Res<200, t_hook[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -17816,10 +17613,10 @@ export type ReposCreateWebhook = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_hook> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_hook> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -17835,8 +17632,8 @@ export type ReposGetWebhook = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_hook> - | Response<404, t_basic_error> + | Res<200, t_hook> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -17858,9 +17655,9 @@ export type ReposUpdateWebhook = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_hook> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_hook> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -17876,8 +17673,8 @@ export type ReposDeleteWebhook = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -17891,9 +17688,7 @@ export type ReposGetWebhookConfigForRepo = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_webhook_config> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_webhook_config> | typeof SkipResponse > export type ReposUpdateWebhookConfigForRepoResponder = { @@ -17911,9 +17706,7 @@ export type ReposUpdateWebhookConfigForRepo = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_webhook_config> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_webhook_config> | typeof SkipResponse > export type ReposListWebhookDeliveriesResponder = { @@ -17934,9 +17727,9 @@ export type ReposListWebhookDeliveries = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_hook_delivery_item[]> - | Response<400, t_scim_error> - | Response<422, t_validation_error> + | Res<200, t_hook_delivery_item[]> + | Res<400, t_scim_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -17953,9 +17746,9 @@ export type ReposGetWebhookDelivery = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_hook_delivery> - | Response<400, t_scim_error> - | Response<422, t_validation_error> + | Res<200, t_hook_delivery> + | Res<400, t_scim_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -17974,14 +17767,14 @@ export type ReposRedeliverWebhookDelivery = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { [key: string]: unknown | undefined } > - | Response<400, t_scim_error> - | Response<422, t_validation_error> + | Res<400, t_scim_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -17997,8 +17790,8 @@ export type ReposPingWebhook = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -18014,8 +17807,8 @@ export type ReposTestPushWebhook = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -18032,9 +17825,9 @@ export type MigrationsGetImportStatus = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_import> - | Response<404, t_basic_error> - | Response<503, t_basic_error> + | Res<200, t_import> + | Res<404, t_basic_error> + | Res<503, t_basic_error> | typeof SkipResponse > @@ -18057,10 +17850,10 @@ export type MigrationsStartImport = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_import> - | Response<404, t_basic_error> - | Response<422, t_validation_error> - | Response<503, t_basic_error> + | Res<201, t_import> + | Res<404, t_basic_error> + | Res<422, t_validation_error> + | Res<503, t_basic_error> | typeof SkipResponse > @@ -18081,8 +17874,8 @@ export type MigrationsUpdateImport = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_import> - | Response<503, t_basic_error> + | Res<200, t_import> + | Res<503, t_basic_error> | typeof SkipResponse > @@ -18098,8 +17891,8 @@ export type MigrationsCancelImport = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<503, t_basic_error> + | Res<204, void> + | Res<503, t_basic_error> | typeof SkipResponse > @@ -18121,9 +17914,9 @@ export type MigrationsGetCommitAuthors = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_porter_author[]> - | Response<404, t_basic_error> - | Response<503, t_basic_error> + | Res<200, t_porter_author[]> + | Res<404, t_basic_error> + | Res<503, t_basic_error> | typeof SkipResponse > @@ -18146,10 +17939,10 @@ export type MigrationsMapCommitAuthor = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_porter_author> - | Response<404, t_basic_error> - | Response<422, t_validation_error> - | Response<503, t_basic_error> + | Res<200, t_porter_author> + | Res<404, t_basic_error> + | Res<422, t_validation_error> + | Res<503, t_basic_error> | typeof SkipResponse > @@ -18165,8 +17958,8 @@ export type MigrationsGetLargeFiles = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_porter_large_file[]> - | Response<503, t_basic_error> + | Res<200, t_porter_large_file[]> + | Res<503, t_basic_error> | typeof SkipResponse > @@ -18188,9 +17981,9 @@ export type MigrationsSetLfsPreference = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_import> - | Response<422, t_validation_error> - | Response<503, t_basic_error> + | Res<200, t_import> + | Res<422, t_validation_error> + | Res<503, t_basic_error> | typeof SkipResponse > @@ -18207,9 +18000,9 @@ export type AppsGetRepoInstallation = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_installation> - | Response<301, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_installation> + | Res<301, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -18229,7 +18022,7 @@ export type InteractionsGetRestrictionsForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_interaction_limit_response | EmptyObject> + | Res<200, t_interaction_limit_response | EmptyObject> | typeof SkipResponse > @@ -18250,8 +18043,8 @@ export type InteractionsSetRestrictionsForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_interaction_limit_response> - | Response<409, void> + | Res<200, t_interaction_limit_response> + | Res<409, void> | typeof SkipResponse > @@ -18272,8 +18065,8 @@ export type InteractionsRemoveRestrictionsForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<409, void> + | Res<204, void> + | Res<409, void> | typeof SkipResponse > @@ -18293,7 +18086,7 @@ export type ReposListInvitations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository_invitation[]> + | Res<200, t_repository_invitation[]> | typeof SkipResponse > @@ -18313,7 +18106,7 @@ export type ReposUpdateInvitation = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository_invitation> + | Res<200, t_repository_invitation> | typeof SkipResponse > @@ -18326,9 +18119,7 @@ export type ReposDeleteInvitation = ( respond: ReposDeleteInvitationResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type IssuesListForRepoResponder = { with200(): KoaRuntimeResponse @@ -18349,10 +18140,10 @@ export type IssuesListForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue[]> - | Response<301, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_issue[]> + | Res<301, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -18382,13 +18173,13 @@ export type IssuesCreate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_issue> - | Response<400, t_scim_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<410, t_basic_error> - | Response<422, t_validation_error> - | Response< + | Res<201, t_issue> + | Res<400, t_scim_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<410, t_basic_error> + | Res<422, t_validation_error> + | Res< 503, { code?: string @@ -18417,9 +18208,9 @@ export type IssuesListCommentsForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue_comment[]> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_issue_comment[]> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -18435,8 +18226,8 @@ export type IssuesGetComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue_comment> - | Response<404, t_basic_error> + | Res<200, t_issue_comment> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -18457,8 +18248,8 @@ export type IssuesUpdateComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue_comment> - | Response<422, t_validation_error> + | Res<200, t_issue_comment> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -18471,9 +18262,7 @@ export type IssuesDeleteComment = ( respond: IssuesDeleteCommentResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReactionsListForIssueCommentResponder = { with200(): KoaRuntimeResponse @@ -18492,8 +18281,8 @@ export type ReactionsListForIssueComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_reaction[]> - | Response<404, t_basic_error> + | Res<200, t_reaction[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -18515,9 +18304,9 @@ export type ReactionsCreateForIssueComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_reaction> - | Response<201, t_reaction> - | Response<422, t_validation_error> + | Res<200, t_reaction> + | Res<201, t_reaction> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -18530,9 +18319,7 @@ export type ReactionsDeleteForIssueComment = ( respond: ReactionsDeleteForIssueCommentResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type IssuesListEventsForRepoResponder = { with200(): KoaRuntimeResponse @@ -18551,8 +18338,8 @@ export type IssuesListEventsForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue_event[]> - | Response<422, t_validation_error> + | Res<200, t_issue_event[]> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -18570,10 +18357,10 @@ export type IssuesGetEvent = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue_event> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<410, t_basic_error> + | Res<200, t_issue_event> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<410, t_basic_error> | typeof SkipResponse > @@ -18592,11 +18379,11 @@ export type IssuesGet = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue> - | Response<301, t_basic_error> - | Response<304, void> - | Response<404, t_basic_error> - | Response<410, t_basic_error> + | Res<200, t_issue> + | Res<301, t_basic_error> + | Res<304, void> + | Res<404, t_basic_error> + | Res<410, t_basic_error> | typeof SkipResponse > @@ -18626,13 +18413,13 @@ export type IssuesUpdate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue> - | Response<301, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<410, t_basic_error> - | Response<422, t_validation_error> - | Response< + | Res<200, t_issue> + | Res<301, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<410, t_basic_error> + | Res<422, t_validation_error> + | Res< 503, { code?: string @@ -18658,7 +18445,7 @@ export type IssuesAddAssignees = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<201, t_issue> | typeof SkipResponse + KoaRuntimeResponse | Res<201, t_issue> | typeof SkipResponse > export type IssuesRemoveAssigneesResponder = { @@ -18676,7 +18463,7 @@ export type IssuesRemoveAssignees = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_issue> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_issue> | typeof SkipResponse > export type IssuesCheckUserCanBeAssignedToIssueResponder = { @@ -18696,8 +18483,8 @@ export type IssuesCheckUserCanBeAssignedToIssue = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -18719,9 +18506,9 @@ export type IssuesListComments = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue_comment[]> - | Response<404, t_basic_error> - | Response<410, t_basic_error> + | Res<200, t_issue_comment[]> + | Res<404, t_basic_error> + | Res<410, t_basic_error> | typeof SkipResponse > @@ -18745,11 +18532,11 @@ export type IssuesCreateComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_issue_comment> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<410, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_issue_comment> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<410, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -18770,8 +18557,8 @@ export type IssuesListEvents = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue_event_for_issue[]> - | Response<410, t_basic_error> + | Res<200, t_issue_event_for_issue[]> + | Res<410, t_basic_error> | typeof SkipResponse > @@ -18794,10 +18581,10 @@ export type IssuesListLabelsOnIssue = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_label[]> - | Response<301, t_basic_error> - | Response<404, t_basic_error> - | Response<410, t_basic_error> + | Res<200, t_label[]> + | Res<301, t_basic_error> + | Res<404, t_basic_error> + | Res<410, t_basic_error> | typeof SkipResponse > @@ -18821,11 +18608,11 @@ export type IssuesAddLabels = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_label[]> - | Response<301, t_basic_error> - | Response<404, t_basic_error> - | Response<410, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_label[]> + | Res<301, t_basic_error> + | Res<404, t_basic_error> + | Res<410, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -18849,11 +18636,11 @@ export type IssuesSetLabels = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_label[]> - | Response<301, t_basic_error> - | Response<404, t_basic_error> - | Response<410, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_label[]> + | Res<301, t_basic_error> + | Res<404, t_basic_error> + | Res<410, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -18871,10 +18658,10 @@ export type IssuesRemoveAllLabels = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<301, t_basic_error> - | Response<404, t_basic_error> - | Response<410, t_basic_error> + | Res<204, void> + | Res<301, t_basic_error> + | Res<404, t_basic_error> + | Res<410, t_basic_error> | typeof SkipResponse > @@ -18892,10 +18679,10 @@ export type IssuesRemoveLabel = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_label[]> - | Response<301, t_basic_error> - | Response<404, t_basic_error> - | Response<410, t_basic_error> + | Res<200, t_label[]> + | Res<301, t_basic_error> + | Res<404, t_basic_error> + | Res<410, t_basic_error> | typeof SkipResponse > @@ -18919,11 +18706,11 @@ export type IssuesLock = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<410, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<410, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -18940,9 +18727,9 @@ export type IssuesUnlock = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -18964,9 +18751,9 @@ export type ReactionsListForIssue = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_reaction[]> - | Response<404, t_basic_error> - | Response<410, t_basic_error> + | Res<200, t_reaction[]> + | Res<404, t_basic_error> + | Res<410, t_basic_error> | typeof SkipResponse > @@ -18988,9 +18775,9 @@ export type ReactionsCreateForIssue = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_reaction> - | Response<201, t_reaction> - | Response<422, t_validation_error> + | Res<200, t_reaction> + | Res<201, t_reaction> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -19003,9 +18790,7 @@ export type ReactionsDeleteForIssue = ( respond: ReactionsDeleteForIssueResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type IssuesRemoveSubIssueResponder = { with200(): KoaRuntimeResponse @@ -19025,9 +18810,9 @@ export type IssuesRemoveSubIssue = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue> - | Response<400, t_scim_error> - | Response<404, t_basic_error> + | Res<200, t_issue> + | Res<400, t_scim_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -19049,9 +18834,9 @@ export type IssuesListSubIssues = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue[]> - | Response<404, t_basic_error> - | Response<410, t_basic_error> + | Res<200, t_issue[]> + | Res<404, t_basic_error> + | Res<410, t_basic_error> | typeof SkipResponse > @@ -19075,11 +18860,11 @@ export type IssuesAddSubIssue = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_issue> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<410, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_issue> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<410, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -19107,11 +18892,11 @@ export type IssuesReprioritizeSubIssue = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> - | Response< + | Res<200, t_issue> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> + | Res< 503, { code?: string @@ -19140,9 +18925,9 @@ export type IssuesListEventsForTimeline = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_timeline_issue_events[]> - | Response<404, t_basic_error> - | Response<410, t_basic_error> + | Res<200, t_timeline_issue_events[]> + | Res<404, t_basic_error> + | Res<410, t_basic_error> | typeof SkipResponse > @@ -19161,9 +18946,7 @@ export type ReposListDeployKeys = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_deploy_key[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_deploy_key[]> | typeof SkipResponse > export type ReposCreateDeployKeyResponder = { @@ -19183,8 +18966,8 @@ export type ReposCreateDeployKey = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_deploy_key> - | Response<422, t_validation_error> + | Res<201, t_deploy_key> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -19200,8 +18983,8 @@ export type ReposGetDeployKey = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deploy_key> - | Response<404, t_basic_error> + | Res<200, t_deploy_key> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -19214,9 +18997,7 @@ export type ReposDeleteDeployKey = ( respond: ReposDeleteDeployKeyResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type IssuesListLabelsForRepoResponder = { with200(): KoaRuntimeResponse @@ -19235,8 +19016,8 @@ export type IssuesListLabelsForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_label[]> - | Response<404, t_basic_error> + | Res<200, t_label[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -19258,9 +19039,9 @@ export type IssuesCreateLabel = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_label> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_label> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -19276,8 +19057,8 @@ export type IssuesGetLabel = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_label> - | Response<404, t_basic_error> + | Res<200, t_label> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -19296,7 +19077,7 @@ export type IssuesUpdateLabel = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_label> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_label> | typeof SkipResponse > export type IssuesDeleteLabelResponder = { @@ -19308,9 +19089,7 @@ export type IssuesDeleteLabel = ( respond: IssuesDeleteLabelResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReposListLanguagesResponder = { with200(): KoaRuntimeResponse @@ -19322,7 +19101,7 @@ export type ReposListLanguages = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_language> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_language> | typeof SkipResponse > export type LicensesGetForRepoResponder = { @@ -19342,8 +19121,8 @@ export type LicensesGetForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_license_content> - | Response<404, t_basic_error> + | Res<200, t_license_content> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -19365,9 +19144,9 @@ export type ReposMergeUpstream = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_merged_upstream> - | Response<409, void> - | Response<422, void> + | Res<200, t_merged_upstream> + | Res<409, void> + | Res<422, void> | typeof SkipResponse > @@ -19387,12 +19166,12 @@ export type ReposMerge = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_commit> - | Response<204, void> - | Response<403, t_basic_error> - | Response<404, void> - | Response<409, void> - | Response<422, t_validation_error> + | Res<201, t_commit> + | Res<204, void> + | Res<403, t_basic_error> + | Res<404, void> + | Res<409, void> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -19413,8 +19192,8 @@ export type IssuesListMilestones = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_milestone[]> - | Response<404, t_basic_error> + | Res<200, t_milestone[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -19436,9 +19215,9 @@ export type IssuesCreateMilestone = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_milestone> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_milestone> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -19454,8 +19233,8 @@ export type IssuesGetMilestone = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_milestone> - | Response<404, t_basic_error> + | Res<200, t_milestone> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -19474,7 +19253,7 @@ export type IssuesUpdateMilestone = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_milestone> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_milestone> | typeof SkipResponse > export type IssuesDeleteMilestoneResponder = { @@ -19489,8 +19268,8 @@ export type IssuesDeleteMilestone = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -19509,7 +19288,7 @@ export type IssuesListLabelsForMilestone = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_label[]> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_label[]> | typeof SkipResponse > export type ActivityListRepoNotificationsForAuthenticatedUserResponder = { @@ -19527,7 +19306,7 @@ export type ActivityListRepoNotificationsForAuthenticatedUser = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_thread[]> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_thread[]> | typeof SkipResponse > export type ActivityMarkRepoNotificationsAsReadResponder = { @@ -19550,14 +19329,14 @@ export type ActivityMarkRepoNotificationsAsRead = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { message?: string url?: string } > - | Response<205, void> + | Res<205, void> | typeof SkipResponse > @@ -19573,8 +19352,8 @@ export type ReposGetPages = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_page> - | Response<404, t_basic_error> + | Res<200, t_page> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -19596,9 +19375,9 @@ export type ReposCreatePagesSite = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_page> - | Response<409, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_page> + | Res<409, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -19621,10 +19400,10 @@ export type ReposUpdateInformationAboutPagesSite = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<400, t_scim_error> - | Response<409, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<400, t_scim_error> + | Res<409, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -19642,10 +19421,10 @@ export type ReposDeletePagesSite = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> - | Response<409, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<404, t_basic_error> + | Res<409, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -19664,9 +19443,7 @@ export type ReposListPagesBuilds = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_page_build[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_page_build[]> | typeof SkipResponse > export type ReposRequestPagesBuildResponder = { @@ -19680,7 +19457,7 @@ export type ReposRequestPagesBuild = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_page_build_status> + | Res<201, t_page_build_status> | typeof SkipResponse > @@ -19694,9 +19471,7 @@ export type ReposGetLatestPagesBuild = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_page_build> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_page_build> | typeof SkipResponse > export type ReposGetPagesBuildResponder = { @@ -19709,9 +19484,7 @@ export type ReposGetPagesBuild = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_page_build> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_page_build> | typeof SkipResponse > export type ReposCreatePagesDeploymentResponder = { @@ -19733,10 +19506,10 @@ export type ReposCreatePagesDeployment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_page_deployment> - | Response<400, t_scim_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_page_deployment> + | Res<400, t_scim_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -19752,8 +19525,8 @@ export type ReposGetPagesDeployment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pages_deployment_status> - | Response<404, t_basic_error> + | Res<200, t_pages_deployment_status> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -19769,8 +19542,8 @@ export type ReposCancelPagesDeployment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -19789,11 +19562,11 @@ export type ReposGetPagesHealthCheck = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pages_health_check> - | Response<202, t_empty_object> - | Response<400, void> - | Response<404, t_basic_error> - | Response<422, void> + | Res<200, t_pages_health_check> + | Res<202, t_empty_object> + | Res<400, void> + | Res<404, t_basic_error> + | Res<422, void> | typeof SkipResponse > @@ -19816,13 +19589,13 @@ export type ReposCheckPrivateVulnerabilityReporting = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { enabled: boolean } > - | Response<422, t_scim_error> + | Res<422, t_scim_error> | typeof SkipResponse > @@ -19843,8 +19616,8 @@ export type ReposEnablePrivateVulnerabilityReporting = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<422, t_scim_error> + | Res<204, void> + | Res<422, t_scim_error> | typeof SkipResponse > @@ -19865,8 +19638,8 @@ export type ReposDisablePrivateVulnerabilityReporting = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<422, t_scim_error> + | Res<204, void> + | Res<422, t_scim_error> | typeof SkipResponse > @@ -19891,12 +19664,12 @@ export type ProjectsClassicListForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_project[]> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<410, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<200, t_project[]> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<410, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -19921,12 +19694,12 @@ export type ProjectsClassicCreateForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_project> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<410, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<201, t_project> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<410, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -19943,9 +19716,9 @@ export type ReposGetCustomPropertiesValues = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_custom_property_value[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_custom_property_value[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -19968,10 +19741,10 @@ export type ReposCreateOrUpdateCustomPropertiesValues = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -19988,9 +19761,9 @@ export type PullsList = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request_simple[]> - | Response<304, void> - | Response<422, t_validation_error> + | Res<200, t_pull_request_simple[]> + | Res<304, void> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -20012,9 +19785,9 @@ export type PullsCreate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_pull_request> - | Response<403, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_pull_request> + | Res<403, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -20034,7 +19807,7 @@ export type PullsListReviewCommentsForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request_review_comment[]> + | Res<200, t_pull_request_review_comment[]> | typeof SkipResponse > @@ -20050,8 +19823,8 @@ export type PullsGetReviewComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request_review_comment> - | Response<404, t_basic_error> + | Res<200, t_pull_request_review_comment> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -20071,7 +19844,7 @@ export type PullsUpdateReviewComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request_review_comment> + | Res<200, t_pull_request_review_comment> | typeof SkipResponse > @@ -20087,8 +19860,8 @@ export type PullsDeleteReviewComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -20109,8 +19882,8 @@ export type ReactionsListForPullRequestReviewComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_reaction[]> - | Response<404, t_basic_error> + | Res<200, t_reaction[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -20132,9 +19905,9 @@ export type ReactionsCreateForPullRequestReviewComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_reaction> - | Response<201, t_reaction> - | Response<422, t_validation_error> + | Res<200, t_reaction> + | Res<201, t_reaction> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -20152,9 +19925,7 @@ export type ReactionsDeleteForPullRequestComment = ( respond: ReactionsDeleteForPullRequestCommentResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type PullsGetResponder = { with200(): KoaRuntimeResponse @@ -20176,12 +19947,12 @@ export type PullsGet = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request> - | Response<304, void> - | Response<404, t_basic_error> - | Response<406, t_basic_error> - | Response<500, t_basic_error> - | Response< + | Res<200, t_pull_request> + | Res<304, void> + | Res<404, t_basic_error> + | Res<406, t_basic_error> + | Res<500, t_basic_error> + | Res< 503, { code?: string @@ -20210,9 +19981,9 @@ export type PullsUpdate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request> - | Response<403, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_pull_request> + | Res<403, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -20241,12 +20012,12 @@ export type CodespacesCreateWithPrForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_codespace> - | Response<202, t_codespace> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response< + | Res<201, t_codespace> + | Res<202, t_codespace> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -20273,7 +20044,7 @@ export type PullsListReviewComments = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request_review_comment[]> + | Res<200, t_pull_request_review_comment[]> | typeof SkipResponse > @@ -20295,9 +20066,9 @@ export type PullsCreateReviewComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_pull_request_review_comment> - | Response<403, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_pull_request_review_comment> + | Res<403, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -20318,8 +20089,8 @@ export type PullsCreateReplyForReviewComment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_pull_request_review_comment> - | Response<404, t_basic_error> + | Res<201, t_pull_request_review_comment> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -20338,7 +20109,7 @@ export type PullsListCommits = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_commit[]> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_commit[]> | typeof SkipResponse > export type PullsListFilesResponder = { @@ -20364,10 +20135,10 @@ export type PullsListFiles = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_diff_entry[]> - | Response<422, t_validation_error> - | Response<500, t_basic_error> - | Response< + | Res<200, t_diff_entry[]> + | Res<422, t_validation_error> + | Res<500, t_basic_error> + | Res< 503, { code?: string @@ -20390,8 +20161,8 @@ export type PullsCheckIfMerged = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, void> + | Res<204, void> + | Res<404, void> | typeof SkipResponse > @@ -20422,24 +20193,24 @@ export type PullsMerge = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request_merge_result> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response< + | Res<200, t_pull_request_merge_result> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res< 405, { documentation_url?: string message?: string } > - | Response< + | Res< 409, { documentation_url?: string message?: string } > - | Response<422, t_validation_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -20454,7 +20225,7 @@ export type PullsListRequestedReviewers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request_review_request> + | Res<200, t_pull_request_review_request> | typeof SkipResponse > @@ -20476,9 +20247,9 @@ export type PullsRequestReviewers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_pull_request_simple> - | Response<403, t_basic_error> - | Response<422, void> + | Res<201, t_pull_request_simple> + | Res<403, t_basic_error> + | Res<422, void> | typeof SkipResponse > @@ -20499,8 +20270,8 @@ export type PullsRemoveRequestedReviewers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request_simple> - | Response<422, t_validation_error> + | Res<200, t_pull_request_simple> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -20520,7 +20291,7 @@ export type PullsListReviews = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request_review[]> + | Res<200, t_pull_request_review[]> | typeof SkipResponse > @@ -20542,9 +20313,9 @@ export type PullsCreateReview = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request_review> - | Response<403, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<200, t_pull_request_review> + | Res<403, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -20560,8 +20331,8 @@ export type PullsGetReview = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request_review> - | Response<404, t_basic_error> + | Res<200, t_pull_request_review> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -20582,8 +20353,8 @@ export type PullsUpdateReview = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request_review> - | Response<422, t_validation_error_simple> + | Res<200, t_pull_request_review> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -20600,9 +20371,9 @@ export type PullsDeletePendingReview = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request_review> - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<200, t_pull_request_review> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -20623,8 +20394,8 @@ export type PullsListCommentsForReview = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_review_comment[]> - | Response<404, t_basic_error> + | Res<200, t_review_comment[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -20646,9 +20417,9 @@ export type PullsDismissReview = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request_review> - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<200, t_pull_request_review> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -20671,10 +20442,10 @@ export type PullsSubmitReview = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_pull_request_review> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<200, t_pull_request_review> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -20699,15 +20470,15 @@ export type PullsUpdateBranch = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { message?: string url?: string } > - | Response<403, t_basic_error> - | Response<422, t_validation_error> + | Res<403, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -20730,10 +20501,10 @@ export type ReposGetReadme = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_content_file> - | Response<304, void> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_content_file> + | Res<304, void> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -20755,9 +20526,9 @@ export type ReposGetReadmeInDirectory = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_content_file> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_content_file> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -20778,8 +20549,8 @@ export type ReposListReleases = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_release[]> - | Response<404, t_basic_error> + | Res<200, t_release[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -20801,9 +20572,9 @@ export type ReposCreateRelease = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_release> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_release> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -20820,9 +20591,9 @@ export type ReposGetReleaseAsset = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_release_asset> - | Response<302, void> - | Response<404, t_basic_error> + | Res<200, t_release_asset> + | Res<302, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -20841,9 +20612,7 @@ export type ReposUpdateReleaseAsset = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_release_asset> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_release_asset> | typeof SkipResponse > export type ReposDeleteReleaseAssetResponder = { @@ -20855,9 +20624,7 @@ export type ReposDeleteReleaseAsset = ( respond: ReposDeleteReleaseAssetResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReposGenerateReleaseNotesResponder = { with200(): KoaRuntimeResponse @@ -20876,8 +20643,8 @@ export type ReposGenerateReleaseNotes = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_release_notes_content> - | Response<404, t_basic_error> + | Res<200, t_release_notes_content> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -20891,7 +20658,7 @@ export type ReposGetLatestRelease = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_release> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_release> | typeof SkipResponse > export type ReposGetReleaseByTagResponder = { @@ -20906,8 +20673,8 @@ export type ReposGetReleaseByTag = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_release> - | Response<404, t_basic_error> + | Res<200, t_release> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -20923,8 +20690,8 @@ export type ReposGetRelease = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_release> - | Response<401, void> + | Res<200, t_release> + | Res<401, void> | typeof SkipResponse > @@ -20945,8 +20712,8 @@ export type ReposUpdateRelease = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_release> - | Response<404, t_basic_error> + | Res<200, t_release> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -20959,9 +20726,7 @@ export type ReposDeleteRelease = ( respond: ReposDeleteReleaseResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReposListReleaseAssetsResponder = { with200(): KoaRuntimeResponse @@ -20979,7 +20744,7 @@ export type ReposListReleaseAssets = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_release_asset[]> + | Res<200, t_release_asset[]> | typeof SkipResponse > @@ -21000,8 +20765,8 @@ export type ReposUploadReleaseAsset = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_release_asset> - | Response<422, void> + | Res<201, t_release_asset> + | Res<422, void> | typeof SkipResponse > @@ -21022,8 +20787,8 @@ export type ReactionsListForRelease = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_reaction[]> - | Response<404, t_basic_error> + | Res<200, t_reaction[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -21045,9 +20810,9 @@ export type ReactionsCreateForRelease = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_reaction> - | Response<201, t_reaction> - | Response<422, t_validation_error> + | Res<200, t_reaction> + | Res<201, t_reaction> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -21060,9 +20825,7 @@ export type ReactionsDeleteForRelease = ( respond: ReactionsDeleteForReleaseResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReposGetBranchRulesResponder = { with200(): KoaRuntimeResponse @@ -21080,7 +20843,7 @@ export type ReposGetBranchRules = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository_rule_detailed[]> + | Res<200, t_repository_rule_detailed[]> | typeof SkipResponse > @@ -21102,9 +20865,9 @@ export type ReposGetRepoRulesets = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository_ruleset[]> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_repository_ruleset[]> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -21126,9 +20889,9 @@ export type ReposCreateRepoRuleset = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_repository_ruleset> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<201, t_repository_ruleset> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -21150,9 +20913,9 @@ export type ReposGetRepoRuleSuites = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_rule_suites> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_rule_suites> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -21169,9 +20932,9 @@ export type ReposGetRepoRuleSuite = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_rule_suite> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_rule_suite> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -21193,9 +20956,9 @@ export type ReposGetRepoRuleset = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository_ruleset> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_repository_ruleset> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -21217,9 +20980,9 @@ export type ReposUpdateRepoRuleset = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository_ruleset> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_repository_ruleset> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -21236,9 +20999,9 @@ export type ReposDeleteRepoRuleset = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<204, void> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -21260,9 +21023,9 @@ export type ReposGetRepoRulesetHistory = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_ruleset_version[]> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_ruleset_version[]> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -21279,9 +21042,9 @@ export type ReposGetRepoRulesetVersion = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_ruleset_version_with_state> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_ruleset_version_with_state> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -21307,9 +21070,9 @@ export type SecretScanningListAlertsForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_secret_scanning_alert[]> - | Response<404, void> - | Response< + | Res<200, t_secret_scanning_alert[]> + | Res<404, void> + | Res< 503, { code?: string @@ -21343,10 +21106,10 @@ export type SecretScanningGetAlert = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_secret_scanning_alert> - | Response<304, void> - | Response<404, void> - | Response< + | Res<200, t_secret_scanning_alert> + | Res<304, void> + | Res<404, void> + | Res< 503, { code?: string @@ -21381,11 +21144,11 @@ export type SecretScanningUpdateAlert = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_secret_scanning_alert> - | Response<400, void> - | Response<404, void> - | Response<422, void> - | Response< + | Res<200, t_secret_scanning_alert> + | Res<400, void> + | Res<404, void> + | Res<422, void> + | Res< 503, { code?: string @@ -21418,9 +21181,9 @@ export type SecretScanningListLocationsForAlert = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_secret_scanning_location[]> - | Response<404, void> - | Response< + | Res<200, t_secret_scanning_location[]> + | Res<404, void> + | Res< 503, { code?: string @@ -21455,11 +21218,11 @@ export type SecretScanningCreatePushProtectionBypass = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_secret_scanning_push_protection_bypass> - | Response<403, void> - | Response<404, void> - | Response<422, void> - | Response< + | Res<200, t_secret_scanning_push_protection_bypass> + | Res<403, void> + | Res<404, void> + | Res<422, void> + | Res< 503, { code?: string @@ -21487,9 +21250,9 @@ export type SecretScanningGetScanHistory = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_secret_scanning_scan_history> - | Response<404, void> - | Response< + | Res<200, t_secret_scanning_scan_history> + | Res<404, void> + | Res< 503, { code?: string @@ -21518,9 +21281,9 @@ export type SecurityAdvisoriesListRepositoryAdvisories = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository_advisory[]> - | Response<400, t_scim_error> - | Response<404, t_basic_error> + | Res<200, t_repository_advisory[]> + | Res<400, t_scim_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -21543,10 +21306,10 @@ export type SecurityAdvisoriesCreateRepositoryAdvisory = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_repository_advisory> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_repository_advisory> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -21569,10 +21332,10 @@ export type SecurityAdvisoriesCreatePrivateVulnerabilityReport = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_repository_advisory> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_repository_advisory> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -21594,9 +21357,9 @@ export type SecurityAdvisoriesGetRepositoryAdvisory = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository_advisory> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_repository_advisory> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -21619,10 +21382,10 @@ export type SecurityAdvisoriesUpdateRepositoryAdvisory = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository_advisory> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_repository_advisory> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -21648,16 +21411,16 @@ export type SecurityAdvisoriesCreateRepositoryAdvisoryCveRequest = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { [key: string]: unknown | undefined } > - | Response<400, t_scim_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<400, t_scim_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -21676,11 +21439,11 @@ export type SecurityAdvisoriesCreateFork = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<202, t_full_repository> - | Response<400, t_scim_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<202, t_full_repository> + | Res<400, t_scim_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -21701,8 +21464,8 @@ export type ActivityListStargazersForRepo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_simple_user[] | t_stargazer[]> - | Response<422, t_validation_error> + | Res<200, t_simple_user[] | t_stargazer[]> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -21722,15 +21485,15 @@ export type ReposGetCodeFrequencyStats = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_frequency_stat[]> - | Response< + | Res<200, t_code_frequency_stat[]> + | Res< 202, { [key: string]: unknown | undefined } > - | Response<204, void> - | Response<422, void> + | Res<204, void> + | Res<422, void> | typeof SkipResponse > @@ -21749,14 +21512,14 @@ export type ReposGetCommitActivityStats = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_commit_activity[]> - | Response< + | Res<200, t_commit_activity[]> + | Res< 202, { [key: string]: unknown | undefined } > - | Response<204, void> + | Res<204, void> | typeof SkipResponse > @@ -21775,14 +21538,14 @@ export type ReposGetContributorsStats = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_contributor_activity[]> - | Response< + | Res<200, t_contributor_activity[]> + | Res< 202, { [key: string]: unknown | undefined } > - | Response<204, void> + | Res<204, void> | typeof SkipResponse > @@ -21798,8 +21561,8 @@ export type ReposGetParticipationStats = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_participation_stats> - | Response<404, t_basic_error> + | Res<200, t_participation_stats> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -21815,8 +21578,8 @@ export type ReposGetPunchCardStats = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_code_frequency_stat[]> - | Response<204, void> + | Res<200, t_code_frequency_stat[]> + | Res<204, void> | typeof SkipResponse > @@ -21835,7 +21598,7 @@ export type ReposCreateCommitStatus = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<201, t_status> | typeof SkipResponse + KoaRuntimeResponse | Res<201, t_status> | typeof SkipResponse > export type ActivityListWatchersForRepoResponder = { @@ -21853,9 +21616,7 @@ export type ActivityListWatchersForRepo = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_simple_user[]> | typeof SkipResponse > export type ActivityGetRepoSubscriptionResponder = { @@ -21871,9 +21632,9 @@ export type ActivityGetRepoSubscription = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository_subscription> - | Response<403, t_basic_error> - | Response<404, void> + | Res<200, t_repository_subscription> + | Res<403, t_basic_error> + | Res<404, void> | typeof SkipResponse > @@ -21893,7 +21654,7 @@ export type ActivitySetRepoSubscription = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository_subscription> + | Res<200, t_repository_subscription> | typeof SkipResponse > @@ -21906,9 +21667,7 @@ export type ActivityDeleteRepoSubscription = ( respond: ActivityDeleteRepoSubscriptionResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReposListTagsResponder = { with200(): KoaRuntimeResponse @@ -21925,7 +21684,7 @@ export type ReposListTags = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_tag[]> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_tag[]> | typeof SkipResponse > export type ReposListTagProtectionResponder = { @@ -21941,9 +21700,9 @@ export type ReposListTagProtection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tag_protection[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_tag_protection[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -21965,9 +21724,9 @@ export type ReposCreateTagProtection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_tag_protection> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<201, t_tag_protection> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -21984,9 +21743,9 @@ export type ReposDeleteTagProtection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -21999,9 +21758,7 @@ export type ReposDownloadTarballArchive = ( respond: ReposDownloadTarballArchiveResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<302, void> | typeof SkipResponse -> +) => Promise | Res<302, void> | typeof SkipResponse> export type ReposListTeamsResponder = { with200(): KoaRuntimeResponse @@ -22020,8 +21777,8 @@ export type ReposListTeams = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team[]> - | Response<404, t_basic_error> + | Res<200, t_team[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -22042,8 +21799,8 @@ export type ReposGetAllTopics = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_topic> - | Response<404, t_basic_error> + | Res<200, t_topic> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -22065,9 +21822,9 @@ export type ReposReplaceAllTopics = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_topic> - | Response<404, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<200, t_topic> + | Res<404, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -22088,8 +21845,8 @@ export type ReposGetClones = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_clone_traffic> - | Response<403, t_basic_error> + | Res<200, t_clone_traffic> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -22105,8 +21862,8 @@ export type ReposGetTopPaths = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_content_traffic[]> - | Response<403, t_basic_error> + | Res<200, t_content_traffic[]> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -22122,8 +21879,8 @@ export type ReposGetTopReferrers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_referrer_traffic[]> - | Response<403, t_basic_error> + | Res<200, t_referrer_traffic[]> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -22144,8 +21901,8 @@ export type ReposGetViews = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_view_traffic> - | Response<403, t_basic_error> + | Res<200, t_view_traffic> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -22165,7 +21922,7 @@ export type ReposTransfer = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<202, t_minimal_repository> + | Res<202, t_minimal_repository> | typeof SkipResponse > @@ -22181,8 +21938,8 @@ export type ReposCheckVulnerabilityAlerts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, void> + | Res<204, void> + | Res<404, void> | typeof SkipResponse > @@ -22195,9 +21952,7 @@ export type ReposEnableVulnerabilityAlerts = ( respond: ReposEnableVulnerabilityAlertsResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReposDisableVulnerabilityAlertsResponder = { with204(): KoaRuntimeResponse @@ -22213,9 +21968,7 @@ export type ReposDisableVulnerabilityAlerts = ( respond: ReposDisableVulnerabilityAlertsResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReposDownloadZipballArchiveResponder = { with302(): KoaRuntimeResponse @@ -22226,9 +21979,7 @@ export type ReposDownloadZipballArchive = ( respond: ReposDownloadZipballArchiveResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<302, void> | typeof SkipResponse -> +) => Promise | Res<302, void> | typeof SkipResponse> export type ReposCreateUsingTemplateResponder = { with201(): KoaRuntimeResponse @@ -22246,7 +21997,7 @@ export type ReposCreateUsingTemplate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_full_repository> + | Res<201, t_full_repository> | typeof SkipResponse > @@ -22263,9 +22014,9 @@ export type ReposListPublic = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_minimal_repository[]> - | Response<304, void> - | Response<422, t_validation_error> + | Res<200, t_minimal_repository[]> + | Res<304, void> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -22292,7 +22043,7 @@ export type SearchCode = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { incomplete_results: boolean @@ -22300,10 +22051,10 @@ export type SearchCode = ( total_count: number } > - | Response<304, void> - | Response<403, t_basic_error> - | Response<422, t_validation_error> - | Response< + | Res<304, void> + | Res<403, t_basic_error> + | Res<422, t_validation_error> + | Res< 503, { code?: string @@ -22330,7 +22081,7 @@ export type SearchCommits = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { incomplete_results: boolean @@ -22338,7 +22089,7 @@ export type SearchCommits = ( total_count: number } > - | Response<304, void> + | Res<304, void> | typeof SkipResponse > @@ -22365,7 +22116,7 @@ export type SearchIssuesAndPullRequests = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { incomplete_results: boolean @@ -22373,10 +22124,10 @@ export type SearchIssuesAndPullRequests = ( total_count: number } > - | Response<304, void> - | Response<403, t_basic_error> - | Response<422, t_validation_error> - | Response< + | Res<304, void> + | Res<403, t_basic_error> + | Res<422, t_validation_error> + | Res< 503, { code?: string @@ -22406,7 +22157,7 @@ export type SearchLabels = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { incomplete_results: boolean @@ -22414,10 +22165,10 @@ export type SearchLabels = ( total_count: number } > - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -22443,7 +22194,7 @@ export type SearchRepos = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { incomplete_results: boolean @@ -22451,9 +22202,9 @@ export type SearchRepos = ( total_count: number } > - | Response<304, void> - | Response<422, t_validation_error> - | Response< + | Res<304, void> + | Res<422, t_validation_error> + | Res< 503, { code?: string @@ -22480,7 +22231,7 @@ export type SearchTopics = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { incomplete_results: boolean @@ -22488,7 +22239,7 @@ export type SearchTopics = ( total_count: number } > - | Response<304, void> + | Res<304, void> | typeof SkipResponse > @@ -22514,7 +22265,7 @@ export type SearchUsers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { incomplete_results: boolean @@ -22522,9 +22273,9 @@ export type SearchUsers = ( total_count: number } > - | Response<304, void> - | Response<422, t_validation_error> - | Response< + | Res<304, void> + | Res<422, t_validation_error> + | Res< 503, { code?: string @@ -22547,8 +22298,8 @@ export type TeamsGetLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_full> - | Response<404, t_basic_error> + | Res<200, t_team_full> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -22572,11 +22323,11 @@ export type TeamsUpdateLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_full> - | Response<201, t_team_full> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_team_full> + | Res<201, t_team_full> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -22593,9 +22344,9 @@ export type TeamsDeleteLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -22615,7 +22366,7 @@ export type TeamsListDiscussionsLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_discussion[]> + | Res<200, t_team_discussion[]> | typeof SkipResponse > @@ -22635,7 +22386,7 @@ export type TeamsCreateDiscussionLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_team_discussion> + | Res<201, t_team_discussion> | typeof SkipResponse > @@ -22650,7 +22401,7 @@ export type TeamsGetDiscussionLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_discussion> + | Res<200, t_team_discussion> | typeof SkipResponse > @@ -22670,7 +22421,7 @@ export type TeamsUpdateDiscussionLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_discussion> + | Res<200, t_team_discussion> | typeof SkipResponse > @@ -22683,9 +22434,7 @@ export type TeamsDeleteDiscussionLegacy = ( respond: TeamsDeleteDiscussionLegacyResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type TeamsListDiscussionCommentsLegacyResponder = { with200(): KoaRuntimeResponse @@ -22703,7 +22452,7 @@ export type TeamsListDiscussionCommentsLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_discussion_comment[]> + | Res<200, t_team_discussion_comment[]> | typeof SkipResponse > @@ -22723,7 +22472,7 @@ export type TeamsCreateDiscussionCommentLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_team_discussion_comment> + | Res<201, t_team_discussion_comment> | typeof SkipResponse > @@ -22743,7 +22492,7 @@ export type TeamsGetDiscussionCommentLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_discussion_comment> + | Res<200, t_team_discussion_comment> | typeof SkipResponse > @@ -22763,7 +22512,7 @@ export type TeamsUpdateDiscussionCommentLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_discussion_comment> + | Res<200, t_team_discussion_comment> | typeof SkipResponse > @@ -22781,9 +22530,7 @@ export type TeamsDeleteDiscussionCommentLegacy = ( respond: TeamsDeleteDiscussionCommentLegacyResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ReactionsListForTeamDiscussionCommentLegacyResponder = { with200(): KoaRuntimeResponse @@ -22800,9 +22547,7 @@ export type ReactionsListForTeamDiscussionCommentLegacy = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_reaction[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_reaction[]> | typeof SkipResponse > export type ReactionsCreateForTeamDiscussionCommentLegacyResponder = { @@ -22820,7 +22565,7 @@ export type ReactionsCreateForTeamDiscussionCommentLegacy = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<201, t_reaction> | typeof SkipResponse + KoaRuntimeResponse | Res<201, t_reaction> | typeof SkipResponse > export type ReactionsListForTeamDiscussionLegacyResponder = { @@ -22838,9 +22583,7 @@ export type ReactionsListForTeamDiscussionLegacy = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_reaction[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_reaction[]> | typeof SkipResponse > export type ReactionsCreateForTeamDiscussionLegacyResponder = { @@ -22858,7 +22601,7 @@ export type ReactionsCreateForTeamDiscussionLegacy = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<201, t_reaction> | typeof SkipResponse + KoaRuntimeResponse | Res<201, t_reaction> | typeof SkipResponse > export type TeamsListPendingInvitationsLegacyResponder = { @@ -22877,7 +22620,7 @@ export type TeamsListPendingInvitationsLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_organization_invitation[]> + | Res<200, t_organization_invitation[]> | typeof SkipResponse > @@ -22898,8 +22641,8 @@ export type TeamsListMembersLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | Response<404, t_basic_error> + | Res<200, t_simple_user[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -22915,8 +22658,8 @@ export type TeamsGetMemberLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, void> + | Res<204, void> + | Res<404, void> | typeof SkipResponse > @@ -22934,10 +22677,10 @@ export type TeamsAddMemberLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> - | Response<404, void> - | Response<422, void> + | Res<204, void> + | Res<403, t_basic_error> + | Res<404, void> + | Res<422, void> | typeof SkipResponse > @@ -22953,8 +22696,8 @@ export type TeamsRemoveMemberLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, void> + | Res<204, void> + | Res<404, void> | typeof SkipResponse > @@ -22975,8 +22718,8 @@ export type TeamsGetMembershipForUserLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_membership> - | Response<404, t_basic_error> + | Res<200, t_team_membership> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -22999,10 +22742,10 @@ export type TeamsAddOrUpdateMembershipForUserLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_membership> - | Response<403, void> - | Response<404, t_basic_error> - | Response<422, void> + | Res<200, t_team_membership> + | Res<403, void> + | Res<404, t_basic_error> + | Res<422, void> | typeof SkipResponse > @@ -23023,8 +22766,8 @@ export type TeamsRemoveMembershipForUserLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, void> + | Res<204, void> + | Res<403, void> | typeof SkipResponse > @@ -23045,8 +22788,8 @@ export type TeamsListProjectsLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_project[]> - | Response<404, t_basic_error> + | Res<200, t_team_project[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -23067,8 +22810,8 @@ export type TeamsCheckPermissionsForProjectLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_project> - | Response<404, void> + | Res<200, t_team_project> + | Res<404, void> | typeof SkipResponse > @@ -23094,16 +22837,16 @@ export type TeamsAddOrUpdateProjectPermissionsLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response< + | Res<204, void> + | Res< 403, { documentation_url?: string message?: string } > - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -23120,9 +22863,9 @@ export type TeamsRemoveProjectLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -23143,8 +22886,8 @@ export type TeamsListReposLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_minimal_repository[]> - | Response<404, t_basic_error> + | Res<200, t_minimal_repository[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -23166,9 +22909,9 @@ export type TeamsCheckPermissionsForRepoLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_repository> - | Response<204, void> - | Response<404, void> + | Res<200, t_team_repository> + | Res<204, void> + | Res<404, void> | typeof SkipResponse > @@ -23190,9 +22933,9 @@ export type TeamsAddOrUpdateRepoPermissionsLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<403, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -23205,9 +22948,7 @@ export type TeamsRemoveRepoLegacy = ( respond: TeamsRemoveRepoLegacyResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type TeamsListChildLegacyResponder = { with200(): KoaRuntimeResponse @@ -23228,10 +22969,10 @@ export type TeamsListChildLegacy = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team[]> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_team[]> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -23249,10 +22990,10 @@ export type UsersGetAuthenticated = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_private_user | t_public_user> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_private_user | t_public_user> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -23277,12 +23018,12 @@ export type UsersUpdateAuthenticated = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_private_user> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_private_user> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -23306,11 +23047,11 @@ export type UsersListBlockedByAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_simple_user[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -23329,11 +23070,11 @@ export type UsersCheckBlocked = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -23353,12 +23094,12 @@ export type UsersBlock = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -23377,11 +23118,11 @@ export type UsersUnblock = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -23409,18 +23150,18 @@ export type CodespacesListForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { codespaces: t_codespace[] total_count: number } > - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -23449,12 +23190,12 @@ export type CodespacesCreateForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_codespace> - | Response<202, t_codespace> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response< + | Res<201, t_codespace> + | Res<202, t_codespace> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res< 503, { code?: string @@ -23484,7 +23225,7 @@ export type CodespacesListSecretsForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { secrets: t_codespaces_secret[] @@ -23505,7 +23246,7 @@ export type CodespacesGetPublicKeyForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_codespaces_user_public_key> + | Res<200, t_codespaces_user_public_key> | typeof SkipResponse > @@ -23525,7 +23266,7 @@ export type CodespacesGetSecretForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_codespaces_secret> + | Res<200, t_codespaces_secret> | typeof SkipResponse > @@ -23548,10 +23289,10 @@ export type CodespacesCreateOrUpdateSecretForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_empty_object> - | Response<204, void> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_empty_object> + | Res<204, void> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -23569,9 +23310,7 @@ export type CodespacesDeleteSecretForAuthenticatedUser = ( respond: CodespacesDeleteSecretForAuthenticatedUserResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type CodespacesListRepositoriesForSecretForAuthenticatedUserResponder = { with200(): KoaRuntimeResponse<{ @@ -23596,17 +23335,17 @@ export type CodespacesListRepositoriesForSecretForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { repositories: t_minimal_repository[] total_count: number } > - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -23630,11 +23369,11 @@ export type CodespacesSetRepositoriesForSecretForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<204, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -23658,11 +23397,11 @@ export type CodespacesAddRepositoryForSecretForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<204, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -23686,11 +23425,11 @@ export type CodespacesRemoveRepositoryForSecretForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<204, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -23715,12 +23454,12 @@ export type CodespacesGetForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_codespace> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_codespace> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -23743,10 +23482,10 @@ export type CodespacesUpdateForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_codespace> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_codespace> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -23773,17 +23512,17 @@ export type CodespacesDeleteForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { [key: string]: unknown | undefined } > - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -23808,12 +23547,12 @@ export type CodespacesExportForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<202, t_codespace_export_details> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> - | Response<500, t_basic_error> + | Res<202, t_codespace_export_details> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -23834,8 +23573,8 @@ export type CodespacesGetExportDetailsForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_codespace_export_details> - | Response<404, t_basic_error> + | Res<200, t_codespace_export_details> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -23863,18 +23602,18 @@ export type CodespacesCodespaceMachinesForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { machines: t_codespace_machine[] total_count: number } > - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -23898,11 +23637,11 @@ export type CodespacesPublishForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_codespace_with_full_repository> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_codespace_with_full_repository> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -23930,15 +23669,15 @@ export type CodespacesStartForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_codespace> - | Response<304, void> - | Response<400, t_scim_error> - | Response<401, t_basic_error> - | Response<402, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<409, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_codespace> + | Res<304, void> + | Res<400, t_scim_error> + | Res<401, t_basic_error> + | Res<402, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<409, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -23962,11 +23701,11 @@ export type CodespacesStopForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_codespace> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<500, t_basic_error> + | Res<200, t_codespace> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<500, t_basic_error> | typeof SkipResponse > @@ -23982,9 +23721,7 @@ export type PackagesListDockerMigrationConflictingPackagesForAuthenticatedUser = ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_package[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_package[]> | typeof SkipResponse > export type UsersSetPrimaryEmailVisibilityForAuthenticatedUserResponder = { @@ -24008,12 +23745,12 @@ export type UsersSetPrimaryEmailVisibilityForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_email[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_email[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -24037,11 +23774,11 @@ export type UsersListEmailsForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_email[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_email[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -24066,12 +23803,12 @@ export type UsersAddEmailForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_email[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_email[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -24096,12 +23833,12 @@ export type UsersDeleteEmailForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -24124,10 +23861,10 @@ export type UsersListFollowersForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_simple_user[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -24150,10 +23887,10 @@ export type UsersListFollowedByAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_simple_user[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -24177,11 +23914,11 @@ export type UsersCheckPersonIsFollowedByAuthenticated = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -24201,12 +23938,12 @@ export type UsersFollow = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -24225,11 +23962,11 @@ export type UsersUnfollow = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -24253,11 +23990,11 @@ export type UsersListGpgKeysForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_gpg_key[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_gpg_key[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -24282,12 +24019,12 @@ export type UsersCreateGpgKeyForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_gpg_key> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_gpg_key> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -24311,11 +24048,11 @@ export type UsersGetGpgKeyForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_gpg_key> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_gpg_key> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -24340,12 +24077,12 @@ export type UsersDeleteGpgKeyForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -24371,16 +24108,16 @@ export type AppsListInstallationsForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { installations: t_installation[] total_count: number } > - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -24407,7 +24144,7 @@ export type AppsListInstallationReposForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { repositories: t_repository[] @@ -24415,9 +24152,9 @@ export type AppsListInstallationReposForAuthenticatedUser = ( total_count: number } > - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -24440,10 +24177,10 @@ export type AppsAddRepoToInstallationForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -24467,11 +24204,11 @@ export type AppsRemoveRepoFromInstallationForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, void> + | Res<204, void> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, void> | typeof SkipResponse > @@ -24487,8 +24224,8 @@ export type InteractionsGetRestrictionsForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_interaction_limit_response | EmptyObject> - | Response<204, void> + | Res<200, t_interaction_limit_response | EmptyObject> + | Res<204, void> | typeof SkipResponse > @@ -24504,8 +24241,8 @@ export type InteractionsSetRestrictionsForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_interaction_limit_response> - | Response<422, t_validation_error> + | Res<200, t_interaction_limit_response> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -24518,9 +24255,7 @@ export type InteractionsRemoveRestrictionsForAuthenticatedUser = ( respond: InteractionsRemoveRestrictionsForAuthenticatedUserResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type IssuesListForAuthenticatedUserResponder = { with200(): KoaRuntimeResponse @@ -24535,9 +24270,9 @@ export type IssuesListForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issue[]> - | Response<304, void> - | Response<404, t_basic_error> + | Res<200, t_issue[]> + | Res<304, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -24561,11 +24296,11 @@ export type UsersListPublicSshKeysForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_key[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_key[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -24590,12 +24325,12 @@ export type UsersCreatePublicSshKeyForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_key> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_key> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -24619,11 +24354,11 @@ export type UsersGetPublicSshKeyForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_key> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_key> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -24647,11 +24382,11 @@ export type UsersDeletePublicSshKeyForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -24674,10 +24409,10 @@ export type AppsListSubscriptionsForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_user_marketplace_purchase[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_user_marketplace_purchase[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -24699,9 +24434,9 @@ export type AppsListSubscriptionsForAuthenticatedUserStubbed = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_user_marketplace_purchase[]> - | Response<304, void> - | Response<401, t_basic_error> + | Res<200, t_user_marketplace_purchase[]> + | Res<304, void> + | Res<401, t_basic_error> | typeof SkipResponse > @@ -24725,11 +24460,11 @@ export type OrgsListMembershipsForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_org_membership[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_org_membership[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -24751,9 +24486,9 @@ export type OrgsGetMembershipForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_org_membership> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_org_membership> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -24776,10 +24511,10 @@ export type OrgsUpdateMembershipForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_org_membership> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_org_membership> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -24802,10 +24537,10 @@ export type MigrationsListForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_migration[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_migration[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -24829,11 +24564,11 @@ export type MigrationsStartForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_migration> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_migration> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -24857,11 +24592,11 @@ export type MigrationsGetStatusForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_migration> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_migration> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -24884,10 +24619,10 @@ export type MigrationsGetArchiveForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<302, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<302, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -24911,11 +24646,11 @@ export type MigrationsDeleteArchiveForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -24939,11 +24674,11 @@ export type MigrationsUnlockRepoForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -24964,8 +24699,8 @@ export type MigrationsListReposForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_minimal_repository[]> - | Response<404, t_basic_error> + | Res<200, t_minimal_repository[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -24983,10 +24718,10 @@ export type OrgsListForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_organization_simple[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_organization_simple[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -25007,8 +24742,8 @@ export type PackagesListPackagesForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_package[]> - | Response<400, void> + | Res<200, t_package[]> + | Res<400, void> | typeof SkipResponse > @@ -25027,7 +24762,7 @@ export type PackagesGetPackageForAuthenticatedUser = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_package> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_package> | typeof SkipResponse > export type PackagesDeletePackageForAuthenticatedUserResponder = { @@ -25049,10 +24784,10 @@ export type PackagesDeletePackageForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25075,10 +24810,10 @@ export type PackagesRestorePackageForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25102,10 +24837,10 @@ export type PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_package_version[]> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_package_version[]> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25125,7 +24860,7 @@ export type PackagesGetPackageVersionForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_package_version> + | Res<200, t_package_version> | typeof SkipResponse > @@ -25148,10 +24883,10 @@ export type PackagesDeletePackageVersionForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25174,10 +24909,10 @@ export type PackagesRestorePackageVersionForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25201,11 +24936,11 @@ export type ProjectsClassicCreateForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_project> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<422, t_validation_error_simple> + | Res<201, t_project> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<422, t_validation_error_simple> | typeof SkipResponse > @@ -25229,11 +24964,11 @@ export type UsersListPublicEmailsForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_email[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_email[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25252,11 +24987,11 @@ export type ReposListForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_repository[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -25282,13 +25017,13 @@ export type ReposCreateForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_full_repository> - | Response<304, void> - | Response<400, t_scim_error> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_full_repository> + | Res<304, void> + | Res<400, t_scim_error> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -25312,11 +25047,11 @@ export type ReposListInvitationsForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_repository_invitation[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_repository_invitation[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25340,11 +25075,11 @@ export type ReposAcceptInvitationForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<409, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<409, t_basic_error> | typeof SkipResponse > @@ -25368,11 +25103,11 @@ export type ReposDeclineInvitationForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<409, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<409, t_basic_error> | typeof SkipResponse > @@ -25396,11 +25131,11 @@ export type UsersListSocialAccountsForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_social_account[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_social_account[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25425,12 +25160,12 @@ export type UsersAddSocialAccountForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_social_account[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_social_account[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -25455,12 +25190,12 @@ export type UsersDeleteSocialAccountForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -25484,11 +25219,11 @@ export type UsersListSshSigningKeysForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_ssh_signing_key[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_ssh_signing_key[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25513,12 +25248,12 @@ export type UsersCreateSshSigningKeyForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_ssh_signing_key> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<201, t_ssh_signing_key> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -25542,11 +25277,11 @@ export type UsersGetSshSigningKeyForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_ssh_signing_key> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_ssh_signing_key> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25570,11 +25305,11 @@ export type UsersDeleteSshSigningKeyForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25597,10 +25332,10 @@ export type ActivityListReposStarredByAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_starred_repository[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_starred_repository[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -25624,11 +25359,11 @@ export type ActivityCheckRepoIsStarredByAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25652,11 +25387,11 @@ export type ActivityStarRepoForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25680,11 +25415,11 @@ export type ActivityUnstarRepoForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25707,10 +25442,10 @@ export type ActivityListWatchedReposForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_minimal_repository[]> - | Response<304, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_minimal_repository[]> + | Res<304, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -25728,10 +25463,10 @@ export type TeamsListForAuthenticatedUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_team_full[]> - | Response<304, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_team_full[]> + | Res<304, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25747,8 +25482,8 @@ export type UsersGetById = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_private_user | t_public_user> - | Response<404, t_basic_error> + | Res<200, t_private_user | t_public_user> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25764,8 +25499,8 @@ export type UsersList = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | Response<304, void> + | Res<200, t_simple_user[]> + | Res<304, void> | typeof SkipResponse > @@ -25781,8 +25516,8 @@ export type UsersGetByUsername = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_private_user | t_public_user> - | Response<404, t_basic_error> + | Res<200, t_private_user | t_public_user> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25829,7 +25564,7 @@ export type UsersListAttestationsBulk = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { attestations_subject_digests?: { @@ -25880,8 +25615,8 @@ export type UsersDeleteAttestationsBulk = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, void> - | Response<404, t_basic_error> + | Res<200, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25903,9 +25638,9 @@ export type UsersDeleteAttestationsBySubjectDigest = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, void> - | Response<204, void> - | Response<404, t_basic_error> + | Res<200, void> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25923,10 +25658,10 @@ export type UsersDeleteAttestationsById = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, void> - | Response<204, void> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, void> + | Res<204, void> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -25963,7 +25698,7 @@ export type UsersListAttestations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { attestations?: { @@ -25981,9 +25716,9 @@ export type UsersListAttestations = ( }[] } > - | Response<201, t_empty_object> - | Response<204, void> - | Response<404, t_basic_error> + | Res<201, t_empty_object> + | Res<204, void> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -26005,9 +25740,9 @@ export type PackagesListDockerMigrationConflictingPackagesForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_package[]> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_package[]> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -26026,7 +25761,7 @@ export type ActivityListEventsForAuthenticatedUser = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_event[]> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_event[]> | typeof SkipResponse > export type ActivityListOrgEventsForAuthenticatedUserResponder = { @@ -26044,7 +25779,7 @@ export type ActivityListOrgEventsForAuthenticatedUser = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_event[]> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_event[]> | typeof SkipResponse > export type ActivityListPublicEventsForUserResponder = { @@ -26062,7 +25797,7 @@ export type ActivityListPublicEventsForUser = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_event[]> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_event[]> | typeof SkipResponse > export type UsersListFollowersForUserResponder = { @@ -26080,9 +25815,7 @@ export type UsersListFollowersForUser = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_simple_user[]> | typeof SkipResponse > export type UsersListFollowingForUserResponder = { @@ -26100,9 +25833,7 @@ export type UsersListFollowingForUser = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_simple_user[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_simple_user[]> | typeof SkipResponse > export type UsersCheckFollowingForUserResponder = { @@ -26117,8 +25848,8 @@ export type UsersCheckFollowingForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, void> + | Res<204, void> + | Res<404, void> | typeof SkipResponse > @@ -26139,8 +25870,8 @@ export type GistsListForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_base_gist[]> - | Response<422, t_validation_error> + | Res<200, t_base_gist[]> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -26159,7 +25890,7 @@ export type UsersListGpgKeysForUser = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_gpg_key[]> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_gpg_key[]> | typeof SkipResponse > export type UsersGetContextForUserResponder = { @@ -26180,9 +25911,9 @@ export type UsersGetContextForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_hovercard> - | Response<404, t_basic_error> - | Response<422, t_validation_error> + | Res<200, t_hovercard> + | Res<404, t_basic_error> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -26196,9 +25927,7 @@ export type AppsGetUserInstallation = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_installation> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_installation> | typeof SkipResponse > export type UsersListPublicKeysForUserResponder = { @@ -26216,9 +25945,7 @@ export type UsersListPublicKeysForUser = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_key_simple[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_key_simple[]> | typeof SkipResponse > export type OrgsListForUserResponder = { @@ -26237,7 +25964,7 @@ export type OrgsListForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_organization_simple[]> + | Res<200, t_organization_simple[]> | typeof SkipResponse > @@ -26260,10 +25987,10 @@ export type PackagesListPackagesForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_package[]> - | Response<400, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> + | Res<200, t_package[]> + | Res<400, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> | typeof SkipResponse > @@ -26277,7 +26004,7 @@ export type PackagesGetPackageForUser = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_package> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_package> | typeof SkipResponse > export type PackagesDeletePackageForUserResponder = { @@ -26294,10 +26021,10 @@ export type PackagesDeletePackageForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -26320,10 +26047,10 @@ export type PackagesRestorePackageForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -26346,10 +26073,10 @@ export type PackagesGetAllPackageVersionsForPackageOwnedByUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_package_version[]> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<200, t_package_version[]> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -26369,7 +26096,7 @@ export type PackagesGetPackageVersionForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_package_version> + | Res<200, t_package_version> | typeof SkipResponse > @@ -26392,10 +26119,10 @@ export type PackagesDeletePackageVersionForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -26418,10 +26145,10 @@ export type PackagesRestorePackageVersionForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_basic_error> - | Response<403, t_basic_error> - | Response<404, t_basic_error> + | Res<204, void> + | Res<401, t_basic_error> + | Res<403, t_basic_error> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -26442,8 +26169,8 @@ export type ProjectsClassicListForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_project[]> - | Response<422, t_validation_error> + | Res<200, t_project[]> + | Res<422, t_validation_error> | typeof SkipResponse > @@ -26462,7 +26189,7 @@ export type ActivityListReceivedEventsForUser = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_event[]> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_event[]> | typeof SkipResponse > export type ActivityListReceivedPublicEventsForUserResponder = { @@ -26480,7 +26207,7 @@ export type ActivityListReceivedPublicEventsForUser = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, t_event[]> | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_event[]> | typeof SkipResponse > export type ReposListForUserResponder = { @@ -26499,7 +26226,7 @@ export type ReposListForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_minimal_repository[]> + | Res<200, t_minimal_repository[]> | typeof SkipResponse > @@ -26519,7 +26246,7 @@ export type BillingGetGithubActionsBillingUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_actions_billing_usage> + | Res<200, t_actions_billing_usage> | typeof SkipResponse > @@ -26539,7 +26266,7 @@ export type BillingGetGithubPackagesBillingUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_packages_billing_usage> + | Res<200, t_packages_billing_usage> | typeof SkipResponse > @@ -26559,7 +26286,7 @@ export type BillingGetSharedStorageBillingUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_combined_billing_usage> + | Res<200, t_combined_billing_usage> | typeof SkipResponse > @@ -26587,11 +26314,11 @@ export type BillingGetGithubBillingUsageReportUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_usage_report_user> - | Response<400, t_scim_error> - | Response<403, t_basic_error> - | Response<500, t_basic_error> - | Response< + | Res<200, t_billing_usage_report_user> + | Res<400, t_scim_error> + | Res<403, t_basic_error> + | Res<500, t_basic_error> + | Res< 503, { code?: string @@ -26618,7 +26345,7 @@ export type UsersListSocialAccountsForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_social_account[]> + | Res<200, t_social_account[]> | typeof SkipResponse > @@ -26638,7 +26365,7 @@ export type UsersListSshSigningKeysForUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_ssh_signing_key[]> + | Res<200, t_ssh_signing_key[]> | typeof SkipResponse > @@ -26658,7 +26385,7 @@ export type ActivityListReposStarredByUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_starred_repository[] | t_repository[]> + | Res<200, t_starred_repository[] | t_repository[]> | typeof SkipResponse > @@ -26678,7 +26405,7 @@ export type ActivityListReposWatchedByUser = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_minimal_repository[]> + | Res<200, t_minimal_repository[]> | typeof SkipResponse > @@ -26694,8 +26421,8 @@ export type MetaGetAllVersions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, string[]> - | Response<404, t_basic_error> + | Res<200, string[]> + | Res<404, t_basic_error> | typeof SkipResponse > @@ -26709,7 +26436,7 @@ export type MetaGetZen = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<200, string> | typeof SkipResponse + KoaRuntimeResponse | Res<200, string> | typeof SkipResponse > export type Implementation = { diff --git a/integration-tests/typescript-koa/src/generated/azure-core-data-plane-service.tsp/generated.ts b/integration-tests/typescript-koa/src/generated/azure-core-data-plane-service.tsp/generated.ts index 0a1da6bfd..523affb88 100644 --- a/integration-tests/typescript-koa/src/generated/azure-core-data-plane-service.tsp/generated.ts +++ b/integration-tests/typescript-koa/src/generated/azure-core-data-plane-service.tsp/generated.ts @@ -11,7 +11,7 @@ import { type KoaRuntimeResponder, KoaRuntimeResponse, type Params, - type Response, + type Res, type ServerConfig, SkipResponse, type StatusCode, @@ -136,13 +136,13 @@ export type GetServiceStatus = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { statusString: string } > - | Response + | Res | typeof SkipResponse > @@ -179,7 +179,7 @@ export type WidgetsGetWidgetOperationStatusWidgetsGetWidgetDeleteOperationStatus next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, | { error?: t_Azure_Core_Foundations_Error @@ -193,7 +193,7 @@ export type WidgetsGetWidgetOperationStatusWidgetsGetWidgetDeleteOperationStatus status: t_Azure_Core_Foundations_OperationState } > - | Response + | Res | typeof SkipResponse > @@ -217,9 +217,9 @@ export type WidgetsCreateOrUpdateWidget = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Widget> - | Response<201, t_Widget> - | Response + | Res<200, t_Widget> + | Res<201, t_Widget> + | Res | typeof SkipResponse > @@ -242,8 +242,8 @@ export type WidgetsGetWidget = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Widget> - | Response + | Res<200, t_Widget> + | Res | typeof SkipResponse > @@ -270,7 +270,7 @@ export type WidgetsDeleteWidget = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { error?: t_Azure_Core_Foundations_Error @@ -278,7 +278,7 @@ export type WidgetsDeleteWidget = ( status: t_Azure_Core_Foundations_OperationState } > - | Response + | Res | typeof SkipResponse > @@ -301,8 +301,8 @@ export type WidgetsListWidgets = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_PagedWidget> - | Response + | Res<200, t_PagedWidget> + | Res | typeof SkipResponse > @@ -325,8 +325,8 @@ export type WidgetsGetAnalytics = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_WidgetAnalytics> - | Response + | Res<200, t_WidgetAnalytics> + | Res | typeof SkipResponse > @@ -350,9 +350,9 @@ export type WidgetsUpdateAnalytics = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_WidgetAnalytics> - | Response<201, t_WidgetAnalytics> - | Response + | Res<200, t_WidgetAnalytics> + | Res<201, t_WidgetAnalytics> + | Res | typeof SkipResponse > @@ -380,7 +380,7 @@ export type WidgetsGetRepairStatus = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { error?: t_Azure_Core_Foundations_Error @@ -389,7 +389,7 @@ export type WidgetsGetRepairStatus = ( status: t_Azure_Core_Foundations_OperationState } > - | Response + | Res | typeof SkipResponse > @@ -423,7 +423,7 @@ export type WidgetsScheduleRepairs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { error?: t_Azure_Core_Foundations_Error @@ -438,7 +438,7 @@ export type WidgetsScheduleRepairs = ( status: t_Azure_Core_Foundations_OperationState } > - | Response + | Res | typeof SkipResponse > @@ -466,7 +466,7 @@ export type WidgetPartsGetWidgetPartOperationStatus = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { error?: t_Azure_Core_Foundations_Error @@ -475,7 +475,7 @@ export type WidgetPartsGetWidgetPartOperationStatus = ( status: t_Azure_Core_Foundations_OperationState } > - | Response + | Res | typeof SkipResponse > @@ -498,8 +498,8 @@ export type WidgetPartsCreateWidgetPart = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, void> - | Response + | Res<201, void> + | Res | typeof SkipResponse > @@ -522,8 +522,8 @@ export type WidgetPartsListWidgetParts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_PagedWidgetPart> - | Response + | Res<200, t_PagedWidgetPart> + | Res | typeof SkipResponse > @@ -546,8 +546,8 @@ export type WidgetPartsGetWidgetPart = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_WidgetPart> - | Response + | Res<200, t_WidgetPart> + | Res | typeof SkipResponse > @@ -570,8 +570,8 @@ export type WidgetPartsDeleteWidgetPart = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response + | Res<204, void> + | Res | typeof SkipResponse > @@ -598,7 +598,7 @@ export type WidgetPartsReorderParts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { error?: t_Azure_Core_Foundations_Error @@ -606,7 +606,7 @@ export type WidgetPartsReorderParts = ( status: t_Azure_Core_Foundations_OperationState } > - | Response + | Res | typeof SkipResponse > @@ -634,7 +634,7 @@ export type ManufacturersGetManufacturerOperationStatus = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { error?: t_Azure_Core_Foundations_Error @@ -643,7 +643,7 @@ export type ManufacturersGetManufacturerOperationStatus = ( status: t_Azure_Core_Foundations_OperationState } > - | Response + | Res | typeof SkipResponse > @@ -667,9 +667,9 @@ export type ManufacturersCreateOrReplaceManufacturer = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Manufacturer> - | Response<201, t_Manufacturer> - | Response + | Res<200, t_Manufacturer> + | Res<201, t_Manufacturer> + | Res | typeof SkipResponse > @@ -692,8 +692,8 @@ export type ManufacturersGetManufacturer = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Manufacturer> - | Response + | Res<200, t_Manufacturer> + | Res | typeof SkipResponse > @@ -720,7 +720,7 @@ export type ManufacturersDeleteManufacturer = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 202, { error?: t_Azure_Core_Foundations_Error @@ -728,7 +728,7 @@ export type ManufacturersDeleteManufacturer = ( status: t_Azure_Core_Foundations_OperationState } > - | Response + | Res | typeof SkipResponse > @@ -751,8 +751,8 @@ export type ManufacturersListManufacturers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_PagedManufacturer> - | Response + | Res<200, t_PagedManufacturer> + | Res | typeof SkipResponse > diff --git a/integration-tests/typescript-koa/src/generated/azure-resource-manager.tsp/generated.ts b/integration-tests/typescript-koa/src/generated/azure-resource-manager.tsp/generated.ts index cfb0c3432..e308f4f9b 100644 --- a/integration-tests/typescript-koa/src/generated/azure-resource-manager.tsp/generated.ts +++ b/integration-tests/typescript-koa/src/generated/azure-resource-manager.tsp/generated.ts @@ -11,7 +11,7 @@ import { type KoaRuntimeResponder, KoaRuntimeResponse, type Params, - type Response, + type Res, type ServerConfig, SkipResponse, type StatusCode, @@ -74,8 +74,8 @@ export type OperationsList = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_OperationListResult> - | Response + | Res<200, t_OperationListResult> + | Res | typeof SkipResponse > @@ -98,8 +98,8 @@ export type EmployeesGet = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Employee> - | Response + | Res<200, t_Employee> + | Res | typeof SkipResponse > @@ -123,9 +123,9 @@ export type EmployeesCreateOrUpdate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Employee> - | Response<201, t_Employee> - | Response + | Res<200, t_Employee> + | Res<201, t_Employee> + | Res | typeof SkipResponse > @@ -148,8 +148,8 @@ export type EmployeesUpdate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Employee> - | Response + | Res<200, t_Employee> + | Res | typeof SkipResponse > @@ -173,9 +173,9 @@ export type EmployeesDelete = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<202, void> - | Response<204, void> - | Response + | Res<202, void> + | Res<204, void> + | Res | typeof SkipResponse > @@ -199,9 +199,9 @@ export type EmployeesCheckExistence = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<404, void> - | Response + | Res<204, void> + | Res<404, void> + | Res | typeof SkipResponse > @@ -224,8 +224,8 @@ export type EmployeesListByResourceGroup = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_EmployeeListResult> - | Response + | Res<200, t_EmployeeListResult> + | Res | typeof SkipResponse > @@ -248,8 +248,8 @@ export type EmployeesListBySubscription = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_EmployeeListResult> - | Response + | Res<200, t_EmployeeListResult> + | Res | typeof SkipResponse > @@ -272,8 +272,8 @@ export type EmployeesMove = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_MoveResponse> - | Response + | Res<200, t_MoveResponse> + | Res | typeof SkipResponse > diff --git a/integration-tests/typescript-koa/src/generated/okta.idp.yaml/generated.ts b/integration-tests/typescript-koa/src/generated/okta.idp.yaml/generated.ts index 94a8bbbba..2e34571f2 100644 --- a/integration-tests/typescript-koa/src/generated/okta.idp.yaml/generated.ts +++ b/integration-tests/typescript-koa/src/generated/okta.idp.yaml/generated.ts @@ -11,7 +11,7 @@ import { type KoaRuntimeResponder, KoaRuntimeResponse, type Params, - type Response, + type Res, type ServerConfig, SkipResponse, type StatusCode, @@ -112,11 +112,11 @@ export type CreateAppAuthenticatorEnrollment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_AppAuthenticatorEnrollment> - | Response<400, t_Error> - | Response<401, t_Error> - | Response<403, t_Error> - | Response<404, t_Error> + | Res<200, t_AppAuthenticatorEnrollment> + | Res<400, t_Error> + | Res<401, t_Error> + | Res<403, t_Error> + | Res<404, t_Error> | typeof SkipResponse > @@ -138,9 +138,9 @@ export type VerifyAppAuthenticatorPushNotificationChallenge = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, void> - | Response<204, void> - | Response<400, void> + | Res<200, void> + | Res<204, void> + | Res<400, void> | typeof SkipResponse > @@ -163,10 +163,10 @@ export type UpdateAppAuthenticatorEnrollment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_AppAuthenticatorEnrollment> - | Response<401, t_Error> - | Response<403, t_Error> - | Response<404, t_Error> + | Res<200, t_AppAuthenticatorEnrollment> + | Res<401, t_Error> + | Res<403, t_Error> + | Res<404, t_Error> | typeof SkipResponse > @@ -189,10 +189,10 @@ export type DeleteAppAuthenticatorEnrollment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_Error> - | Response<403, t_Error> - | Response<404, t_Error> + | Res<204, void> + | Res<401, t_Error> + | Res<403, t_Error> + | Res<404, t_Error> | typeof SkipResponse > @@ -213,8 +213,8 @@ export type ListAppAuthenticatorPendingPushNotificationChallenges = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_PushNotificationChallenge[]> - | Response<401, t_Error> + | Res<200, t_PushNotificationChallenge[]> + | Res<401, t_Error> | typeof SkipResponse > @@ -231,9 +231,9 @@ export type ListAuthenticators = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Authenticator[]> - | Response<403, t_Error> - | Response<429, t_Error> + | Res<200, t_Authenticator[]> + | Res<403, t_Error> + | Res<429, t_Error> | typeof SkipResponse > @@ -256,10 +256,10 @@ export type GetAuthenticator = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Authenticator> - | Response<403, t_Error> - | Response<404, t_Error> - | Response<429, t_Error> + | Res<200, t_Authenticator> + | Res<403, t_Error> + | Res<404, t_Error> + | Res<429, t_Error> | typeof SkipResponse > @@ -277,10 +277,10 @@ export type ListEnrollments = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_AuthenticatorEnrollment[]> - | Response<403, t_Error> - | Response<404, t_Error> - | Response<429, t_Error> + | Res<200, t_AuthenticatorEnrollment[]> + | Res<403, t_Error> + | Res<404, t_Error> + | Res<429, t_Error> | typeof SkipResponse > @@ -298,10 +298,10 @@ export type GetEnrollment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_AuthenticatorEnrollment> - | Response<403, t_Error> - | Response<404, t_Error> - | Response<429, t_Error> + | Res<200, t_AuthenticatorEnrollment> + | Res<403, t_Error> + | Res<404, t_Error> + | Res<429, t_Error> | typeof SkipResponse > @@ -324,10 +324,10 @@ export type UpdateEnrollment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_AuthenticatorEnrollment> - | Response<401, t_Error> - | Response<403, t_Error> - | Response<404, t_Error> + | Res<200, t_AuthenticatorEnrollment> + | Res<401, t_Error> + | Res<403, t_Error> + | Res<404, t_Error> | typeof SkipResponse > @@ -343,8 +343,8 @@ export type ListEmails = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Email[]> - | Response<401, t_Error> + | Res<200, t_Email[]> + | Res<401, t_Error> | typeof SkipResponse > @@ -363,11 +363,11 @@ export type CreateEmail = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_Email> - | Response<400, t_Error> - | Response<401, t_Error> - | Response<403, t_Error> - | Response<409, t_Error> + | Res<201, t_Email> + | Res<400, t_Error> + | Res<401, t_Error> + | Res<403, t_Error> + | Res<409, t_Error> | typeof SkipResponse > @@ -383,8 +383,8 @@ export type GetEmail = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Email> - | Response<401, t_Error> + | Res<200, t_Email> + | Res<401, t_Error> | typeof SkipResponse > @@ -402,10 +402,10 @@ export type DeleteEmail = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<400, t_Error> - | Response<401, t_Error> - | Response<404, t_Error> + | Res<204, void> + | Res<400, t_Error> + | Res<401, t_Error> + | Res<404, t_Error> | typeof SkipResponse > @@ -449,7 +449,7 @@ export type SendEmailChallenge = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 201, { _links: { @@ -474,9 +474,9 @@ export type SendEmailChallenge = ( status: "VERIFIED" | "UNVERIFIED" } > - | Response<401, t_Error> - | Response<403, t_Error> - | Response<404, t_Error> + | Res<401, t_Error> + | Res<403, t_Error> + | Res<404, t_Error> | typeof SkipResponse > @@ -514,7 +514,7 @@ export type PollChallengeForEmailMagicLink = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { _links: { @@ -539,8 +539,8 @@ export type PollChallengeForEmailMagicLink = ( status: "VERIFIED" | "UNVERIFIED" } > - | Response<401, t_Error> - | Response<404, t_Error> + | Res<401, t_Error> + | Res<404, t_Error> | typeof SkipResponse > @@ -563,10 +563,10 @@ export type VerifyEmailOtp = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, void> - | Response<401, t_Error> - | Response<403, t_Error> - | Response<404, t_Error> + | Res<200, void> + | Res<401, t_Error> + | Res<403, t_Error> + | Res<404, t_Error> | typeof SkipResponse > @@ -582,8 +582,8 @@ export type ListOktaApplications = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_OktaApplication[]> - | Response<400, t_Error> + | Res<200, t_OktaApplication[]> + | Res<400, t_Error> | typeof SkipResponse > @@ -599,8 +599,8 @@ export type GetOrganization = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Organization> - | Response<401, t_Error> + | Res<200, t_Organization> + | Res<401, t_Error> | typeof SkipResponse > @@ -616,8 +616,8 @@ export type GetPassword = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_PasswordResponse> - | Response<401, t_Error> + | Res<200, t_PasswordResponse> + | Res<401, t_Error> | typeof SkipResponse > @@ -635,10 +635,10 @@ export type CreatePassword = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_PasswordResponse> - | Response<400, t_Error> - | Response<401, t_Error> - | Response<403, t_Error> + | Res<201, t_PasswordResponse> + | Res<400, t_Error> + | Res<401, t_Error> + | Res<403, t_Error> | typeof SkipResponse > @@ -656,10 +656,10 @@ export type ReplacePassword = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_PasswordResponse> - | Response<400, t_Error> - | Response<401, t_Error> - | Response<403, t_Error> + | Res<201, t_PasswordResponse> + | Res<400, t_Error> + | Res<401, t_Error> + | Res<403, t_Error> | typeof SkipResponse > @@ -676,9 +676,9 @@ export type DeletePassword = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_Error> - | Response<404, t_Error> + | Res<204, void> + | Res<401, t_Error> + | Res<404, t_Error> | typeof SkipResponse > @@ -694,8 +694,8 @@ export type ListPhones = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Phone[]> - | Response<401, t_Error> + | Res<200, t_Phone[]> + | Res<401, t_Error> | typeof SkipResponse > @@ -715,12 +715,12 @@ export type CreatePhone = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_Phone> - | Response<400, t_Error> - | Response<401, t_Error> - | Response<403, t_Error> - | Response<409, t_Error> - | Response<500, t_Error> + | Res<201, t_Phone> + | Res<400, t_Error> + | Res<401, t_Error> + | Res<403, t_Error> + | Res<409, t_Error> + | Res<500, t_Error> | typeof SkipResponse > @@ -737,9 +737,9 @@ export type GetPhone = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Phone> - | Response<401, t_Error> - | Response<404, t_Error> + | Res<200, t_Phone> + | Res<401, t_Error> + | Res<404, t_Error> | typeof SkipResponse > @@ -757,10 +757,10 @@ export type DeletePhone = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_Error> - | Response<403, t_Error> - | Response<404, t_Error> + | Res<204, void> + | Res<401, t_Error> + | Res<403, t_Error> + | Res<404, t_Error> | typeof SkipResponse > @@ -794,7 +794,7 @@ export type SendPhoneChallenge = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { _links?: { @@ -807,11 +807,11 @@ export type SendPhoneChallenge = ( } } > - | Response<400, t_Error> - | Response<401, t_Error> - | Response<403, t_Error> - | Response<404, t_Error> - | Response<500, t_Error> + | Res<400, t_Error> + | Res<401, t_Error> + | Res<403, t_Error> + | Res<404, t_Error> + | Res<500, t_Error> | typeof SkipResponse > @@ -836,12 +836,12 @@ export type VerifyPhoneChallenge = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<400, t_Error> - | Response<401, t_Error> - | Response<403, t_Error> - | Response<404, t_Error> - | Response<409, t_Error> + | Res<204, void> + | Res<400, t_Error> + | Res<401, t_Error> + | Res<403, t_Error> + | Res<404, t_Error> + | Res<409, t_Error> | typeof SkipResponse > @@ -857,8 +857,8 @@ export type GetProfile = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Profile> - | Response<401, t_Error> + | Res<200, t_Profile> + | Res<401, t_Error> | typeof SkipResponse > @@ -875,9 +875,9 @@ export type ReplaceProfile = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Profile> - | Response<400, t_Error> - | Response<401, t_Error> + | Res<200, t_Profile> + | Res<400, t_Error> + | Res<401, t_Error> | typeof SkipResponse > @@ -893,8 +893,8 @@ export type GetProfileSchema = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Schema> - | Response<401, t_Error> + | Res<200, t_Schema> + | Res<401, t_Error> | typeof SkipResponse > @@ -911,9 +911,9 @@ export type DeleteSessions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<401, t_Error> - | Response<404, t_Error> + | Res<204, void> + | Res<401, t_Error> + | Res<404, t_Error> | typeof SkipResponse > diff --git a/integration-tests/typescript-koa/src/generated/okta.oauth.yaml/generated.ts b/integration-tests/typescript-koa/src/generated/okta.oauth.yaml/generated.ts index 79169bb33..4aaa112af 100644 --- a/integration-tests/typescript-koa/src/generated/okta.oauth.yaml/generated.ts +++ b/integration-tests/typescript-koa/src/generated/okta.oauth.yaml/generated.ts @@ -11,7 +11,7 @@ import { type KoaRuntimeResponder, KoaRuntimeResponse, type Params, - type Response, + type Res, type ServerConfig, SkipResponse, type StatusCode, @@ -136,8 +136,8 @@ export type GetWellKnownOpenIdConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_OidcMetadata> - | Response<400, t_Error> + | Res<200, t_OidcMetadata> + | Res<400, t_Error> | typeof SkipResponse > @@ -151,7 +151,7 @@ export type Authorize = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<429, t_Error> | typeof SkipResponse + KoaRuntimeResponse | Res<429, t_Error> | typeof SkipResponse > export type AuthorizeWithPostResponder = { @@ -164,7 +164,7 @@ export type AuthorizeWithPost = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<429, t_Error> | typeof SkipResponse + KoaRuntimeResponse | Res<429, t_Error> | typeof SkipResponse > export type BcAuthorizeResponder = { @@ -181,10 +181,10 @@ export type BcAuthorize = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_BackchannelAuthorizeResponse> - | Response<400, t_OAuthError> - | Response<401, t_OAuthError> - | Response<429, t_Error> + | Res<200, t_BackchannelAuthorizeResponse> + | Res<400, t_OAuthError> + | Res<401, t_OAuthError> + | Res<429, t_Error> | typeof SkipResponse > @@ -203,11 +203,11 @@ export type Challenge = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_ChallengeResponse> - | Response<400, t_OAuthError> - | Response<401, t_OAuthError> - | Response<403, t_OAuthError> - | Response<429, t_OAuthError> + | Res<200, t_ChallengeResponse> + | Res<400, t_OAuthError> + | Res<401, t_OAuthError> + | Res<403, t_OAuthError> + | Res<429, t_OAuthError> | typeof SkipResponse > @@ -224,9 +224,9 @@ export type ListClients = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Client[]> - | Response<403, t_Error> - | Response<429, t_Error> + | Res<200, t_Client[]> + | Res<403, t_Error> + | Res<429, t_Error> | typeof SkipResponse > @@ -244,10 +244,10 @@ export type CreateClient = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<201, t_Client> - | Response<400, t_Error> - | Response<403, t_Error> - | Response<429, t_Error> + | Res<201, t_Client> + | Res<400, t_Error> + | Res<403, t_Error> + | Res<429, t_Error> | typeof SkipResponse > @@ -265,10 +265,10 @@ export type GetClient = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Client> - | Response<403, t_Error> - | Response<404, t_Error> - | Response<429, t_Error> + | Res<200, t_Client> + | Res<403, t_Error> + | Res<404, t_Error> + | Res<429, t_Error> | typeof SkipResponse > @@ -287,11 +287,11 @@ export type ReplaceClient = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Client> - | Response<400, t_Error> - | Response<403, t_Error> - | Response<404, t_Error> - | Response<429, t_Error> + | Res<200, t_Client> + | Res<400, t_Error> + | Res<403, t_Error> + | Res<404, t_Error> + | Res<429, t_Error> | typeof SkipResponse > @@ -309,10 +309,10 @@ export type DeleteClient = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<403, t_Error> - | Response<404, t_Error> - | Response<429, t_Error> + | Res<204, void> + | Res<403, t_Error> + | Res<404, t_Error> + | Res<429, t_Error> | typeof SkipResponse > @@ -330,10 +330,10 @@ export type GenerateNewClientSecret = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Client> - | Response<403, t_Error> - | Response<404, t_Error> - | Response<429, t_Error> + | Res<200, t_Client> + | Res<403, t_Error> + | Res<404, t_Error> + | Res<429, t_Error> | typeof SkipResponse > @@ -351,10 +351,10 @@ export type DeviceAuthorize = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_DeviceAuthorizeResponse> - | Response<400, t_OAuthError> - | Response<401, t_OAuthError> - | Response<429, t_Error> + | Res<200, t_DeviceAuthorizeResponse> + | Res<400, t_OAuthError> + | Res<401, t_OAuthError> + | Res<429, t_Error> | typeof SkipResponse > @@ -372,10 +372,10 @@ export type GlobalTokenRevocation = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<400, void> - | Response<403, t_Error> - | Response<429, t_Error> + | Res<204, void> + | Res<400, void> + | Res<403, t_Error> + | Res<429, t_Error> | typeof SkipResponse > @@ -393,10 +393,10 @@ export type Introspect = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_IntrospectionResponse> - | Response<400, t_OAuthError> - | Response<401, t_OAuthError> - | Response<429, t_Error> + | Res<200, t_IntrospectionResponse> + | Res<400, t_OAuthError> + | Res<401, t_OAuthError> + | Res<429, t_Error> | typeof SkipResponse > @@ -412,8 +412,8 @@ export type OauthKeys = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_OAuthKeys> - | Response<429, t_Error> + | Res<200, t_OAuthKeys> + | Res<429, t_Error> | typeof SkipResponse > @@ -429,8 +429,8 @@ export type Logout = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, void> - | Response<429, t_Error> + | Res<200, void> + | Res<429, t_Error> | typeof SkipResponse > @@ -446,8 +446,8 @@ export type LogoutWithPost = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, void> - | Response<429, t_Error> + | Res<200, void> + | Res<429, t_Error> | typeof SkipResponse > @@ -466,11 +466,11 @@ export type OobAuthenticate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_OobAuthenticateResponse> - | Response<400, t_OAuthError> - | Response<401, t_OAuthError> - | Response<403, t_OAuthError> - | Response<429, t_OAuthError> + | Res<200, t_OobAuthenticateResponse> + | Res<400, t_OAuthError> + | Res<401, t_OAuthError> + | Res<403, t_OAuthError> + | Res<429, t_OAuthError> | typeof SkipResponse > @@ -486,8 +486,8 @@ export type ParOptions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<429, t_Error> + | Res<204, void> + | Res<429, t_Error> | typeof SkipResponse > @@ -506,11 +506,11 @@ export type Par = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_ParResponse> - | Response<400, t_OAuthError> - | Response<401, t_OAuthError> - | Response<403, t_OAuthError> - | Response<429, t_Error> + | Res<200, t_ParResponse> + | Res<400, t_OAuthError> + | Res<401, t_OAuthError> + | Res<403, t_OAuthError> + | Res<429, t_Error> | typeof SkipResponse > @@ -528,10 +528,10 @@ export type Revoke = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, void> - | Response<400, t_OAuthError> - | Response<401, t_OAuthError> - | Response<429, t_Error> + | Res<200, void> + | Res<400, t_OAuthError> + | Res<401, t_OAuthError> + | Res<429, t_Error> | typeof SkipResponse > @@ -547,8 +547,8 @@ export type TokenOptions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<429, t_Error> + | Res<204, void> + | Res<429, t_Error> | typeof SkipResponse > @@ -566,10 +566,10 @@ export type Token = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_TokenResponse> - | Response<400, t_OAuthError> - | Response<401, t_OAuthError> - | Response<429, t_Error> + | Res<200, t_TokenResponse> + | Res<400, t_OAuthError> + | Res<401, t_OAuthError> + | Res<429, t_Error> | typeof SkipResponse > @@ -587,10 +587,10 @@ export type Userinfo = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_UserInfo> - | Response<401, void> - | Response<403, void> - | Response<429, t_Error> + | Res<200, t_UserInfo> + | Res<401, void> + | Res<403, void> + | Res<429, t_Error> | typeof SkipResponse > @@ -612,9 +612,9 @@ export type GetWellKnownOAuthConfigurationCustomAs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_OAuthMetadata> - | Response<400, t_Error> - | Response<404, t_Error> + | Res<200, t_OAuthMetadata> + | Res<400, t_Error> + | Res<404, t_Error> | typeof SkipResponse > @@ -636,9 +636,9 @@ export type GetWellKnownOpenIdConfigurationCustomAs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_OidcMetadata> - | Response<400, t_Error> - | Response<404, t_Error> + | Res<200, t_OidcMetadata> + | Res<400, t_Error> + | Res<404, t_Error> | typeof SkipResponse > @@ -657,7 +657,7 @@ export type AuthorizeCustomAs = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<429, t_Error> | typeof SkipResponse + KoaRuntimeResponse | Res<429, t_Error> | typeof SkipResponse > export type AuthorizeCustomAsWithPostResponder = { @@ -675,7 +675,7 @@ export type AuthorizeCustomAsWithPost = ( ctx: RouterContext, next: Next, ) => Promise< - KoaRuntimeResponse | Response<429, t_Error> | typeof SkipResponse + KoaRuntimeResponse | Res<429, t_Error> | typeof SkipResponse > export type BcAuthorizeCustomAsResponder = { @@ -697,10 +697,10 @@ export type BcAuthorizeCustomAs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_BackchannelAuthorizeResponse> - | Response<400, t_OAuthError> - | Response<401, t_OAuthError> - | Response<429, t_Error> + | Res<200, t_BackchannelAuthorizeResponse> + | Res<400, t_OAuthError> + | Res<401, t_OAuthError> + | Res<429, t_Error> | typeof SkipResponse > @@ -724,11 +724,11 @@ export type ChallengeCustomAs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_ChallengeResponse> - | Response<400, t_OAuthError> - | Response<401, t_OAuthError> - | Response<403, t_OAuthError> - | Response<429, t_OAuthError> + | Res<200, t_ChallengeResponse> + | Res<400, t_OAuthError> + | Res<401, t_OAuthError> + | Res<403, t_OAuthError> + | Res<429, t_OAuthError> | typeof SkipResponse > @@ -751,10 +751,10 @@ export type DeviceAuthorizeCustomAs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_DeviceAuthorizeResponse> - | Response<400, t_OAuthError> - | Response<401, t_OAuthError> - | Response<429, t_Error> + | Res<200, t_DeviceAuthorizeResponse> + | Res<400, t_OAuthError> + | Res<401, t_OAuthError> + | Res<429, t_Error> | typeof SkipResponse > @@ -777,10 +777,10 @@ export type IntrospectCustomAs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_IntrospectionResponse> - | Response<400, t_OAuthError> - | Response<401, t_OAuthError> - | Response<429, t_Error> + | Res<200, t_IntrospectionResponse> + | Res<400, t_OAuthError> + | Res<401, t_OAuthError> + | Res<429, t_Error> | typeof SkipResponse > @@ -796,8 +796,8 @@ export type OauthKeysCustomAs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_OAuthKeys> - | Response<429, t_Error> + | Res<200, t_OAuthKeys> + | Res<429, t_Error> | typeof SkipResponse > @@ -818,8 +818,8 @@ export type LogoutCustomAs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, void> - | Response<429, t_Error> + | Res<200, void> + | Res<429, t_Error> | typeof SkipResponse > @@ -840,8 +840,8 @@ export type LogoutCustomAsWithPost = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, void> - | Response<429, t_Error> + | Res<200, void> + | Res<429, t_Error> | typeof SkipResponse > @@ -865,11 +865,11 @@ export type OobAuthenticateCustomAs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_OobAuthenticateResponse> - | Response<400, t_OAuthError> - | Response<401, t_OAuthError> - | Response<403, t_OAuthError> - | Response<429, t_OAuthError> + | Res<200, t_OobAuthenticateResponse> + | Res<400, t_OAuthError> + | Res<401, t_OAuthError> + | Res<403, t_OAuthError> + | Res<429, t_OAuthError> | typeof SkipResponse > @@ -890,8 +890,8 @@ export type ParOptionsCustomAs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<429, t_Error> + | Res<204, void> + | Res<429, t_Error> | typeof SkipResponse > @@ -910,11 +910,11 @@ export type ParCustomAs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_ParResponse> - | Response<400, t_OAuthError> - | Response<401, t_OAuthError> - | Response<403, t_OAuthError> - | Response<429, t_Error> + | Res<200, t_ParResponse> + | Res<400, t_OAuthError> + | Res<401, t_OAuthError> + | Res<403, t_OAuthError> + | Res<429, t_Error> | typeof SkipResponse > @@ -932,10 +932,10 @@ export type RevokeCustomAs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, void> - | Response<400, t_OAuthError> - | Response<401, t_OAuthError> - | Response<429, t_Error> + | Res<200, void> + | Res<400, t_OAuthError> + | Res<401, t_OAuthError> + | Res<429, t_Error> | typeof SkipResponse > @@ -956,8 +956,8 @@ export type TokenOptionsCustomAs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response<429, t_Error> + | Res<204, void> + | Res<429, t_Error> | typeof SkipResponse > @@ -975,10 +975,10 @@ export type TokenCustomAs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_TokenResponse> - | Response<400, t_OAuthError> - | Response<401, t_OAuthError> - | Response<429, t_Error> + | Res<200, t_TokenResponse> + | Res<400, t_OAuthError> + | Res<401, t_OAuthError> + | Res<429, t_Error> | typeof SkipResponse > @@ -996,10 +996,10 @@ export type UserinfoCustomAs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_UserInfo> - | Response<401, void> - | Response<403, void> - | Response<429, t_Error> + | Res<200, t_UserInfo> + | Res<401, void> + | Res<403, void> + | Res<429, t_Error> | typeof SkipResponse > diff --git a/integration-tests/typescript-koa/src/generated/petstore-expanded.yaml/generated.ts b/integration-tests/typescript-koa/src/generated/petstore-expanded.yaml/generated.ts index 6a6542082..6a8989137 100644 --- a/integration-tests/typescript-koa/src/generated/petstore-expanded.yaml/generated.ts +++ b/integration-tests/typescript-koa/src/generated/petstore-expanded.yaml/generated.ts @@ -11,7 +11,7 @@ import { type KoaRuntimeResponder, KoaRuntimeResponse, type Params, - type Response, + type Res, type ServerConfig, SkipResponse, type StatusCode, @@ -45,8 +45,8 @@ export type FindPets = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Pet[]> - | Response + | Res<200, t_Pet[]> + | Res | typeof SkipResponse > @@ -62,8 +62,8 @@ export type AddPet = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Pet> - | Response + | Res<200, t_Pet> + | Res | typeof SkipResponse > @@ -79,8 +79,8 @@ export type FindPetById = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_Pet> - | Response + | Res<200, t_Pet> + | Res | typeof SkipResponse > @@ -96,8 +96,8 @@ export type DeletePet = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response + | Res<204, void> + | Res | typeof SkipResponse > diff --git a/integration-tests/typescript-koa/src/generated/stripe.yaml/generated.ts b/integration-tests/typescript-koa/src/generated/stripe.yaml/generated.ts index c3ed1418d..a64159036 100644 --- a/integration-tests/typescript-koa/src/generated/stripe.yaml/generated.ts +++ b/integration-tests/typescript-koa/src/generated/stripe.yaml/generated.ts @@ -12,7 +12,7 @@ import { KoaRuntimeResponse, type Params, parseQueryParameters, - type Response, + type Res, type ServerConfig, SkipResponse, type StatusCode, @@ -1568,8 +1568,8 @@ export type GetAccount = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_account> - | Response + | Res<200, t_account> + | Res | typeof SkipResponse > @@ -1585,8 +1585,8 @@ export type PostAccountLinks = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_account_link> - | Response + | Res<200, t_account_link> + | Res | typeof SkipResponse > @@ -1602,8 +1602,8 @@ export type PostAccountSessions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_account_session> - | Response + | Res<200, t_account_session> + | Res | typeof SkipResponse > @@ -1624,7 +1624,7 @@ export type GetAccounts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_account[] @@ -1633,7 +1633,7 @@ export type GetAccounts = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -1649,8 +1649,8 @@ export type PostAccounts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_account> - | Response + | Res<200, t_account> + | Res | typeof SkipResponse > @@ -1666,8 +1666,8 @@ export type DeleteAccountsAccount = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_account> - | Response + | Res<200, t_deleted_account> + | Res | typeof SkipResponse > @@ -1688,8 +1688,8 @@ export type GetAccountsAccount = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_account> - | Response + | Res<200, t_account> + | Res | typeof SkipResponse > @@ -1710,8 +1710,8 @@ export type PostAccountsAccount = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_account> - | Response + | Res<200, t_account> + | Res | typeof SkipResponse > @@ -1732,8 +1732,8 @@ export type PostAccountsAccountBankAccounts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_external_account> - | Response + | Res<200, t_external_account> + | Res | typeof SkipResponse > @@ -1754,8 +1754,8 @@ export type DeleteAccountsAccountBankAccountsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_external_account> - | Response + | Res<200, t_deleted_external_account> + | Res | typeof SkipResponse > @@ -1776,8 +1776,8 @@ export type GetAccountsAccountBankAccountsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_external_account> - | Response + | Res<200, t_external_account> + | Res | typeof SkipResponse > @@ -1798,8 +1798,8 @@ export type PostAccountsAccountBankAccountsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_external_account> - | Response + | Res<200, t_external_account> + | Res | typeof SkipResponse > @@ -1825,7 +1825,7 @@ export type GetAccountsAccountCapabilities = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_capability[] @@ -1834,7 +1834,7 @@ export type GetAccountsAccountCapabilities = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -1855,8 +1855,8 @@ export type GetAccountsAccountCapabilitiesCapability = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_capability> - | Response + | Res<200, t_capability> + | Res | typeof SkipResponse > @@ -1877,8 +1877,8 @@ export type PostAccountsAccountCapabilitiesCapability = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_capability> - | Response + | Res<200, t_capability> + | Res | typeof SkipResponse > @@ -1904,7 +1904,7 @@ export type GetAccountsAccountExternalAccounts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: (t_bank_account | t_card)[] @@ -1913,7 +1913,7 @@ export type GetAccountsAccountExternalAccounts = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -1934,8 +1934,8 @@ export type PostAccountsAccountExternalAccounts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_external_account> - | Response + | Res<200, t_external_account> + | Res | typeof SkipResponse > @@ -1956,8 +1956,8 @@ export type DeleteAccountsAccountExternalAccountsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_external_account> - | Response + | Res<200, t_deleted_external_account> + | Res | typeof SkipResponse > @@ -1978,8 +1978,8 @@ export type GetAccountsAccountExternalAccountsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_external_account> - | Response + | Res<200, t_external_account> + | Res | typeof SkipResponse > @@ -2000,8 +2000,8 @@ export type PostAccountsAccountExternalAccountsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_external_account> - | Response + | Res<200, t_external_account> + | Res | typeof SkipResponse > @@ -2022,8 +2022,8 @@ export type PostAccountsAccountLoginLinks = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_login_link> - | Response + | Res<200, t_login_link> + | Res | typeof SkipResponse > @@ -2049,7 +2049,7 @@ export type GetAccountsAccountPeople = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_person[] @@ -2058,7 +2058,7 @@ export type GetAccountsAccountPeople = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -2079,8 +2079,8 @@ export type PostAccountsAccountPeople = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_person> - | Response + | Res<200, t_person> + | Res | typeof SkipResponse > @@ -2101,8 +2101,8 @@ export type DeleteAccountsAccountPeoplePerson = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_person> - | Response + | Res<200, t_deleted_person> + | Res | typeof SkipResponse > @@ -2123,8 +2123,8 @@ export type GetAccountsAccountPeoplePerson = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_person> - | Response + | Res<200, t_person> + | Res | typeof SkipResponse > @@ -2145,8 +2145,8 @@ export type PostAccountsAccountPeoplePerson = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_person> - | Response + | Res<200, t_person> + | Res | typeof SkipResponse > @@ -2172,7 +2172,7 @@ export type GetAccountsAccountPersons = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_person[] @@ -2181,7 +2181,7 @@ export type GetAccountsAccountPersons = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -2202,8 +2202,8 @@ export type PostAccountsAccountPersons = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_person> - | Response + | Res<200, t_person> + | Res | typeof SkipResponse > @@ -2224,8 +2224,8 @@ export type DeleteAccountsAccountPersonsPerson = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_person> - | Response + | Res<200, t_deleted_person> + | Res | typeof SkipResponse > @@ -2246,8 +2246,8 @@ export type GetAccountsAccountPersonsPerson = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_person> - | Response + | Res<200, t_person> + | Res | typeof SkipResponse > @@ -2268,8 +2268,8 @@ export type PostAccountsAccountPersonsPerson = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_person> - | Response + | Res<200, t_person> + | Res | typeof SkipResponse > @@ -2290,8 +2290,8 @@ export type PostAccountsAccountReject = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_account> - | Response + | Res<200, t_account> + | Res | typeof SkipResponse > @@ -2312,7 +2312,7 @@ export type GetApplePayDomains = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_apple_pay_domain[] @@ -2321,7 +2321,7 @@ export type GetApplePayDomains = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -2337,8 +2337,8 @@ export type PostApplePayDomains = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_apple_pay_domain> - | Response + | Res<200, t_apple_pay_domain> + | Res | typeof SkipResponse > @@ -2354,8 +2354,8 @@ export type DeleteApplePayDomainsDomain = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_apple_pay_domain> - | Response + | Res<200, t_deleted_apple_pay_domain> + | Res | typeof SkipResponse > @@ -2376,8 +2376,8 @@ export type GetApplePayDomainsDomain = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_apple_pay_domain> - | Response + | Res<200, t_apple_pay_domain> + | Res | typeof SkipResponse > @@ -2398,7 +2398,7 @@ export type GetApplicationFees = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_application_fee[] @@ -2407,7 +2407,7 @@ export type GetApplicationFees = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -2428,8 +2428,8 @@ export type GetApplicationFeesFeeRefundsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_fee_refund> - | Response + | Res<200, t_fee_refund> + | Res | typeof SkipResponse > @@ -2450,8 +2450,8 @@ export type PostApplicationFeesFeeRefundsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_fee_refund> - | Response + | Res<200, t_fee_refund> + | Res | typeof SkipResponse > @@ -2472,8 +2472,8 @@ export type GetApplicationFeesId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_application_fee> - | Response + | Res<200, t_application_fee> + | Res | typeof SkipResponse > @@ -2494,8 +2494,8 @@ export type PostApplicationFeesIdRefund = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_application_fee> - | Response + | Res<200, t_application_fee> + | Res | typeof SkipResponse > @@ -2521,7 +2521,7 @@ export type GetApplicationFeesIdRefunds = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_fee_refund[] @@ -2530,7 +2530,7 @@ export type GetApplicationFeesIdRefunds = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -2551,8 +2551,8 @@ export type PostApplicationFeesIdRefunds = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_fee_refund> - | Response + | Res<200, t_fee_refund> + | Res | typeof SkipResponse > @@ -2573,7 +2573,7 @@ export type GetAppsSecrets = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_apps_secret[] @@ -2582,7 +2582,7 @@ export type GetAppsSecrets = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -2598,8 +2598,8 @@ export type PostAppsSecrets = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_apps_secret> - | Response + | Res<200, t_apps_secret> + | Res | typeof SkipResponse > @@ -2615,8 +2615,8 @@ export type PostAppsSecretsDelete = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_apps_secret> - | Response + | Res<200, t_apps_secret> + | Res | typeof SkipResponse > @@ -2632,8 +2632,8 @@ export type GetAppsSecretsFind = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_apps_secret> - | Response + | Res<200, t_apps_secret> + | Res | typeof SkipResponse > @@ -2649,8 +2649,8 @@ export type GetBalance = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_balance> - | Response + | Res<200, t_balance> + | Res | typeof SkipResponse > @@ -2671,7 +2671,7 @@ export type GetBalanceHistory = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_balance_transaction[] @@ -2680,7 +2680,7 @@ export type GetBalanceHistory = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -2701,8 +2701,8 @@ export type GetBalanceHistoryId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_balance_transaction> - | Response + | Res<200, t_balance_transaction> + | Res | typeof SkipResponse > @@ -2723,7 +2723,7 @@ export type GetBalanceTransactions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_balance_transaction[] @@ -2732,7 +2732,7 @@ export type GetBalanceTransactions = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -2753,8 +2753,8 @@ export type GetBalanceTransactionsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_balance_transaction> - | Response + | Res<200, t_balance_transaction> + | Res | typeof SkipResponse > @@ -2775,7 +2775,7 @@ export type GetBillingAlerts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_billing_alert[] @@ -2784,7 +2784,7 @@ export type GetBillingAlerts = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -2800,8 +2800,8 @@ export type PostBillingAlerts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_alert> - | Response + | Res<200, t_billing_alert> + | Res | typeof SkipResponse > @@ -2822,8 +2822,8 @@ export type GetBillingAlertsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_alert> - | Response + | Res<200, t_billing_alert> + | Res | typeof SkipResponse > @@ -2844,8 +2844,8 @@ export type PostBillingAlertsIdActivate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_alert> - | Response + | Res<200, t_billing_alert> + | Res | typeof SkipResponse > @@ -2866,8 +2866,8 @@ export type PostBillingAlertsIdArchive = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_alert> - | Response + | Res<200, t_billing_alert> + | Res | typeof SkipResponse > @@ -2888,8 +2888,8 @@ export type PostBillingAlertsIdDeactivate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_alert> - | Response + | Res<200, t_billing_alert> + | Res | typeof SkipResponse > @@ -2905,8 +2905,8 @@ export type GetBillingCreditBalanceSummary = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_credit_balance_summary> - | Response + | Res<200, t_billing_credit_balance_summary> + | Res | typeof SkipResponse > @@ -2932,7 +2932,7 @@ export type GetBillingCreditBalanceTransactions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_billing_credit_balance_transaction[] @@ -2941,7 +2941,7 @@ export type GetBillingCreditBalanceTransactions = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -2962,8 +2962,8 @@ export type GetBillingCreditBalanceTransactionsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_credit_balance_transaction> - | Response + | Res<200, t_billing_credit_balance_transaction> + | Res | typeof SkipResponse > @@ -2984,7 +2984,7 @@ export type GetBillingCreditGrants = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_billing_credit_grant[] @@ -2993,7 +2993,7 @@ export type GetBillingCreditGrants = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -3009,8 +3009,8 @@ export type PostBillingCreditGrants = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_credit_grant> - | Response + | Res<200, t_billing_credit_grant> + | Res | typeof SkipResponse > @@ -3031,8 +3031,8 @@ export type GetBillingCreditGrantsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_credit_grant> - | Response + | Res<200, t_billing_credit_grant> + | Res | typeof SkipResponse > @@ -3053,8 +3053,8 @@ export type PostBillingCreditGrantsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_credit_grant> - | Response + | Res<200, t_billing_credit_grant> + | Res | typeof SkipResponse > @@ -3075,8 +3075,8 @@ export type PostBillingCreditGrantsIdExpire = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_credit_grant> - | Response + | Res<200, t_billing_credit_grant> + | Res | typeof SkipResponse > @@ -3097,8 +3097,8 @@ export type PostBillingCreditGrantsIdVoid = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_credit_grant> - | Response + | Res<200, t_billing_credit_grant> + | Res | typeof SkipResponse > @@ -3119,8 +3119,8 @@ export type PostBillingMeterEventAdjustments = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_meter_event_adjustment> - | Response + | Res<200, t_billing_meter_event_adjustment> + | Res | typeof SkipResponse > @@ -3136,8 +3136,8 @@ export type PostBillingMeterEvents = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_meter_event> - | Response + | Res<200, t_billing_meter_event> + | Res | typeof SkipResponse > @@ -3158,7 +3158,7 @@ export type GetBillingMeters = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_billing_meter[] @@ -3167,7 +3167,7 @@ export type GetBillingMeters = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -3183,8 +3183,8 @@ export type PostBillingMeters = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_meter> - | Response + | Res<200, t_billing_meter> + | Res | typeof SkipResponse > @@ -3205,8 +3205,8 @@ export type GetBillingMetersId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_meter> - | Response + | Res<200, t_billing_meter> + | Res | typeof SkipResponse > @@ -3227,8 +3227,8 @@ export type PostBillingMetersId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_meter> - | Response + | Res<200, t_billing_meter> + | Res | typeof SkipResponse > @@ -3249,8 +3249,8 @@ export type PostBillingMetersIdDeactivate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_meter> - | Response + | Res<200, t_billing_meter> + | Res | typeof SkipResponse > @@ -3276,7 +3276,7 @@ export type GetBillingMetersIdEventSummaries = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_billing_meter_event_summary[] @@ -3285,7 +3285,7 @@ export type GetBillingMetersIdEventSummaries = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -3306,8 +3306,8 @@ export type PostBillingMetersIdReactivate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_meter> - | Response + | Res<200, t_billing_meter> + | Res | typeof SkipResponse > @@ -3328,7 +3328,7 @@ export type GetBillingPortalConfigurations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_billing_portal_configuration[] @@ -3337,7 +3337,7 @@ export type GetBillingPortalConfigurations = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -3358,8 +3358,8 @@ export type PostBillingPortalConfigurations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_portal_configuration> - | Response + | Res<200, t_billing_portal_configuration> + | Res | typeof SkipResponse > @@ -3380,8 +3380,8 @@ export type GetBillingPortalConfigurationsConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_portal_configuration> - | Response + | Res<200, t_billing_portal_configuration> + | Res | typeof SkipResponse > @@ -3402,8 +3402,8 @@ export type PostBillingPortalConfigurationsConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_portal_configuration> - | Response + | Res<200, t_billing_portal_configuration> + | Res | typeof SkipResponse > @@ -3419,8 +3419,8 @@ export type PostBillingPortalSessions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_billing_portal_session> - | Response + | Res<200, t_billing_portal_session> + | Res | typeof SkipResponse > @@ -3441,7 +3441,7 @@ export type GetCharges = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_charge[] @@ -3450,7 +3450,7 @@ export type GetCharges = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -3466,8 +3466,8 @@ export type PostCharges = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_charge> - | Response + | Res<200, t_charge> + | Res | typeof SkipResponse > @@ -3490,7 +3490,7 @@ export type GetChargesSearch = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_charge[] @@ -3501,7 +3501,7 @@ export type GetChargesSearch = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -3522,8 +3522,8 @@ export type GetChargesCharge = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_charge> - | Response + | Res<200, t_charge> + | Res | typeof SkipResponse > @@ -3544,8 +3544,8 @@ export type PostChargesCharge = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_charge> - | Response + | Res<200, t_charge> + | Res | typeof SkipResponse > @@ -3566,8 +3566,8 @@ export type PostChargesChargeCapture = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_charge> - | Response + | Res<200, t_charge> + | Res | typeof SkipResponse > @@ -3588,8 +3588,8 @@ export type GetChargesChargeDispute = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_dispute> - | Response + | Res<200, t_dispute> + | Res | typeof SkipResponse > @@ -3610,8 +3610,8 @@ export type PostChargesChargeDispute = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_dispute> - | Response + | Res<200, t_dispute> + | Res | typeof SkipResponse > @@ -3632,8 +3632,8 @@ export type PostChargesChargeDisputeClose = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_dispute> - | Response + | Res<200, t_dispute> + | Res | typeof SkipResponse > @@ -3654,8 +3654,8 @@ export type PostChargesChargeRefund = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_charge> - | Response + | Res<200, t_charge> + | Res | typeof SkipResponse > @@ -3681,7 +3681,7 @@ export type GetChargesChargeRefunds = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_refund[] @@ -3690,7 +3690,7 @@ export type GetChargesChargeRefunds = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -3711,8 +3711,8 @@ export type PostChargesChargeRefunds = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_refund> - | Response + | Res<200, t_refund> + | Res | typeof SkipResponse > @@ -3733,8 +3733,8 @@ export type GetChargesChargeRefundsRefund = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_refund> - | Response + | Res<200, t_refund> + | Res | typeof SkipResponse > @@ -3755,8 +3755,8 @@ export type PostChargesChargeRefundsRefund = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_refund> - | Response + | Res<200, t_refund> + | Res | typeof SkipResponse > @@ -3777,7 +3777,7 @@ export type GetCheckoutSessions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_checkout_session[] @@ -3786,7 +3786,7 @@ export type GetCheckoutSessions = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -3807,8 +3807,8 @@ export type PostCheckoutSessions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_checkout_session> - | Response + | Res<200, t_checkout_session> + | Res | typeof SkipResponse > @@ -3829,8 +3829,8 @@ export type GetCheckoutSessionsSession = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_checkout_session> - | Response + | Res<200, t_checkout_session> + | Res | typeof SkipResponse > @@ -3851,8 +3851,8 @@ export type PostCheckoutSessionsSession = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_checkout_session> - | Response + | Res<200, t_checkout_session> + | Res | typeof SkipResponse > @@ -3873,8 +3873,8 @@ export type PostCheckoutSessionsSessionExpire = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_checkout_session> - | Response + | Res<200, t_checkout_session> + | Res | typeof SkipResponse > @@ -3900,7 +3900,7 @@ export type GetCheckoutSessionsSessionLineItems = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_item[] @@ -3909,7 +3909,7 @@ export type GetCheckoutSessionsSessionLineItems = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -3930,7 +3930,7 @@ export type GetClimateOrders = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_climate_order[] @@ -3939,7 +3939,7 @@ export type GetClimateOrders = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -3955,8 +3955,8 @@ export type PostClimateOrders = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_climate_order> - | Response + | Res<200, t_climate_order> + | Res | typeof SkipResponse > @@ -3977,8 +3977,8 @@ export type GetClimateOrdersOrder = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_climate_order> - | Response + | Res<200, t_climate_order> + | Res | typeof SkipResponse > @@ -3999,8 +3999,8 @@ export type PostClimateOrdersOrder = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_climate_order> - | Response + | Res<200, t_climate_order> + | Res | typeof SkipResponse > @@ -4021,8 +4021,8 @@ export type PostClimateOrdersOrderCancel = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_climate_order> - | Response + | Res<200, t_climate_order> + | Res | typeof SkipResponse > @@ -4043,7 +4043,7 @@ export type GetClimateProducts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_climate_product[] @@ -4052,7 +4052,7 @@ export type GetClimateProducts = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -4073,8 +4073,8 @@ export type GetClimateProductsProduct = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_climate_product> - | Response + | Res<200, t_climate_product> + | Res | typeof SkipResponse > @@ -4095,7 +4095,7 @@ export type GetClimateSuppliers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_climate_supplier[] @@ -4104,7 +4104,7 @@ export type GetClimateSuppliers = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -4125,8 +4125,8 @@ export type GetClimateSuppliersSupplier = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_climate_supplier> - | Response + | Res<200, t_climate_supplier> + | Res | typeof SkipResponse > @@ -4147,8 +4147,8 @@ export type GetConfirmationTokensConfirmationToken = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_confirmation_token> - | Response + | Res<200, t_confirmation_token> + | Res | typeof SkipResponse > @@ -4169,7 +4169,7 @@ export type GetCountrySpecs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_country_spec[] @@ -4178,7 +4178,7 @@ export type GetCountrySpecs = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -4199,8 +4199,8 @@ export type GetCountrySpecsCountry = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_country_spec> - | Response + | Res<200, t_country_spec> + | Res | typeof SkipResponse > @@ -4221,7 +4221,7 @@ export type GetCoupons = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_coupon[] @@ -4230,7 +4230,7 @@ export type GetCoupons = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -4246,8 +4246,8 @@ export type PostCoupons = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_coupon> - | Response + | Res<200, t_coupon> + | Res | typeof SkipResponse > @@ -4263,8 +4263,8 @@ export type DeleteCouponsCoupon = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_coupon> - | Response + | Res<200, t_deleted_coupon> + | Res | typeof SkipResponse > @@ -4285,8 +4285,8 @@ export type GetCouponsCoupon = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_coupon> - | Response + | Res<200, t_coupon> + | Res | typeof SkipResponse > @@ -4307,8 +4307,8 @@ export type PostCouponsCoupon = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_coupon> - | Response + | Res<200, t_coupon> + | Res | typeof SkipResponse > @@ -4329,7 +4329,7 @@ export type GetCreditNotes = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_credit_note[] @@ -4338,7 +4338,7 @@ export type GetCreditNotes = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -4354,8 +4354,8 @@ export type PostCreditNotes = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_credit_note> - | Response + | Res<200, t_credit_note> + | Res | typeof SkipResponse > @@ -4371,8 +4371,8 @@ export type GetCreditNotesPreview = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_credit_note> - | Response + | Res<200, t_credit_note> + | Res | typeof SkipResponse > @@ -4393,7 +4393,7 @@ export type GetCreditNotesPreviewLines = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_credit_note_line_item[] @@ -4402,7 +4402,7 @@ export type GetCreditNotesPreviewLines = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -4428,7 +4428,7 @@ export type GetCreditNotesCreditNoteLines = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_credit_note_line_item[] @@ -4437,7 +4437,7 @@ export type GetCreditNotesCreditNoteLines = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -4458,8 +4458,8 @@ export type GetCreditNotesId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_credit_note> - | Response + | Res<200, t_credit_note> + | Res | typeof SkipResponse > @@ -4480,8 +4480,8 @@ export type PostCreditNotesId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_credit_note> - | Response + | Res<200, t_credit_note> + | Res | typeof SkipResponse > @@ -4502,8 +4502,8 @@ export type PostCreditNotesIdVoid = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_credit_note> - | Response + | Res<200, t_credit_note> + | Res | typeof SkipResponse > @@ -4519,8 +4519,8 @@ export type PostCustomerSessions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_customer_session> - | Response + | Res<200, t_customer_session> + | Res | typeof SkipResponse > @@ -4541,7 +4541,7 @@ export type GetCustomers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_customer[] @@ -4550,7 +4550,7 @@ export type GetCustomers = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -4566,8 +4566,8 @@ export type PostCustomers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_customer> - | Response + | Res<200, t_customer> + | Res | typeof SkipResponse > @@ -4590,7 +4590,7 @@ export type GetCustomersSearch = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_customer[] @@ -4601,7 +4601,7 @@ export type GetCustomersSearch = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -4617,8 +4617,8 @@ export type DeleteCustomersCustomer = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_customer> - | Response + | Res<200, t_deleted_customer> + | Res | typeof SkipResponse > @@ -4639,8 +4639,8 @@ export type GetCustomersCustomer = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_customer | t_deleted_customer> - | Response + | Res<200, t_customer | t_deleted_customer> + | Res | typeof SkipResponse > @@ -4661,8 +4661,8 @@ export type PostCustomersCustomer = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_customer> - | Response + | Res<200, t_customer> + | Res | typeof SkipResponse > @@ -4688,7 +4688,7 @@ export type GetCustomersCustomerBalanceTransactions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_customer_balance_transaction[] @@ -4697,7 +4697,7 @@ export type GetCustomersCustomerBalanceTransactions = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -4718,8 +4718,8 @@ export type PostCustomersCustomerBalanceTransactions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_customer_balance_transaction> - | Response + | Res<200, t_customer_balance_transaction> + | Res | typeof SkipResponse > @@ -4740,8 +4740,8 @@ export type GetCustomersCustomerBalanceTransactionsTransaction = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_customer_balance_transaction> - | Response + | Res<200, t_customer_balance_transaction> + | Res | typeof SkipResponse > @@ -4763,8 +4763,8 @@ export type PostCustomersCustomerBalanceTransactionsTransaction = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_customer_balance_transaction> - | Response + | Res<200, t_customer_balance_transaction> + | Res | typeof SkipResponse > @@ -4790,7 +4790,7 @@ export type GetCustomersCustomerBankAccounts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_bank_account[] @@ -4799,7 +4799,7 @@ export type GetCustomersCustomerBankAccounts = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -4820,8 +4820,8 @@ export type PostCustomersCustomerBankAccounts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_source> - | Response + | Res<200, t_payment_source> + | Res | typeof SkipResponse > @@ -4842,8 +4842,8 @@ export type DeleteCustomersCustomerBankAccountsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_source | t_deleted_payment_source> - | Response + | Res<200, t_payment_source | t_deleted_payment_source> + | Res | typeof SkipResponse > @@ -4864,8 +4864,8 @@ export type GetCustomersCustomerBankAccountsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_bank_account> - | Response + | Res<200, t_bank_account> + | Res | typeof SkipResponse > @@ -4886,8 +4886,8 @@ export type PostCustomersCustomerBankAccountsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_card | t_bank_account | t_source> - | Response + | Res<200, t_card | t_bank_account | t_source> + | Res | typeof SkipResponse > @@ -4908,8 +4908,8 @@ export type PostCustomersCustomerBankAccountsIdVerify = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_bank_account> - | Response + | Res<200, t_bank_account> + | Res | typeof SkipResponse > @@ -4935,7 +4935,7 @@ export type GetCustomersCustomerCards = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_card[] @@ -4944,7 +4944,7 @@ export type GetCustomersCustomerCards = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -4965,8 +4965,8 @@ export type PostCustomersCustomerCards = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_source> - | Response + | Res<200, t_payment_source> + | Res | typeof SkipResponse > @@ -4987,8 +4987,8 @@ export type DeleteCustomersCustomerCardsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_source | t_deleted_payment_source> - | Response + | Res<200, t_payment_source | t_deleted_payment_source> + | Res | typeof SkipResponse > @@ -5009,8 +5009,8 @@ export type GetCustomersCustomerCardsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_card> - | Response + | Res<200, t_card> + | Res | typeof SkipResponse > @@ -5031,8 +5031,8 @@ export type PostCustomersCustomerCardsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_card | t_bank_account | t_source> - | Response + | Res<200, t_card | t_bank_account | t_source> + | Res | typeof SkipResponse > @@ -5053,8 +5053,8 @@ export type GetCustomersCustomerCashBalance = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_cash_balance> - | Response + | Res<200, t_cash_balance> + | Res | typeof SkipResponse > @@ -5075,8 +5075,8 @@ export type PostCustomersCustomerCashBalance = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_cash_balance> - | Response + | Res<200, t_cash_balance> + | Res | typeof SkipResponse > @@ -5102,7 +5102,7 @@ export type GetCustomersCustomerCashBalanceTransactions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_customer_cash_balance_transaction[] @@ -5111,7 +5111,7 @@ export type GetCustomersCustomerCashBalanceTransactions = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -5132,8 +5132,8 @@ export type GetCustomersCustomerCashBalanceTransactionsTransaction = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_customer_cash_balance_transaction> - | Response + | Res<200, t_customer_cash_balance_transaction> + | Res | typeof SkipResponse > @@ -5154,8 +5154,8 @@ export type DeleteCustomersCustomerDiscount = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_discount> - | Response + | Res<200, t_deleted_discount> + | Res | typeof SkipResponse > @@ -5176,8 +5176,8 @@ export type GetCustomersCustomerDiscount = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_discount> - | Response + | Res<200, t_discount> + | Res | typeof SkipResponse > @@ -5198,8 +5198,8 @@ export type PostCustomersCustomerFundingInstructions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_funding_instructions> - | Response + | Res<200, t_funding_instructions> + | Res | typeof SkipResponse > @@ -5225,7 +5225,7 @@ export type GetCustomersCustomerPaymentMethods = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_payment_method[] @@ -5234,7 +5234,7 @@ export type GetCustomersCustomerPaymentMethods = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -5255,8 +5255,8 @@ export type GetCustomersCustomerPaymentMethodsPaymentMethod = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_method> - | Response + | Res<200, t_payment_method> + | Res | typeof SkipResponse > @@ -5282,7 +5282,7 @@ export type GetCustomersCustomerSources = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: (t_bank_account | t_card | t_source)[] @@ -5291,7 +5291,7 @@ export type GetCustomersCustomerSources = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -5312,8 +5312,8 @@ export type PostCustomersCustomerSources = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_source> - | Response + | Res<200, t_payment_source> + | Res | typeof SkipResponse > @@ -5334,8 +5334,8 @@ export type DeleteCustomersCustomerSourcesId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_source | t_deleted_payment_source> - | Response + | Res<200, t_payment_source | t_deleted_payment_source> + | Res | typeof SkipResponse > @@ -5356,8 +5356,8 @@ export type GetCustomersCustomerSourcesId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_source> - | Response + | Res<200, t_payment_source> + | Res | typeof SkipResponse > @@ -5378,8 +5378,8 @@ export type PostCustomersCustomerSourcesId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_card | t_bank_account | t_source> - | Response + | Res<200, t_card | t_bank_account | t_source> + | Res | typeof SkipResponse > @@ -5400,8 +5400,8 @@ export type PostCustomersCustomerSourcesIdVerify = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_bank_account> - | Response + | Res<200, t_bank_account> + | Res | typeof SkipResponse > @@ -5427,7 +5427,7 @@ export type GetCustomersCustomerSubscriptions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_subscription[] @@ -5436,7 +5436,7 @@ export type GetCustomersCustomerSubscriptions = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -5457,8 +5457,8 @@ export type PostCustomersCustomerSubscriptions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription> - | Response + | Res<200, t_subscription> + | Res | typeof SkipResponse > @@ -5481,8 +5481,8 @@ export type DeleteCustomersCustomerSubscriptionsSubscriptionExposedId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription> - | Response + | Res<200, t_subscription> + | Res | typeof SkipResponse > @@ -5503,8 +5503,8 @@ export type GetCustomersCustomerSubscriptionsSubscriptionExposedId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription> - | Response + | Res<200, t_subscription> + | Res | typeof SkipResponse > @@ -5526,8 +5526,8 @@ export type PostCustomersCustomerSubscriptionsSubscriptionExposedId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription> - | Response + | Res<200, t_subscription> + | Res | typeof SkipResponse > @@ -5550,8 +5550,8 @@ export type DeleteCustomersCustomerSubscriptionsSubscriptionExposedIdDiscount = next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_discount> - | Response + | Res<200, t_deleted_discount> + | Res | typeof SkipResponse > @@ -5573,8 +5573,8 @@ export type GetCustomersCustomerSubscriptionsSubscriptionExposedIdDiscount = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_discount> - | Response + | Res<200, t_discount> + | Res | typeof SkipResponse > @@ -5600,7 +5600,7 @@ export type GetCustomersCustomerTaxIds = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_tax_id[] @@ -5609,7 +5609,7 @@ export type GetCustomersCustomerTaxIds = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -5630,8 +5630,8 @@ export type PostCustomersCustomerTaxIds = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_id> - | Response + | Res<200, t_tax_id> + | Res | typeof SkipResponse > @@ -5652,8 +5652,8 @@ export type DeleteCustomersCustomerTaxIdsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_tax_id> - | Response + | Res<200, t_deleted_tax_id> + | Res | typeof SkipResponse > @@ -5674,8 +5674,8 @@ export type GetCustomersCustomerTaxIdsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_id> - | Response + | Res<200, t_tax_id> + | Res | typeof SkipResponse > @@ -5696,7 +5696,7 @@ export type GetDisputes = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_dispute[] @@ -5705,7 +5705,7 @@ export type GetDisputes = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -5726,8 +5726,8 @@ export type GetDisputesDispute = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_dispute> - | Response + | Res<200, t_dispute> + | Res | typeof SkipResponse > @@ -5748,8 +5748,8 @@ export type PostDisputesDispute = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_dispute> - | Response + | Res<200, t_dispute> + | Res | typeof SkipResponse > @@ -5770,8 +5770,8 @@ export type PostDisputesDisputeClose = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_dispute> - | Response + | Res<200, t_dispute> + | Res | typeof SkipResponse > @@ -5797,7 +5797,7 @@ export type GetEntitlementsActiveEntitlements = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_entitlements_active_entitlement[] @@ -5806,7 +5806,7 @@ export type GetEntitlementsActiveEntitlements = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -5827,8 +5827,8 @@ export type GetEntitlementsActiveEntitlementsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_entitlements_active_entitlement> - | Response + | Res<200, t_entitlements_active_entitlement> + | Res | typeof SkipResponse > @@ -5849,7 +5849,7 @@ export type GetEntitlementsFeatures = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_entitlements_feature[] @@ -5858,7 +5858,7 @@ export type GetEntitlementsFeatures = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -5874,8 +5874,8 @@ export type PostEntitlementsFeatures = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_entitlements_feature> - | Response + | Res<200, t_entitlements_feature> + | Res | typeof SkipResponse > @@ -5896,8 +5896,8 @@ export type GetEntitlementsFeaturesId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_entitlements_feature> - | Response + | Res<200, t_entitlements_feature> + | Res | typeof SkipResponse > @@ -5918,8 +5918,8 @@ export type PostEntitlementsFeaturesId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_entitlements_feature> - | Response + | Res<200, t_entitlements_feature> + | Res | typeof SkipResponse > @@ -5935,8 +5935,8 @@ export type PostEphemeralKeys = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_ephemeral_key> - | Response + | Res<200, t_ephemeral_key> + | Res | typeof SkipResponse > @@ -5957,8 +5957,8 @@ export type DeleteEphemeralKeysKey = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_ephemeral_key> - | Response + | Res<200, t_ephemeral_key> + | Res | typeof SkipResponse > @@ -5979,7 +5979,7 @@ export type GetEvents = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_event[] @@ -5988,7 +5988,7 @@ export type GetEvents = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -6009,8 +6009,8 @@ export type GetEventsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_event> - | Response + | Res<200, t_event> + | Res | typeof SkipResponse > @@ -6031,7 +6031,7 @@ export type GetExchangeRates = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_exchange_rate[] @@ -6040,7 +6040,7 @@ export type GetExchangeRates = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -6061,8 +6061,8 @@ export type GetExchangeRatesRateId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_exchange_rate> - | Response + | Res<200, t_exchange_rate> + | Res | typeof SkipResponse > @@ -6083,8 +6083,8 @@ export type PostExternalAccountsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_external_account> - | Response + | Res<200, t_external_account> + | Res | typeof SkipResponse > @@ -6105,7 +6105,7 @@ export type GetFileLinks = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_file_link[] @@ -6114,7 +6114,7 @@ export type GetFileLinks = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -6130,8 +6130,8 @@ export type PostFileLinks = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_file_link> - | Response + | Res<200, t_file_link> + | Res | typeof SkipResponse > @@ -6152,8 +6152,8 @@ export type GetFileLinksLink = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_file_link> - | Response + | Res<200, t_file_link> + | Res | typeof SkipResponse > @@ -6174,8 +6174,8 @@ export type PostFileLinksLink = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_file_link> - | Response + | Res<200, t_file_link> + | Res | typeof SkipResponse > @@ -6196,7 +6196,7 @@ export type GetFiles = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_file[] @@ -6205,7 +6205,7 @@ export type GetFiles = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -6221,8 +6221,8 @@ export type PostFiles = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_file> - | Response + | Res<200, t_file> + | Res | typeof SkipResponse > @@ -6243,8 +6243,8 @@ export type GetFilesFile = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_file> - | Response + | Res<200, t_file> + | Res | typeof SkipResponse > @@ -6270,7 +6270,7 @@ export type GetFinancialConnectionsAccounts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_financial_connections_account[] @@ -6279,7 +6279,7 @@ export type GetFinancialConnectionsAccounts = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -6300,8 +6300,8 @@ export type GetFinancialConnectionsAccountsAccount = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_financial_connections_account> - | Response + | Res<200, t_financial_connections_account> + | Res | typeof SkipResponse > @@ -6322,8 +6322,8 @@ export type PostFinancialConnectionsAccountsAccountDisconnect = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_financial_connections_account> - | Response + | Res<200, t_financial_connections_account> + | Res | typeof SkipResponse > @@ -6349,7 +6349,7 @@ export type GetFinancialConnectionsAccountsAccountOwners = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_financial_connections_account_owner[] @@ -6358,7 +6358,7 @@ export type GetFinancialConnectionsAccountsAccountOwners = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -6379,8 +6379,8 @@ export type PostFinancialConnectionsAccountsAccountRefresh = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_financial_connections_account> - | Response + | Res<200, t_financial_connections_account> + | Res | typeof SkipResponse > @@ -6401,8 +6401,8 @@ export type PostFinancialConnectionsAccountsAccountSubscribe = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_financial_connections_account> - | Response + | Res<200, t_financial_connections_account> + | Res | typeof SkipResponse > @@ -6423,8 +6423,8 @@ export type PostFinancialConnectionsAccountsAccountUnsubscribe = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_financial_connections_account> - | Response + | Res<200, t_financial_connections_account> + | Res | typeof SkipResponse > @@ -6445,8 +6445,8 @@ export type PostFinancialConnectionsSessions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_financial_connections_session> - | Response + | Res<200, t_financial_connections_session> + | Res | typeof SkipResponse > @@ -6467,8 +6467,8 @@ export type GetFinancialConnectionsSessionsSession = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_financial_connections_session> - | Response + | Res<200, t_financial_connections_session> + | Res | typeof SkipResponse > @@ -6494,7 +6494,7 @@ export type GetFinancialConnectionsTransactions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_financial_connections_transaction[] @@ -6503,7 +6503,7 @@ export type GetFinancialConnectionsTransactions = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -6524,8 +6524,8 @@ export type GetFinancialConnectionsTransactionsTransaction = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_financial_connections_transaction> - | Response + | Res<200, t_financial_connections_transaction> + | Res | typeof SkipResponse > @@ -6546,7 +6546,7 @@ export type GetForwardingRequests = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_forwarding_request[] @@ -6555,7 +6555,7 @@ export type GetForwardingRequests = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -6571,8 +6571,8 @@ export type PostForwardingRequests = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_forwarding_request> - | Response + | Res<200, t_forwarding_request> + | Res | typeof SkipResponse > @@ -6593,8 +6593,8 @@ export type GetForwardingRequestsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_forwarding_request> - | Response + | Res<200, t_forwarding_request> + | Res | typeof SkipResponse > @@ -6615,7 +6615,7 @@ export type GetIdentityVerificationReports = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_identity_verification_report[] @@ -6624,7 +6624,7 @@ export type GetIdentityVerificationReports = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -6645,8 +6645,8 @@ export type GetIdentityVerificationReportsReport = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_identity_verification_report> - | Response + | Res<200, t_identity_verification_report> + | Res | typeof SkipResponse > @@ -6672,7 +6672,7 @@ export type GetIdentityVerificationSessions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_identity_verification_session[] @@ -6681,7 +6681,7 @@ export type GetIdentityVerificationSessions = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -6702,8 +6702,8 @@ export type PostIdentityVerificationSessions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_identity_verification_session> - | Response + | Res<200, t_identity_verification_session> + | Res | typeof SkipResponse > @@ -6724,8 +6724,8 @@ export type GetIdentityVerificationSessionsSession = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_identity_verification_session> - | Response + | Res<200, t_identity_verification_session> + | Res | typeof SkipResponse > @@ -6746,8 +6746,8 @@ export type PostIdentityVerificationSessionsSession = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_identity_verification_session> - | Response + | Res<200, t_identity_verification_session> + | Res | typeof SkipResponse > @@ -6768,8 +6768,8 @@ export type PostIdentityVerificationSessionsSessionCancel = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_identity_verification_session> - | Response + | Res<200, t_identity_verification_session> + | Res | typeof SkipResponse > @@ -6790,8 +6790,8 @@ export type PostIdentityVerificationSessionsSessionRedact = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_identity_verification_session> - | Response + | Res<200, t_identity_verification_session> + | Res | typeof SkipResponse > @@ -6812,7 +6812,7 @@ export type GetInvoicePayments = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_invoice_payment[] @@ -6821,7 +6821,7 @@ export type GetInvoicePayments = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -6842,8 +6842,8 @@ export type GetInvoicePaymentsInvoicePayment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoice_payment> - | Response + | Res<200, t_invoice_payment> + | Res | typeof SkipResponse > @@ -6864,7 +6864,7 @@ export type GetInvoiceRenderingTemplates = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_invoice_rendering_template[] @@ -6873,7 +6873,7 @@ export type GetInvoiceRenderingTemplates = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -6894,8 +6894,8 @@ export type GetInvoiceRenderingTemplatesTemplate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoice_rendering_template> - | Response + | Res<200, t_invoice_rendering_template> + | Res | typeof SkipResponse > @@ -6916,8 +6916,8 @@ export type PostInvoiceRenderingTemplatesTemplateArchive = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoice_rendering_template> - | Response + | Res<200, t_invoice_rendering_template> + | Res | typeof SkipResponse > @@ -6938,8 +6938,8 @@ export type PostInvoiceRenderingTemplatesTemplateUnarchive = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoice_rendering_template> - | Response + | Res<200, t_invoice_rendering_template> + | Res | typeof SkipResponse > @@ -6960,7 +6960,7 @@ export type GetInvoiceitems = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_invoiceitem[] @@ -6969,7 +6969,7 @@ export type GetInvoiceitems = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -6985,8 +6985,8 @@ export type PostInvoiceitems = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoiceitem> - | Response + | Res<200, t_invoiceitem> + | Res | typeof SkipResponse > @@ -7002,8 +7002,8 @@ export type DeleteInvoiceitemsInvoiceitem = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_invoiceitem> - | Response + | Res<200, t_deleted_invoiceitem> + | Res | typeof SkipResponse > @@ -7024,8 +7024,8 @@ export type GetInvoiceitemsInvoiceitem = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoiceitem> - | Response + | Res<200, t_invoiceitem> + | Res | typeof SkipResponse > @@ -7046,8 +7046,8 @@ export type PostInvoiceitemsInvoiceitem = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoiceitem> - | Response + | Res<200, t_invoiceitem> + | Res | typeof SkipResponse > @@ -7068,7 +7068,7 @@ export type GetInvoices = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_invoice[] @@ -7077,7 +7077,7 @@ export type GetInvoices = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -7093,8 +7093,8 @@ export type PostInvoices = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoice> - | Response + | Res<200, t_invoice> + | Res | typeof SkipResponse > @@ -7115,8 +7115,8 @@ export type PostInvoicesCreatePreview = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoice> - | Response + | Res<200, t_invoice> + | Res | typeof SkipResponse > @@ -7139,7 +7139,7 @@ export type GetInvoicesSearch = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_invoice[] @@ -7150,7 +7150,7 @@ export type GetInvoicesSearch = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -7166,8 +7166,8 @@ export type DeleteInvoicesInvoice = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_invoice> - | Response + | Res<200, t_deleted_invoice> + | Res | typeof SkipResponse > @@ -7188,8 +7188,8 @@ export type GetInvoicesInvoice = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoice> - | Response + | Res<200, t_invoice> + | Res | typeof SkipResponse > @@ -7210,8 +7210,8 @@ export type PostInvoicesInvoice = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoice> - | Response + | Res<200, t_invoice> + | Res | typeof SkipResponse > @@ -7232,8 +7232,8 @@ export type PostInvoicesInvoiceAddLines = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoice> - | Response + | Res<200, t_invoice> + | Res | typeof SkipResponse > @@ -7254,8 +7254,8 @@ export type PostInvoicesInvoiceAttachPayment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoice> - | Response + | Res<200, t_invoice> + | Res | typeof SkipResponse > @@ -7276,8 +7276,8 @@ export type PostInvoicesInvoiceFinalize = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoice> - | Response + | Res<200, t_invoice> + | Res | typeof SkipResponse > @@ -7303,7 +7303,7 @@ export type GetInvoicesInvoiceLines = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_line_item[] @@ -7312,7 +7312,7 @@ export type GetInvoicesInvoiceLines = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -7333,8 +7333,8 @@ export type PostInvoicesInvoiceLinesLineItemId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_line_item> - | Response + | Res<200, t_line_item> + | Res | typeof SkipResponse > @@ -7355,8 +7355,8 @@ export type PostInvoicesInvoiceMarkUncollectible = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoice> - | Response + | Res<200, t_invoice> + | Res | typeof SkipResponse > @@ -7377,8 +7377,8 @@ export type PostInvoicesInvoicePay = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoice> - | Response + | Res<200, t_invoice> + | Res | typeof SkipResponse > @@ -7399,8 +7399,8 @@ export type PostInvoicesInvoiceRemoveLines = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoice> - | Response + | Res<200, t_invoice> + | Res | typeof SkipResponse > @@ -7421,8 +7421,8 @@ export type PostInvoicesInvoiceSend = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoice> - | Response + | Res<200, t_invoice> + | Res | typeof SkipResponse > @@ -7443,8 +7443,8 @@ export type PostInvoicesInvoiceUpdateLines = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoice> - | Response + | Res<200, t_invoice> + | Res | typeof SkipResponse > @@ -7465,8 +7465,8 @@ export type PostInvoicesInvoiceVoid = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_invoice> - | Response + | Res<200, t_invoice> + | Res | typeof SkipResponse > @@ -7487,7 +7487,7 @@ export type GetIssuingAuthorizations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_issuing_authorization[] @@ -7496,7 +7496,7 @@ export type GetIssuingAuthorizations = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -7517,8 +7517,8 @@ export type GetIssuingAuthorizationsAuthorization = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_authorization> - | Response + | Res<200, t_issuing_authorization> + | Res | typeof SkipResponse > @@ -7539,8 +7539,8 @@ export type PostIssuingAuthorizationsAuthorization = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_authorization> - | Response + | Res<200, t_issuing_authorization> + | Res | typeof SkipResponse > @@ -7561,8 +7561,8 @@ export type PostIssuingAuthorizationsAuthorizationApprove = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_authorization> - | Response + | Res<200, t_issuing_authorization> + | Res | typeof SkipResponse > @@ -7583,8 +7583,8 @@ export type PostIssuingAuthorizationsAuthorizationDecline = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_authorization> - | Response + | Res<200, t_issuing_authorization> + | Res | typeof SkipResponse > @@ -7605,7 +7605,7 @@ export type GetIssuingCardholders = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_issuing_cardholder[] @@ -7614,7 +7614,7 @@ export type GetIssuingCardholders = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -7630,8 +7630,8 @@ export type PostIssuingCardholders = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_cardholder> - | Response + | Res<200, t_issuing_cardholder> + | Res | typeof SkipResponse > @@ -7652,8 +7652,8 @@ export type GetIssuingCardholdersCardholder = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_cardholder> - | Response + | Res<200, t_issuing_cardholder> + | Res | typeof SkipResponse > @@ -7674,8 +7674,8 @@ export type PostIssuingCardholdersCardholder = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_cardholder> - | Response + | Res<200, t_issuing_cardholder> + | Res | typeof SkipResponse > @@ -7696,7 +7696,7 @@ export type GetIssuingCards = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_issuing_card[] @@ -7705,7 +7705,7 @@ export type GetIssuingCards = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -7721,8 +7721,8 @@ export type PostIssuingCards = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_card> - | Response + | Res<200, t_issuing_card> + | Res | typeof SkipResponse > @@ -7743,8 +7743,8 @@ export type GetIssuingCardsCard = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_card> - | Response + | Res<200, t_issuing_card> + | Res | typeof SkipResponse > @@ -7765,8 +7765,8 @@ export type PostIssuingCardsCard = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_card> - | Response + | Res<200, t_issuing_card> + | Res | typeof SkipResponse > @@ -7787,7 +7787,7 @@ export type GetIssuingDisputes = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_issuing_dispute[] @@ -7796,7 +7796,7 @@ export type GetIssuingDisputes = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -7817,8 +7817,8 @@ export type PostIssuingDisputes = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_dispute> - | Response + | Res<200, t_issuing_dispute> + | Res | typeof SkipResponse > @@ -7839,8 +7839,8 @@ export type GetIssuingDisputesDispute = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_dispute> - | Response + | Res<200, t_issuing_dispute> + | Res | typeof SkipResponse > @@ -7861,8 +7861,8 @@ export type PostIssuingDisputesDispute = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_dispute> - | Response + | Res<200, t_issuing_dispute> + | Res | typeof SkipResponse > @@ -7883,8 +7883,8 @@ export type PostIssuingDisputesDisputeSubmit = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_dispute> - | Response + | Res<200, t_issuing_dispute> + | Res | typeof SkipResponse > @@ -7910,7 +7910,7 @@ export type GetIssuingPersonalizationDesigns = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_issuing_personalization_design[] @@ -7919,7 +7919,7 @@ export type GetIssuingPersonalizationDesigns = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -7940,8 +7940,8 @@ export type PostIssuingPersonalizationDesigns = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_personalization_design> - | Response + | Res<200, t_issuing_personalization_design> + | Res | typeof SkipResponse > @@ -7962,8 +7962,8 @@ export type GetIssuingPersonalizationDesignsPersonalizationDesign = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_personalization_design> - | Response + | Res<200, t_issuing_personalization_design> + | Res | typeof SkipResponse > @@ -7985,8 +7985,8 @@ export type PostIssuingPersonalizationDesignsPersonalizationDesign = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_personalization_design> - | Response + | Res<200, t_issuing_personalization_design> + | Res | typeof SkipResponse > @@ -8007,7 +8007,7 @@ export type GetIssuingPhysicalBundles = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_issuing_physical_bundle[] @@ -8016,7 +8016,7 @@ export type GetIssuingPhysicalBundles = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -8037,8 +8037,8 @@ export type GetIssuingPhysicalBundlesPhysicalBundle = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_physical_bundle> - | Response + | Res<200, t_issuing_physical_bundle> + | Res | typeof SkipResponse > @@ -8059,8 +8059,8 @@ export type GetIssuingSettlementsSettlement = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_settlement> - | Response + | Res<200, t_issuing_settlement> + | Res | typeof SkipResponse > @@ -8081,8 +8081,8 @@ export type PostIssuingSettlementsSettlement = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_settlement> - | Response + | Res<200, t_issuing_settlement> + | Res | typeof SkipResponse > @@ -8103,7 +8103,7 @@ export type GetIssuingTokens = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_issuing_token[] @@ -8112,7 +8112,7 @@ export type GetIssuingTokens = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -8133,8 +8133,8 @@ export type GetIssuingTokensToken = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_token> - | Response + | Res<200, t_issuing_token> + | Res | typeof SkipResponse > @@ -8155,8 +8155,8 @@ export type PostIssuingTokensToken = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_token> - | Response + | Res<200, t_issuing_token> + | Res | typeof SkipResponse > @@ -8177,7 +8177,7 @@ export type GetIssuingTransactions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_issuing_transaction[] @@ -8186,7 +8186,7 @@ export type GetIssuingTransactions = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -8207,8 +8207,8 @@ export type GetIssuingTransactionsTransaction = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_transaction> - | Response + | Res<200, t_issuing_transaction> + | Res | typeof SkipResponse > @@ -8229,8 +8229,8 @@ export type PostIssuingTransactionsTransaction = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_transaction> - | Response + | Res<200, t_issuing_transaction> + | Res | typeof SkipResponse > @@ -8246,8 +8246,8 @@ export type PostLinkAccountSessions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_financial_connections_session> - | Response + | Res<200, t_financial_connections_session> + | Res | typeof SkipResponse > @@ -8268,8 +8268,8 @@ export type GetLinkAccountSessionsSession = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_financial_connections_session> - | Response + | Res<200, t_financial_connections_session> + | Res | typeof SkipResponse > @@ -8290,7 +8290,7 @@ export type GetLinkedAccounts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_financial_connections_account[] @@ -8299,7 +8299,7 @@ export type GetLinkedAccounts = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -8320,8 +8320,8 @@ export type GetLinkedAccountsAccount = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_financial_connections_account> - | Response + | Res<200, t_financial_connections_account> + | Res | typeof SkipResponse > @@ -8342,8 +8342,8 @@ export type PostLinkedAccountsAccountDisconnect = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_financial_connections_account> - | Response + | Res<200, t_financial_connections_account> + | Res | typeof SkipResponse > @@ -8369,7 +8369,7 @@ export type GetLinkedAccountsAccountOwners = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_financial_connections_account_owner[] @@ -8378,7 +8378,7 @@ export type GetLinkedAccountsAccountOwners = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -8399,8 +8399,8 @@ export type PostLinkedAccountsAccountRefresh = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_financial_connections_account> - | Response + | Res<200, t_financial_connections_account> + | Res | typeof SkipResponse > @@ -8421,8 +8421,8 @@ export type GetMandatesMandate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_mandate> - | Response + | Res<200, t_mandate> + | Res | typeof SkipResponse > @@ -8443,7 +8443,7 @@ export type GetPaymentIntents = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_payment_intent[] @@ -8452,7 +8452,7 @@ export type GetPaymentIntents = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -8468,8 +8468,8 @@ export type PostPaymentIntents = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_intent> - | Response + | Res<200, t_payment_intent> + | Res | typeof SkipResponse > @@ -8492,7 +8492,7 @@ export type GetPaymentIntentsSearch = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_payment_intent[] @@ -8503,7 +8503,7 @@ export type GetPaymentIntentsSearch = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -8524,8 +8524,8 @@ export type GetPaymentIntentsIntent = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_intent> - | Response + | Res<200, t_payment_intent> + | Res | typeof SkipResponse > @@ -8546,8 +8546,8 @@ export type PostPaymentIntentsIntent = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_intent> - | Response + | Res<200, t_payment_intent> + | Res | typeof SkipResponse > @@ -8568,8 +8568,8 @@ export type PostPaymentIntentsIntentApplyCustomerBalance = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_intent> - | Response + | Res<200, t_payment_intent> + | Res | typeof SkipResponse > @@ -8590,8 +8590,8 @@ export type PostPaymentIntentsIntentCancel = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_intent> - | Response + | Res<200, t_payment_intent> + | Res | typeof SkipResponse > @@ -8612,8 +8612,8 @@ export type PostPaymentIntentsIntentCapture = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_intent> - | Response + | Res<200, t_payment_intent> + | Res | typeof SkipResponse > @@ -8634,8 +8634,8 @@ export type PostPaymentIntentsIntentConfirm = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_intent> - | Response + | Res<200, t_payment_intent> + | Res | typeof SkipResponse > @@ -8656,8 +8656,8 @@ export type PostPaymentIntentsIntentIncrementAuthorization = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_intent> - | Response + | Res<200, t_payment_intent> + | Res | typeof SkipResponse > @@ -8678,8 +8678,8 @@ export type PostPaymentIntentsIntentVerifyMicrodeposits = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_intent> - | Response + | Res<200, t_payment_intent> + | Res | typeof SkipResponse > @@ -8700,7 +8700,7 @@ export type GetPaymentLinks = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_payment_link[] @@ -8709,7 +8709,7 @@ export type GetPaymentLinks = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -8725,8 +8725,8 @@ export type PostPaymentLinks = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_link> - | Response + | Res<200, t_payment_link> + | Res | typeof SkipResponse > @@ -8747,8 +8747,8 @@ export type GetPaymentLinksPaymentLink = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_link> - | Response + | Res<200, t_payment_link> + | Res | typeof SkipResponse > @@ -8769,8 +8769,8 @@ export type PostPaymentLinksPaymentLink = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_link> - | Response + | Res<200, t_payment_link> + | Res | typeof SkipResponse > @@ -8796,7 +8796,7 @@ export type GetPaymentLinksPaymentLinkLineItems = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_item[] @@ -8805,7 +8805,7 @@ export type GetPaymentLinksPaymentLinkLineItems = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -8826,7 +8826,7 @@ export type GetPaymentMethodConfigurations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_payment_method_configuration[] @@ -8835,7 +8835,7 @@ export type GetPaymentMethodConfigurations = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -8856,8 +8856,8 @@ export type PostPaymentMethodConfigurations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_method_configuration> - | Response + | Res<200, t_payment_method_configuration> + | Res | typeof SkipResponse > @@ -8878,8 +8878,8 @@ export type GetPaymentMethodConfigurationsConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_method_configuration> - | Response + | Res<200, t_payment_method_configuration> + | Res | typeof SkipResponse > @@ -8900,8 +8900,8 @@ export type PostPaymentMethodConfigurationsConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_method_configuration> - | Response + | Res<200, t_payment_method_configuration> + | Res | typeof SkipResponse > @@ -8922,7 +8922,7 @@ export type GetPaymentMethodDomains = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_payment_method_domain[] @@ -8931,7 +8931,7 @@ export type GetPaymentMethodDomains = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -8947,8 +8947,8 @@ export type PostPaymentMethodDomains = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_method_domain> - | Response + | Res<200, t_payment_method_domain> + | Res | typeof SkipResponse > @@ -8969,8 +8969,8 @@ export type GetPaymentMethodDomainsPaymentMethodDomain = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_method_domain> - | Response + | Res<200, t_payment_method_domain> + | Res | typeof SkipResponse > @@ -8991,8 +8991,8 @@ export type PostPaymentMethodDomainsPaymentMethodDomain = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_method_domain> - | Response + | Res<200, t_payment_method_domain> + | Res | typeof SkipResponse > @@ -9014,8 +9014,8 @@ export type PostPaymentMethodDomainsPaymentMethodDomainValidate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_method_domain> - | Response + | Res<200, t_payment_method_domain> + | Res | typeof SkipResponse > @@ -9036,7 +9036,7 @@ export type GetPaymentMethods = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_payment_method[] @@ -9045,7 +9045,7 @@ export type GetPaymentMethods = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -9061,8 +9061,8 @@ export type PostPaymentMethods = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_method> - | Response + | Res<200, t_payment_method> + | Res | typeof SkipResponse > @@ -9083,8 +9083,8 @@ export type GetPaymentMethodsPaymentMethod = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_method> - | Response + | Res<200, t_payment_method> + | Res | typeof SkipResponse > @@ -9105,8 +9105,8 @@ export type PostPaymentMethodsPaymentMethod = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_method> - | Response + | Res<200, t_payment_method> + | Res | typeof SkipResponse > @@ -9127,8 +9127,8 @@ export type PostPaymentMethodsPaymentMethodAttach = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_method> - | Response + | Res<200, t_payment_method> + | Res | typeof SkipResponse > @@ -9149,8 +9149,8 @@ export type PostPaymentMethodsPaymentMethodDetach = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payment_method> - | Response + | Res<200, t_payment_method> + | Res | typeof SkipResponse > @@ -9171,7 +9171,7 @@ export type GetPayouts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_payout[] @@ -9180,7 +9180,7 @@ export type GetPayouts = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -9196,8 +9196,8 @@ export type PostPayouts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payout> - | Response + | Res<200, t_payout> + | Res | typeof SkipResponse > @@ -9218,8 +9218,8 @@ export type GetPayoutsPayout = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payout> - | Response + | Res<200, t_payout> + | Res | typeof SkipResponse > @@ -9240,8 +9240,8 @@ export type PostPayoutsPayout = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payout> - | Response + | Res<200, t_payout> + | Res | typeof SkipResponse > @@ -9262,8 +9262,8 @@ export type PostPayoutsPayoutCancel = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payout> - | Response + | Res<200, t_payout> + | Res | typeof SkipResponse > @@ -9284,8 +9284,8 @@ export type PostPayoutsPayoutReverse = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_payout> - | Response + | Res<200, t_payout> + | Res | typeof SkipResponse > @@ -9306,7 +9306,7 @@ export type GetPlans = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_plan[] @@ -9315,7 +9315,7 @@ export type GetPlans = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -9331,8 +9331,8 @@ export type PostPlans = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_plan> - | Response + | Res<200, t_plan> + | Res | typeof SkipResponse > @@ -9348,8 +9348,8 @@ export type DeletePlansPlan = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_plan> - | Response + | Res<200, t_deleted_plan> + | Res | typeof SkipResponse > @@ -9370,8 +9370,8 @@ export type GetPlansPlan = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_plan> - | Response + | Res<200, t_plan> + | Res | typeof SkipResponse > @@ -9392,8 +9392,8 @@ export type PostPlansPlan = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_plan> - | Response + | Res<200, t_plan> + | Res | typeof SkipResponse > @@ -9414,7 +9414,7 @@ export type GetPrices = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_price[] @@ -9423,7 +9423,7 @@ export type GetPrices = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -9439,8 +9439,8 @@ export type PostPrices = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_price> - | Response + | Res<200, t_price> + | Res | typeof SkipResponse > @@ -9463,7 +9463,7 @@ export type GetPricesSearch = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_price[] @@ -9474,7 +9474,7 @@ export type GetPricesSearch = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -9495,8 +9495,8 @@ export type GetPricesPrice = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_price> - | Response + | Res<200, t_price> + | Res | typeof SkipResponse > @@ -9517,8 +9517,8 @@ export type PostPricesPrice = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_price> - | Response + | Res<200, t_price> + | Res | typeof SkipResponse > @@ -9539,7 +9539,7 @@ export type GetProducts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_product[] @@ -9548,7 +9548,7 @@ export type GetProducts = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -9564,8 +9564,8 @@ export type PostProducts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_product> - | Response + | Res<200, t_product> + | Res | typeof SkipResponse > @@ -9588,7 +9588,7 @@ export type GetProductsSearch = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_product[] @@ -9599,7 +9599,7 @@ export type GetProductsSearch = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -9615,8 +9615,8 @@ export type DeleteProductsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_product> - | Response + | Res<200, t_deleted_product> + | Res | typeof SkipResponse > @@ -9637,8 +9637,8 @@ export type GetProductsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_product> - | Response + | Res<200, t_product> + | Res | typeof SkipResponse > @@ -9659,8 +9659,8 @@ export type PostProductsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_product> - | Response + | Res<200, t_product> + | Res | typeof SkipResponse > @@ -9686,7 +9686,7 @@ export type GetProductsProductFeatures = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_product_feature[] @@ -9695,7 +9695,7 @@ export type GetProductsProductFeatures = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -9716,8 +9716,8 @@ export type PostProductsProductFeatures = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_product_feature> - | Response + | Res<200, t_product_feature> + | Res | typeof SkipResponse > @@ -9738,8 +9738,8 @@ export type DeleteProductsProductFeaturesId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_product_feature> - | Response + | Res<200, t_deleted_product_feature> + | Res | typeof SkipResponse > @@ -9760,8 +9760,8 @@ export type GetProductsProductFeaturesId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_product_feature> - | Response + | Res<200, t_product_feature> + | Res | typeof SkipResponse > @@ -9782,7 +9782,7 @@ export type GetPromotionCodes = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_promotion_code[] @@ -9791,7 +9791,7 @@ export type GetPromotionCodes = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -9807,8 +9807,8 @@ export type PostPromotionCodes = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_promotion_code> - | Response + | Res<200, t_promotion_code> + | Res | typeof SkipResponse > @@ -9829,8 +9829,8 @@ export type GetPromotionCodesPromotionCode = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_promotion_code> - | Response + | Res<200, t_promotion_code> + | Res | typeof SkipResponse > @@ -9851,8 +9851,8 @@ export type PostPromotionCodesPromotionCode = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_promotion_code> - | Response + | Res<200, t_promotion_code> + | Res | typeof SkipResponse > @@ -9873,7 +9873,7 @@ export type GetQuotes = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_quote[] @@ -9882,7 +9882,7 @@ export type GetQuotes = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -9898,8 +9898,8 @@ export type PostQuotes = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_quote> - | Response + | Res<200, t_quote> + | Res | typeof SkipResponse > @@ -9920,8 +9920,8 @@ export type GetQuotesQuote = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_quote> - | Response + | Res<200, t_quote> + | Res | typeof SkipResponse > @@ -9942,8 +9942,8 @@ export type PostQuotesQuote = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_quote> - | Response + | Res<200, t_quote> + | Res | typeof SkipResponse > @@ -9964,8 +9964,8 @@ export type PostQuotesQuoteAccept = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_quote> - | Response + | Res<200, t_quote> + | Res | typeof SkipResponse > @@ -9986,8 +9986,8 @@ export type PostQuotesQuoteCancel = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_quote> - | Response + | Res<200, t_quote> + | Res | typeof SkipResponse > @@ -10013,7 +10013,7 @@ export type GetQuotesQuoteComputedUpfrontLineItems = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_item[] @@ -10022,7 +10022,7 @@ export type GetQuotesQuoteComputedUpfrontLineItems = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -10043,8 +10043,8 @@ export type PostQuotesQuoteFinalize = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_quote> - | Response + | Res<200, t_quote> + | Res | typeof SkipResponse > @@ -10070,7 +10070,7 @@ export type GetQuotesQuoteLineItems = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_item[] @@ -10079,7 +10079,7 @@ export type GetQuotesQuoteLineItems = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -10100,8 +10100,8 @@ export type GetQuotesQuotePdf = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, string> - | Response + | Res<200, string> + | Res | typeof SkipResponse > @@ -10122,7 +10122,7 @@ export type GetRadarEarlyFraudWarnings = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_radar_early_fraud_warning[] @@ -10131,7 +10131,7 @@ export type GetRadarEarlyFraudWarnings = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -10152,8 +10152,8 @@ export type GetRadarEarlyFraudWarningsEarlyFraudWarning = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_radar_early_fraud_warning> - | Response + | Res<200, t_radar_early_fraud_warning> + | Res | typeof SkipResponse > @@ -10174,7 +10174,7 @@ export type GetRadarValueListItems = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_radar_value_list_item[] @@ -10183,7 +10183,7 @@ export type GetRadarValueListItems = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -10199,8 +10199,8 @@ export type PostRadarValueListItems = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_radar_value_list_item> - | Response + | Res<200, t_radar_value_list_item> + | Res | typeof SkipResponse > @@ -10216,8 +10216,8 @@ export type DeleteRadarValueListItemsItem = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_radar_value_list_item> - | Response + | Res<200, t_deleted_radar_value_list_item> + | Res | typeof SkipResponse > @@ -10238,8 +10238,8 @@ export type GetRadarValueListItemsItem = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_radar_value_list_item> - | Response + | Res<200, t_radar_value_list_item> + | Res | typeof SkipResponse > @@ -10260,7 +10260,7 @@ export type GetRadarValueLists = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_radar_value_list[] @@ -10269,7 +10269,7 @@ export type GetRadarValueLists = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -10285,8 +10285,8 @@ export type PostRadarValueLists = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_radar_value_list> - | Response + | Res<200, t_radar_value_list> + | Res | typeof SkipResponse > @@ -10302,8 +10302,8 @@ export type DeleteRadarValueListsValueList = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_radar_value_list> - | Response + | Res<200, t_deleted_radar_value_list> + | Res | typeof SkipResponse > @@ -10324,8 +10324,8 @@ export type GetRadarValueListsValueList = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_radar_value_list> - | Response + | Res<200, t_radar_value_list> + | Res | typeof SkipResponse > @@ -10346,8 +10346,8 @@ export type PostRadarValueListsValueList = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_radar_value_list> - | Response + | Res<200, t_radar_value_list> + | Res | typeof SkipResponse > @@ -10368,7 +10368,7 @@ export type GetRefunds = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_refund[] @@ -10377,7 +10377,7 @@ export type GetRefunds = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -10393,8 +10393,8 @@ export type PostRefunds = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_refund> - | Response + | Res<200, t_refund> + | Res | typeof SkipResponse > @@ -10415,8 +10415,8 @@ export type GetRefundsRefund = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_refund> - | Response + | Res<200, t_refund> + | Res | typeof SkipResponse > @@ -10437,8 +10437,8 @@ export type PostRefundsRefund = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_refund> - | Response + | Res<200, t_refund> + | Res | typeof SkipResponse > @@ -10459,8 +10459,8 @@ export type PostRefundsRefundCancel = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_refund> - | Response + | Res<200, t_refund> + | Res | typeof SkipResponse > @@ -10481,7 +10481,7 @@ export type GetReportingReportRuns = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_reporting_report_run[] @@ -10490,7 +10490,7 @@ export type GetReportingReportRuns = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -10506,8 +10506,8 @@ export type PostReportingReportRuns = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_reporting_report_run> - | Response + | Res<200, t_reporting_report_run> + | Res | typeof SkipResponse > @@ -10528,8 +10528,8 @@ export type GetReportingReportRunsReportRun = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_reporting_report_run> - | Response + | Res<200, t_reporting_report_run> + | Res | typeof SkipResponse > @@ -10550,7 +10550,7 @@ export type GetReportingReportTypes = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_reporting_report_type[] @@ -10559,7 +10559,7 @@ export type GetReportingReportTypes = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -10580,8 +10580,8 @@ export type GetReportingReportTypesReportType = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_reporting_report_type> - | Response + | Res<200, t_reporting_report_type> + | Res | typeof SkipResponse > @@ -10602,7 +10602,7 @@ export type GetReviews = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_review[] @@ -10611,7 +10611,7 @@ export type GetReviews = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -10632,8 +10632,8 @@ export type GetReviewsReview = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_review> - | Response + | Res<200, t_review> + | Res | typeof SkipResponse > @@ -10654,8 +10654,8 @@ export type PostReviewsReviewApprove = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_review> - | Response + | Res<200, t_review> + | Res | typeof SkipResponse > @@ -10676,7 +10676,7 @@ export type GetSetupAttempts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_setup_attempt[] @@ -10685,7 +10685,7 @@ export type GetSetupAttempts = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -10706,7 +10706,7 @@ export type GetSetupIntents = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_setup_intent[] @@ -10715,7 +10715,7 @@ export type GetSetupIntents = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -10731,8 +10731,8 @@ export type PostSetupIntents = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_setup_intent> - | Response + | Res<200, t_setup_intent> + | Res | typeof SkipResponse > @@ -10753,8 +10753,8 @@ export type GetSetupIntentsIntent = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_setup_intent> - | Response + | Res<200, t_setup_intent> + | Res | typeof SkipResponse > @@ -10775,8 +10775,8 @@ export type PostSetupIntentsIntent = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_setup_intent> - | Response + | Res<200, t_setup_intent> + | Res | typeof SkipResponse > @@ -10797,8 +10797,8 @@ export type PostSetupIntentsIntentCancel = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_setup_intent> - | Response + | Res<200, t_setup_intent> + | Res | typeof SkipResponse > @@ -10819,8 +10819,8 @@ export type PostSetupIntentsIntentConfirm = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_setup_intent> - | Response + | Res<200, t_setup_intent> + | Res | typeof SkipResponse > @@ -10841,8 +10841,8 @@ export type PostSetupIntentsIntentVerifyMicrodeposits = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_setup_intent> - | Response + | Res<200, t_setup_intent> + | Res | typeof SkipResponse > @@ -10863,7 +10863,7 @@ export type GetShippingRates = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_shipping_rate[] @@ -10872,7 +10872,7 @@ export type GetShippingRates = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -10888,8 +10888,8 @@ export type PostShippingRates = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_shipping_rate> - | Response + | Res<200, t_shipping_rate> + | Res | typeof SkipResponse > @@ -10910,8 +10910,8 @@ export type GetShippingRatesShippingRateToken = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_shipping_rate> - | Response + | Res<200, t_shipping_rate> + | Res | typeof SkipResponse > @@ -10932,8 +10932,8 @@ export type PostShippingRatesShippingRateToken = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_shipping_rate> - | Response + | Res<200, t_shipping_rate> + | Res | typeof SkipResponse > @@ -10954,8 +10954,8 @@ export type PostSigmaSavedQueriesId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_sigma_sigma_api_query> - | Response + | Res<200, t_sigma_sigma_api_query> + | Res | typeof SkipResponse > @@ -10976,7 +10976,7 @@ export type GetSigmaScheduledQueryRuns = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_scheduled_query_run[] @@ -10985,7 +10985,7 @@ export type GetSigmaScheduledQueryRuns = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -11006,8 +11006,8 @@ export type GetSigmaScheduledQueryRunsScheduledQueryRun = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_scheduled_query_run> - | Response + | Res<200, t_scheduled_query_run> + | Res | typeof SkipResponse > @@ -11023,8 +11023,8 @@ export type PostSources = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_source> - | Response + | Res<200, t_source> + | Res | typeof SkipResponse > @@ -11045,8 +11045,8 @@ export type GetSourcesSource = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_source> - | Response + | Res<200, t_source> + | Res | typeof SkipResponse > @@ -11067,8 +11067,8 @@ export type PostSourcesSource = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_source> - | Response + | Res<200, t_source> + | Res | typeof SkipResponse > @@ -11089,8 +11089,8 @@ export type GetSourcesSourceMandateNotificationsMandateNotification = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_source_mandate_notification> - | Response + | Res<200, t_source_mandate_notification> + | Res | typeof SkipResponse > @@ -11116,7 +11116,7 @@ export type GetSourcesSourceSourceTransactions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_source_transaction[] @@ -11125,7 +11125,7 @@ export type GetSourcesSourceSourceTransactions = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -11146,8 +11146,8 @@ export type GetSourcesSourceSourceTransactionsSourceTransaction = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_source_transaction> - | Response + | Res<200, t_source_transaction> + | Res | typeof SkipResponse > @@ -11168,8 +11168,8 @@ export type PostSourcesSourceVerify = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_source> - | Response + | Res<200, t_source> + | Res | typeof SkipResponse > @@ -11190,7 +11190,7 @@ export type GetSubscriptionItems = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_subscription_item[] @@ -11199,7 +11199,7 @@ export type GetSubscriptionItems = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -11215,8 +11215,8 @@ export type PostSubscriptionItems = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription_item> - | Response + | Res<200, t_subscription_item> + | Res | typeof SkipResponse > @@ -11237,8 +11237,8 @@ export type DeleteSubscriptionItemsItem = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_subscription_item> - | Response + | Res<200, t_deleted_subscription_item> + | Res | typeof SkipResponse > @@ -11259,8 +11259,8 @@ export type GetSubscriptionItemsItem = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription_item> - | Response + | Res<200, t_subscription_item> + | Res | typeof SkipResponse > @@ -11281,8 +11281,8 @@ export type PostSubscriptionItemsItem = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription_item> - | Response + | Res<200, t_subscription_item> + | Res | typeof SkipResponse > @@ -11303,7 +11303,7 @@ export type GetSubscriptionSchedules = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_subscription_schedule[] @@ -11312,7 +11312,7 @@ export type GetSubscriptionSchedules = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -11333,8 +11333,8 @@ export type PostSubscriptionSchedules = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription_schedule> - | Response + | Res<200, t_subscription_schedule> + | Res | typeof SkipResponse > @@ -11355,8 +11355,8 @@ export type GetSubscriptionSchedulesSchedule = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription_schedule> - | Response + | Res<200, t_subscription_schedule> + | Res | typeof SkipResponse > @@ -11377,8 +11377,8 @@ export type PostSubscriptionSchedulesSchedule = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription_schedule> - | Response + | Res<200, t_subscription_schedule> + | Res | typeof SkipResponse > @@ -11399,8 +11399,8 @@ export type PostSubscriptionSchedulesScheduleCancel = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription_schedule> - | Response + | Res<200, t_subscription_schedule> + | Res | typeof SkipResponse > @@ -11421,8 +11421,8 @@ export type PostSubscriptionSchedulesScheduleRelease = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription_schedule> - | Response + | Res<200, t_subscription_schedule> + | Res | typeof SkipResponse > @@ -11443,7 +11443,7 @@ export type GetSubscriptions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_subscription[] @@ -11452,7 +11452,7 @@ export type GetSubscriptions = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -11468,8 +11468,8 @@ export type PostSubscriptions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription> - | Response + | Res<200, t_subscription> + | Res | typeof SkipResponse > @@ -11492,7 +11492,7 @@ export type GetSubscriptionsSearch = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_subscription[] @@ -11503,7 +11503,7 @@ export type GetSubscriptionsSearch = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -11524,8 +11524,8 @@ export type DeleteSubscriptionsSubscriptionExposedId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription> - | Response + | Res<200, t_subscription> + | Res | typeof SkipResponse > @@ -11546,8 +11546,8 @@ export type GetSubscriptionsSubscriptionExposedId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription> - | Response + | Res<200, t_subscription> + | Res | typeof SkipResponse > @@ -11568,8 +11568,8 @@ export type PostSubscriptionsSubscriptionExposedId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription> - | Response + | Res<200, t_subscription> + | Res | typeof SkipResponse > @@ -11590,8 +11590,8 @@ export type DeleteSubscriptionsSubscriptionExposedIdDiscount = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_discount> - | Response + | Res<200, t_deleted_discount> + | Res | typeof SkipResponse > @@ -11612,8 +11612,8 @@ export type PostSubscriptionsSubscriptionMigrate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription> - | Response + | Res<200, t_subscription> + | Res | typeof SkipResponse > @@ -11634,8 +11634,8 @@ export type PostSubscriptionsSubscriptionResume = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_subscription> - | Response + | Res<200, t_subscription> + | Res | typeof SkipResponse > @@ -11651,8 +11651,8 @@ export type PostTaxCalculations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_calculation> - | Response + | Res<200, t_tax_calculation> + | Res | typeof SkipResponse > @@ -11673,8 +11673,8 @@ export type GetTaxCalculationsCalculation = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_calculation> - | Response + | Res<200, t_tax_calculation> + | Res | typeof SkipResponse > @@ -11700,7 +11700,7 @@ export type GetTaxCalculationsCalculationLineItems = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_tax_calculation_line_item[] @@ -11709,7 +11709,7 @@ export type GetTaxCalculationsCalculationLineItems = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -11730,7 +11730,7 @@ export type GetTaxRegistrations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_tax_registration[] @@ -11739,7 +11739,7 @@ export type GetTaxRegistrations = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -11755,8 +11755,8 @@ export type PostTaxRegistrations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_registration> - | Response + | Res<200, t_tax_registration> + | Res | typeof SkipResponse > @@ -11777,8 +11777,8 @@ export type GetTaxRegistrationsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_registration> - | Response + | Res<200, t_tax_registration> + | Res | typeof SkipResponse > @@ -11799,8 +11799,8 @@ export type PostTaxRegistrationsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_registration> - | Response + | Res<200, t_tax_registration> + | Res | typeof SkipResponse > @@ -11816,8 +11816,8 @@ export type GetTaxSettings = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_settings> - | Response + | Res<200, t_tax_settings> + | Res | typeof SkipResponse > @@ -11833,8 +11833,8 @@ export type PostTaxSettings = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_settings> - | Response + | Res<200, t_tax_settings> + | Res | typeof SkipResponse > @@ -11855,8 +11855,8 @@ export type PostTaxTransactionsCreateFromCalculation = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_transaction> - | Response + | Res<200, t_tax_transaction> + | Res | typeof SkipResponse > @@ -11877,8 +11877,8 @@ export type PostTaxTransactionsCreateReversal = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_transaction> - | Response + | Res<200, t_tax_transaction> + | Res | typeof SkipResponse > @@ -11899,8 +11899,8 @@ export type GetTaxTransactionsTransaction = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_transaction> - | Response + | Res<200, t_tax_transaction> + | Res | typeof SkipResponse > @@ -11926,7 +11926,7 @@ export type GetTaxTransactionsTransactionLineItems = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_tax_transaction_line_item[] @@ -11935,7 +11935,7 @@ export type GetTaxTransactionsTransactionLineItems = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -11956,7 +11956,7 @@ export type GetTaxCodes = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_tax_code[] @@ -11965,7 +11965,7 @@ export type GetTaxCodes = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -11986,8 +11986,8 @@ export type GetTaxCodesId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_code> - | Response + | Res<200, t_tax_code> + | Res | typeof SkipResponse > @@ -12008,7 +12008,7 @@ export type GetTaxIds = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_tax_id[] @@ -12017,7 +12017,7 @@ export type GetTaxIds = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -12033,8 +12033,8 @@ export type PostTaxIds = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_id> - | Response + | Res<200, t_tax_id> + | Res | typeof SkipResponse > @@ -12050,8 +12050,8 @@ export type DeleteTaxIdsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_tax_id> - | Response + | Res<200, t_deleted_tax_id> + | Res | typeof SkipResponse > @@ -12072,8 +12072,8 @@ export type GetTaxIdsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_id> - | Response + | Res<200, t_tax_id> + | Res | typeof SkipResponse > @@ -12094,7 +12094,7 @@ export type GetTaxRates = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_tax_rate[] @@ -12103,7 +12103,7 @@ export type GetTaxRates = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -12119,8 +12119,8 @@ export type PostTaxRates = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_rate> - | Response + | Res<200, t_tax_rate> + | Res | typeof SkipResponse > @@ -12141,8 +12141,8 @@ export type GetTaxRatesTaxRate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_rate> - | Response + | Res<200, t_tax_rate> + | Res | typeof SkipResponse > @@ -12163,8 +12163,8 @@ export type PostTaxRatesTaxRate = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_tax_rate> - | Response + | Res<200, t_tax_rate> + | Res | typeof SkipResponse > @@ -12185,7 +12185,7 @@ export type GetTerminalConfigurations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_terminal_configuration[] @@ -12194,7 +12194,7 @@ export type GetTerminalConfigurations = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -12215,8 +12215,8 @@ export type PostTerminalConfigurations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_configuration> - | Response + | Res<200, t_terminal_configuration> + | Res | typeof SkipResponse > @@ -12237,8 +12237,8 @@ export type DeleteTerminalConfigurationsConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_terminal_configuration> - | Response + | Res<200, t_deleted_terminal_configuration> + | Res | typeof SkipResponse > @@ -12261,8 +12261,8 @@ export type GetTerminalConfigurationsConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_configuration | t_deleted_terminal_configuration> - | Response + | Res<200, t_terminal_configuration | t_deleted_terminal_configuration> + | Res | typeof SkipResponse > @@ -12285,8 +12285,8 @@ export type PostTerminalConfigurationsConfiguration = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_configuration | t_deleted_terminal_configuration> - | Response + | Res<200, t_terminal_configuration | t_deleted_terminal_configuration> + | Res | typeof SkipResponse > @@ -12307,8 +12307,8 @@ export type PostTerminalConnectionTokens = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_connection_token> - | Response + | Res<200, t_terminal_connection_token> + | Res | typeof SkipResponse > @@ -12329,7 +12329,7 @@ export type GetTerminalLocations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_terminal_location[] @@ -12338,7 +12338,7 @@ export type GetTerminalLocations = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -12354,8 +12354,8 @@ export type PostTerminalLocations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_location> - | Response + | Res<200, t_terminal_location> + | Res | typeof SkipResponse > @@ -12376,8 +12376,8 @@ export type DeleteTerminalLocationsLocation = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_terminal_location> - | Response + | Res<200, t_deleted_terminal_location> + | Res | typeof SkipResponse > @@ -12400,8 +12400,8 @@ export type GetTerminalLocationsLocation = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_location | t_deleted_terminal_location> - | Response + | Res<200, t_terminal_location | t_deleted_terminal_location> + | Res | typeof SkipResponse > @@ -12424,8 +12424,8 @@ export type PostTerminalLocationsLocation = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_location | t_deleted_terminal_location> - | Response + | Res<200, t_terminal_location | t_deleted_terminal_location> + | Res | typeof SkipResponse > @@ -12446,7 +12446,7 @@ export type GetTerminalReaders = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_terminal_reader[] @@ -12455,7 +12455,7 @@ export type GetTerminalReaders = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -12471,8 +12471,8 @@ export type PostTerminalReaders = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_reader> - | Response + | Res<200, t_terminal_reader> + | Res | typeof SkipResponse > @@ -12488,8 +12488,8 @@ export type DeleteTerminalReadersReader = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_terminal_reader> - | Response + | Res<200, t_deleted_terminal_reader> + | Res | typeof SkipResponse > @@ -12510,8 +12510,8 @@ export type GetTerminalReadersReader = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_reader | t_deleted_terminal_reader> - | Response + | Res<200, t_terminal_reader | t_deleted_terminal_reader> + | Res | typeof SkipResponse > @@ -12532,8 +12532,8 @@ export type PostTerminalReadersReader = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_reader | t_deleted_terminal_reader> - | Response + | Res<200, t_terminal_reader | t_deleted_terminal_reader> + | Res | typeof SkipResponse > @@ -12554,8 +12554,8 @@ export type PostTerminalReadersReaderCancelAction = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_reader> - | Response + | Res<200, t_terminal_reader> + | Res | typeof SkipResponse > @@ -12576,8 +12576,8 @@ export type PostTerminalReadersReaderCollectInputs = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_reader> - | Response + | Res<200, t_terminal_reader> + | Res | typeof SkipResponse > @@ -12598,8 +12598,8 @@ export type PostTerminalReadersReaderCollectPaymentMethod = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_reader> - | Response + | Res<200, t_terminal_reader> + | Res | typeof SkipResponse > @@ -12620,8 +12620,8 @@ export type PostTerminalReadersReaderConfirmPaymentIntent = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_reader> - | Response + | Res<200, t_terminal_reader> + | Res | typeof SkipResponse > @@ -12642,8 +12642,8 @@ export type PostTerminalReadersReaderProcessPaymentIntent = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_reader> - | Response + | Res<200, t_terminal_reader> + | Res | typeof SkipResponse > @@ -12664,8 +12664,8 @@ export type PostTerminalReadersReaderProcessSetupIntent = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_reader> - | Response + | Res<200, t_terminal_reader> + | Res | typeof SkipResponse > @@ -12686,8 +12686,8 @@ export type PostTerminalReadersReaderRefundPayment = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_reader> - | Response + | Res<200, t_terminal_reader> + | Res | typeof SkipResponse > @@ -12708,8 +12708,8 @@ export type PostTerminalReadersReaderSetReaderDisplay = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_reader> - | Response + | Res<200, t_terminal_reader> + | Res | typeof SkipResponse > @@ -12730,8 +12730,8 @@ export type PostTestHelpersConfirmationTokens = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_confirmation_token> - | Response + | Res<200, t_confirmation_token> + | Res | typeof SkipResponse > @@ -12752,8 +12752,8 @@ export type PostTestHelpersCustomersCustomerFundCashBalance = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_customer_cash_balance_transaction> - | Response + | Res<200, t_customer_cash_balance_transaction> + | Res | typeof SkipResponse > @@ -12774,8 +12774,8 @@ export type PostTestHelpersIssuingAuthorizations = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_authorization> - | Response + | Res<200, t_issuing_authorization> + | Res | typeof SkipResponse > @@ -12798,8 +12798,8 @@ export type PostTestHelpersIssuingAuthorizationsAuthorizationCapture = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_authorization> - | Response + | Res<200, t_issuing_authorization> + | Res | typeof SkipResponse > @@ -12821,8 +12821,8 @@ export type PostTestHelpersIssuingAuthorizationsAuthorizationExpire = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_authorization> - | Response + | Res<200, t_issuing_authorization> + | Res | typeof SkipResponse > @@ -12844,8 +12844,8 @@ export type PostTestHelpersIssuingAuthorizationsAuthorizationFinalizeAmount = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_authorization> - | Response + | Res<200, t_issuing_authorization> + | Res | typeof SkipResponse > @@ -12868,8 +12868,8 @@ export type PostTestHelpersIssuingAuthorizationsAuthorizationFraudChallengesResp next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_authorization> - | Response + | Res<200, t_issuing_authorization> + | Res | typeof SkipResponse > @@ -12891,8 +12891,8 @@ export type PostTestHelpersIssuingAuthorizationsAuthorizationIncrement = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_authorization> - | Response + | Res<200, t_issuing_authorization> + | Res | typeof SkipResponse > @@ -12915,8 +12915,8 @@ export type PostTestHelpersIssuingAuthorizationsAuthorizationReverse = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_authorization> - | Response + | Res<200, t_issuing_authorization> + | Res | typeof SkipResponse > @@ -12937,8 +12937,8 @@ export type PostTestHelpersIssuingCardsCardShippingDeliver = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_card> - | Response + | Res<200, t_issuing_card> + | Res | typeof SkipResponse > @@ -12959,8 +12959,8 @@ export type PostTestHelpersIssuingCardsCardShippingFail = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_card> - | Response + | Res<200, t_issuing_card> + | Res | typeof SkipResponse > @@ -12981,8 +12981,8 @@ export type PostTestHelpersIssuingCardsCardShippingReturn = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_card> - | Response + | Res<200, t_issuing_card> + | Res | typeof SkipResponse > @@ -13003,8 +13003,8 @@ export type PostTestHelpersIssuingCardsCardShippingShip = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_card> - | Response + | Res<200, t_issuing_card> + | Res | typeof SkipResponse > @@ -13025,8 +13025,8 @@ export type PostTestHelpersIssuingCardsCardShippingSubmit = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_card> - | Response + | Res<200, t_issuing_card> + | Res | typeof SkipResponse > @@ -13050,8 +13050,8 @@ export type PostTestHelpersIssuingPersonalizationDesignsPersonalizationDesignAct next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_personalization_design> - | Response + | Res<200, t_issuing_personalization_design> + | Res | typeof SkipResponse > @@ -13075,8 +13075,8 @@ export type PostTestHelpersIssuingPersonalizationDesignsPersonalizationDesignDea next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_personalization_design> - | Response + | Res<200, t_issuing_personalization_design> + | Res | typeof SkipResponse > @@ -13099,8 +13099,8 @@ export type PostTestHelpersIssuingPersonalizationDesignsPersonalizationDesignRej next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_personalization_design> - | Response + | Res<200, t_issuing_personalization_design> + | Res | typeof SkipResponse > @@ -13121,8 +13121,8 @@ export type PostTestHelpersIssuingSettlements = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_settlement> - | Response + | Res<200, t_issuing_settlement> + | Res | typeof SkipResponse > @@ -13144,8 +13144,8 @@ export type PostTestHelpersIssuingSettlementsSettlementComplete = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_settlement> - | Response + | Res<200, t_issuing_settlement> + | Res | typeof SkipResponse > @@ -13166,8 +13166,8 @@ export type PostTestHelpersIssuingTransactionsCreateForceCapture = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_transaction> - | Response + | Res<200, t_issuing_transaction> + | Res | typeof SkipResponse > @@ -13188,8 +13188,8 @@ export type PostTestHelpersIssuingTransactionsCreateUnlinkedRefund = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_transaction> - | Response + | Res<200, t_issuing_transaction> + | Res | typeof SkipResponse > @@ -13211,8 +13211,8 @@ export type PostTestHelpersIssuingTransactionsTransactionRefund = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_issuing_transaction> - | Response + | Res<200, t_issuing_transaction> + | Res | typeof SkipResponse > @@ -13233,8 +13233,8 @@ export type PostTestHelpersRefundsRefundExpire = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_refund> - | Response + | Res<200, t_refund> + | Res | typeof SkipResponse > @@ -13257,8 +13257,8 @@ export type PostTestHelpersTerminalReadersReaderPresentPaymentMethod = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_reader> - | Response + | Res<200, t_terminal_reader> + | Res | typeof SkipResponse > @@ -13281,8 +13281,8 @@ export type PostTestHelpersTerminalReadersReaderSucceedInputCollection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_reader> - | Response + | Res<200, t_terminal_reader> + | Res | typeof SkipResponse > @@ -13305,8 +13305,8 @@ export type PostTestHelpersTerminalReadersReaderTimeoutInputCollection = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_terminal_reader> - | Response + | Res<200, t_terminal_reader> + | Res | typeof SkipResponse > @@ -13327,7 +13327,7 @@ export type GetTestHelpersTestClocks = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_test_helpers_test_clock[] @@ -13336,7 +13336,7 @@ export type GetTestHelpersTestClocks = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -13352,8 +13352,8 @@ export type PostTestHelpersTestClocks = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_test_helpers_test_clock> - | Response + | Res<200, t_test_helpers_test_clock> + | Res | typeof SkipResponse > @@ -13374,8 +13374,8 @@ export type DeleteTestHelpersTestClocksTestClock = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_test_helpers_test_clock> - | Response + | Res<200, t_deleted_test_helpers_test_clock> + | Res | typeof SkipResponse > @@ -13396,8 +13396,8 @@ export type GetTestHelpersTestClocksTestClock = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_test_helpers_test_clock> - | Response + | Res<200, t_test_helpers_test_clock> + | Res | typeof SkipResponse > @@ -13418,8 +13418,8 @@ export type PostTestHelpersTestClocksTestClockAdvance = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_test_helpers_test_clock> - | Response + | Res<200, t_test_helpers_test_clock> + | Res | typeof SkipResponse > @@ -13440,8 +13440,8 @@ export type PostTestHelpersTreasuryInboundTransfersIdFail = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_inbound_transfer> - | Response + | Res<200, t_treasury_inbound_transfer> + | Res | typeof SkipResponse > @@ -13462,8 +13462,8 @@ export type PostTestHelpersTreasuryInboundTransfersIdReturn = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_inbound_transfer> - | Response + | Res<200, t_treasury_inbound_transfer> + | Res | typeof SkipResponse > @@ -13484,8 +13484,8 @@ export type PostTestHelpersTreasuryInboundTransfersIdSucceed = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_inbound_transfer> - | Response + | Res<200, t_treasury_inbound_transfer> + | Res | typeof SkipResponse > @@ -13506,8 +13506,8 @@ export type PostTestHelpersTreasuryOutboundPaymentsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_outbound_payment> - | Response + | Res<200, t_treasury_outbound_payment> + | Res | typeof SkipResponse > @@ -13528,8 +13528,8 @@ export type PostTestHelpersTreasuryOutboundPaymentsIdFail = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_outbound_payment> - | Response + | Res<200, t_treasury_outbound_payment> + | Res | typeof SkipResponse > @@ -13550,8 +13550,8 @@ export type PostTestHelpersTreasuryOutboundPaymentsIdPost = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_outbound_payment> - | Response + | Res<200, t_treasury_outbound_payment> + | Res | typeof SkipResponse > @@ -13572,8 +13572,8 @@ export type PostTestHelpersTreasuryOutboundPaymentsIdReturn = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_outbound_payment> - | Response + | Res<200, t_treasury_outbound_payment> + | Res | typeof SkipResponse > @@ -13595,8 +13595,8 @@ export type PostTestHelpersTreasuryOutboundTransfersOutboundTransfer = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_outbound_transfer> - | Response + | Res<200, t_treasury_outbound_transfer> + | Res | typeof SkipResponse > @@ -13619,8 +13619,8 @@ export type PostTestHelpersTreasuryOutboundTransfersOutboundTransferFail = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_outbound_transfer> - | Response + | Res<200, t_treasury_outbound_transfer> + | Res | typeof SkipResponse > @@ -13643,8 +13643,8 @@ export type PostTestHelpersTreasuryOutboundTransfersOutboundTransferPost = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_outbound_transfer> - | Response + | Res<200, t_treasury_outbound_transfer> + | Res | typeof SkipResponse > @@ -13667,8 +13667,8 @@ export type PostTestHelpersTreasuryOutboundTransfersOutboundTransferReturn = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_outbound_transfer> - | Response + | Res<200, t_treasury_outbound_transfer> + | Res | typeof SkipResponse > @@ -13689,8 +13689,8 @@ export type PostTestHelpersTreasuryReceivedCredits = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_received_credit> - | Response + | Res<200, t_treasury_received_credit> + | Res | typeof SkipResponse > @@ -13711,8 +13711,8 @@ export type PostTestHelpersTreasuryReceivedDebits = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_received_debit> - | Response + | Res<200, t_treasury_received_debit> + | Res | typeof SkipResponse > @@ -13728,8 +13728,8 @@ export type PostTokens = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_token> - | Response + | Res<200, t_token> + | Res | typeof SkipResponse > @@ -13750,8 +13750,8 @@ export type GetTokensToken = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_token> - | Response + | Res<200, t_token> + | Res | typeof SkipResponse > @@ -13772,7 +13772,7 @@ export type GetTopups = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_topup[] @@ -13781,7 +13781,7 @@ export type GetTopups = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -13797,8 +13797,8 @@ export type PostTopups = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_topup> - | Response + | Res<200, t_topup> + | Res | typeof SkipResponse > @@ -13819,8 +13819,8 @@ export type GetTopupsTopup = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_topup> - | Response + | Res<200, t_topup> + | Res | typeof SkipResponse > @@ -13841,8 +13841,8 @@ export type PostTopupsTopup = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_topup> - | Response + | Res<200, t_topup> + | Res | typeof SkipResponse > @@ -13863,8 +13863,8 @@ export type PostTopupsTopupCancel = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_topup> - | Response + | Res<200, t_topup> + | Res | typeof SkipResponse > @@ -13885,7 +13885,7 @@ export type GetTransfers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_transfer[] @@ -13894,7 +13894,7 @@ export type GetTransfers = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -13910,8 +13910,8 @@ export type PostTransfers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_transfer> - | Response + | Res<200, t_transfer> + | Res | typeof SkipResponse > @@ -13937,7 +13937,7 @@ export type GetTransfersIdReversals = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_transfer_reversal[] @@ -13946,7 +13946,7 @@ export type GetTransfersIdReversals = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -13967,8 +13967,8 @@ export type PostTransfersIdReversals = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_transfer_reversal> - | Response + | Res<200, t_transfer_reversal> + | Res | typeof SkipResponse > @@ -13989,8 +13989,8 @@ export type GetTransfersTransfer = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_transfer> - | Response + | Res<200, t_transfer> + | Res | typeof SkipResponse > @@ -14011,8 +14011,8 @@ export type PostTransfersTransfer = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_transfer> - | Response + | Res<200, t_transfer> + | Res | typeof SkipResponse > @@ -14033,8 +14033,8 @@ export type GetTransfersTransferReversalsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_transfer_reversal> - | Response + | Res<200, t_transfer_reversal> + | Res | typeof SkipResponse > @@ -14055,8 +14055,8 @@ export type PostTransfersTransferReversalsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_transfer_reversal> - | Response + | Res<200, t_transfer_reversal> + | Res | typeof SkipResponse > @@ -14077,7 +14077,7 @@ export type GetTreasuryCreditReversals = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_treasury_credit_reversal[] @@ -14086,7 +14086,7 @@ export type GetTreasuryCreditReversals = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -14102,8 +14102,8 @@ export type PostTreasuryCreditReversals = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_credit_reversal> - | Response + | Res<200, t_treasury_credit_reversal> + | Res | typeof SkipResponse > @@ -14124,8 +14124,8 @@ export type GetTreasuryCreditReversalsCreditReversal = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_credit_reversal> - | Response + | Res<200, t_treasury_credit_reversal> + | Res | typeof SkipResponse > @@ -14146,7 +14146,7 @@ export type GetTreasuryDebitReversals = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_treasury_debit_reversal[] @@ -14155,7 +14155,7 @@ export type GetTreasuryDebitReversals = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -14171,8 +14171,8 @@ export type PostTreasuryDebitReversals = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_debit_reversal> - | Response + | Res<200, t_treasury_debit_reversal> + | Res | typeof SkipResponse > @@ -14193,8 +14193,8 @@ export type GetTreasuryDebitReversalsDebitReversal = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_debit_reversal> - | Response + | Res<200, t_treasury_debit_reversal> + | Res | typeof SkipResponse > @@ -14215,7 +14215,7 @@ export type GetTreasuryFinancialAccounts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_treasury_financial_account[] @@ -14224,7 +14224,7 @@ export type GetTreasuryFinancialAccounts = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -14240,8 +14240,8 @@ export type PostTreasuryFinancialAccounts = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_financial_account> - | Response + | Res<200, t_treasury_financial_account> + | Res | typeof SkipResponse > @@ -14262,8 +14262,8 @@ export type GetTreasuryFinancialAccountsFinancialAccount = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_financial_account> - | Response + | Res<200, t_treasury_financial_account> + | Res | typeof SkipResponse > @@ -14284,8 +14284,8 @@ export type PostTreasuryFinancialAccountsFinancialAccount = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_financial_account> - | Response + | Res<200, t_treasury_financial_account> + | Res | typeof SkipResponse > @@ -14306,8 +14306,8 @@ export type PostTreasuryFinancialAccountsFinancialAccountClose = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_financial_account> - | Response + | Res<200, t_treasury_financial_account> + | Res | typeof SkipResponse > @@ -14328,8 +14328,8 @@ export type GetTreasuryFinancialAccountsFinancialAccountFeatures = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_financial_account_features> - | Response + | Res<200, t_treasury_financial_account_features> + | Res | typeof SkipResponse > @@ -14351,8 +14351,8 @@ export type PostTreasuryFinancialAccountsFinancialAccountFeatures = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_financial_account_features> - | Response + | Res<200, t_treasury_financial_account_features> + | Res | typeof SkipResponse > @@ -14373,7 +14373,7 @@ export type GetTreasuryInboundTransfers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_treasury_inbound_transfer[] @@ -14382,7 +14382,7 @@ export type GetTreasuryInboundTransfers = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -14398,8 +14398,8 @@ export type PostTreasuryInboundTransfers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_inbound_transfer> - | Response + | Res<200, t_treasury_inbound_transfer> + | Res | typeof SkipResponse > @@ -14420,8 +14420,8 @@ export type GetTreasuryInboundTransfersId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_inbound_transfer> - | Response + | Res<200, t_treasury_inbound_transfer> + | Res | typeof SkipResponse > @@ -14442,8 +14442,8 @@ export type PostTreasuryInboundTransfersInboundTransferCancel = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_inbound_transfer> - | Response + | Res<200, t_treasury_inbound_transfer> + | Res | typeof SkipResponse > @@ -14464,7 +14464,7 @@ export type GetTreasuryOutboundPayments = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_treasury_outbound_payment[] @@ -14473,7 +14473,7 @@ export type GetTreasuryOutboundPayments = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -14489,8 +14489,8 @@ export type PostTreasuryOutboundPayments = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_outbound_payment> - | Response + | Res<200, t_treasury_outbound_payment> + | Res | typeof SkipResponse > @@ -14511,8 +14511,8 @@ export type GetTreasuryOutboundPaymentsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_outbound_payment> - | Response + | Res<200, t_treasury_outbound_payment> + | Res | typeof SkipResponse > @@ -14533,8 +14533,8 @@ export type PostTreasuryOutboundPaymentsIdCancel = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_outbound_payment> - | Response + | Res<200, t_treasury_outbound_payment> + | Res | typeof SkipResponse > @@ -14555,7 +14555,7 @@ export type GetTreasuryOutboundTransfers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_treasury_outbound_transfer[] @@ -14564,7 +14564,7 @@ export type GetTreasuryOutboundTransfers = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -14580,8 +14580,8 @@ export type PostTreasuryOutboundTransfers = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_outbound_transfer> - | Response + | Res<200, t_treasury_outbound_transfer> + | Res | typeof SkipResponse > @@ -14602,8 +14602,8 @@ export type GetTreasuryOutboundTransfersOutboundTransfer = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_outbound_transfer> - | Response + | Res<200, t_treasury_outbound_transfer> + | Res | typeof SkipResponse > @@ -14625,8 +14625,8 @@ export type PostTreasuryOutboundTransfersOutboundTransferCancel = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_outbound_transfer> - | Response + | Res<200, t_treasury_outbound_transfer> + | Res | typeof SkipResponse > @@ -14647,7 +14647,7 @@ export type GetTreasuryReceivedCredits = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_treasury_received_credit[] @@ -14656,7 +14656,7 @@ export type GetTreasuryReceivedCredits = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -14677,8 +14677,8 @@ export type GetTreasuryReceivedCreditsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_received_credit> - | Response + | Res<200, t_treasury_received_credit> + | Res | typeof SkipResponse > @@ -14699,7 +14699,7 @@ export type GetTreasuryReceivedDebits = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_treasury_received_debit[] @@ -14708,7 +14708,7 @@ export type GetTreasuryReceivedDebits = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -14729,8 +14729,8 @@ export type GetTreasuryReceivedDebitsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_received_debit> - | Response + | Res<200, t_treasury_received_debit> + | Res | typeof SkipResponse > @@ -14751,7 +14751,7 @@ export type GetTreasuryTransactionEntries = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_treasury_transaction_entry[] @@ -14760,7 +14760,7 @@ export type GetTreasuryTransactionEntries = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -14781,8 +14781,8 @@ export type GetTreasuryTransactionEntriesId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_transaction_entry> - | Response + | Res<200, t_treasury_transaction_entry> + | Res | typeof SkipResponse > @@ -14803,7 +14803,7 @@ export type GetTreasuryTransactions = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_treasury_transaction[] @@ -14812,7 +14812,7 @@ export type GetTreasuryTransactions = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -14833,8 +14833,8 @@ export type GetTreasuryTransactionsId = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_treasury_transaction> - | Response + | Res<200, t_treasury_transaction> + | Res | typeof SkipResponse > @@ -14855,7 +14855,7 @@ export type GetWebhookEndpoints = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { data: t_webhook_endpoint[] @@ -14864,7 +14864,7 @@ export type GetWebhookEndpoints = ( url: string } > - | Response + | Res | typeof SkipResponse > @@ -14880,8 +14880,8 @@ export type PostWebhookEndpoints = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_webhook_endpoint> - | Response + | Res<200, t_webhook_endpoint> + | Res | typeof SkipResponse > @@ -14902,8 +14902,8 @@ export type DeleteWebhookEndpointsWebhookEndpoint = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_deleted_webhook_endpoint> - | Response + | Res<200, t_deleted_webhook_endpoint> + | Res | typeof SkipResponse > @@ -14924,8 +14924,8 @@ export type GetWebhookEndpointsWebhookEndpoint = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_webhook_endpoint> - | Response + | Res<200, t_webhook_endpoint> + | Res | typeof SkipResponse > @@ -14946,8 +14946,8 @@ export type PostWebhookEndpointsWebhookEndpoint = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_webhook_endpoint> - | Response + | Res<200, t_webhook_endpoint> + | Res | typeof SkipResponse > diff --git a/integration-tests/typescript-koa/src/generated/todo-lists.yaml/generated.ts b/integration-tests/typescript-koa/src/generated/todo-lists.yaml/generated.ts index bfbff8760..6cee847a3 100644 --- a/integration-tests/typescript-koa/src/generated/todo-lists.yaml/generated.ts +++ b/integration-tests/typescript-koa/src/generated/todo-lists.yaml/generated.ts @@ -11,7 +11,7 @@ import { type KoaRuntimeResponder, KoaRuntimeResponse, type Params, - type Response, + type Res, type ServerConfig, SkipResponse, type StatusCode, @@ -57,9 +57,7 @@ export type GetTodoLists = ( ctx: RouterContext, next: Next, ) => Promise< - | KoaRuntimeResponse - | Response<200, t_TodoList[]> - | typeof SkipResponse + KoaRuntimeResponse | Res<200, t_TodoList[]> | typeof SkipResponse > export type GetTodoListByIdResponder = { @@ -75,9 +73,9 @@ export type GetTodoListById = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_TodoList> - | Response - | Response + | Res<200, t_TodoList> + | Res + | Res | typeof SkipResponse > @@ -99,9 +97,9 @@ export type UpdateTodoListById = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_TodoList> - | Response - | Response + | Res<200, t_TodoList> + | Res + | Res | typeof SkipResponse > @@ -118,9 +116,9 @@ export type DeleteTodoListById = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<204, void> - | Response - | Response + | Res<204, void> + | Res + | Res | typeof SkipResponse > @@ -144,7 +142,7 @@ export type GetTodoListItems = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response< + | Res< 200, { completedAt?: string @@ -153,7 +151,7 @@ export type GetTodoListItems = ( id: string } > - | Response< + | Res< StatusCode5xx, { code: string @@ -177,9 +175,7 @@ export type CreateTodoListItem = ( respond: CreateTodoListItemResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<204, void> | typeof SkipResponse -> +) => Promise | Res<204, void> | typeof SkipResponse> export type ListAttachmentsResponder = { with200(): KoaRuntimeResponse @@ -192,7 +188,7 @@ export type ListAttachments = ( next: Next, ) => Promise< | KoaRuntimeResponse - | Response<200, t_UnknownObject[]> + | Res<200, t_UnknownObject[]> | typeof SkipResponse > @@ -205,9 +201,7 @@ export type UploadAttachment = ( respond: UploadAttachmentResponder, ctx: RouterContext, next: Next, -) => Promise< - KoaRuntimeResponse | Response<202, void> | typeof SkipResponse -> +) => Promise | Res<202, void> | typeof SkipResponse> export type Implementation = { getTodoLists: GetTodoLists