From 19e0d4e6cb02365ebd115923de5ed4ff8d9372a3 Mon Sep 17 00:00:00 2001 From: Lukasz Gornicki Date: Mon, 28 Jun 2021 12:39:44 +0200 Subject: [PATCH] fix: refresh dist on each release (#105) --- dist/fsevents.node | Bin 36204 -> 147128 bytes dist/fsevents1.node | Bin 0 -> 147128 bytes dist/index.js | 276018 ++++++++++++++++++++++++++++------ dist/index.js.map | 1 + dist/sourcemap-register.js | 1 + package-lock.json | 6 +- package.json | 11 +- 7 files changed, 227741 insertions(+), 48296 deletions(-) create mode 100755 dist/fsevents1.node create mode 100644 dist/index.js.map create mode 100644 dist/sourcemap-register.js diff --git a/dist/fsevents.node b/dist/fsevents.node index 8d952b5d084a21166c29de6e90ad6c954f861594..00fac7e88bbc5ed249eaaac87b210a71e2646889 100755 GIT binary patch literal 147128 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 a|NP;OOTMqX|CF;YDn9F9zx(qahW;OGU5pd} literal 36204 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 diff --git a/dist/fsevents1.node b/dist/fsevents1.node new file mode 100755 index 0000000000000000000000000000000000000000..00fac7e88bbc5ed249eaaac87b210a71e2646889 GIT binary patch literal 147128 zcmeHwdtemR+4t-wK)ezJ6z>~Aib^2~MDe~MfEx`M6Hw}Hvq?5&CG5uC4T4x*Kzzv? zqoJZzYhQy_1*;WXwSZNlDA2yPg16$OZ314_TN@P-6wLQ~<~(P2X0n6B*ZkA(I}2yd z`JMCooq5hPXU@!=oSpsC_v@e2G|lbOv;l~-G|h`>Z!R{6Bkxeen&$Fi^Zi!gnQP!xIa5(D}W=A@2uxW2S~RG+^-*w7e^f?=(1Mx8FxzT`>>!!7AgFZ*gD;aIxC z*7|()LP|cT4`Dh6b|1gLCKiu|!n2uRt*@NxJLxDvkXY7dvK5(re^dC{P`K6~3fDz+ zY(Bp8ZxqUeh&001I=D!W(*0y|@r+_aNrKZ}jxCtlOd)+7!VUh|g1Oa^27hBb3Oh5` zC;djf!ss`uCm%t6{QlXI^iiO8o9oL-2<9*r5VqD=z-1Kq{SATr+2?_tJ_+t8gpKvl zOExADfj@r#+z1_nP~2bF6t3xIU;83KlbrD|S8dd^Z-7^Qq-pg-H0==NNnbpTd(U3#5QzWK5eCS0h^$4WZ z&$FIS(3S7h##Jte#e;Llm4&LKf#`y9Q=@^o!D}PYIk9mik!Wygq$!L86pDn$*2$7_ zmjt6R{({WZG)!_4+|ctHYc`0H1`2Mc;o^P@z;&U`J0`OiQ}%OGF##^g87dr`zQ$402g$?obtIdhFV9AC>bdVWhIeABN4Z%^>Gw3lHPhkdHigip094q*5 z+UDf@$5B%TE`1I)5oc1%lli*$Kx>(~Cb@;nAK>x}S|;RE6)iK@Chz64TXZY_QPvu4 zFKhlV`M93lbc3&@seK*w4#8hl)-q-DwC1klG*Mnt+VgU0&4AKH8_9>IXS_V{mP=t( zY0Hf{$rC^!?;nZS*Mg?E^oyM)9COx`E$A+-!EKipUr~G|yEci}izN5p{UphkXmcBF zE~Cv!*bF>zvewJr!^)bcb(F!CWi3zB{--V7HSng_sgccp_BFp=+WgJ)^!kkCJ*c^~ z`K9JzzR-8XOE&8nlSk(GmcBdirdDvunt!@wN@$$Dc~VRE8a-oD^G#=vmrHv#mM+>v^-}+tSl0ZnvgTdM^~az@*R{sa$XT!V>E=!A z@Yau<^EWsK>-BE>3Ap;nwdAE?MsLxJ zT;%yqy>HQH?PN>y_odAr!P5s72~Rgq+2-4{wDG&19+cwjy@Qgz*4B1JQwln!;Pib? z-^0MA)A4GS=ZAroyqaupehI?)po!D*DN^`a+X&&zPu|0-r+&j?zpn%kCHcl=WBgx8OuJ!yLPC{ zKSq_d7Cq>psI^U$^0|?Gg-NYq&udZYYq^7}@U<{^hi}maayic49A9g{Q}*`s6tAOq z)WEjlwTQLK@~buam%ItJVJOI_-Fo#J$5R7V^G*sWYtvF6YA0D)^MmEIqfJX^aSoDI z>0~`83*dzh*X!Nl*La_duX*WalC?fXk=_Mxq4;Amh_bSlrQ|g<_bZr*V@dn^a$s)1 zE6|;vr=9wmUnpKT6p7><@JpM8J4;(`87U6pHFTlbRR|(oXf`D;C05HHbf+iFY4@!| zFa1_OgmK-cOXgi#9dbn695542Y%8ANn>;*#fu1teIPUtD$|hiNBkXH_E4g$Jc?%R2{|&DYLrab+Yu?G1E02EZ zOm>q+&(P*(Y%l~&7Uvg@>%(YxZf!~?n{@TSr9QmA2RrOWjkuIna_;Gr+tQT8nA{CV zuJ8b2mn*pV__Rn|fsW;ZgUq_GS$72&|BJe(*x7T`Gm|@x6n+0)DoF3IK2Pj#BQIX5E{t`;3ckH|TOm7vq8(%{t$3vA-v|IB3x6!|qvJaIsnU4C}7v;?oT} zG+j$(alr_)Zqx{|zsX#DkU{4q-T$KJ)5-ZYu2%-Xw6N|_*1b!`?9T-0Zf70c1sQZ7 zvhEEoe$1f5`Kl!^=YqS;2z`ILI&Zec^>Ev!sZd$5IYU^RS zqVim7z^0|c(gnACqgU<`1wJm=wA3ppo0d*YC-c+E(K6Y3*xJ!_AX>|jgUV;g0^IAR zllAFjBPYw6pPi57rYQ;0o+-=pxb?88Uf;Af+}qs6MeQ7~;&_c7ip13LfT8|FX&?B$D^s?k&TmE=3z<*ire@gtHUY6WJ zdrnQ&80*gx{5u5yVB%kYS@L(b{ObijDEMs{cGmwKE=ex3DD>wi*k302MS_18@$V%5 z#Wwuo1izo)ZvtAsg7`G%7+WCg|4b(qy@`_%C(uR2zn%DBU?|GO|AXK^DEKb`t^XPE zU$EhSA?#@q{I9A0wZva;!ykhd!v9kQ{~lZ(*S}5tfDM1IsDG&7pG^EM#4oVnzasb_ zpaY=2L0q2Jze;?U4gX%je@gIokpKTe{H+*~Gx?`M@RthywZ#83@mJdL&ldcdfT(y%Yy$f9bcNcNp|5v zlc~LB@F0%Y9fIFN{``pePuTE}6a1jyA4&Wj#9w5?|4j6UBDSCG=_3BcHvH2>{rv?0 z_Tk|7$4HXQv*Gs_{5Ns<;h#fN{4Wm5+}^i@Jr4^09eJp~AJzYY4gVp*ZxZ}LDgJUB z{yf2-BKXTas6U(P57_Xh3jR>R-*ckm7ufKR6#Nfx_|e{<5p@NX9UnS%d5W;6x=8XNv4f`5|W&n3Q#>Myq8j}rW^ zarn{Rk1*XQ_=9ZtySV=geuVh?^HdjZkuvrFje>s%*N@2#!GFSrf2ZIF1%EE_>8>HU z$cA4h_(g)>g^4D?zu1OhUN&uf@368tadM$mA@lh=#4 z^nteMLBX#i{ywVz1sncDg5M9XN}s1LM7PYFIvCkXyl+{k3|&(ngxRPawD{BN*n&o zfwmjo8UiT z!@pDT#eC#pM-cyCRR1Cyex2YKiTX(`_!ryoPZRupf`2;k|4H@d+3?q41V?{<6NexE z8Bf=X!$D1wQ!}-^Xt> z0r1;;PWliTJtrmgE&cVW=cLc{?LYNxx4!*S-|p16yY%gDefzDx-K%fE*S8ujzda|p z^=-Dk?XPch^zFg=_E3F$xW3KRw@2vPA^P@6eLGCw9;0uM)3+z+TaUgSu5U-`+fn*< zw7xw>-;U9@WA$ymzAeKK>InBGr*f zJ)KHDno8ZDO5K%8-I_|>luBKfN;RfZb*a=9sZ>QOU6gNwyhh z9H(%G;#1ao{8ror6j%0~)P=ZBwCqF7Pl(iesnlz!)aF#`xm4=ORO*pbsy&suGnKj} zm0Fxi(QJs=TR4@fO{FeNrD&o>@TR6xXQxtysT57o2;K>))R0u_;8aRWrFLQNL?}K> zrM4rbY4_YspLOTe#e)7|cwQ(P3C|6NqgNK0qtV_& z_}QI6xF+alzSvV!I2x?;$LnEEZ7fh1)PHS-em6txQ;L3kZcU(}p*m1A$5gLge>B(- z3}6SDD(S5sBaDj2>caj&btKx`(ArR}F%Yk*_v=0}IYj)_kH0BiH&NIp-1g&hMSOXv zcK(%PA+Coripxv=#WQDI=@7Jd67`9=af@U9+mER;eAUuqG}%GAa;T5U!~R z#v)Boiv$fZ9xZ(U!LNPMk6#(ih~bhpJo7m~)lbK7<=9%2sR!uej^3Q{XpYH5hE(Mk zPyQHBq45yPH1#<1X$_~O50UJ(y>0rp2Pby1xxdIg>tkxKfl(TrX&}}6bEGldoe!`( z_HH5dY5Z1Eur3r1*2+F0`m>2#N4V>C?RnAiFnqY?ZxTzrABJ+=EWp5eqsFYH~- zfmt)HDHgA+34|+~swan{G@|vc(ZX?Vqea*U=FW@-qm$v2#vqOJy-hWgJ2%rH>H`xm z#9c+OVSh%N7|zW!$@;)hy+@YT#x9KpZ2f8BI5*ZJ>;rRsp;$Z;T`<}1^f8n>H`5^M z0~0GEk$4F%{gXlT&C=<8V9?C)Tw9a4%(+o4=mWD# z@%wir`dvWgfyPko+&qJ*k4&rx&W+5o>20((E!D+#GU|Pi9l}6Hm z8EaJbk;N53{ouC$L#gfByNq5T|qNjNYgrK*ptoQmIi4Mt1xW3T%= z_9oVW*=v&akv#2;sdi#X!^`P-2K`f?$Q`a57atH`pme>1#=rh;W_&;kQoPRB+L5DP+uTg`vaCr z%7L0Hb$w=QSs)gdmF~y0M%sbeY}EFF-58Yg`|6C=%0lNhN<|-7rr+5#;MUy!5?`Vh zJGU-fWk&n-M|OIi-p}K@KBs7U#Jh{;|&y%&w~UKSJ`&GHM?9Oa0Ys~=7?ak3#xdXKQvj$h*VFC1^R`$88+n!||^;{td@#IewAjS2%u)<4%r0;dm#<-*cS9b{)a- zaU6?3CgJD5^*^6z+7OOU;CM90g&d#FvG-EZzW?j(RH5{6oXfH70JC{Nxibat_J;rK zJt?8`fbxLyfbxLyfbxLyfbxLyfbxLyfbxLyfbxLyfbxLyfbxLyfbxLyfbxLyfbxLy zfbxLyfbxLyfbxLyfbxLyfbxLyfbxLyfbxLyfbxLyfbxLyfbxLyfbxLyfbxLyfbxLy zfbxLyfbxLyfbxLyfbxLyfbzh<;ekPUo~nZLD~l_+j&r?u-66f1*ZAgD?c!@XTy4gZ z3@^{rQUvkFPWdWIYrg(k#tfOKO|WK)_dQy34Q~Rq7CEp=y!$pK?DZ0dREgmouBJSC zXRRqC^-@byuKqs6)azR_6zT6z&5)m|d2=JRO?ZiIG&mbC-U~)kDx0^48p>_oSe)YY ze!*p`$o8GdTH7G6zhr80G#XeS-pr;Y*6zbwqUl2&h0D$l#xJ4Q*cQi2@%E|tRB_4F zil%T`B+^)1TU)8W`_+^SMM+aMidS`-vY|0yq2yf~YptYrcIX*+)hAvUD=3$S;`JpW z!&pc=OXto>nKn6C7r>jP@g}FBmRKcPMeRDm>o>heR5raFJ2VxPhH>~qwe;d^Yf*)G ziFB|0%9{Eh9b__pu14 z)w+1ywZEo*j=wGt()+eCZ*~*jBcvth_vZ8u9p1WV5T0qLHWQ01fHynYr9?gyIz*NwJdpXDk4pByuMbu zvOE~Ai$v#2TvI|X9B+^?l&vLhapBc2ZThwyTdkk*rRdu8u4q%(-+C)Wt?dET|YV`3|>vUynYxEsO8b@O|~b$uRe6ZF2pZw&@V#B_o4V1SMmE%ZeZNT_!o>j7_VjA z&G>c3o>`(h{F8Ax4J>86tVC=bE)IXeYIpZ@JCm5GAUc-1c z<4(pmFwUhPV!(%fiAO(Pj2~s($an+ecE;~8-op3`#@dylzJqc^eff;@7*{bqgK-<< ziy3z?4l(X#yoj;qDpCL4jLR86!8pPAkBrwa?qb}@cn{-Tzo>5zehEr%KjV`bH!?0} z+|KwXjJGhphOt&9>T714&v+%{D#q&=w=v$zxP$S>jJp}T@RKZLpC_Q{pQ9OsYc-<2gYXkIWN$v>JjPXw z&tTlf_+rK#j6;mO882e&sTK9#&A6QL6O0p#Ut+w5@n0EtGX8{dZcxQ}v7@3-$un;k8`8%Z{%i0-CCgrOi}Ansyh;M;h?cz&D8^eM?0n5pp??@N{g9 znCg@7f7;CTN$gZF-y`(_>m_!o&*%2I@RLc@o)l*Ly%zh8nCx$4{V}YUSnfYz(Hk-8 zyIDV)^%6^cyG3urq;ET45WK9HSn9V}^hQkjDxV-+!g`6NzL666P&6GIBPRWpQoUHa zn)MPBUqAkoz=tBz=Nd5SJ1@|SwV$$HVxp0Li(8ZvCcP1pe$6yd{$H$@SnAtEacciY zOnUEhL1<&W#8O|?Uz8K3{Tngq+h>UKcGgQQ^^Kx9wSOZfy?oEvqpX)$>hmq_H)7p> zzJK_ww4brmdo24mV$#d|75c$C>i-f;eZEC+#H5$^Hy^NGVyAj}Kjg+wqS5{(cB+^6 zPbacoVyAj}zjY?-C3dQp_h{Q>$_lpm)USg+u zd4Ji#dWoIt<^AYZ)=TVEFYjNsvtDASdU?P573(E-s^7x*$JzMFKsx>sJJrkkY5JvR z(o5`AFYmucv0h@QdU?NoI_o8Ns+afoKGsX@RNuk(|36{9#7_0ytPinXVyAlfys?1w z5m_!o@8svDzp!3nr+WE(^#SW8cB=RC^VMF~ zOYBrHpWg=Oit|Ter+WFkcM9tzcBDbR4<>mldPB6sa`&xYj~Hje*Nd?Z>M_s zJU@)}5gD`J8|x)@s+aQ} zt5`3wQ~egUzk~G>JJoAd;s$#g>m_!om-8>(te4oSzKZvsgP(+^{wuLly`10iuwG)P z`VQXzMAl2}RNu||a@I@iR4?b7>RB(bQ@xy@O0ZsHr}{)d9RIsmFR@d-oc~(GdWoIt zJ9+<`Sue3uy_{d`WWB^r^>RLLH|r&Ks+aS3xr6!o&+~Oo^>V&%H0vdHs+aSFUe-(O zR4?ZfXR%&lr+PX6*vNW`o$9Mm_!o@8JEfWxd2s_1&!B!g`6F z>g9ZElJych)yw%=Z3tigYlT0Z>J!W##(IgJ>gD|JsjQdSslJox69lK3j{M`6xZ&PNl!mNxvMX|I96ay}4L9n1N>p^W8x*|Ch}{N1UH<$T=f zjOF}rrPTBMYa?ShzkMrXIUjmIV>v&&o^d|wUuP`mKR;wF=VSLWZe;$!Xq)(t0(_3P z-~tPtV!@YLaJ>cJXu-EyF#c?6+W)fx^K7H0y=K9mTCfXDWTp5cEckQ_zQBUR0%wcX zYufb|e5(bowBUyYh6&>HoTYrDz~9UAcPx011rN;9+mqrCx8NcRF16rl3tnQuKeyn= zE%*fs-eSS;Tkt*$9t=;y87ce6S@0AKuCd^y7W_XJ{G7npiqBsx_&p2$%7O>r@7b^~ zr9ak!3oQ6d3w{aWmk~B1Y(m(K@JEC{A^b1GD+qr^_zS|T2wM=gB2Yhm9pMdxHxd4d z@HWCb2=5}ihwwLqza#tup%bACVLQSOg!d6XK==^hBZMTv#|WPw&^hrL!siJ8MEDm% zH^LVPSQ4Rqg|HLhYXp3}Zz0}>unXZoy*(a{mKcfO7#At5;PC4!RP?RkCzAyh3pf0x z1ui9~Wh&+}%aRszp>+X_zxNMaYkHn>l?$&+>6I^6uIL5kg)Mqkuk|o`Zfe1dTwKPh zuOzgtHOsWpES+aqXO_-{ue3BWtuZrX(+V>{yY*$MBE#x3^Xf2ZxM{(bVab@8Effe%&WwJENjF}IbwyFSQO^ZyoydP6U(%=)R32H{U#S% z)|8rZ#fnmE7S@xRvUoMADGw{gdS|HYrT623h#=34)DC|~^%2N9^qk@rP#i%H-UoVuUlndHTvfOCGNWM3)t-0eh_l^rsfm(!fGL3m>x^yvEi<8fwQDh+^xw zLWiTbnlnr&JY@15Zz)Wm3GgCGin<*Pj&XkRY zXUazNGi4X#+vKB*X5`y6w7{mN1vX7BuxV?7O=AmeT3cY#+ya~S7TUD8(5AhGHtj96 zX>XxTdkbyaTWHhXLYwv$+O)UOroH2B+B@E+z2j}#JKmc1)*P6g z?>WcemT4?*BXQG`-UC&fsu#C4rUwjpTPjz=vmq&djfKD8hYrir3M%m%A1_Rg5$UG` zD^1>UP`>pFp6QC2;Zm8tHl;2~*5Q^hKXlPhtf|`!y0c1kWb+*X&Tn%DP6cxYP6TrX zPGxfj&S7%~PF`~c&RTN@PFHgV&Qm=@-bP5fB$j4LY%|W-3|I2}PJN+5c*CX=o3YAf zsInQUYz8WuaY_zT76a97hB#2_HiJ8?T}QU*$?7&k`0YRMHbYD{tF7{Y^1%NW9(eWJ z&%ejtdiB4U;45sjtWMk3U(=Ry>yJh}8h^X<`)5p2W{f{4;rq3khN|?B z-;Xc+#u*^8*0&koPoqzgc8CvQ>^A+ucWTps^z`-KSSrg}-_)A+tFvQmHuZe_X=>}Wv^Nkif@;QA7<4=sX zAJix2cbQ?Wubk^U=_o;vSXOAV6`6j2Q}|kZH(E?i_ipd}^MrC4S3uZWhpd}oI&2fs zi~Rn{#WRZiB^OPv6ureurTBRDZLgTxECZH=LO(l__L_Zt9`G;8 zsovz}yadOLrO(`)?e{kX{ILadt0N7V50Bc`m(b62h!SSI@O4{l0@p>6-;dW91kxE+ z`x1*pnQSNFA8MyhueYpp`h`;_mx|tjFCg(gyc{!Ld#=D_E(Q4+4$Jl9+abQ&n2WeG zTb8Ed?w3S=B>xOUXxpf1dr;Auk2G!B5KY6^GgHUt_sFM!ucYXI^EUbcS*DNYL-Y4I zWg)GHq5a%{$WdP|Uw_sIzqmiva@sS`o?eJN4+5&k2YYoLqNjCVJg|e{n++=f-ZfhHm-63Ui~q5Tv@0(8i+0!H#HiV8>C5~*tn8NG&nVaKO+U=p-6aa zoh%u531*Ct6B}1-;h^qb`#GcBSXgc=O z6pM~)2vt+4IrY@B1!M7dnozaQpJ?E_&OQ{E5i?)7V(cWAfQ_|H2;|4nIL_q1lNr-- zr_b>SRPM#Xp!xEop#t?$9{7L2107lZw`ACP(Q~W!Ep)BkSE4QdD$DhVXQX$}P5reM zRcc0Nkke&^$tvfI32Yvt5`Y@6F;vFT4*VgLw4}D}E;``j%9`~Le zy$!S%_zA?@zZSgrM^IgZAL#-w3;b&0Xj)O{0PmiC3rk?jq}97FEnW@V zbQ>pRX)AVJ`YiI{|Anw~iMD)amirMp4qwAQPxhoe9WL$3iKwTl|D-+j?n!%GCkY>o z{+0021TGuFG2T70;>P~&J%NKK?a70d+BOe)9=BFhMR{7Hf{qdDExPew_nsTwLq6@$ zv>D>qPJ%7PuyMnxAL01!TbRb=)8k<8AcVb<^{c;~?OMIt?*=yunrzsQeo*3C-czD& zrDK@{-{;)?}$j3uR(aI&Rt(12J@v?!lF5CSe=WWMvtbxDY z$38yp2cKnWMGFVO4tHYRWhJ@GZ_LX1bk27@GpbLo-5~59FG~#m$TQ~(in+)HTz=xCI%i`60BO6zdk2gZU)2*%e7~$^-uOn$;U?{;MzN+{<;ObSEDVXLuc+@cHM%tls*~$9(_>u zI=tg$Ikox3tfN20%?A3*k?7|~KXNtdT4gvc?nI&@%Y&e;jLt_{)xMr0S$<-kcE(3N zJxA?9KkS6I3w|FC|K0%}ohSPiPDa~G(8ft=Zv6aqg zv~M~2+Selc+;O{?q2A=_+MewXxR&qO;98DHuGjh@(7rr}Yem|UM8!2o(>Ra=o0H?U zJzZycvGg=oKZjSKOgl^~>N?N6XM2r%`TI*;dVUtTx1$X2;3(=Up)!%*g1nAHw4(cP z?sb7rV+Q%+QRH`(2+nNc9IO=;f1)*#y*oyTeCo$FDAQ2Zb-s7cj+V)*@0^soeDnKa zT1okn)(;DV+z{VAMpT$S0aH_leN0%SZxoDk2EH^ zJ&6i8j>|xBIxj?fOWgVxOvix6tDV`}iXHIB`{TTO7JVl6O?D<;)UMc$v5D$=5Phm2 z^a-?cnPEIyb)y)Mu$B~MllJ5w9{x6ui#6tP@i>&>0ifu4obR0jX^gl+KUYeBnm$*$ zFec&nE;o*wdm}ID{b3*MybXQgCWHkDSg*XI1_968E2be#Lckj56?6@-j{i8`%SWTV z$${t_uxrN%E!8&;hh6O$CwmToZ!l(WFA;VRB72eFb%^lscAQ&3`@ZMrUC@%x`=i{0 z@f6pL<;JmIj`NFQ%e4p%WYY!>Hl@dV>c4tDXj4a?Rz%lDsuS0niZ_wxMc$49-qkOD zrj^sNpt2t1w|mlD8q@!TJP-1SJG@);FXGZMO`MqK7K8gd@-*b>+@0xqKSqAl32E*k zaGyk8=kbEO{hM^Xe@DI-`6+u{iHg<8>o|_N-=*t)9r+&Qr?}`tSi`)c{aEJqX!){j zn~|>}KgGp$;&$XEjuG7Zv&4M`we4BtcOGrv<|HbXA+HK~dfNuLQuY28`5nUy+}uRP zPm$+E9&xJ=PS^V|^4pIxa6O5NDDphWBkqfbx%BgwY`7Qsi6aeMZ=zy0@-*ZTckv)s z>bRk!t*9Dm;3g6kS0Jx*2-`3;&Al1{JxuQ&#IG%gc&_>a@v$;eM&9G2W-a0eof#%AKan4dmw zXCS`{f^tf;hMZmiI6zvEJwH*VIczEQ?w$8fbYqyxCmh~g59`y5A4VO(*DG?@@L3v z$9StB)8e%6*CAg+z8HheJ~|m?Cm;+)=qc&Hb+>;g?kA4K{l-zaml}q9ss8%&58V%Z zgK?e4qs_kb{lsT`dwx#$QFL9u4P*Z zUC#sBo*nx2Y6$MT20wDYmZ-Q0zUYL%QrF+&^!3+;dsQ0W_AQ(RA6*JxU4nbEnXBPD zz0c9J0NtOqUzn9kzPdPzo)?~nAGPJ)MVg+sa*?KwlUa+keBx}!v)3WeNgn)EPWgd^ z;ElLh;QI$ADqIF$`(lxwccb8KSS;ej;C%xdWPR;7i~O#iin!!9-tQ5Kiq8$as->cQ z<@F-oaf`6`MeueQc%GX?d0?T4moy9BV({KJ@H*L^yz2xn>t?~L2Jck^ubutTHDB;H zEE4US1RkA_sdlum|E?9h2U-NreN>|286&S%ln3VVepiZk__2wKCk(u*TSR_dlZZF` zlIuGrQGxGjrS|J-5#?Pm5%2i9;B7xTQSnOyud`W{uZ)U##0vHwc()sP?aM@Y;2IHU zEf>7|!D}|~s{Tuq=QT3#R<;kk8x1^Rf!FbK!ON>--oP|(oPn3P zQ}DWK1+V5%mwx`;kNQqB@Vs{j-pU%mTauIJ9c$oWwAIh+K(*j)$QHcCsBe&g*YPvK z%L@oziI(OKFz^z~**?GEJ+N2wgKE^b57!9kKW`h`ca`AP>`wFWy{;5b2bFtsy;NkmgDW125?fZ$~m3+*{ z7d(6)F2&Qh{|06W-i8kZ&kf!S242T9w(nBrb)|XuTSTh9#DB4UGughs3;VX8n5cNn z!1LbB_RSEytasA92Mj#?VOJdAO2MmnOW+q#-`xgY#}bjBSHbnYCSu~Kt4qp**7bpIfa8~!dO?3>Q@Z4~t_2JadJuj2-`Z<^qh zyqMWFmJuU#H%#$w1px+P%3yko)+;W@JbE5 zjs=33=M&{iew*f5ymPre9>0k9F9R^a;3YzA-|2!^!uLJZ z;5}>LdF$D}(|Er(2tO0=cLts|o9!zSyqfC-o&?@%1Fs_}^7AGL-Uz;*Al`ijUZPg; zx(WsFfhhMs@a{11yfuQivVeJE?tkF57;05vpZ^zXlc7wOb!0V`D`^Is7bpjLb zS_3cP7x`U37Q7O^er-QKQ8CxR^Ij!*E5~qse7zxFje)0KDR_ZX1uyGL(T*3v`-y>9 z^|r{*J4NtD{Ec~exW_i|JljNm*J!ryZSGg#O)>B~-x9o)KVtjd67gd2&NA>c-cMi@ z^WGEozBnRLQ2-v@TQ_cZV}AX_wC+5mmAXghIFnW-Te2gCl-;mBVq`TiU)Ne?yF{Il# zU9M@vu(SdzAoTSQ!_fCqY5d(il`b-*v4$a)KhBUIV@Tug?I{la7N1IwFr+<(H2xl+ z;v8d0WBF1lABj|YkRgqA8mWA&s7R%A3~4MHNaf?t{d)R|H{7{&&UByu{AxYktm)?w z`D73Nh9P~j%aH!cknT35KR2X5F{J5lA+nzL4e2gJ`tOGHyN2{OL;6ia8uJmUI$t%U zUooWrXh?4~q&FDS9ftI?hV*(v`uB$PlZNyYhV*X?>0fjDp1bL@?mU~X-}L?>koc7$ z^VhmZTUuiknbIv&)y|Tz0`odH1FZt+&w%<(_ z`;^}d`tiB+!$;NlK@?NHdKFRe(=GlC-whw#TR%n^6_3@0{ekL8w6~$=ul{OAhZw%f zE$kCtQ~vR}BECFSJO9eDje&SQoKaj}>Mx!-<060Al= z_%R-8uihUlRZwp*edn2dOqDu4h{EB%cBOxDV86^T6pA6=lSidHo;YpxS6Q!KrPo)0`b1Zv zZ9^~&Lpim-$_xizuci>yjEaTuJ2<^n-0#F282Eq(Vhh4G6~UPP8&D<*8X~@wzuz-r zxTFowd=60c)3HX*RJF0jOg%s!cl73rM{`UjGNdZUc=E@13XO+Qrm4r7Pir_OeTZbQ z?QN6II~io}!Rt5R*!>Mo>|*(&Yi6N7ruG^brO}xNQvOn0x;r0WckJCl>eH!LUC2Hl z`m>2_{u;Y!R5bM;eR*{N-!L?(jR#nNEr{6D9JGh}RAn3&oVj|EzN$Gr62`$CrMJyg z4Hbx8_kP)hs4=zsF`nVXMlbAL&4F1nttl3-tO%-3wMxqNQ+nqj!a_43mM15dlMI;h0!Nq^JP46_6J2%lF>H`y}Va;|t2Y13Q#3te8>xoLqzsSh zrL~nbuQWY!ZANd)!u_|0CpCvlcE*;>ZirN4lN&0Glagl`EPvW_xiV>E%bSXV}aCGc|dtUc|dtUc|dtU zc|dtUc|dtUc|dtUc|dtUc|dtUc|dtUc|dtUc|dtUc|dtUc|dtUc|dtUc|dtUc|dtU zc|dtUc|dtUc|dtUc|dtUc|dtUc|dtUc|dtUc|dtUc|dtUc|dtUc|dtUc|dtUc|dtU zc|dtUc|du9Jdph(;fGv~kK=eW#}hdAa$LsoERJhAZshoSj+b$~g5!3MALV#0$1icb zh2!@)PIBCRlCW$G32N7stQicn!yY z;CM5~Z*bhn@lLi^8!hZRl;dF>kK{O?c4y6Bd6oXS!JBkMD{QGNjG}sUf#De?f z#9&c4FgI8$ovCZLmh?7&JV^fAwLwyOW~yX zRB_4Fil%T`B+^)1TU!}viq-^8xloieMWey6e%MoFXiPMrjF&;@oACTpmt4e+Yw&>)XFLIU=zr}z+B#K)Q26L3QEH` zw4qvbe%gzvs6rfxUiph3VrC|hdEoEeUBg;S%Exv2_=c>R8V zAQnRx_ebNpEB*eO`Z=-q9Di*fdTl7IT|>L|`(yDy%^WK7*9AfiT67s5O=I@#ra-h- zyCw(ObdZTz;*emd&o=9(ZaU zP77w0^ey*`^!CA?5~LNM8@Tes~BI+cp2k`jMp%}h4D7Vzhtc8SkUJ; zj7Kwmo^d(jEsWsT+jFd#%+uPjMp-r z&$yHEZH#k{6ZJpDIG^#ejAt=^gK>iKr;JxIcIOEDw=h12@ovV2j6KJT{awJ=$GDnt zBjf8B-^KW6j5`=V!Z^wJMaH=&i2C1QJdyF2jH?(Qe2}nr8ROxM*DyYl@ixX4jI|R* z{Z}&{&3G~6a>n;Cp3nHVjN2LiiScH}+ZlH={+97DkJ#T42Mc?>j89=)&v+8!HpZ7R zUduSjxRddJGtR*vLZAB?=QCcLL9 zOZ*k^O}bKSoYuF6>+5%zut#F2`Zrjg$9jpS{%p31Ftx{ssXe*qH}pA^^%6_{y`nhf z41W^=)2E8{5=;G)qBymGBPKod6Z*_!y~I)((}yta--ty4Q7@_lNruwG)RFQWuL z6w&^TnDp{~gD~^d90V%sb1cHUB-Heo$BTNS`+IfcB+^6cWtbf*r{IL5B{3< z5m_!om-n;ofujFO>{KuBe+RQ(VyAj}zdVxl z5m_!om-qYite4oSUOpczV7Q@wm%S2B6b>{KtGzjJUONc~r0r+WFk?qR*e zPWAHnej@87cB+^20p+Zh*r{I5AJns6VyAjJ-;iLv#7^~ce&R0HOYBrH=QGx@USg+u zIsdVl^%6VP%lVQ{)=TVEFXvZwvtDASdO07HdxYq}5m_!o_j>Sm_!om-Bh~te4oSUe5pdSTC_ty__$s zV!gyp^;`0Uzvi=EVyAjJAKAuwiJj`@{N*avOYBrH=Q}%CFR@d-oFCoBdWoIt<$P*4 z>m_!om-DYVL-_j7^RG_za=zBXdWoIt<^1kM)=TVEFXw|VWWB^r^>Y6BD%MNvR4?b7 zuVKB!Kcv3_{85;@l=IQVucZxtXxeWe@b#D%pbyPk5tj3NLmA8YGWs(RmCO0NQyI(o zxYHTS`Qb{&a{jrIv7Fz&m9d-;y`Qn1pIy&b&KJMVSk8Zb$XL$D?qw|JhYyCW;y()T zIog5?EO?3qUuMDe7JQ=x-)h0DE%;f1dA3#4UbEm&E!YJnvQqpJ7JRw|UtqyufwM*H zahxr<)q?M{;NM#CT7hAb_`GT<|Es{?%kobx_~0zPJ*je!1&_DjsTO>h1;;FSg$1v& z;0_CZ&4Rlu_-hM39G*nuQ}&OvV6O#VV!?3>zSDvqx8PR=##Vg(VZonUa5m=AVPA?* z^XNuA#)2nV@P!uqGQ=AZHX&?A_#?uf5dIh86@)({`~~4vge?eL5vWhUj_?M;n+ShJ zcpKqeg!d5shVXZUe;{-sbRld<*n#jq!UqT+B7B69MEDp1s~F}Etyp))ht(eO!OI*x_)&((sS~z1_x1#467ryXPm0tOBF^gVcUhAS~^;#mM=cd-s z$VFzn97{s$nzKwR&eC~?^=9cz_)1G7(^@k_Hmx)R6bs0N5yo|9sUpKFGxM4-X}Dj z^YS{maxBxLQ$t>+MUGr-S!`;`6>B}MSy*;y%Hn0FraUYnOD!@r75tzjyueh5dM_^( z`Lhj+OVc^}($X|cFDy;xS(cSr3&f&QYi{qxSQnHEh23gTS!%zSR4_6uB^3qs3rSN; z1LYtg*ZS#81yiNwg@TrBeVL#oPhSjZ$>Sx0SP>`|2=-bY=ufS%rIChCmzbuHIlV`- zu{Du~+OY+q*g8--C@d68^U!J1Wh&Z_YP@}g=aqAXp7us_Npp8m(^Z$Be9AvRTA!DAxbxQEzL*nyd%=&! zfB#=)pIuuqyx>Z$W6ZwSBlkYHa>*yBJvXm^VEuJ#b{_uFYb`6kdH&Gom$RqjJzcf) zUr+ve_Wa|YI&;SE9sQr({_DpUz3|b!59d`aKEHO;6DNP4d+i+;&;5SWWq$X^Z~o)s z`!0WB;?5uKd++g_GY@N6_~b7~j!mpDsfffMUif}8>w-Iu3A`Bk@;AR(o_E5sCr^Lu z#z%iUE3)z9x{mC>ZrwV^ebKCbJ=Z^Z{dG&KXv3h_kgOIS)-Tj&aeG>?c?XpKjqJd z>>Kmrp2f9SBpy3z+h+qFpMC$j-zTSk^~KMMhJ7|;*xm=8p1yI&QH{qR^vt=(uDa&+ zHzvLL%@rp-@#c~p)3$5(TvoZaD*vUxmzxS3>#Ao>-~7%!p$Xs3KcaQSsNb&J+4c+X a|NP;OOTMqX|CF;YDn9F9zx(qahW;OGU5pd} literal 0 HcmV?d00001 diff --git a/dist/index.js b/dist/index.js index a374d66b8..f45e2ac10 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,132 +1,11 @@ -module.exports = -/******/ (() => { // webpackBootstrap +require('./sourcemap-register.js');/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ 67387: -/***/ ((module) => { - -"use strict"; -module.exports = JSON.parse("{\"_from\":\"markdown-it@^10.0.0\",\"_id\":\"markdown-it@10.0.0\",\"_inBundle\":false,\"_integrity\":\"sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg==\",\"_location\":\"/@asyncapi/generator-filters/markdown-it\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"range\",\"registry\":true,\"raw\":\"markdown-it@^10.0.0\",\"name\":\"markdown-it\",\"escapedName\":\"markdown-it\",\"rawSpec\":\"^10.0.0\",\"saveSpec\":null,\"fetchSpec\":\"^10.0.0\"},\"_requiredBy\":[\"/@asyncapi/generator-filters\"],\"_resolved\":\"https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz\",\"_shasum\":\"abfc64f141b1722d663402044e43927f1f50a8dc\",\"_spec\":\"markdown-it@^10.0.0\",\"_where\":\"/Users/wookiee/sources/github-action-for-generator/node_modules/@asyncapi/generator/node_modules/@asyncapi/generator-filters\",\"bin\":{\"markdown-it\":\"bin/markdown-it.js\"},\"bugs\":{\"url\":\"https://github.com/markdown-it/markdown-it/issues\"},\"bundleDependencies\":false,\"dependencies\":{\"argparse\":\"^1.0.7\",\"entities\":\"~2.0.0\",\"linkify-it\":\"^2.0.0\",\"mdurl\":\"^1.0.1\",\"uc.micro\":\"^1.0.5\"},\"deprecated\":false,\"description\":\"Markdown-it - modern pluggable markdown parser.\",\"devDependencies\":{\"ansi\":\"^0.3.0\",\"autoprefixer-stylus\":\"^0.14.0\",\"benchmark\":\"~2.1.0\",\"browserify\":\"^16.3.0\",\"chai\":\"^4.2.0\",\"coveralls\":\"^3.0.4\",\"eslint\":\"^6.0.1\",\"express\":\"^4.14.0\",\"highlight.js\":\"^9.2.0\",\"istanbul\":\"^0.4.5\",\"markdown-it-abbr\":\"^1.0.4\",\"markdown-it-container\":\"^2.0.0\",\"markdown-it-deflist\":\"^2.0.0\",\"markdown-it-emoji\":\"^1.1.1\",\"markdown-it-footnote\":\"^3.0.1\",\"markdown-it-for-inline\":\"^0.1.0\",\"markdown-it-ins\":\"^2.0.0\",\"markdown-it-mark\":\"^2.0.0\",\"markdown-it-sub\":\"^1.0.0\",\"markdown-it-sup\":\"^1.0.0\",\"markdown-it-testgen\":\"^0.1.3\",\"mocha\":\"^6.1.4\",\"ndoc\":\"^5.0.0\",\"pug-cli\":\"^1.0.0-alpha6\",\"stylus\":\"^0.54.5\",\"supertest\":\"^4.0.2\",\"terser\":\"^4.1.2\"},\"files\":[\"index.js\",\"bin/\",\"lib/\",\"dist/\"],\"homepage\":\"https://github.com/markdown-it/markdown-it#readme\",\"keywords\":[\"markdown\",\"parser\",\"commonmark\",\"markdown-it\",\"markdown-it-plugin\"],\"license\":\"MIT\",\"main\":\"index.js\",\"name\":\"markdown-it\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/markdown-it/markdown-it.git\"},\"scripts\":{\"test\":\"make test\"},\"version\":\"10.0.0\"}"); - -/***/ }), - -/***/ 81195: -/***/ ((module) => { - -"use strict"; -module.exports = JSON.parse("{\"_from\":\"@asyncapi/generator-filters@^1.1.0\",\"_id\":\"@asyncapi/generator-filters@1.1.0\",\"_inBundle\":false,\"_integrity\":\"sha512-04Z2mMi3iv1jl7RZ1U5DX+Ruet5BOHLzEMSsl0vnYx2UZCM0AIlMvS6ph5JHv2AhBTD65a4Lfnsdr8qz0ybW+g==\",\"_location\":\"/@asyncapi/generator-filters\",\"_phantomChildren\":{\"argparse\":\"1.0.10\",\"entities\":\"2.0.3\",\"linkify-it\":\"2.2.0\",\"mdurl\":\"1.0.1\",\"uc.micro\":\"1.0.6\"},\"_requested\":{\"type\":\"range\",\"registry\":true,\"raw\":\"@asyncapi/generator-filters@^1.1.0\",\"name\":\"@asyncapi/generator-filters\",\"escapedName\":\"@asyncapi%2fgenerator-filters\",\"scope\":\"@asyncapi\",\"rawSpec\":\"^1.1.0\",\"saveSpec\":null,\"fetchSpec\":\"^1.1.0\"},\"_requiredBy\":[\"/@asyncapi/markdown-template\"],\"_resolved\":\"https://registry.npmjs.org/@asyncapi/generator-filters/-/generator-filters-1.1.0.tgz\",\"_shasum\":\"d6869fc1468a1d4ea3f7f20d463e7283e4aaa13c\",\"_spec\":\"@asyncapi/generator-filters@^1.1.0\",\"_where\":\"/Users/wookiee/sources/github-action-for-generator/node_modules/@asyncapi/generator/node_modules/@asyncapi/markdown-template\",\"author\":{\"name\":\"Lukasz Gornicki\",\"email\":\"lpgornicki@gmail.com\"},\"ava\":{\"files\":[\"./src/*.test.js\"]},\"bugs\":{\"url\":\"https://github.com/asyncapi/generator-filters/issues\"},\"bundleDependencies\":false,\"dependencies\":{\"lodash\":\"^4.17.15\",\"markdown-it\":\"^10.0.0\",\"openapi-sampler\":\"1.0.0-beta.17\"},\"deprecated\":false,\"description\":\"Library with Nunjucks filters for templates using AsyncAPI Generator\",\"devDependencies\":{\"@semantic-release/commit-analyzer\":\"^8.0.1\",\"@semantic-release/github\":\"^7.0.4\",\"@semantic-release/npm\":\"^7.0.3\",\"@semantic-release/release-notes-generator\":\"^9.0.1\",\"ava\":\"^3.7.0\",\"conventional-changelog-conventionalcommits\":\"^4.2.3\",\"eslint\":\"^6.8.0\",\"eslint-plugin-sonarjs\":\"^0.5.0\",\"jsdoc-to-markdown\":\"^5.0.3\",\"semantic-release\":\"^17.0.4\"},\"homepage\":\"https://github.com/asyncapi/generator-filters#readme\",\"keywords\":[\"asyncapi\",\"generator\",\"nunjucks\"],\"license\":\"Apache-2.0\",\"main\":\"src/index.js\",\"name\":\"@asyncapi/generator-filters\",\"publishConfig\":{\"access\":\"public\"},\"release\":{\"branches\":[\"master\"],\"plugins\":[[\"@semantic-release/commit-analyzer\",{\"preset\":\"conventionalcommits\"}],[\"@semantic-release/release-notes-generator\",{\"preset\":\"conventionalcommits\"}],\"@semantic-release/npm\",\"@semantic-release/github\"]},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/asyncapi/generator-filters.git\"},\"scripts\":{\"docs\":\"jsdoc2md src/customFilters.js > docs/api.md\",\"get-version\":\"echo $npm_package_version\",\"lint\":\"eslint --config .eslintrc .\",\"lint-fix\":\"eslint --fix --config .eslintrc .\",\"release\":\"semantic-release\",\"test\":\"ava\"},\"version\":\"1.1.0\"}"); - -/***/ }), - -/***/ 65035: -/***/ ((module) => { - -"use strict"; -module.exports = JSON.parse("{\"_from\":\"@asyncapi/markdown-template@0.10.0\",\"_id\":\"@asyncapi/markdown-template@0.10.0\",\"_inBundle\":false,\"_integrity\":\"sha512-B7DUJ3R3Z0R47g2A4uj+K/xrXSNPhZnGTYMb5xxZCx+qniti2Sad8nWSuCA2xB7O3BCZiotbN9PZGCs/tIz7Rw==\",\"_location\":\"/@asyncapi/markdown-template\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"version\",\"registry\":true,\"raw\":\"@asyncapi/markdown-template@0.10.0\",\"name\":\"@asyncapi/markdown-template\",\"escapedName\":\"@asyncapi%2fmarkdown-template\",\"scope\":\"@asyncapi\",\"rawSpec\":\"0.10.0\",\"saveSpec\":null,\"fetchSpec\":\"0.10.0\"},\"_requiredBy\":[\"#USER\"],\"_resolved\":\"https://registry.npmjs.org/@asyncapi/markdown-template/-/markdown-template-0.10.0.tgz\",\"_shasum\":\"7c61f61b01daa68331e695547af6373d67b53baa\",\"_spec\":\"@asyncapi/markdown-template@0.10.0\",\"_where\":\"/Users/wookiee/sources/github-action-for-generator\",\"author\":{\"name\":\"Fran Mendez\",\"email\":\"fmvilas@gmail.com\",\"url\":\"fmvilas.com\"},\"bugs\":{\"url\":\"https://github.com/asyncapi/markdown-template/issues\"},\"bundleDependencies\":false,\"dependencies\":{\"@asyncapi/generator-filters\":\"^1.1.0\"},\"deprecated\":false,\"description\":\"Markdown template for the AsyncAPI generator.\",\"devDependencies\":{\"@semantic-release/commit-analyzer\":\"^8.0.1\",\"@semantic-release/github\":\"^7.0.4\",\"@semantic-release/npm\":\"^7.0.3\",\"@semantic-release/release-notes-generator\":\"^9.0.1\",\"conventional-changelog-conventionalcommits\":\"^4.2.3\",\"semantic-release\":\"^17.0.4\"},\"generator\":{\"generator\":\">=0.50.0 <2.0.0\",\"filters\":[\"@asyncapi/generator-filters\"],\"parameters\":{\"outFilename\":{\"description\":\"The name of the output markdown file\",\"default\":\"asyncapi.md\",\"required\":false}}},\"homepage\":\"https://github.com/asyncapi/markdown-template#readme\",\"keywords\":[\"asyncapi\",\"generator\",\"markdown\",\"template\"],\"license\":\"Apache-2.0\",\"name\":\"@asyncapi/markdown-template\",\"publishConfig\":{\"access\":\"public\"},\"release\":{\"branches\":[\"master\"],\"plugins\":[[\"@semantic-release/commit-analyzer\",{\"preset\":\"conventionalcommits\"}],[\"@semantic-release/release-notes-generator\",{\"preset\":\"conventionalcommits\"}],\"@semantic-release/npm\",\"@semantic-release/github\"]},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/asyncapi/markdown-template.git\"},\"scripts\":{\"dev\":\"ag test/spec/asyncapi.yml ./ -o test/output --force-write --watch-template\",\"get-version\":\"echo $npm_package_version\",\"release\":\"semantic-release\",\"test\":\"echo \\\"No test specified yet\\\"\"},\"version\":\"0.10.0\"}"); - -/***/ }), - -/***/ 30313: -/***/ ((module) => { - -"use strict"; -module.exports = JSON.parse("{\"_from\":\"argparse@^1.0.7\",\"_id\":\"argparse@1.0.10\",\"_inBundle\":false,\"_integrity\":\"sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==\",\"_location\":\"/argparse\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"range\",\"registry\":true,\"raw\":\"argparse@^1.0.7\",\"name\":\"argparse\",\"escapedName\":\"argparse\",\"rawSpec\":\"^1.0.7\",\"saveSpec\":null,\"fetchSpec\":\"^1.0.7\"},\"_requiredBy\":[\"/@asyncapi/generator-filters/markdown-it\"],\"_resolved\":\"https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz\",\"_shasum\":\"bcd6791ea5ae09725e17e5ad988134cd40b3d911\",\"_spec\":\"argparse@^1.0.7\",\"_where\":\"/Users/wookiee/sources/github-action-for-generator/node_modules/@asyncapi/generator/node_modules/@asyncapi/generator-filters/node_modules/markdown-it\",\"bugs\":{\"url\":\"https://github.com/nodeca/argparse/issues\"},\"bundleDependencies\":false,\"contributors\":[{\"name\":\"Eugene Shkuropat\"},{\"name\":\"Paul Jacobson\"}],\"dependencies\":{\"sprintf-js\":\"~1.0.2\"},\"deprecated\":false,\"description\":\"Very powerful CLI arguments parser. Native port of argparse - python's options parsing library\",\"devDependencies\":{\"eslint\":\"^2.13.1\",\"istanbul\":\"^0.4.5\",\"mocha\":\"^3.1.0\",\"ndoc\":\"^5.0.1\"},\"files\":[\"index.js\",\"lib/\"],\"homepage\":\"https://github.com/nodeca/argparse#readme\",\"keywords\":[\"cli\",\"parser\",\"argparse\",\"option\",\"args\"],\"license\":\"MIT\",\"name\":\"argparse\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/nodeca/argparse.git\"},\"scripts\":{\"test\":\"make test\"},\"version\":\"1.0.10\"}"); - -/***/ }), - -/***/ 50274: -/***/ ((module) => { - -"use strict"; -module.exports = JSON.parse("{\"_from\":\"commander@^6.1.0\",\"_id\":\"commander@6.2.0\",\"_inBundle\":false,\"_integrity\":\"sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==\",\"_location\":\"/@asyncapi/generator/commander\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"range\",\"registry\":true,\"raw\":\"commander@^6.1.0\",\"name\":\"commander\",\"escapedName\":\"commander\",\"rawSpec\":\"^6.1.0\",\"saveSpec\":null,\"fetchSpec\":\"^6.1.0\"},\"_requiredBy\":[\"/@asyncapi/generator\"],\"_resolved\":\"https://registry.npmjs.org/commander/-/commander-6.2.0.tgz\",\"_shasum\":\"b990bfb8ac030aedc6d11bc04d1488ffef56db75\",\"_spec\":\"commander@^6.1.0\",\"_where\":\"/Users/wookiee/sources/github-action-for-generator/node_modules/@asyncapi/generator\",\"author\":{\"name\":\"TJ Holowaychuk\",\"email\":\"tj@vision-media.ca\"},\"bugs\":{\"url\":\"https://github.com/tj/commander.js/issues\"},\"bundleDependencies\":false,\"dependencies\":{},\"deprecated\":false,\"description\":\"the complete solution for node.js command-line programs\",\"devDependencies\":{\"@types/jest\":\"^26.0.15\",\"@types/node\":\"^14.14.2\",\"@typescript-eslint/eslint-plugin\":\"^4.5.0\",\"eslint\":\"^7.11.0\",\"eslint-config-standard-with-typescript\":\"^19.0.1\",\"eslint-plugin-jest\":\"^24.1.0\",\"jest\":\"^26.6.0\",\"standard\":\"^15.0.0\",\"typescript\":\"^4.0.3\"},\"engines\":{\"node\":\">= 6\"},\"files\":[\"index.js\",\"typings/index.d.ts\"],\"homepage\":\"https://github.com/tj/commander.js#readme\",\"jest\":{\"collectCoverage\":true},\"keywords\":[\"commander\",\"command\",\"option\",\"parser\",\"cli\",\"argument\",\"args\",\"argv\"],\"license\":\"MIT\",\"main\":\"index\",\"name\":\"commander\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/tj/commander.js.git\"},\"scripts\":{\"lint\":\"eslint index.js \\\"tests/**/*.js\\\"\",\"test\":\"jest && npm run test-typings\",\"test-typings\":\"tsc -p tsconfig.json\",\"typescript-lint\":\"eslint typings/*.ts\"},\"typings\":\"typings/index.d.ts\",\"version\":\"6.2.0\"}"); - -/***/ }), - -/***/ 99589: -/***/ ((module) => { - -"use strict"; -module.exports = JSON.parse("{\"_from\":\"entities@~2.0.0\",\"_id\":\"entities@2.0.3\",\"_inBundle\":false,\"_integrity\":\"sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==\",\"_location\":\"/entities\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"range\",\"registry\":true,\"raw\":\"entities@~2.0.0\",\"name\":\"entities\",\"escapedName\":\"entities\",\"rawSpec\":\"~2.0.0\",\"saveSpec\":null,\"fetchSpec\":\"~2.0.0\"},\"_requiredBy\":[\"/@asyncapi/generator-filters/markdown-it\"],\"_resolved\":\"https://registry.npmjs.org/entities/-/entities-2.0.3.tgz\",\"_shasum\":\"5c487e5742ab93c15abb5da22759b8590ec03b7f\",\"_spec\":\"entities@~2.0.0\",\"_where\":\"/Users/wookiee/sources/github-action-for-generator/node_modules/@asyncapi/generator/node_modules/@asyncapi/generator-filters/node_modules/markdown-it\",\"author\":{\"name\":\"Felix Boehm\",\"email\":\"me@feedic.com\"},\"bugs\":{\"url\":\"https://github.com/fb55/entities/issues\"},\"bundleDependencies\":false,\"deprecated\":false,\"description\":\"Encode & decode XML and HTML entities with ease\",\"devDependencies\":{\"@types/jest\":\"^25.1.4\",\"@types/node\":\"^14.0.6\",\"@typescript-eslint/eslint-plugin\":\"^2.31.0\",\"@typescript-eslint/parser\":\"^2.31.0\",\"coveralls\":\"*\",\"eslint\":\"^7.0.0\",\"eslint-config-prettier\":\"^6.0.0\",\"jest\":\"^26.0.1\",\"prettier\":\"^2.0.5\",\"ts-jest\":\"^26.1.0\",\"typescript\":\"^3.5.3\"},\"directories\":{\"lib\":\"lib/\"},\"files\":[\"lib/**/*\"],\"homepage\":\"https://github.com/fb55/entities#readme\",\"jest\":{\"preset\":\"ts-jest\",\"testEnvironment\":\"node\"},\"keywords\":[\"entity\",\"decoding\",\"encoding\",\"html\",\"xml\",\"html entities\"],\"license\":\"BSD-2-Clause\",\"main\":\"lib/index.js\",\"name\":\"entities\",\"prettier\":{\"tabWidth\":4},\"repository\":{\"type\":\"git\",\"url\":\"git://github.com/fb55/entities.git\"},\"scripts\":{\"build\":\"tsc\",\"coverage\":\"cat coverage/lcov.info | coveralls\",\"format\":\"prettier --write **/*.{ts,md}\",\"lint\":\"eslint --ext=js,ts src\",\"prepare\":\"npm run build\",\"test\":\"jest --coverage && npm run lint\"},\"sideEffects\":false,\"types\":\"lib/index.d.ts\",\"version\":\"2.0.3\"}"); - -/***/ }), - -/***/ 99945: -/***/ ((module) => { - -"use strict"; -module.exports = JSON.parse("{\"_from\":\"foreach@^2.0.4\",\"_id\":\"foreach@2.0.5\",\"_inBundle\":false,\"_integrity\":\"sha1-C+4AUBiusmDQo6865ljdATbsG5k=\",\"_location\":\"/foreach\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"range\",\"registry\":true,\"raw\":\"foreach@^2.0.4\",\"name\":\"foreach\",\"escapedName\":\"foreach\",\"rawSpec\":\"^2.0.4\",\"saveSpec\":null,\"fetchSpec\":\"^2.0.4\"},\"_requiredBy\":[\"/json-pointer\"],\"_resolved\":\"https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz\",\"_shasum\":\"0bee005018aeb260d0a3af3ae658dd0136ec1b99\",\"_spec\":\"foreach@^2.0.4\",\"_where\":\"/Users/wookiee/sources/github-action-for-generator/node_modules/@asyncapi/generator/node_modules/json-pointer\",\"author\":{\"name\":\"Manuel Stofer\",\"email\":\"manuel@takimata.ch\"},\"bugs\":{\"url\":\"https://github.com/manuelstofer/foreach/issues\"},\"bundleDependencies\":false,\"contributors\":[{\"name\":\"Manuel Stofer\"},{\"name\":\"Jordan Harband\",\"url\":\"https://github.com/ljharb\"}],\"dependencies\":{},\"deprecated\":false,\"description\":\"foreach component + npm package\",\"devDependencies\":{\"covert\":\"*\",\"tape\":\"*\"},\"homepage\":\"https://github.com/manuelstofer/foreach#readme\",\"keywords\":[\"shim\",\"Array.prototype.forEach\",\"forEach\",\"Array#forEach\",\"each\"],\"license\":\"MIT\",\"main\":\"index.js\",\"name\":\"foreach\",\"repository\":{\"type\":\"git\",\"url\":\"git://github.com/manuelstofer/foreach.git\"},\"scripts\":{\"coverage\":\"covert test.js\",\"coverage-quiet\":\"covert --quiet test.js\",\"test\":\"node test.js\"},\"testling\":{\"files\":\"test.js\",\"browsers\":[\"iexplore/6.0..latest\",\"firefox/3.0\",\"firefox/15.0..latest\",\"firefox/nightly\",\"chrome/4.0\",\"chrome/22.0..latest\",\"chrome/canary\",\"opera/10.0..latest\",\"opera/next\",\"safari/5.0.5..latest\",\"ipad/6.0..latest\",\"iphone/6.0..latest\",\"android-browser/4.2\"]},\"version\":\"2.0.5\"}"); - -/***/ }), - -/***/ 46587: -/***/ ((module) => { - -"use strict"; -module.exports = JSON.parse("{\"_from\":\"json-pointer@^0.6.0\",\"_id\":\"json-pointer@0.6.1\",\"_inBundle\":false,\"_integrity\":\"sha512-3OvjqKdCBvH41DLpV4iSt6v2XhZXV1bPB4OROuknvUXI7ZQNofieCPkmE26stEJ9zdQuvIxDHCuYhfgxFAAs+Q==\",\"_location\":\"/json-pointer\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"range\",\"registry\":true,\"raw\":\"json-pointer@^0.6.0\",\"name\":\"json-pointer\",\"escapedName\":\"json-pointer\",\"rawSpec\":\"^0.6.0\",\"saveSpec\":null,\"fetchSpec\":\"^0.6.0\"},\"_requiredBy\":[\"/openapi-sampler\"],\"_resolved\":\"https://registry.npmjs.org/json-pointer/-/json-pointer-0.6.1.tgz\",\"_shasum\":\"3c6caa6ac139e2599f5a1659d39852154015054d\",\"_spec\":\"json-pointer@^0.6.0\",\"_where\":\"/Users/wookiee/sources/github-action-for-generator/node_modules/@asyncapi/generator/node_modules/openapi-sampler\",\"author\":{\"name\":\"Manuel Stofer\",\"email\":\"manuel@smallpdf.com\"},\"bugs\":{\"url\":\"https://github.com/manuelstofer/json-pointer/issues\"},\"bundleDependencies\":false,\"dependencies\":{\"foreach\":\"^2.0.4\"},\"deprecated\":false,\"description\":\"Some utilities for JSON pointers described by RFC 6901\",\"devDependencies\":{\"chai\":\"^1.9.1\",\"coveralls\":\"^2.11.14\",\"mocha\":\"^1.9.0\",\"nyc\":\"^8.3.1\",\"seamless-immutable\":\"^5.1.1\"},\"homepage\":\"https://github.com/manuelstofer/json-pointer\",\"license\":\"MIT\",\"name\":\"json-pointer\",\"nyc\":{\"exclude\":[\"test\",\"node_modules\"],\"reporter\":[\"lcov\",\"text-summary\"]},\"repository\":{\"type\":\"git\",\"url\":\"git://github.com/manuelstofer/json-pointer.git\"},\"scripts\":{\"test\":\"nyc make test\"},\"version\":\"0.6.1\"}"); - -/***/ }), - -/***/ 6016: -/***/ ((module) => { - -"use strict"; -module.exports = JSON.parse("{\"_from\":\"linkify-it@^2.0.0\",\"_id\":\"linkify-it@2.2.0\",\"_inBundle\":false,\"_integrity\":\"sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==\",\"_location\":\"/linkify-it\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"range\",\"registry\":true,\"raw\":\"linkify-it@^2.0.0\",\"name\":\"linkify-it\",\"escapedName\":\"linkify-it\",\"rawSpec\":\"^2.0.0\",\"saveSpec\":null,\"fetchSpec\":\"^2.0.0\"},\"_requiredBy\":[\"/@asyncapi/generator-filters/markdown-it\"],\"_resolved\":\"https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz\",\"_shasum\":\"e3b54697e78bf915c70a38acd78fd09e0058b1cf\",\"_spec\":\"linkify-it@^2.0.0\",\"_where\":\"/Users/wookiee/sources/github-action-for-generator/node_modules/@asyncapi/generator/node_modules/@asyncapi/generator-filters/node_modules/markdown-it\",\"bugs\":{\"url\":\"https://github.com/markdown-it/linkify-it/issues\"},\"bundleDependencies\":false,\"dependencies\":{\"uc.micro\":\"^1.0.1\"},\"deprecated\":false,\"description\":\"Links recognition library with FULL unicode support\",\"devDependencies\":{\"ansi\":\"^0.3.0\",\"autoprefixer-stylus\":\"^0.14.0\",\"benchmark\":\"^2.1.0\",\"browserify\":\"^16.2.3\",\"chai\":\"^4.2.0\",\"coveralls\":\"^3.0.2\",\"eslint\":\"^5.9.0\",\"istanbul\":\"^0.4.5\",\"jade\":\"^1.11.0\",\"mdurl\":\"^1.0.0\",\"mocha\":\"^5.2.0\",\"ndoc\":\"^5.0.1\",\"stylus\":\"~0.54.5\",\"tlds\":\"^1.166.0\"},\"files\":[\"index.js\",\"lib/\"],\"homepage\":\"https://github.com/markdown-it/linkify-it#readme\",\"keywords\":[\"linkify\",\"linkifier\",\"autolink\",\"autolinker\"],\"license\":\"MIT\",\"name\":\"linkify-it\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/markdown-it/linkify-it.git\"},\"scripts\":{\"test\":\"make test\"},\"version\":\"2.2.0\"}"); - -/***/ }), - -/***/ 77234: -/***/ ((module) => { - -"use strict"; -module.exports = JSON.parse("{\"_from\":\"lodash@^4.17.15\",\"_id\":\"lodash@4.17.20\",\"_inBundle\":false,\"_integrity\":\"sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==\",\"_location\":\"/lodash\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"range\",\"registry\":true,\"raw\":\"lodash@^4.17.15\",\"name\":\"lodash\",\"escapedName\":\"lodash\",\"rawSpec\":\"^4.17.15\",\"saveSpec\":null,\"fetchSpec\":\"^4.17.15\"},\"_requiredBy\":[\"/@asyncapi/generator-filters\"],\"_resolved\":\"https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz\",\"_shasum\":\"b44a9b6297bcb698f1c51a3545a2b3b368d59c52\",\"_spec\":\"lodash@^4.17.15\",\"_where\":\"/Users/wookiee/sources/github-action-for-generator/node_modules/@asyncapi/generator/node_modules/@asyncapi/generator-filters\",\"author\":{\"name\":\"John-David Dalton\",\"email\":\"john.david.dalton@gmail.com\"},\"bugs\":{\"url\":\"https://github.com/lodash/lodash/issues\"},\"bundleDependencies\":false,\"contributors\":[{\"name\":\"John-David Dalton\",\"email\":\"john.david.dalton@gmail.com\"},{\"name\":\"Mathias Bynens\",\"email\":\"mathias@qiwi.be\"}],\"deprecated\":false,\"description\":\"Lodash modular utilities.\",\"homepage\":\"https://lodash.com/\",\"icon\":\"https://lodash.com/icon.svg\",\"keywords\":[\"modules\",\"stdlib\",\"util\"],\"license\":\"MIT\",\"main\":\"lodash.js\",\"name\":\"lodash\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/lodash/lodash.git\"},\"scripts\":{\"test\":\"echo \\\"See https://travis-ci.org/lodash-archive/lodash-cli for testing details.\\\"\"},\"version\":\"4.17.20\"}"); - -/***/ }), - -/***/ 42896: -/***/ ((module) => { - -"use strict"; -module.exports = JSON.parse("{\"_from\":\"mdurl@^1.0.1\",\"_id\":\"mdurl@1.0.1\",\"_inBundle\":false,\"_integrity\":\"sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=\",\"_location\":\"/mdurl\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"range\",\"registry\":true,\"raw\":\"mdurl@^1.0.1\",\"name\":\"mdurl\",\"escapedName\":\"mdurl\",\"rawSpec\":\"^1.0.1\",\"saveSpec\":null,\"fetchSpec\":\"^1.0.1\"},\"_requiredBy\":[\"/@asyncapi/generator-filters/markdown-it\"],\"_resolved\":\"https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz\",\"_shasum\":\"fe85b2ec75a59037f2adfec100fd6c601761152e\",\"_spec\":\"mdurl@^1.0.1\",\"_where\":\"/Users/wookiee/sources/github-action-for-generator/node_modules/@asyncapi/generator/node_modules/@asyncapi/generator-filters/node_modules/markdown-it\",\"bugs\":{\"url\":\"https://github.com/markdown-it/mdurl/issues\"},\"bundleDependencies\":false,\"deprecated\":false,\"description\":\"URL utilities for markdown-it\",\"devDependencies\":{\"eslint\":\"0.13.0\",\"eslint-plugin-nodeca\":\"^1.0.0\",\"istanbul\":\"*\",\"mocha\":\"*\"},\"homepage\":\"https://github.com/markdown-it/mdurl#readme\",\"license\":\"MIT\",\"name\":\"mdurl\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/markdown-it/mdurl.git\"},\"scripts\":{\"test\":\"make test\"},\"version\":\"1.0.1\"}"); - -/***/ }), - -/***/ 10525: -/***/ ((module) => { - -"use strict"; -module.exports = JSON.parse("{\"_from\":\"openapi-sampler@1.0.0-beta.17\",\"_id\":\"openapi-sampler@1.0.0-beta.17\",\"_inBundle\":false,\"_integrity\":\"sha512-xYGPaPaEQFFAGQVrRpunkb8loNfL1rq4fJ+q7NH+LVBsrHKGUicD2f5Rzw6fWcRwwcOvnKD/aik9guiNWq2kpA==\",\"_location\":\"/openapi-sampler\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"version\",\"registry\":true,\"raw\":\"openapi-sampler@1.0.0-beta.17\",\"name\":\"openapi-sampler\",\"escapedName\":\"openapi-sampler\",\"rawSpec\":\"1.0.0-beta.17\",\"saveSpec\":null,\"fetchSpec\":\"1.0.0-beta.17\"},\"_requiredBy\":[\"/@asyncapi/generator-filters\"],\"_resolved\":\"https://registry.npmjs.org/openapi-sampler/-/openapi-sampler-1.0.0-beta.17.tgz\",\"_shasum\":\"45814ed929d8b5af1b71e5d545a0134c70346daa\",\"_spec\":\"openapi-sampler@1.0.0-beta.17\",\"_where\":\"/Users/wookiee/sources/github-action-for-generator/node_modules/@asyncapi/generator/node_modules/@asyncapi/generator-filters\",\"author\":{\"name\":\"Roman Hotsiy\",\"email\":\"gotsijroman@gmail.com\"},\"browserslist\":\"> 0.25%, not dead\",\"bugs\":{\"url\":\"https://github.com/APIs-guru/openapi-sampler/issues\"},\"bundleDependencies\":false,\"dependencies\":{\"json-pointer\":\"^0.6.0\"},\"deprecated\":false,\"description\":\"Tool for generation samples based on OpenAPI payload/response schema\",\"devDependencies\":{\"@babel/core\":\"^7.7.2\",\"@babel/preset-env\":\"^7.7.1\",\"@babel/register\":\"^7.7.0\",\"babel-eslint\":\"^10.0.3\",\"babel-loader\":\"^8.0.6\",\"babel-plugin-istanbul\":\"^5.2.0\",\"babelify\":\"^10.0.0\",\"browserify\":\"^16.5.0\",\"browserify-istanbul\":\"^3.0.1\",\"chai\":\"^4.2.0\",\"core-js\":\"^3.4.1\",\"coveralls\":\"^3.0.7\",\"del\":\"^5.1.0\",\"glob\":\"^7.1.6\",\"gulp\":\"^4.0.2\",\"gulp-eslint\":\"^6.0.0\",\"gulp-filter\":\"^6.0.0\",\"gulp-istanbul\":\"^1.1.3\",\"gulp-livereload\":\"^4.0.2\",\"gulp-load-plugins\":\"^2.0.1\",\"gulp-mocha\":\"^7.0.2\",\"gulp-plumber\":\"^1.2.1\",\"gulp-rename\":\"^1.4.0\",\"gulp-sourcemaps\":\"^2.6.5\",\"gulp-uglify\":\"^3.0.2\",\"json-loader\":\"^0.5.7\",\"karma\":\"^4.4.1\",\"karma-babel-preprocessor\":\"^8.0.1\",\"karma-browserify\":\"^6.1.0\",\"karma-chrome-launcher\":\"^3.1.0\",\"karma-coverage\":\"^2.0.1\",\"karma-firefox-launcher\":\"^1.2.0\",\"karma-mocha\":\"^1.3.0\",\"karma-mocha-reporter\":\"^2.2.5\",\"karma-phantomjs-launcher\":\"^1.0.4\",\"karma-sinon-chai\":\"^2.0.2\",\"lolex\":\"^5.1.1\",\"mocha\":\"^6.2.2\",\"phantomjs-prebuilt\":\"^2.1.16\",\"sinon\":\"^7.5.0\",\"sinon-chai\":\"^3.3.0\",\"vinyl-buffer\":\"^1.0.1\",\"vinyl-source-stream\":\"^2.0.0\"},\"homepage\":\"https://github.com/APIs-guru/openapi-sampler/\",\"keywords\":[\"OpenAPI\",\"Swagger\",\"instantiator\",\"sampler\",\"faker\"],\"license\":\"MIT\",\"main\":\"dist/openapi-sampler.js\",\"module\":\"src/openapi-sampler.js\",\"name\":\"openapi-sampler\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/APIs-guru/openapi-sampler.git\"},\"scripts\":{\"build\":\"gulp build\",\"build-dist\":\"gulp build\",\"coverage\":\"gulp coverage\",\"lint\":\"gulp lint\",\"prepublish\":\"npm run build\",\"test\":\"gulp\",\"test-browser\":\"gulp test-browser\",\"watch\":\"gulp watch\"},\"version\":\"1.0.0-beta.17\"}"); - -/***/ }), - -/***/ 9968: -/***/ ((module) => { - -"use strict"; -module.exports = JSON.parse("{\"_from\":\"semver@^7.3.2\",\"_id\":\"semver@7.3.2\",\"_inBundle\":false,\"_integrity\":\"sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==\",\"_location\":\"/@asyncapi/generator/semver\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"range\",\"registry\":true,\"raw\":\"semver@^7.3.2\",\"name\":\"semver\",\"escapedName\":\"semver\",\"rawSpec\":\"^7.3.2\",\"saveSpec\":null,\"fetchSpec\":\"^7.3.2\"},\"_requiredBy\":[\"/@asyncapi/generator\"],\"_resolved\":\"https://registry.npmjs.org/semver/-/semver-7.3.2.tgz\",\"_shasum\":\"604962b052b81ed0786aae84389ffba70ffd3938\",\"_spec\":\"semver@^7.3.2\",\"_where\":\"/Users/wookiee/sources/github-action-for-generator/node_modules/@asyncapi/generator\",\"bin\":{\"semver\":\"bin/semver.js\"},\"bugs\":{\"url\":\"https://github.com/npm/node-semver/issues\"},\"bundleDependencies\":false,\"deprecated\":false,\"description\":\"The semantic version parser used by npm.\",\"devDependencies\":{\"tap\":\"^14.10.7\"},\"engines\":{\"node\":\">=10\"},\"files\":[\"bin/**/*.js\",\"range.bnf\",\"classes/**/*.js\",\"functions/**/*.js\",\"internal/**/*.js\",\"ranges/**/*.js\",\"index.js\",\"preload.js\"],\"homepage\":\"https://github.com/npm/node-semver#readme\",\"license\":\"ISC\",\"main\":\"index.js\",\"name\":\"semver\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/npm/node-semver.git\"},\"scripts\":{\"postpublish\":\"git push origin --follow-tags\",\"postversion\":\"npm publish\",\"preversion\":\"npm test\",\"snap\":\"tap\",\"test\":\"tap\"},\"tap\":{\"check-coverage\":true,\"coverage-map\":\"map.js\"},\"version\":\"7.3.2\"}"); - -/***/ }), - -/***/ 87475: -/***/ ((module) => { - -"use strict"; -module.exports = JSON.parse("{\"_from\":\"sprintf-js@~1.0.2\",\"_id\":\"sprintf-js@1.0.3\",\"_inBundle\":false,\"_integrity\":\"sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=\",\"_location\":\"/sprintf-js\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"range\",\"registry\":true,\"raw\":\"sprintf-js@~1.0.2\",\"name\":\"sprintf-js\",\"escapedName\":\"sprintf-js\",\"rawSpec\":\"~1.0.2\",\"saveSpec\":null,\"fetchSpec\":\"~1.0.2\"},\"_requiredBy\":[\"/argparse\"],\"_resolved\":\"https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz\",\"_shasum\":\"04e6926f662895354f3dd015203633b857297e2c\",\"_spec\":\"sprintf-js@~1.0.2\",\"_where\":\"/Users/wookiee/sources/github-action-for-generator/node_modules/@asyncapi/generator/node_modules/argparse\",\"author\":{\"name\":\"Alexandru Marasteanu\",\"email\":\"hello@alexei.ro\",\"url\":\"http://alexei.ro/\"},\"bugs\":{\"url\":\"https://github.com/alexei/sprintf.js/issues\"},\"bundleDependencies\":false,\"deprecated\":false,\"description\":\"JavaScript sprintf implementation\",\"devDependencies\":{\"grunt\":\"*\",\"grunt-contrib-uglify\":\"*\",\"grunt-contrib-watch\":\"*\",\"mocha\":\"*\"},\"homepage\":\"https://github.com/alexei/sprintf.js#readme\",\"license\":\"BSD-3-Clause\",\"main\":\"src/sprintf.js\",\"name\":\"sprintf-js\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/alexei/sprintf.js.git\"},\"scripts\":{\"test\":\"mocha test/test.js\"},\"version\":\"1.0.3\"}"); - -/***/ }), - -/***/ 19909: -/***/ ((module) => { - -"use strict"; -module.exports = JSON.parse("{\"_from\":\"uc.micro@^1.0.5\",\"_id\":\"uc.micro@1.0.6\",\"_inBundle\":false,\"_integrity\":\"sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==\",\"_location\":\"/uc.micro\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"range\",\"registry\":true,\"raw\":\"uc.micro@^1.0.5\",\"name\":\"uc.micro\",\"escapedName\":\"uc.micro\",\"rawSpec\":\"^1.0.5\",\"saveSpec\":null,\"fetchSpec\":\"^1.0.5\"},\"_requiredBy\":[\"/@asyncapi/generator-filters/markdown-it\",\"/linkify-it\"],\"_resolved\":\"https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz\",\"_shasum\":\"9c411a802a409a91fc6cf74081baba34b24499ac\",\"_spec\":\"uc.micro@^1.0.5\",\"_where\":\"/Users/wookiee/sources/github-action-for-generator/node_modules/@asyncapi/generator/node_modules/@asyncapi/generator-filters/node_modules/markdown-it\",\"bugs\":{\"url\":\"https://github.com/markdown-it/uc.micro/issues\"},\"bundleDependencies\":false,\"deprecated\":false,\"description\":\"Micro subset of unicode data files for markdown-it projects.\",\"devDependencies\":{\"mocha\":\"^5.0.0\",\"shelljs\":\"^0.8.1\",\"unicode-11.0.0\":\"^0.7.8\"},\"files\":[\"categories/\",\"properties/\",\"index.js\"],\"homepage\":\"https://github.com/markdown-it/uc.micro#readme\",\"license\":\"MIT\",\"name\":\"uc.micro\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/markdown-it/uc.micro.git\"},\"scripts\":{\"test\":\"mocha\",\"update\":\"node update.js && npm test\"},\"version\":\"1.0.6\"}"); - -/***/ }), - /***/ 94532: /***/ ((module) => { "use strict"; -module.exports = JSON.parse("{\"_from\":\"@asyncapi/generator@1.0.1\",\"_id\":\"@asyncapi/generator@1.0.1\",\"_inBundle\":false,\"_integrity\":\"sha512-vg2TvzQK9tT7gGzqI2W6kPv62rfi3Iht+yW//mYz+eWdHxCestlQD0iyUxFuS7K+jMor2kfvJEFaOzjRr/JSRg==\",\"_location\":\"/@asyncapi/generator\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"version\",\"registry\":true,\"raw\":\"@asyncapi/generator@1.0.1\",\"name\":\"@asyncapi/generator\",\"escapedName\":\"@asyncapi%2fgenerator\",\"scope\":\"@asyncapi\",\"rawSpec\":\"1.0.1\",\"saveSpec\":null,\"fetchSpec\":\"1.0.1\"},\"_requiredBy\":[\"/\"],\"_resolved\":\"https://registry.npmjs.org/@asyncapi/generator/-/generator-1.0.1.tgz\",\"_shasum\":\"c314de4f60efede036c8f9ba118dc0775b7f601c\",\"_spec\":\"@asyncapi/generator@1.0.1\",\"_where\":\"/Users/wookiee/sources/github-action-for-generator\",\"author\":{\"name\":\"Fran Mendez\",\"email\":\"fmvilas@gmail.com\"},\"bin\":{\"asyncapi-generator\":\"cli.js\",\"ag\":\"cli.js\"},\"bugs\":{\"url\":\"https://github.com/asyncapi/generator/issues\"},\"bundleDependencies\":false,\"dependencies\":{\"@asyncapi/avro-schema-parser\":\"^0.2.0\",\"@asyncapi/openapi-schema-parser\":\"^2.0.0\",\"@asyncapi/parser\":\"^1.1.1\",\"@asyncapi/raml-dt-schema-parser\":\"^2.0.0\",\"ajv\":\"^6.10.2\",\"commander\":\"^6.1.0\",\"filenamify\":\"^4.1.0\",\"fs.extra\":\"^1.3.2\",\"jmespath\":\"^0.15.0\",\"js-yaml\":\"^3.13.1\",\"levenshtein-edit-distance\":\"^2.0.5\",\"loglevel\":\"^1.6.8\",\"markdown-it\":\"^8.4.1\",\"minimatch\":\"^3.0.4\",\"node-fetch\":\"^2.6.0\",\"npmi\":\"^4.0.0\",\"nunjucks\":\"^3.2.0\",\"semver\":\"^7.3.2\",\"simple-git\":\"^1.131.0\"},\"deprecated\":false,\"description\":\"The AsyncAPI generator. It can generate documentation, code, anything!\",\"devDependencies\":{\"@semantic-release/commit-analyzer\":\"^8.0.1\",\"@semantic-release/github\":\"^7.0.4\",\"@semantic-release/npm\":\"^7.0.6\",\"@semantic-release/release-notes-generator\":\"^9.0.1\",\"all-contributors-cli\":\"^6.14.2\",\"chokidar\":\"^3.4.0\",\"conventional-changelog-conventionalcommits\":\"^4.4.0\",\"eslint\":\"^6.8.0\",\"eslint-plugin-jest\":\"^23.8.2\",\"eslint-plugin-sonarjs\":\"^0.5.0\",\"jest\":\"^25.5.0\",\"jsdoc-to-markdown\":\"^5.0.0\",\"markdown-toc\":\"^1.2.0\",\"semantic-release\":\"^17.2.2\",\"semantic-release-slack-bot\":\"^1.5.0\"},\"engines\":{\"node\":\">12.16 <15\",\"npm\":\">6.13.7 <7\"},\"homepage\":\"https://github.com/asyncapi/generator\",\"keywords\":[\"asyncapi\",\"documentation\",\"generator\",\"markdown\"],\"license\":\"Apache-2.0\",\"main\":\"./lib/generator.js\",\"name\":\"@asyncapi/generator\",\"preferGlobal\":true,\"publishConfig\":{\"access\":\"public\"},\"release\":{\"branches\":[\"master\"],\"plugins\":[[\"@semantic-release/commit-analyzer\",{\"preset\":\"conventionalcommits\"}],[\"@semantic-release/release-notes-generator\",{\"preset\":\"conventionalcommits\"}],[\"semantic-release-slack-bot\",{\"notifyOnSuccess\":true,\"packageName\":\"https://github.com/asyncapi/generator\",\"markdownReleaseNotes\":true}],\"@semantic-release/npm\",\"@semantic-release/github\"]},\"repository\":{\"type\":\"git\",\"url\":\"git://github.com/asyncapi/generator.git\"},\"scripts\":{\"docker-build\":\"docker build -t asyncapi/generator:latest .\",\"docs\":\"jsdoc2md lib/generator.js > docs/api.md\",\"gen-readme-toc\":\"markdown-toc -i README.md\",\"get-version\":\"echo $npm_package_version\",\"lint\":\"eslint --max-warnings 0 --config .eslintrc .\",\"lint-tpl-validator\":\"eslint --fix --config .eslintrc .github/templates-list-validator\",\"prepublishOnly\":\"npm run docs\",\"release\":\"semantic-release\",\"test\":\"jest --coverage\",\"test:dev\":\"jest --watchAll --coverage\"},\"version\":\"1.0.1\"}"); +module.exports = JSON.parse('{"_args":[["@asyncapi/generator@1.7.4","/Users/wookiee/sources/github-action-for-generator"]],"_from":"@asyncapi/generator@1.7.4","_id":"@asyncapi/generator@1.7.4","_inBundle":false,"_integrity":"sha512-rGyI+gcPrFS1xLkXt/QdR5kTSwn6wPLWGkGJO1mxHyOVF6X9sCnCHKLHqQ9tzh++fi5tivi6Ybx5VM5xaRc1eg==","_location":"/@asyncapi/generator","_phantomChildren":{"lru-cache":"6.0.0"},"_requested":{"type":"version","registry":true,"raw":"@asyncapi/generator@1.7.4","name":"@asyncapi/generator","escapedName":"@asyncapi%2fgenerator","scope":"@asyncapi","rawSpec":"1.7.4","saveSpec":null,"fetchSpec":"1.7.4"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/@asyncapi/generator/-/generator-1.7.4.tgz","_spec":"1.7.4","_where":"/Users/wookiee/sources/github-action-for-generator","author":{"name":"Fran Mendez","email":"fmvilas@gmail.com"},"bin":{"asyncapi-generator":"cli.js","ag":"cli.js"},"bugs":{"url":"https://github.com/asyncapi/generator/issues"},"dependencies":{"@asyncapi/avro-schema-parser":"^0.2.1","@asyncapi/generator-react-sdk":"^0.2.11","@asyncapi/openapi-schema-parser":"^2.0.1","@asyncapi/parser":"^1.5.2","@asyncapi/raml-dt-schema-parser":"^2.0.1","@npmcli/arborist":"^2.2.4","ajv":"^6.10.2","chokidar":"^3.4.0","commander":"^6.1.0","filenamify":"^4.1.0","fs.extra":"^1.3.2","global-dirs":"^3.0.0","jmespath":"^0.15.0","js-yaml":"^3.13.1","levenshtein-edit-distance":"^2.0.5","loglevel":"^1.6.8","markdown-it":"^8.4.1","minimatch":"^3.0.4","node-fetch":"^2.6.0","nunjucks":"^3.2.0","resolve-from":"^5.0.0","resolve-pkg":"^2.0.0","semver":"^7.3.2","simple-git":"^1.131.0","source-map-support":"^0.5.19","ts-node":"^9.1.1","typescript":"^4.2.2"},"description":"The AsyncAPI generator. It can generate documentation, code, anything!","devDependencies":{"@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/github":"^7.0.4","@semantic-release/npm":"^7.0.6","@semantic-release/release-notes-generator":"^9.0.1","all-contributors-cli":"^6.14.2","conventional-changelog-conventionalcommits":"^4.4.0","eslint":"^6.8.0","eslint-plugin-jest":"^23.8.2","eslint-plugin-sonarjs":"^0.5.0","jest":"^25.5.0","jsdoc-to-markdown":"^5.0.0","markdown-toc":"^1.2.0","rimraf":"^3.0.2","semantic-release":"^17.2.2","unixify":"^1.0.0"},"engines":{"node":">12.16","npm":">6.13.7"},"homepage":"https://github.com/asyncapi/generator","keywords":["asyncapi","documentation","generator","markdown"],"license":"Apache-2.0","main":"./lib/generator.js","name":"@asyncapi/generator","preferGlobal":true,"publishConfig":{"access":"public"},"release":{"branches":["master"],"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits"}],["@semantic-release/release-notes-generator",{"preset":"conventionalcommits"}],"@semantic-release/npm","@semantic-release/github"]},"repository":{"type":"git","url":"git://github.com/asyncapi/generator.git"},"scripts":{"bump:version":"npm --no-git-tag-version --allow-same-version version $VERSION","docker:build":"docker build -t asyncapi/generator:latest .","docs":"jsdoc2md lib/generator.js > docs/api.md","generate:assets":"npm run docs && npm run generate:readme:toc","generate:readme:toc":"markdown-toc -i README.md","get:name":"echo $npm_package_name","get:version":"echo $npm_package_version","lint":"eslint --max-warnings 0 --config .eslintrc .","lint:tpl:validator":"eslint --fix --config .eslintrc .github/templates-list-validator","release":"semantic-release","test":"npm run test:unit && npm run test:integration && npm run test:cli","test:cleanup":"rimraf \\"test/temp\\"","test:cli":"node cli.js ./test/docs/dummy.yml @asyncapi/html-template -o test/output --force-write --debug && test -e test/output/index.html","test:dev":"npm run test:unit -- --watchAll","test:integration":"npm run test:cleanup && jest --testPathPattern=integration --modulePathIgnorePatterns=\'./__mocks__\'","test:unit":"jest --coverage --testPathIgnorePatterns=integration --testPathIgnorePatterns=test-project"},"version":"1.7.4"}'); /***/ }), @@ -134,7 +13,7 @@ module.exports = JSON.parse("{\"_from\":\"@asyncapi/generator@1.0.1\",\"_id\":\" /***/ ((module) => { "use strict"; -module.exports = JSON.parse("{\"title\":\"AsyncAPI 1.0 schema.\",\"id\":\"http://asyncapi.hitchhq.com/v1/schema.json#\",\"$schema\":\"http://json-schema.org/draft-04/schema#\",\"type\":\"object\",\"required\":[\"asyncapi\",\"info\",\"topics\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"asyncapi\":{\"type\":\"string\",\"enum\":[\"1.0.0\"],\"description\":\"The AsyncAPI specification version of this document.\"},\"info\":{\"$ref\":\"#/definitions/info\"},\"baseTopic\":{\"type\":\"string\",\"pattern\":\"^[^/.]\",\"description\":\"The base topic to the API. Example: 'hitch'.\",\"default\":\"\"},\"servers\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/server\"},\"uniqueItems\":true},\"topics\":{\"$ref\":\"#/definitions/topics\"},\"components\":{\"$ref\":\"#/definitions/components\"},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"security\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/SecurityRequirement\"}},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"}},\"definitions\":{\"Reference\":{\"type\":\"object\",\"required\":[\"$ref\"],\"properties\":{\"$ref\":{\"type\":\"string\",\"format\":\"uri\"}}},\"info\":{\"type\":\"object\",\"description\":\"General information about the API.\",\"required\":[\"version\",\"title\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"title\":{\"type\":\"string\",\"description\":\"A unique and precise title of the API.\"},\"version\":{\"type\":\"string\",\"description\":\"A semantic version number of the API.\"},\"description\":{\"type\":\"string\",\"description\":\"A longer description of the API. Should be different from the title. CommonMark is allowed.\"},\"termsOfService\":{\"type\":\"string\",\"description\":\"A URL to the Terms of Service for the API. MUST be in the format of a URL.\",\"format\":\"uri\"},\"contact\":{\"$ref\":\"#/definitions/contact\"},\"license\":{\"$ref\":\"#/definitions/license\"}}},\"contact\":{\"type\":\"object\",\"description\":\"Contact information for the owners of the API.\",\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\",\"description\":\"The identifying name of the contact person/organization.\"},\"url\":{\"type\":\"string\",\"description\":\"The URL pointing to the contact information.\",\"format\":\"uri\"},\"email\":{\"type\":\"string\",\"description\":\"The email address of the contact person/organization.\",\"format\":\"email\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}}},\"license\":{\"type\":\"object\",\"required\":[\"name\"],\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\",\"description\":\"The name of the license type. It's encouraged to use an OSI compatible license.\"},\"url\":{\"type\":\"string\",\"description\":\"The URL pointing to the license.\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}}},\"server\":{\"type\":\"object\",\"description\":\"An object representing a Server.\",\"required\":[\"url\",\"scheme\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"url\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"scheme\":{\"type\":\"string\",\"description\":\"The transfer protocol.\",\"enum\":[\"kafka\",\"kafka-secure\",\"amqp\",\"amqps\",\"mqtt\",\"mqtts\",\"secure-mqtt\",\"ws\",\"wss\",\"stomp\",\"stomps\"]},\"schemeVersion\":{\"type\":\"string\"},\"variables\":{\"$ref\":\"#/definitions/serverVariables\"}}},\"serverVariables\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/serverVariable\"}},\"serverVariable\":{\"type\":\"object\",\"description\":\"An object representing a Server Variable for server URL template substitution.\",\"minProperties\":1,\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"enum\":{\"type\":\"array\",\"items\":{\"type\":\"string\"},\"uniqueItems\":true},\"default\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"}}},\"topics\":{\"type\":\"object\",\"description\":\"Relative paths to the individual topics. They must be relative to the 'baseTopic'.\",\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"},\"^[^.]\":{\"$ref\":\"#/definitions/topicItem\"}},\"additionalProperties\":false},\"components\":{\"type\":\"object\",\"description\":\"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.\",\"additionalProperties\":false,\"properties\":{\"schemas\":{\"$ref\":\"#/definitions/schemas\"},\"messages\":{\"$ref\":\"#/definitions/messages\"},\"securitySchemes\":{\"type\":\"object\",\"patternProperties\":{\"^[a-zA-Z0-9\\\\.\\\\-_]+$\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/SecurityScheme\"}]}}}}},\"schemas\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/schema\"},\"description\":\"JSON objects describing schemas the API uses.\"},\"messages\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/message\"},\"description\":\"JSON objects describing the messages being consumed and produced by the API.\"},\"schema\":{\"type\":\"object\",\"description\":\"A deterministic version of a JSON Schema object.\",\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"$ref\":{\"type\":\"string\"},\"format\":{\"type\":\"string\"},\"title\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/title\"},\"description\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/description\"},\"default\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/default\"},\"multipleOf\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/multipleOf\"},\"maximum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/maximum\"},\"exclusiveMaximum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum\"},\"minimum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/minimum\"},\"exclusiveMinimum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum\"},\"maxLength\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minLength\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"pattern\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/pattern\"},\"maxItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"uniqueItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/uniqueItems\"},\"maxProperties\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minProperties\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"required\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/stringArray\"},\"enum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/enum\"},\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/definitions/schema\"},{\"type\":\"boolean\"}],\"default\":{}},\"type\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/type\"},\"items\":{\"anyOf\":[{\"$ref\":\"#/definitions/schema\"},{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/schema\"}}],\"default\":{}},\"allOf\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/schema\"}},\"properties\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/schema\"},\"default\":{}},\"discriminator\":{\"type\":\"string\"},\"readOnly\":{\"type\":\"boolean\",\"default\":false},\"xml\":{\"$ref\":\"#/definitions/xml\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"example\":{}},\"additionalProperties\":false},\"xml\":{\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"},\"prefix\":{\"type\":\"string\"},\"attribute\":{\"type\":\"boolean\",\"default\":false},\"wrapped\":{\"type\":\"boolean\",\"default\":false}}},\"externalDocs\":{\"type\":\"object\",\"additionalProperties\":false,\"description\":\"information about external documentation\",\"required\":[\"url\"],\"properties\":{\"description\":{\"type\":\"string\"},\"url\":{\"type\":\"string\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}}},\"topicItem\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"minProperties\":1,\"properties\":{\"$ref\":{\"type\":\"string\"},\"publish\":{\"$ref\":\"#/definitions/message\"},\"subscribe\":{\"$ref\":\"#/definitions/message\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false}}},\"message\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"$ref\":{\"type\":\"string\"},\"headers\":{\"$ref\":\"#/definitions/schema\"},\"payload\":{\"$ref\":\"#/definitions/schema\"},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"summary\":{\"type\":\"string\",\"description\":\"A brief summary of the message.\"},\"description\":{\"type\":\"string\",\"description\":\"A longer description of the message. CommonMark is allowed.\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false},\"example\":{}}},\"vendorExtension\":{\"description\":\"Any property starting with x- is valid.\",\"additionalProperties\":true,\"additionalItems\":true},\"tag\":{\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}}},\"SecurityScheme\":{\"oneOf\":[{\"$ref\":\"#/definitions/userPassword\"},{\"$ref\":\"#/definitions/apiKey\"},{\"$ref\":\"#/definitions/X509\"},{\"$ref\":\"#/definitions/symmetricEncryption\"},{\"$ref\":\"#/definitions/asymmetricEncryption\"},{\"$ref\":\"#/definitions/HTTPSecurityScheme\"}]},\"userPassword\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"userPassword\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"apiKey\":{\"type\":\"object\",\"required\":[\"type\",\"in\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"apiKey\"]},\"in\":{\"type\":\"string\",\"enum\":[\"user\",\"password\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"X509\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"X509\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"symmetricEncryption\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"symmetricEncryption\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"asymmetricEncryption\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"asymmetricEncryption\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"HTTPSecurityScheme\":{\"oneOf\":[{\"$ref\":\"#/definitions/NonBearerHTTPSecurityScheme\"},{\"$ref\":\"#/definitions/BearerHTTPSecurityScheme\"},{\"$ref\":\"#/definitions/APIKeyHTTPSecurityScheme\"}]},\"NonBearerHTTPSecurityScheme\":{\"not\":{\"type\":\"object\",\"properties\":{\"scheme\":{\"type\":\"string\",\"enum\":[\"bearer\"]}}},\"type\":\"object\",\"required\":[\"scheme\",\"type\"],\"properties\":{\"scheme\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"type\":{\"type\":\"string\",\"enum\":[\"http\"]}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"BearerHTTPSecurityScheme\":{\"type\":\"object\",\"required\":[\"type\",\"scheme\"],\"properties\":{\"scheme\":{\"type\":\"string\",\"enum\":[\"bearer\"]},\"bearerFormat\":{\"type\":\"string\"},\"type\":{\"type\":\"string\",\"enum\":[\"http\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"APIKeyHTTPSecurityScheme\":{\"type\":\"object\",\"required\":[\"type\",\"name\",\"in\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"httpApiKey\"]},\"name\":{\"type\":\"string\"},\"in\":{\"type\":\"string\",\"enum\":[\"header\",\"query\",\"cookie\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"SecurityRequirement\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}},\"title\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/title\"},\"description\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/description\"},\"default\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/default\"},\"multipleOf\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/multipleOf\"},\"maximum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/maximum\"},\"exclusiveMaximum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum\"},\"minimum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/minimum\"},\"exclusiveMinimum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum\"},\"maxLength\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minLength\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"pattern\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/pattern\"},\"maxItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"uniqueItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/uniqueItems\"},\"enum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/enum\"}}}"); +module.exports = JSON.parse('{"title":"AsyncAPI 1.0 schema.","id":"http://asyncapi.hitchhq.com/v1/schema.json#","$schema":"http://json-schema.org/draft-04/schema#","type":"object","required":["asyncapi","info","topics"],"additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"asyncapi":{"type":"string","enum":["1.0.0"],"description":"The AsyncAPI specification version of this document."},"info":{"$ref":"#/definitions/info"},"baseTopic":{"type":"string","pattern":"^[^/.]","description":"The base topic to the API. Example: \'hitch\'.","default":""},"servers":{"type":"array","items":{"$ref":"#/definitions/server"},"uniqueItems":true},"topics":{"$ref":"#/definitions/topics"},"components":{"$ref":"#/definitions/components"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"security":{"type":"array","items":{"$ref":"#/definitions/SecurityRequirement"}},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"definitions":{"Reference":{"type":"object","required":["$ref"],"properties":{"$ref":{"type":"string","format":"uri"}}},"info":{"type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"#/definitions/contact"},"license":{"$ref":"#/definitions/license"}}},"contact":{"type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}}},"license":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It\'s encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}}},"server":{"type":"object","description":"An object representing a Server.","required":["url","scheme"],"additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"scheme":{"type":"string","description":"The transfer protocol.","enum":["kafka","kafka-secure","amqp","amqps","mqtt","mqtts","secure-mqtt","ws","wss","stomp","stomps"]},"schemeVersion":{"type":"string"},"variables":{"$ref":"#/definitions/serverVariables"}}},"serverVariables":{"type":"object","additionalProperties":{"$ref":"#/definitions/serverVariable"}},"serverVariable":{"type":"object","description":"An object representing a Server Variable for server URL template substitution.","minProperties":1,"additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"}}},"topics":{"type":"object","description":"Relative paths to the individual topics. They must be relative to the \'baseTopic\'.","patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"},"^[^.]":{"$ref":"#/definitions/topicItem"}},"additionalProperties":false},"components":{"type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"properties":{"schemas":{"$ref":"#/definitions/schemas"},"messages":{"$ref":"#/definitions/messages"},"securitySchemes":{"type":"object","patternProperties":{"^[a-zA-Z0-9\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/SecurityScheme"}]}}}}},"schemas":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"description":"JSON objects describing schemas the API uses."},"messages":{"type":"object","additionalProperties":{"$ref":"#/definitions/message"},"description":"JSON objects describing the messages being consumed and produced by the API."},"schema":{"type":"object","description":"A deterministic version of a JSON Schema object.","patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"$ref":{"type":"string"},"format":{"type":"string"},"title":{"$ref":"http://json-schema.org/draft-04/schema#/properties/title"},"description":{"$ref":"http://json-schema.org/draft-04/schema#/properties/description"},"default":{"$ref":"http://json-schema.org/draft-04/schema#/properties/default"},"multipleOf":{"$ref":"http://json-schema.org/draft-04/schema#/properties/multipleOf"},"maximum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/maximum"},"exclusiveMaximum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"},"minimum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/minimum"},"exclusiveMinimum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"},"maxLength":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minLength":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"pattern":{"$ref":"http://json-schema.org/draft-04/schema#/properties/pattern"},"maxItems":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minItems":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"uniqueItems":{"$ref":"http://json-schema.org/draft-04/schema#/properties/uniqueItems"},"maxProperties":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minProperties":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"required":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/stringArray"},"enum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/enum"},"additionalProperties":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"boolean"}],"default":{}},"type":{"$ref":"http://json-schema.org/draft-04/schema#/properties/type"},"items":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"discriminator":{"type":"string"},"readOnly":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/xml"},"externalDocs":{"$ref":"#/definitions/externalDocs"},"example":{}},"additionalProperties":false},"xml":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"namespace":{"type":"string"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}}},"externalDocs":{"type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}}},"topicItem":{"type":"object","additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"minProperties":1,"properties":{"$ref":{"type":"string"},"publish":{"$ref":"#/definitions/message"},"subscribe":{"$ref":"#/definitions/message"},"deprecated":{"type":"boolean","default":false}}},"message":{"type":"object","additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"$ref":{"type":"string"},"headers":{"$ref":"#/definitions/schema"},"payload":{"$ref":"#/definitions/schema"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"example":{}}},"vendorExtension":{"description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}}},"SecurityScheme":{"oneOf":[{"$ref":"#/definitions/userPassword"},{"$ref":"#/definitions/apiKey"},{"$ref":"#/definitions/X509"},{"$ref":"#/definitions/symmetricEncryption"},{"$ref":"#/definitions/asymmetricEncryption"},{"$ref":"#/definitions/HTTPSecurityScheme"}]},"userPassword":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"apiKey":{"type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"X509":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"symmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"asymmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"HTTPSecurityScheme":{"oneOf":[{"$ref":"#/definitions/NonBearerHTTPSecurityScheme"},{"$ref":"#/definitions/BearerHTTPSecurityScheme"},{"$ref":"#/definitions/APIKeyHTTPSecurityScheme"}]},"NonBearerHTTPSecurityScheme":{"not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-":{}},"additionalProperties":false},"BearerHTTPSecurityScheme":{"type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"APIKeyHTTPSecurityScheme":{"type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"SecurityRequirement":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"title":{"$ref":"http://json-schema.org/draft-04/schema#/properties/title"},"description":{"$ref":"http://json-schema.org/draft-04/schema#/properties/description"},"default":{"$ref":"http://json-schema.org/draft-04/schema#/properties/default"},"multipleOf":{"$ref":"http://json-schema.org/draft-04/schema#/properties/multipleOf"},"maximum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/maximum"},"exclusiveMaximum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"},"minimum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/minimum"},"exclusiveMinimum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"},"maxLength":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minLength":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"pattern":{"$ref":"http://json-schema.org/draft-04/schema#/properties/pattern"},"maxItems":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minItems":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"uniqueItems":{"$ref":"http://json-schema.org/draft-04/schema#/properties/uniqueItems"},"enum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/enum"}}}'); /***/ }), @@ -142,7 +21,7 @@ module.exports = JSON.parse("{\"title\":\"AsyncAPI 1.0 schema.\",\"id\":\"http:/ /***/ ((module) => { "use strict"; -module.exports = JSON.parse("{\"title\":\"AsyncAPI 1.1.0 schema.\",\"id\":\"http://asyncapi.hitchhq.com/v1/schema.json#\",\"$schema\":\"http://json-schema.org/draft-04/schema#\",\"type\":\"object\",\"required\":[\"asyncapi\",\"info\",\"topics\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"asyncapi\":{\"type\":\"string\",\"enum\":[\"1.0.0\",\"1.1.0\"],\"description\":\"The AsyncAPI specification version of this document.\"},\"info\":{\"$ref\":\"#/definitions/info\"},\"baseTopic\":{\"type\":\"string\",\"pattern\":\"^[^/.]\",\"description\":\"The base topic to the API. Example: 'hitch'.\",\"default\":\"\"},\"servers\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/server\"},\"uniqueItems\":true},\"topics\":{\"$ref\":\"#/definitions/topics\"},\"components\":{\"$ref\":\"#/definitions/components\"},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"security\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/SecurityRequirement\"}},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"}},\"definitions\":{\"Reference\":{\"type\":\"object\",\"required\":[\"$ref\"],\"properties\":{\"$ref\":{\"type\":\"string\",\"format\":\"uri\"}}},\"info\":{\"type\":\"object\",\"description\":\"General information about the API.\",\"required\":[\"version\",\"title\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"title\":{\"type\":\"string\",\"description\":\"A unique and precise title of the API.\"},\"version\":{\"type\":\"string\",\"description\":\"A semantic version number of the API.\"},\"description\":{\"type\":\"string\",\"description\":\"A longer description of the API. Should be different from the title. CommonMark is allowed.\"},\"termsOfService\":{\"type\":\"string\",\"description\":\"A URL to the Terms of Service for the API. MUST be in the format of a URL.\",\"format\":\"uri\"},\"contact\":{\"$ref\":\"#/definitions/contact\"},\"license\":{\"$ref\":\"#/definitions/license\"}}},\"contact\":{\"type\":\"object\",\"description\":\"Contact information for the owners of the API.\",\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\",\"description\":\"The identifying name of the contact person/organization.\"},\"url\":{\"type\":\"string\",\"description\":\"The URL pointing to the contact information.\",\"format\":\"uri\"},\"email\":{\"type\":\"string\",\"description\":\"The email address of the contact person/organization.\",\"format\":\"email\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}}},\"license\":{\"type\":\"object\",\"required\":[\"name\"],\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\",\"description\":\"The name of the license type. It's encouraged to use an OSI compatible license.\"},\"url\":{\"type\":\"string\",\"description\":\"The URL pointing to the license.\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}}},\"server\":{\"type\":\"object\",\"description\":\"An object representing a Server.\",\"required\":[\"url\",\"scheme\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"url\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"scheme\":{\"type\":\"string\",\"description\":\"The transfer protocol.\",\"enum\":[\"kafka\",\"kafka-secure\",\"amqp\",\"amqps\",\"mqtt\",\"mqtts\",\"secure-mqtt\",\"ws\",\"wss\",\"stomp\",\"stomps\",\"jms\"]},\"schemeVersion\":{\"type\":\"string\"},\"variables\":{\"$ref\":\"#/definitions/serverVariables\"}}},\"serverVariables\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/serverVariable\"}},\"serverVariable\":{\"type\":\"object\",\"description\":\"An object representing a Server Variable for server URL template substitution.\",\"minProperties\":1,\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"enum\":{\"type\":\"array\",\"items\":{\"type\":\"string\"},\"uniqueItems\":true},\"default\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"}}},\"topics\":{\"type\":\"object\",\"description\":\"Relative paths to the individual topics. They must be relative to the 'baseTopic'.\",\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"},\"^[^.]\":{\"$ref\":\"#/definitions/topicItem\"}},\"additionalProperties\":false},\"components\":{\"type\":\"object\",\"description\":\"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.\",\"additionalProperties\":false,\"properties\":{\"schemas\":{\"$ref\":\"#/definitions/schemas\"},\"messages\":{\"$ref\":\"#/definitions/messages\"},\"securitySchemes\":{\"type\":\"object\",\"patternProperties\":{\"^[a-zA-Z0-9\\\\.\\\\-_]+$\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/SecurityScheme\"}]}}}}},\"schemas\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/schema\"},\"description\":\"JSON objects describing schemas the API uses.\"},\"messages\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/message\"},\"description\":\"JSON objects describing the messages being consumed and produced by the API.\"},\"schema\":{\"type\":\"object\",\"description\":\"A deterministic version of a JSON Schema object.\",\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"$ref\":{\"type\":\"string\"},\"format\":{\"type\":\"string\"},\"title\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/title\"},\"description\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/description\"},\"default\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/default\"},\"multipleOf\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/multipleOf\"},\"maximum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/maximum\"},\"exclusiveMaximum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum\"},\"minimum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/minimum\"},\"exclusiveMinimum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum\"},\"maxLength\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minLength\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"pattern\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/pattern\"},\"maxItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"uniqueItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/uniqueItems\"},\"maxProperties\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minProperties\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"required\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/stringArray\"},\"enum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/enum\"},\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/definitions/schema\"},{\"type\":\"boolean\"}],\"default\":{}},\"type\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/type\"},\"items\":{\"anyOf\":[{\"$ref\":\"#/definitions/schema\"},{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/schema\"}}],\"default\":{}},\"allOf\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/schema\"}},\"oneOf\":{\"type\":\"array\",\"minItems\":2,\"items\":{\"$ref\":\"#/definitions/schema\"}},\"anyOf\":{\"type\":\"array\",\"minItems\":2,\"items\":{\"$ref\":\"#/definitions/schema\"}},\"not\":{\"$ref\":\"#/definitions/schema\"},\"properties\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/schema\"},\"default\":{}},\"discriminator\":{\"type\":\"string\"},\"readOnly\":{\"type\":\"boolean\",\"default\":false},\"xml\":{\"$ref\":\"#/definitions/xml\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"example\":{}},\"additionalProperties\":false},\"xml\":{\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"},\"prefix\":{\"type\":\"string\"},\"attribute\":{\"type\":\"boolean\",\"default\":false},\"wrapped\":{\"type\":\"boolean\",\"default\":false}}},\"externalDocs\":{\"type\":\"object\",\"additionalProperties\":false,\"description\":\"information about external documentation\",\"required\":[\"url\"],\"properties\":{\"description\":{\"type\":\"string\"},\"url\":{\"type\":\"string\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}}},\"topicItem\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"minProperties\":1,\"properties\":{\"$ref\":{\"type\":\"string\"},\"parameters\":{\"type\":\"array\",\"uniqueItems\":true,\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/parameter\"}},\"publish\":{\"$ref\":\"#/definitions/operation\"},\"subscribe\":{\"$ref\":\"#/definitions/operation\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false}}},\"parameter\":{\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"description\":{\"type\":\"string\",\"description\":\"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.\"},\"name\":{\"type\":\"string\",\"description\":\"The name of the parameter.\"},\"schema\":{\"$ref\":\"#/definitions/schema\"}}},\"operation\":{\"oneOf\":[{\"$ref\":\"#/definitions/message\"},{\"type\":\"object\",\"required\":[\"oneOf\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"oneOf\":{\"type\":\"array\",\"minItems\":2,\"items\":{\"$ref\":\"#/definitions/message\"}}}}]},\"message\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"$ref\":{\"type\":\"string\"},\"headers\":{\"$ref\":\"#/definitions/schema\"},\"payload\":{\"$ref\":\"#/definitions/schema\"},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"summary\":{\"type\":\"string\",\"description\":\"A brief summary of the message.\"},\"description\":{\"type\":\"string\",\"description\":\"A longer description of the message. CommonMark is allowed.\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false},\"example\":{}}},\"vendorExtension\":{\"description\":\"Any property starting with x- is valid.\",\"additionalProperties\":true,\"additionalItems\":true},\"tag\":{\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}}},\"SecurityScheme\":{\"oneOf\":[{\"$ref\":\"#/definitions/userPassword\"},{\"$ref\":\"#/definitions/apiKey\"},{\"$ref\":\"#/definitions/X509\"},{\"$ref\":\"#/definitions/symmetricEncryption\"},{\"$ref\":\"#/definitions/asymmetricEncryption\"},{\"$ref\":\"#/definitions/HTTPSecurityScheme\"}]},\"userPassword\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"userPassword\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"apiKey\":{\"type\":\"object\",\"required\":[\"type\",\"in\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"apiKey\"]},\"in\":{\"type\":\"string\",\"enum\":[\"user\",\"password\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"X509\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"X509\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"symmetricEncryption\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"symmetricEncryption\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"asymmetricEncryption\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"asymmetricEncryption\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"HTTPSecurityScheme\":{\"oneOf\":[{\"$ref\":\"#/definitions/NonBearerHTTPSecurityScheme\"},{\"$ref\":\"#/definitions/BearerHTTPSecurityScheme\"},{\"$ref\":\"#/definitions/APIKeyHTTPSecurityScheme\"}]},\"NonBearerHTTPSecurityScheme\":{\"not\":{\"type\":\"object\",\"properties\":{\"scheme\":{\"type\":\"string\",\"enum\":[\"bearer\"]}}},\"type\":\"object\",\"required\":[\"scheme\",\"type\"],\"properties\":{\"scheme\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"type\":{\"type\":\"string\",\"enum\":[\"http\"]}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"BearerHTTPSecurityScheme\":{\"type\":\"object\",\"required\":[\"type\",\"scheme\"],\"properties\":{\"scheme\":{\"type\":\"string\",\"enum\":[\"bearer\"]},\"bearerFormat\":{\"type\":\"string\"},\"type\":{\"type\":\"string\",\"enum\":[\"http\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"APIKeyHTTPSecurityScheme\":{\"type\":\"object\",\"required\":[\"type\",\"name\",\"in\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"httpApiKey\"]},\"name\":{\"type\":\"string\"},\"in\":{\"type\":\"string\",\"enum\":[\"header\",\"query\",\"cookie\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"SecurityRequirement\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}},\"title\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/title\"},\"description\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/description\"},\"default\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/default\"},\"multipleOf\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/multipleOf\"},\"maximum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/maximum\"},\"exclusiveMaximum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum\"},\"minimum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/minimum\"},\"exclusiveMinimum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum\"},\"maxLength\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minLength\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"pattern\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/pattern\"},\"maxItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"uniqueItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/uniqueItems\"},\"enum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/enum\"}}}"); +module.exports = JSON.parse('{"title":"AsyncAPI 1.1.0 schema.","id":"http://asyncapi.hitchhq.com/v1/schema.json#","$schema":"http://json-schema.org/draft-04/schema#","type":"object","required":["asyncapi","info","topics"],"additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"asyncapi":{"type":"string","enum":["1.0.0","1.1.0"],"description":"The AsyncAPI specification version of this document."},"info":{"$ref":"#/definitions/info"},"baseTopic":{"type":"string","pattern":"^[^/.]","description":"The base topic to the API. Example: \'hitch\'.","default":""},"servers":{"type":"array","items":{"$ref":"#/definitions/server"},"uniqueItems":true},"topics":{"$ref":"#/definitions/topics"},"components":{"$ref":"#/definitions/components"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"security":{"type":"array","items":{"$ref":"#/definitions/SecurityRequirement"}},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"definitions":{"Reference":{"type":"object","required":["$ref"],"properties":{"$ref":{"type":"string","format":"uri"}}},"info":{"type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"#/definitions/contact"},"license":{"$ref":"#/definitions/license"}}},"contact":{"type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}}},"license":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It\'s encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}}},"server":{"type":"object","description":"An object representing a Server.","required":["url","scheme"],"additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"scheme":{"type":"string","description":"The transfer protocol.","enum":["kafka","kafka-secure","amqp","amqps","mqtt","mqtts","secure-mqtt","ws","wss","stomp","stomps","jms"]},"schemeVersion":{"type":"string"},"variables":{"$ref":"#/definitions/serverVariables"}}},"serverVariables":{"type":"object","additionalProperties":{"$ref":"#/definitions/serverVariable"}},"serverVariable":{"type":"object","description":"An object representing a Server Variable for server URL template substitution.","minProperties":1,"additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"}}},"topics":{"type":"object","description":"Relative paths to the individual topics. They must be relative to the \'baseTopic\'.","patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"},"^[^.]":{"$ref":"#/definitions/topicItem"}},"additionalProperties":false},"components":{"type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"properties":{"schemas":{"$ref":"#/definitions/schemas"},"messages":{"$ref":"#/definitions/messages"},"securitySchemes":{"type":"object","patternProperties":{"^[a-zA-Z0-9\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/SecurityScheme"}]}}}}},"schemas":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"description":"JSON objects describing schemas the API uses."},"messages":{"type":"object","additionalProperties":{"$ref":"#/definitions/message"},"description":"JSON objects describing the messages being consumed and produced by the API."},"schema":{"type":"object","description":"A deterministic version of a JSON Schema object.","patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"$ref":{"type":"string"},"format":{"type":"string"},"title":{"$ref":"http://json-schema.org/draft-04/schema#/properties/title"},"description":{"$ref":"http://json-schema.org/draft-04/schema#/properties/description"},"default":{"$ref":"http://json-schema.org/draft-04/schema#/properties/default"},"multipleOf":{"$ref":"http://json-schema.org/draft-04/schema#/properties/multipleOf"},"maximum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/maximum"},"exclusiveMaximum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"},"minimum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/minimum"},"exclusiveMinimum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"},"maxLength":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minLength":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"pattern":{"$ref":"http://json-schema.org/draft-04/schema#/properties/pattern"},"maxItems":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minItems":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"uniqueItems":{"$ref":"http://json-schema.org/draft-04/schema#/properties/uniqueItems"},"maxProperties":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minProperties":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"required":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/stringArray"},"enum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/enum"},"additionalProperties":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"boolean"}],"default":{}},"type":{"$ref":"http://json-schema.org/draft-04/schema#/properties/type"},"items":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"oneOf":{"type":"array","minItems":2,"items":{"$ref":"#/definitions/schema"}},"anyOf":{"type":"array","minItems":2,"items":{"$ref":"#/definitions/schema"}},"not":{"$ref":"#/definitions/schema"},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"discriminator":{"type":"string"},"readOnly":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/xml"},"externalDocs":{"$ref":"#/definitions/externalDocs"},"example":{}},"additionalProperties":false},"xml":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"namespace":{"type":"string"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}}},"externalDocs":{"type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}}},"topicItem":{"type":"object","additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"minProperties":1,"properties":{"$ref":{"type":"string"},"parameters":{"type":"array","uniqueItems":true,"minItems":1,"items":{"$ref":"#/definitions/parameter"}},"publish":{"$ref":"#/definitions/operation"},"subscribe":{"$ref":"#/definitions/operation"},"deprecated":{"type":"boolean","default":false}}},"parameter":{"additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"name":{"type":"string","description":"The name of the parameter."},"schema":{"$ref":"#/definitions/schema"}}},"operation":{"oneOf":[{"$ref":"#/definitions/message"},{"type":"object","required":["oneOf"],"additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"oneOf":{"type":"array","minItems":2,"items":{"$ref":"#/definitions/message"}}}}]},"message":{"type":"object","additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"$ref":{"type":"string"},"headers":{"$ref":"#/definitions/schema"},"payload":{"$ref":"#/definitions/schema"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"example":{}}},"vendorExtension":{"description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}}},"SecurityScheme":{"oneOf":[{"$ref":"#/definitions/userPassword"},{"$ref":"#/definitions/apiKey"},{"$ref":"#/definitions/X509"},{"$ref":"#/definitions/symmetricEncryption"},{"$ref":"#/definitions/asymmetricEncryption"},{"$ref":"#/definitions/HTTPSecurityScheme"}]},"userPassword":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"apiKey":{"type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"X509":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"symmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"asymmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"HTTPSecurityScheme":{"oneOf":[{"$ref":"#/definitions/NonBearerHTTPSecurityScheme"},{"$ref":"#/definitions/BearerHTTPSecurityScheme"},{"$ref":"#/definitions/APIKeyHTTPSecurityScheme"}]},"NonBearerHTTPSecurityScheme":{"not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-":{}},"additionalProperties":false},"BearerHTTPSecurityScheme":{"type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"APIKeyHTTPSecurityScheme":{"type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"SecurityRequirement":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"title":{"$ref":"http://json-schema.org/draft-04/schema#/properties/title"},"description":{"$ref":"http://json-schema.org/draft-04/schema#/properties/description"},"default":{"$ref":"http://json-schema.org/draft-04/schema#/properties/default"},"multipleOf":{"$ref":"http://json-schema.org/draft-04/schema#/properties/multipleOf"},"maximum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/maximum"},"exclusiveMaximum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"},"minimum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/minimum"},"exclusiveMinimum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"},"maxLength":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minLength":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"pattern":{"$ref":"http://json-schema.org/draft-04/schema#/properties/pattern"},"maxItems":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minItems":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"uniqueItems":{"$ref":"http://json-schema.org/draft-04/schema#/properties/uniqueItems"},"enum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/enum"}}}'); /***/ }), @@ -150,7 +29,7 @@ module.exports = JSON.parse("{\"title\":\"AsyncAPI 1.1.0 schema.\",\"id\":\"http /***/ ((module) => { "use strict"; -module.exports = JSON.parse("{\"title\":\"AsyncAPI 1.2.0 schema.\",\"id\":\"http://asyncapi.hitchhq.com/v1/schema.json#\",\"$schema\":\"http://json-schema.org/draft-04/schema#\",\"type\":\"object\",\"required\":[\"asyncapi\",\"info\"],\"oneOf\":[{\"required\":[\"topics\"]},{\"required\":[\"stream\"]},{\"required\":[\"events\"]}],\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"asyncapi\":{\"type\":\"string\",\"enum\":[\"1.0.0\",\"1.1.0\",\"1.2.0\"],\"description\":\"The AsyncAPI specification version of this document.\"},\"info\":{\"$ref\":\"#/definitions/info\"},\"baseTopic\":{\"type\":\"string\",\"pattern\":\"^[^/.]\",\"description\":\"The base topic to the API. Example: 'hitch'.\",\"default\":\"\"},\"servers\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/server\"},\"uniqueItems\":true},\"topics\":{\"$ref\":\"#/definitions/topics\"},\"stream\":{\"$ref\":\"#/definitions/stream\",\"description\":\"The list of messages a consumer can read or write from/to a streaming API.\"},\"events\":{\"$ref\":\"#/definitions/events\",\"description\":\"The list of messages an events API sends and/or receives.\"},\"components\":{\"$ref\":\"#/definitions/components\"},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"security\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/SecurityRequirement\"}},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"}},\"definitions\":{\"Reference\":{\"type\":\"object\",\"required\":[\"$ref\"],\"properties\":{\"$ref\":{\"type\":\"string\",\"format\":\"uri\"}}},\"info\":{\"type\":\"object\",\"description\":\"General information about the API.\",\"required\":[\"version\",\"title\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"title\":{\"type\":\"string\",\"description\":\"A unique and precise title of the API.\"},\"version\":{\"type\":\"string\",\"description\":\"A semantic version number of the API.\"},\"description\":{\"type\":\"string\",\"description\":\"A longer description of the API. Should be different from the title. CommonMark is allowed.\"},\"termsOfService\":{\"type\":\"string\",\"description\":\"A URL to the Terms of Service for the API. MUST be in the format of a URL.\",\"format\":\"uri\"},\"contact\":{\"$ref\":\"#/definitions/contact\"},\"license\":{\"$ref\":\"#/definitions/license\"}}},\"contact\":{\"type\":\"object\",\"description\":\"Contact information for the owners of the API.\",\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\",\"description\":\"The identifying name of the contact person/organization.\"},\"url\":{\"type\":\"string\",\"description\":\"The URL pointing to the contact information.\",\"format\":\"uri\"},\"email\":{\"type\":\"string\",\"description\":\"The email address of the contact person/organization.\",\"format\":\"email\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}}},\"license\":{\"type\":\"object\",\"required\":[\"name\"],\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\",\"description\":\"The name of the license type. It's encouraged to use an OSI compatible license.\"},\"url\":{\"type\":\"string\",\"description\":\"The URL pointing to the license.\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}}},\"server\":{\"type\":\"object\",\"description\":\"An object representing a Server.\",\"required\":[\"url\",\"scheme\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"url\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"scheme\":{\"type\":\"string\",\"description\":\"The transfer protocol.\",\"enum\":[\"kafka\",\"kafka-secure\",\"amqp\",\"amqps\",\"mqtt\",\"mqtts\",\"secure-mqtt\",\"ws\",\"wss\",\"stomp\",\"stomps\",\"jms\",\"http\",\"https\"]},\"schemeVersion\":{\"type\":\"string\"},\"variables\":{\"$ref\":\"#/definitions/serverVariables\"}}},\"serverVariables\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/serverVariable\"}},\"serverVariable\":{\"type\":\"object\",\"description\":\"An object representing a Server Variable for server URL template substitution.\",\"minProperties\":1,\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"enum\":{\"type\":\"array\",\"items\":{\"type\":\"string\"},\"uniqueItems\":true},\"default\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"}}},\"topics\":{\"type\":\"object\",\"description\":\"Relative paths to the individual topics. They must be relative to the 'baseTopic'.\",\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"},\"^[^.]\":{\"$ref\":\"#/definitions/topicItem\"}},\"additionalProperties\":false},\"components\":{\"type\":\"object\",\"description\":\"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.\",\"additionalProperties\":false,\"properties\":{\"schemas\":{\"$ref\":\"#/definitions/schemas\"},\"messages\":{\"$ref\":\"#/definitions/messages\"},\"securitySchemes\":{\"type\":\"object\",\"patternProperties\":{\"^[a-zA-Z0-9\\\\.\\\\-_]+$\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/SecurityScheme\"}]}}},\"parameters\":{\"$ref\":\"#/definitions/parameters\"}}},\"schemas\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/schema\"},\"description\":\"JSON objects describing schemas the API uses.\"},\"messages\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/message\"},\"description\":\"JSON objects describing the messages being consumed and produced by the API.\"},\"parameters\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/parameter\"},\"description\":\"JSON objects describing re-usable topic parameters.\"},\"schema\":{\"type\":\"object\",\"description\":\"A deterministic version of a JSON Schema object.\",\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"$ref\":{\"type\":\"string\"},\"format\":{\"type\":\"string\"},\"title\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/title\"},\"description\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/description\"},\"default\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/default\"},\"multipleOf\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/multipleOf\"},\"maximum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/maximum\"},\"exclusiveMaximum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum\"},\"minimum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/minimum\"},\"exclusiveMinimum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum\"},\"maxLength\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minLength\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"pattern\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/pattern\"},\"maxItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"uniqueItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/uniqueItems\"},\"maxProperties\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minProperties\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"required\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/stringArray\"},\"enum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/enum\"},\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/definitions/schema\"},{\"type\":\"boolean\"}],\"default\":{}},\"type\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/type\"},\"items\":{\"anyOf\":[{\"$ref\":\"#/definitions/schema\"},{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/schema\"}}],\"default\":{}},\"allOf\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/schema\"}},\"oneOf\":{\"type\":\"array\",\"minItems\":2,\"items\":{\"$ref\":\"#/definitions/schema\"}},\"anyOf\":{\"type\":\"array\",\"minItems\":2,\"items\":{\"$ref\":\"#/definitions/schema\"}},\"not\":{\"$ref\":\"#/definitions/schema\"},\"properties\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/schema\"},\"default\":{}},\"discriminator\":{\"type\":\"string\"},\"readOnly\":{\"type\":\"boolean\",\"default\":false},\"xml\":{\"$ref\":\"#/definitions/xml\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"example\":{}},\"additionalProperties\":false},\"xml\":{\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"},\"prefix\":{\"type\":\"string\"},\"attribute\":{\"type\":\"boolean\",\"default\":false},\"wrapped\":{\"type\":\"boolean\",\"default\":false}}},\"externalDocs\":{\"type\":\"object\",\"additionalProperties\":false,\"description\":\"information about external documentation\",\"required\":[\"url\"],\"properties\":{\"description\":{\"type\":\"string\"},\"url\":{\"type\":\"string\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}}},\"topicItem\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"minProperties\":1,\"properties\":{\"$ref\":{\"type\":\"string\"},\"parameters\":{\"type\":\"array\",\"uniqueItems\":true,\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/parameter\"}},\"publish\":{\"$ref\":\"#/definitions/operation\"},\"subscribe\":{\"$ref\":\"#/definitions/operation\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false}}},\"parameter\":{\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"description\":{\"type\":\"string\",\"description\":\"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.\"},\"name\":{\"type\":\"string\",\"description\":\"The name of the parameter.\"},\"schema\":{\"$ref\":\"#/definitions/schema\"},\"$ref\":{\"type\":\"string\"}}},\"operation\":{\"oneOf\":[{\"$ref\":\"#/definitions/message\"},{\"type\":\"object\",\"required\":[\"oneOf\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"oneOf\":{\"type\":\"array\",\"minItems\":2,\"items\":{\"$ref\":\"#/definitions/message\"}}}}]},\"stream\":{\"title\":\"Stream Object\",\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"minProperties\":1,\"properties\":{\"framing\":{\"title\":\"Stream Framing Object\",\"type\":\"object\",\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"minProperties\":1,\"oneOf\":[{\"additionalProperties\":false,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"chunked\"]},\"delimiter\":{\"type\":\"string\",\"enum\":[\"\\\\r\\\\n\",\"\\\\n\"],\"default\":\"\\\\r\\\\n\"}}},{\"additionalProperties\":false,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"sse\"]},\"delimiter\":{\"type\":\"string\",\"enum\":[\"\\\\n\\\\n\"],\"default\":\"\\\\n\\\\n\"}}}]},\"read\":{\"title\":\"Stream Read Object\",\"type\":\"array\",\"uniqueItems\":true,\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/message\"}},\"write\":{\"title\":\"Stream Write Object\",\"type\":\"array\",\"uniqueItems\":true,\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/message\"}}}},\"events\":{\"title\":\"Events Object\",\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"minProperties\":1,\"anyOf\":[{\"required\":[\"receive\"]},{\"required\":[\"send\"]}],\"properties\":{\"receive\":{\"title\":\"Events Receive Object\",\"type\":\"array\",\"uniqueItems\":true,\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/message\"}},\"send\":{\"title\":\"Events Send Object\",\"type\":\"array\",\"uniqueItems\":true,\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/message\"}}}},\"message\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}},\"properties\":{\"$ref\":{\"type\":\"string\"},\"headers\":{\"$ref\":\"#/definitions/schema\"},\"payload\":{\"$ref\":\"#/definitions/schema\"},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"summary\":{\"type\":\"string\",\"description\":\"A brief summary of the message.\"},\"description\":{\"type\":\"string\",\"description\":\"A longer description of the message. CommonMark is allowed.\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false},\"example\":{}}},\"vendorExtension\":{\"description\":\"Any property starting with x- is valid.\",\"additionalProperties\":true,\"additionalItems\":true},\"tag\":{\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/vendorExtension\"}}},\"SecurityScheme\":{\"oneOf\":[{\"$ref\":\"#/definitions/userPassword\"},{\"$ref\":\"#/definitions/apiKey\"},{\"$ref\":\"#/definitions/X509\"},{\"$ref\":\"#/definitions/symmetricEncryption\"},{\"$ref\":\"#/definitions/asymmetricEncryption\"},{\"$ref\":\"#/definitions/HTTPSecurityScheme\"}]},\"userPassword\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"userPassword\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"apiKey\":{\"type\":\"object\",\"required\":[\"type\",\"in\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"apiKey\"]},\"in\":{\"type\":\"string\",\"enum\":[\"user\",\"password\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"X509\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"X509\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"symmetricEncryption\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"symmetricEncryption\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"asymmetricEncryption\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"asymmetricEncryption\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"HTTPSecurityScheme\":{\"oneOf\":[{\"$ref\":\"#/definitions/NonBearerHTTPSecurityScheme\"},{\"$ref\":\"#/definitions/BearerHTTPSecurityScheme\"},{\"$ref\":\"#/definitions/APIKeyHTTPSecurityScheme\"}]},\"NonBearerHTTPSecurityScheme\":{\"not\":{\"type\":\"object\",\"properties\":{\"scheme\":{\"type\":\"string\",\"enum\":[\"bearer\"]}}},\"type\":\"object\",\"required\":[\"scheme\",\"type\"],\"properties\":{\"scheme\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"type\":{\"type\":\"string\",\"enum\":[\"http\"]}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"BearerHTTPSecurityScheme\":{\"type\":\"object\",\"required\":[\"type\",\"scheme\"],\"properties\":{\"scheme\":{\"type\":\"string\",\"enum\":[\"bearer\"]},\"bearerFormat\":{\"type\":\"string\"},\"type\":{\"type\":\"string\",\"enum\":[\"http\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"APIKeyHTTPSecurityScheme\":{\"type\":\"object\",\"required\":[\"type\",\"name\",\"in\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"httpApiKey\"]},\"name\":{\"type\":\"string\"},\"in\":{\"type\":\"string\",\"enum\":[\"header\",\"query\",\"cookie\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{}},\"additionalProperties\":false},\"SecurityRequirement\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}},\"title\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/title\"},\"description\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/description\"},\"default\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/default\"},\"multipleOf\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/multipleOf\"},\"maximum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/maximum\"},\"exclusiveMaximum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum\"},\"minimum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/minimum\"},\"exclusiveMinimum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum\"},\"maxLength\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minLength\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"pattern\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/pattern\"},\"maxItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"uniqueItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/uniqueItems\"},\"enum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/enum\"}}}"); +module.exports = JSON.parse('{"title":"AsyncAPI 1.2.0 schema.","id":"http://asyncapi.hitchhq.com/v1/schema.json#","$schema":"http://json-schema.org/draft-04/schema#","type":"object","required":["asyncapi","info"],"oneOf":[{"required":["topics"]},{"required":["stream"]},{"required":["events"]}],"additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"asyncapi":{"type":"string","enum":["1.0.0","1.1.0","1.2.0"],"description":"The AsyncAPI specification version of this document."},"info":{"$ref":"#/definitions/info"},"baseTopic":{"type":"string","pattern":"^[^/.]","description":"The base topic to the API. Example: \'hitch\'.","default":""},"servers":{"type":"array","items":{"$ref":"#/definitions/server"},"uniqueItems":true},"topics":{"$ref":"#/definitions/topics"},"stream":{"$ref":"#/definitions/stream","description":"The list of messages a consumer can read or write from/to a streaming API."},"events":{"$ref":"#/definitions/events","description":"The list of messages an events API sends and/or receives."},"components":{"$ref":"#/definitions/components"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"security":{"type":"array","items":{"$ref":"#/definitions/SecurityRequirement"}},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"definitions":{"Reference":{"type":"object","required":["$ref"],"properties":{"$ref":{"type":"string","format":"uri"}}},"info":{"type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"#/definitions/contact"},"license":{"$ref":"#/definitions/license"}}},"contact":{"type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}}},"license":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It\'s encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}}},"server":{"type":"object","description":"An object representing a Server.","required":["url","scheme"],"additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"scheme":{"type":"string","description":"The transfer protocol.","enum":["kafka","kafka-secure","amqp","amqps","mqtt","mqtts","secure-mqtt","ws","wss","stomp","stomps","jms","http","https"]},"schemeVersion":{"type":"string"},"variables":{"$ref":"#/definitions/serverVariables"}}},"serverVariables":{"type":"object","additionalProperties":{"$ref":"#/definitions/serverVariable"}},"serverVariable":{"type":"object","description":"An object representing a Server Variable for server URL template substitution.","minProperties":1,"additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"}}},"topics":{"type":"object","description":"Relative paths to the individual topics. They must be relative to the \'baseTopic\'.","patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"},"^[^.]":{"$ref":"#/definitions/topicItem"}},"additionalProperties":false},"components":{"type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"properties":{"schemas":{"$ref":"#/definitions/schemas"},"messages":{"$ref":"#/definitions/messages"},"securitySchemes":{"type":"object","patternProperties":{"^[a-zA-Z0-9\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/SecurityScheme"}]}}},"parameters":{"$ref":"#/definitions/parameters"}}},"schemas":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"description":"JSON objects describing schemas the API uses."},"messages":{"type":"object","additionalProperties":{"$ref":"#/definitions/message"},"description":"JSON objects describing the messages being consumed and produced by the API."},"parameters":{"type":"object","additionalProperties":{"$ref":"#/definitions/parameter"},"description":"JSON objects describing re-usable topic parameters."},"schema":{"type":"object","description":"A deterministic version of a JSON Schema object.","patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"$ref":{"type":"string"},"format":{"type":"string"},"title":{"$ref":"http://json-schema.org/draft-04/schema#/properties/title"},"description":{"$ref":"http://json-schema.org/draft-04/schema#/properties/description"},"default":{"$ref":"http://json-schema.org/draft-04/schema#/properties/default"},"multipleOf":{"$ref":"http://json-schema.org/draft-04/schema#/properties/multipleOf"},"maximum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/maximum"},"exclusiveMaximum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"},"minimum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/minimum"},"exclusiveMinimum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"},"maxLength":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minLength":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"pattern":{"$ref":"http://json-schema.org/draft-04/schema#/properties/pattern"},"maxItems":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minItems":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"uniqueItems":{"$ref":"http://json-schema.org/draft-04/schema#/properties/uniqueItems"},"maxProperties":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minProperties":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"required":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/stringArray"},"enum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/enum"},"additionalProperties":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"boolean"}],"default":{}},"type":{"$ref":"http://json-schema.org/draft-04/schema#/properties/type"},"items":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"oneOf":{"type":"array","minItems":2,"items":{"$ref":"#/definitions/schema"}},"anyOf":{"type":"array","minItems":2,"items":{"$ref":"#/definitions/schema"}},"not":{"$ref":"#/definitions/schema"},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"discriminator":{"type":"string"},"readOnly":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/xml"},"externalDocs":{"$ref":"#/definitions/externalDocs"},"example":{}},"additionalProperties":false},"xml":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"namespace":{"type":"string"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}}},"externalDocs":{"type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}}},"topicItem":{"type":"object","additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"minProperties":1,"properties":{"$ref":{"type":"string"},"parameters":{"type":"array","uniqueItems":true,"minItems":1,"items":{"$ref":"#/definitions/parameter"}},"publish":{"$ref":"#/definitions/operation"},"subscribe":{"$ref":"#/definitions/operation"},"deprecated":{"type":"boolean","default":false}}},"parameter":{"additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"name":{"type":"string","description":"The name of the parameter."},"schema":{"$ref":"#/definitions/schema"},"$ref":{"type":"string"}}},"operation":{"oneOf":[{"$ref":"#/definitions/message"},{"type":"object","required":["oneOf"],"additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"oneOf":{"type":"array","minItems":2,"items":{"$ref":"#/definitions/message"}}}}]},"stream":{"title":"Stream Object","type":"object","additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"minProperties":1,"properties":{"framing":{"title":"Stream Framing Object","type":"object","patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"minProperties":1,"oneOf":[{"additionalProperties":false,"properties":{"type":{"type":"string","enum":["chunked"]},"delimiter":{"type":"string","enum":["\\\\r\\\\n","\\\\n"],"default":"\\\\r\\\\n"}}},{"additionalProperties":false,"properties":{"type":{"type":"string","enum":["sse"]},"delimiter":{"type":"string","enum":["\\\\n\\\\n"],"default":"\\\\n\\\\n"}}}]},"read":{"title":"Stream Read Object","type":"array","uniqueItems":true,"minItems":1,"items":{"$ref":"#/definitions/message"}},"write":{"title":"Stream Write Object","type":"array","uniqueItems":true,"minItems":1,"items":{"$ref":"#/definitions/message"}}}},"events":{"title":"Events Object","type":"object","additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"minProperties":1,"anyOf":[{"required":["receive"]},{"required":["send"]}],"properties":{"receive":{"title":"Events Receive Object","type":"array","uniqueItems":true,"minItems":1,"items":{"$ref":"#/definitions/message"}},"send":{"title":"Events Send Object","type":"array","uniqueItems":true,"minItems":1,"items":{"$ref":"#/definitions/message"}}}},"message":{"type":"object","additionalProperties":false,"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}},"properties":{"$ref":{"type":"string"},"headers":{"$ref":"#/definitions/schema"},"payload":{"$ref":"#/definitions/schema"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"example":{}}},"vendorExtension":{"description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"patternProperties":{"^x-":{"$ref":"#/definitions/vendorExtension"}}},"SecurityScheme":{"oneOf":[{"$ref":"#/definitions/userPassword"},{"$ref":"#/definitions/apiKey"},{"$ref":"#/definitions/X509"},{"$ref":"#/definitions/symmetricEncryption"},{"$ref":"#/definitions/asymmetricEncryption"},{"$ref":"#/definitions/HTTPSecurityScheme"}]},"userPassword":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"apiKey":{"type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"X509":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"symmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"asymmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"HTTPSecurityScheme":{"oneOf":[{"$ref":"#/definitions/NonBearerHTTPSecurityScheme"},{"$ref":"#/definitions/BearerHTTPSecurityScheme"},{"$ref":"#/definitions/APIKeyHTTPSecurityScheme"}]},"NonBearerHTTPSecurityScheme":{"not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-":{}},"additionalProperties":false},"BearerHTTPSecurityScheme":{"type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"APIKeyHTTPSecurityScheme":{"type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"SecurityRequirement":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"title":{"$ref":"http://json-schema.org/draft-04/schema#/properties/title"},"description":{"$ref":"http://json-schema.org/draft-04/schema#/properties/description"},"default":{"$ref":"http://json-schema.org/draft-04/schema#/properties/default"},"multipleOf":{"$ref":"http://json-schema.org/draft-04/schema#/properties/multipleOf"},"maximum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/maximum"},"exclusiveMaximum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"},"minimum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/minimum"},"exclusiveMinimum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"},"maxLength":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minLength":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"pattern":{"$ref":"http://json-schema.org/draft-04/schema#/properties/pattern"},"maxItems":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minItems":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"uniqueItems":{"$ref":"http://json-schema.org/draft-04/schema#/properties/uniqueItems"},"enum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/enum"}}}'); /***/ }), @@ -158,7 +37,7 @@ module.exports = JSON.parse("{\"title\":\"AsyncAPI 1.2.0 schema.\",\"id\":\"http /***/ ((module) => { "use strict"; -module.exports = JSON.parse("{\"title\":\"AsyncAPI 2.0.0-rc1 schema.\",\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"required\":[\"asyncapi\",\"id\",\"info\",\"channels\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"asyncapi\":{\"type\":\"string\",\"enum\":[\"2.0.0-rc1\"],\"description\":\"The AsyncAPI specification version of this document.\"},\"id\":{\"type\":\"string\",\"description\":\"A unique id representing the application.\",\"format\":\"uri-reference\"},\"info\":{\"$ref\":\"#/definitions/info\"},\"servers\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/server\"},\"uniqueItems\":true},\"defaultContentType\":{\"type\":\"string\"},\"channels\":{\"$ref\":\"#/definitions/channels\"},\"components\":{\"$ref\":\"#/definitions/components\"},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"}},\"definitions\":{\"Reference\":{\"type\":\"object\",\"required\":[\"$ref\"],\"properties\":{\"$ref\":{\"$ref\":\"#/definitions/ReferenceObject\"}}},\"ReferenceObject\":{\"type\":\"string\",\"format\":\"uri\"},\"info\":{\"type\":\"object\",\"description\":\"General information about the API.\",\"required\":[\"version\",\"title\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"title\":{\"type\":\"string\",\"description\":\"A unique and precise title of the API.\"},\"version\":{\"type\":\"string\",\"description\":\"A semantic version number of the API.\"},\"description\":{\"type\":\"string\",\"description\":\"A longer description of the API. Should be different from the title. CommonMark is allowed.\"},\"termsOfService\":{\"type\":\"string\",\"description\":\"A URL to the Terms of Service for the API. MUST be in the format of a URL.\",\"format\":\"uri\"},\"contact\":{\"$ref\":\"#/definitions/contact\"},\"license\":{\"$ref\":\"#/definitions/license\"}}},\"contact\":{\"type\":\"object\",\"description\":\"Contact information for the owners of the API.\",\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\",\"description\":\"The identifying name of the contact person/organization.\"},\"url\":{\"type\":\"string\",\"description\":\"The URL pointing to the contact information.\",\"format\":\"uri\"},\"email\":{\"type\":\"string\",\"description\":\"The email address of the contact person/organization.\",\"format\":\"email\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"license\":{\"type\":\"object\",\"required\":[\"name\"],\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\",\"description\":\"The name of the license type. It's encouraged to use an OSI compatible license.\"},\"url\":{\"type\":\"string\",\"description\":\"The URL pointing to the license.\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"server\":{\"type\":\"object\",\"description\":\"An object representing a Server.\",\"required\":[\"url\",\"protocol\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"url\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"protocol\":{\"type\":\"string\",\"description\":\"The transfer protocol.\"},\"protocolVersion\":{\"type\":\"string\"},\"variables\":{\"$ref\":\"#/definitions/serverVariables\"},\"baseChannel\":{\"type\":\"string\",\"x-format\":\"uri-path\"},\"security\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/SecurityRequirement\"}}}},\"serverVariables\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/serverVariable\"}},\"serverVariable\":{\"type\":\"object\",\"description\":\"An object representing a Server Variable for server URL template substitution.\",\"minProperties\":1,\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"enum\":{\"type\":\"array\",\"items\":{\"type\":\"string\"},\"uniqueItems\":true},\"default\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"examples\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}}},\"channels\":{\"type\":\"object\",\"propertyNames\":{\"type\":\"string\",\"format\":\"uri-template\",\"minLength\":1},\"additionalProperties\":{\"$ref\":\"#/definitions/channelItem\"}},\"components\":{\"type\":\"object\",\"description\":\"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.\",\"additionalProperties\":false,\"properties\":{\"schemas\":{\"$ref\":\"#/definitions/schemas\"},\"messages\":{\"$ref\":\"#/definitions/messages\"},\"securitySchemes\":{\"type\":\"object\",\"patternProperties\":{\"^[\\\\w\\\\d\\\\.\\\\-_]+$\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/SecurityScheme\"}]}}},\"parameters\":{\"$ref\":\"#/definitions/parameters\"},\"correlationIds\":{\"type\":\"object\",\"patternProperties\":{\"^[\\\\w\\\\d\\\\.\\\\-_]+$\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/correlationId\"}]}}},\"traits\":{\"$ref\":\"#/definitions/traits\"}}},\"schemas\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/schema\"},\"description\":\"JSON objects describing schemas the API uses.\"},\"messages\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/message\"},\"description\":\"JSON objects describing the messages being consumed and produced by the API.\"},\"parameters\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/parameter\"},\"description\":\"JSON objects describing re-usable channel parameters.\"},\"schema\":{\"type\":\"object\",\"description\":\"A deterministic version of a JSON Schema object.\",\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"$ref\":{\"$ref\":\"#/definitions/ReferenceObject\"},\"format\":{\"type\":\"string\"},\"title\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/title\"},\"description\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/description\"},\"default\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/default\"},\"multipleOf\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/multipleOf\"},\"maximum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/maximum\"},\"exclusiveMaximum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum\"},\"minimum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/minimum\"},\"exclusiveMinimum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum\"},\"maxLength\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minLength\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"pattern\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/pattern\"},\"maxItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"uniqueItems\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/uniqueItems\"},\"maxProperties\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"},\"minProperties\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"},\"required\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/definitions/stringArray\"},\"enum\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/enum\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false},\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/definitions/schema\"},{\"type\":\"boolean\"}],\"default\":{}},\"type\":{\"$ref\":\"http://json-schema.org/draft-04/schema#/properties/type\"},\"items\":{\"anyOf\":[{\"$ref\":\"#/definitions/schema\"},{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/schema\"}}],\"default\":{}},\"allOf\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/schema\"}},\"oneOf\":{\"type\":\"array\",\"minItems\":2,\"items\":{\"$ref\":\"#/definitions/schema\"}},\"anyOf\":{\"type\":\"array\",\"minItems\":2,\"items\":{\"$ref\":\"#/definitions/schema\"}},\"not\":{\"$ref\":\"#/definitions/schema\"},\"properties\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/schema\"},\"default\":{}},\"discriminator\":{\"type\":\"string\"},\"readOnly\":{\"type\":\"boolean\",\"default\":false},\"xml\":{\"$ref\":\"#/definitions/xml\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"example\":{},\"examples\":{\"type\":\"array\",\"items\":{}}},\"additionalProperties\":false},\"xml\":{\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"},\"prefix\":{\"type\":\"string\"},\"attribute\":{\"type\":\"boolean\",\"default\":false},\"wrapped\":{\"type\":\"boolean\",\"default\":false}}},\"externalDocs\":{\"type\":\"object\",\"additionalProperties\":false,\"description\":\"information about external documentation\",\"required\":[\"url\"],\"properties\":{\"description\":{\"type\":\"string\"},\"url\":{\"type\":\"string\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"channelItem\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"minProperties\":1,\"properties\":{\"$ref\":{\"$ref\":\"#/definitions/ReferenceObject\"},\"parameters\":{\"type\":\"array\",\"uniqueItems\":true,\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/parameter\"}},\"publish\":{\"$ref\":\"#/definitions/operation\"},\"subscribe\":{\"$ref\":\"#/definitions/operation\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false},\"protocolInfo\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}}}},\"parameter\":{\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"description\":{\"type\":\"string\",\"description\":\"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.\"},\"name\":{\"type\":\"string\",\"description\":\"The name of the parameter.\"},\"schema\":{\"$ref\":\"#/definitions/schema\"},\"$ref\":{\"$ref\":\"#/definitions/ReferenceObject\"}}},\"operation\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"traits\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/operationTrait\"},{\"type\":\"array\",\"items\":[{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/operationTrait\"}]},{\"type\":\"object\",\"additionalItems\":true}]}]}},\"summary\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"operationId\":{\"type\":\"string\"},\"protocolInfo\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"message\":{\"oneOf\":[{\"$ref\":\"#/definitions/message\"},{\"type\":\"object\",\"required\":[\"oneOf\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"oneOf\":{\"type\":\"array\",\"minItems\":2,\"items\":{\"$ref\":\"#/definitions/message\"}}}}]}}},\"message\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"schemaFormat\":{\"type\":\"string\"},\"contentType\":{\"type\":\"string\"},\"headers\":{\"type\":\"object\",\"additionalProperties\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/schema\"}]}},\"payload\":{},\"correlationId\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/correlationId\"}]},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"summary\":{\"type\":\"string\",\"description\":\"A brief summary of the message.\"},\"name\":{\"type\":\"string\",\"description\":\"Name of the message.\"},\"title\":{\"type\":\"string\",\"description\":\"A human-friendly title for the message.\"},\"description\":{\"type\":\"string\",\"description\":\"A longer description of the message. CommonMark is allowed.\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false},\"examples\":{\"type\":\"array\",\"items\":{\"type\":\"object\"}},\"protocolInfo\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"traits\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/messageTrait\"},{\"type\":\"array\",\"items\":[{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/messageTrait\"}]},{\"type\":\"object\",\"additionalItems\":true}]}]}}}},\"correlationId\":{\"type\":\"object\",\"required\":[\"location\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"description\":{\"type\":\"string\",\"description\":\"A optional description of the correlation ID. GitHub Flavored Markdown is allowed.\"},\"location\":{\"type\":\"string\",\"description\":\"A runtime expression that specifies the location of the correlation ID\",\"pattern\":\"^\\\\$message\\\\.(header|payload)#(/\\\\w+)+\"}}},\"specificationExtension\":{\"description\":\"Any property starting with x- is valid.\",\"additionalProperties\":true,\"additionalItems\":true},\"tag\":{\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"traits\":{\"type\":\"object\",\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/definitions/operationTrait\"},{\"$ref\":\"#/definitions/messageTrait\"}]}},\"operationTrait\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"summary\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"operationId\":{\"type\":\"string\"},\"protocolInfo\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}}}},\"messageTrait\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"schemaFormat\":{\"type\":\"string\"},\"contentType\":{\"type\":\"string\"},\"headers\":{\"type\":\"object\",\"additionalProperties\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/schema\"}]}},\"correlationId\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/correlationId\"}]},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"summary\":{\"type\":\"string\",\"description\":\"A brief summary of the message.\"},\"name\":{\"type\":\"string\",\"description\":\"Name of the message.\"},\"title\":{\"type\":\"string\",\"description\":\"A human-friendly title for the message.\"},\"description\":{\"type\":\"string\",\"description\":\"A longer description of the message. CommonMark is allowed.\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false},\"examples\":{\"type\":\"array\",\"items\":{\"type\":\"object\"}},\"protocolInfo\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}}}},\"SecurityScheme\":{\"oneOf\":[{\"$ref\":\"#/definitions/userPassword\"},{\"$ref\":\"#/definitions/apiKey\"},{\"$ref\":\"#/definitions/X509\"},{\"$ref\":\"#/definitions/symmetricEncryption\"},{\"$ref\":\"#/definitions/asymmetricEncryption\"},{\"$ref\":\"#/definitions/HTTPSecurityScheme\"},{\"$ref\":\"#/definitions/oauth2Flows\"},{\"$ref\":\"#/definitions/openIdConnect\"}]},\"userPassword\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"userPassword\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"apiKey\":{\"type\":\"object\",\"required\":[\"type\",\"in\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"apiKey\"]},\"in\":{\"type\":\"string\",\"enum\":[\"user\",\"password\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"X509\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"X509\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"symmetricEncryption\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"symmetricEncryption\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"asymmetricEncryption\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"asymmetricEncryption\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"HTTPSecurityScheme\":{\"oneOf\":[{\"$ref\":\"#/definitions/NonBearerHTTPSecurityScheme\"},{\"$ref\":\"#/definitions/BearerHTTPSecurityScheme\"},{\"$ref\":\"#/definitions/APIKeyHTTPSecurityScheme\"}]},\"NonBearerHTTPSecurityScheme\":{\"not\":{\"type\":\"object\",\"properties\":{\"scheme\":{\"type\":\"string\",\"enum\":[\"bearer\"]}}},\"type\":\"object\",\"required\":[\"scheme\",\"type\"],\"properties\":{\"scheme\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"type\":{\"type\":\"string\",\"enum\":[\"http\"]}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"BearerHTTPSecurityScheme\":{\"type\":\"object\",\"required\":[\"type\",\"scheme\"],\"properties\":{\"scheme\":{\"type\":\"string\",\"enum\":[\"bearer\"]},\"bearerFormat\":{\"type\":\"string\"},\"type\":{\"type\":\"string\",\"enum\":[\"http\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"APIKeyHTTPSecurityScheme\":{\"type\":\"object\",\"required\":[\"type\",\"name\",\"in\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"httpApiKey\"]},\"name\":{\"type\":\"string\"},\"in\":{\"type\":\"string\",\"enum\":[\"header\",\"query\",\"cookie\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"oauth2Flows\":{\"type\":\"object\",\"required\":[\"type\",\"flows\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"oauth2\"]},\"description\":{\"type\":\"string\"},\"flows\":{\"type\":\"object\",\"properties\":{\"implicit\":{\"allOf\":[{\"$ref\":\"#/definitions/oauth2Flow\"},{\"required\":[\"authorizationUrl\",\"scopes\"]},{\"not\":{\"required\":[\"tokenUrl\"]}}]},\"password\":{\"allOf\":[{\"$ref\":\"#/definitions/oauth2Flow\"},{\"required\":[\"tokenUrl\",\"scopes\"]},{\"not\":{\"required\":[\"authorizationUrl\"]}}]},\"clientCredentials\":{\"allOf\":[{\"$ref\":\"#/definitions/oauth2Flow\"},{\"required\":[\"tokenUrl\",\"scopes\"]},{\"not\":{\"required\":[\"authorizationUrl\"]}}]},\"authorizationCode\":{\"allOf\":[{\"$ref\":\"#/definitions/oauth2Flow\"},{\"required\":[\"authorizationUrl\",\"tokenUrl\",\"scopes\"]}]}},\"additionalProperties\":false,\"minProperties\":1}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"oauth2Flow\":{\"type\":\"object\",\"properties\":{\"authorizationUrl\":{\"type\":\"string\",\"format\":\"uri\"},\"tokenUrl\":{\"type\":\"string\",\"format\":\"uri\"},\"refreshUrl\":{\"type\":\"string\",\"format\":\"uri\"},\"scopes\":{\"$ref\":\"#/definitions/oauth2Scopes\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"oauth2Scopes\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"string\"}},\"openIdConnect\":{\"type\":\"object\",\"required\":[\"type\",\"openIdConnectUrl\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"openIdConnect\"]},\"description\":{\"type\":\"string\"},\"openIdConnectUrl\":{\"type\":\"string\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"SecurityRequirement\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"array\",\"items\":{\"type\":\"string\"},\"uniqueItems\":true}}}}"); +module.exports = JSON.parse('{"title":"AsyncAPI 2.0.0-rc1 schema.","$schema":"http://json-schema.org/draft-07/schema#","type":"object","required":["asyncapi","id","info","channels"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"asyncapi":{"type":"string","enum":["2.0.0-rc1"],"description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri-reference"},"info":{"$ref":"#/definitions/info"},"servers":{"type":"array","items":{"$ref":"#/definitions/server"},"uniqueItems":true},"defaultContentType":{"type":"string"},"channels":{"$ref":"#/definitions/channels"},"components":{"$ref":"#/definitions/components"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"definitions":{"Reference":{"type":"object","required":["$ref"],"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"ReferenceObject":{"type":"string","format":"uri"},"info":{"type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"#/definitions/contact"},"license":{"$ref":"#/definitions/license"}}},"contact":{"type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}}},"license":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It\'s encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}}},"server":{"type":"object","description":"An object representing a Server.","required":["url","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"protocol":{"type":"string","description":"The transfer protocol."},"protocolVersion":{"type":"string"},"variables":{"$ref":"#/definitions/serverVariables"},"baseChannel":{"type":"string","x-format":"uri-path"},"security":{"type":"array","items":{"$ref":"#/definitions/SecurityRequirement"}}}},"serverVariables":{"type":"object","additionalProperties":{"$ref":"#/definitions/serverVariable"}},"serverVariable":{"type":"object","description":"An object representing a Server Variable for server URL template substitution.","minProperties":1,"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}}},"channels":{"type":"object","propertyNames":{"type":"string","format":"uri-template","minLength":1},"additionalProperties":{"$ref":"#/definitions/channelItem"}},"components":{"type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"properties":{"schemas":{"$ref":"#/definitions/schemas"},"messages":{"$ref":"#/definitions/messages"},"securitySchemes":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/SecurityScheme"}]}}},"parameters":{"$ref":"#/definitions/parameters"},"correlationIds":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]}}},"traits":{"$ref":"#/definitions/traits"}}},"schemas":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"description":"JSON objects describing schemas the API uses."},"messages":{"type":"object","additionalProperties":{"$ref":"#/definitions/message"},"description":"JSON objects describing the messages being consumed and produced by the API."},"parameters":{"type":"object","additionalProperties":{"$ref":"#/definitions/parameter"},"description":"JSON objects describing re-usable channel parameters."},"schema":{"type":"object","description":"A deterministic version of a JSON Schema object.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"},"format":{"type":"string"},"title":{"$ref":"http://json-schema.org/draft-04/schema#/properties/title"},"description":{"$ref":"http://json-schema.org/draft-04/schema#/properties/description"},"default":{"$ref":"http://json-schema.org/draft-04/schema#/properties/default"},"multipleOf":{"$ref":"http://json-schema.org/draft-04/schema#/properties/multipleOf"},"maximum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/maximum"},"exclusiveMaximum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"},"minimum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/minimum"},"exclusiveMinimum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"},"maxLength":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minLength":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"pattern":{"$ref":"http://json-schema.org/draft-04/schema#/properties/pattern"},"maxItems":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minItems":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"uniqueItems":{"$ref":"http://json-schema.org/draft-04/schema#/properties/uniqueItems"},"maxProperties":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},"minProperties":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},"required":{"$ref":"http://json-schema.org/draft-04/schema#/definitions/stringArray"},"enum":{"$ref":"http://json-schema.org/draft-04/schema#/properties/enum"},"deprecated":{"type":"boolean","default":false},"additionalProperties":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"boolean"}],"default":{}},"type":{"$ref":"http://json-schema.org/draft-04/schema#/properties/type"},"items":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"oneOf":{"type":"array","minItems":2,"items":{"$ref":"#/definitions/schema"}},"anyOf":{"type":"array","minItems":2,"items":{"$ref":"#/definitions/schema"}},"not":{"$ref":"#/definitions/schema"},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"discriminator":{"type":"string"},"readOnly":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/xml"},"externalDocs":{"$ref":"#/definitions/externalDocs"},"example":{},"examples":{"type":"array","items":{}}},"additionalProperties":false},"xml":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"namespace":{"type":"string"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}}},"externalDocs":{"type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}}},"channelItem":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"minProperties":1,"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"},"parameters":{"type":"array","uniqueItems":true,"minItems":1,"items":{"$ref":"#/definitions/parameter"}},"publish":{"$ref":"#/definitions/operation"},"subscribe":{"$ref":"#/definitions/operation"},"deprecated":{"type":"boolean","default":false},"protocolInfo":{"type":"object","additionalProperties":{"type":"object"}}}},"parameter":{"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"name":{"type":"string","description":"The name of the parameter."},"schema":{"$ref":"#/definitions/schema"},"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"operation":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationTrait"},{"type":"array","items":[{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationTrait"}]},{"type":"object","additionalItems":true}]}]}},"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"protocolInfo":{"type":"object","additionalProperties":{"type":"object"}},"message":{"oneOf":[{"$ref":"#/definitions/message"},{"type":"object","required":["oneOf"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"oneOf":{"type":"array","minItems":2,"items":{"$ref":"#/definitions/message"}}}}]}}},"message":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/schema"}]}},"payload":{},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object"}},"protocolInfo":{"type":"object","additionalProperties":{"type":"object"}},"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"},{"type":"array","items":[{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"}]},{"type":"object","additionalItems":true}]}]}}}},"correlationId":{"type":"object","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)#(/\\\\w+)+"}}},"specificationExtension":{"description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}}},"traits":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#/definitions/operationTrait"},{"$ref":"#/definitions/messageTrait"}]}},"operationTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"protocolInfo":{"type":"object","additionalProperties":{"type":"object"}}}},"messageTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/schema"}]}},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object"}},"protocolInfo":{"type":"object","additionalProperties":{"type":"object"}}}},"SecurityScheme":{"oneOf":[{"$ref":"#/definitions/userPassword"},{"$ref":"#/definitions/apiKey"},{"$ref":"#/definitions/X509"},{"$ref":"#/definitions/symmetricEncryption"},{"$ref":"#/definitions/asymmetricEncryption"},{"$ref":"#/definitions/HTTPSecurityScheme"},{"$ref":"#/definitions/oauth2Flows"},{"$ref":"#/definitions/openIdConnect"}]},"userPassword":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"apiKey":{"type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"X509":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"symmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"asymmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"HTTPSecurityScheme":{"oneOf":[{"$ref":"#/definitions/NonBearerHTTPSecurityScheme"},{"$ref":"#/definitions/BearerHTTPSecurityScheme"},{"$ref":"#/definitions/APIKeyHTTPSecurityScheme"}]},"NonBearerHTTPSecurityScheme":{"not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"BearerHTTPSecurityScheme":{"type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"APIKeyHTTPSecurityScheme":{"type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Flows":{"type":"object","required":["type","flows"],"properties":{"type":{"type":"string","enum":["oauth2"]},"description":{"type":"string"},"flows":{"type":"object","properties":{"implicit":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","scopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","tokenUrl","scopes"]}]}},"additionalProperties":false,"minProperties":1}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}}},"oauth2Flow":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"tokenUrl":{"type":"string","format":"uri"},"refreshUrl":{"type":"string","format":"uri"},"scopes":{"$ref":"#/definitions/oauth2Scopes"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Scopes":{"type":"object","additionalProperties":{"type":"string"}},"openIdConnect":{"type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","enum":["openIdConnect"]},"description":{"type":"string"},"openIdConnectUrl":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SecurityRequirement":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true}}}}'); /***/ }), @@ -166,7 +45,7 @@ module.exports = JSON.parse("{\"title\":\"AsyncAPI 2.0.0-rc1 schema.\",\"$schema /***/ ((module) => { "use strict"; -module.exports = JSON.parse("{\"title\":\"AsyncAPI 2.0.0-rc2 schema.\",\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"required\":[\"asyncapi\",\"info\",\"channels\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"asyncapi\":{\"type\":\"string\",\"enum\":[\"2.0.0-rc2\"],\"description\":\"The AsyncAPI specification version of this document.\"},\"id\":{\"type\":\"string\",\"description\":\"A unique id representing the application.\",\"format\":\"uri\"},\"info\":{\"$ref\":\"#/definitions/info\"},\"servers\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/server\"}},\"defaultContentType\":{\"type\":\"string\"},\"channels\":{\"$ref\":\"#/definitions/channels\"},\"components\":{\"$ref\":\"#/definitions/components\"},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"}},\"definitions\":{\"Reference\":{\"type\":\"object\",\"required\":[\"$ref\"],\"properties\":{\"$ref\":{\"$ref\":\"#/definitions/ReferenceObject\"}}},\"ReferenceObject\":{\"type\":\"string\",\"format\":\"uri-reference\"},\"info\":{\"type\":\"object\",\"description\":\"General information about the API.\",\"required\":[\"version\",\"title\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"title\":{\"type\":\"string\",\"description\":\"A unique and precise title of the API.\"},\"version\":{\"type\":\"string\",\"description\":\"A semantic version number of the API.\"},\"description\":{\"type\":\"string\",\"description\":\"A longer description of the API. Should be different from the title. CommonMark is allowed.\"},\"termsOfService\":{\"type\":\"string\",\"description\":\"A URL to the Terms of Service for the API. MUST be in the format of a URL.\",\"format\":\"uri\"},\"contact\":{\"$ref\":\"#/definitions/contact\"},\"license\":{\"$ref\":\"#/definitions/license\"}}},\"contact\":{\"type\":\"object\",\"description\":\"Contact information for the owners of the API.\",\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\",\"description\":\"The identifying name of the contact person/organization.\"},\"url\":{\"type\":\"string\",\"description\":\"The URL pointing to the contact information.\",\"format\":\"uri\"},\"email\":{\"type\":\"string\",\"description\":\"The email address of the contact person/organization.\",\"format\":\"email\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"license\":{\"type\":\"object\",\"required\":[\"name\"],\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\",\"description\":\"The name of the license type. It's encouraged to use an OSI compatible license.\"},\"url\":{\"type\":\"string\",\"description\":\"The URL pointing to the license.\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"server\":{\"type\":\"object\",\"description\":\"An object representing a Server.\",\"required\":[\"url\",\"protocol\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"url\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"protocol\":{\"type\":\"string\",\"description\":\"The transfer protocol.\"},\"protocolVersion\":{\"type\":\"string\"},\"variables\":{\"$ref\":\"#/definitions/serverVariables\"},\"security\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/SecurityRequirement\"}},\"bindings\":{\"$ref\":\"#/definitions/bindingsObject\"}}},\"serverVariables\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/serverVariable\"}},\"serverVariable\":{\"type\":\"object\",\"description\":\"An object representing a Server Variable for server URL template substitution.\",\"minProperties\":1,\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"enum\":{\"type\":\"array\",\"items\":{\"type\":\"string\"},\"uniqueItems\":true},\"default\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"examples\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}}},\"channels\":{\"type\":\"object\",\"propertyNames\":{\"type\":\"string\",\"format\":\"uri-template\",\"minLength\":1},\"additionalProperties\":{\"$ref\":\"#/definitions/channelItem\"}},\"components\":{\"type\":\"object\",\"description\":\"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.\",\"additionalProperties\":false,\"properties\":{\"schemas\":{\"$ref\":\"#/definitions/schemas\"},\"messages\":{\"$ref\":\"#/definitions/messages\"},\"securitySchemes\":{\"type\":\"object\",\"patternProperties\":{\"^[\\\\w\\\\d\\\\.\\\\-_]+$\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/SecurityScheme\"}]}}},\"parameters\":{\"$ref\":\"#/definitions/parameters\"},\"correlationIds\":{\"type\":\"object\",\"patternProperties\":{\"^[\\\\w\\\\d\\\\.\\\\-_]+$\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/correlationId\"}]}}},\"operationTraits\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/operationTrait\"}},\"messageTraits\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/messageTrait\"}},\"serverBindings\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/bindingsObject\"}},\"channelBindings\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/bindingsObject\"}},\"operationBindings\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/bindingsObject\"}},\"messageBindings\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/bindingsObject\"}}}},\"schemas\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/schema\"},\"description\":\"JSON objects describing schemas the API uses.\"},\"messages\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/message\"},\"description\":\"JSON objects describing the messages being consumed and produced by the API.\"},\"parameters\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/parameter\"},\"description\":\"JSON objects describing re-usable channel parameters.\"},\"schema\":{\"allOf\":[{\"$ref\":\"http://json-schema.org/draft-07/schema#\"},{\"type\":\"object\",\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"additionalProperties\":{\"$ref\":\"#/definitions/schema\"},\"items\":{\"anyOf\":[{\"$ref\":\"#/definitions/schema\"},{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/schema\"}}],\"default\":{}},\"allOf\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/schema\"}},\"oneOf\":{\"type\":\"array\",\"minItems\":2,\"items\":{\"$ref\":\"#/definitions/schema\"}},\"anyOf\":{\"type\":\"array\",\"minItems\":2,\"items\":{\"$ref\":\"#/definitions/schema\"}},\"not\":{\"$ref\":\"#/definitions/schema\"},\"properties\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/schema\"},\"default\":{}},\"patternProperties\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/schema\"},\"default\":{}},\"propertyNames\":{\"$ref\":\"#/definitions/schema\"},\"contains\":{\"$ref\":\"#/definitions/schema\"},\"discriminator\":{\"type\":\"string\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false}}}]},\"externalDocs\":{\"type\":\"object\",\"additionalProperties\":false,\"description\":\"information about external documentation\",\"required\":[\"url\"],\"properties\":{\"description\":{\"type\":\"string\"},\"url\":{\"type\":\"string\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"channelItem\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"minProperties\":1,\"properties\":{\"$ref\":{\"$ref\":\"#/definitions/ReferenceObject\"},\"parameters\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/parameter\"}},\"description\":{\"type\":\"string\",\"description\":\"A description of the channel.\"},\"publish\":{\"$ref\":\"#/definitions/operation\"},\"subscribe\":{\"$ref\":\"#/definitions/operation\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false},\"bindings\":{\"$ref\":\"#/definitions/bindingsObject\"}}},\"parameter\":{\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"description\":{\"type\":\"string\",\"description\":\"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.\"},\"schema\":{\"$ref\":\"#/definitions/schema\"},\"location\":{\"type\":\"string\",\"description\":\"A runtime expression that specifies the location of the parameter value\",\"pattern\":\"^\\\\$message\\\\.(header|payload)\\\\#(\\\\/(([^\\\\/~])|(~[01]))*)*\"},\"$ref\":{\"$ref\":\"#/definitions/ReferenceObject\"}}},\"operation\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"traits\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/operationTrait\"},{\"type\":\"array\",\"items\":[{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/operationTrait\"}]},{\"type\":\"object\",\"additionalItems\":true}]}]}},\"summary\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"operationId\":{\"type\":\"string\"},\"bindings\":{\"$ref\":\"#/definitions/bindingsObject\"},\"message\":{\"$ref\":\"#/definitions/message\"}}},\"message\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"oneOf\":[{\"type\":\"object\",\"required\":[\"oneOf\"],\"additionalProperties\":false,\"properties\":{\"oneOf\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/message\"}}}},{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"schemaFormat\":{\"type\":\"string\"},\"contentType\":{\"type\":\"string\"},\"headers\":{\"$ref\":\"#/definitions/schema\"},\"payload\":{},\"correlationId\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/correlationId\"}]},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"summary\":{\"type\":\"string\",\"description\":\"A brief summary of the message.\"},\"name\":{\"type\":\"string\",\"description\":\"Name of the message.\"},\"title\":{\"type\":\"string\",\"description\":\"A human-friendly title for the message.\"},\"description\":{\"type\":\"string\",\"description\":\"A longer description of the message. CommonMark is allowed.\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false},\"examples\":{\"type\":\"array\",\"items\":{\"type\":\"object\"}},\"bindings\":{\"$ref\":\"#/definitions/bindingsObject\"},\"traits\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/messageTrait\"},{\"type\":\"array\",\"items\":[{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/messageTrait\"}]},{\"type\":\"object\",\"additionalItems\":true}]}]}}}}]}]},\"bindingsObject\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"http\":{},\"ws\":{},\"amqp\":{},\"amqp1\":{},\"mqtt\":{},\"mqtt5\":{},\"kafka\":{},\"nats\":{},\"jms\":{},\"sns\":{},\"sqs\":{},\"stomp\":{},\"redis\":{}}},\"correlationId\":{\"type\":\"object\",\"required\":[\"location\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"description\":{\"type\":\"string\",\"description\":\"A optional description of the correlation ID. GitHub Flavored Markdown is allowed.\"},\"location\":{\"type\":\"string\",\"description\":\"A runtime expression that specifies the location of the correlation ID\",\"pattern\":\"^\\\\$message\\\\.(header|payload)\\\\#(\\\\/(([^\\\\/~])|(~[01]))*)*\"}}},\"specificationExtension\":{\"description\":\"Any property starting with x- is valid.\",\"additionalProperties\":true,\"additionalItems\":true},\"tag\":{\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"operationTrait\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"summary\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"operationId\":{\"type\":\"string\"},\"bindings\":{\"$ref\":\"#/definitions/bindingsObject\"}}},\"messageTrait\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"schemaFormat\":{\"type\":\"string\"},\"contentType\":{\"type\":\"string\"},\"headers\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/schema\"}]},\"correlationId\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/correlationId\"}]},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"summary\":{\"type\":\"string\",\"description\":\"A brief summary of the message.\"},\"name\":{\"type\":\"string\",\"description\":\"Name of the message.\"},\"title\":{\"type\":\"string\",\"description\":\"A human-friendly title for the message.\"},\"description\":{\"type\":\"string\",\"description\":\"A longer description of the message. CommonMark is allowed.\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false},\"examples\":{\"type\":\"array\",\"items\":{\"type\":\"object\"}},\"bindings\":{\"$ref\":\"#/definitions/bindingsObject\"}}},\"SecurityScheme\":{\"oneOf\":[{\"$ref\":\"#/definitions/userPassword\"},{\"$ref\":\"#/definitions/apiKey\"},{\"$ref\":\"#/definitions/X509\"},{\"$ref\":\"#/definitions/symmetricEncryption\"},{\"$ref\":\"#/definitions/asymmetricEncryption\"},{\"$ref\":\"#/definitions/HTTPSecurityScheme\"},{\"$ref\":\"#/definitions/oauth2Flows\"},{\"$ref\":\"#/definitions/openIdConnect\"}]},\"userPassword\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"userPassword\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"apiKey\":{\"type\":\"object\",\"required\":[\"type\",\"in\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"apiKey\"]},\"in\":{\"type\":\"string\",\"enum\":[\"user\",\"password\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"X509\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"X509\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"symmetricEncryption\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"symmetricEncryption\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"asymmetricEncryption\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"asymmetricEncryption\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"HTTPSecurityScheme\":{\"oneOf\":[{\"$ref\":\"#/definitions/NonBearerHTTPSecurityScheme\"},{\"$ref\":\"#/definitions/BearerHTTPSecurityScheme\"},{\"$ref\":\"#/definitions/APIKeyHTTPSecurityScheme\"}]},\"NonBearerHTTPSecurityScheme\":{\"not\":{\"type\":\"object\",\"properties\":{\"scheme\":{\"type\":\"string\",\"enum\":[\"bearer\"]}}},\"type\":\"object\",\"required\":[\"scheme\",\"type\"],\"properties\":{\"scheme\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"type\":{\"type\":\"string\",\"enum\":[\"http\"]}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"BearerHTTPSecurityScheme\":{\"type\":\"object\",\"required\":[\"type\",\"scheme\"],\"properties\":{\"scheme\":{\"type\":\"string\",\"enum\":[\"bearer\"]},\"bearerFormat\":{\"type\":\"string\"},\"type\":{\"type\":\"string\",\"enum\":[\"http\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"APIKeyHTTPSecurityScheme\":{\"type\":\"object\",\"required\":[\"type\",\"name\",\"in\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"httpApiKey\"]},\"name\":{\"type\":\"string\"},\"in\":{\"type\":\"string\",\"enum\":[\"header\",\"query\",\"cookie\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"oauth2Flows\":{\"type\":\"object\",\"required\":[\"type\",\"flows\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"oauth2\"]},\"description\":{\"type\":\"string\"},\"flows\":{\"type\":\"object\",\"properties\":{\"implicit\":{\"allOf\":[{\"$ref\":\"#/definitions/oauth2Flow\"},{\"required\":[\"authorizationUrl\",\"scopes\"]},{\"not\":{\"required\":[\"tokenUrl\"]}}]},\"password\":{\"allOf\":[{\"$ref\":\"#/definitions/oauth2Flow\"},{\"required\":[\"tokenUrl\",\"scopes\"]},{\"not\":{\"required\":[\"authorizationUrl\"]}}]},\"clientCredentials\":{\"allOf\":[{\"$ref\":\"#/definitions/oauth2Flow\"},{\"required\":[\"tokenUrl\",\"scopes\"]},{\"not\":{\"required\":[\"authorizationUrl\"]}}]},\"authorizationCode\":{\"allOf\":[{\"$ref\":\"#/definitions/oauth2Flow\"},{\"required\":[\"authorizationUrl\",\"tokenUrl\",\"scopes\"]}]}},\"additionalProperties\":false,\"minProperties\":1}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"oauth2Flow\":{\"type\":\"object\",\"properties\":{\"authorizationUrl\":{\"type\":\"string\",\"format\":\"uri\"},\"tokenUrl\":{\"type\":\"string\",\"format\":\"uri\"},\"refreshUrl\":{\"type\":\"string\",\"format\":\"uri\"},\"scopes\":{\"$ref\":\"#/definitions/oauth2Scopes\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"oauth2Scopes\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"string\"}},\"openIdConnect\":{\"type\":\"object\",\"required\":[\"type\",\"openIdConnectUrl\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"openIdConnect\"]},\"description\":{\"type\":\"string\"},\"openIdConnectUrl\":{\"type\":\"string\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"SecurityRequirement\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"array\",\"items\":{\"type\":\"string\"},\"uniqueItems\":true}}}}"); +module.exports = JSON.parse('{"title":"AsyncAPI 2.0.0-rc2 schema.","$schema":"http://json-schema.org/draft-07/schema#","type":"object","required":["asyncapi","info","channels"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"asyncapi":{"type":"string","enum":["2.0.0-rc2"],"description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"#/definitions/info"},"servers":{"type":"object","additionalProperties":{"$ref":"#/definitions/server"}},"defaultContentType":{"type":"string"},"channels":{"$ref":"#/definitions/channels"},"components":{"$ref":"#/definitions/components"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"definitions":{"Reference":{"type":"object","required":["$ref"],"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"ReferenceObject":{"type":"string","format":"uri-reference"},"info":{"type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"#/definitions/contact"},"license":{"$ref":"#/definitions/license"}}},"contact":{"type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}}},"license":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It\'s encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}}},"server":{"type":"object","description":"An object representing a Server.","required":["url","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"protocol":{"type":"string","description":"The transfer protocol."},"protocolVersion":{"type":"string"},"variables":{"$ref":"#/definitions/serverVariables"},"security":{"type":"array","items":{"$ref":"#/definitions/SecurityRequirement"}},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"serverVariables":{"type":"object","additionalProperties":{"$ref":"#/definitions/serverVariable"}},"serverVariable":{"type":"object","description":"An object representing a Server Variable for server URL template substitution.","minProperties":1,"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}}},"channels":{"type":"object","propertyNames":{"type":"string","format":"uri-template","minLength":1},"additionalProperties":{"$ref":"#/definitions/channelItem"}},"components":{"type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"properties":{"schemas":{"$ref":"#/definitions/schemas"},"messages":{"$ref":"#/definitions/messages"},"securitySchemes":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/SecurityScheme"}]}}},"parameters":{"$ref":"#/definitions/parameters"},"correlationIds":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]}}},"operationTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/operationTrait"}},"messageTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/messageTrait"}},"serverBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"channelBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"operationBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"messageBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}}}},"schemas":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"description":"JSON objects describing schemas the API uses."},"messages":{"type":"object","additionalProperties":{"$ref":"#/definitions/message"},"description":"JSON objects describing the messages being consumed and produced by the API."},"parameters":{"type":"object","additionalProperties":{"$ref":"#/definitions/parameter"},"description":"JSON objects describing re-usable channel parameters."},"schema":{"allOf":[{"$ref":"http://json-schema.org/draft-07/schema#"},{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"additionalProperties":{"$ref":"#/definitions/schema"},"items":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"oneOf":{"type":"array","minItems":2,"items":{"$ref":"#/definitions/schema"}},"anyOf":{"type":"array","minItems":2,"items":{"$ref":"#/definitions/schema"}},"not":{"$ref":"#/definitions/schema"},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"propertyNames":{"$ref":"#/definitions/schema"},"contains":{"$ref":"#/definitions/schema"},"discriminator":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false}}}]},"externalDocs":{"type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}}},"channelItem":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"minProperties":1,"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"},"parameters":{"type":"object","additionalProperties":{"$ref":"#/definitions/parameter"}},"description":{"type":"string","description":"A description of the channel."},"publish":{"$ref":"#/definitions/operation"},"subscribe":{"$ref":"#/definitions/operation"},"deprecated":{"type":"boolean","default":false},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"parameter":{"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"schema":{"$ref":"#/definitions/schema"},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)\\\\#(\\\\/(([^\\\\/~])|(~[01]))*)*"},"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"operation":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationTrait"},{"type":"array","items":[{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationTrait"}]},{"type":"object","additionalItems":true}]}]}},"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"bindings":{"$ref":"#/definitions/bindingsObject"},"message":{"$ref":"#/definitions/message"}}},"message":{"oneOf":[{"$ref":"#/definitions/Reference"},{"oneOf":[{"type":"object","required":["oneOf"],"additionalProperties":false,"properties":{"oneOf":{"type":"array","items":{"$ref":"#/definitions/message"}}}},{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"$ref":"#/definitions/schema"},"payload":{},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object"}},"bindings":{"$ref":"#/definitions/bindingsObject"},"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"},{"type":"array","items":[{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"}]},{"type":"object","additionalItems":true}]}]}}}}]}]},"bindingsObject":{"type":"object","additionalProperties":true,"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{},"mqtt5":{},"kafka":{},"nats":{},"jms":{},"sns":{},"sqs":{},"stomp":{},"redis":{}}},"correlationId":{"type":"object","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)\\\\#(\\\\/(([^\\\\/~])|(~[01]))*)*"}}},"specificationExtension":{"description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}}},"operationTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"messageTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/schema"}]},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object"}},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"SecurityScheme":{"oneOf":[{"$ref":"#/definitions/userPassword"},{"$ref":"#/definitions/apiKey"},{"$ref":"#/definitions/X509"},{"$ref":"#/definitions/symmetricEncryption"},{"$ref":"#/definitions/asymmetricEncryption"},{"$ref":"#/definitions/HTTPSecurityScheme"},{"$ref":"#/definitions/oauth2Flows"},{"$ref":"#/definitions/openIdConnect"}]},"userPassword":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"apiKey":{"type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"X509":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"symmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"asymmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"HTTPSecurityScheme":{"oneOf":[{"$ref":"#/definitions/NonBearerHTTPSecurityScheme"},{"$ref":"#/definitions/BearerHTTPSecurityScheme"},{"$ref":"#/definitions/APIKeyHTTPSecurityScheme"}]},"NonBearerHTTPSecurityScheme":{"not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"BearerHTTPSecurityScheme":{"type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"APIKeyHTTPSecurityScheme":{"type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Flows":{"type":"object","required":["type","flows"],"properties":{"type":{"type":"string","enum":["oauth2"]},"description":{"type":"string"},"flows":{"type":"object","properties":{"implicit":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","scopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","tokenUrl","scopes"]}]}},"additionalProperties":false,"minProperties":1}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}}},"oauth2Flow":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"tokenUrl":{"type":"string","format":"uri"},"refreshUrl":{"type":"string","format":"uri"},"scopes":{"$ref":"#/definitions/oauth2Scopes"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Scopes":{"type":"object","additionalProperties":{"type":"string"}},"openIdConnect":{"type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","enum":["openIdConnect"]},"description":{"type":"string"},"openIdConnectUrl":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SecurityRequirement":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true}}}}'); /***/ }), @@ -174,65 +53,49 @@ module.exports = JSON.parse("{\"title\":\"AsyncAPI 2.0.0-rc2 schema.\",\"$schema /***/ ((module) => { "use strict"; -module.exports = JSON.parse("{\"title\":\"AsyncAPI 2.0.0 schema.\",\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"required\":[\"asyncapi\",\"info\",\"channels\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"asyncapi\":{\"type\":\"string\",\"enum\":[\"2.0.0\"],\"description\":\"The AsyncAPI specification version of this document.\"},\"id\":{\"type\":\"string\",\"description\":\"A unique id representing the application.\",\"format\":\"uri\"},\"info\":{\"$ref\":\"#/definitions/info\"},\"servers\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/server\"}},\"defaultContentType\":{\"type\":\"string\"},\"channels\":{\"$ref\":\"#/definitions/channels\"},\"components\":{\"$ref\":\"#/definitions/components\"},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"}},\"definitions\":{\"Reference\":{\"type\":\"object\",\"required\":[\"$ref\"],\"properties\":{\"$ref\":{\"$ref\":\"#/definitions/ReferenceObject\"}}},\"ReferenceObject\":{\"type\":\"string\",\"format\":\"uri-reference\"},\"info\":{\"type\":\"object\",\"description\":\"General information about the API.\",\"required\":[\"version\",\"title\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"title\":{\"type\":\"string\",\"description\":\"A unique and precise title of the API.\"},\"version\":{\"type\":\"string\",\"description\":\"A semantic version number of the API.\"},\"description\":{\"type\":\"string\",\"description\":\"A longer description of the API. Should be different from the title. CommonMark is allowed.\"},\"termsOfService\":{\"type\":\"string\",\"description\":\"A URL to the Terms of Service for the API. MUST be in the format of a URL.\",\"format\":\"uri\"},\"contact\":{\"$ref\":\"#/definitions/contact\"},\"license\":{\"$ref\":\"#/definitions/license\"}}},\"contact\":{\"type\":\"object\",\"description\":\"Contact information for the owners of the API.\",\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\",\"description\":\"The identifying name of the contact person/organization.\"},\"url\":{\"type\":\"string\",\"description\":\"The URL pointing to the contact information.\",\"format\":\"uri\"},\"email\":{\"type\":\"string\",\"description\":\"The email address of the contact person/organization.\",\"format\":\"email\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"license\":{\"type\":\"object\",\"required\":[\"name\"],\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\",\"description\":\"The name of the license type. It's encouraged to use an OSI compatible license.\"},\"url\":{\"type\":\"string\",\"description\":\"The URL pointing to the license.\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"server\":{\"type\":\"object\",\"description\":\"An object representing a Server.\",\"required\":[\"url\",\"protocol\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"url\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"protocol\":{\"type\":\"string\",\"description\":\"The transfer protocol.\"},\"protocolVersion\":{\"type\":\"string\"},\"variables\":{\"$ref\":\"#/definitions/serverVariables\"},\"security\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/SecurityRequirement\"}},\"bindings\":{\"$ref\":\"#/definitions/bindingsObject\"}}},\"serverVariables\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/serverVariable\"}},\"serverVariable\":{\"type\":\"object\",\"description\":\"An object representing a Server Variable for server URL template substitution.\",\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"enum\":{\"type\":\"array\",\"items\":{\"type\":\"string\"},\"uniqueItems\":true},\"default\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"examples\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}}},\"channels\":{\"type\":\"object\",\"propertyNames\":{\"type\":\"string\",\"format\":\"uri-template\",\"minLength\":1},\"additionalProperties\":{\"$ref\":\"#/definitions/channelItem\"}},\"components\":{\"type\":\"object\",\"description\":\"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.\",\"additionalProperties\":false,\"properties\":{\"schemas\":{\"$ref\":\"#/definitions/schemas\"},\"messages\":{\"$ref\":\"#/definitions/messages\"},\"securitySchemes\":{\"type\":\"object\",\"patternProperties\":{\"^[\\\\w\\\\d\\\\.\\\\-_]+$\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/SecurityScheme\"}]}}},\"parameters\":{\"$ref\":\"#/definitions/parameters\"},\"correlationIds\":{\"type\":\"object\",\"patternProperties\":{\"^[\\\\w\\\\d\\\\.\\\\-_]+$\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/correlationId\"}]}}},\"operationTraits\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/operationTrait\"}},\"messageTraits\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/messageTrait\"}},\"serverBindings\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/bindingsObject\"}},\"channelBindings\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/bindingsObject\"}},\"operationBindings\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/bindingsObject\"}},\"messageBindings\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/bindingsObject\"}}}},\"schemas\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/schema\"},\"description\":\"JSON objects describing schemas the API uses.\"},\"messages\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/message\"},\"description\":\"JSON objects describing the messages being consumed and produced by the API.\"},\"parameters\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/parameter\"},\"description\":\"JSON objects describing re-usable channel parameters.\"},\"schema\":{\"allOf\":[{\"$ref\":\"http://json-schema.org/draft-07/schema#\"},{\"type\":\"object\",\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/definitions/schema\"},{\"type\":\"boolean\"}],\"default\":{}},\"items\":{\"anyOf\":[{\"$ref\":\"#/definitions/schema\"},{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/schema\"}}],\"default\":{}},\"allOf\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/schema\"}},\"oneOf\":{\"type\":\"array\",\"minItems\":2,\"items\":{\"$ref\":\"#/definitions/schema\"}},\"anyOf\":{\"type\":\"array\",\"minItems\":2,\"items\":{\"$ref\":\"#/definitions/schema\"}},\"not\":{\"$ref\":\"#/definitions/schema\"},\"properties\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/schema\"},\"default\":{}},\"patternProperties\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/schema\"},\"default\":{}},\"propertyNames\":{\"$ref\":\"#/definitions/schema\"},\"contains\":{\"$ref\":\"#/definitions/schema\"},\"discriminator\":{\"type\":\"string\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false}}}]},\"externalDocs\":{\"type\":\"object\",\"additionalProperties\":false,\"description\":\"information about external documentation\",\"required\":[\"url\"],\"properties\":{\"description\":{\"type\":\"string\"},\"url\":{\"type\":\"string\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"channelItem\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"$ref\":{\"$ref\":\"#/definitions/ReferenceObject\"},\"parameters\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/parameter\"}},\"description\":{\"type\":\"string\",\"description\":\"A description of the channel.\"},\"publish\":{\"$ref\":\"#/definitions/operation\"},\"subscribe\":{\"$ref\":\"#/definitions/operation\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false},\"bindings\":{\"$ref\":\"#/definitions/bindingsObject\"}}},\"parameter\":{\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"description\":{\"type\":\"string\",\"description\":\"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.\"},\"schema\":{\"$ref\":\"#/definitions/schema\"},\"location\":{\"type\":\"string\",\"description\":\"A runtime expression that specifies the location of the parameter value\",\"pattern\":\"^\\\\$message\\\\.(header|payload)\\\\#(\\\\/(([^\\\\/~])|(~[01]))*)*\"},\"$ref\":{\"$ref\":\"#/definitions/ReferenceObject\"}}},\"operation\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"traits\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/operationTrait\"},{\"type\":\"array\",\"items\":[{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/operationTrait\"}]},{\"type\":\"object\",\"additionalItems\":true}]}]}},\"summary\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"operationId\":{\"type\":\"string\"},\"bindings\":{\"$ref\":\"#/definitions/bindingsObject\"},\"message\":{\"$ref\":\"#/definitions/message\"}}},\"message\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"oneOf\":[{\"type\":\"object\",\"required\":[\"oneOf\"],\"additionalProperties\":false,\"properties\":{\"oneOf\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/message\"}}}},{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"schemaFormat\":{\"type\":\"string\"},\"contentType\":{\"type\":\"string\"},\"headers\":{\"allOf\":[{\"$ref\":\"#/definitions/schema\"},{\"properties\":{\"type\":{\"const\":\"object\"}}}]},\"payload\":{},\"correlationId\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/correlationId\"}]},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"summary\":{\"type\":\"string\",\"description\":\"A brief summary of the message.\"},\"name\":{\"type\":\"string\",\"description\":\"Name of the message.\"},\"title\":{\"type\":\"string\",\"description\":\"A human-friendly title for the message.\"},\"description\":{\"type\":\"string\",\"description\":\"A longer description of the message. CommonMark is allowed.\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false},\"examples\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"headers\":{\"type\":\"object\"},\"payload\":{}}}},\"bindings\":{\"$ref\":\"#/definitions/bindingsObject\"},\"traits\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/messageTrait\"},{\"type\":\"array\",\"items\":[{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/messageTrait\"}]},{\"type\":\"object\",\"additionalItems\":true}]}]}}}}]}]},\"bindingsObject\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"http\":{},\"ws\":{},\"amqp\":{},\"amqp1\":{},\"mqtt\":{},\"mqtt5\":{},\"kafka\":{},\"nats\":{},\"jms\":{},\"sns\":{},\"sqs\":{},\"stomp\":{},\"redis\":{}}},\"correlationId\":{\"type\":\"object\",\"required\":[\"location\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"description\":{\"type\":\"string\",\"description\":\"A optional description of the correlation ID. GitHub Flavored Markdown is allowed.\"},\"location\":{\"type\":\"string\",\"description\":\"A runtime expression that specifies the location of the correlation ID\",\"pattern\":\"^\\\\$message\\\\.(header|payload)\\\\#(\\\\/(([^\\\\/~])|(~[01]))*)*\"}}},\"specificationExtension\":{\"description\":\"Any property starting with x- is valid.\",\"additionalProperties\":true,\"additionalItems\":true},\"tag\":{\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"operationTrait\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"summary\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"operationId\":{\"type\":\"string\"},\"bindings\":{\"$ref\":\"#/definitions/bindingsObject\"}}},\"messageTrait\":{\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"schemaFormat\":{\"type\":\"string\"},\"contentType\":{\"type\":\"string\"},\"headers\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/schema\"}]},\"correlationId\":{\"oneOf\":[{\"$ref\":\"#/definitions/Reference\"},{\"$ref\":\"#/definitions/correlationId\"}]},\"tags\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/tag\"},\"uniqueItems\":true},\"summary\":{\"type\":\"string\",\"description\":\"A brief summary of the message.\"},\"name\":{\"type\":\"string\",\"description\":\"Name of the message.\"},\"title\":{\"type\":\"string\",\"description\":\"A human-friendly title for the message.\"},\"description\":{\"type\":\"string\",\"description\":\"A longer description of the message. CommonMark is allowed.\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocs\"},\"deprecated\":{\"type\":\"boolean\",\"default\":false},\"examples\":{\"type\":\"array\",\"items\":{\"type\":\"object\"}},\"bindings\":{\"$ref\":\"#/definitions/bindingsObject\"}}},\"SecurityScheme\":{\"oneOf\":[{\"$ref\":\"#/definitions/userPassword\"},{\"$ref\":\"#/definitions/apiKey\"},{\"$ref\":\"#/definitions/X509\"},{\"$ref\":\"#/definitions/symmetricEncryption\"},{\"$ref\":\"#/definitions/asymmetricEncryption\"},{\"$ref\":\"#/definitions/HTTPSecurityScheme\"},{\"$ref\":\"#/definitions/oauth2Flows\"},{\"$ref\":\"#/definitions/openIdConnect\"}]},\"userPassword\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"userPassword\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"apiKey\":{\"type\":\"object\",\"required\":[\"type\",\"in\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"apiKey\"]},\"in\":{\"type\":\"string\",\"enum\":[\"user\",\"password\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"X509\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"X509\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"symmetricEncryption\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"symmetricEncryption\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"asymmetricEncryption\":{\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"asymmetricEncryption\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"HTTPSecurityScheme\":{\"oneOf\":[{\"$ref\":\"#/definitions/NonBearerHTTPSecurityScheme\"},{\"$ref\":\"#/definitions/BearerHTTPSecurityScheme\"},{\"$ref\":\"#/definitions/APIKeyHTTPSecurityScheme\"}]},\"NonBearerHTTPSecurityScheme\":{\"not\":{\"type\":\"object\",\"properties\":{\"scheme\":{\"type\":\"string\",\"enum\":[\"bearer\"]}}},\"type\":\"object\",\"required\":[\"scheme\",\"type\"],\"properties\":{\"scheme\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"type\":{\"type\":\"string\",\"enum\":[\"http\"]}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"BearerHTTPSecurityScheme\":{\"type\":\"object\",\"required\":[\"type\",\"scheme\"],\"properties\":{\"scheme\":{\"type\":\"string\",\"enum\":[\"bearer\"]},\"bearerFormat\":{\"type\":\"string\"},\"type\":{\"type\":\"string\",\"enum\":[\"http\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"APIKeyHTTPSecurityScheme\":{\"type\":\"object\",\"required\":[\"type\",\"name\",\"in\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"httpApiKey\"]},\"name\":{\"type\":\"string\"},\"in\":{\"type\":\"string\",\"enum\":[\"header\",\"query\",\"cookie\"]},\"description\":{\"type\":\"string\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"oauth2Flows\":{\"type\":\"object\",\"required\":[\"type\",\"flows\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"oauth2\"]},\"description\":{\"type\":\"string\"},\"flows\":{\"type\":\"object\",\"properties\":{\"implicit\":{\"allOf\":[{\"$ref\":\"#/definitions/oauth2Flow\"},{\"required\":[\"authorizationUrl\",\"scopes\"]},{\"not\":{\"required\":[\"tokenUrl\"]}}]},\"password\":{\"allOf\":[{\"$ref\":\"#/definitions/oauth2Flow\"},{\"required\":[\"tokenUrl\",\"scopes\"]},{\"not\":{\"required\":[\"authorizationUrl\"]}}]},\"clientCredentials\":{\"allOf\":[{\"$ref\":\"#/definitions/oauth2Flow\"},{\"required\":[\"tokenUrl\",\"scopes\"]},{\"not\":{\"required\":[\"authorizationUrl\"]}}]},\"authorizationCode\":{\"allOf\":[{\"$ref\":\"#/definitions/oauth2Flow\"},{\"required\":[\"authorizationUrl\",\"tokenUrl\",\"scopes\"]}]}},\"additionalProperties\":false}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"oauth2Flow\":{\"type\":\"object\",\"properties\":{\"authorizationUrl\":{\"type\":\"string\",\"format\":\"uri\"},\"tokenUrl\":{\"type\":\"string\",\"format\":\"uri\"},\"refreshUrl\":{\"type\":\"string\",\"format\":\"uri\"},\"scopes\":{\"$ref\":\"#/definitions/oauth2Scopes\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"oauth2Scopes\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"string\"}},\"openIdConnect\":{\"type\":\"object\",\"required\":[\"type\",\"openIdConnectUrl\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"openIdConnect\"]},\"description\":{\"type\":\"string\"},\"openIdConnectUrl\":{\"type\":\"string\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"additionalProperties\":false},\"SecurityRequirement\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"array\",\"items\":{\"type\":\"string\"},\"uniqueItems\":true}}}}"); +module.exports = JSON.parse('{"title":"AsyncAPI 2.0.0 schema.","$schema":"http://json-schema.org/draft-07/schema#","type":"object","required":["asyncapi","info","channels"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"asyncapi":{"type":"string","enum":["2.0.0"],"description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"#/definitions/info"},"servers":{"type":"object","additionalProperties":{"$ref":"#/definitions/server"}},"defaultContentType":{"type":"string"},"channels":{"$ref":"#/definitions/channels"},"components":{"$ref":"#/definitions/components"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"definitions":{"Reference":{"type":"object","required":["$ref"],"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"ReferenceObject":{"type":"string","format":"uri-reference"},"info":{"type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"#/definitions/contact"},"license":{"$ref":"#/definitions/license"}}},"contact":{"type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}}},"license":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It\'s encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}}},"server":{"type":"object","description":"An object representing a Server.","required":["url","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"protocol":{"type":"string","description":"The transfer protocol."},"protocolVersion":{"type":"string"},"variables":{"$ref":"#/definitions/serverVariables"},"security":{"type":"array","items":{"$ref":"#/definitions/SecurityRequirement"}},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"serverVariables":{"type":"object","additionalProperties":{"$ref":"#/definitions/serverVariable"}},"serverVariable":{"type":"object","description":"An object representing a Server Variable for server URL template substitution.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}}},"channels":{"type":"object","propertyNames":{"type":"string","format":"uri-template","minLength":1},"additionalProperties":{"$ref":"#/definitions/channelItem"}},"components":{"type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemas":{"$ref":"#/definitions/schemas"},"messages":{"$ref":"#/definitions/messages"},"securitySchemes":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/SecurityScheme"}]}}},"parameters":{"$ref":"#/definitions/parameters"},"correlationIds":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]}}},"operationTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/operationTrait"}},"messageTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/messageTrait"}},"serverBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"channelBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"operationBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"messageBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}}}},"schemas":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"description":"JSON objects describing schemas the API uses."},"messages":{"type":"object","additionalProperties":{"$ref":"#/definitions/message"},"description":"JSON objects describing the messages being consumed and produced by the API."},"parameters":{"type":"object","additionalProperties":{"$ref":"#/definitions/parameter"},"description":"JSON objects describing re-usable channel parameters."},"schema":{"allOf":[{"$ref":"http://json-schema.org/draft-07/schema#"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"not":{"$ref":"#/definitions/schema"},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"propertyNames":{"$ref":"#/definitions/schema"},"contains":{"$ref":"#/definitions/schema"},"discriminator":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false}}}]},"externalDocs":{"type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}}},"channelItem":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"},"parameters":{"type":"object","additionalProperties":{"$ref":"#/definitions/parameter"}},"description":{"type":"string","description":"A description of the channel."},"publish":{"$ref":"#/definitions/operation"},"subscribe":{"$ref":"#/definitions/operation"},"deprecated":{"type":"boolean","default":false},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"parameter":{"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"schema":{"$ref":"#/definitions/schema"},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)\\\\#(\\\\/(([^\\\\/~])|(~[01]))*)*"},"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"operation":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationTrait"},{"type":"array","items":[{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationTrait"}]},{"type":"object","additionalItems":true}]}]}},"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"bindings":{"$ref":"#/definitions/bindingsObject"},"message":{"$ref":"#/definitions/message"}}},"message":{"oneOf":[{"$ref":"#/definitions/Reference"},{"oneOf":[{"type":"object","required":["oneOf"],"additionalProperties":false,"properties":{"oneOf":{"type":"array","items":{"$ref":"#/definitions/message"}}}},{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"#/definitions/schema"},{"properties":{"type":{"const":"object"}}}]},"payload":{},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"headers":{"type":"object"},"payload":{}}}},"bindings":{"$ref":"#/definitions/bindingsObject"},"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"},{"type":"array","items":[{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"}]},{"type":"object","additionalItems":true}]}]}}}}]}]},"bindingsObject":{"type":"object","additionalProperties":true,"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{},"mqtt5":{},"kafka":{},"nats":{},"jms":{},"sns":{},"sqs":{},"stomp":{},"redis":{}}},"correlationId":{"type":"object","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)\\\\#(\\\\/(([^\\\\/~])|(~[01]))*)*"}}},"specificationExtension":{"description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}}},"operationTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"messageTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/schema"}]},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object"}},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"SecurityScheme":{"oneOf":[{"$ref":"#/definitions/userPassword"},{"$ref":"#/definitions/apiKey"},{"$ref":"#/definitions/X509"},{"$ref":"#/definitions/symmetricEncryption"},{"$ref":"#/definitions/asymmetricEncryption"},{"$ref":"#/definitions/HTTPSecurityScheme"},{"$ref":"#/definitions/oauth2Flows"},{"$ref":"#/definitions/openIdConnect"}]},"userPassword":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"apiKey":{"type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"X509":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"symmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"asymmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"HTTPSecurityScheme":{"oneOf":[{"$ref":"#/definitions/NonBearerHTTPSecurityScheme"},{"$ref":"#/definitions/BearerHTTPSecurityScheme"},{"$ref":"#/definitions/APIKeyHTTPSecurityScheme"}]},"NonBearerHTTPSecurityScheme":{"not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"BearerHTTPSecurityScheme":{"type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"APIKeyHTTPSecurityScheme":{"type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Flows":{"type":"object","required":["type","flows"],"properties":{"type":{"type":"string","enum":["oauth2"]},"description":{"type":"string"},"flows":{"type":"object","properties":{"implicit":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","scopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","tokenUrl","scopes"]}]}},"additionalProperties":false}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}}},"oauth2Flow":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"tokenUrl":{"type":"string","format":"uri"},"refreshUrl":{"type":"string","format":"uri"},"scopes":{"$ref":"#/definitions/oauth2Scopes"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Scopes":{"type":"object","additionalProperties":{"type":"string"}},"openIdConnect":{"type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","enum":["openIdConnect"]},"description":{"type":"string"},"openIdConnectUrl":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\-\\\\_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SecurityRequirement":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true}}}}'); /***/ }), -/***/ 94822: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { +/***/ 74884: +/***/ ((module) => { -const core = __webpack_require__(42186); -const Generator = __webpack_require__(56814); -const path = __webpack_require__(85622); -const fs = __webpack_require__(35747); -const { paramParser, createOutputDir } = __webpack_require__(50918); +function webpackEmptyAsyncContext(req) { + // Here Promise.resolve().then() is used instead of new Promise() to prevent + // uncaught exception popping up in devtools + return Promise.resolve().then(() => { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; + }); +} +webpackEmptyAsyncContext.keys = () => ([]); +webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext; +webpackEmptyAsyncContext.id = 74884; +module.exports = webpackEmptyAsyncContext; -const DEFAULT_TEMPLATE = '@asyncapi/markdown-template@0.10.0'; -const DEFAULT_FILEPATH = 'asyncapi.yml'; -const DEFAULT_OUTPUT = 'output'; +/***/ }), -async function run() { - try { - const template = core.getInput('template') || DEFAULT_TEMPLATE; - const filepath = core.getInput('filepath') || DEFAULT_FILEPATH; - const parameters = paramParser(core.getInput('parameters')); - const output = core.getInput('output') || DEFAULT_OUTPUT; - const workdir = process.env.GITHUB_WORKSPACE || __dirname; - const absoluteOutputPath = path.resolve(workdir, output); - const pathToAsyncapiFile = path.resolve(workdir, filepath); +/***/ 64118: +/***/ ((module) => { - //Below additional log information is visible only if you add ACTIONS_STEP_DEBUG secret to your repository where you run your action. - //The value of this secret must be "true" - core.debug(`Template: ${template}`); - core.debug(`Filepath: ${filepath}`); - core.debug(`Parameters: ${JSON.stringify(parameters)}`); - core.debug(`Output: ${output}`); - core.debug(`Workdir: ${workdir}`); - core.debug(`Workdir contents: ${fs.readdirSync(workdir)}`); - core.debug(`AbsoluteOutputPath: ${absoluteOutputPath}`); - core.debug(`PathToAsyncapiFile: ${pathToAsyncapiFile}`); +"use strict"; +module.exports = JSON.parse('{"_args":[["@babel/core@7.12.3","/Users/wookiee/sources/github-action-for-generator"]],"_development":true,"_from":"@babel/core@7.12.3","_id":"@babel/core@7.12.3","_inBundle":false,"_integrity":"sha512-0qXcZYKZp3/6N2jKYVxZv0aNCsxTSVCiK72DTiTYZAu7sjg73W0/aynWjMbiGd87EQL4WyA8reiJVh92AVla9g==","_location":"/@babel/core","_phantomChildren":{"chalk":"2.4.2","js-tokens":"4.0.0"},"_requested":{"type":"version","registry":true,"raw":"@babel/core@7.12.3","name":"@babel/core","escapedName":"@babel%2fcore","scope":"@babel","rawSpec":"7.12.3","saveSpec":null,"fetchSpec":"7.12.3"},"_requiredBy":["/@jest/transform","/istanbul-lib-instrument","/jest-config"],"_resolved":"https://registry.npmjs.org/@babel/core/-/core-7.12.3.tgz","_spec":"7.12.3","_where":"/Users/wookiee/sources/github-action-for-generator","author":{"name":"Sebastian McKenzie","email":"sebmck@gmail.com"},"browser":{"./lib/config/files/index.js":"./lib/config/files/index-browser.js","./lib/transform-file.js":"./lib/transform-file-browser.js","./src/config/files/index.js":"./src/config/files/index-browser.js","./src/transform-file.js":"./src/transform-file-browser.js"},"bugs":{"url":"https://github.com/babel/babel/issues"},"dependencies":{"@babel/code-frame":"^7.10.4","@babel/generator":"^7.12.1","@babel/helper-module-transforms":"^7.12.1","@babel/helpers":"^7.12.1","@babel/parser":"^7.12.3","@babel/template":"^7.10.4","@babel/traverse":"^7.12.1","@babel/types":"^7.12.1","convert-source-map":"^1.7.0","debug":"^4.1.0","gensync":"^1.0.0-beta.1","json5":"^2.1.2","lodash":"^4.17.19","resolve":"^1.3.2","semver":"^5.4.1","source-map":"^0.5.0"},"description":"Babel compiler core.","devDependencies":{"@babel/helper-transform-fixture-test-runner":"^7.12.1"},"engines":{"node":">=6.9.0"},"funding":{"type":"opencollective","url":"https://opencollective.com/babel"},"homepage":"https://babeljs.io/","keywords":["6to5","babel","classes","const","es6","harmony","let","modules","transpile","transpiler","var","babel-core","compiler"],"license":"MIT","main":"lib/index.js","name":"@babel/core","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/babel/babel.git","directory":"packages/babel-core"},"version":"7.12.3"}'); - createOutputDir(absoluteOutputPath); +/***/ }), - const generator = new Generator(template, absoluteOutputPath, { - templateParams: parameters, - forceWrite: true - }); - await generator.generateFromFile(pathToAsyncapiFile); - } catch (e) { - core.setFailed(e.message); - } -} - -run(); +/***/ 20150: +/***/ ((module) => { +"use strict"; +module.exports = JSON.parse('{"builtin":{"Array":false,"ArrayBuffer":false,"Atomics":false,"BigInt":false,"BigInt64Array":false,"BigUint64Array":false,"Boolean":false,"constructor":false,"DataView":false,"Date":false,"decodeURI":false,"decodeURIComponent":false,"encodeURI":false,"encodeURIComponent":false,"Error":false,"escape":false,"eval":false,"EvalError":false,"Float32Array":false,"Float64Array":false,"Function":false,"globalThis":false,"hasOwnProperty":false,"Infinity":false,"Int16Array":false,"Int32Array":false,"Int8Array":false,"isFinite":false,"isNaN":false,"isPrototypeOf":false,"JSON":false,"Map":false,"Math":false,"NaN":false,"Number":false,"Object":false,"parseFloat":false,"parseInt":false,"Promise":false,"propertyIsEnumerable":false,"Proxy":false,"RangeError":false,"ReferenceError":false,"Reflect":false,"RegExp":false,"Set":false,"SharedArrayBuffer":false,"String":false,"Symbol":false,"SyntaxError":false,"toLocaleString":false,"toString":false,"TypeError":false,"Uint16Array":false,"Uint32Array":false,"Uint8Array":false,"Uint8ClampedArray":false,"undefined":false,"unescape":false,"URIError":false,"valueOf":false,"WeakMap":false,"WeakSet":false},"es5":{"Array":false,"Boolean":false,"constructor":false,"Date":false,"decodeURI":false,"decodeURIComponent":false,"encodeURI":false,"encodeURIComponent":false,"Error":false,"escape":false,"eval":false,"EvalError":false,"Function":false,"hasOwnProperty":false,"Infinity":false,"isFinite":false,"isNaN":false,"isPrototypeOf":false,"JSON":false,"Math":false,"NaN":false,"Number":false,"Object":false,"parseFloat":false,"parseInt":false,"propertyIsEnumerable":false,"RangeError":false,"ReferenceError":false,"RegExp":false,"String":false,"SyntaxError":false,"toLocaleString":false,"toString":false,"TypeError":false,"undefined":false,"unescape":false,"URIError":false,"valueOf":false},"es2015":{"Array":false,"ArrayBuffer":false,"Boolean":false,"constructor":false,"DataView":false,"Date":false,"decodeURI":false,"decodeURIComponent":false,"encodeURI":false,"encodeURIComponent":false,"Error":false,"escape":false,"eval":false,"EvalError":false,"Float32Array":false,"Float64Array":false,"Function":false,"hasOwnProperty":false,"Infinity":false,"Int16Array":false,"Int32Array":false,"Int8Array":false,"isFinite":false,"isNaN":false,"isPrototypeOf":false,"JSON":false,"Map":false,"Math":false,"NaN":false,"Number":false,"Object":false,"parseFloat":false,"parseInt":false,"Promise":false,"propertyIsEnumerable":false,"Proxy":false,"RangeError":false,"ReferenceError":false,"Reflect":false,"RegExp":false,"Set":false,"String":false,"Symbol":false,"SyntaxError":false,"toLocaleString":false,"toString":false,"TypeError":false,"Uint16Array":false,"Uint32Array":false,"Uint8Array":false,"Uint8ClampedArray":false,"undefined":false,"unescape":false,"URIError":false,"valueOf":false,"WeakMap":false,"WeakSet":false},"es2017":{"Array":false,"ArrayBuffer":false,"Atomics":false,"Boolean":false,"constructor":false,"DataView":false,"Date":false,"decodeURI":false,"decodeURIComponent":false,"encodeURI":false,"encodeURIComponent":false,"Error":false,"escape":false,"eval":false,"EvalError":false,"Float32Array":false,"Float64Array":false,"Function":false,"hasOwnProperty":false,"Infinity":false,"Int16Array":false,"Int32Array":false,"Int8Array":false,"isFinite":false,"isNaN":false,"isPrototypeOf":false,"JSON":false,"Map":false,"Math":false,"NaN":false,"Number":false,"Object":false,"parseFloat":false,"parseInt":false,"Promise":false,"propertyIsEnumerable":false,"Proxy":false,"RangeError":false,"ReferenceError":false,"Reflect":false,"RegExp":false,"Set":false,"SharedArrayBuffer":false,"String":false,"Symbol":false,"SyntaxError":false,"toLocaleString":false,"toString":false,"TypeError":false,"Uint16Array":false,"Uint32Array":false,"Uint8Array":false,"Uint8ClampedArray":false,"undefined":false,"unescape":false,"URIError":false,"valueOf":false,"WeakMap":false,"WeakSet":false},"browser":{"AbortController":false,"AbortSignal":false,"addEventListener":false,"alert":false,"AnalyserNode":false,"Animation":false,"AnimationEffectReadOnly":false,"AnimationEffectTiming":false,"AnimationEffectTimingReadOnly":false,"AnimationEvent":false,"AnimationPlaybackEvent":false,"AnimationTimeline":false,"applicationCache":false,"ApplicationCache":false,"ApplicationCacheErrorEvent":false,"atob":false,"Attr":false,"Audio":false,"AudioBuffer":false,"AudioBufferSourceNode":false,"AudioContext":false,"AudioDestinationNode":false,"AudioListener":false,"AudioNode":false,"AudioParam":false,"AudioProcessingEvent":false,"AudioScheduledSourceNode":false,"AudioWorkletGlobalScope ":false,"AudioWorkletNode":false,"AudioWorkletProcessor":false,"BarProp":false,"BaseAudioContext":false,"BatteryManager":false,"BeforeUnloadEvent":false,"BiquadFilterNode":false,"Blob":false,"BlobEvent":false,"blur":false,"BroadcastChannel":false,"btoa":false,"BudgetService":false,"ByteLengthQueuingStrategy":false,"Cache":false,"caches":false,"CacheStorage":false,"cancelAnimationFrame":false,"cancelIdleCallback":false,"CanvasCaptureMediaStreamTrack":false,"CanvasGradient":false,"CanvasPattern":false,"CanvasRenderingContext2D":false,"ChannelMergerNode":false,"ChannelSplitterNode":false,"CharacterData":false,"clearInterval":false,"clearTimeout":false,"clientInformation":false,"ClipboardEvent":false,"close":false,"closed":false,"CloseEvent":false,"Comment":false,"CompositionEvent":false,"confirm":false,"console":false,"ConstantSourceNode":false,"ConvolverNode":false,"CountQueuingStrategy":false,"createImageBitmap":false,"Credential":false,"CredentialsContainer":false,"crypto":false,"Crypto":false,"CryptoKey":false,"CSS":false,"CSSConditionRule":false,"CSSFontFaceRule":false,"CSSGroupingRule":false,"CSSImportRule":false,"CSSKeyframeRule":false,"CSSKeyframesRule":false,"CSSMediaRule":false,"CSSNamespaceRule":false,"CSSPageRule":false,"CSSRule":false,"CSSRuleList":false,"CSSStyleDeclaration":false,"CSSStyleRule":false,"CSSStyleSheet":false,"CSSSupportsRule":false,"CustomElementRegistry":false,"customElements":false,"CustomEvent":false,"DataTransfer":false,"DataTransferItem":false,"DataTransferItemList":false,"defaultstatus":false,"defaultStatus":false,"DelayNode":false,"DeviceMotionEvent":false,"DeviceOrientationEvent":false,"devicePixelRatio":false,"dispatchEvent":false,"document":false,"Document":false,"DocumentFragment":false,"DocumentType":false,"DOMError":false,"DOMException":false,"DOMImplementation":false,"DOMMatrix":false,"DOMMatrixReadOnly":false,"DOMParser":false,"DOMPoint":false,"DOMPointReadOnly":false,"DOMQuad":false,"DOMRect":false,"DOMRectReadOnly":false,"DOMStringList":false,"DOMStringMap":false,"DOMTokenList":false,"DragEvent":false,"DynamicsCompressorNode":false,"Element":false,"ErrorEvent":false,"event":false,"Event":false,"EventSource":false,"EventTarget":false,"external":false,"fetch":false,"File":false,"FileList":false,"FileReader":false,"find":false,"focus":false,"FocusEvent":false,"FontFace":false,"FontFaceSetLoadEvent":false,"FormData":false,"frameElement":false,"frames":false,"GainNode":false,"Gamepad":false,"GamepadButton":false,"GamepadEvent":false,"getComputedStyle":false,"getSelection":false,"HashChangeEvent":false,"Headers":false,"history":false,"History":false,"HTMLAllCollection":false,"HTMLAnchorElement":false,"HTMLAreaElement":false,"HTMLAudioElement":false,"HTMLBaseElement":false,"HTMLBodyElement":false,"HTMLBRElement":false,"HTMLButtonElement":false,"HTMLCanvasElement":false,"HTMLCollection":false,"HTMLContentElement":false,"HTMLDataElement":false,"HTMLDataListElement":false,"HTMLDetailsElement":false,"HTMLDialogElement":false,"HTMLDirectoryElement":false,"HTMLDivElement":false,"HTMLDListElement":false,"HTMLDocument":false,"HTMLElement":false,"HTMLEmbedElement":false,"HTMLFieldSetElement":false,"HTMLFontElement":false,"HTMLFormControlsCollection":false,"HTMLFormElement":false,"HTMLFrameElement":false,"HTMLFrameSetElement":false,"HTMLHeadElement":false,"HTMLHeadingElement":false,"HTMLHRElement":false,"HTMLHtmlElement":false,"HTMLIFrameElement":false,"HTMLImageElement":false,"HTMLInputElement":false,"HTMLLabelElement":false,"HTMLLegendElement":false,"HTMLLIElement":false,"HTMLLinkElement":false,"HTMLMapElement":false,"HTMLMarqueeElement":false,"HTMLMediaElement":false,"HTMLMenuElement":false,"HTMLMetaElement":false,"HTMLMeterElement":false,"HTMLModElement":false,"HTMLObjectElement":false,"HTMLOListElement":false,"HTMLOptGroupElement":false,"HTMLOptionElement":false,"HTMLOptionsCollection":false,"HTMLOutputElement":false,"HTMLParagraphElement":false,"HTMLParamElement":false,"HTMLPictureElement":false,"HTMLPreElement":false,"HTMLProgressElement":false,"HTMLQuoteElement":false,"HTMLScriptElement":false,"HTMLSelectElement":false,"HTMLShadowElement":false,"HTMLSlotElement":false,"HTMLSourceElement":false,"HTMLSpanElement":false,"HTMLStyleElement":false,"HTMLTableCaptionElement":false,"HTMLTableCellElement":false,"HTMLTableColElement":false,"HTMLTableElement":false,"HTMLTableRowElement":false,"HTMLTableSectionElement":false,"HTMLTemplateElement":false,"HTMLTextAreaElement":false,"HTMLTimeElement":false,"HTMLTitleElement":false,"HTMLTrackElement":false,"HTMLUListElement":false,"HTMLUnknownElement":false,"HTMLVideoElement":false,"IDBCursor":false,"IDBCursorWithValue":false,"IDBDatabase":false,"IDBFactory":false,"IDBIndex":false,"IDBKeyRange":false,"IDBObjectStore":false,"IDBOpenDBRequest":false,"IDBRequest":false,"IDBTransaction":false,"IDBVersionChangeEvent":false,"IdleDeadline":false,"IIRFilterNode":false,"Image":false,"ImageBitmap":false,"ImageBitmapRenderingContext":false,"ImageCapture":false,"ImageData":false,"indexedDB":false,"innerHeight":false,"innerWidth":false,"InputEvent":false,"IntersectionObserver":false,"IntersectionObserverEntry":false,"Intl":false,"isSecureContext":false,"KeyboardEvent":false,"KeyframeEffect":false,"KeyframeEffectReadOnly":false,"length":false,"localStorage":false,"location":true,"Location":false,"locationbar":false,"matchMedia":false,"MediaDeviceInfo":false,"MediaDevices":false,"MediaElementAudioSourceNode":false,"MediaEncryptedEvent":false,"MediaError":false,"MediaKeyMessageEvent":false,"MediaKeySession":false,"MediaKeyStatusMap":false,"MediaKeySystemAccess":false,"MediaList":false,"MediaQueryList":false,"MediaQueryListEvent":false,"MediaRecorder":false,"MediaSettingsRange":false,"MediaSource":false,"MediaStream":false,"MediaStreamAudioDestinationNode":false,"MediaStreamAudioSourceNode":false,"MediaStreamEvent":false,"MediaStreamTrack":false,"MediaStreamTrackEvent":false,"menubar":false,"MessageChannel":false,"MessageEvent":false,"MessagePort":false,"MIDIAccess":false,"MIDIConnectionEvent":false,"MIDIInput":false,"MIDIInputMap":false,"MIDIMessageEvent":false,"MIDIOutput":false,"MIDIOutputMap":false,"MIDIPort":false,"MimeType":false,"MimeTypeArray":false,"MouseEvent":false,"moveBy":false,"moveTo":false,"MutationEvent":false,"MutationObserver":false,"MutationRecord":false,"name":false,"NamedNodeMap":false,"NavigationPreloadManager":false,"navigator":false,"Navigator":false,"NetworkInformation":false,"Node":false,"NodeFilter":false,"NodeIterator":false,"NodeList":false,"Notification":false,"OfflineAudioCompletionEvent":false,"OfflineAudioContext":false,"offscreenBuffering":false,"OffscreenCanvas":true,"onabort":true,"onafterprint":true,"onanimationend":true,"onanimationiteration":true,"onanimationstart":true,"onappinstalled":true,"onauxclick":true,"onbeforeinstallprompt":true,"onbeforeprint":true,"onbeforeunload":true,"onblur":true,"oncancel":true,"oncanplay":true,"oncanplaythrough":true,"onchange":true,"onclick":true,"onclose":true,"oncontextmenu":true,"oncuechange":true,"ondblclick":true,"ondevicemotion":true,"ondeviceorientation":true,"ondeviceorientationabsolute":true,"ondrag":true,"ondragend":true,"ondragenter":true,"ondragleave":true,"ondragover":true,"ondragstart":true,"ondrop":true,"ondurationchange":true,"onemptied":true,"onended":true,"onerror":true,"onfocus":true,"ongotpointercapture":true,"onhashchange":true,"oninput":true,"oninvalid":true,"onkeydown":true,"onkeypress":true,"onkeyup":true,"onlanguagechange":true,"onload":true,"onloadeddata":true,"onloadedmetadata":true,"onloadstart":true,"onlostpointercapture":true,"onmessage":true,"onmessageerror":true,"onmousedown":true,"onmouseenter":true,"onmouseleave":true,"onmousemove":true,"onmouseout":true,"onmouseover":true,"onmouseup":true,"onmousewheel":true,"onoffline":true,"ononline":true,"onpagehide":true,"onpageshow":true,"onpause":true,"onplay":true,"onplaying":true,"onpointercancel":true,"onpointerdown":true,"onpointerenter":true,"onpointerleave":true,"onpointermove":true,"onpointerout":true,"onpointerover":true,"onpointerup":true,"onpopstate":true,"onprogress":true,"onratechange":true,"onrejectionhandled":true,"onreset":true,"onresize":true,"onscroll":true,"onsearch":true,"onseeked":true,"onseeking":true,"onselect":true,"onstalled":true,"onstorage":true,"onsubmit":true,"onsuspend":true,"ontimeupdate":true,"ontoggle":true,"ontransitionend":true,"onunhandledrejection":true,"onunload":true,"onvolumechange":true,"onwaiting":true,"onwheel":true,"open":false,"openDatabase":false,"opener":false,"Option":false,"origin":false,"OscillatorNode":false,"outerHeight":false,"outerWidth":false,"PageTransitionEvent":false,"pageXOffset":false,"pageYOffset":false,"PannerNode":false,"parent":false,"Path2D":false,"PaymentAddress":false,"PaymentRequest":false,"PaymentRequestUpdateEvent":false,"PaymentResponse":false,"performance":false,"Performance":false,"PerformanceEntry":false,"PerformanceLongTaskTiming":false,"PerformanceMark":false,"PerformanceMeasure":false,"PerformanceNavigation":false,"PerformanceNavigationTiming":false,"PerformanceObserver":false,"PerformanceObserverEntryList":false,"PerformancePaintTiming":false,"PerformanceResourceTiming":false,"PerformanceTiming":false,"PeriodicWave":false,"Permissions":false,"PermissionStatus":false,"personalbar":false,"PhotoCapabilities":false,"Plugin":false,"PluginArray":false,"PointerEvent":false,"PopStateEvent":false,"postMessage":false,"Presentation":false,"PresentationAvailability":false,"PresentationConnection":false,"PresentationConnectionAvailableEvent":false,"PresentationConnectionCloseEvent":false,"PresentationConnectionList":false,"PresentationReceiver":false,"PresentationRequest":false,"print":false,"ProcessingInstruction":false,"ProgressEvent":false,"PromiseRejectionEvent":false,"prompt":false,"PushManager":false,"PushSubscription":false,"PushSubscriptionOptions":false,"queueMicrotask":false,"RadioNodeList":false,"Range":false,"ReadableStream":false,"registerProcessor":false,"RemotePlayback":false,"removeEventListener":false,"Request":false,"requestAnimationFrame":false,"requestIdleCallback":false,"resizeBy":false,"ResizeObserver":false,"ResizeObserverEntry":false,"resizeTo":false,"Response":false,"RTCCertificate":false,"RTCDataChannel":false,"RTCDataChannelEvent":false,"RTCDtlsTransport":false,"RTCIceCandidate":false,"RTCIceGatherer":false,"RTCIceTransport":false,"RTCPeerConnection":false,"RTCPeerConnectionIceEvent":false,"RTCRtpContributingSource":false,"RTCRtpReceiver":false,"RTCRtpSender":false,"RTCSctpTransport":false,"RTCSessionDescription":false,"RTCStatsReport":false,"RTCTrackEvent":false,"screen":false,"Screen":false,"screenLeft":false,"ScreenOrientation":false,"screenTop":false,"screenX":false,"screenY":false,"ScriptProcessorNode":false,"scroll":false,"scrollbars":false,"scrollBy":false,"scrollTo":false,"scrollX":false,"scrollY":false,"SecurityPolicyViolationEvent":false,"Selection":false,"self":false,"ServiceWorker":false,"ServiceWorkerContainer":false,"ServiceWorkerRegistration":false,"sessionStorage":false,"setInterval":false,"setTimeout":false,"ShadowRoot":false,"SharedWorker":false,"SourceBuffer":false,"SourceBufferList":false,"speechSynthesis":false,"SpeechSynthesisEvent":false,"SpeechSynthesisUtterance":false,"StaticRange":false,"status":false,"statusbar":false,"StereoPannerNode":false,"stop":false,"Storage":false,"StorageEvent":false,"StorageManager":false,"styleMedia":false,"StyleSheet":false,"StyleSheetList":false,"SubtleCrypto":false,"SVGAElement":false,"SVGAngle":false,"SVGAnimatedAngle":false,"SVGAnimatedBoolean":false,"SVGAnimatedEnumeration":false,"SVGAnimatedInteger":false,"SVGAnimatedLength":false,"SVGAnimatedLengthList":false,"SVGAnimatedNumber":false,"SVGAnimatedNumberList":false,"SVGAnimatedPreserveAspectRatio":false,"SVGAnimatedRect":false,"SVGAnimatedString":false,"SVGAnimatedTransformList":false,"SVGAnimateElement":false,"SVGAnimateMotionElement":false,"SVGAnimateTransformElement":false,"SVGAnimationElement":false,"SVGCircleElement":false,"SVGClipPathElement":false,"SVGComponentTransferFunctionElement":false,"SVGDefsElement":false,"SVGDescElement":false,"SVGDiscardElement":false,"SVGElement":false,"SVGEllipseElement":false,"SVGFEBlendElement":false,"SVGFEColorMatrixElement":false,"SVGFEComponentTransferElement":false,"SVGFECompositeElement":false,"SVGFEConvolveMatrixElement":false,"SVGFEDiffuseLightingElement":false,"SVGFEDisplacementMapElement":false,"SVGFEDistantLightElement":false,"SVGFEDropShadowElement":false,"SVGFEFloodElement":false,"SVGFEFuncAElement":false,"SVGFEFuncBElement":false,"SVGFEFuncGElement":false,"SVGFEFuncRElement":false,"SVGFEGaussianBlurElement":false,"SVGFEImageElement":false,"SVGFEMergeElement":false,"SVGFEMergeNodeElement":false,"SVGFEMorphologyElement":false,"SVGFEOffsetElement":false,"SVGFEPointLightElement":false,"SVGFESpecularLightingElement":false,"SVGFESpotLightElement":false,"SVGFETileElement":false,"SVGFETurbulenceElement":false,"SVGFilterElement":false,"SVGForeignObjectElement":false,"SVGGElement":false,"SVGGeometryElement":false,"SVGGradientElement":false,"SVGGraphicsElement":false,"SVGImageElement":false,"SVGLength":false,"SVGLengthList":false,"SVGLinearGradientElement":false,"SVGLineElement":false,"SVGMarkerElement":false,"SVGMaskElement":false,"SVGMatrix":false,"SVGMetadataElement":false,"SVGMPathElement":false,"SVGNumber":false,"SVGNumberList":false,"SVGPathElement":false,"SVGPatternElement":false,"SVGPoint":false,"SVGPointList":false,"SVGPolygonElement":false,"SVGPolylineElement":false,"SVGPreserveAspectRatio":false,"SVGRadialGradientElement":false,"SVGRect":false,"SVGRectElement":false,"SVGScriptElement":false,"SVGSetElement":false,"SVGStopElement":false,"SVGStringList":false,"SVGStyleElement":false,"SVGSVGElement":false,"SVGSwitchElement":false,"SVGSymbolElement":false,"SVGTextContentElement":false,"SVGTextElement":false,"SVGTextPathElement":false,"SVGTextPositioningElement":false,"SVGTitleElement":false,"SVGTransform":false,"SVGTransformList":false,"SVGTSpanElement":false,"SVGUnitTypes":false,"SVGUseElement":false,"SVGViewElement":false,"TaskAttributionTiming":false,"Text":false,"TextDecoder":false,"TextEncoder":false,"TextEvent":false,"TextMetrics":false,"TextTrack":false,"TextTrackCue":false,"TextTrackCueList":false,"TextTrackList":false,"TimeRanges":false,"toolbar":false,"top":false,"Touch":false,"TouchEvent":false,"TouchList":false,"TrackEvent":false,"TransitionEvent":false,"TreeWalker":false,"UIEvent":false,"URL":false,"URLSearchParams":false,"ValidityState":false,"visualViewport":false,"VisualViewport":false,"VTTCue":false,"WaveShaperNode":false,"WebAssembly":false,"WebGL2RenderingContext":false,"WebGLActiveInfo":false,"WebGLBuffer":false,"WebGLContextEvent":false,"WebGLFramebuffer":false,"WebGLProgram":false,"WebGLQuery":false,"WebGLRenderbuffer":false,"WebGLRenderingContext":false,"WebGLSampler":false,"WebGLShader":false,"WebGLShaderPrecisionFormat":false,"WebGLSync":false,"WebGLTexture":false,"WebGLTransformFeedback":false,"WebGLUniformLocation":false,"WebGLVertexArrayObject":false,"WebSocket":false,"WheelEvent":false,"window":false,"Window":false,"Worker":false,"WritableStream":false,"XMLDocument":false,"XMLHttpRequest":false,"XMLHttpRequestEventTarget":false,"XMLHttpRequestUpload":false,"XMLSerializer":false,"XPathEvaluator":false,"XPathExpression":false,"XPathResult":false,"XSLTProcessor":false},"worker":{"addEventListener":false,"applicationCache":false,"atob":false,"Blob":false,"BroadcastChannel":false,"btoa":false,"Cache":false,"caches":false,"clearInterval":false,"clearTimeout":false,"close":true,"console":false,"fetch":false,"FileReaderSync":false,"FormData":false,"Headers":false,"IDBCursor":false,"IDBCursorWithValue":false,"IDBDatabase":false,"IDBFactory":false,"IDBIndex":false,"IDBKeyRange":false,"IDBObjectStore":false,"IDBOpenDBRequest":false,"IDBRequest":false,"IDBTransaction":false,"IDBVersionChangeEvent":false,"ImageData":false,"importScripts":true,"indexedDB":false,"location":false,"MessageChannel":false,"MessagePort":false,"name":false,"navigator":false,"Notification":false,"onclose":true,"onconnect":true,"onerror":true,"onlanguagechange":true,"onmessage":true,"onoffline":true,"ononline":true,"onrejectionhandled":true,"onunhandledrejection":true,"performance":false,"Performance":false,"PerformanceEntry":false,"PerformanceMark":false,"PerformanceMeasure":false,"PerformanceNavigation":false,"PerformanceResourceTiming":false,"PerformanceTiming":false,"postMessage":true,"Promise":false,"queueMicrotask":false,"removeEventListener":false,"Request":false,"Response":false,"self":true,"ServiceWorkerRegistration":false,"setInterval":false,"setTimeout":false,"TextDecoder":false,"TextEncoder":false,"URL":false,"URLSearchParams":false,"WebSocket":false,"Worker":false,"WorkerGlobalScope":false,"XMLHttpRequest":false},"node":{"__dirname":false,"__filename":false,"Buffer":false,"clearImmediate":false,"clearInterval":false,"clearTimeout":false,"console":false,"exports":true,"global":false,"Intl":false,"module":false,"process":false,"queueMicrotask":false,"require":false,"setImmediate":false,"setInterval":false,"setTimeout":false,"TextDecoder":false,"TextEncoder":false,"URL":false,"URLSearchParams":false},"commonjs":{"exports":true,"global":false,"module":false,"require":false},"amd":{"define":false,"require":false},"mocha":{"after":false,"afterEach":false,"before":false,"beforeEach":false,"context":false,"describe":false,"it":false,"mocha":false,"run":false,"setup":false,"specify":false,"suite":false,"suiteSetup":false,"suiteTeardown":false,"teardown":false,"test":false,"xcontext":false,"xdescribe":false,"xit":false,"xspecify":false},"jasmine":{"afterAll":false,"afterEach":false,"beforeAll":false,"beforeEach":false,"describe":false,"expect":false,"fail":false,"fdescribe":false,"fit":false,"it":false,"jasmine":false,"pending":false,"runs":false,"spyOn":false,"spyOnProperty":false,"waits":false,"waitsFor":false,"xdescribe":false,"xit":false},"jest":{"afterAll":false,"afterEach":false,"beforeAll":false,"beforeEach":false,"describe":false,"expect":false,"fdescribe":false,"fit":false,"it":false,"jest":false,"pit":false,"require":false,"test":false,"xdescribe":false,"xit":false,"xtest":false},"qunit":{"asyncTest":false,"deepEqual":false,"equal":false,"expect":false,"module":false,"notDeepEqual":false,"notEqual":false,"notOk":false,"notPropEqual":false,"notStrictEqual":false,"ok":false,"propEqual":false,"QUnit":false,"raises":false,"start":false,"stop":false,"strictEqual":false,"test":false,"throws":false},"phantomjs":{"console":true,"exports":true,"phantom":true,"require":true,"WebPage":true},"couch":{"emit":false,"exports":false,"getRow":false,"log":false,"module":false,"provides":false,"require":false,"respond":false,"send":false,"start":false,"sum":false},"rhino":{"defineClass":false,"deserialize":false,"gc":false,"help":false,"importClass":false,"importPackage":false,"java":false,"load":false,"loadClass":false,"Packages":false,"print":false,"quit":false,"readFile":false,"readUrl":false,"runCommand":false,"seal":false,"serialize":false,"spawn":false,"sync":false,"toint32":false,"version":false},"nashorn":{"__DIR__":false,"__FILE__":false,"__LINE__":false,"com":false,"edu":false,"exit":false,"java":false,"Java":false,"javafx":false,"JavaImporter":false,"javax":false,"JSAdapter":false,"load":false,"loadWithNewGlobal":false,"org":false,"Packages":false,"print":false,"quit":false},"wsh":{"ActiveXObject":true,"Enumerator":true,"GetObject":true,"ScriptEngine":true,"ScriptEngineBuildVersion":true,"ScriptEngineMajorVersion":true,"ScriptEngineMinorVersion":true,"VBArray":true,"WScript":true,"WSH":true,"XDomainRequest":true},"jquery":{"$":false,"jQuery":false},"yui":{"YAHOO":false,"YAHOO_config":false,"YUI":false,"YUI_config":false},"shelljs":{"cat":false,"cd":false,"chmod":false,"config":false,"cp":false,"dirs":false,"echo":false,"env":false,"error":false,"exec":false,"exit":false,"find":false,"grep":false,"ln":false,"ls":false,"mkdir":false,"mv":false,"popd":false,"pushd":false,"pwd":false,"rm":false,"sed":false,"set":false,"target":false,"tempdir":false,"test":false,"touch":false,"which":false},"prototypejs":{"$":false,"$$":false,"$A":false,"$break":false,"$continue":false,"$F":false,"$H":false,"$R":false,"$w":false,"Abstract":false,"Ajax":false,"Autocompleter":false,"Builder":false,"Class":false,"Control":false,"Draggable":false,"Draggables":false,"Droppables":false,"Effect":false,"Element":false,"Enumerable":false,"Event":false,"Field":false,"Form":false,"Hash":false,"Insertion":false,"ObjectRange":false,"PeriodicalExecuter":false,"Position":false,"Prototype":false,"Scriptaculous":false,"Selector":false,"Sortable":false,"SortableObserver":false,"Sound":false,"Template":false,"Toggle":false,"Try":false},"meteor":{"_":false,"$":false,"Accounts":false,"AccountsClient":false,"AccountsCommon":false,"AccountsServer":false,"App":false,"Assets":false,"Blaze":false,"check":false,"Cordova":false,"DDP":false,"DDPRateLimiter":false,"DDPServer":false,"Deps":false,"EJSON":false,"Email":false,"HTTP":false,"Log":false,"Match":false,"Meteor":false,"Mongo":false,"MongoInternals":false,"Npm":false,"Package":false,"Plugin":false,"process":false,"Random":false,"ReactiveDict":false,"ReactiveVar":false,"Router":false,"ServiceConfiguration":false,"Session":false,"share":false,"Spacebars":false,"Template":false,"Tinytest":false,"Tracker":false,"UI":false,"Utils":false,"WebApp":false,"WebAppInternals":false},"mongo":{"_isWindows":false,"_rand":false,"BulkWriteResult":false,"cat":false,"cd":false,"connect":false,"db":false,"getHostName":false,"getMemInfo":false,"hostname":false,"ISODate":false,"listFiles":false,"load":false,"ls":false,"md5sumFile":false,"mkdir":false,"Mongo":false,"NumberInt":false,"NumberLong":false,"ObjectId":false,"PlanCache":false,"print":false,"printjson":false,"pwd":false,"quit":false,"removeFile":false,"rs":false,"sh":false,"UUID":false,"version":false,"WriteResult":false},"applescript":{"$":false,"Application":false,"Automation":false,"console":false,"delay":false,"Library":false,"ObjC":false,"ObjectSpecifier":false,"Path":false,"Progress":false,"Ref":false},"serviceworker":{"addEventListener":false,"applicationCache":false,"atob":false,"Blob":false,"BroadcastChannel":false,"btoa":false,"Cache":false,"caches":false,"CacheStorage":false,"clearInterval":false,"clearTimeout":false,"Client":false,"clients":false,"Clients":false,"close":true,"console":false,"ExtendableEvent":false,"ExtendableMessageEvent":false,"fetch":false,"FetchEvent":false,"FileReaderSync":false,"FormData":false,"Headers":false,"IDBCursor":false,"IDBCursorWithValue":false,"IDBDatabase":false,"IDBFactory":false,"IDBIndex":false,"IDBKeyRange":false,"IDBObjectStore":false,"IDBOpenDBRequest":false,"IDBRequest":false,"IDBTransaction":false,"IDBVersionChangeEvent":false,"ImageData":false,"importScripts":false,"indexedDB":false,"location":false,"MessageChannel":false,"MessagePort":false,"name":false,"navigator":false,"Notification":false,"onclose":true,"onconnect":true,"onerror":true,"onfetch":true,"oninstall":true,"onlanguagechange":true,"onmessage":true,"onmessageerror":true,"onnotificationclick":true,"onnotificationclose":true,"onoffline":true,"ononline":true,"onpush":true,"onpushsubscriptionchange":true,"onrejectionhandled":true,"onsync":true,"onunhandledrejection":true,"performance":false,"Performance":false,"PerformanceEntry":false,"PerformanceMark":false,"PerformanceMeasure":false,"PerformanceNavigation":false,"PerformanceResourceTiming":false,"PerformanceTiming":false,"postMessage":true,"Promise":false,"queueMicrotask":false,"registration":false,"removeEventListener":false,"Request":false,"Response":false,"self":false,"ServiceWorker":false,"ServiceWorkerContainer":false,"ServiceWorkerGlobalScope":false,"ServiceWorkerMessageEvent":false,"ServiceWorkerRegistration":false,"setInterval":false,"setTimeout":false,"skipWaiting":false,"TextDecoder":false,"TextEncoder":false,"URL":false,"URLSearchParams":false,"WebSocket":false,"WindowClient":false,"Worker":false,"WorkerGlobalScope":false,"XMLHttpRequest":false},"atomtest":{"advanceClock":false,"fakeClearInterval":false,"fakeClearTimeout":false,"fakeSetInterval":false,"fakeSetTimeout":false,"resetTimeouts":false,"waitsForPromise":false},"embertest":{"andThen":false,"click":false,"currentPath":false,"currentRouteName":false,"currentURL":false,"fillIn":false,"find":false,"findAll":false,"findWithAssert":false,"keyEvent":false,"pauseTest":false,"resumeTest":false,"triggerEvent":false,"visit":false,"wait":false},"protractor":{"$":false,"$$":false,"browser":false,"by":false,"By":false,"DartObject":false,"element":false,"protractor":false},"shared-node-browser":{"clearInterval":false,"clearTimeout":false,"console":false,"setInterval":false,"setTimeout":false,"URL":false,"URLSearchParams":false},"webextensions":{"browser":false,"chrome":false,"opr":false},"greasemonkey":{"cloneInto":false,"createObjectIn":false,"exportFunction":false,"GM":false,"GM_addStyle":false,"GM_deleteValue":false,"GM_getResourceText":false,"GM_getResourceURL":false,"GM_getValue":false,"GM_info":false,"GM_listValues":false,"GM_log":false,"GM_openInTab":false,"GM_registerMenuCommand":false,"GM_setClipboard":false,"GM_setValue":false,"GM_xmlhttpRequest":false,"unsafeWindow":false},"devtools":{"$":false,"$_":false,"$$":false,"$0":false,"$1":false,"$2":false,"$3":false,"$4":false,"$x":false,"chrome":false,"clear":false,"copy":false,"debug":false,"dir":false,"dirxml":false,"getEventListeners":false,"inspect":false,"keys":false,"monitor":false,"monitorEvents":false,"profile":false,"profileEnd":false,"queryObjects":false,"table":false,"undebug":false,"unmonitor":false,"unmonitorEvents":false,"values":false}}'); /***/ }), /***/ 50918: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const fs = __webpack_require__(35747); +const fs = __nccwpck_require__(35747); const paramParser = function(input) { const params = {}; @@ -266,7 +129,7 @@ module.exports = { /***/ }), /***/ 87351: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -278,8 +141,8 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const os = __importStar(__webpack_require__(12087)); -const utils_1 = __webpack_require__(5278); +const os = __importStar(__nccwpck_require__(12087)); +const utils_1 = __nccwpck_require__(5278); /** * Commands * @@ -352,7 +215,7 @@ function escapeProperty(s) { /***/ }), /***/ 42186: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -373,11 +236,11 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const command_1 = __webpack_require__(87351); -const file_command_1 = __webpack_require__(717); -const utils_1 = __webpack_require__(5278); -const os = __importStar(__webpack_require__(12087)); -const path = __importStar(__webpack_require__(85622)); +const command_1 = __nccwpck_require__(87351); +const file_command_1 = __nccwpck_require__(717); +const utils_1 = __nccwpck_require__(5278); +const os = __importStar(__nccwpck_require__(12087)); +const path = __importStar(__nccwpck_require__(85622)); /** * The code to exit an action */ @@ -597,7 +460,7 @@ exports.getState = getState; /***/ }), /***/ 717: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -612,9 +475,9 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true })); // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ -const fs = __importStar(__webpack_require__(35747)); -const os = __importStar(__webpack_require__(12087)); -const utils_1 = __webpack_require__(5278); +const fs = __importStar(__nccwpck_require__(35747)); +const os = __importStar(__nccwpck_require__(12087)); +const utils_1 = __nccwpck_require__(5278); function issueCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { @@ -659,14 +522,14 @@ exports.toCommandValue = toCommandValue; /***/ }), /***/ 53113: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const $Ref = __webpack_require__(59825); -const Pointer = __webpack_require__(26040); -const url = __webpack_require__(81279); +const $Ref = __nccwpck_require__(59825); +const Pointer = __nccwpck_require__(26040); +const url = __nccwpck_require__(81279); module.exports = bundle; @@ -928,15 +791,15 @@ function removeFromInventory (inventory, entry) { /***/ }), /***/ 82461: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const $Ref = __webpack_require__(59825); -const Pointer = __webpack_require__(26040); -const { ono } = __webpack_require__(33436); -const url = __webpack_require__(81279); +const $Ref = __nccwpck_require__(59825); +const Pointer = __nccwpck_require__(26040); +const { ono } = __nccwpck_require__(33436); +const url = __nccwpck_require__(81279); module.exports = dereference; @@ -949,7 +812,7 @@ module.exports = dereference; */ function dereference (parser, options) { // console.log('Dereferencing $ref pointers in %s', parser.$refs._root$Ref.path); - let dereferenced = crawl(parser.schema, parser.$refs._root$Ref.path, "#", [], parser.$refs, options); + let dereferenced = crawl(parser.schema, parser.$refs._root$Ref.path, "#", new Set(), new Set(), new Map(), parser.$refs, options); parser.$refs.circular = dereferenced.circular; parser.schema = dereferenced.value; } @@ -960,44 +823,39 @@ function dereference (parser, options) { * @param {*} obj - The value to crawl. If it's not an object or array, it will be ignored. * @param {string} path - The full path of `obj`, possibly with a JSON Pointer in the hash * @param {string} pathFromRoot - The path of `obj` from the schema root - * @param {object[]} parents - An array of the parent objects that have already been dereferenced + * @param {Set} parents - An array of the parent objects that have already been dereferenced + * @param {Set} processedObjects - An array of all the objects that have already been processed + * @param {Map} dereferencedCache - An map of all the dereferenced objects * @param {$Refs} $refs * @param {$RefParserOptions} options * @returns {{value: object, circular: boolean}} */ -function crawl (obj, path, pathFromRoot, parents, $refs, options) { +function crawl (obj, path, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options) { let dereferenced; let result = { value: obj, circular: false }; - if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj)) { - parents.push(obj); - - if ($Ref.isAllowed$Ref(obj, options)) { - dereferenced = dereference$Ref(obj, path, pathFromRoot, parents, $refs, options); - result.circular = dereferenced.circular; - result.value = dereferenced.value; - } - else { - for (let key of Object.keys(obj)) { - let keyPath = Pointer.join(path, key); - let keyPathFromRoot = Pointer.join(pathFromRoot, key); - let value = obj[key]; - let circular = false; + if (options.dereference.circular === "ignore" || !processedObjects.has(obj)) { + if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj)) { + parents.add(obj); + processedObjects.add(obj); - if ($Ref.isAllowed$Ref(value, options)) { - dereferenced = dereference$Ref(value, keyPath, keyPathFromRoot, parents, $refs, options); - circular = dereferenced.circular; - // Avoid pointless mutations; breaks frozen objects to no profit - if (obj[key] !== dereferenced.value) { - obj[key] = dereferenced.value; - } - } - else { - if (parents.indexOf(value) === -1) { - dereferenced = crawl(value, keyPath, keyPathFromRoot, parents, $refs, options); + if ($Ref.isAllowed$Ref(obj, options)) { + dereferenced = dereference$Ref(obj, path, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options); + result.circular = dereferenced.circular; + result.value = dereferenced.value; + } + else { + for (const key of Object.keys(obj)) { + let keyPath = Pointer.join(path, key); + let keyPathFromRoot = Pointer.join(pathFromRoot, key); + let value = obj[key]; + let circular = false; + + if ($Ref.isAllowed$Ref(value, options)) { + dereferenced = dereference$Ref(value, keyPath, keyPathFromRoot, parents, processedObjects, dereferencedCache, $refs, options); circular = dereferenced.circular; // Avoid pointless mutations; breaks frozen objects to no profit if (obj[key] !== dereferenced.value) { @@ -1005,16 +863,26 @@ function crawl (obj, path, pathFromRoot, parents, $refs, options) { } } else { - circular = foundCircularReference(keyPath, $refs, options); + if (!parents.has(value)) { + dereferenced = crawl(value, keyPath, keyPathFromRoot, parents, processedObjects, dereferencedCache, $refs, options); + circular = dereferenced.circular; + // Avoid pointless mutations; breaks frozen objects to no profit + if (obj[key] !== dereferenced.value) { + obj[key] = dereferenced.value; + } + } + else { + circular = foundCircularReference(keyPath, $refs, options); + } } - } - // Set the "isCircular" flag if this or any other property is circular - result.circular = result.circular || circular; + // Set the "isCircular" flag if this or any other property is circular + result.circular = result.circular || circular; + } } - } - parents.pop(); + parents.delete(obj); + } } return result; @@ -1026,15 +894,38 @@ function crawl (obj, path, pathFromRoot, parents, $refs, options) { * @param {{$ref: string}} $ref - The JSON Reference to resolve * @param {string} path - The full path of `$ref`, possibly with a JSON Pointer in the hash * @param {string} pathFromRoot - The path of `$ref` from the schema root - * @param {object[]} parents - An array of the parent objects that have already been dereferenced + * @param {Set} parents - An array of the parent objects that have already been dereferenced + * @param {Set} processedObjects - An array of all the objects that have already been dereferenced + * @param {Map} dereferencedCache - An map of all the dereferenced objects * @param {$Refs} $refs * @param {$RefParserOptions} options * @returns {{value: object, circular: boolean}} */ -function dereference$Ref ($ref, path, pathFromRoot, parents, $refs, options) { +function dereference$Ref ($ref, path, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options) { // console.log('Dereferencing $ref pointer "%s" at %s', $ref.$ref, path); let $refPath = url.resolve(path, $ref.$ref); + + const cache = dereferencedCache.get($refPath); + if (cache) { + const refKeys = Object.keys($ref); + if (refKeys.length > 1) { + const extraKeys = {}; + for (let key of refKeys) { + if (key !== "$ref" && !(key in cache.value)) { + extraKeys[key] = $ref[key]; + } + } + return { + circular: cache.circular, + value: Object.assign({}, cache.value, extraKeys), + }; + } + + return cache; + } + + let pointer = $refs._resolve($refPath, path, options); if (pointer === null) { @@ -1046,7 +937,7 @@ function dereference$Ref ($ref, path, pathFromRoot, parents, $refs, options) { // Check for circular references let directCircular = pointer.circular; - let circular = directCircular || parents.indexOf(pointer.value) !== -1; + let circular = directCircular || parents.has(pointer.value); circular && foundCircularReference(path, $refs, options); // Dereference the JSON reference @@ -1055,7 +946,7 @@ function dereference$Ref ($ref, path, pathFromRoot, parents, $refs, options) { // Crawl the dereferenced value (unless it's circular) if (!circular) { // Determine if the dereferenced value is circular - let dereferenced = crawl(dereferencedValue, pointer.path, pathFromRoot, parents, $refs, options); + let dereferenced = crawl(dereferencedValue, pointer.path, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options); circular = dereferenced.circular; dereferencedValue = dereferenced.value; } @@ -1071,10 +962,18 @@ function dereference$Ref ($ref, path, pathFromRoot, parents, $refs, options) { dereferencedValue.$ref = pathFromRoot; } - return { + + const dereferencedObject = { circular, value: dereferencedValue }; + + // only cache if no extra properties than $ref + if (Object.keys($ref).length === 1) { + dereferencedCache.set($refPath, dereferencedObject); + } + + return dereferencedObject; } /** @@ -1098,22 +997,22 @@ function foundCircularReference (keyPath, $refs, options) { /***/ }), /***/ 85862: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; /* eslint-disable no-unused-vars */ -const $Refs = __webpack_require__(40957); -const _parse = __webpack_require__(52430); -const normalizeArgs = __webpack_require__(64608); -const resolveExternal = __webpack_require__(45330); -const _bundle = __webpack_require__(53113); -const _dereference = __webpack_require__(82461); -const url = __webpack_require__(81279); -const { JSONParserError, InvalidPointerError, MissingPointerError, ResolverError, ParserError, UnmatchedParserError, UnmatchedResolverError, isHandledError, JSONParserErrorGroup } = __webpack_require__(1695); -const maybe = __webpack_require__(59581); -const { ono } = __webpack_require__(33436); +const $Refs = __nccwpck_require__(40957); +const _parse = __nccwpck_require__(52430); +const normalizeArgs = __nccwpck_require__(64608); +const resolveExternal = __nccwpck_require__(45330); +const _bundle = __nccwpck_require__(53113); +const _dereference = __nccwpck_require__(82461); +const url = __nccwpck_require__(81279); +const { JSONParserError, InvalidPointerError, MissingPointerError, ResolverError, ParserError, UnmatchedParserError, UnmatchedResolverError, isHandledError, JSONParserErrorGroup } = __nccwpck_require__(1695); +const maybe = __nccwpck_require__(59581); +const { ono } = __nccwpck_require__(33436); module.exports = $RefParser; module.exports.default = $RefParser; @@ -1389,12 +1288,12 @@ function finalize (parser) { /***/ }), /***/ 64608: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Options = __webpack_require__(36608); +const Options = __nccwpck_require__(36608); module.exports = normalizeArgs; @@ -1450,18 +1349,18 @@ function normalizeArgs (args) { /***/ }), /***/ 36608: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; /* eslint lines-around-comment: [2, {beforeBlockComment: false}] */ -const jsonParser = __webpack_require__(74683); -const yamlParser = __webpack_require__(40525); -const textParser = __webpack_require__(80164); -const binaryParser = __webpack_require__(67922); -const fileResolver = __webpack_require__(36859); -const httpResolver = __webpack_require__(34147); +const jsonParser = __nccwpck_require__(74683); +const yamlParser = __nccwpck_require__(40525); +const textParser = __nccwpck_require__(80164); +const binaryParser = __nccwpck_require__(67922); +const fileResolver = __nccwpck_require__(36859); +const httpResolver = __nccwpck_require__(34147); module.exports = $RefParserOptions; @@ -1579,15 +1478,15 @@ function isMergeable (val) { /***/ }), /***/ 52430: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { ono } = __webpack_require__(33436); -const url = __webpack_require__(81279); -const plugins = __webpack_require__(14601); -const { ResolverError, ParserError, UnmatchedParserError, UnmatchedResolverError, isHandledError } = __webpack_require__(1695); +const { ono } = __nccwpck_require__(33436); +const url = __nccwpck_require__(81279); +const plugins = __nccwpck_require__(14601); +const { ResolverError, ParserError, UnmatchedParserError, UnmatchedResolverError, isHandledError } = __nccwpck_require__(1695); module.exports = parse; @@ -1814,12 +1713,12 @@ module.exports = { /***/ }), /***/ 74683: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { ParserError } = __webpack_require__(1695); +const { ParserError } = __nccwpck_require__(1695); module.exports = { /** @@ -1885,12 +1784,12 @@ module.exports = { /***/ }), /***/ 80164: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { ParserError } = __webpack_require__(1695); +const { ParserError } = __nccwpck_require__(1695); let TEXT_REGEXP = /\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i; @@ -1959,13 +1858,13 @@ module.exports = { /***/ }), /***/ 40525: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { ParserError } = __webpack_require__(1695); -const yaml = __webpack_require__(21917); +const { ParserError } = __nccwpck_require__(1695); +const yaml = __nccwpck_require__(55848); module.exports = { /** @@ -2009,7 +1908,7 @@ module.exports = { if (typeof data === "string") { try { - return yaml.safeLoad(data); + return yaml.load(data); } catch (e) { throw new ParserError(e.message, file.url); @@ -2026,16 +1925,16 @@ module.exports = { /***/ }), /***/ 26040: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; module.exports = Pointer; -const $Ref = __webpack_require__(59825); -const url = __webpack_require__(81279); -const { JSONParserError, InvalidPointerError, MissingPointerError, isHandledError } = __webpack_require__(1695); +const $Ref = __nccwpck_require__(59825); +const url = __nccwpck_require__(81279); +const { JSONParserError, InvalidPointerError, MissingPointerError, isHandledError } = __nccwpck_require__(1695); const slashes = /\//g; const tildes = /~/g; const escapedSlash = /~1/g; @@ -2266,6 +2165,10 @@ function resolveIf$Ref (pointer, options) { } else { let resolved = pointer.$ref.$refs._resolve($refPath, pointer.path, options); + if (resolved === null) { + return false; + } + pointer.indirections += resolved.indirections + 1; if ($Ref.isExtended$Ref(pointer.value)) { @@ -2325,21 +2228,21 @@ function unwrapOrThrow (value) { /***/ }), /***/ 59825: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; module.exports = $Ref; -const Pointer = __webpack_require__(26040); -const { InvalidPointerError, isHandledError, normalizeError } = __webpack_require__(1695); -const { safePointerToPath, stripHash, getHash } = __webpack_require__(81279); +const Pointer = __nccwpck_require__(26040); +const { InvalidPointerError, isHandledError, normalizeError } = __nccwpck_require__(1695); +const { safePointerToPath, stripHash, getHash } = __nccwpck_require__(81279); /** * This class represents a single JSON reference and its resolved value. * - * @constructor + * @class */ function $Ref () { /** @@ -2357,24 +2260,28 @@ function $Ref () { /** * The resolved value of the JSON reference. * Can be any JSON type, not just objects. Unknown file types are represented as Buffers (byte arrays). + * * @type {?*} */ this.value = undefined; /** * The {@link $Refs} object that contains this {@link $Ref} object. + * * @type {$Refs} */ this.$refs = undefined; /** * Indicates the type of {@link $Ref#path} (e.g. "file", "http", etc.) + * * @type {?string} */ this.pathType = undefined; /** * List of all errors. Undefined if no errors. + * * @type {Array} */ this.errors = undefined; @@ -2383,7 +2290,7 @@ function $Ref () { /** * Pushes an error to errors array. * - * @param {Array} error - The error to be pushed + * @param {Array} err - The error to be pushed * @returns {void} */ $Ref.prototype.addError = function (err) { @@ -2391,17 +2298,22 @@ $Ref.prototype.addError = function (err) { this.errors = []; } + const existingErrors = this.errors.map(({ footprint }) => footprint); + // the path has been almost certainly set at this point, - // but just in case something went wrong, let's inject path if necessary + // but just in case something went wrong, normalizeError injects path if necessary + // moreover, certain errors might point at the same spot, so filter them out to reduce noise if (Array.isArray(err.errors)) { - this.errors.push(...err.errors.map(normalizeError)); + this.errors.push(...err.errors + .map(normalizeError) + .filter(({ footprint }) => !existingErrors.includes(footprint)), + ); } - else { + else if (!existingErrors.includes(err.footprint)) { this.errors.push(normalizeError(err)); } }; - /** * Determines whether the given JSON reference exists within this {@link $Ref#value}. * @@ -2436,8 +2348,8 @@ $Ref.prototype.get = function (path, options) { * @param {string} path - The full path being resolved, optionally with a JSON pointer in the hash * @param {$RefParserOptions} options * @param {string} friendlyPath - The original user-specified path (used for error messages) -* @param {string} pathFromRoot - The path of `obj` from the schema root - * @returns {Pointer} + * @param {string} pathFromRoot - The path of `obj` from the schema root + * @returns {Pointer | null} */ $Ref.prototype.resolve = function (path, options, friendlyPath, pathFromRoot) { let pointer = new Pointer(this, path, friendlyPath); @@ -2618,14 +2530,14 @@ $Ref.dereference = function ($ref, resolvedValue) { /***/ }), /***/ 40957: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { ono } = __webpack_require__(33436); -const $Ref = __webpack_require__(59825); -const url = __webpack_require__(81279); +const { ono } = __nccwpck_require__(33436); +const $Ref = __nccwpck_require__(59825); +const url = __nccwpck_require__(81279); module.exports = $Refs; @@ -2823,16 +2735,16 @@ function getPaths ($refs, types) { /***/ }), /***/ 45330: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const $Ref = __webpack_require__(59825); -const Pointer = __webpack_require__(26040); -const parse = __webpack_require__(52430); -const url = __webpack_require__(81279); -const { isHandledError } = __webpack_require__(1695); +const $Ref = __nccwpck_require__(59825); +const Pointer = __nccwpck_require__(26040); +const parse = __nccwpck_require__(52430); +const url = __nccwpck_require__(81279); +const { isHandledError } = __nccwpck_require__(1695); module.exports = resolveExternal; @@ -2872,6 +2784,7 @@ function resolveExternal (parser, options) { * @param {string} path - The full path of `obj`, possibly with a JSON Pointer in the hash * @param {$Refs} $refs * @param {$RefParserOptions} options + * @param {Set} seen - Internal. * * @returns {Promise[]} * Returns an array of promises. There will be one promise for each JSON reference in `obj`. @@ -2879,10 +2792,12 @@ function resolveExternal (parser, options) { * If any of the JSON references point to files that contain additional JSON references, * then the corresponding promise will internally reference an array of promises. */ -function crawl (obj, path, $refs, options) { +function crawl (obj, path, $refs, options, seen) { + seen = seen || new Set(); let promises = []; - if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj)) { + if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj) && !seen.has(obj)) { + seen.add(obj); // Track previously seen objects to avoid infinite recursion if ($Ref.isExternal$Ref(obj)) { promises.push(resolve$Ref(obj, path, $refs, options)); } @@ -2895,7 +2810,7 @@ function crawl (obj, path, $refs, options) { promises.push(resolve$Ref(value, keyPath, $refs, options)); } else { - promises = promises.concat(crawl(value, keyPath, $refs, options)); + promises = promises.concat(crawl(value, keyPath, $refs, options, seen)); } } } @@ -2957,14 +2872,14 @@ async function resolve$Ref ($ref, path, $refs, options) { /***/ }), /***/ 36859: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(35747); -const { ono } = __webpack_require__(33436); -const url = __webpack_require__(81279); -const { ResolverError } = __webpack_require__(1695); +const fs = __nccwpck_require__(35747); +const { ono } = __nccwpck_require__(33436); +const url = __nccwpck_require__(81279); +const { ResolverError } = __nccwpck_require__(1695); module.exports = { /** @@ -3029,16 +2944,16 @@ module.exports = { /***/ }), /***/ 34147: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const http = __webpack_require__(98605); -const https = __webpack_require__(57211); -const { ono } = __webpack_require__(33436); -const url = __webpack_require__(81279); -const { ResolverError } = __webpack_require__(1695); +const http = __nccwpck_require__(98605); +const https = __nccwpck_require__(57211); +const { ono } = __nccwpck_require__(33436); +const url = __nccwpck_require__(81279); +const { ResolverError } = __nccwpck_require__(1695); module.exports = { /** @@ -3217,14 +3132,14 @@ function get (u, httpOptions) { /***/ }), /***/ 1695: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -const { Ono } = __webpack_require__(33436); +const { Ono } = __nccwpck_require__(33436); -const { stripHash, toFileSystemPath } = __webpack_require__(81279); +const { stripHash, toFileSystemPath } = __nccwpck_require__(81279); const JSONParserError = exports.JSONParserError = class JSONParserError extends Error { constructor (message, source) { @@ -3237,6 +3152,10 @@ const JSONParserError = exports.JSONParserError = class JSONParserError extends Ono.extend(this); } + + get footprint () { + return `${this.path}+${this.source}+${this.code}+${this.message}`; + } }; setErrorName(JSONParserError); @@ -3524,7 +3443,7 @@ function getResult (obj, prop, file, callback, $refs) { /***/ }), /***/ 81279: -/***/ ((module, exports, __webpack_require__) => { +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; @@ -3551,8 +3470,8 @@ let urlDecodePatterns = [ /\%40/g, "@" ]; -exports.parse = __webpack_require__(78835).parse; -exports.resolve = __webpack_require__(78835).resolve; +exports.parse = __nccwpck_require__(78835).parse; +exports.resolve = __nccwpck_require__(78835).resolve; /** * Returns the current working directory (in Node) or the current page URL (in browsers). @@ -3598,11 +3517,25 @@ exports.getProtocol = function getProtocol (path) { exports.getExtension = function getExtension (path) { let lastDot = path.lastIndexOf("."); if (lastDot >= 0) { - return path.substr(lastDot).toLowerCase(); + return url.stripQuery(path.substr(lastDot).toLowerCase()); } return ""; }; +/** + * Removes the query, if any, from the given path. + * + * @param {string} path + * @returns {string} + */ +exports.stripQuery = function stripQuery (path) { + let queryIndex = path.indexOf("?"); + if (queryIndex >= 0) { + path = path.substr(0, queryIndex); + } + return path; +}; + /** * Returns the hash (URL fragment), of the given path. * If there is no hash, then the root hash ("#") is returned. @@ -3788,34395 +3721,137799 @@ exports.safePointerToPath = function safePointerToPath (pointer) { /***/ }), -/***/ 89067: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const { avroToJsonSchema } = __webpack_require__(71228); +/***/ 55848: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports.parse = async ({ message, defaultSchemaFormat }) => { - const transformed = await avroToJsonSchema(message.payload); +"use strict"; - message['x-parser-original-schema-format'] = message.schemaFormat || defaultSchemaFormat; - message['x-parser-original-payload'] = message.payload; - message.payload = transformed; - delete message.schemaFormat; -}; -module.exports.getMimeTypes = () => { - return [ - 'application/vnd.apache.avro;version=1.9.0', - 'application/vnd.apache.avro+json;version=1.9.0', - 'application/vnd.apache.avro+yaml;version=1.9.0', - 'application/vnd.apache.avro;version=1.8.2', - 'application/vnd.apache.avro+json;version=1.8.2', - 'application/vnd.apache.avro+yaml;version=1.8.2' - ]; -}; +var loader = __nccwpck_require__(42432); +var dumper = __nccwpck_require__(99772); -/***/ }), -/***/ 71228: -/***/ ((module) => { +function renamed(from, to) { + return function () { + throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' + + 'Use yaml.' + to + ' instead, which is now safe by default.'); + }; +} -const BYTES_PATTERN = '^[\u0000-\u00ff]*$'; -const INT_MIN = Math.pow(-2, 31); -const INT_MAX = Math.pow(2, 31) - 1; -const LONG_MIN = Math.pow(-2, 63); -const LONG_MAX = Math.pow(2, 63) - 1; -const typeMappings = { - null: 'null', - boolean: 'boolean', - int: 'integer', - long: 'integer', - float: 'number', - double: 'number', - bytes: 'string', - string: 'string', - fixed: 'string', - map: 'object', - array: 'array', - enum: 'string', - record: 'object', - uuid: 'string', +module.exports.Type = __nccwpck_require__(63820); +module.exports.Schema = __nccwpck_require__(78583); +module.exports.FAILSAFE_SCHEMA = __nccwpck_require__(59056); +module.exports.JSON_SCHEMA = __nccwpck_require__(9531); +module.exports.CORE_SCHEMA = __nccwpck_require__(84030); +module.exports.DEFAULT_SCHEMA = __nccwpck_require__(81448); +module.exports.load = loader.load; +module.exports.loadAll = loader.loadAll; +module.exports.dump = dumper.dump; +module.exports.YAMLException = __nccwpck_require__(7987); + +// Re-export all types in case user wants to create custom schema +module.exports.types = { + binary: __nccwpck_require__(27731), + float: __nccwpck_require__(68155), + map: __nccwpck_require__(23412), + null: __nccwpck_require__(21471), + pairs: __nccwpck_require__(61589), + set: __nccwpck_require__(80986), + timestamp: __nccwpck_require__(65821), + bool: __nccwpck_require__(18769), + int: __nccwpck_require__(58884), + merge: __nccwpck_require__(50718), + omap: __nccwpck_require__(40564), + seq: __nccwpck_require__(37331), + str: __nccwpck_require__(98225) }; -module.exports.avroToJsonSchema = async function avroToJsonSchema(avroDefinition) { - const jsonSchema = {}; - const isUnion = Array.isArray(avroDefinition); +// Removed functions from JS-YAML 3.0.x +module.exports.safeLoad = renamed('safeLoad', 'load'); +module.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll'); +module.exports.safeDump = renamed('safeDump', 'dump'); - if (isUnion) { - jsonSchema.oneOf = []; - for (const avroDef of avroDefinition) { - const def = await avroToJsonSchema(avroDef); - jsonSchema.oneOf.push(def); - } - return jsonSchema; - } - - // Avro definition can be a string (e.g. "int") - // or an object like { type: "int" } - const type = avroDefinition.type || avroDefinition; - jsonSchema.type = typeMappings[type]; - - switch (type) { - case 'int': - jsonSchema.minimum = INT_MIN; - jsonSchema.maximum = INT_MAX; - break; - case 'long': - jsonSchema.minimum = LONG_MIN; - jsonSchema.maximum = LONG_MAX; - break; - case 'bytes': - jsonSchema.pattern = BYTES_PATTERN; - break; - case 'fixed': - jsonSchema.pattern = BYTES_PATTERN; - jsonSchema.minLength = avroDefinition.size; - jsonSchema.maxLength = avroDefinition.size; - break; - case 'map': - jsonSchema.additionalProperties = await avroToJsonSchema(avroDefinition.values); - break; - case 'array': - jsonSchema.items = await avroToJsonSchema(avroDefinition.items); - break; - case 'enum': - jsonSchema.enum = avroDefinition.symbols; - break; - case 'record': - const propsMap = new Map(); - for (const field of avroDefinition.fields) { - const def = await avroToJsonSchema(field.type); - if (field.doc) def.description = field.doc; - if (field.default) def.default = field.default; - propsMap.set(field.name, def); - } - jsonSchema.properties = Object.fromEntries(propsMap.entries()); - break; - } +/***/ }), - if (avroDefinition.doc) jsonSchema.description = avroDefinition.doc; - if (avroDefinition.default !== undefined) jsonSchema.default = avroDefinition.default; +/***/ 33198: +/***/ ((module) => { - return jsonSchema; -}; +"use strict"; -/***/ }), -/***/ 80851: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +function isNothing(subject) { + return (typeof subject === 'undefined') || (subject === null); +} -const path = __webpack_require__(85622); -const fs = __webpack_require__(35747); -const xfs = __webpack_require__(52088); -const { isLocalTemplate } = __webpack_require__(65015); -/** - * Registers all template filters. - * @param {Object} nunjucks Nunjucks environment. - * @param {Object} templateConfig Template configuration. - * @param {String} templateDir Directory where template is located. - * @param {String} filtersDir Directory where local filters are located. - */ -module.exports.registerFilters = async (nunjucks, templateConfig, templateDir, filtersDir) => { - await registerLocalFilters(nunjucks, templateDir, filtersDir); - await registerConfigFilters(nunjucks, templateDir, templateConfig); -}; +function isObject(subject) { + return (typeof subject === 'object') && (subject !== null); +} -/** - * Registers the local template filters. - * @private - * @param {Object} nunjucks Nunjucks environment. - * @param {String} templateDir Directory where template is located. - * @param {String} filtersDir Directory where local filters are located. - */ -function registerLocalFilters(nunjucks, templateDir, filtersDir) { - return new Promise((resolve, reject) => { - const localFilters = path.resolve(templateDir, filtersDir); - if (!fs.existsSync(localFilters)) return resolve(); +function toArray(sequence) { + if (Array.isArray(sequence)) return sequence; + else if (isNothing(sequence)) return []; - const walker = xfs.walk(localFilters, { - followLinks: false - }); + return [ sequence ]; +} - walker.on('file', async (root, stats, next) => { - try { - const filePath = path.resolve(templateDir, path.resolve(root, stats.name)); - // If it's a module constructor, inject dependencies to ensure consistent usage in remote templates in other projects or plain directories. - delete require.cache[require.resolve(filePath)]; - const mod = require(filePath); - addFilters(nunjucks, mod); - - next(); - } catch (e) { - reject(e); - } - }); +function extend(target, source) { + var index, length, key, sourceKeys; - walker.on('errors', (root, nodeStatsArray) => { - reject(nodeStatsArray); - }); + if (source) { + sourceKeys = Object.keys(source); - walker.on('end', async () => { - resolve(); - }); - }); + for (index = 0, length = sourceKeys.length; index < length; index += 1) { + key = sourceKeys[index]; + target[key] = source[key]; + } + } + + return target; } -/** -* Registers the additionally configured filters. -* @private -* @param {Object} nunjucks Nunjucks environment. -* @param {String} templateDir Directory where template is located. -* @param {Object} templateConfig Template configuration. -*/ -async function registerConfigFilters(nunjucks, templateDir, templateConfig) { - const confFilters = templateConfig.filters; - const DEFAULT_MODULES_DIR = 'node_modules'; - if (!Array.isArray(confFilters)) return; - const promises = confFilters.map(async el => { - const modulePath = await isLocalTemplate(templateDir) ? path.resolve(templateDir, DEFAULT_MODULES_DIR, el) : el; - const mod = require(modulePath); +function repeat(string, count) { + var result = '', cycle; - addFilters(nunjucks, mod); - }); + for (cycle = 0; cycle < count; cycle += 1) { + result += string; + } - await Promise.all(promises); + return result; } -/** - * Add filter functions to Nunjucks environment. Only owned functions from the module are added. - * @private - * @param {Object} nunjucks Nunjucks environment. - * @param {Object} filters Module with functions. - */ -function addFilters(nunjucks, filters) { - Object.getOwnPropertyNames(filters).forEach((key) => { - const value = filters[key]; - if (!(value instanceof Function)) return; - nunjucks.addFilter(key, value); - }); +function isNegativeZero(number) { + return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); } -/***/ }), +module.exports.isNothing = isNothing; +module.exports.isObject = isObject; +module.exports.toArray = toArray; +module.exports.repeat = repeat; +module.exports.isNegativeZero = isNegativeZero; +module.exports.extend = extend; -/***/ 56814: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -function __ncc_wildcard$0 (arg) { - if (arg === "@asyncapi/generator-filters/node_modules/markdown-it") return __webpack_require__(67387); - else if (arg === "@asyncapi/generator-filters") return __webpack_require__(81195); - else if (arg === "@asyncapi/markdown-template") return __webpack_require__(65035); - else if (arg === "argparse") return __webpack_require__(30313); - else if (arg === "commander") return __webpack_require__(50274); - else if (arg === "entities") return __webpack_require__(99589); - else if (arg === "foreach") return __webpack_require__(99945); - else if (arg === "json-pointer") return __webpack_require__(46587); - else if (arg === "linkify-it") return __webpack_require__(6016); - else if (arg === "lodash") return __webpack_require__(77234); - else if (arg === "mdurl") return __webpack_require__(42896); - else if (arg === "openapi-sampler") return __webpack_require__(10525); - else if (arg === "semver") return __webpack_require__(9968); - else if (arg === "sprintf-js") return __webpack_require__(87475); - else if (arg === "uc.micro") return __webpack_require__(19909); -} -const path = __webpack_require__(85622); -const fs = __webpack_require__(35747); -const xfs = __webpack_require__(52088); -const minimatch = __webpack_require__(83973); -const parser = __webpack_require__(44479); -const { parse, AsyncAPIDocument } = parser; -const ramlDtParser = __webpack_require__(54443); -const openapiSchemaParser = __webpack_require__(3149); -const avroSchemaParser = __webpack_require__(89067); -const Nunjucks = __webpack_require__(17006); -const jmespath = __webpack_require__(87783); -const filenamify = __webpack_require__(16094); -const git = __webpack_require__(18577); -const npmi = __webpack_require__(69039); -const log = __webpack_require__(78063); -const { validateTemplateConfig } = __webpack_require__(45881); -const { - convertMapToObject, - isFileSystemPath, - beautifyNpmiResult, - isLocalTemplate, - getLocalTemplateDetails, - readFile, - readDir, - writeFile, - copyFile, - exists, - fetchSpec, - getInvalidOptions -} = __webpack_require__(65015); -const { registerFilters } = __webpack_require__(80851); -const { registerHooks } = __webpack_require__(27014); -parser.registerSchemaParser(openapiSchemaParser); -parser.registerSchemaParser(ramlDtParser); -parser.registerSchemaParser(avroSchemaParser); +/***/ }), -const FILTERS_DIRNAME = 'filters'; -const HOOKS_DIRNAME = 'hooks'; -const CONFIG_FILENAME = 'package.json'; -const PACKAGE_JSON_FILENAME = 'package.json'; -const GIT_IGNORE_FILENAME = '{.gitignore}'; -const NPM_IGNORE_FILENAME = '{.npmignore}'; -const ROOT_DIR = path.resolve(__dirname, '..'); -const DEFAULT_TEMPLATES_DIR = path.resolve(ROOT_DIR, 'node_modules'); -const TEMPLATE_CONTENT_DIRNAME = 'template'; -const GENERATOR_OPTIONS = ['debug', 'disabledHooks', 'entrypoint', 'forceWrite', 'install', 'noOverwriteGlobs', 'output', 'templateParams']; +/***/ 99772: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const shouldIgnoreFile = filePath => - filePath.startsWith(`.git${path.sep}`); +"use strict"; -const shouldIgnoreDir = dirPath => - dirPath === '.git' - || dirPath.startsWith(`.git${path.sep}`); -class Generator { - /** - * Instantiates a new Generator object. - * - * @example - * const path = require('path'); - * const generator = new Generator('@asyncapi/html-template', path.resolve(__dirname, 'example')); - * - * @example Passing custom params to the template - * const path = require('path'); - * const generator = new Generator('@asyncapi/html-template', path.resolve(__dirname, 'example'), { - * templateParams: { - * sidebarOrganization: 'byTags' - * } - * }); - * - * @param {String} templateName Name of the template to generate. - * @param {String} targetDir Path to the directory where the files will be generated. - * @param {Object} options - * @param {String} [options.templateParams] Optional parameters to pass to the template. Each template define their own params. - * @param {String} [options.entrypoint] Name of the file to use as the entry point for the rendering process. Use in case you want to use only a specific template file. Note: this potentially avoids rendering every file in the template. - * @param {String[]} [options.noOverwriteGlobs] List of globs to skip when regenerating the template. - * @param {Object} [options.disabledHooks] Object with hooks to disable. The key is a hook type. If key has "true" value, then the generator skips all hooks from the given type. If the value associated with a key is a string with the name of a single hook, then the generator skips only this single hook name. If the value associated with a key is an array of strings, then the generator skips only hooks from the array. - * @param {String} [options.output='fs'] Type of output. Can be either 'fs' (default) or 'string'. Only available when entrypoint is set. - * @param {Boolean} [options.forceWrite=false] Force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir. Default is set to false. - * @param {Boolean} [options.install=false] Install the template and its dependencies, even when the template has already been installed. - * @param {Boolean} [options.debug=false] Enable more specific errors in the console. At the moment it only shows specific errors about filters. Keep in mind that as a result errors about template are less descriptive. - */ - constructor(templateName, targetDir, { templateParams = {}, entrypoint, noOverwriteGlobs, disabledHooks, output = 'fs', forceWrite = false, install = false, debug = false } = {}) { - const invalidOptions = getInvalidOptions(GENERATOR_OPTIONS, arguments[arguments.length - 1] || []); - if (invalidOptions.length) throw new Error(`These options are not supported by the generator: ${invalidOptions.join(', ')}`); - if (!templateName) throw new Error('No template name has been specified.'); - if (!entrypoint && !targetDir) throw new Error('No target directory has been specified.'); - if (!['fs', 'string'].includes(output)) throw new Error(`Invalid output type ${output}. Valid values are 'fs' and 'string'.`); +/*eslint-disable no-use-before-define*/ - /** @type {String} Name of the template to generate. */ - this.templateName = templateName; - /** @type {String} Path to the directory where the files will be generated. */ - this.targetDir = targetDir; - /** @type {String} Name of the file to use as the entry point for the rendering process. Use in case you want to use only a specific template file. Note: this potentially avoids rendering every file in the template. */ - this.entrypoint = entrypoint; - /** @type {String[]} List of globs to skip when regenerating the template. */ - this.noOverwriteGlobs = noOverwriteGlobs || []; - /** @type {Object} Object with hooks to disable. The key is a hook type. If key has "true" value, then the generator skips all hooks from the given type. If the value associated with a key is a string with the name of a single hook, then the generator skips only this single hook name. If the value associated with a key is an array of strings, then the generator skips only hooks from the array. */ - this.disabledHooks = disabledHooks || {}; - /** @type {String} Type of output. Can be either 'fs' (default) or 'string'. Only available when entrypoint is set. */ - this.output = output; - /** @type {Boolean} Force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir. Default is set to false. */ - this.forceWrite = forceWrite; - /** @type {Boolean} Enable more specific errors in the console. At the moment it only shows specific errors about filters. Keep in mind that as a result errors about template are less descriptive. */ - this.debug = debug; - /** @type {Boolean} Install the template and its dependencies, even when the template has already been installed. */ - this.install = install; - /** @type {Object} The template configuration. */ - this.templateConfig = {}; - /** @type {Object} Hooks object with hooks functions grouped by the hook type. */ - this.hooks = {}; +var common = __nccwpck_require__(33198); +var YAMLException = __nccwpck_require__(7987); +var DEFAULT_SCHEMA = __nccwpck_require__(81448); - // Load template configuration - /** @type {Object} The template parameters. The structure for this object is based on each individual template. */ - this.templateParams = {}; - Object.keys(templateParams).forEach(key => { - const self = this; - Object.defineProperty(this.templateParams, key, { - enumerable: true, - get() { - if (!self.templateConfig.parameters || !self.templateConfig.parameters[key]) { - throw new Error(`Template parameter "${key}" has not been defined in the package.json file under generator property. Please make sure it's listed there before you use it in your template.`); - } - return templateParams[key]; - } - }); - }); - } - - /** - * Generates files from a given template and an AsyncAPIDocument object. - * - * @example - * generator - * .generate(myAsyncAPIdocument) - * .then(() => { - * console.log('Done!'); - * }) - * .catch(console.error); - * - * @example Using async/await - * try { - * await generator.generate(myAsyncAPIdocument); - * console.log('Done!'); - * } catch (e) { - * console.error(e); - * } - * - * @param {AsyncAPIDocument} asyncapiDocument AsyncAPIDocument object to use as source. - * @return {Promise} - */ - async generate(asyncapiDocument) { - if (!(asyncapiDocument instanceof AsyncAPIDocument)) throw new Error('Parameter "asyncapiDocument" must be an AsyncAPIDocument object.'); - - if (this.output === 'fs') { - xfs.mkdirpSync(this.targetDir); - if (!this.forceWrite) await this.verifyTargetDir(this.targetDir); - } else if (this.output === 'string' && this.entrypoint === undefined) { - throw new Error('Parameter entrypoint is required when using output = "string"'); - } - - if (this.debug) log.setLevel('debug'); +var _toString = Object.prototype.toString; +var _hasOwnProperty = Object.prototype.hasOwnProperty; - const { name: templatePkgName, path: templatePkgPath } = await this.installTemplate(this.install); - this.templateDir = templatePkgPath; - this.templateName = templatePkgName; - this.templateContentDir = path.resolve(this.templateDir, TEMPLATE_CONTENT_DIRNAME); - this.configNunjucks(); - await this.loadTemplateConfig(); - validateTemplateConfig(this.templateConfig, this.templateParams, asyncapiDocument); - await registerHooks(this.hooks, this.templateConfig, this.templateDir, HOOKS_DIRNAME); - await registerFilters(this.nunjucks, this.templateConfig, this.templateDir, FILTERS_DIRNAME); - await this.launchHook('generate:before'); +var CHAR_BOM = 0xFEFF; +var CHAR_TAB = 0x09; /* Tab */ +var CHAR_LINE_FEED = 0x0A; /* LF */ +var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ +var CHAR_SPACE = 0x20; /* Space */ +var CHAR_EXCLAMATION = 0x21; /* ! */ +var CHAR_DOUBLE_QUOTE = 0x22; /* " */ +var CHAR_SHARP = 0x23; /* # */ +var CHAR_PERCENT = 0x25; /* % */ +var CHAR_AMPERSAND = 0x26; /* & */ +var CHAR_SINGLE_QUOTE = 0x27; /* ' */ +var CHAR_ASTERISK = 0x2A; /* * */ +var CHAR_COMMA = 0x2C; /* , */ +var CHAR_MINUS = 0x2D; /* - */ +var CHAR_COLON = 0x3A; /* : */ +var CHAR_EQUALS = 0x3D; /* = */ +var CHAR_GREATER_THAN = 0x3E; /* > */ +var CHAR_QUESTION = 0x3F; /* ? */ +var CHAR_COMMERCIAL_AT = 0x40; /* @ */ +var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ +var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ +var CHAR_GRAVE_ACCENT = 0x60; /* ` */ +var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ +var CHAR_VERTICAL_LINE = 0x7C; /* | */ +var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ - if (this.entrypoint) { - const entrypointPath = path.resolve(this.templateContentDir, this.entrypoint); - if (!(await exists(entrypointPath))) throw new Error(`Template entrypoint "${entrypointPath}" couldn't be found.`); - if (this.output === 'fs') { - await this.generateFile(asyncapiDocument, path.basename(entrypointPath), path.dirname(entrypointPath)); - await this.launchHook('generate:after'); - return; - } else if (this.output === 'string') { - return this.renderString(asyncapiDocument, await readFile(entrypointPath, { encoding: 'utf8' }), entrypointPath); - } - } - await this.generateDirectoryStructure(asyncapiDocument); - await this.launchHook('generate:after'); - } +var ESCAPE_SEQUENCES = {}; - /** - * Generates files from a given template and AsyncAPI string. - * - * @example - * const asyncapiString = ` - * asyncapi: '2.0.0' - * info: - * title: Example - * version: 1.0.0 - * ... - * `; - * generator - * .generateFromString(asyncapiString) - * .then(() => { - * console.log('Done!'); - * }) - * .catch(console.error); - * - * @example Using async/await - * const asyncapiString = ` - * asyncapi: '2.0.0' - * info: - * title: Example - * version: 1.0.0 - * ... - * `; - * - * try { - * await generator.generateFromString(asyncapiString); - * console.log('Done!'); - * } catch (e) { - * console.error(e); - * } - * - * @param {String} asyncapiString AsyncAPI string to use as source. - * @param {Object} [parserOptions={}] AsyncAPI parser options. Check out {@link https://www.github.com/asyncapi/parser-js|@asyncapi/parser} for more information. - * @return {Promise} - */ - async generateFromString(asyncapiString, parserOptions = {}) { - if (!asyncapiString || typeof asyncapiString !== 'string') throw new Error('Parameter "asyncapiString" must be a non-empty string.'); +ESCAPE_SEQUENCES[0x00] = '\\0'; +ESCAPE_SEQUENCES[0x07] = '\\a'; +ESCAPE_SEQUENCES[0x08] = '\\b'; +ESCAPE_SEQUENCES[0x09] = '\\t'; +ESCAPE_SEQUENCES[0x0A] = '\\n'; +ESCAPE_SEQUENCES[0x0B] = '\\v'; +ESCAPE_SEQUENCES[0x0C] = '\\f'; +ESCAPE_SEQUENCES[0x0D] = '\\r'; +ESCAPE_SEQUENCES[0x1B] = '\\e'; +ESCAPE_SEQUENCES[0x22] = '\\"'; +ESCAPE_SEQUENCES[0x5C] = '\\\\'; +ESCAPE_SEQUENCES[0x85] = '\\N'; +ESCAPE_SEQUENCES[0xA0] = '\\_'; +ESCAPE_SEQUENCES[0x2028] = '\\L'; +ESCAPE_SEQUENCES[0x2029] = '\\P'; - /** @type {String} AsyncAPI string to use as a source. */ - this.originalAsyncAPI = asyncapiString; +var DEPRECATED_BOOLEANS_SYNTAX = [ + 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', + 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' +]; - /** @type {AsyncAPIDocument} Parsed AsyncAPI schema. See {@link https://github.com/asyncapi/parser-js/blob/master/API.md#module_@asyncapi/parser+AsyncAPIDocument|AsyncAPIDocument} for details on object structure. */ - this.asyncapi = await parse(asyncapiString, parserOptions); - return this.generate(this.asyncapi); - } +var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; - /** - * Generates files from a given template and AsyncAPI file stored on external server. - * - * @example - * generator - * .generateFromURL('https://example.com/asyncapi.yaml') - * .then(() => { - * console.log('Done!'); - * }) - * .catch(console.error); - * - * @example Using async/await - * try { - * await generator.generateFromURL('https://example.com/asyncapi.yaml'); - * console.log('Done!'); - * } catch (e) { - * console.error(e); - * } - * - * @param {String} asyncapiURL Link to AsyncAPI file - * @return {Promise} - */ - async generateFromURL(asyncapiURL) { - const doc = await fetchSpec(asyncapiURL); +function compileStyleMap(schema, map) { + var result, keys, index, length, tag, style, type; - return this.generateFromString(doc); - } + if (map === null) return {}; - /** - * Generates files from a given template and AsyncAPI file. - * - * @example - * generator - * .generateFromFile('asyncapi.yaml') - * .then(() => { - * console.log('Done!'); - * }) - * .catch(console.error); - * - * @example Using async/await - * try { - * await generator.generateFromFile('asyncapi.yaml'); - * console.log('Done!'); - * } catch (e) { - * console.error(e); - * } - * - * @param {String} asyncapiFile AsyncAPI file to use as source. - * @return {Promise} - */ - async generateFromFile(asyncapiFile) { - const doc = await readFile(asyncapiFile, { encoding: 'utf8' }); - return this.generateFromString(doc, { path: asyncapiFile }); - } + result = {}; + keys = Object.keys(map); - /** - * Returns the content of a given template file. - * - * @example - * const Generator = require('asyncapi-generator'); - * const content = await Generator.getTemplateFile('@asyncapi/html-template', 'partials/content.html'); - * - * @example Using a custom `templatesDir` - * const Generator = require('asyncapi-generator'); - * const content = await Generator.getTemplateFile('@asyncapi/html-template', 'partials/content.html', '~/my-templates'); - * - * @static - * @param {String} templateName Name of the template to generate. - * @param {String} filePath Path to the file to render. Relative to the template directory. - * @param {String} [templatesDir=DEFAULT_TEMPLATES_DIR] Path to the directory where the templates are installed. - * @return {Promise} - */ - static async getTemplateFile(templateName, filePath, templatesDir = DEFAULT_TEMPLATES_DIR) { - return await readFile(path.resolve(templatesDir, templateName, filePath), 'utf8'); - } + for (index = 0, length = keys.length; index < length; index += 1) { + tag = keys[index]; + style = String(map[tag]); - /** - * Downloads and installs a template and its dependencies. - * - * @param {Boolean} [force=false] Whether to force installation (and skip cache) or not. - */ - installTemplate(force = false) { - return new Promise(async (resolve, reject) => { - if (!force) { - try { - let installedPkg; - - if (isFileSystemPath(this.templateName)) { - const pkg = require(path.resolve(this.templateName, PACKAGE_JSON_FILENAME)); - installedPkg = __ncc_wildcard$0(pkg.name); - } else { // Template is not a filesystem path... - const templatePath = path.resolve(DEFAULT_TEMPLATES_DIR, this.templateName); - if (await isLocalTemplate(templatePath)) { - // This "if" is covering the following workflow: - // ag asyncapi.yaml ../html-template - // The previous command installs a template called @asyncapi/html-template - // And now we run the command again but with the resolved name: - // ag asyncapi.yaml @asyncapi/html-template - // The template name doesn't look like a file system path but we find - // that the package is already installed and it's a symbolic link. - const { resolvedLink } = await getLocalTemplateDetails(templatePath); - log.debug(`This template has already been installed and it's pointing to your filesystem at ${resolvedLink}.`); - } - installedPkg = require(path.resolve(templatePath, PACKAGE_JSON_FILENAME)); - } + if (tag.slice(0, 2) === '!!') { + tag = 'tag:yaml.org,2002:' + tag.slice(2); + } + type = schema.compiledTypeMap['fallback'][tag]; - return resolve({ - name: installedPkg.name, - version: installedPkg.version, - path: path.resolve(DEFAULT_TEMPLATES_DIR, installedPkg.name), - }); - } catch (e) { - // We did our best. Proceed with installation... - } - } + if (type && _hasOwnProperty.call(type.styleAliases, style)) { + style = type.styleAliases[style]; + } - // NOTE: npmi creates symbolic links inside DEFAULT_TEMPLATES_DIR - // (node_modules) for local packages, i.e., those located in the file system. - npmi({ - name: this.templateName, - install: force, - path: ROOT_DIR, - pkgName: 'dummy value so it does not force installation always', - npmLoad: { - loglevel: 'http', - save: false, - audit: false, - progress: false, - only: 'prod' - }, - }, (err, result) => { - if (err) return reject(err); - resolve(beautifyNpmiResult(result)); - }); - }); + result[tag] = style; } - /** - * Returns all the parameters on the AsyncAPI document. - * - * @private - * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source. - */ - getAllParameters(asyncapiDocument) { - const parameters = new Map(); + return result; +} - if (asyncapiDocument.hasChannels()) { - asyncapiDocument.channelNames().forEach(channelName => { - const channel = asyncapiDocument.channel(channelName); - for (const [key, value] of Object.entries(channel.parameters())) { - parameters.set(key, value); - } - }); - } +function encodeHex(character) { + var string, handle, length; - if (asyncapiDocument.hasComponents()) { - for (const [key, value] of Object.entries(asyncapiDocument.components().parameters())) { - parameters.set(key, value); - } - } + string = character.toString(16).toUpperCase(); - return parameters; + if (character <= 0xFF) { + handle = 'x'; + length = 2; + } else if (character <= 0xFFFF) { + handle = 'u'; + length = 4; + } else if (character <= 0xFFFFFFFF) { + handle = 'U'; + length = 8; + } else { + throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); } - /** - * Generates the directory structure. - * - * @private - * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source. - * @return {Promise} - */ - generateDirectoryStructure(asyncapiDocument) { - const objectMap = {}; - asyncapiDocument.allSchemas().forEach((schema, schemaId) => { if (schema.type() === 'object') objectMap[schemaId] = schema; }); + return '\\' + handle + common.repeat('0', length - string.length) + string; +} - return new Promise((resolve, reject) => { - xfs.mkdirpSync(this.targetDir); - const walker = xfs.walk(this.templateContentDir, { - followLinks: false - }); +var QUOTING_TYPE_SINGLE = 1, + QUOTING_TYPE_DOUBLE = 2; - walker.on('file', async (root, stats, next) => { - try { - await this.filesGenerationHandler(asyncapiDocument, objectMap, root, stats, next); - } catch (e) { - reject(e); - } - }); +function State(options) { + this.schema = options['schema'] || DEFAULT_SCHEMA; + this.indent = Math.max(1, (options['indent'] || 2)); + this.noArrayIndent = options['noArrayIndent'] || false; + this.skipInvalid = options['skipInvalid'] || false; + this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); + this.styleMap = compileStyleMap(this.schema, options['styles'] || null); + this.sortKeys = options['sortKeys'] || false; + this.lineWidth = options['lineWidth'] || 80; + this.noRefs = options['noRefs'] || false; + this.noCompatMode = options['noCompatMode'] || false; + this.condenseFlow = options['condenseFlow'] || false; + this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; + this.forceQuotes = options['forceQuotes'] || false; + this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null; - walker.on('directory', async (root, stats, next) => { - try { - this.ignoredDirHandler(root, stats, next); - } catch (e) { - reject(e); - } - }); + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; - walker.on('errors', (root, nodeStatsArray) => { - reject(nodeStatsArray); - }); + this.tag = null; + this.result = ''; - walker.on('end', async () => { - resolve(); - }); - }); - } + this.duplicates = []; + this.usedDuplicates = null; +} - /** - * Makes sure that during directory structure generation ignored dirs are not modified - * @private - * - * @param {String} root Dir name. - * @param {String} stats Information about the file. - * @param {Function} next Callback function - */ - ignoredDirHandler(root, stats, next) { - const relativeDir = path.relative(this.templateContentDir, path.resolve(root, stats.name)); - const dirPath = path.resolve(this.targetDir, relativeDir); - if (!shouldIgnoreDir(relativeDir)) { - xfs.mkdirpSync(dirPath); +// Indents every line in a string. Empty lines (\n only) are not indented. +function indentString(string, spaces) { + var ind = common.repeat(' ', spaces), + position = 0, + next = -1, + result = '', + line, + length = string.length; + + while (position < length) { + next = string.indexOf('\n', position); + if (next === -1) { + line = string.slice(position); + position = length; + } else { + line = string.slice(position, next + 1); + position = next + 1; } - next(); - } - /** - * Makes sure that during directory structure generation ignored dirs are not modified - * @private - * - * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source. - * @param {String} objectMap Map of schemas of type object - * @param {String} root Dir name. - * @param {String} stats Information about the file. - * @param {Function} next Callback function - */ - async filesGenerationHandler(asyncapiDocument, objectMap, root, stats, next) { - const fileNamesForSeparation = { - channel: asyncapiDocument.channels(), - message: convertMapToObject(asyncapiDocument.allMessages()), - securityScheme: asyncapiDocument.components() ? asyncapiDocument.components().securitySchemes() : {}, - schema: asyncapiDocument.components() ? asyncapiDocument.components().schemas() : {}, - objectSchema: objectMap, - parameter: convertMapToObject(this.getAllParameters(asyncapiDocument)), - everySchema: convertMapToObject(asyncapiDocument.allSchemas()), - }; + if (line.length && line !== '\n') result += ind; - // Check if the filename dictates it should be separated - let wasSeparated = false; - for (const prop in fileNamesForSeparation) { - if (Object.prototype.hasOwnProperty.call(fileNamesForSeparation, prop) && stats.name.includes(`$$${prop}$$`)) { - await this.generateSeparateFiles(asyncapiDocument, fileNamesForSeparation[prop], prop, stats.name, root); - const templateFilePath = path.relative(this.templateContentDir, path.resolve(root, stats.name)); - fs.unlink(path.resolve(this.targetDir, templateFilePath), next); - wasSeparated = true; - //The filename can only contain 1 specifier (message, scheme etc) - break; - } - } - // If it was not separated process normally - if (!wasSeparated) { - await this.generateFile(asyncapiDocument, stats.name, root); - next(); - } + result += line; } - /** - * Generates all the files for each in array - * - * @private - * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source. - * @param {Array} array The components/channels to generate the separeted files for. - * @param {String} template The template filename to replace. - * @param {String} fileName Name of the file to generate for each security schema. - * @param {String} baseDir Base directory of the given file name. - * @returns {Promise} - */ - generateSeparateFiles(asyncapiDocument, array, template, fileName, baseDir) { - const promises = []; + return result; +} - Object.keys(array).forEach((name) => { - const component = array[name]; - promises.push(this.generateSeparateFile(asyncapiDocument, name, component, template, fileName, baseDir)); - }); +function generateNextLine(state, level) { + return '\n' + common.repeat(' ', state.indent * level); +} - return Promise.all(promises); - } +function testImplicitResolving(state, str) { + var index, length, type; - /** - * Generates a file for a component/channel - * - * @private - * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source. - * @param {String} name The name of the component (filename to use) - * @param {Object} component The component/channel object used to generate the file. - * @param {String} template The template filename to replace. - * @param {String} fileName Name of the file to generate for each security schema. - * @param {String} baseDir Base directory of the given file name. - * @returns {Promise} - */ - async generateSeparateFile(asyncapiDocument, name, component, template, fileName, baseDir) { - const relativeBaseDir = path.relative(this.templateContentDir, baseDir); + for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { + type = state.implicitTypes[index]; - const setFileTemplateNameHookName = 'setFileTemplateName'; - let filename = name; - if (this.isHookAvailable(setFileTemplateNameHookName)) { - const filenamesFromHooks = await this.launchHook(setFileTemplateNameHookName, {originalFilename: filename}); - //Use the result of the first hook - filename = filenamesFromHooks[0]; - } else { - filename = filenamify(filename, { replacement: '-', maxLength: 255 }); + if (type.resolve(str)) { + return true; } - const newFileName = fileName.replace(`\$\$${template}\$\$`, filename); - const targetFile = path.resolve(this.targetDir, relativeBaseDir, newFileName); - const relativeTargetFile = path.relative(this.targetDir, targetFile); - const shouldOverwriteFile = await this.shouldOverwriteFile(relativeTargetFile); - if (!shouldOverwriteFile) return; - //Ensure the same object are parsed to the renderFile method as before. - const temp = {}; - const key = template === 'everySchema' || template === 'objectSchema' ? 'schema' : template; - temp[`${key}Name`] = name; - temp[key] = component; - const content = await this.renderFile(asyncapiDocument, path.resolve(baseDir, fileName), temp); - - await writeFile(targetFile, content, 'utf8'); } - /** - * Generates a file. - * - * @private - * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source. - * @param {String} fileName Name of the file to generate for each channel. - * @param {String} baseDir Base directory of the given file name. - * @return {Promise} - */ - async generateFile(asyncapiDocument, fileName, baseDir) { - const sourceFile = path.resolve(baseDir, fileName); - const relativeSourceFile = path.relative(this.templateContentDir, sourceFile); - const targetFile = path.resolve(this.targetDir, this.maybeRenameSourceFile(relativeSourceFile)); - const relativeTargetFile = path.relative(this.targetDir, targetFile); + return false; +} - if (shouldIgnoreFile(relativeSourceFile)) return; +// [33] s-white ::= s-space | s-tab +function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; +} - const shouldOverwriteFile = await this.shouldOverwriteFile(relativeTargetFile); - if (!shouldOverwriteFile) return; +// Returns true if the character can be printed without escaping. +// From YAML 1.2: "any allowed characters known to be non-printable +// should also be escaped. [However,] This isn’t mandatory" +// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. +function isPrintable(c) { + return (0x00020 <= c && c <= 0x00007E) + || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM) + || (0x10000 <= c && c <= 0x10FFFF); +} - if (this.templateConfig.conditionalFiles && this.templateConfig.conditionalFiles[relativeSourceFile]) { - const server = this.templateParams.server && asyncapiDocument.server(this.templateParams.server); - const source = jmespath.search({ - ...asyncapiDocument.json(), - ...{ - server: server ? server.json() : undefined, - }, - }, this.templateConfig.conditionalFiles[relativeSourceFile].subject); +// [34] ns-char ::= nb-char - s-white +// [27] nb-char ::= c-printable - b-char - c-byte-order-mark +// [26] b-char ::= b-line-feed | b-carriage-return +// Including s-white (for some reason, examples doesn't match specs in this aspect) +// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark +function isNsCharOrWhitespace(c) { + return isPrintable(c) + && c !== CHAR_BOM + // - b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} - if (!source) return log.debug(`${relativeSourceFile} was not generated because ${this.templateConfig.conditionalFiles[relativeSourceFile].subject} specified in template configuration in conditionalFiles was not found in provided AsyncAPI specification file`); +// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out +// c = flow-in ⇒ ns-plain-safe-in +// c = block-key ⇒ ns-plain-safe-out +// c = flow-key ⇒ ns-plain-safe-in +// [128] ns-plain-safe-out ::= ns-char +// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator +// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” ) +// | ( /* An ns-char preceding */ “#” ) +// | ( “:” /* Followed by an ns-plain-safe(c) */ ) +function isPlainSafe(c, prev, inblock) { + var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c); + var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c); + return ( + // ns-plain-safe + inblock ? // c = flow-in + cIsNsCharOrWhitespace + : cIsNsCharOrWhitespace + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + ) + // ns-plain-char + && c !== CHAR_SHARP // false on '#' + && !(prev === CHAR_COLON && !cIsNsChar) // false on ': ' + || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#' + || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]' +} - if (source) { - const validate = this.templateConfig.conditionalFiles[relativeSourceFile].validate; - const valid = validate(source); - if (!valid) return log.debug(`${relativeSourceFile} was not generated because condition specified for this file in template configuration in conditionalFiles matched`); - } - } - if (this.isNonRenderableFile(relativeSourceFile)) return await copyFile(sourceFile, targetFile); +// Simplified test for values allowed as the first character in plain style. +function isPlainSafeFirst(c) { + // Uses a subset of ns-char - c-indicator + // where ns-char = nb-char - s-white. + // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part + return isPrintable(c) && c !== CHAR_BOM + && !isWhitespace(c) // - s-white + // - (c-indicator ::= + // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” + && c !== CHAR_MINUS + && c !== CHAR_QUESTION + && c !== CHAR_COLON + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” + && c !== CHAR_SHARP + && c !== CHAR_AMPERSAND + && c !== CHAR_ASTERISK + && c !== CHAR_EXCLAMATION + && c !== CHAR_VERTICAL_LINE + && c !== CHAR_EQUALS + && c !== CHAR_GREATER_THAN + && c !== CHAR_SINGLE_QUOTE + && c !== CHAR_DOUBLE_QUOTE + // | “%” | “@” | “`”) + && c !== CHAR_PERCENT + && c !== CHAR_COMMERCIAL_AT + && c !== CHAR_GRAVE_ACCENT; +} - const parsedContent = await this.renderFile(asyncapiDocument, sourceFile); - const stats = fs.statSync(sourceFile); - await writeFile(targetFile, parsedContent, { encoding: 'utf8', mode: stats.mode }); - } +// Simplified test for values allowed as the last character in plain style. +function isPlainSafeLast(c) { + // just not whitespace or colon, it will be checked to be plain character later + return !isWhitespace(c) && c !== CHAR_COLON; +} - /** - * It may rename the source file name in cases where special names are not supported, like .gitignore or .npmignore. - * - * Since we're using npm to install templates, these files are never downloaded (that's npm behavior we can't change). - * @private - * @param {String} sourceFile Path to the source file - * @returns {String} New path name - */ - maybeRenameSourceFile(sourceFile) { - switch (path.basename(sourceFile)) { - case GIT_IGNORE_FILENAME: - return path.join(path.dirname(sourceFile), '.gitignore'); - case NPM_IGNORE_FILENAME: - return path.join(path.dirname(sourceFile), '.npmignore'); - default: - return sourceFile; +// Same as 'string'.codePointAt(pos), but works in older browsers. +function codePointAt(string, pos) { + var first = string.charCodeAt(pos), second; + if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) { + second = string.charCodeAt(pos + 1); + if (second >= 0xDC00 && second <= 0xDFFF) { + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; } } + return first; +} - /** - * Renders a template string and outputs it. - * - * @private - * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to pass to the template. - * @param {String} templateString String containing the template. - * @param {String} filePath Path to the file being rendered. - * @param {Object} [extraTemplateData] Extra data to pass to the template. - * @return {Promise} - */ - renderString(asyncapiDocument, templateString, filePath, extraTemplateData = {}) { - return new Promise((resolve, reject) => { - this.nunjucks.renderString(templateString, { - asyncapi: asyncapiDocument, - params: this.templateParams, - originalAsyncAPI: this.originalAsyncAPI, - ...extraTemplateData - }, { path: filePath }, (err, result) => { - if (err) return reject(err); - resolve(result); - }); - }); - } - - /** - * Renders the content of a file and outputs it. - * - * @private - * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to pass to the template. - * @param {String} filePath Path to the file you want to render. - * @param {Object} [extraTemplateData] Extra data to pass to the template. - * @return {Promise} - */ - async renderFile(asyncapiDocument, filePath, extraTemplateData = {}) { - const content = await readFile(filePath, 'utf8'); - return this.renderString(asyncapiDocument, content, filePath, extraTemplateData); - } +// Determines whether block indentation indicator is required. +function needIndentIndicator(string) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string); +} - /** - * Checks if a given file name matches the list of non-renderable files. - * - * @private - * @param {string} fileName Name of the file to check against a list of glob patterns. - * @return {boolean} - */ - isNonRenderableFile(fileName) { - if (!Array.isArray(this.templateConfig.nonRenderableFiles)) return false; +var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; - return this.templateConfig.nonRenderableFiles.some(globExp => minimatch(fileName, globExp)); - } +// Determines which scalar styles are possible and returns the preferred style. +// lineWidth = -1 => no limit. +// Pre-conditions: str.length > 0. +// Post-conditions: +// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. +// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). +// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). +function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, + testAmbiguousType, quotingType, forceQuotes, inblock) { - /** - * Checks if a given file should be overwritten. - * - * @private - * @param {string} filePath Path to the file to check against a list of glob patterns. - * @return {boolean} - */ - async shouldOverwriteFile(filePath) { - if (!Array.isArray(this.noOverwriteGlobs)) return true; - const fileExists = await exists(path.resolve(this.targetDir, filePath)); - if (!fileExists) return true; + var i; + var char = 0; + var prevChar = null; + var hasLineBreak = false; + var hasFoldableLine = false; // only checked if shouldTrackWidth + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; // count the first line correctly + var plain = isPlainSafeFirst(codePointAt(string, 0)) + && isPlainSafeLast(codePointAt(string, string.length - 1)); - return !this.noOverwriteGlobs.some(globExp => minimatch(filePath, globExp)); + if (singleLineOnly || forceQuotes) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + // Check if any line can be folded. + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || + // Foldable line = too long, and not more-indented. + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' '); + previousLineBreak = i; + } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + // in case the end is missing a \n + hasFoldableLine = hasFoldableLine || (shouldTrackWidth && + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' ')); } - - /** - * Configures Nunjucks templating system - * @private - */ - configNunjucks() { - const config = {}; - if (this.debug) config.dev = true; - - this.nunjucks = new Nunjucks.Environment(new Nunjucks.FileSystemLoader(this.templateDir), config); + // Although every style can represent \n without escaping, prefer block styles + // for multiline, since they're more readable and they don't add empty lines. + // Also prefer folding a super-long line. + if (!hasLineBreak && !hasFoldableLine) { + // Strings interpretable as another type have to be quoted; + // e.g. the string 'true' vs. the boolean true. + if (plain && !forceQuotes && !testAmbiguousType(string)) { + return STYLE_PLAIN; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; + } + // Edge case: block indentation indicator can only have one digit. + if (indentPerLevel > 9 && needIndentIndicator(string)) { + return STYLE_DOUBLE; + } + // At this point we know block styles are valid. + // Prefer literal style unless we want to fold. + if (!forceQuotes) { + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; +} - /** - * Loads the template configuration. - * @private - */ - async loadTemplateConfig() { - try { - const configPath = path.resolve(this.templateDir, CONFIG_FILENAME); - if (!fs.existsSync(configPath)) { - this.templateConfig = {}; - return; +// Note: line breaking/folding is implemented for only the folded style. +// NB. We drop the last trailing newline (if any) of a returned block scalar +// since the dumper adds its own newline. This always works: +// • No ending newline => unaffected; already using strip "-" chomping. +// • Ending newline => removed then restored. +// Importantly, this keeps the "+" chomp indicator from gaining an extra line. +function writeScalar(state, string, level, iskey, inblock) { + state.dump = (function () { + if (string.length === 0) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; + } + if (!state.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'"); } + } - const json = await readFile(configPath, { encoding: 'utf8' }); - const generatorProp = JSON.parse(json).generator; - this.templateConfig = generatorProp || {}; - } catch (e) { - this.templateConfig = {}; + var indent = state.indent * Math.max(1, level); // no 0-indent scalars + // As indentation gets deeper, let the width decrease monotonically + // to the lower bound min(state.lineWidth, 40). + // Note that this implies + // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. + // state.lineWidth > 40 + state.indent: width decreases until the lower bound. + // This behaves better than a constant minimum width which disallows narrower options, + // or an indent threshold which causes the width to suddenly increase. + var lineWidth = state.lineWidth === -1 + ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + + // Without knowing if keys are implicit/explicit, assume implicit for safety. + var singleLineOnly = iskey + // No block styles in flow mode. + || (state.flowLevel > -1 && level >= state.flowLevel); + function testAmbiguity(string) { + return testImplicitResolving(state, string); } - await this.loadDefaultValues(); - } - /** - * Loads default values of parameters from template config. If value was already set as parameter it will not be - * overriden. - * @private - */ - async loadDefaultValues() { - const parameters = this.templateConfig.parameters; - const defaultValues = Object.keys(parameters || {}).filter(key => parameters[key].default); + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, + testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) { - defaultValues.filter(dv => this.templateParams[dv] === undefined).forEach(dv => - Object.defineProperty(this.templateParams, dv, { - enumerable: true, - get() { - return parameters[dv].default; - } - }) - ); - } + case STYLE_PLAIN: + return string; + case STYLE_SINGLE: + return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return '|' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: + return '>' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string, lineWidth) + '"'; + default: + throw new YAMLException('impossible error: invalid scalar style'); + } + }()); +} - /** - * Launches all the hooks registered at a given hook point/name. - * - * @param {string} hookName - * @param {*} hookArguments - * @private - */ - async launchHook(hookName, hookArguments) { - let disabledHooks = this.disabledHooks[hookName] || []; - if (disabledHooks === true) return; - if (typeof disabledHooks === 'string') disabledHooks = [disabledHooks]; +// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. +function blockHeader(string, indentPerLevel) { + var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; - const hooks = this.hooks[hookName]; - if (!Array.isArray(hooks)) return; - const promises = hooks.map(async (hook) => { - if (typeof hook !== 'function') return; - if (disabledHooks.includes(hook.name)) return; - return await hook(this, hookArguments); - }).filter(Boolean); + // note the special case: the string '\n' counts as a "trailing" empty line. + var clip = string[string.length - 1] === '\n'; + var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); + var chomp = keep ? '+' : (clip ? '' : '-'); - return Promise.all(promises); - } + return indentIndicator + chomp + '\n'; +} - /** - * Check if any hooks are available - * - * @param {string} hookName - * @private - */ - isHookAvailable(hookName) { - const hooks = this.hooks[hookName]; +// (See the note for writeScalar.) +function dropEndingNewline(string) { + return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; +} - if (this.disabledHooks[hookName] === true - || !Array.isArray(hooks) - || hooks.length === 0) return false; +// Note: a long line without a suitable break point will exceed the width limit. +// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. +function foldString(string, width) { + // In folded style, $k$ consecutive newlines output as $k+1$ newlines— + // unless they're before or after a more-indented line, or at the very + // beginning or end, in which case $k$ maps to $k$. + // Therefore, parse each chunk as newline(s) followed by a content line. + var lineRe = /(\n+)([^\n]*)/g; - let disabledHooks = this.disabledHooks[hookName] || []; - if (typeof disabledHooks === 'string') disabledHooks = [disabledHooks]; + // first line (possibly an empty line) + var result = (function () { + var nextLF = string.indexOf('\n'); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }()); + // If we haven't reached the first content line yet, don't add an extra \n. + var prevMoreIndented = string[0] === '\n' || string[0] === ' '; + var moreIndented; - return !!hooks.filter(h => !disabledHooks.includes(h.name)).length; + // rest of the lines + var match; + while ((match = lineRe.exec(string))) { + var prefix = match[1], line = match[2]; + moreIndented = (line[0] === ' '); + result += prefix + + (!prevMoreIndented && !moreIndented && line !== '' + ? '\n' : '') + + foldLine(line, width); + prevMoreIndented = moreIndented; } - /** - * Check if given directory is a git repo with unstaged changes and is not in .gitignore or is not empty - * @private - * @param {String} dir Directory that needs to be tested for a given condition. - */ - async verifyTargetDir(dir) { - const isGitRepo = await git(dir).checkIsRepo(); + return result; +} - if (isGitRepo) { - //Need to figure out root of the repository to properly verify .gitignore - const root = await git(dir).revparse(['--show-toplevel']); - const gitInfo = git(root); +// Greedy line breaking. +// Picks the longest line under the limit each time, +// otherwise settles for the shortest line over the limit. +// NB. More-indented lines *cannot* be folded, as that would add an extra \n. +function foldLine(line, width) { + if (line === '' || line[0] === ' ') return line; - //Skipping verification if workDir inside repo is declared in .gitignore - const workDir = path.relative(root, dir); - if (workDir) { - const checkGitIgnore = await gitInfo.checkIgnore(workDir); - if (checkGitIgnore.length !== 0) return; - } + // Since a more-indented line adds a \n, breaks can't be followed by a space. + var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. + var match; + // start is an inclusive index. end, curr, and next are exclusive. + var start = 0, end, curr = 0, next = 0; + var result = ''; - const gitStatus = await gitInfo.status(); - //New files are not tracked and not visible as modified - const hasUntrackedUnstagedFiles = gitStatus.not_added.length !== 0; + // Invariants: 0 <= start <= length-1. + // 0 <= curr <= next <= max(0, length-2). curr - start <= width. + // Inside the loop: + // A match implies length >= 2, so curr and next are <= length-2. + while ((match = breakRe.exec(line))) { + next = match.index; + // maintain invariant: curr - start <= width + if (next - start > width) { + end = (curr > start) ? curr : next; // derive end <= length-2 + result += '\n' + line.slice(start, end); + // skip the space that was output as \n + start = end + 1; // derive start <= length-1 + } + curr = next; + } - const stagedFiles = gitStatus.staged; - const modifiedFiles = gitStatus.modified; - const hasModifiedUstagedFiles = (modifiedFiles.filter(e => stagedFiles.indexOf(e) === -1)).length !== 0; + // By the invariants, start <= length-1, so there is something left over. + // It is either the whole string or a part starting from non-whitespace. + result += '\n'; + // Insert a break if the remainder is too long and there is a break available. + if (line.length - start > width && curr > start) { + result += line.slice(start, curr) + '\n' + line.slice(curr + 1); + } else { + result += line.slice(start); + } - if (hasModifiedUstagedFiles || hasUntrackedUnstagedFiles) throw new Error(`"${this.targetDir}" is in a git repository with unstaged changes. Please commit your changes before proceeding or add proper directory to .gitignore file. You can also use the --force-write flag to skip this rule (not recommended).`); - } else { - const isDirEmpty = (await readDir(dir)).length === 0; + return result.slice(1); // drop extra \n joiner +} - if (!isDirEmpty) throw new Error(`"${this.targetDir}" is not an empty directory. You might override your work. To skip this rule, please make your code a git repository or use the --force-write flag (not recommended).`); +// Escapes a double-quoted string. +function escapeString(string) { + var result = ''; + var char = 0; + var escapeSeq; + + for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + escapeSeq = ESCAPE_SEQUENCES[char]; + + if (!escapeSeq && isPrintable(char)) { + result += string[i]; + if (char >= 0x10000) result += string[i + 1]; + } else { + result += escapeSeq || encodeHex(char); } } -} -Generator.DEFAULT_TEMPLATES_DIR = DEFAULT_TEMPLATES_DIR; + return result; +} -module.exports = Generator; +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length, + value; + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; -/***/ }), + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } -/***/ 27014: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level, value, false, false) || + (typeof value === 'undefined' && + writeNode(state, level, null, false, false))) { -const path = __webpack_require__(85622); -const xfs = __webpack_require__(52088); -const { isLocalTemplate, exists } = __webpack_require__(65015); + if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : ''); + _result += state.dump; + } + } -/** - * Registers all template hooks. - * @param {Object} hooks Object that stores information about all available hook functions grouped by the type of the hook. - * @param {Object} templateConfig Template configuration. - * @param {String} templateDir Directory where template is located. - * @param {String} hooksDir Directory where local hooks are located. - */ -module.exports.registerHooks = async (hooks, templateConfig, templateDir, hooksDir) => { - await registerLocalHooks(hooks, templateDir, hooksDir); + state.tag = _tag; + state.dump = '[' + _result + ']'; +} - if (templateConfig && Object.keys(templateConfig).length > 0) await registerConfigHooks(hooks, templateDir, templateConfig); - - return hooks; -}; +function writeBlockSequence(state, level, object, compact) { + var _result = '', + _tag = state.tag, + index, + length, + value; -/** - * Loads the local template hooks from default location. - * @private - * @param {Object} hooks Object that stores information about all available hook functions grouped by the type of the hook. - * @param {String} templateDir Directory where template is located. - * @param {String} hooksDir Directory where local hooks are located. - */ -async function registerLocalHooks(hooks, templateDir, hooksDir) { - return new Promise(async (resolve, reject) => { - const localHooks = path.resolve(templateDir, hooksDir); + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; - if (!await exists(localHooks)) return resolve(hooks); + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } - const walker = xfs.walk(localHooks, { - followLinks: false - }); - - walker.on('file', async (root, stats, next) => { - try { - const filePath = path.resolve(templateDir, path.resolve(root, stats.name)); - delete require.cache[require.resolve(filePath)]; - const mod = require(filePath); + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level + 1, value, true, true, false, true) || + (typeof value === 'undefined' && + writeNode(state, level + 1, null, true, true, false, true))) { - addHook(hooks, mod); + if (!compact || _result !== '') { + _result += generateNextLine(state, level); + } - next(); - } catch (e) { - reject(e); + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + _result += '-'; + } else { + _result += '- '; } - }); - walker.on('errors', (root, nodeStatsArray) => { - reject(nodeStatsArray); - }); + _result += state.dump; + } + } - walker.on('end', async () => { - resolve(hooks); - }); - }); + state.tag = _tag; + state.dump = _result || '[]'; // Empty sequence if no valid values. } -/** - * Loads the template hooks provided in template config. - * @private - * - * @param {Object} hooks Object that stores information about all available hook functions grouped by the type of the hook. - * @param {String} templateDir Directory where template is located. - * @param {String} templateConfig Template configuration. - */ -async function registerConfigHooks(hooks, templateDir, templateConfig) { - const configHooks = templateConfig.hooks; - const DEFAULT_MODULES_DIR = 'node_modules'; +function writeFlowMapping(state, level, object) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + pairBuffer; - if (typeof configHooks !== 'object' || !Object.keys(configHooks).length > 0) return; + for (index = 0, length = objectKeyList.length; index < length; index += 1) { - const promises = Object.keys(configHooks).map(async hooksModuleName => { - const modulePath = await isLocalTemplate(templateDir) ? path.resolve(templateDir, DEFAULT_MODULES_DIR, hooksModuleName) : hooksModuleName; - const mod = require(modulePath); - const configHooksArray = [].concat(configHooks[hooksModuleName]); + pairBuffer = ''; + if (_result !== '') pairBuffer += ', '; - addHook(hooks, mod, configHooksArray); - }); - await Promise.all(promises); - return hooks; -} + if (state.condenseFlow) pairBuffer += '"'; -/** - * Add hook from given module to list of available hooks - * @private - * @param {Object} hooks Object that stores information about all available hook functions grouped by the type of the hook. - * @param {Object} mod Single module with object of hook functions grouped by the type of the hook - * @param {Array} config List of hooks configured in template configuration - */ -function addHook(hooks, mod, config) { - Object.keys(mod).forEach(hookType => { - const moduleHooksArray = [].concat(mod[hookType]); + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; - moduleHooksArray.forEach(hook => { - if (config && !config.includes(hook.name)) return; + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } - hooks[hookType] = hooks[hookType] || []; - hooks[hookType].push(hook); - }); - }); - return hooks; -} + if (!writeNode(state, level, objectKey, false, false)) { + continue; // Skip this pair because of invalid key; + } + if (state.dump.length > 1024) pairBuffer += '? '; -/***/ }), + pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); -/***/ 45881: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (!writeNode(state, level, objectValue, false, false)) { + continue; // Skip this pair because of invalid value. + } -const semver = __webpack_require__(57489); -const Ajv = __webpack_require__(64941); -const { getGeneratorVersion } = __webpack_require__(65015); -const levenshtein = __webpack_require__(30592); + pairBuffer += state.dump; -const ajv = new Ajv({ allErrors: true }); + // Both key and value are valid. + _result += pairBuffer; + } -/** - * Validates the template configuration. - * - * @param {Object} templateConfig Template configuration. - * @param {Object} templateParams Params specified when running generator. - * @param {AsyncAPIDocument} asyncapiDocument AsyncAPIDocument object to use as source. - * @return {Boolean} - */ -module.exports.validateTemplateConfig = (templateConfig, templateParams, asyncapiDocument) => { - const { parameters, supportedProtocols, conditionalFiles, generator } = templateConfig; - - validateConditionalFiles(conditionalFiles); - isTemplateCompatible(generator); + state.tag = _tag; + state.dump = '{' + _result + '}'; +} - isRequiredParamProvided(parameters, templateParams); +function writeBlockMapping(state, level, object, compact) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + explicitPair, + pairBuffer; - if (asyncapiDocument) { - const server = asyncapiDocument.server(templateParams.server); - isServerProvidedInDocument(server, templateParams.server); - isServerProtocolSupported(server, supportedProtocols, templateParams.server); + // Allow sorting keys so that the output file is deterministic + if (state.sortKeys === true) { + // Default sorting + objectKeyList.sort(); + } else if (typeof state.sortKeys === 'function') { + // Custom sort function + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + // Something is wrong + throw new YAMLException('sortKeys must be a boolean or a function'); } - isProvidedParameterSupported(parameters, templateParams); + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; - return true; -}; + if (!compact || _result !== '') { + pairBuffer += generateNextLine(state, level); + } -/** - * Checks if template is compatible with the version of the generator that is used - * @private - * @param {String} generator Information about supported generator version that is part of the template configuration - */ -function isTemplateCompatible(generator) { - const generatorVersion = getGeneratorVersion(); - if (typeof generator === 'string' && !semver.satisfies(generatorVersion, generator, {includePrerelease: true})) { - throw new Error(`This template is not compatible with the current version of the generator (${generatorVersion}). This template is compatible with the following version range: ${generator}.`); - } -} + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; -/** - * Checks if parameters described in template configuration as required are passed to the generator - * @private - * @param {Object} configParams Parameters specified in template configuration - * @param {Object} templateParams All parameters provided to generator - */ -function isRequiredParamProvided(configParams, templateParams) { - const missingParams = Object.keys(configParams || {}) - .filter(key => configParams[key].required && !templateParams[key]); - - if (missingParams.length) { - throw new Error(`This template requires the following missing params: ${missingParams}.`); - } -} + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } -/** - * Provides a hint for a user about correct parameter name. - * @private - * @param {Object} wrongParam Incorrectly written parameter - * @param {Object} configParams Parameters specified in template configuration - */ -function getParamSuggestion(wrongParam, configParams) { - const sortInt = (a, b) => { - return a[0] - b[0]; - }; - const arr = Object.keys(configParams).map(param => [levenshtein(wrongParam, param), param]); + if (!writeNode(state, level + 1, objectKey, true, true, true)) { + continue; // Skip this pair because of invalid key. + } - return arr.sort(sortInt)[0][1]; -} + explicitPair = (state.tag !== null && state.tag !== '?') || + (state.dump && state.dump.length > 1024); -/** - * Checks if parameters provided to generator is supported by the template - * @private - * @param {Object} configParams Parameters specified in template configuration - * @param {Object} templateParams All parameters provided to generator - */ -function isProvidedParameterSupported(configParams, templateParams) { - const wrongParams = Object.keys(templateParams || {}).filter(key => !configParams || !configParams[key]); - - if (!wrongParams.length) return; - if (!configParams) throw new Error('This template doesn\'t have any params.'); + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += '?'; + } else { + pairBuffer += '? '; + } + } - let suggestionsString = ''; - - wrongParams.forEach(wp => { - suggestionsString += `\nDid you mean "${getParamSuggestion(wp,configParams)}" instead of "${wp}"?`; - }); + pairBuffer += state.dump; - throw new Error(`This template doesn't have the following params: ${wrongParams}.${suggestionsString}`); -} - -/** - * Checks if given AsyncAPI document has servers with protocol that is supported by the template - * @private - * @param {Object} server Server object from AsyncAPI file - * @param {String[]} supportedProtocols Supported protocols specified in template configuration - * @param {String} paramsServerName Name of the server specified as a param for the generator - */ -function isServerProtocolSupported(server, supportedProtocols, paramsServerName) { - if (server && Array.isArray(supportedProtocols) && !supportedProtocols.includes(server.protocol())) { - throw new Error(`Server "${paramsServerName}" uses the ${server.protocol()} protocol but this template only supports the following ones: ${supportedProtocols}.`); - } -} + if (explicitPair) { + pairBuffer += generateNextLine(state, level); + } -/** - * Checks if given AsyncAPI document has servers with protocol that is supported by the template - * @private - * @param {Object} server Server object from AsyncAPI file - * @param {String} paramsServerName Name of the server specified as a param for the generator - */ -function isServerProvidedInDocument(server, paramsServerName) { - if (typeof paramsServerName === 'string' && !server) throw new Error(`Couldn't find server with name ${paramsServerName}.`); -} + if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { + continue; // Skip this pair because of invalid value. + } -/** - * Checks if conditional files are specified properly in the template - * @private - * @param {Object} conditionalFiles conditions specified in the template config - */ -function validateConditionalFiles(conditionalFiles) { - if (typeof conditionalFiles === 'object') { - const fileNames = Object.keys(conditionalFiles); - - fileNames.forEach(fileName => { - const def = conditionalFiles[fileName]; - if (typeof def.subject !== 'string') throw new Error(`Invalid conditional file subject for ${fileName}: ${def.subject}.`); - if (typeof def.validation !== 'object') throw new Error(`Invalid conditional file validation object for ${fileName}: ${def.validation}.`); - conditionalFiles[fileName].validate = ajv.compile(conditionalFiles[fileName].validation); - }); + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += ':'; + } else { + pairBuffer += ': '; + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; } + + state.tag = _tag; + state.dump = _result || '{}'; // Empty mapping if no valid pairs. } -/***/ }), +function detectType(state, object, explicit) { + var _result, typeList, index, length, type, style; -/***/ 65015: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + typeList = explicit ? state.explicitTypes : state.implicitTypes; -const fs = __webpack_require__(35747); -const util = __webpack_require__(31669); -const path = __webpack_require__(85622); -const fetch = __webpack_require__(80467); -const url = __webpack_require__(78835); -const packageJson = __webpack_require__(94532); + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; -const utils = module.exports; + if ((type.instanceOf || type.predicate) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && + (!type.predicate || type.predicate(object))) { -utils.lstat = util.promisify(fs.lstat); -utils.readlink = util.promisify(fs.readlink); -utils.readFile = util.promisify(fs.readFile); -utils.writeFile = util.promisify(fs.writeFile); -utils.copyFile = util.promisify(fs.copyFile); -utils.exists = util.promisify(fs.exists); -utils.readDir = util.promisify(fs.readdir); + if (explicit) { + if (type.multi && type.representName) { + state.tag = type.representName(object); + } else { + state.tag = type.tag; + } + } else { + state.tag = '?'; + } -/** - * Checks if a string is a filesystem path. - * @private - * @param {String} string The string to check. - * @returns {Boolean} Whether the string is a filesystem path or not. - */ -utils.isFileSystemPath = (string) => { - return path.isAbsolute(string) - || string.startsWith(`.${path.sep}`) - || string.startsWith(`..${path.sep}`) - || string.startsWith('~'); -}; + if (type.represent) { + style = state.styleMap[type.tag] || type.defaultStyle; -/** - * Takes the result of calling the npmi module and returns it in a more consumable form. - * @private - * @param {Array} result The result of calling npmi. - * @returns {Object} - */ -utils.beautifyNpmiResult = (result) => { - const [nameWithVersion, pkgPath] = result[result.length-1]; - const nameWithVersionArray = nameWithVersion.split('@'); - const version = nameWithVersionArray[nameWithVersionArray.length - 1]; - const name = nameWithVersionArray.splice(0, nameWithVersionArray.length - 1).join('@'); + if (_toString.call(type.represent) === '[object Function]') { + _result = type.represent(object, style); + } else if (_hasOwnProperty.call(type.represent, style)) { + _result = type.represent[style](object, style); + } else { + throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); + } - return { - name, - path: pkgPath, - version, - }; -}; + state.dump = _result; + } -/** - * Converts a Map into an object. - * @private - * @param {Map} map The map to transform. - * @returns {Object} - */ -utils.convertMapToObject = (map) => { - const tempObject = {}; - for (const [key, value] of map.entries()) { - tempObject[key] = value; + return true; + } } - return tempObject; -}; - -/** - * Checks if template is local or not (i.e., it's remote). - * @private - * @param {String} templatePath The path to the template. - * @returns {Promise} - */ -utils.isLocalTemplate = async (templatePath) => { - const stats = await utils.lstat(templatePath); - return stats.isSymbolicLink(); -}; - -/** - * Gets the details (link and resolved link) of a local template. - * @private - * @param {String} templatePath The path to the template. - * @returns {Promise} - */ -utils.getLocalTemplateDetails = async (templatePath) => { - const linkTarget = await utils.readlink(templatePath); - return { - link: linkTarget, - resolvedLink: path.resolve(path.dirname(templatePath), linkTarget), - }; -}; -/** - * Fetches an AsyncAPI document from the given URL and return its content as string - * - * @param {String} link URL where the AsyncAPI document is located. - * @returns Promise} Content of fetched file. - */ -utils.fetchSpec = (link) => { - return new Promise((resolve, reject) => { - fetch(link) - .then(res => resolve(res.text())) - .catch(reject); - }); -}; + return false; +} -/** - * Checks if given string is URL and if not, we assume it is file path - * - * @param {String} str Information representing file path or url - * @returns {Boolean} - */ -utils.isFilePath = (str) => { - return !url.parse(str).hostname; -}; +// Serializes `object` and writes it to global `result`. +// Returns true on success, or false on invalid object. +// +function writeNode(state, level, object, block, compact, iskey, isblockseq) { + state.tag = null; + state.dump = object; -/** - * Get version of the generator - * - * @returns {String} - */ -utils.getGeneratorVersion = () => { - return packageJson.version; -}; + if (!detectType(state, object, false)) { + detectType(state, object, true); + } -/** - * Filters out the Generator invalid options given - * - * @param {Array} - * @returns {Array} - */ -utils.getInvalidOptions = (generatorOptions, options) => { - if (typeof options !== 'object') return []; - return Object.keys(options).filter(param => !generatorOptions.includes(param)); -}; + var type = _toString.call(state.dump); + var inblock = block; + var tagStr; + if (block) { + block = (state.flowLevel < 0 || state.flowLevel > level); + } -/***/ }), + var objectOrArray = type === '[object Object]' || type === '[object Array]', + duplicateIndex, + duplicate; -/***/ 2400: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } -const ANY = Symbol('SemVer ANY') -// hoisted class for cyclic dependency -class Comparator { - static get ANY () { - return ANY + if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { + compact = false; } - constructor (comp, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false + + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = '*ref_' + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type === '[object Object]') { + if (block && (Object.keys(state.dump).length !== 0)) { + writeBlockMapping(state, level, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowMapping(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object Array]') { + if (block && (state.dump.length !== 0)) { + if (state.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence(state, level - 1, state.dump, compact); + } else { + writeBlockSequence(state, level, state.dump, compact); + } + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey, inblock); } + } else if (type === '[object Undefined]') { + return false; + } else { + if (state.skipInvalid) return false; + throw new YAMLException('unacceptable kind of an object to dump ' + type); } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp + if (state.tag !== null && state.tag !== '?') { + // Need to encode all characters except those allowed by the spec: + // + // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */ + // [36] ns-hex-digit ::= ns-dec-digit + // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */ + // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */ + // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-” + // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#” + // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,” + // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]” + // + // Also need to encode '!' because it has special meaning (end of tag prefix). + // + tagStr = encodeURI( + state.tag[0] === '!' ? state.tag.slice(1) : state.tag + ).replace(/!/g, '%21'); + + if (state.tag[0] === '!') { + tagStr = '!' + tagStr; + } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') { + tagStr = '!!' + tagStr.slice(18); } else { - comp = comp.value + tagStr = '!<' + tagStr + '>'; } + + state.dump = tagStr + ' ' + state.dump; } + } - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) + return true; +} - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version - } +function getDuplicateReferences(object, state) { + var objects = [], + duplicatesIndexes = [], + index, + length; - debug('comp', this) + inspectNode(object, objects, duplicatesIndexes); + + for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { + state.duplicates.push(objects[duplicatesIndexes[index]]); } + state.usedDuplicates = new Array(length); +} - parse (comp) { - const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - const m = comp.match(r) +function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, + index, + length; - if (!m) { - throw new TypeError(`Invalid comparator: ${comp}`) - } + if (object !== null && typeof object === 'object') { + index = objects.indexOf(object); + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { + duplicatesIndexes.push(index); + } + } else { + objects.push(object); - this.operator = m[1] !== undefined ? m[1] : '' - if (this.operator === '=') { - this.operator = '' - } + if (Array.isArray(object)) { + for (index = 0, length = object.length; index < length; index += 1) { + inspectNode(object[index], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY - } else { - this.semver = new SemVer(m[2], this.options.loose) + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); + } + } } } +} - toString () { - return this.value - } +function dump(input, options) { + options = options || {}; - test (version) { - debug('Comparator.test', version, this.options.loose) + var state = new State(options); - if (this.semver === ANY || version === ANY) { - return true - } + if (!state.noRefs) getDuplicateReferences(input, state); - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } + var value = input; - return cmp(version, this.operator, this.semver, this.options) + if (state.replacer) { + value = state.replacer.call({ '': value }, '', value); } - intersects (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } - - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - - if (this.operator === '') { - if (this.value === '') { - return true - } - return new Range(comp.value, options).test(this.value) - } else if (comp.operator === '') { - if (comp.value === '') { - return true - } - return new Range(this.value, options).test(comp.semver) - } - - const sameDirectionIncreasing = - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>') - const sameDirectionDecreasing = - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<') - const sameSemVer = this.semver.version === comp.semver.version - const differentDirectionsInclusive = - (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<=') - const oppositeDirectionsLessThan = - cmp(this.semver, '<', comp.semver, options) && - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<') - const oppositeDirectionsGreaterThan = - cmp(this.semver, '>', comp.semver, options) && - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>') + if (writeNode(state, 0, value, true, true)) return state.dump + '\n'; - return ( - sameDirectionIncreasing || - sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || - oppositeDirectionsGreaterThan - ) - } + return ''; } -module.exports = Comparator - -const {re, t} = __webpack_require__(97559) -const cmp = __webpack_require__(27323) -const debug = __webpack_require__(4709) -const SemVer = __webpack_require__(2975) -const Range = __webpack_require__(17151) +module.exports.dump = dump; /***/ }), -/***/ 17151: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -// hoisted class for cyclic dependency -class Range { - constructor (range, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - - if (range instanceof Range) { - if ( - range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease - ) { - return range - } else { - return new Range(range.raw, options) - } - } - - if (range instanceof Comparator) { - // just put it in the set and return - this.raw = range.value - this.set = [[range]] - this.format() - return this - } +/***/ 7987: +/***/ ((module) => { - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease +"use strict"; +// YAML error class. http://stackoverflow.com/questions/8458984 +// - // First, split based on boolean or || - this.raw = range - this.set = range - .split(/\s*\|\|\s*/) - // map the range to a 2d array of comparators - .map(range => this.parseRange(range.trim())) - // throw out any comparator lists that are empty - // this generally means that it was not a valid range, which is allowed - // in loose mode, but will still throw if the WHOLE range is invalid. - .filter(c => c.length) - if (!this.set.length) { - throw new TypeError(`Invalid SemVer Range: ${range}`) - } - this.format() - } +function formatError(exception, compact) { + var where = '', message = exception.reason || '(unknown reason)'; - format () { - this.range = this.set - .map((comps) => { - return comps.join(' ').trim() - }) - .join('||') - .trim() - return this.range - } + if (!exception.mark) return message; - toString () { - return this.range + if (exception.mark.name) { + where += 'in "' + exception.mark.name + '" '; } - parseRange (range) { - const loose = this.options.loose - range = range.trim() - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] - range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) - debug('hyphen replace', range) - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, re[t.COMPARATORTRIM]) - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) - - // normalize spaces - range = range.split(/\s+/).join(' ') - - // At this point, the range is completely trimmed and - // ready to be split into comparators. + where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')'; - const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - return range - .split(' ') - .map(comp => parseComparator(comp, this.options)) - .join(' ') - .split(/\s+/) - .map(comp => replaceGTE0(comp, this.options)) - // in loose mode, throw out any that are not valid comparators - .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) - .map(comp => new Comparator(comp, this.options)) + if (!compact && exception.mark.snippet) { + where += '\n\n' + exception.mark.snippet; } - intersects (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') - } + return message + ' ' + where; +} - return this.set.some((thisComparators) => { - return ( - isSatisfiable(thisComparators, options) && - range.set.some((rangeComparators) => { - return ( - isSatisfiable(rangeComparators, options) && - thisComparators.every((thisComparator) => { - return rangeComparators.every((rangeComparator) => { - return thisComparator.intersects(rangeComparator, options) - }) - }) - ) - }) - ) - }) - } - // if ANY of the sets match ALL of its comparators, then pass - test (version) { - if (!version) { - return false - } +function YAMLException(reason, mark) { + // Super constructor + Error.call(this); - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = formatError(this, false); - for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } - } - return false + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; } } -module.exports = Range -const Comparator = __webpack_require__(2400) -const debug = __webpack_require__(4709) -const SemVer = __webpack_require__(2975) -const { - re, - t, - comparatorTrimReplace, - tildeTrimReplace, - caretTrimReplace -} = __webpack_require__(97559) -// take a set of comparators and determine whether there -// exists a version which can satisfy it -const isSatisfiable = (comparators, options) => { - let result = true - const remainingComparators = comparators.slice() - let testComparator = remainingComparators.pop() +// Inherit from Error +YAMLException.prototype = Object.create(Error.prototype); +YAMLException.prototype.constructor = YAMLException; - while (result && remainingComparators.length) { - result = remainingComparators.every((otherComparator) => { - return testComparator.intersects(otherComparator, options) - }) - testComparator = remainingComparators.pop() - } +YAMLException.prototype.toString = function toString(compact) { + return this.name + ': ' + formatError(this, compact); +}; - return result -} -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -const parseComparator = (comp, options) => { - debug('comp', comp, options) - comp = replaceCarets(comp, options) - debug('caret', comp) - comp = replaceTildes(comp, options) - debug('tildes', comp) - comp = replaceXRanges(comp, options) - debug('xrange', comp) - comp = replaceStars(comp, options) - debug('stars', comp) - return comp -} +module.exports = YAMLException; -const isX = id => !id || id.toLowerCase() === 'x' || id === '*' -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 -const replaceTildes = (comp, options) => - comp.trim().split(/\s+/).map((comp) => { - return replaceTilde(comp, options) - }).join(' ') +/***/ }), -const replaceTilde = (comp, options) => { - const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] - return comp.replace(r, (_, M, m, p, pr) => { - debug('tilde', comp, _, M, m, p, pr) - let ret +/***/ 42432: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0 <${+M + 1}.0.0-0` - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0-0 - ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` - } else if (pr) { - debug('replaceTilde pr', pr) - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } else { - // ~1.2.3 == >=1.2.3 <1.3.0-0 - ret = `>=${M}.${m}.${p - } <${M}.${+m + 1}.0-0` - } +"use strict"; - debug('tilde return', ret) - return ret - }) -} -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 -// ^1.2.3 --> >=1.2.3 <2.0.0-0 -// ^1.2.0 --> >=1.2.0 <2.0.0-0 -const replaceCarets = (comp, options) => - comp.trim().split(/\s+/).map((comp) => { - return replaceCaret(comp, options) - }).join(' ') +/*eslint-disable max-len,no-use-before-define*/ -const replaceCaret = (comp, options) => { - debug('caret', comp, options) - const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] - const z = options.includePrerelease ? '-0' : '' - return comp.replace(r, (_, M, m, p, pr) => { - debug('caret', comp, _, M, m, p, pr) - let ret +var common = __nccwpck_require__(33198); +var YAMLException = __nccwpck_require__(7987); +var makeSnippet = __nccwpck_require__(99152); +var DEFAULT_SCHEMA = __nccwpck_require__(81448); - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` - } else if (isX(p)) { - if (M === '0') { - ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` - } else { - ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${+M + 1}.0.0-0` - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p - }${z} <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p - }${z} <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p - } <${+M + 1}.0.0-0` - } - } - debug('caret return', ret) - return ret - }) -} +var _hasOwnProperty = Object.prototype.hasOwnProperty; -const replaceXRanges = (comp, options) => { - debug('replaceXRanges', comp, options) - return comp.split(/\s+/).map((comp) => { - return replaceXRange(comp, options) - }).join(' ') -} -const replaceXRange = (comp, options) => { - comp = comp.trim() - const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] - return comp.replace(r, (ret, gtlt, M, m, p, pr) => { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - const xM = isX(M) - const xm = xM || isX(m) - const xp = xm || isX(p) - const anyX = xp +var CONTEXT_FLOW_IN = 1; +var CONTEXT_FLOW_OUT = 2; +var CONTEXT_BLOCK_IN = 3; +var CONTEXT_BLOCK_OUT = 4; - if (gtlt === '=' && anyX) { - gtlt = '' - } - // if we're including prereleases in the match, then we need - // to fix this to -0, the lowest possible prerelease value - pr = options.includePrerelease ? '-0' : '' +var CHOMPING_CLIP = 1; +var CHOMPING_STRIP = 2; +var CHOMPING_KEEP = 3; - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0-0' - } else { - // nothing is forbidden - ret = '*' - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0 - } - p = 0 - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - gtlt = '>=' - if (xm) { - M = +M + 1 - m = 0 - p = 0 - } else { - m = +m + 1 - p = 0 - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) { - M = +M + 1 - } else { - m = +m + 1 - } - } +var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; +var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; +var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; +var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; - if (gtlt === '<') - pr = '-0' - ret = `${gtlt + M}.${m}.${p}${pr}` - } else if (xm) { - ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` - } else if (xp) { - ret = `>=${M}.${m}.0${pr - } <${M}.${+m + 1}.0-0` - } +function _class(obj) { return Object.prototype.toString.call(obj); } - debug('xRange return', ret) +function is_EOL(c) { + return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); +} - return ret - }) +function is_WHITE_SPACE(c) { + return (c === 0x09/* Tab */) || (c === 0x20/* Space */); } -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -const replaceStars = (comp, options) => { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[t.STAR], '') +function is_WS_OR_EOL(c) { + return (c === 0x09/* Tab */) || + (c === 0x20/* Space */) || + (c === 0x0A/* LF */) || + (c === 0x0D/* CR */); } -const replaceGTE0 = (comp, options) => { - debug('replaceGTE0', comp, options) - return comp.trim() - .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') +function is_FLOW_INDICATOR(c) { + return c === 0x2C/* , */ || + c === 0x5B/* [ */ || + c === 0x5D/* ] */ || + c === 0x7B/* { */ || + c === 0x7D/* } */; } -// This function is passed to string.replace(re[t.HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 -const hyphenReplace = incPr => ($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) => { - if (isX(fM)) { - from = '' - } else if (isX(fm)) { - from = `>=${fM}.0.0${incPr ? '-0' : ''}` - } else if (isX(fp)) { - from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` - } else if (fpr) { - from = `>=${from}` - } else { - from = `>=${from}${incPr ? '-0' : ''}` +function fromHexCode(c) { + var lc; + + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; } - if (isX(tM)) { - to = '' - } else if (isX(tm)) { - to = `<${+tM + 1}.0.0-0` - } else if (isX(tp)) { - to = `<${tM}.${+tm + 1}.0-0` - } else if (tpr) { - to = `<=${tM}.${tm}.${tp}-${tpr}` - } else if (incPr) { - to = `<${tM}.${tm}.${+tp + 1}-0` - } else { - to = `<=${to}` + /*eslint-disable no-bitwise*/ + lc = c | 0x20; + + if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { + return lc - 0x61 + 10; } - return (`${from} ${to}`).trim() + return -1; } -const testSet = (set, version, options) => { - for (let i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false - } +function escapedHexLen(c) { + if (c === 0x78/* x */) { return 2; } + if (c === 0x75/* u */) { return 4; } + if (c === 0x55/* U */) { return 8; } + return 0; +} + +function fromDecimalCode(c) { + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; } - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (let i = 0; i < set.length; i++) { - debug(set[i].semver) - if (set[i].semver === Comparator.ANY) { - continue - } + return -1; +} - if (set[i].semver.prerelease.length > 0) { - const allowed = set[i].semver - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) { - return true - } - } - } +function simpleEscapeSequence(c) { + /* eslint-disable indent */ + return (c === 0x30/* 0 */) ? '\x00' : + (c === 0x61/* a */) ? '\x07' : + (c === 0x62/* b */) ? '\x08' : + (c === 0x74/* t */) ? '\x09' : + (c === 0x09/* Tab */) ? '\x09' : + (c === 0x6E/* n */) ? '\x0A' : + (c === 0x76/* v */) ? '\x0B' : + (c === 0x66/* f */) ? '\x0C' : + (c === 0x72/* r */) ? '\x0D' : + (c === 0x65/* e */) ? '\x1B' : + (c === 0x20/* Space */) ? ' ' : + (c === 0x22/* " */) ? '\x22' : + (c === 0x2F/* / */) ? '/' : + (c === 0x5C/* \ */) ? '\x5C' : + (c === 0x4E/* N */) ? '\x85' : + (c === 0x5F/* _ */) ? '\xA0' : + (c === 0x4C/* L */) ? '\u2028' : + (c === 0x50/* P */) ? '\u2029' : ''; +} - // Version has a -pre, but it's not one of the ones we like. - return false +function charFromCodepoint(c) { + if (c <= 0xFFFF) { + return String.fromCharCode(c); } + // Encode UTF-16 surrogate pair + // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF + return String.fromCharCode( + ((c - 0x010000) >> 10) + 0xD800, + ((c - 0x010000) & 0x03FF) + 0xDC00 + ); +} - return true +var simpleEscapeCheck = new Array(256); // integer, for fast access +var simpleEscapeMap = new Array(256); +for (var i = 0; i < 256; i++) { + simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; + simpleEscapeMap[i] = simpleEscapeSequence(i); } -/***/ }), +function State(input, options) { + this.input = input; -/***/ 2975: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + this.filename = options['filename'] || null; + this.schema = options['schema'] || DEFAULT_SCHEMA; + this.onWarning = options['onWarning'] || null; + // (Hidden) Remove? makes the loader to expect YAML 1.1 documents + // if such documents have no explicit %YAML directive + this.legacy = options['legacy'] || false; -const debug = __webpack_require__(4709) -const { MAX_LENGTH, MAX_SAFE_INTEGER } = __webpack_require__(14762) -const { re, t } = __webpack_require__(97559) + this.json = options['json'] || false; + this.listener = options['listener'] || null; -const { compareIdentifiers } = __webpack_require__(34170) -class SemVer { - constructor (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - if (version instanceof SemVer) { - if (version.loose === !!options.loose && - version.includePrerelease === !!options.includePrerelease) { - return version - } else { - version = version.version - } - } else if (typeof version !== 'string') { - throw new TypeError(`Invalid Version: ${version}`) - } + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; - if (version.length > MAX_LENGTH) { - throw new TypeError( - `version is longer than ${MAX_LENGTH} characters` - ) - } + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose - // this isn't actually relevant for versions, but keep it so that we - // don't run into trouble passing this.options around. - this.includePrerelease = !!options.includePrerelease + // position of first leading tab in the current line, + // used to make sure there are no tabs in the indentation + this.firstTabInLine = -1; - const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + this.documents = []; - if (!m) { - throw new TypeError(`Invalid Version: ${version}`) - } + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ - this.raw = version +} - // these are actually numbers - this.major = +m[1] - this.minor = +m[2] - this.patch = +m[3] - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version') - } +function generateError(state, message) { + var mark = { + name: state.filename, + buffer: state.input.slice(0, -1), // omit trailing \0 + position: state.position, + line: state.line, + column: state.position - state.lineStart + }; - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } + mark.snippet = makeSnippet(mark); - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') - } + return new YAMLException(message, mark); +} - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = [] - } else { - this.prerelease = m[4].split('.').map((id) => { - if (/^[0-9]+$/.test(id)) { - const num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } - } - return id - }) - } +function throwError(state, message) { + throw generateError(state, message); +} - this.build = m[5] ? m[5].split('.') : [] - this.format() +function throwWarning(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError(state, message)); } +} - format () { - this.version = `${this.major}.${this.minor}.${this.patch}` - if (this.prerelease.length) { - this.version += `-${this.prerelease.join('.')}` - } - return this.version - } - toString () { - return this.version - } +var directiveHandlers = { - compare (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - if (typeof other === 'string' && other === this.version) { - return 0 - } - other = new SemVer(other, this.options) - } + YAML: function handleYamlDirective(state, name, args) { - if (other.version === this.version) { - return 0 - } + var match, major, minor; - return this.compareMain(other) || this.comparePre(other) - } + if (state.version !== null) { + throwError(state, 'duplication of %YAML directive'); + } - compareMain (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) + if (args.length !== 1) { + throwError(state, 'YAML directive accepts exactly one argument'); } - return ( - compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) - ) - } + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - comparePre (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) + if (match === null) { + throwError(state, 'ill-formed argument of the YAML directive'); } - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1 - } else if (!this.prerelease.length && other.prerelease.length) { - return 1 - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0 + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + + if (major !== 1) { + throwError(state, 'unacceptable YAML version of the document'); } - let i = 0 - do { - const a = this.prerelease[i] - const b = other.prerelease[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) - } + state.version = args[0]; + state.checkLineBreaks = (minor < 2); - compareBuild (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) + if (minor !== 1 && minor !== 2) { + throwWarning(state, 'unsupported YAML version of the document'); } + }, - let i = 0 - do { - const a = this.build[i] - const b = other.build[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) - } - - // preminor will bump the version up to the next minor release, and immediately - // down to pre-release. premajor and prepatch work the same way. - inc (release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier) - break - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0 - this.inc('patch', identifier) - this.inc('pre', identifier) - break - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier) - } - this.inc('pre', identifier) - break + TAG: function handleTagDirective(state, name, args) { - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if ( - this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0 - ) { - this.major++ - } - this.minor = 0 - this.patch = 0 - this.prerelease = [] - break - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++ - } - this.patch = 0 - this.prerelease = [] - break - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++ - } - this.prerelease = [] - break - // This probably shouldn't be used publicly. - // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) { - this.prerelease = [0] - } else { - let i = this.prerelease.length - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++ - i = -2 - } - } - if (i === -1) { - // didn't increment anything - this.prerelease.push(0) - } - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0] - } - } else { - this.prerelease = [identifier, 0] - } - } - break + var handle, prefix; - default: - throw new Error(`invalid increment argument: ${release}`) + if (args.length !== 2) { + throwError(state, 'TAG directive accepts exactly two arguments'); } - this.format() - this.raw = this.version - return this - } -} - -module.exports = SemVer - -/***/ }), + handle = args[0]; + prefix = args[1]; -/***/ 52966: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); + } -const parse = __webpack_require__(74067) -const clean = (version, options) => { - const s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null -} -module.exports = clean + if (_hasOwnProperty.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); + } -/***/ }), + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state, 'tag prefix is malformed: ' + prefix); + } -/***/ 27323: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + state.tagMap[handle] = prefix; + } +}; -const eq = __webpack_require__(78230) -const neq = __webpack_require__(18407) -const gt = __webpack_require__(39778) -const gte = __webpack_require__(56172) -const lt = __webpack_require__(24605) -const lte = __webpack_require__(80885) -const cmp = (a, op, b, loose) => { - switch (op) { - case '===': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a === b +function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; - case '!==': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a !== b + if (start < end) { + _result = state.input.slice(start, end); - case '': - case '=': - case '==': - return eq(a, b, loose) + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 0x09 || + (0x20 <= _character && _character <= 0x10FFFF))) { + throwError(state, 'expected valid JSON character'); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, 'the stream contains non-printable characters'); + } - case '!=': - return neq(a, b, loose) + state.result += _result; + } +} - case '>': - return gt(a, b, loose) +function mergeMappings(state, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; - case '>=': - return gte(a, b, loose) + if (!common.isObject(source)) { + throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); + } - case '<': - return lt(a, b, loose) + sourceKeys = Object.keys(source); - case '<=': - return lte(a, b, loose) + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; - default: - throw new TypeError(`Invalid operator: ${op}`) + if (!_hasOwnProperty.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } } } -module.exports = cmp +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, + startLine, startLineStart, startPos) { -/***/ }), + var index, quantity; -/***/ 43236: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + // The output is a plain object here, so keys can only be strings. + // We need to convert keyNode to a string, but doing so can hang the process + // (deeply nested arrays that explode exponentially using aliases). + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); -const SemVer = __webpack_require__(2975) -const parse = __webpack_require__(74067) -const {re, t} = __webpack_require__(97559) + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) { + throwError(state, 'nested arrays are not supported inside keys'); + } -const coerce = (version, options) => { - if (version instanceof SemVer) { - return version + if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { + keyNode[index] = '[object Object]'; + } + } } - if (typeof version === 'number') { - version = String(version) + // Avoid code execution in load() via toString property + // (still use its own toString for arrays, timestamps, + // and whatever user schema extensions happen to have @@toStringTag) + if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { + keyNode = '[object Object]'; } - if (typeof version !== 'string') { - return null - } - options = options || {} + keyNode = String(keyNode); - let match = null - if (!options.rtl) { - match = version.match(re[t.COERCE]) + if (_result === null) { + _result = {}; + } + + if (keyTag === 'tag:yaml.org,2002:merge') { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state, _result, valueNode[index], overridableKeys); + } + } else { + mergeMappings(state, _result, valueNode, overridableKeys); + } } else { - // Find the right-most coercible string that does not share - // a terminus with a more left-ward coercible string. - // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' - // - // Walk through the string checking with a /g regexp - // Manually set the index so as to pick up overlapping matches. - // Stop when we get a match that ends at the string end, since no - // coercible string can be more right-ward without the same terminus. - let next - while ((next = re[t.COERCERTL].exec(version)) && - (!match || match.index + match[0].length !== version.length) - ) { - if (!match || - next.index + next[0].length !== match.index + match[0].length) { - match = next - } - re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + if (!state.json && + !_hasOwnProperty.call(overridableKeys, keyNode) && + _hasOwnProperty.call(_result, keyNode)) { + state.line = startLine || state.line; + state.lineStart = startLineStart || state.lineStart; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); } - // leave it in a clean state - re[t.COERCERTL].lastIndex = -1 - } - if (match === null) - return null + // used for this specific key only because Object.defineProperty is slow + if (keyNode === '__proto__') { + Object.defineProperty(_result, keyNode, { + configurable: true, + enumerable: true, + writable: true, + value: valueNode + }); + } else { + _result[keyNode] = valueNode; + } + delete overridableKeys[keyNode]; + } - return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) + return _result; } -module.exports = coerce +function readLineBreak(state) { + var ch; -/***/ }), + ch = state.input.charCodeAt(state.position); -/***/ 48966: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (ch === 0x0A/* LF */) { + state.position++; + } else if (ch === 0x0D/* CR */) { + state.position++; + if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { + state.position++; + } + } else { + throwError(state, 'a line break is expected'); + } -const SemVer = __webpack_require__(2975) -const compareBuild = (a, b, loose) => { - const versionA = new SemVer(a, loose) - const versionB = new SemVer(b, loose) - return versionA.compare(versionB) || versionA.compareBuild(versionB) + state.line += 1; + state.lineStart = state.position; + state.firstTabInLine = -1; } -module.exports = compareBuild +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); -/***/ }), + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) { + state.firstTabInLine = state.position; + } + ch = state.input.charCodeAt(++state.position); + } -/***/ 86840: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (allowComments && ch === 0x23/* # */) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); + } -const compare = __webpack_require__(17188) -const compareLoose = (a, b) => compare(a, b, true) -module.exports = compareLoose + if (is_EOL(ch)) { + readLineBreak(state); + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; -/***/ }), + while (ch === 0x20/* Space */) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } -/***/ 17188: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning(state, 'deficient indentation'); + } -const SemVer = __webpack_require__(2975) -const compare = (a, b, loose) => - new SemVer(a, loose).compare(new SemVer(b, loose)) + return lineBreaks; +} -module.exports = compare +function testDocumentSeparator(state) { + var _position = state.position, + ch; + ch = state.input.charCodeAt(_position); -/***/ }), + // Condition state.position === state.lineStart is tested + // in parent on each call, for efficiency. No needs to test here again. + if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && + ch === state.input.charCodeAt(_position + 1) && + ch === state.input.charCodeAt(_position + 2)) { -/***/ 16860: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + _position += 3; -const parse = __webpack_require__(74067) -const eq = __webpack_require__(78230) + ch = state.input.charCodeAt(_position); -const diff = (version1, version2) => { - if (eq(version1, version2)) { - return null - } else { - const v1 = parse(version1) - const v2 = parse(version2) - const hasPre = v1.prerelease.length || v2.prerelease.length - const prefix = hasPre ? 'pre' : '' - const defaultResult = hasPre ? 'prerelease' : '' - for (const key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return prefix + key - } - } + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; } - return defaultResult // may be undefined + } + + return false; +} + +function writeFoldedLines(state, count) { + if (count === 1) { + state.result += ' '; + } else if (count > 1) { + state.result += common.repeat('\n', count - 1); } } -module.exports = diff -/***/ }), +function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, + following, + captureStart, + captureEnd, + hasPendingContent, + _line, + _lineStart, + _lineIndent, + _kind = state.kind, + _result = state.result, + ch; -/***/ 78230: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + ch = state.input.charCodeAt(state.position); -const compare = __webpack_require__(17188) -const eq = (a, b, loose) => compare(a, b, loose) === 0 -module.exports = eq + if (is_WS_OR_EOL(ch) || + is_FLOW_INDICATOR(ch) || + ch === 0x23/* # */ || + ch === 0x26/* & */ || + ch === 0x2A/* * */ || + ch === 0x21/* ! */ || + ch === 0x7C/* | */ || + ch === 0x3E/* > */ || + ch === 0x27/* ' */ || + ch === 0x22/* " */ || + ch === 0x25/* % */ || + ch === 0x40/* @ */ || + ch === 0x60/* ` */) { + return false; + } + if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { + following = state.input.charCodeAt(state.position + 1); -/***/ }), + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; + } + } -/***/ 39778: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + state.kind = 'scalar'; + state.result = ''; + captureStart = captureEnd = state.position; + hasPendingContent = false; -const compare = __webpack_require__(17188) -const gt = (a, b, loose) => compare(a, b, loose) > 0 -module.exports = gt + while (ch !== 0) { + if (ch === 0x3A/* : */) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } -/***/ }), + } else if (ch === 0x23/* # */) { + preceding = state.input.charCodeAt(state.position - 1); -/***/ 56172: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (is_WS_OR_EOL(preceding)) { + break; + } -const compare = __webpack_require__(17188) -const gte = (a, b, loose) => compare(a, b, loose) >= 0 -module.exports = gte + } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || + withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + } else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); -/***/ }), + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } -/***/ 29124: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } -const SemVer = __webpack_require__(2975) + if (!is_WHITE_SPACE(ch)) { + captureEnd = state.position + 1; + } -const inc = (version, release, options, identifier) => { - if (typeof (options) === 'string') { - identifier = options - options = undefined + ch = state.input.charCodeAt(++state.position); } - try { - return new SemVer(version, options).inc(release, identifier).version - } catch (er) { - return null + captureSegment(state, captureStart, captureEnd, false); + + if (state.result) { + return true; } + + state.kind = _kind; + state.result = _result; + return false; } -module.exports = inc +function readSingleQuotedScalar(state, nodeIndent) { + var ch, + captureStart, captureEnd; -/***/ }), + ch = state.input.charCodeAt(state.position); -/***/ 24605: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (ch !== 0x27/* ' */) { + return false; + } -const compare = __webpack_require__(17188) -const lt = (a, b, loose) => compare(a, b, loose) < 0 -module.exports = lt + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x27/* ' */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); -/***/ }), + if (ch === 0x27/* ' */) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } -/***/ 80885: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; -const compare = __webpack_require__(17188) -const lte = (a, b, loose) => compare(a, b, loose) <= 0 -module.exports = lte + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a single quoted scalar'); + } else { + state.position++; + captureEnd = state.position; + } + } -/***/ }), + throwError(state, 'unexpected end of the stream within a single quoted scalar'); +} -/***/ 96452: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, + captureEnd, + hexLength, + hexResult, + tmp, + ch; -const SemVer = __webpack_require__(2975) -const major = (a, loose) => new SemVer(a, loose).major -module.exports = major + ch = state.input.charCodeAt(state.position); + if (ch !== 0x22/* " */) { + return false; + } -/***/ }), + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; -/***/ 77016: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; -const SemVer = __webpack_require__(2975) -const minor = (a, loose) => new SemVer(a, loose).minor -module.exports = minor + } else if (ch === 0x5C/* \ */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); -/***/ }), + // TODO: rework to inline fn with no type cast? + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; -/***/ 18407: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; -const compare = __webpack_require__(17188) -const neq = (a, b, loose) => compare(a, b, loose) !== 0 -module.exports = neq + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; -/***/ }), + } else { + throwError(state, 'expected hexadecimal character'); + } + } -/***/ 74067: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + state.result += charFromCodepoint(hexResult); -const {MAX_LENGTH} = __webpack_require__(14762) -const { re, t } = __webpack_require__(97559) -const SemVer = __webpack_require__(2975) + state.position++; -const parse = (version, options) => { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } + } else { + throwError(state, 'unknown escape sequence'); + } - if (version instanceof SemVer) { - return version - } + captureStart = captureEnd = state.position; - if (typeof version !== 'string') { - return null - } + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; - if (version.length > MAX_LENGTH) { - return null - } + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a double quoted scalar'); - const r = options.loose ? re[t.LOOSE] : re[t.FULL] - if (!r.test(version)) { - return null + } else { + state.position++; + captureEnd = state.position; + } } - try { - return new SemVer(version, options) - } catch (er) { - return null - } + throwError(state, 'unexpected end of the stream within a double quoted scalar'); } -module.exports = parse - - -/***/ }), - -/***/ 82172: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +function readFlowCollection(state, nodeIndent) { + var readNext = true, + _line, + _lineStart, + _pos, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = Object.create(null), + keyNode, + keyTag, + valueNode, + ch; -const SemVer = __webpack_require__(2975) -const patch = (a, loose) => new SemVer(a, loose).patch -module.exports = patch + ch = state.input.charCodeAt(state.position); + if (ch === 0x5B/* [ */) { + terminator = 0x5D;/* ] */ + isMapping = false; + _result = []; + } else if (ch === 0x7B/* { */) { + terminator = 0x7D;/* } */ + isMapping = true; + _result = {}; + } else { + return false; + } -/***/ }), + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } -/***/ 74711: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + ch = state.input.charCodeAt(++state.position); -const parse = __webpack_require__(74067) -const prerelease = (version, options) => { - const parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null -} -module.exports = prerelease + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); -/***/ }), + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? 'mapping' : 'sequence'; + state.result = _result; + return true; + } else if (!readNext) { + throwError(state, 'missed comma between flow collection entries'); + } else if (ch === 0x2C/* , */) { + // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4 + throwError(state, "expected the node content, but found ','"); + } -/***/ 30949: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; -const compare = __webpack_require__(17188) -const rcompare = (a, b, loose) => compare(b, a, loose) -module.exports = rcompare + if (ch === 0x3F/* ? */) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); + } + } -/***/ }), + _line = state.line; // Save the current line. + _lineStart = state.lineStart; + _pos = state.position; + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); -/***/ 71435: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + ch = state.input.charCodeAt(state.position); -const compareBuild = __webpack_require__(48966) -const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) -module.exports = rsort + if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { + isPair = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; + } + if (isMapping) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + } else { + _result.push(keyNode); + } -/***/ }), + skipSeparationSpace(state, true, nodeIndent); -/***/ 62634: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + ch = state.input.charCodeAt(state.position); -const Range = __webpack_require__(17151) -const satisfies = (version, range, options) => { - try { - range = new Range(range, options) - } catch (er) { - return false + if (ch === 0x2C/* , */) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } } - return range.test(version) + + throwError(state, 'unexpected end of the stream within a flow collection'); } -module.exports = satisfies +function readBlockScalar(state, nodeIndent) { + var captureStart, + folding, + chomping = CHOMPING_CLIP, + didReadContent = false, + detectedIndent = false, + textIndent = nodeIndent, + emptyLines = 0, + atMoreIndented = false, + tmp, + ch; -/***/ }), - -/***/ 48953: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const compareBuild = __webpack_require__(48966) -const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) -module.exports = sort + ch = state.input.charCodeAt(state.position); + if (ch === 0x7C/* | */) { + folding = false; + } else if (ch === 0x3E/* > */) { + folding = true; + } else { + return false; + } -/***/ }), + state.kind = 'scalar'; + state.result = ''; -/***/ 26671: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); -const parse = __webpack_require__(74067) -const valid = (version, options) => { - const v = parse(version, options) - return v ? v.version : null -} -module.exports = valid + if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { + if (CHOMPING_CLIP === chomping) { + chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError(state, 'repeat of a chomping mode identifier'); + } + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError(state, 'repeat of an indentation width identifier'); + } -/***/ }), + } else { + break; + } + } -/***/ 57489: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (is_WHITE_SPACE(ch)) { + do { ch = state.input.charCodeAt(++state.position); } + while (is_WHITE_SPACE(ch)); -// just pre-load all the stuff that index.js lazily exports -const internalRe = __webpack_require__(97559) -module.exports = { - re: internalRe.re, - src: internalRe.src, - tokens: internalRe.t, - SEMVER_SPEC_VERSION: __webpack_require__(14762).SEMVER_SPEC_VERSION, - SemVer: __webpack_require__(2975), - compareIdentifiers: __webpack_require__(34170).compareIdentifiers, - rcompareIdentifiers: __webpack_require__(34170).rcompareIdentifiers, - parse: __webpack_require__(74067), - valid: __webpack_require__(26671), - clean: __webpack_require__(52966), - inc: __webpack_require__(29124), - diff: __webpack_require__(16860), - major: __webpack_require__(96452), - minor: __webpack_require__(77016), - patch: __webpack_require__(82172), - prerelease: __webpack_require__(74711), - compare: __webpack_require__(17188), - rcompare: __webpack_require__(30949), - compareLoose: __webpack_require__(86840), - compareBuild: __webpack_require__(48966), - sort: __webpack_require__(48953), - rsort: __webpack_require__(71435), - gt: __webpack_require__(39778), - lt: __webpack_require__(24605), - eq: __webpack_require__(78230), - neq: __webpack_require__(18407), - gte: __webpack_require__(56172), - lte: __webpack_require__(80885), - cmp: __webpack_require__(27323), - coerce: __webpack_require__(43236), - Comparator: __webpack_require__(2400), - Range: __webpack_require__(17151), - satisfies: __webpack_require__(62634), - toComparators: __webpack_require__(57575), - maxSatisfying: __webpack_require__(85564), - minSatisfying: __webpack_require__(97612), - minVersion: __webpack_require__(82834), - validRange: __webpack_require__(57458), - outside: __webpack_require__(50717), - gtr: __webpack_require__(79576), - ltr: __webpack_require__(7789), - intersects: __webpack_require__(26145), - simplifyRange: __webpack_require__(15636), - subset: __webpack_require__(62928), -} + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (!is_EOL(ch) && (ch !== 0)); + } + } + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; -/***/ }), + ch = state.input.charCodeAt(state.position); -/***/ 14762: -/***/ ((module) => { + while ((!detectedIndent || state.lineIndent < textIndent) && + (ch === 0x20/* Space */)) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -const SEMVER_SPEC_VERSION = '2.0.0' + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } -const MAX_LENGTH = 256 -const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || - /* istanbul ignore next */ 9007199254740991 + if (is_EOL(ch)) { + emptyLines++; + continue; + } -// Max safe segment length for coercion. -const MAX_SAFE_COMPONENT_LENGTH = 16 + // End of the scalar. + if (state.lineIndent < textIndent) { -module.exports = { - SEMVER_SPEC_VERSION, - MAX_LENGTH, - MAX_SAFE_INTEGER, - MAX_SAFE_COMPONENT_LENGTH -} + // Perform the chomping. + if (chomping === CHOMPING_KEEP) { + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { // i.e. only if the scalar is not empty. + state.result += '\n'; + } + } + // Break this `while` cycle and go to the funciton's epilogue. + break; + } -/***/ }), + // Folded style: use fancy rules to handle line breaks. + if (folding) { -/***/ 4709: -/***/ ((module) => { + // Lines starting with white space characters (more-indented lines) are not folded. + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + // except for the first content line (cf. Example 8.1) + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); -const debug = ( - typeof process === 'object' && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG) -) ? (...args) => console.error('SEMVER', ...args) - : () => {} + // End of more-indented block. + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat('\n', emptyLines + 1); -module.exports = debug + // Just one line break - perceive as the same line. + } else if (emptyLines === 0) { + if (didReadContent) { // i.e. only if we have already read some scalar content. + state.result += ' '; + } + // Several line breaks - perceive as different lines. + } else { + state.result += common.repeat('\n', emptyLines); + } -/***/ }), + // Literal style: just add exact number of line breaks between content lines. + } else { + // Keep all line breaks except the header line break. + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } -/***/ 34170: -/***/ ((module) => { + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; -const numeric = /^[0-9]+$/ -const compareIdentifiers = (a, b) => { - const anum = numeric.test(a) - const bnum = numeric.test(b) + while (!is_EOL(ch) && (ch !== 0)) { + ch = state.input.charCodeAt(++state.position); + } - if (anum && bnum) { - a = +a - b = +b + captureSegment(state, captureStart, state.position, false); } - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 + return true; } -const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) +function readBlockSequence(state, nodeIndent) { + var _line, + _tag = state.tag, + _anchor = state.anchor, + _result = [], + following, + detected = false, + ch; -module.exports = { - compareIdentifiers, - rcompareIdentifiers -} + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } -/***/ }), + ch = state.input.charCodeAt(state.position); -/***/ 97559: -/***/ ((module, exports, __webpack_require__) => { + while (ch !== 0) { + if (state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } -const { MAX_SAFE_COMPONENT_LENGTH } = __webpack_require__(14762) -const debug = __webpack_require__(4709) -exports = module.exports = {} + if (ch !== 0x2D/* - */) { + break; + } -// The actual regexps go on exports.re -const re = exports.re = [] -const src = exports.src = [] -const t = exports.t = {} -let R = 0 + following = state.input.charCodeAt(state.position + 1); -const createToken = (name, value, isGlobal) => { - const index = R++ - debug(index, value) - t[name] = index - src[index] = value - re[index] = new RegExp(value, isGlobal ? 'g' : undefined) -} + if (!is_WS_OR_EOL(following)) { + break; + } -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. + detected = true; + state.position++; -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } -createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') -createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+') + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. + ch = state.input.charCodeAt(state.position); -createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*') + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a sequence entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } -// ## Main Version -// Three dot-separated numeric identifiers. + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'sequence'; + state.result = _result; + return true; + } + return false; +} -createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})`) +function readBlockMapping(state, nodeIndent, flowIndent) { + var following, + allowCompact, + _line, + _keyLine, + _keyLineStart, + _keyPos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = Object.create(null), + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; -createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})`) + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } -createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] -}|${src[t.NONNUMERICIDENTIFIER]})`) + ch = state.input.charCodeAt(state.position); -createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] -}|${src[t.NONNUMERICIDENTIFIER]})`) + while (ch !== 0) { + if (!atExplicitKey && state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. -createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] -}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) + // + // Explicit notation case. There are two separate blocks: + // first for the key (denoted by "?") and second for the value (denoted by ":") + // + if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { -createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] -}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) + if (ch === 0x3F/* ? */) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. + detected = true; + atExplicitKey = true; + allowCompact = true; -createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+') + } else if (atExplicitKey) { + // i.e. 0x3A/* : */ === character after the explicit key. + atExplicitKey = false; + allowCompact = true; -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. + } else { + throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); + } -createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] -}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) + state.position += 1; + ch = following; -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. + // + // Implicit notation case. Flow-style node as the key first, then ":", and the value. + // + } else { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. + if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + // Neither implicit nor explicit notation. + // Reading is done. Go to the epilogue. + break; + } -createToken('FULLPLAIN', `v?${src[t.MAINVERSION] -}${src[t.PRERELEASE]}?${ - src[t.BUILD]}?`) + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); -createToken('FULL', `^${src[t.FULLPLAIN]}$`) + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] -}${src[t.PRERELEASELOOSE]}?${ - src[t.BUILD]}?`) + if (ch === 0x3A/* : */) { + ch = state.input.charCodeAt(++state.position); -createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) + if (!is_WS_OR_EOL(ch)) { + throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); + } -createToken('GTLT', '((?:<|>)?=?)') + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) -createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; -createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:${src[t.PRERELEASE]})?${ - src[t.BUILD]}?` + - `)?)?`) + } else if (detected) { + throwError(state, 'can not read an implicit mapping pair; a colon is missed'); -createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:${src[t.PRERELEASELOOSE]})?${ - src[t.BUILD]}?` + - `)?)?`) + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } -createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) -createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) + } else if (detected) { + throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -createToken('COERCE', `${'(^|[^\\d])' + - '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + - `(?:$|[^\\d])`) -createToken('COERCERTL', src[t.COERCE], true) + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + } -// Tilde ranges. -// Meaning is "reasonably at or greater than" -createToken('LONETILDE', '(?:~>?)') + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + } -createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) -exports.tildeTrimReplace = '$1~' + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } -createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) -createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } -// Caret ranges. -// Meaning is "at least and backwards compatible with" -createToken('LONECARET', '(?:\\^)') + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } -createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) -exports.caretTrimReplace = '$1^' + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a mapping entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } -createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) -createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) + // + // Epilogue. + // -// A simple gt/lt/eq thing, or just "" to indicate "any version" -createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) -createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) + // Special case: last mapping's node contains only the key in explicit notation. + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + } -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] -}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) -exports.comparatorTrimReplace = '$1$2$3' + // Expose the resulting mapping. + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'mapping'; + state.result = _result; + } -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAIN]})` + - `\\s*$`) + return detected; +} -createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAINLOOSE]})` + - `\\s*$`) +function readTagProperty(state) { + var _position, + isVerbatim = false, + isNamed = false, + tagHandle, + tagName, + ch; -// Star ranges basically just allow anything at all. -createToken('STAR', '(<|>)?=?\\s*\\*') -// >=0.0.0 is like a star -createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$') -createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$') + ch = state.input.charCodeAt(state.position); + if (ch !== 0x21/* ! */) return false; -/***/ }), + if (state.tag !== null) { + throwError(state, 'duplication of a tag property'); + } -/***/ 79576: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + ch = state.input.charCodeAt(++state.position); -// Determine if version is greater than all the versions possible in the range. -const outside = __webpack_require__(50717) -const gtr = (version, range, options) => outside(version, range, '>', options) -module.exports = gtr + if (ch === 0x3C/* < */) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + } else if (ch === 0x21/* ! */) { + isNamed = true; + tagHandle = '!!'; + ch = state.input.charCodeAt(++state.position); -/***/ }), + } else { + tagHandle = '!'; + } -/***/ 26145: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + _position = state.position; -const Range = __webpack_require__(17151) -const intersects = (r1, r2, options) => { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2) -} -module.exports = intersects + if (isVerbatim) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && ch !== 0x3E/* > */); + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError(state, 'unexpected end of the stream within a verbatim tag'); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { -/***/ }), + if (ch === 0x21/* ! */) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); -/***/ 7789: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state, 'named tag handle cannot contain such characters'); + } -const outside = __webpack_require__(50717) -// Determine if version is less than all the versions possible in the range -const ltr = (version, range, options) => outside(version, range, '<', options) -module.exports = ltr + isNamed = true; + _position = state.position + 1; + } else { + throwError(state, 'tag suffix cannot contain exclamation marks'); + } + } + ch = state.input.charCodeAt(++state.position); + } -/***/ }), + tagName = state.input.slice(_position, state.position); -/***/ 85564: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state, 'tag suffix cannot contain flow indicator characters'); + } + } -const SemVer = __webpack_require__(2975) -const Range = __webpack_require__(17151) + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state, 'tag name cannot contain such characters: ' + tagName); + } -const maxSatisfying = (versions, range, options) => { - let max = null - let maxSV = null - let rangeObj = null try { - rangeObj = new Range(range, options) - } catch (er) { - return null + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state, 'tag name is malformed: ' + tagName); } - versions.forEach((v) => { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v - maxSV = new SemVer(max, options) - } - } - }) - return max -} -module.exports = maxSatisfying + if (isVerbatim) { + state.tag = tagName; -/***/ }), + } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; -/***/ 97612: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + } else if (tagHandle === '!') { + state.tag = '!' + tagName; -const SemVer = __webpack_require__(2975) -const Range = __webpack_require__(17151) -const minSatisfying = (versions, range, options) => { - let min = null - let minSV = null - let rangeObj = null - try { - rangeObj = new Range(range, options) - } catch (er) { - return null + } else if (tagHandle === '!!') { + state.tag = 'tag:yaml.org,2002:' + tagName; + + } else { + throwError(state, 'undeclared tag handle "' + tagHandle + '"'); } - versions.forEach((v) => { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v - minSV = new SemVer(min, options) - } - } - }) - return min + + return true; } -module.exports = minSatisfying +function readAnchorProperty(state) { + var _position, + ch; -/***/ }), + ch = state.input.charCodeAt(state.position); -/***/ 82834: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (ch !== 0x26/* & */) return false; -const SemVer = __webpack_require__(2975) -const Range = __webpack_require__(17151) -const gt = __webpack_require__(39778) + if (state.anchor !== null) { + throwError(state, 'duplication of an anchor property'); + } -const minVersion = (range, loose) => { - range = new Range(range, loose) + ch = state.input.charCodeAt(++state.position); + _position = state.position; - let minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); } - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver + if (state.position === _position) { + throwError(state, 'name of an anchor node must contain at least one character'); } - minver = null - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i] + state.anchor = state.input.slice(_position, state.position); + return true; +} - comparators.forEach((comparator) => { - // Clone to avoid manipulating the comparator's semver object. - const compver = new SemVer(comparator.semver.version) - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++ - } else { - compver.prerelease.push(0) - } - compver.raw = compver.format() - /* fallthrough */ - case '': - case '>=': - if (!minver || gt(minver, compver)) { - minver = compver - } - break - case '<': - case '<=': - /* Ignore maximum versions */ - break - /* istanbul ignore next */ - default: - throw new Error(`Unexpected operation: ${comparator.operator}`) - } - }) +function readAlias(state) { + var _position, alias, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x2A/* * */) return false; + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); } - if (minver && range.test(minver)) { - return minver + if (state.position === _position) { + throwError(state, 'name of an alias node must contain at least one character'); } - return null + alias = state.input.slice(_position, state.position); + + if (!_hasOwnProperty.call(state.anchorMap, alias)) { + throwError(state, 'unidentified alias "' + alias + '"'); + } + + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; } -module.exports = minVersion +function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, + allowBlockScalars, + allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this { + state.tag = null; + state.anchor = null; + state.kind = null; + state.result = null; -const SemVer = __webpack_require__(2975) -const Comparator = __webpack_require__(2400) -const {ANY} = Comparator -const Range = __webpack_require__(17151) -const satisfies = __webpack_require__(62634) -const gt = __webpack_require__(39778) -const lt = __webpack_require__(24605) -const lte = __webpack_require__(80885) -const gte = __webpack_require__(56172) + allowBlockStyles = allowBlockScalars = allowBlockCollections = + CONTEXT_BLOCK_OUT === nodeContext || + CONTEXT_BLOCK_IN === nodeContext; -const outside = (version, range, hilo, options) => { - version = new SemVer(version, options) - range = new Range(range, options) + if (allowToSeek) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; - let gtfn, ltefn, ltfn, comp, ecomp - switch (hilo) { - case '>': - gtfn = gt - ltefn = lte - ltfn = lt - comp = '>' - ecomp = '>=' - break - case '<': - gtfn = lt - ltefn = gte - ltfn = gt - comp = '<' - ecomp = '<=' - break - default: - throw new TypeError('Must provide a hilo val of "<" or ">"') + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } } - // If it satisifes the range it is not outside - if (satisfies(version, range, options)) { - return false + if (indentStatus === 1) { + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } } - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i] + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } - let high = null - let low = null + blockIndent = state.position - state.lineStart; - comparators.forEach((comparator) => { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator - low = low || comparator - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator + if (indentStatus === 1) { + if (allowBlockCollections && + (readBlockSequence(state, blockIndent) || + readBlockMapping(state, blockIndent, flowIndent)) || + readFlowCollection(state, flowIndent)) { + hasContent = true; + } else { + if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || + readSingleQuotedScalar(state, flowIndent) || + readDoubleQuotedScalar(state, flowIndent)) { + hasContent = true; + + } else if (readAlias(state)) { + hasContent = true; + + if (state.tag !== null || state.anchor !== null) { + throwError(state, 'alias node should not have any properties'); + } + + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + + if (state.tag === null) { + state.tag = '?'; + } + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } } - }) + } else if (indentStatus === 0) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 + hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + } - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false + if (state.tag === null) { + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; } - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false + } else if (state.tag === '?') { + // Implicit resolving is not allowed for non-scalar types, and '?' + // non-specific tag is only automatically assigned to plain scalars. + // + // We only need to check kind conformity in case user explicitly assigns '?' + // tag, for example like this: "! [0]" + // + if (state.result !== null && state.kind !== 'scalar') { + throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); } - } - return true -} -module.exports = outside + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type = state.implicitTypes[typeIndex]; + if (type.resolve(state.result)) { // `state.result` updated in resolver if matched + state.result = type.construct(state.result); + state.tag = type.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (state.tag !== '!') { + if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + } else { + // looking for multi type + type = null; + typeList = state.typeMap.multi[state.kind || 'fallback']; -/***/ }), + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type = typeList[typeIndex]; + break; + } + } + } -/***/ 15636: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (!type) { + throwError(state, 'unknown tag !<' + state.tag + '>'); + } -// given a set of versions and a range, create a "simplified" range -// that includes the same versions that the original range does -// If the original range is shorter than the simplified one, return that. -const satisfies = __webpack_require__(62634) -const compare = __webpack_require__(17188) -module.exports = (versions, range, options) => { - const set = [] - let min = null - let prev = null - const v = versions.sort((a, b) => compare(a, b, options)) - for (const version of v) { - const included = satisfies(version, range, options) - if (included) { - prev = version - if (!min) - min = version + if (state.result !== null && type.kind !== state.kind) { + throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); + } + + if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched + throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); } else { - if (prev) { - set.push([min, prev]) + state.result = type.construct(state.result, state.tag); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; } - prev = null - min = null } } - if (min) - set.push([min, null]) - const ranges = [] - for (const [min, max] of set) { - if (min === max) - ranges.push(min) - else if (!max && min === v[0]) - ranges.push('*') - else if (!max) - ranges.push(`>=${min}`) - else if (min === v[0]) - ranges.push(`<=${max}`) - else - ranges.push(`${min} - ${max}`) + if (state.listener !== null) { + state.listener('close', state); } - const simplified = ranges.join(' || ') - const original = typeof range.raw === 'string' ? range.raw : String(range) - return simplified.length < original.length ? simplified : range + return state.tag !== null || state.anchor !== null || hasContent; } +function readDocument(state) { + var documentStart = state.position, + _position, + directiveName, + directiveArgs, + hasDirectives = false, + ch; -/***/ }), + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = Object.create(null); + state.anchorMap = Object.create(null); -/***/ 62928: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); -const Range = __webpack_require__(17151) -const { ANY } = __webpack_require__(2400) -const satisfies = __webpack_require__(62634) -const compare = __webpack_require__(17188) + ch = state.input.charCodeAt(state.position); -// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: -// - Every simple range `r1, r2, ...` is a subset of some `R1, R2, ...` -// -// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: -// - If c is only the ANY comparator -// - If C is only the ANY comparator, return true -// - Else return false -// - Let EQ be the set of = comparators in c -// - If EQ is more than one, return true (null set) -// - Let GT be the highest > or >= comparator in c -// - Let LT be the lowest < or <= comparator in c -// - If GT and LT, and GT.semver > LT.semver, return true (null set) -// - If EQ -// - If GT, and EQ does not satisfy GT, return true (null set) -// - If LT, and EQ does not satisfy LT, return true (null set) -// - If EQ satisfies every C, return true -// - Else return false -// - If GT -// - If GT is lower than any > or >= comp in C, return false -// - If GT is >=, and GT.semver does not satisfy every C, return false -// - If LT -// - If LT.semver is greater than that of any > comp in C, return false -// - If LT is <=, and LT.semver does not satisfy every C, return false -// - If any C is a = range, and GT or LT are set, return false -// - Else return true + if (state.lineIndent > 0 || ch !== 0x25/* % */) { + break; + } -const subset = (sub, dom, options) => { - sub = new Range(sub, options) - dom = new Range(dom, options) - let sawNonNull = false + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; - OUTER: for (const simpleSub of sub.set) { - for (const simpleDom of dom.set) { - const isSub = simpleSubset(simpleSub, simpleDom, options) - sawNonNull = sawNonNull || isSub !== null - if (isSub) - continue OUTER + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); } - // the null set is a subset of everything, but null simple ranges in - // a complex range should be ignored. so if we saw a non-null range, - // then we know this isn't a subset, but if EVERY simple range was null, - // then it is a subset. - if (sawNonNull) - return false - } - return true -} -const simpleSubset = (sub, dom, options) => { - if (sub.length === 1 && sub[0].semver === ANY) - return dom.length === 1 && dom[0].semver === ANY + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; - const eqSet = new Set() - let gt, lt - for (const c of sub) { - if (c.operator === '>' || c.operator === '>=') - gt = higherGT(gt, c, options) - else if (c.operator === '<' || c.operator === '<=') - lt = lowerLT(lt, c, options) - else - eqSet.add(c.semver) - } + if (directiveName.length < 1) { + throwError(state, 'directive name must not be less than one character in length'); + } - if (eqSet.size > 1) - return null + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } - let gtltComp - if (gt && lt) { - gtltComp = compare(gt.semver, lt.semver, options) - if (gtltComp > 0) - return null - else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) - return null - } + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && !is_EOL(ch)); + break; + } - // will iterate one or zero times - for (const eq of eqSet) { - if (gt && !satisfies(eq, String(gt), options)) - return null + if (is_EOL(ch)) break; - if (lt && !satisfies(eq, String(lt), options)) - return null + _position = state.position; - for (const c of dom) { - if (!satisfies(eq, String(c), options)) - return false + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveArgs.push(state.input.slice(_position, state.position)); } - return true - } - let higher, lower - let hasDomLT, hasDomGT - for (const c of dom) { - hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' - hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' - if (gt) { - if (c.operator === '>' || c.operator === '>=') { - higher = higherGT(gt, c, options) - if (higher === c) - return false - } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) - return false - } - if (lt) { - if (c.operator === '<' || c.operator === '<=') { - lower = lowerLT(lt, c, options) - if (lower === c) - return false - } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) - return false + if (ch !== 0) readLineBreak(state); + + if (_hasOwnProperty.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning(state, 'unknown document directive "' + directiveName + '"'); } - if (!c.operator && (lt || gt) && gtltComp !== 0) - return false } - // if there was a < or >, and nothing in the dom, then must be false - // UNLESS it was limited by another range in the other direction. - // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 - if (gt && hasDomLT && !lt && gtltComp !== 0) - return false - - if (lt && hasDomGT && !gt && gtltComp !== 0) - return false - - return true -} + skipSeparationSpace(state, true, -1); -// >=1.2.3 is lower than >1.2.3 -const higherGT = (a, b, options) => { - if (!a) - return b - const comp = compare(a.semver, b.semver, options) - return comp > 0 ? a - : comp < 0 ? b - : b.operator === '>' && a.operator === '>=' ? b - : a -} + if (state.lineIndent === 0 && + state.input.charCodeAt(state.position) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { + state.position += 3; + skipSeparationSpace(state, true, -1); -// <=1.2.3 is higher than <1.2.3 -const lowerLT = (a, b, options) => { - if (!a) - return b - const comp = compare(a.semver, b.semver, options) - return comp < 0 ? a - : comp > 0 ? b - : b.operator === '<' && a.operator === '<=' ? b - : a -} + } else if (hasDirectives) { + throwError(state, 'directives end mark is expected'); + } -module.exports = subset + composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); + if (state.checkLineBreaks && + PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { + throwWarning(state, 'non-ASCII line breaks are interpreted as content'); + } -/***/ }), + state.documents.push(state.result); -/***/ 57575: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (state.position === state.lineStart && testDocumentSeparator(state)) { -const Range = __webpack_require__(17151) + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } + return; + } -// Mostly just for testing and legacy API reasons -const toComparators = (range, options) => - new Range(range, options).set - .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) + if (state.position < (state.length - 1)) { + throwError(state, 'end of the stream or a document separator is expected'); + } else { + return; + } +} -module.exports = toComparators +function loadDocuments(input, options) { + input = String(input); + options = options || {}; -/***/ }), + if (input.length !== 0) { -/***/ 57458: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + // Add tailing `\n` if not exists + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { + input += '\n'; + } -const Range = __webpack_require__(17151) -const validRange = (range, options) => { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || '*' - } catch (er) { - return null + // Strip BOM + if (input.charCodeAt(0) === 0xFEFF) { + input = input.slice(1); + } } -} -module.exports = validRange + var state = new State(input, options); -/***/ }), + var nullpos = input.indexOf('\0'); -/***/ 3149: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, 'null byte is not allowed in input'); + } -const toJsonSchema = __webpack_require__(17040); + // Use 0 as string terminator. That significantly simplifies bounds check. + state.input += '\0'; -module.exports = { - parse, - getMimeTypes -}; + while (state.input.charCodeAt(state.position) === 0x20/* Space */) { + state.lineIndent += 1; + state.position += 1; + } -async function parse({ message, defaultSchemaFormat }) { - const transformed = toJsonSchema(message.payload, { - cloneSchema: true, - keepNotSupported: [ - 'discriminator', - 'readOnly', - 'writeOnly', - 'deprecated', - 'xml', - 'example', - ], - }); + while (state.position < (state.length - 1)) { + readDocument(state); + } - iterateSchema(transformed); + return state.documents; +} - message['x-parser-original-schema-format'] = message.schemaFormat || defaultSchemaFormat; - message['x-parser-original-payload'] = message.payload; - message.payload = transformed; - delete message.schemaFormat; -}; -function iterateSchema(schema) { - if (schema.example !== undefined) { - const examples = schema.examples || []; - examples.push(schema.example); - schema.examples = examples; - delete schema.example; +function loadAll(input, iterator, options) { + if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { + options = iterator; + iterator = null; } - if (schema.$schema !== undefined) { - delete schema.$schema; + var documents = loadDocuments(input, options); + + if (typeof iterator !== 'function') { + return documents; } - aliasProps(schema.properties); - aliasProps(schema.patternProperties); - aliasProps(schema.additionalProperties); - aliasProps(schema.items); - aliasProps(schema.additionalItems); - aliasProps(schema.oneOf); - aliasProps(schema.anyOf); - aliasProps(schema.allOf); - aliasProps(schema.not); + for (var index = 0, length = documents.length; index < length; index += 1) { + iterator(documents[index]); + } } -function aliasProps(obj) { - for (const key in obj) { - const prop = obj[key]; - if (prop.xml !== undefined) { - prop['x-xml'] = prop.xml; - delete prop.xml; - } +function load(input, options) { + var documents = loadDocuments(input, options); - iterateSchema(obj[key]); + if (documents.length === 0) { + /*eslint-disable no-undefined*/ + return undefined; + } else if (documents.length === 1) { + return documents[0]; } + throw new YAMLException('expected a single document in the stream, but found more'); } -function getMimeTypes() { - return [ - 'application/vnd.oai.openapi;version=3.0.0', - 'application/vnd.oai.openapi+json;version=3.0.0', - 'application/vnd.oai.openapi+yaml;version=3.0.0', - ]; -} + +module.exports.loadAll = loadAll; +module.exports.load = load; + /***/ }), -/***/ 69162: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 78583: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const Ajv = __webpack_require__(64941); -const ParserError = __webpack_require__(21978); -const asyncapi = __webpack_require__(78100); -const { improveAjvErrors } = __webpack_require__(12065); +"use strict"; -module.exports = { - parse, - getMimeTypes -}; -/** - * @private - */ -async function parse({ message, originalAsyncAPIDocument, fileFormat, parsedAsyncAPIDocument, pathToPayload }) { - const payload = message.payload; - if (!payload) return; +/*eslint-disable max-len*/ - const ajv = new Ajv({ - jsonPointers: true, - allErrors: true, - schemaId: 'id', - logger: false, - }); - const payloadSchema = preparePayloadSchema(asyncapi[parsedAsyncAPIDocument.asyncapi]); - const validate = ajv.compile(payloadSchema); - const valid = validate(payload); +var YAMLException = __nccwpck_require__(7987); +var Type = __nccwpck_require__(63820); - if (!valid) throw new ParserError({ - type: 'schema-validation-errors', - title: 'This is not a valid AsyncAPI Schema Object.', - parsedJSON: parsedAsyncAPIDocument, - validationErrors: improveAjvErrors(addFullPathToDataPath(validate.errors, pathToPayload), originalAsyncAPIDocument, fileFormat), + +function compileList(schema, name) { + var result = []; + + schema[name].forEach(function (currentType) { + var newIndex = result.length; + + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && + previousType.kind === currentType.kind && + previousType.multi === currentType.multi) { + + newIndex = previousIndex; + } + }); + + result[newIndex] = currentType; }); -} -/** - * @private - */ -function getMimeTypes() { - return [ - 'application/vnd.aai.asyncapi;version=2.0.0', - 'application/vnd.aai.asyncapi+json;version=2.0.0', - 'application/vnd.aai.asyncapi+yaml;version=2.0.0', - 'application/schema;version=draft-07', - 'application/schema+json;version=draft-07', - 'application/schema+yaml;version=draft-07', - ]; + return result; } -/** - * To validate schema of the payload we just need a small portion of official AsyncAPI spec JSON Schema, the definition of the schema must be - * a main part of the JSON Schema - * - * @private - * @param {Object} asyncapiSchema AsyncAPI specification JSON Schema - * @returns {Object} valid JSON Schema document describing format of AsyncAPI-valid schema for message payload - */ -function preparePayloadSchema(asyncapiSchema) { - return { - $ref: '#/definitions/schema', - definitions: asyncapiSchema.definitions - }; -} -/** - * Errors from Ajv contain dataPath information about parameter relative to parsed payload message. - * This function enriches dataPath with additional information on where is the parameter located in AsyncAPI document - * - * @private - * @param {Array} errors Ajv errors - * @param {String} path Path to location of the payload schema in AsyncAPI Document - * @returns {Array} same object as received in input but with modified datePath property so it contain full path relative to AsyncAPI document - */ -function addFullPathToDataPath(errors, path) { - return errors.map((err) => ({ - ...err, - ...{ - dataPath: `${path}${err.dataPath}` +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index, length; + + function collectType(type) { + if (type.multi) { + result.multi[type.kind].push(type); + result.multi['fallback'].push(type); + } else { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; } - })); + } + + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; } +function Schema(definition) { + return this.extend(definition); +} -/***/ }), -/***/ 10254: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +Schema.prototype.extend = function extend(definition) { + var implicit = []; + var explicit = []; -const ParserError = __webpack_require__(21978); -const { parseUrlVariables, getMissingProps, groupValidationErrors, tilde, parseUrlQueryParameters, setNotProvidedParams } = __webpack_require__(12065); -const validationError = 'validation-errors'; + if (definition instanceof Type) { + // Schema.extend(type) + explicit.push(definition); -/** - * Validates if variables provided in the url have corresponding variable object defined - * @private - * @param {Object} parsedJSON parsed AsyncAPI document - * @param {String} asyncapiYAMLorJSON AsyncAPI document in string - * @param {String} initialFormat information of the document was oryginally JSON or YAML - * @returns {Boolean} true in case the document is valid, otherwise throws ParserError - */ -function validateServerVariables(parsedJSON, asyncapiYAMLorJSON, initialFormat) { - const srvs = parsedJSON.servers; - if (!srvs) return true; + } else if (Array.isArray(definition)) { + // Schema.extend([ type1, type2, ... ]) + explicit = explicit.concat(definition); - const srvsMap = new Map(Object.entries(srvs)); - const notProvidedVariables = new Map(); + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] }) + if (definition.implicit) implicit = implicit.concat(definition.implicit); + if (definition.explicit) explicit = explicit.concat(definition.explicit); - srvsMap.forEach((val, key) => { - const variables = parseUrlVariables(val.url); - const notProvidedServerVars = notProvidedVariables.get(tilde(key)); - if (!variables) return; + } else { + throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' + + 'or a schema definition ({ implicit: [...], explicit: [...] })'); + } - const missingServerVariables = getMissingProps(variables, val.variables); - if (!missingServerVariables.length) return; + implicit.forEach(function (type) { + if (!(type instanceof Type)) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } - notProvidedVariables.set(tilde(key), - notProvidedServerVars - ? notProvidedServerVars.concat(missingServerVariables) - : missingServerVariables); - }); + if (type.loadKind && type.loadKind !== 'scalar') { + throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } - if (notProvidedVariables.size) { - throw new ParserError({ - type: validationError, - title: 'Not all server variables are described with variable object', - parsedJSON, - validationErrors: groupValidationErrors('servers', 'server does not have a corresponding variable object for', notProvidedVariables, asyncapiYAMLorJSON, initialFormat) - }); - } + if (type.multi) { + throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.'); + } + }); - return true; -} + explicit.forEach(function (type) { + if (!(type instanceof Type)) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + }); -/** - * Validates if operationIds are duplicated in the document - * - * @private - * @param {Object} parsedJSON parsed AsyncAPI document - * @param {String} asyncapiYAMLorJSON AsyncAPI document in string - * @param {String} initialFormat information of the document was oryginally JSON or YAML - * @returns {Boolean} true in case the document is valid, otherwise throws ParserError - */ -function validateOperationId(parsedJSON, asyncapiYAMLorJSON, initialFormat, operations) { - const chnls = parsedJSON.channels; - if (!chnls) return true; - const chnlsMap = new Map(Object.entries(chnls)); - //it is a map of paths, the one that is a duplicate and the one that is duplicated - const duplicatedOperations = new Map(); - //is is a 2-dimentional array that holds information with operationId value and its path - const allOperations = []; + var result = Object.create(Schema.prototype); - const addDuplicateToMap = (op, channelName, opName) => { - const operationId = op.operationId; - if (!operationId) return; + result.implicit = (this.implicit || []).concat(implicit); + result.explicit = (this.explicit || []).concat(explicit); - const operationPath = `${tilde(channelName)}/${opName}/operationId`; - const isOperationIdDuplicated = allOperations.filter(v => v[0] === operationId); - if (!isOperationIdDuplicated.length) return allOperations.push([operationId, operationPath]); + result.compiledImplicit = compileList(result, 'implicit'); + result.compiledExplicit = compileList(result, 'explicit'); + result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); - //isOperationIdDuplicated always holds one record and it is an array of paths, the one that is a duplicate and the one that is duplicated - duplicatedOperations.set(operationPath, isOperationIdDuplicated[0][1]); - }; + return result; +}; - chnlsMap.forEach((chnlObj, chnlName) => { - operations.forEach(opName => { - const op = chnlObj[String(opName)]; - if (op) addDuplicateToMap(op, chnlName, opName); - }); - }); - if (duplicatedOperations.size) { - throw new ParserError({ - type: validationError, - title: 'operationId must be unique across all the operations.', - parsedJSON, - validationErrors: groupValidationErrors('channels', 'is a duplicate of', duplicatedOperations, asyncapiYAMLorJSON, initialFormat) - }); - } +module.exports = Schema; - return true; -} -/** - * Validates if server security is declared properly and the name has a corresponding security schema definition in components with the same name - * - * @private - * @param {Object} parsedJSON parsed AsyncAPI document - * @param {String} asyncapiYAMLorJSON AsyncAPI document in string - * @param {String} initialFormat information of the document was oryginally JSON or YAML - * @param {String[]} specialSecTypes list of security types that can have data in array - * @returns {Boolean} true in case the document is valid, otherwise throws ParserError - */ -function validateServerSecurity(parsedJSON, asyncapiYAMLorJSON, initialFormat, specialSecTypes) { - const srvs = parsedJSON.servers; - if (!srvs) return true; +/***/ }), - const root = 'servers'; - const srvsMap = new Map(Object.entries(srvs)); +/***/ 84030: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const missingSecSchema = new Map(), - invalidSecurityValues = new Map(); +"use strict"; +// Standard YAML's Core schema. +// http://www.yaml.org/spec/1.2/spec.html#id2804923 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, Core schema has no distinctions from JSON schema is JS-YAML. - //we need to validate every server specified in the document - srvsMap.forEach((server, serverName) => { - const serverSecInfo = server.security; - if (!serverSecInfo) return true; - //server security info is an array of many possible values - serverSecInfo.forEach(secObj => { - Object.keys(secObj).forEach(secName => { - //security schema is located in components object, we need to find if there is security schema with the same name as the server security info object - const schema = findSecuritySchema(secName, parsedJSON.components); - const srvrSecurityPath = `${serverName}/security/${secName}`; - if (!schema.length) return missingSecSchema.set(srvrSecurityPath); - //findSecuritySchema returns type always on index 1. Type is needed further to validate if server security info can be or not an empty array - const schemaType = schema[1]; - if (!isSrvrSecProperArray(schemaType, specialSecTypes, secObj, secName)) invalidSecurityValues.set(srvrSecurityPath, schemaType); - }); - }); - }); +module.exports = __nccwpck_require__(9531); - if (missingSecSchema.size) { - throw new ParserError({ - type: validationError, - title: 'Server security name must correspond to a security scheme which is declared in the security schemes under the components object.', - parsedJSON, - validationErrors: groupValidationErrors(root, 'doesn\'t have a corresponding security schema under the components object', missingSecSchema, asyncapiYAMLorJSON, initialFormat) - }); - } - if (invalidSecurityValues.size) { - throw new ParserError({ - type: validationError, - title: 'Server security value must be an empty array if corresponding security schema type is not oauth2 or openIdConnect.', - parsedJSON, - validationErrors: groupValidationErrors(root, 'security info must have an empty array because its corresponding security schema type is', invalidSecurityValues, asyncapiYAMLorJSON, initialFormat) - }); - } +/***/ }), - return true; -} +/***/ 81448: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Searches for server security corresponding object in security schema object - * @private - * @param {String} securityName name of the server security element that you want to localize in the security schema object - * @param {Object} components components object from the AsyncAPI document - * @returns {String[]} there are 2 elements in array, index 0 is the name of the security schema object and index 1 is it's type - */ -function findSecuritySchema(securityName, components) { - const secSchemes = components && components.securitySchemes; - const secSchemesMap = secSchemes ? new Map(Object.entries(secSchemes)) : new Map(); - const schemaInfo = []; +"use strict"; +// JS-YAML's default schema for `safeLoad` function. +// It is not described in the YAML specification. +// +// This schema is based on standard YAML's Core schema and includes most of +// extra types described at YAML tag repository. (http://yaml.org/type/) - //using for loop here as there is no point to iterate over all entries as it is enough to find first matching element - for (const [schemaName, schema] of secSchemesMap.entries()) { - if (schemaName === securityName) { - schemaInfo.push(schemaName, schema.type); - return schemaInfo; - } - } - return schemaInfo; -} -/** - * Validates if given server security is a proper empty array when security type requires it - * @private - * @param {String} schemaType security type, like httpApiKey or userPassword - * @param {String[]} specialSecTypes list of special types that do not have to be an empty array - * @param {Object} secObj server security object - * @param {String} secName name os server security object - * @returns {String[]} there are 2 elements in array, index 0 is the name of the security schema object and index 1 is it's type - */ -function isSrvrSecProperArray(schemaType, specialSecTypes, secObj, secName) { - if (!specialSecTypes.includes(schemaType)) { - const securityObjValue = secObj[String(secName)]; - return !securityObjValue.length; - } - return true; -} -/** - * Validates if parameters specified in the channel have corresponding parameters object defined and if name does not contain url parameters - * - * @private - * @param {Object} parsedJSON parsed AsyncAPI document - * @param {String} asyncapiYAMLorJSON AsyncAPI document in string - * @param {String} initialFormat information of the document was oryginally JSON or YAML - * @returns {Boolean} true in case the document is valid, otherwise throws ParserError - */ -function validateChannels(parsedJSON, asyncapiYAMLorJSON, initialFormat) { - const chnls = parsedJSON.channels; - if (!chnls) return true; +module.exports = __nccwpck_require__(84030).extend({ + implicit: [ + __nccwpck_require__(65821), + __nccwpck_require__(50718) + ], + explicit: [ + __nccwpck_require__(27731), + __nccwpck_require__(40564), + __nccwpck_require__(61589), + __nccwpck_require__(80986) + ] +}); - const chnlsMap = new Map(Object.entries(chnls)); - const notProvidedParams = new Map(); //return object for missing parameters - const invalidChannelName = new Map(); //return object for invalid channel names with query parameters - chnlsMap.forEach((val, key) => { - const variables = parseUrlVariables(key); - const notProvidedChannelParams = notProvidedParams.get(tilde(key)); - const queryParameters = parseUrlQueryParameters(key); - - //channel variable validation: fill return obeject with missing parameters - if (variables) { - setNotProvidedParams(variables, val, key, notProvidedChannelParams, notProvidedParams); - } +/***/ }), - //channel name validation: fill return object with channels containing query parameters - if (queryParameters) { - invalidChannelName.set(tilde(key), - queryParameters); - } - }); +/***/ 59056: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - //combine validation errors of both checks and output them as one array - const parameterValidationErrors = groupValidationErrors('channels', 'channel does not have a corresponding parameter object for', notProvidedParams, asyncapiYAMLorJSON, initialFormat); - const nameValidationErrors = groupValidationErrors('channels', 'channel contains invalid name with url query parameters', invalidChannelName, asyncapiYAMLorJSON, initialFormat); - const allValidationErrors = parameterValidationErrors.concat(nameValidationErrors); +"use strict"; +// Standard YAML's Failsafe schema. +// http://www.yaml.org/spec/1.2/spec.html#id2802346 - //channel variable validation: throw exception if channel validation failes - if (notProvidedParams.size || invalidChannelName.size) { - throw new ParserError({ - type: validationError, - title: 'Channel validation failed', - parsedJSON, - validationErrors: allValidationErrors - }); - } - return true; -} -module.exports = { - validateServerVariables, - validateOperationId, - validateServerSecurity, - validateChannels -}; + + +var Schema = __nccwpck_require__(78583); + + +module.exports = new Schema({ + explicit: [ + __nccwpck_require__(98225), + __nccwpck_require__(37331), + __nccwpck_require__(23412) + ] +}); /***/ }), -/***/ 21978: -/***/ ((module) => { +/***/ 9531: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const ERROR_URL_PREFIX = 'https://github.com/asyncapi/parser-js/'; +"use strict"; +// Standard YAML's JSON schema. +// http://www.yaml.org/spec/1.2/spec.html#id2803231 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, this schema is not such strict as defined in the YAML specification. +// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. -const buildError = (from, to) => { - to.type = from.type.startsWith(ERROR_URL_PREFIX) ? from.type : `${ERROR_URL_PREFIX}${from.type}`; - to.title = from.title; - if (from.detail) to.detail = from.detail; - if (from.validationErrors) to.validationErrors = from.validationErrors; - if (from.parsedJSON) to.parsedJSON = from.parsedJSON; - if (from.location) to.location = from.location; - if (from.refs) to.refs = from.refs; - return to; -}; -/** - * Represents an error while trying to parse an AsyncAPI document. - * @alias module:@asyncapi/parser#ParserError - * @extends Error - */ -class ParserError extends Error { - /** - * Instantiates an error - * @param {Object} definition - * @param {String} definition.type The type of the error. - * @param {String} definition.title The message of the error. - * @param {String} [definition.detail] A string containing more detailed information about the error. - * @param {Object} [definition.parsedJSON] The resulting JSON after YAML transformation. Or the JSON object if the this was the initial format. - * @param {Object[]} [definition.validationErrors] The errors resulting from the validation. For more information, see https://www.npmjs.com/package/better-ajv-errors. - * @param {String} definition.validationErrors.title A validation error message. - * @param {String} definition.validationErrors.jsonPointer The path to the field that contains the error. Uses JSON Pointer format. - * @param {Number} definition.validationErrors.startLine The line where the error starts in the AsyncAPI document. - * @param {Number} definition.validationErrors.startColumn The column where the error starts in the AsyncAPI document. - * @param {Number} definition.validationErrors.startOffset The offset (starting from the beginning of the document) where the error starts in the AsyncAPI document. - * @param {Number} definition.validationErrors.endLine The line where the error ends in the AsyncAPI document. - * @param {Number} definition.validationErrors.endColumn The column where the error ends in the AsyncAPI document. - * @param {Number} definition.validationErrors.endOffset The offset (starting from the beginning of the document) where the error ends in the AsyncAPI document. - * @param {Object} [definition.location] Error location details after trying to parse an invalid JSON or YAML document. - * @param {Number} definition.location.startLine The line of the YAML/JSON document where the error starts. - * @param {Number} definition.location.startColumn The column of the YAML/JSON document where the error starts. - * @param {Number} definition.location.startOffset The offset (starting from the beginning of the document) where the error starts in the YAML/JSON AsyncAPI document. - * @param {Object[]} [definition.refs] Error details after trying to resolve $ref's. - * @param {String} definition.refs.title A validation error message. - * @param {String} definition.refs.jsonPointer The path to the field that contains the error. Uses JSON Pointer format. - * @param {Number} definition.refs.startLine The line where the error starts in the AsyncAPI document. - * @param {Number} definition.refs.startColumn The column where the error starts in the AsyncAPI document. - * @param {Number} definition.refs.startOffset The offset (starting from the beginning of the document) where the error starts in the AsyncAPI document. - * @param {Number} definition.refs.endLine The line where the error ends in the AsyncAPI document. - * @param {Number} definition.refs.endColumn The column where the error ends in the AsyncAPI document. - * @param {Number} definition.refs.endOffset The offset (starting from the beginning of the document) where the error ends in the AsyncAPI document. - */ - constructor(def) { - super(); - buildError(def, this); - this.message = def.title; - } - /** - * Returns a JS object representation of the error. - */ - toJS() { - return buildError(this, {}); - } -} -module.exports = ParserError; + +module.exports = __nccwpck_require__(59056).extend({ + implicit: [ + __nccwpck_require__(21471), + __nccwpck_require__(18769), + __nccwpck_require__(58884), + __nccwpck_require__(68155) + ] +}); /***/ }), -/***/ 44479: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 99152: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const parser = __webpack_require__(32720); -const defaultAsyncAPISchemaParser = __webpack_require__(69162); +"use strict"; -parser.registerSchemaParser(defaultAsyncAPISchemaParser); -module.exports = parser; +var common = __nccwpck_require__(33198); -/***/ }), -/***/ 78280: -/***/ ((module) => { +// get snippet for a single line, respecting maxLength +function getLine(buffer, lineStart, lineEnd, position, maxLineLength) { + var head = ''; + var tail = ''; + var maxHalfLength = Math.floor(maxLineLength / 2) - 1; -module.exports = (txt, reviver, context = 20) => { - try { - return JSON.parse(txt, reviver); - } catch (e) { - handleJsonNotString(txt); - const syntaxErr = e.message.match(/^Unexpected token.*position\s+(\d+)/i); - const errIdxBrokenJson = e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1 : null; - const errIdx = syntaxErr ? +syntaxErr[1] : errIdxBrokenJson; - handleErrIdxNotNull(e, txt, errIdx, context); - e.offset = errIdx; - const lines = txt.substr(0, errIdx).split('\n'); - e.startLine = lines.length; - e.startColumn = lines[lines.length - 1].length; - throw e; + if (position - lineStart > maxHalfLength) { + head = ' ... '; + lineStart = position - maxHalfLength + head.length; } -}; -function handleJsonNotString(txt) { - if (typeof txt !== 'string') { - const isEmptyArray = Array.isArray(txt) && txt.length === 0; - const errorMessage = `Cannot parse ${ - isEmptyArray ? 'an empty array' : String(txt)}`; - throw new TypeError(errorMessage); + if (lineEnd - position > maxHalfLength) { + tail = ' ...'; + lineEnd = position + maxHalfLength - tail.length; } -} -function handleErrIdxNotNull(e, txt, errIdx, context) { - if (errIdx !== null) { - const start = errIdx <= context - ? 0 - : errIdx - context; - const end = errIdx + context >= txt.length - ? txt.length - : errIdx + context; - e.message += ` while parsing near '${ - start === 0 ? '' : '...' - }${txt.slice(start, end)}${ - end === txt.length ? '' : '...' - }'`; - } else { - e.message += ` while parsing '${txt.slice(0, context * 2)}'`; - } + return { + str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail, + pos: position - lineStart + head.length // relative position + }; } -/***/ }), - -/***/ 58052: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const { getMapValueByKey } = __webpack_require__(12065); +function padStart(string, max) { + return common.repeat(' ', max - string.length) + string; +} -/** - * Implements functions to deal with the common Bindings object. - * @mixin - */ -const MixinBindings = { - /** - * @returns {boolean} - */ - hasBindings() { - return !!(this._json.bindings && Object.keys(this._json.bindings).length); - }, - /** - * @returns {Object} - */ - bindings() { - return this.hasBindings() ? this._json.bindings : {}; - }, +function makeSnippet(mark, options) { + options = Object.create(options || null); - /** - * @returns {string[]} - */ - bindingProtocols() { - return Object.keys(this.bindings()); - }, + if (!mark.buffer) return null; - /** - * @param {string} name - Name of the binding. - * @returns {boolean} - */ - hasBinding(name) { - return this.hasBindings() && !!this._json.bindings[String(name)]; - }, + if (!options.maxLength) options.maxLength = 79; + if (typeof options.indent !== 'number') options.indent = 1; + if (typeof options.linesBefore !== 'number') options.linesBefore = 3; + if (typeof options.linesAfter !== 'number') options.linesAfter = 2; - /** - * @param {string} name - Name of the binding. - * @returns {(Object | null)} - */ - binding(name) { - return getMapValueByKey(this._json.bindings, name); - }, -}; + var re = /\r?\n|\r|\0/g; + var lineStarts = [ 0 ]; + var lineEnds = []; + var match; + var foundLineNo = -1; -module.exports = MixinBindings; + while ((match = re.exec(mark.buffer))) { + lineEnds.push(match.index); + lineStarts.push(match.index + match[0].length); + if (mark.position <= match.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; + } + } -/***/ }), + if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; -/***/ 13518: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + var result = '', i, line; + var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); -const { getMapValueByKey } = __webpack_require__(12065); + for (i = 1; i <= options.linesBefore; i++) { + if (foundLineNo - i < 0) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo - i], + lineEnds[foundLineNo - i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), + maxLineLength + ); + result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n' + result; + } + + line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n'; + + for (i = 1; i <= options.linesAfter; i++) { + if (foundLineNo + i >= lineEnds.length) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo + i], + lineEnds[foundLineNo + i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), + maxLineLength + ); + result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + } -/** - * Implements functions to deal with the description field. - * @mixin - */ -const MixinDescription = { - /** - * @returns {boolean} - */ - hasDescription() { - return !!this._json.description; - }, + return result.replace(/\n$/, ''); +} - /** - * @returns {(string | null)} - */ - description() { - return getMapValueByKey(this._json, 'description'); - }, -}; -module.exports = MixinDescription; +module.exports = makeSnippet; /***/ }), -/***/ 44001: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const { getMapValueOfType } = __webpack_require__(12065); - -const ExternalDocs = __webpack_require__(89147); - -/** - * Implements functions to deal with the ExternalDocs object. - * @mixin - */ -const MixinExternalDocs = { - /** - * @returns {boolean} - */ - hasExternalDocs() { - return !!(this._json.externalDocs && Object.keys(this._json.externalDocs).length); - }, +/***/ 63820: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * @returns {(ExternalDocs | null)} - */ - externalDocs() { - return getMapValueOfType(this._json, 'externalDocs', ExternalDocs); - }, -}; +"use strict"; -module.exports = MixinExternalDocs; +var YAMLException = __nccwpck_require__(7987); -/***/ }), +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'multi', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'representName', + 'defaultStyle', + 'styleAliases' +]; -/***/ 25999: -/***/ ((module) => { +var YAML_NODE_KINDS = [ + 'scalar', + 'sequence', + 'mapping' +]; -/** - * Implements functions to deal with the SpecificationExtensions object. - * @mixin - */ -const MixinSpecificationExtensions = { - /** - * @returns {boolean} - */ - hasExtensions() { - return !!this.extensionKeys().length; - }, +function compileStyleAliases(map) { + var result = {}; - /** - * @returns {Object} - */ - extensions() { - const result = {}; - Object.entries(this._json).forEach(([key, value]) => { - if ((/^x-[\w\d\.\-\_]+$/).test(key)) { - result[String(key)] = value; - } + if (map !== null) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); }); - return result; - }, - - /** - * @returns {string[]} - */ - extensionKeys() { - return Object.keys(this.extensions()); - }, + } - /** - * @returns {string[]} - */ - extKeys() { - return this.extensionKeys(); - }, + return result; +} - /** - * @param {string} key - Extension key. - * @returns {boolean} - */ - hasExtension(key) { - if (!key.startsWith('x-')) { - return false; - } - return !!this._json[String(key)]; - }, +function Type(tag, options) { + options = options || {}; - /** - * @param {string} key - Extension key. - * @returns {any} - */ - extension(key) { - if (!key.startsWith('x-')) { - return null; + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); } - return this._json[String(key)]; - }, + }); - /** - * @param {string} key - Extension key. - * @returns {boolean} - */ - hasExt(key) { - return this.hasExtension(key); - }, + // TODO: Add tag format check. + this.options = options; // keep original options in case user wants to extend this type later + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.representName = options['representName'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.multi = options['multi'] || false; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); - /** - * @param {string} key - Extension key. - * @returns {any} - */ - ext(key) { - return this.extension(key); - }, -}; + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} -module.exports = MixinSpecificationExtensions; +module.exports = Type; /***/ }), -/***/ 74301: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 27731: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const Tag = __webpack_require__(71238); +"use strict"; -/** - * Implements functions to deal with the Tags object. - * @mixin - */ -const MixinTags = { - /** - * @returns {boolean} - */ - hasTags() { - return !!(Array.isArray(this._json.tags) && this._json.tags.length); - }, - /** - * @returns {Tag[]} - */ - tags() { - return this.hasTags() ? this._json.tags.map(t => new Tag(t)) : []; - }, +/*eslint-disable no-bitwise*/ - /** - * @returns {string[]} - */ - tagNames() { - return this.hasTags() ? this._json.tags.map(t => t.name) : []; - }, - /** - * @param {string} name - Name of the tag. - * @returns {boolean} - */ - hasTag(name) { - return this.hasTags() && this._json.tags.some(t => t.name === name); - }, +var Type = __nccwpck_require__(63820); - /** - * @param {string} name - Name of the tag. - * @returns {(Tag | null)} - */ - tag(name) { - const tg = this.hasTags() && this._json.tags.find(t => t.name === name); - return tg ? new Tag(tg) : null; - }, -}; -module.exports = MixinTags; +// [ 64, 65, 66 ] -> [ padding, CR, LF ] +var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; -/***/ }), +function resolveYamlBinary(data) { + if (data === null) return false; -/***/ 41527: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; -const { createMapOfType, getMapValueOfType, mix } = __webpack_require__(12065); + // Convert one by one. + for (idx = 0; idx < max; idx++) { + code = map.indexOf(data.charAt(idx)); -const Base = __webpack_require__(69281); -const Info = __webpack_require__(72420); -const Server = __webpack_require__(27549); -const Channel = __webpack_require__(50342); -const Components = __webpack_require__(14396); + // Skip CR/LF + if (code > 64) continue; -const MixinExternalDocs = __webpack_require__(44001); -const MixinTags = __webpack_require__(74301); -const MixinSpecificationExtensions = __webpack_require__(25999); + // Fail on illegal characters + if (code < 0) return false; -const xParserMessageName = 'x-parser-message-name'; -const xParserSchemaId = 'x-parser-schema-id'; -const xParserCircle = 'x-parser-circular'; -const xParserCircleProps = 'x-parser-circular-props'; + bitlen += 6; + } -/** - * Implements functions to deal with the AsyncAPI document. - * @class - * @alias module:@asyncapi/parser#AsyncAPIDocument - * @extends Base - * @mixes MixinTags - * @mixes MixinExternalDocs - * @mixes MixinSpecificationExtensions - * @returns {AsyncAPIDocument} - */ -class AsyncAPIDocument extends Base { - constructor(...args) { - super(...args); + // If there are any bits left, source was corrupted + return (bitlen % 8) === 0; +} - assignNameToAnonymousMessages(this); - assignNameToComponentMessages(this); +function constructYamlBinary(data) { + var idx, tailbits, + input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan + max = input.length, + map = BASE64_MAP, + bits = 0, + result = []; - assignUidToComponentSchemas(this); - assignUidToParameterSchemas(this); - assignIdToAnonymousSchemas(this); - } + // Collect by 6*4 bits (3 bytes) - /** - * @returns {string} - */ - version() { - return this._json.asyncapi; - } + for (idx = 0; idx < max; idx++) { + if ((idx % 4 === 0) && idx) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } - /** - * @returns {Info} - */ - info() { - return new Info(this._json.info); + bits = (bits << 6) | map.indexOf(input.charAt(idx)); } - /** - * @returns {string} - */ - id() { - return this._json.id; - } + // Dump tail - /** - * @returns {boolean} - */ - hasServers() { - return !!this._json.servers; - } + tailbits = (max % 4) * 6; - /** - * @returns {Object} - */ - servers() { - return createMapOfType(this._json.servers, Server); + if (tailbits === 0) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } else if (tailbits === 18) { + result.push((bits >> 10) & 0xFF); + result.push((bits >> 2) & 0xFF); + } else if (tailbits === 12) { + result.push((bits >> 4) & 0xFF); } - /** - * @param {string} name - Name of the server. - * @returns {Server} - */ - server(name) { - return getMapValueOfType(this._json.servers, name, Server); - } + return new Uint8Array(result); +} - /** - * @returns {boolean} - */ - hasChannels() { - return !!this._json.channels; - } +function representYamlBinary(object /*, style*/) { + var result = '', bits = 0, idx, tail, + max = object.length, + map = BASE64_MAP; - /** - * @returns {Object} - */ - channels() { - return createMapOfType(this._json.channels, Channel, this); - } + // Convert every three bytes to 4 ASCII characters. - /** - * @returns {string[]} - */ - channelNames() { - if (!this._json.channels) return []; - return Object.keys(this._json.channels); - } + for (idx = 0; idx < max; idx++) { + if ((idx % 3 === 0) && idx) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } - /** - * @param {string} name - Name of the channel. - * @returns {Channel} - */ - channel(name) { - return getMapValueOfType(this._json.channels, name, Channel, this); + bits = (bits << 8) + object[idx]; } - /** - * @returns {string} - */ - defaultContentType() { - return this._json.defaultContentType || null; - } + // Dump tail - /** - * @returns {boolean} - */ - hasComponents() { - return !!this._json.components; - } + tail = max % 3; - /** - * @returns {Components} - */ - components() { - if (!this._json.components) return null; - return new Components(this._json.components); + if (tail === 0) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } else if (tail === 2) { + result += map[(bits >> 10) & 0x3F]; + result += map[(bits >> 4) & 0x3F]; + result += map[(bits << 2) & 0x3F]; + result += map[64]; + } else if (tail === 1) { + result += map[(bits >> 2) & 0x3F]; + result += map[(bits << 4) & 0x3F]; + result += map[64]; + result += map[64]; } - /** - * @returns {boolean} - */ - hasMessages() { - return !!this.allMessages().size; - } + return result; +} - /** - * @returns {Map} - */ - allMessages() { - const messages = new Map(); - - if (this.hasChannels()) { - this.channelNames().forEach(channelName => { - const channel = this.channel(channelName); - if (channel.hasPublish()) { - channel.publish().messages().forEach(m => { - messages.set(m.uid(), m); - }); - } - if (channel.hasSubscribe()) { - channel.subscribe().messages().forEach(m => { - messages.set(m.uid(), m); - }); - } - }); - } - - if (this.hasComponents()) { - Object.values(this.components().messages()).forEach(m => { - messages.set(m.uid(), m); - }); - } - - return messages; - } +function isBinary(obj) { + return Object.prototype.toString.call(obj) === '[object Uint8Array]'; +} - /** - * @returns {Map} - */ - allSchemas() { - const schemas = new Map(); - const callback = (schema) => { - if (schema.uid()) { - schemas.set(schema.uid(), schema); - } - }; - schemaDocument(this, callback); - if (this.hasComponents()) { - Object.values(this.components().schemas()).forEach(s => { - recursiveSchema(s, callback); - }); - } +module.exports = new Type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); - return schemas; - } - /** - * @returns {boolean} - */ - hasCircular() { - return !!this._json[String(xParserCircle)]; - } -} +/***/ }), -/** - * Assign message keys as message name to all the component messages. - * - * @private - * @param {AsyncAPIDocument} doc - */ -function assignNameToComponentMessages(doc) { - if (doc.hasComponents()) { - for (const [key, m] of Object.entries(doc.components().messages())) { - if (m.name() === undefined) { - m.json()[String(xParserMessageName)] = key; - } - } - } -} +/***/ 18769: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Assign parameter keys as uid for the parameter schema. - * - * @private - * @param {AsyncAPIDocument} doc - */ -function assignUidToParameterSchemas(doc) { - doc.channelNames().forEach(channelName => { - const channel = doc.channel(channelName); - for (const [parameterKey, parameterSchema] of Object.entries(channel.parameters())) { - parameterSchema.json()[String(xParserSchemaId)] = parameterKey; - } - }); -} +"use strict"; -/** - * Assign uid to component schemas. - * - * @private - * @param {AsyncAPIDocument} doc - */ -function assignUidToComponentSchemas(doc) { - if (doc.hasComponents()) { - for (const [key, s] of Object.entries(doc.components().schemas())) { - s.json()[String(xParserSchemaId)] = key; - } - } -} -/** - * Assign anonymous names to nameless messages. - * - * @private - * @param {AsyncAPIDocument} doc - */ -function assignNameToAnonymousMessages(doc) { - let anonymousMessageCounter = 0; +var Type = __nccwpck_require__(63820); - if (doc.hasChannels()) { - doc.channelNames().forEach(channelName => { - const channel = doc.channel(channelName); - if (channel.hasPublish()) addNameToKey(channel.publish().messages(),++anonymousMessageCounter); - if (channel.hasSubscribe()) addNameToKey(channel.subscribe().messages(),++anonymousMessageCounter); - }); - } +function resolveYamlBoolean(data) { + if (data === null) return false; + + var max = data.length; + + return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || + (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); } -/** - * Add anonymous name to key if no name provided. - * - * @private - * @param {Message} map of messages - */ -function addNameToKey(messages, number) { - messages.forEach(m => { - if (m.name() === undefined) { - m.json()[String(xParserMessageName)] = ``; - } - }); +function constructYamlBoolean(data) { + return data === 'true' || + data === 'True' || + data === 'TRUE'; } -/** - * Function that indicates that a circular reference was detected. - * @private - * @param {Schema} schema schema that is currently accessed and need to be checked if it is a first time - * @param {Array} seenObjects list of objects that were already seen during recursion - */ -function isCircular(schema, seenObjects) { - return seenObjects.includes(schema.json()); +function isBoolean(object) { + return Object.prototype.toString.call(object) === '[object Boolean]'; } -/** - * Mark schema as being a circular ref - * - * @private - * @param {Schema} schema schema that should be marked as circular - */ -function markCircular(schema, prop) { - if (schema.type() === 'array') return schema.json()[String(xParserCircle)] = true; +module.exports = new Type('tag:yaml.org,2002:bool', { + kind: 'scalar', + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: function (object) { return object ? 'true' : 'false'; }, + uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, + camelcase: function (object) { return object ? 'True' : 'False'; } + }, + defaultStyle: 'lowercase' +}); - const circPropsList = schema.json()[String(xParserCircleProps)] || []; - circPropsList.push(prop); - schema.json()[String(xParserCircleProps)] = circPropsList; -} -/** - * Callback that is called foreach schema found - * @private - * @callback FoundSchemaCallback - * @param {Schema} schema found. -*/ -/** - * Recursively go through each schema and execute callback. - * - * @private - * @param {Schema} schema found. - * @param {FoundSchemaCallback} callback - */ -function recursiveSchema(schemaContent, callback) { - if (schemaContent === null) return; - const seenObj = []; +/***/ }), - return crawl(schemaContent, seenObj, callback); -} +/***/ 68155: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Schema crawler - * - * @private - * @param {Schema} schemaContent schema. - * @param {Array} seenObj schema elements that crowler went through already. - * @param {Function} callback(schema) - * the function that is called foreach schema found. - * schema {Schema}: the found schema. - */ -function crawl(schema, seenObj, callback) { - if (isCircular(schema, seenObj)) return true; +"use strict"; - seenObj.push(schema.json()); - callback(schema); - if (schema.type() !== undefined) { - switch (schema.type()) { - case 'object': - recursiveSchemaObject(schema, seenObj, callback); - break; - case 'array': - recursiveSchemaArray(schema, seenObj, callback); - break; - } - } else { - //check for allOf, oneOf, anyOf - const checkCombiningSchemas = (combineArray) => { - if (combineArray !== null && combineArray.length > 0) { - combineArray.forEach(combineSchema => { - if (crawl(combineSchema, seenObj, callback)) markCircular(schema); - }); - } - }; - checkCombiningSchemas(schema.allOf()); - checkCombiningSchemas(schema.anyOf()); - checkCombiningSchemas(schema.oneOf()); - } - seenObj.pop(); -} +var common = __nccwpck_require__(33198); +var Type = __nccwpck_require__(63820); -/** - * Go through each channel and for each parameter, and message payload and headers recursively call the callback for each schema. - * - * @private - * @param {AsyncAPIDocument} doc - * @param {FoundSchemaCallback} callback - */ -function schemaDocument(doc, callback) { - if (doc.hasChannels()) { - doc.channelNames().forEach(channelName => { - const channel = doc.channel(channelName); +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + + // .inf + '|[-+]?\\.(?:inf|Inf|INF)' + + // .nan + '|\\.(?:nan|NaN|NAN))$'); - Object.values(channel.parameters()).forEach(p => { - recursiveSchema(p.schema(), callback); - }); +function resolveYamlFloat(data) { + if (data === null) return false; - if (channel.hasPublish()) { - channel.publish().messages().forEach(m => { - recursiveSchema(m.headers(), callback); - recursiveSchema(m.payload(), callback); - }); - } - if (channel.hasSubscribe()) { - channel.subscribe().messages().forEach(m => { - recursiveSchema(m.headers(), callback); - recursiveSchema(m.payload(), callback); - }); - } - }); + if (!YAML_FLOAT_PATTERN.test(data) || + // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === '_') { + return false; } -} -/** - * Gives schemas id to all anonymous schemas. - * - * @private - * @param {AsyncAPIDocument} doc - */ -function assignIdToAnonymousSchemas(doc) { - let anonymousSchemaCounter = 0; - const callback = (schema) => { - if (!schema.uid()) { - schema.json()[String(xParserSchemaId)] = ``; - } - }; - schemaDocument(doc, callback); + return true; } -/** - * Recursively go through schema of object type and execute callback. - * - * @private - * @param {Schema} schema Object type. - * @param {Array} seenObj schema elements that crawler went through already. - * @param {Function} callback(schema) - * the function that is called foreach schema found. - * schema {Schema}: the found schema. - */ -function recursiveSchemaObject(schema, seenObj, callback) { - if (schema.additionalProperties() !== undefined && typeof schema.additionalProperties() !== 'boolean') { - const additionalSchema = schema.additionalProperties(); - if (crawl(additionalSchema, seenObj, callback)) markCircular(schema); - } - if (schema.properties() !== null) { - const props = schema.properties(); - for (const [prop, propertySchema] of Object.entries(props)) { - if (crawl(propertySchema, seenObj, callback)) markCircular(schema, prop); - } - } -} +function constructYamlFloat(data) { + var value, sign; -/** - * Recursively go through schema of array type and execute callback. - * - * @private - * @param {Schema} schema Array type. - * @param {Array} seenObj schema elements that crowler went through already. - * @param {Function} callback(schema) - * the function that is called foreach schema found. - * schema {Schema}: the found schema. - */ -function recursiveSchemaArray(schema, seenObj, callback) { - if (schema.additionalItems() !== undefined) { - const additionalArrayItems = schema.additionalItems(); - if (crawl(additionalArrayItems, seenObj, callback)) markCircular(schema); + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + + if ('+-'.indexOf(value[0]) >= 0) { + value = value.slice(1); } - if (schema.items() !== null) { - if (Array.isArray(schema.items())) { - schema.items().forEach(arraySchema => { - if (crawl(arraySchema, seenObj, callback)) markCircular(schema); - }); - } else if (crawl(schema.items(), seenObj, callback)) markCircular(schema); + if (value === '.inf') { + return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + + } else if (value === '.nan') { + return NaN; } + return sign * parseFloat(value, 10); } -module.exports = mix(AsyncAPIDocument, MixinTags, MixinExternalDocs, MixinSpecificationExtensions); +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; -/***/ }), +function representYamlFloat(object, style) { + var res; -/***/ 69281: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (isNaN(object)) { + switch (style) { + case 'lowercase': return '.nan'; + case 'uppercase': return '.NAN'; + case 'camelcase': return '.NaN'; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; + } + } else if (common.isNegativeZero(object)) { + return '-0.0'; + } -const ParserError = __webpack_require__(21978); + res = object.toString(10); -/** - * Implements common functionality for all the models. - * @class - * @alias module:@asyncapi/parser#Base - * @returns {Base} - */ -class Base { - constructor (json) { - if (!json) throw new ParserError(`Invalid JSON to instantiate the ${this.constructor.name} object.`); - this._json = json; - } + // JS stringifier can build scientific format without dots: 5e-100, + // while YAML requres dot: 5.e-100. Fix it with simple hack - /** - * @returns {any} - */ - json(key) { - if (key === undefined) return this._json; - if (!this._json) return; - return this._json[String(key)]; - } + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; } -module.exports = Base; +function isFloat(object) { + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' +}); /***/ }), -/***/ 80945: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 58884: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { mix } = __webpack_require__(12065); +"use strict"; -const Base = __webpack_require__(69281); -const Schema = __webpack_require__(36659); -const MixinDescription = __webpack_require__(13518); -const MixinSpecificationExtensions = __webpack_require__(25999); +var common = __nccwpck_require__(33198); +var Type = __nccwpck_require__(63820); -/** - * Implements functions to deal with a ChannelParameter object. - * @class - * @alias module:@asyncapi/parser#ChannelParameter - * @extends Base - * @mixes MixinDescription - * @mixes MixinSpecificationExtensions - * @returns {ChannelParameter} - */ -class ChannelParameter extends Base { - /** - * @returns {string} - */ - location() { - return this._json.location; - } - - /** - * @returns {Schema} - */ - schema() { - if (!this._json.schema) return null; - return new Schema(this._json.schema); - } +function isHexCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || + ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || + ((0x61/* a */ <= c) && (c <= 0x66/* f */)); } -module.exports = mix(ChannelParameter, MixinDescription, MixinSpecificationExtensions); - - -/***/ }), +function isOctCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); +} -/***/ 50342: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +function isDecCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); +} -const { createMapOfType, getMapValueOfType, mix } = __webpack_require__(12065); +function resolveYamlInteger(data) { + if (data === null) return false; -const Base = __webpack_require__(69281); -const ChannelParameter = __webpack_require__(80945); -const PublishOperation = __webpack_require__(45460); -const SubscribeOperation = __webpack_require__(99065); + var max = data.length, + index = 0, + hasDigits = false, + ch; -const MixinDescription = __webpack_require__(13518); -const MixinBindings = __webpack_require__(58052); -const MixinSpecificationExtensions = __webpack_require__(25999); + if (!max) return false; -/** - * Implements functions to deal with a Channel object. - * @class - * @alias module:@asyncapi/parser#Channel - * @extends Base - * @mixes MixinDescription - * @mixes MixinBindings - * @mixes MixinSpecificationExtensions - * @returns {Channel} - */ -class Channel extends Base { - /** - * @returns {Object} - */ - parameters() { - return createMapOfType(this._json.parameters, ChannelParameter); - } + ch = data[index]; - /** - * @param {string} name - Name of the parameter. - * @returns {ChannelParameter} - */ - parameter(name) { - return getMapValueOfType(this._json.parameters, name, ChannelParameter); + // sign + if (ch === '-' || ch === '+') { + ch = data[++index]; } - /** - * @returns {boolean} - */ - hasParameters() { - return !!this._json.parameters; - } + if (ch === '0') { + // 0 + if (index + 1 === max) return true; + ch = data[++index]; - /** - * @returns {PublishOperation} - */ - publish() { - if (!this._json.publish) return null; - return new PublishOperation(this._json.publish); - } + // base 2, base 8, base 16 - /** - * @returns {SubscribeOperation} - */ - subscribe() { - if (!this._json.subscribe) return null; - return new SubscribeOperation(this._json.subscribe); - } + if (ch === 'b') { + // base 2 + index++; - /** - * @returns {boolean} - */ - hasPublish() { - return !!this._json.publish; - } + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch !== '0' && ch !== '1') return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } - /** - * @returns {boolean} - */ - hasSubscribe() { - return !!this._json.subscribe; - } -} -module.exports = mix(Channel, MixinDescription, MixinBindings, MixinSpecificationExtensions); + if (ch === 'x') { + // base 16 + index++; + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } -/***/ }), -/***/ 14396: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (ch === 'o') { + // base 8 + index++; -const { createMapOfType, getMapValueOfType, mix } = __webpack_require__(12065); + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + } -const Base = __webpack_require__(69281); -const Message = __webpack_require__(49739); -const Schema = __webpack_require__(36659); -const SecurityScheme = __webpack_require__(53601); -const ChannelParameter = __webpack_require__(80945); -const CorrelationId = __webpack_require__(89843); -const OperationTrait = __webpack_require__(61348); -const MessageTrait = __webpack_require__(2888); + // base 10 (except 0) -const MixinSpecificationExtensions = __webpack_require__(25999); + // value should not start with `_`; + if (ch === '_') return false; -/** - * Implements functions to deal with a Components object. - * @class - * @alias module:@asyncapi/parser#Components - * @extends Base - * @mixes MixinSpecificationExtensions - * @returns {Components} - */ -class Components extends Base { - /** - * @returns {Object} - */ - messages() { - return createMapOfType(this._json.messages, Message); + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; } - /** - * @returns {Message} - */ - message(name) { - return getMapValueOfType(this._json.messages, name, Message); - } - - /** - * @returns {Object} - */ - schemas() { - return createMapOfType(this._json.schemas, Schema); - } + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; - /** - * @returns {Schema} - */ - schema(name) { - return getMapValueOfType(this._json.schemas, name, Schema); - } - - /** - * @returns {Object} - */ - securitySchemes() { - return createMapOfType(this._json.securitySchemes, SecurityScheme); - } - - /** - * @returns {SecurityScheme} - */ - securityScheme(name) { - return getMapValueOfType(this._json.securitySchemes, name, SecurityScheme); - } - - /** - * @returns {Object} - */ - parameters() { - return createMapOfType(this._json.parameters, ChannelParameter); - } + return true; +} - /** - * @returns {ChannelParameter} - */ - parameter(name) { - return getMapValueOfType(this._json.parameters, name, ChannelParameter); - } - - /** - * @returns {Object} - */ - correlationIds() { - return createMapOfType(this._json.correlationIds, CorrelationId); - } +function constructYamlInteger(data) { + var value = data, sign = 1, ch; - /** - * @returns {CorrelationId} - */ - correlationId(name) { - return getMapValueOfType(this._json.correlationIds, name, CorrelationId); - } - - /** - * @returns {Object} - */ - operationTraits() { - return createMapOfType(this._json.operationTraits, OperationTrait); + if (value.indexOf('_') !== -1) { + value = value.replace(/_/g, ''); } - /** - * @returns {OperationTrait} - */ - operationTrait(name) { - return getMapValueOfType(this._json.operationTraits, name, OperationTrait); - } - - /** - * @returns {Object} - */ - messageTraits() { - return createMapOfType(this._json.messageTraits, MessageTrait); + ch = value[0]; + + if (ch === '-' || ch === '+') { + if (ch === '-') sign = -1; + value = value.slice(1); + ch = value[0]; } - /** - * @returns {MessageTrait} - */ - messageTrait(name) { - return getMapValueOfType(this._json.messageTraits, name, MessageTrait); + if (value === '0') return 0; + + if (ch === '0') { + if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); + if (value[1] === 'x') return sign * parseInt(value.slice(2), 16); + if (value[1] === 'o') return sign * parseInt(value.slice(2), 8); } + + return sign * parseInt(value, 10); } -module.exports = mix(Components, MixinSpecificationExtensions); +function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:int', { + kind: 'scalar', + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, + octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); }, + decimal: function (obj) { return obj.toString(10); }, + /* eslint-disable max-len */ + hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } + }, + defaultStyle: 'decimal', + styleAliases: { + binary: [ 2, 'bin' ], + octal: [ 8, 'oct' ], + decimal: [ 10, 'dec' ], + hexadecimal: [ 16, 'hex' ] + } +}); /***/ }), -/***/ 66913: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - - -const { mix } = __webpack_require__(12065); +/***/ 23412: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const Base = __webpack_require__(69281); +"use strict"; -const MixinSpecificationExtensions = __webpack_require__(25999); -/** - * Implements functions to deal with the Contact object. - * @class - * @alias module:@asyncapi/parser#Contact - * @extends Base - * @mixes MixinSpecificationExtensions - * @returns {Contact} - */ -class Contact extends Base { - /** - * @returns {string} - */ - name() { - return this._json.name; - } - - /** - * @returns {string} - */ - url() { - return this._json.url; - } - - /** - * @returns {string} - */ - email() { - return this._json.email; - } -} +var Type = __nccwpck_require__(63820); -module.exports = mix(Contact, MixinSpecificationExtensions); +module.exports = new Type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } +}); /***/ }), -/***/ 89843: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 50718: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { mix } = __webpack_require__(12065); +"use strict"; -const Base = __webpack_require__(69281); -const MixinDescription = __webpack_require__(13518); -const MixinSpecificationExtensions = __webpack_require__(25999); +var Type = __nccwpck_require__(63820); -/** - * Implements functions to deal with a CorrelationId object. - * @class - * @alias module:@asyncapi/parser#CorrelationId - * @extends Base - * @mixes MixinDescription - * @mixes MixinSpecificationExtensions - * @returns {CorrelationId} - */ -class CorrelationId extends Base { - /** - * @returns {string} - */ - location() { - return this._json.location; - } +function resolveYamlMerge(data) { + return data === '<<' || data === null; } -module.exports = mix(CorrelationId, MixinSpecificationExtensions, MixinDescription); +module.exports = new Type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge +}); /***/ }), -/***/ 89147: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 21471: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { mix } = __webpack_require__(12065); +"use strict"; -const Base = __webpack_require__(69281); -const MixinDescription = __webpack_require__(13518); -const MixinSpecificationExtensions = __webpack_require__(25999); +var Type = __nccwpck_require__(63820); -/** - * Implements functions to deal with an ExternalDocs object. - * @class - * @alias module:@asyncapi/parser#ExternalDocs - * @extends Base - * @mixes MixinDescription - * @mixes MixinSpecificationExtensions - * @returns {ExternalDocs} - */ -class ExternalDocs extends Base { - /** - * @returns {string} - */ - url() { - return this._json.url; - } -} +function resolveYamlNull(data) { + if (data === null) return true; -module.exports = mix(ExternalDocs, MixinDescription, MixinSpecificationExtensions); + var max = data.length; + return (max === 1 && data === '~') || + (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); +} -/***/ }), +function constructYamlNull() { + return null; +} -/***/ 72420: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +function isNull(object) { + return object === null; +} -const { mix } = __webpack_require__(12065); +module.exports = new Type('tag:yaml.org,2002:null', { + kind: 'scalar', + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: function () { return '~'; }, + lowercase: function () { return 'null'; }, + uppercase: function () { return 'NULL'; }, + camelcase: function () { return 'Null'; }, + empty: function () { return ''; } + }, + defaultStyle: 'lowercase' +}); -const Base = __webpack_require__(69281); -const License = __webpack_require__(44352); -const Contact = __webpack_require__(66913); -const MixinDescription = __webpack_require__(13518); -const MixinSpecificationExtensions = __webpack_require__(25999); +/***/ }), -/** - * Implements functions to deal with the Info object. - * @class - * @alias module:@asyncapi/parser#Info - * @extends Base - * @mixes MixinDescription - * @mixes MixinSpecificationExtensions - * @returns {Info} - */ -class Info extends Base { - /** - * @returns {string} - */ - title() { - return this._json.title; - } - - /** - * @returns {string} - */ - version() { - return this._json.version; - } +/***/ 40564: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * @returns {(string | undefined)} - */ - termsOfService() { - return this._json.termsOfService; - } +"use strict"; - /** - * @returns {License} - */ - license() { - if (!this._json.license) return null; - return new License(this._json.license); - } - /** - * @returns {Contact} - */ - contact() { - if (!this._json.contact) return null; - return new Contact(this._json.contact); - } -} +var Type = __nccwpck_require__(63820); -module.exports = mix(Info, MixinDescription, MixinSpecificationExtensions); +var _hasOwnProperty = Object.prototype.hasOwnProperty; +var _toString = Object.prototype.toString; +function resolveYamlOmap(data) { + if (data === null) return true; -/***/ }), + var objectKeys = [], index, length, pair, pairKey, pairHasKey, + object = data; -/***/ 44352: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; -const { mix } = __webpack_require__(12065); + if (_toString.call(pair) !== '[object Object]') return false; -const Base = __webpack_require__(69281); + for (pairKey in pair) { + if (_hasOwnProperty.call(pair, pairKey)) { + if (!pairHasKey) pairHasKey = true; + else return false; + } + } -const MixinSpecificationExtensions = __webpack_require__(25999); + if (!pairHasKey) return false; -/** - * Implements functions to deal with the License object. - * @class - * @alias module:@asyncapi/parser#License - * @extends Base - * @mixes MixinSpecificationExtensions - * @returns {License} - */ -class License extends Base { - /** - * @returns {string} - */ - name() { - return this._json.name; - } - - /** - * @returns {string} - */ - url() { - return this._json.url; + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; } + + return true; } -module.exports = mix(License, MixinSpecificationExtensions); +function constructYamlOmap(data) { + return data !== null ? data : []; +} + +module.exports = new Type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); /***/ }), -/***/ 2888: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 61589: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const MessageTraitable = __webpack_require__(70050); +"use strict"; -/** - * Implements functions to deal with a MessageTrait object. - * @class - * @alias module:@asyncapi/parser#MessageTrait - * @extends MessageTraitable - * @returns {MessageTrait} - */ -class MessageTrait extends MessageTraitable { -} -module.exports = MessageTrait; +var Type = __nccwpck_require__(63820); +var _toString = Object.prototype.toString; -/***/ }), +function resolveYamlPairs(data) { + if (data === null) return true; -/***/ 70050: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + var index, length, pair, keys, result, + object = data; -const { getMapValueOfType, mix } = __webpack_require__(12065); + result = new Array(object.length); -const Base = __webpack_require__(69281); -const Schema = __webpack_require__(36659); -const CorrelationId = __webpack_require__(89843); + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; -const MixinDescription = __webpack_require__(13518); -const MixinExternalDocs = __webpack_require__(44001); -const MixinTags = __webpack_require__(74301); -const MixinBindings = __webpack_require__(58052); -const MixinSpecificationExtensions = __webpack_require__(25999); + if (_toString.call(pair) !== '[object Object]') return false; -/** - * Implements functions to deal with a the common properties that Message and MessageTrait objects have. - * @class - * @alias module:@asyncapi/parser#MessageTraitable - * @extends Base - * @mixes MixinDescription - * @mixes MixinTags - * @mixes MixinExternalDocs - * @mixes MixinBindings - * @mixes MixinSpecificationExtensions - * @returns {MessageTraitable} - */ -class MessageTraitable extends Base { - /** - * @returns {Schema} - */ - headers() { - if (!this._json.headers) return null; - return new Schema(this._json.headers); - } + keys = Object.keys(pair); - /** - * @param {string} name - Name of the header. - * @returns {Schema} - */ - header(name) { - if (!this._json.headers) return null; - return getMapValueOfType(this._json.headers.properties, name, Schema); - } + if (keys.length !== 1) return false; - /** - * @returns {CorrelationId} - */ - correlationId() { - if (!this._json.correlationId) return null; - return new CorrelationId(this._json.correlationId); + result[index] = [ keys[0], pair[keys[0]] ]; } - /** - * @returns {string} - */ - schemaFormat() { - return 'application/schema+json;version=draft-07'; - } + return true; +} - /** - * @returns {string} - */ - contentType() { - return this._json.contentType; - } +function constructYamlPairs(data) { + if (data === null) return []; - /** - * @returns {string} - */ - name() { - return this._json.name; - } + var index, length, pair, keys, result, + object = data; - /** - * @returns {string} - */ - title() { - return this._json.title; - } + result = new Array(object.length); - /** - * @returns {string} - */ - summary() { - return this._json.summary; - } + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; - /** - * @returns {any[]} - */ - examples() { - return this._json.examples; + keys = Object.keys(pair); + + result[index] = [ keys[0], pair[keys[0]] ]; } -} -module.exports = mix(MessageTraitable, MixinDescription, MixinTags, MixinExternalDocs, MixinBindings, MixinSpecificationExtensions); + return result; +} + +module.exports = new Type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); /***/ }), -/***/ 49739: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 37331: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const MessageTraitable = __webpack_require__(70050); -const Schema = __webpack_require__(36659); +"use strict"; -/** - * Implements functions to deal with a Message object. - * @class - * @alias module:@asyncapi/parser#Message - * @extends MessageTraitable - * @returns {Message} - */ -class Message extends MessageTraitable { - /** - * @returns {string} - */ - uid() { - return this.name() || this.ext('x-parser-message-name') || Buffer.from(JSON.stringify(this._json)).toString('base64'); - } - /** - * @returns {Schema} - */ - payload() { - if (!this._json.payload) return null; - return new Schema(this._json.payload); - } +var Type = __nccwpck_require__(63820); - /** - * @returns {any} - */ - originalPayload() { - return this._json['x-parser-original-payload'] || this.payload(); - } +module.exports = new Type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } +}); - /** - * @returns {string} - */ - originalSchemaFormat() { - return this._json['x-parser-original-schema-format'] || this.schemaFormat(); + +/***/ }), + +/***/ 80986: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(63820); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty.call(object, key)) { + if (object[key] !== null) return false; + } } + + return true; } -module.exports = Message; +function constructYamlSet(data) { + return data !== null ? data : {}; +} + +module.exports = new Type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet +}); /***/ }), -/***/ 92548: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 98225: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { mix } = __webpack_require__(12065); +"use strict"; -const Base = __webpack_require__(69281); -const MixinSpecificationExtensions = __webpack_require__(25999); +var Type = __nccwpck_require__(63820); -/** - * Implements functions to deal with a OAuthFlow object. - * @class - * @alias module:@asyncapi/parser#OAuthFlow - * @extends Base - * @mixes MixinSpecificationExtensions - * @returns {OAuthFlow} - */ -class OAuthFlow extends Base { - /** - * @returns {string} - */ - authorizationUrl() { - return this._json.authorizationUrl; - } +module.exports = new Type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } +}); - /** - * @returns {string} - */ - tokenUrl() { - return this._json.tokenUrl; + +/***/ }), + +/***/ 65821: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(63820); + +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + +var YAML_TIMESTAMP_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9]?)' + // [2] month + '-([0-9][0-9]?)' + // [3] day + '(?:[Tt]|[ \\t]+)' + // ... + '([0-9][0-9]?)' + // [4] hour + ':([0-9][0-9])' + // [5] minute + ':([0-9][0-9])' + // [6] second + '(?:\\.([0-9]*))?' + // [7] fraction + '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute + +function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; +} + +function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, date; + + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); + + if (match === null) throw new Error('Date resolve error'); + + // match: [1] year [2] month [3] day + + year = +(match[1]); + month = +(match[2]) - 1; // JS month starts with 0 + day = +(match[3]); + + if (!match[4]) { // no hour + return new Date(Date.UTC(year, month, day)); } - /** - * @returns {string} - */ - refreshUrl() { - return this._json.refreshUrl; + // match: [4] hour [5] minute [6] second [7] fraction + + hour = +(match[4]); + minute = +(match[5]); + second = +(match[6]); + + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { // milli-seconds + fraction += '0'; + } + fraction = +fraction; } - /** - * @returns {Object} - */ - scopes() { - return this._json.scopes; + // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + + if (match[9]) { + tz_hour = +(match[10]); + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds + if (match[9] === '-') delta = -delta; } + + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + + if (delta) date.setTime(date.getTime() - delta); + + return date; } -module.exports = mix(OAuthFlow, MixinSpecificationExtensions); +function representYamlTimestamp(object /*, style*/) { + return object.toISOString(); +} + +module.exports = new Type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); /***/ }), -/***/ 61348: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 89067: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const OperationTraitable = __webpack_require__(62685); +const { avroToJsonSchema } = __nccwpck_require__(71228); -/** - * Implements functions to deal with a OperationTrait object. - * @class - * @alias module:@asyncapi/parser#OperationTrait - * @extends OperationTraitable - * @returns {OperationTrait} - */ -class OperationTrait extends OperationTraitable { -} +module.exports.parse = async ({ message, defaultSchemaFormat }) => { + const transformed = await avroToJsonSchema(message.payload); -module.exports = OperationTrait; + message['x-parser-original-schema-format'] = message.schemaFormat || defaultSchemaFormat; + message['x-parser-original-payload'] = message.payload; + message.payload = transformed; + delete message.schemaFormat; +}; + +module.exports.getMimeTypes = () => { + return [ + 'application/vnd.apache.avro;version=1.9.0', + 'application/vnd.apache.avro+json;version=1.9.0', + 'application/vnd.apache.avro+yaml;version=1.9.0', + 'application/vnd.apache.avro;version=1.8.2', + 'application/vnd.apache.avro+json;version=1.8.2', + 'application/vnd.apache.avro+yaml;version=1.8.2' + ]; +}; /***/ }), -/***/ 62685: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 71228: +/***/ ((module) => { + +const BYTES_PATTERN = '^[\u0000-\u00ff]*$'; +const INT_MIN = Math.pow(-2, 31); +const INT_MAX = Math.pow(2, 31) - 1; +const LONG_MIN = Math.pow(-2, 63); +const LONG_MAX = Math.pow(2, 63) - 1; -const { mix } = __webpack_require__(12065); +const typeMappings = { + null: 'null', + boolean: 'boolean', + int: 'integer', + long: 'integer', + float: 'number', + double: 'number', + bytes: 'string', + string: 'string', + fixed: 'string', + map: 'object', + array: 'array', + enum: 'string', + record: 'object', + uuid: 'string', +}; -const Base = __webpack_require__(69281); +module.exports.avroToJsonSchema = async function avroToJsonSchema(avroDefinition) { + const jsonSchema = {}; + const isUnion = Array.isArray(avroDefinition); -const MixinDescription = __webpack_require__(13518); -const MixinTags = __webpack_require__(74301); -const MixinExternalDocs = __webpack_require__(44001); -const MixinBindings = __webpack_require__(58052); -const MixinSpecificationExtensions = __webpack_require__(25999); + if (isUnion) { + jsonSchema.oneOf = []; + for (const avroDef of avroDefinition) { + const def = await avroToJsonSchema(avroDef); + jsonSchema.oneOf.push(def); + } -/** - * Implements functions to deal with the common properties Operation and OperationTrait object have. - * @class - * @alias module:@asyncapi/parser#OperationTraitable - * @extends Base - * @mixes MixinDescription - * @mixes MixinTags - * @mixes MixinExternalDocs - * @mixes MixinBindings - * @mixes MixinSpecificationExtensions - * @returns {OperationTraitable} - */ -class OperationTraitable extends Base { - /** - * @returns {string} - */ - id() { - return this._json.operationId; + return jsonSchema; } - /** - * @returns {string} - */ - summary() { - return this._json.summary; + // Avro definition can be a string (e.g. "int") + // or an object like { type: "int" } + const type = avroDefinition.type || avroDefinition; + jsonSchema.type = typeMappings[type]; + + switch (type) { + case 'int': + jsonSchema.minimum = INT_MIN; + jsonSchema.maximum = INT_MAX; + break; + case 'long': + jsonSchema.minimum = LONG_MIN; + jsonSchema.maximum = LONG_MAX; + break; + case 'bytes': + jsonSchema.pattern = BYTES_PATTERN; + break; + case 'fixed': + jsonSchema.pattern = BYTES_PATTERN; + jsonSchema.minLength = avroDefinition.size; + jsonSchema.maxLength = avroDefinition.size; + break; + case 'map': + jsonSchema.additionalProperties = await avroToJsonSchema(avroDefinition.values); + break; + case 'array': + jsonSchema.items = await avroToJsonSchema(avroDefinition.items); + break; + case 'enum': + jsonSchema.enum = avroDefinition.symbols; + break; + case 'record': + const propsMap = new Map(); + for (const field of avroDefinition.fields) { + const def = await avroToJsonSchema(field.type); + if (field.doc) def.description = field.doc; + if (field.default) def.default = field.default; + propsMap.set(field.name, def); + } + jsonSchema.properties = Object.fromEntries(propsMap.entries()); + break; } -} -module.exports = mix(OperationTraitable, MixinDescription, MixinTags, MixinExternalDocs, MixinBindings, MixinSpecificationExtensions); + if (avroDefinition.doc) jsonSchema.description = avroDefinition.doc; + if (avroDefinition.default !== undefined) jsonSchema.default = avroDefinition.default; + + return jsonSchema; +}; /***/ }), -/***/ 35682: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 7066: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -const OperationTraitable = __webpack_require__(62685); -const Message = __webpack_require__(49739); +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.FilePropTypes = void 0; +var jsx_runtime_1 = __nccwpck_require__(77392); +var prop_types_1 = __importDefault(__nccwpck_require__(62239)); +exports.FilePropTypes = { + /** + * `name` prop describes the filename for which should be used when generating the file. If none is specified the filename for the template are used. + */ + name: prop_types_1.default.string, + /** + * `permissions` prop describes the permissions the file should be created with. This is interpreted as an octal number such as 0o777 + */ + permissions: prop_types_1.default.number, +}; /** - * Implements functions to deal with an Operation object. - * @class - * @alias module:@asyncapi/parser#Operation - * @extends OperationTraitable - * @returns {Operation} + * Component is used to describe to the generator that you want a file to be created and rendered based on the defined children. + * + * @component + * @example + * const name = "test.js" + * const permissions = 0o777 + * return ( + * Test + * ) */ -class Operation extends OperationTraitable { - /** - * @returns {boolean} - */ - hasMultipleMessages() { - if (this._json.message && this._json.message.oneOf && this._json.message.oneOf.length > 1) return true; - if (!this._json.message) return false; - return false; - } - - /** - * @returns {Message[]} - */ - messages() { - if (!this._json.message) return []; - if (this._json.message.oneOf) return this._json.message.oneOf.map(m => new Message(m)); - return [new Message(this._json.message)]; - } - - /** - * @returns {Message} - */ - message(index) { - if (!this._json.message) return null; - if (!this._json.message.oneOf) return new Message(this._json.message); - if (typeof index !== 'number') return null; - if (index > this._json.message.oneOf.length - 1) return null; - return new Message(this._json.message.oneOf[+index]); - } -} +var File = function (_a) { + var children = _a.children; + return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: children }, void 0); +}; +File.propTypes = __assign({}, exports.FilePropTypes); +exports.default = File; +//# sourceMappingURL=File.js.map -module.exports = Operation; +/***/ }), +/***/ 28178: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.IndentPropTypes = void 0; +var jsx_runtime_1 = __nccwpck_require__(77392); +var prop_types_1 = __importDefault(__nccwpck_require__(62239)); +var utils_1 = __nccwpck_require__(12796); +exports.IndentPropTypes = { + /** + * `size` prop expects a string which format should be a number which represent the number of `type`'s to indent each content. Default to no indentation. + */ + size: prop_types_1.default.number, + /** + * `type` prop expects a string, you can use the `IndentationTypes` enum, as either `TABS` or `SPACES`. The `type` defaults to `SPACES`. + */ + type: prop_types_1.default.oneOf(Object.values(utils_1.IndentationTypes)), +}; +/** + * Component is for wrapping multiple components and apply an indentation on those. + * + * It supports any form of nested components as well, meaning you can have as many nested `Indent` components as you would like. + * + * @component + * @example + * const size = 4 + * const type = IndentationTypes.SPACES + * return ( + * test + * ) + */ +var Indent = function (_a) { + var _b = _a.size, size = _b === void 0 ? 0 : _b, _c = _a.type, type = _c === void 0 ? utils_1.IndentationTypes.SPACES : _c, childrenContent = _a.childrenContent; + return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: utils_1.withIndendation(childrenContent, size, type) }, void 0); +}; +Indent.propTypes = __assign({}, exports.IndentPropTypes); +exports.default = Indent; +//# sourceMappingURL=Indent.js.map /***/ }), -/***/ 45460: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 60709: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -const Operation = __webpack_require__(35682); +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TextPropTypes = void 0; +var jsx_runtime_1 = __nccwpck_require__(77392); +var prop_types_1 = __importDefault(__nccwpck_require__(62239)); +var utils_1 = __nccwpck_require__(12796); +exports.TextPropTypes = { + /** + * `size` prop expects a string which format should be a number which represent the number of `type`'s to indent each content. Default to no indentation. + */ + size: prop_types_1.default.number, + /** + * `type` prop expects a string, you can use the `IndentationTypes` enum, as either `TABS` or `SPACES`. The `type` defaults to `SPACES`. + */ + type: prop_types_1.default.oneOf(Object.values(utils_1.IndentationTypes)), + /** + * `newLines` prop represents the number of appended new lines. Default to one new line. + */ + newLines: prop_types_1.default.number, +}; /** - * Implements functions to deal with a PublishOperation object. - * @class - * @alias module:@asyncapi/parser#PublishOperation - * @extends Operation - * @returns {PublishOperation} + * Component is for defining a group of text which should be rendered on the same line. + * + * @component + * @example + * const indent = 4 + * const type = IndentationTypes.SPACES + * const newLines = 2 + * return ( + * Test + * ) */ -class PublishOperation extends Operation { - /** - * @returns {boolean} - */ - isPublish() { - return true; - } - - /** - * @returns {boolean} - */ - isSubscribe() { - return false; - } +var Text = function (_a) { + var _b = _a.indent, indent = _b === void 0 ? 0 : _b, _c = _a.type, type = _c === void 0 ? utils_1.IndentationTypes.SPACES : _c, _d = _a.newLines, newLines = _d === void 0 ? 1 : _d, childrenContent = _a.childrenContent; + var contentWithLines = utils_1.withNewLines(childrenContent, newLines); + return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: utils_1.withIndendation(contentWithLines, indent, type) }, void 0); +}; +Text.propTypes = __assign({}, exports.TextPropTypes); +exports.default = Text; +//# sourceMappingURL=Text.js.map - /** - * @returns {string} - */ - kind() { - return 'publish'; - } -} +/***/ }), -module.exports = PublishOperation; +/***/ 94332: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +"use strict"; + +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Indent = exports.Text = exports.File = void 0; +var File_1 = __nccwpck_require__(7066); +Object.defineProperty(exports, "File", ({ enumerable: true, get: function () { return __importDefault(File_1).default; } })); +var Text_1 = __nccwpck_require__(60709); +Object.defineProperty(exports, "Text", ({ enumerable: true, get: function () { return __importDefault(Text_1).default; } })); +var Indent_1 = __nccwpck_require__(28178); +Object.defineProperty(exports, "Indent", ({ enumerable: true, get: function () { return __importDefault(Indent_1).default; } })); +//# sourceMappingURL=index.js.map /***/ }), -/***/ 36659: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 87824: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.withNewLines = exports.withIndendation = exports.IndentationTypes = void 0; +__exportStar(__nccwpck_require__(94332), exports); +__exportStar(__nccwpck_require__(13993), exports); +__exportStar(__nccwpck_require__(94292), exports); +__exportStar(__nccwpck_require__(39038), exports); +var utils_1 = __nccwpck_require__(12796); +Object.defineProperty(exports, "IndentationTypes", ({ enumerable: true, get: function () { return utils_1.IndentationTypes; } })); +Object.defineProperty(exports, "withIndendation", ({ enumerable: true, get: function () { return utils_1.withIndendation; } })); +Object.defineProperty(exports, "withNewLines", ({ enumerable: true, get: function () { return utils_1.withNewLines; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 13993: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(79653), exports); +__exportStar(__nccwpck_require__(14101), exports); +//# sourceMappingURL=index.js.map -const { createMapOfType, mix } = __webpack_require__(12065); +/***/ }), -const Base = __webpack_require__(69281); +/***/ 79653: +/***/ (function(__unused_webpack_module, exports) { -const MixinDescription = __webpack_require__(13518); -const MixinExternalDocs = __webpack_require__(44001); -const MixinSpecificationExtensions = __webpack_require__(25999); +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.render = void 0; /** - * Implements functions to deal with a Schema object. - * @class - * @alias module:@asyncapi/parser#Schema - * @extends Base - * @mixes MixinDescription - * @mixes MixinExternalDocs - * @mixes MixinSpecificationExtensions - * @returns {Schema} + * Normalizes given props with render children to string and save value to `childrenContent` prop + * @private + * @param {Any} props + * @returns {Any} normalized props. */ -class Schema extends Base { - /** - * @returns {string} - */ - uid() { - return this.$id() || this.ext('x-parser-schema-id'); - } - - /** - * @returns {string} - */ - $id() { - return this._json.$id; - } - - /** - * @returns {number} - */ - multipleOf() { - return this._json.multipleOf; - } - - /** - * @returns {number} - */ - maximum() { - return this._json.maximum; - } - - /** - * @returns {number} - */ - exclusiveMaximum() { - return this._json.exclusiveMaximum; - } - - /** - * @returns {number} - */ - minimum() { - return this._json.minimum; - } - - /** - * @returns {number} - */ - exclusiveMinimum() { - return this._json.exclusiveMinimum; - } - - /** - * @returns {number} - */ - maxLength() { - return this._json.maxLength; - } - - /** - * @returns {number} - */ - minLength() { - return this._json.minLength; - } - - /** - * @returns {string} - */ - pattern() { - return this._json.pattern; - } - - /** - * @returns {number} - */ - maxItems() { - return this._json.maxItems; - } - - /** - * @returns {number} - */ - minItems() { - return this._json.minItems; - } - - /** - * @returns {boolean} - */ - uniqueItems() { - return !!this._json.uniqueItems; - } - - /** - * @returns {number} - */ - maxProperties() { - return this._json.maxProperties; - } - - /** - * @returns {number} - */ - minProperties() { - return this._json.minProperties; - } - - /** - * @returns {string[]} - */ - required() { - return this._json.required; - } - - /** - * @returns {any[]} - */ - enum() { - return this._json.enum; - } - - /** - * @returns {string|string[]} - */ - type() { - return this._json.type; - } - - /** - * @returns {Schema[]} - */ - allOf() { - if (!this._json.allOf) return null; - return this._json.allOf.map(s => new Schema(s)); - } - - /** - * @returns {Schema[]} - */ - oneOf() { - if (!this._json.oneOf) return null; - return this._json.oneOf.map(s => new Schema(s)); - } - - /** - * @returns {Schema[]} - */ - anyOf() { - if (!this._json.anyOf) return null; - return this._json.anyOf.map(s => new Schema(s)); - } - - /** - * @returns {Schema} - */ - not() { - if (!this._json.not) return null; - return new Schema(this._json.not); - } - - /** - * @returns {Schema|Schema[]} - */ - items() { - if (!this._json.items) return null; - if (Array.isArray(this._json.items)) { - return this._json.items.map(s => new Schema(s)); +function normalizeProps(props) { + return __assign(__assign({}, props), { childrenContent: render(props.children) }); +} +/** + * Executes a `render` method on a given component (in the case of a class component) + * or executes the component itself (a functional component) to get pure string or complex value for the next operations + * @private + * @param {React.ReactElement} element a given component or complex form + * @returns {(React.ReactElement | string)} + */ +function createElement(element) { + if (!element) { + return ""; } - return new Schema(this._json.items); - } - - /** - * @returns {Object} - */ - properties() { - return createMapOfType(this._json.properties, Schema); - } - - /** - * @returns {boolean|Schema} - */ - additionalProperties() { - const ap = this._json.additionalProperties; - if (ap === undefined || ap === null) return; - if (typeof ap === 'boolean') return ap; - return new Schema(ap); - } - - /** - * @returns {Schema} - */ - additionalItems() { - const ai = this._json.additionalItems; - if (ai === undefined || ai === null) return; - return new Schema(ai); - } - - /** - * @returns {Object} - */ - patternProperties() { - return createMapOfType(this._json.patternProperties, Schema); - } + var typeOf = typeof element.type; + if (typeOf === 'string') { + // HTML (also not standard) tags case + throw new Error("HTML tags is not supported yet."); + } + else if (typeOf === 'symbol') { + // internal React types like Fragments, Portal etc. We skip them. + return render(element.props.children); + } + else if (typeOf === 'function') { + // custom components case + var type = element.type; + var prototype = type.prototype; + // Class component case + if (prototype && typeof prototype.isReactComponent === "object") { + var clazzComp = new type(normalizeProps(element.props)); + return createElement(clazzComp.render()); + } + // Function component case + return createElement(type(normalizeProps(element.props))); + } + return element || ""; +} +/** + * Renders given component to string + * + * @param {ReactNode} component a given component to rendering + * @example + * function Component({ textProp }) { + * return <>{textProp} + * } + * render() + * @returns {string} + */ +function render(component) { + var content = ""; + var typeOf = typeof component; + if (typeOf === 'string') { + content += component; + } + else if (Array.isArray(component)) { + content += component.map(function (child) { + var childValue = createElement(child); + return render(childValue); + }).join(""); + } + else if (typeOf === "object") { + content += createElement(component); + } + return content; +} +exports.render = render; +//# sourceMappingURL=renderer.js.map - /** - * @returns {any} - */ - const() { - return this._json.const; - } +/***/ }), - /** - * @returns {Schema} - */ - contains() { - if (!this._json.contains) return null; - return new Schema(this._json.contains); - } +/***/ 14101: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - /** - * @returns {Object} - */ - dependencies() { - if (!this._json.dependencies) return null; - const result = {}; - Object.entries(this._json.dependencies).forEach(([key, value]) => { - result[String(key)] = !Array.isArray(value) ? new Schema(value) : value; - }); - return result; - } +"use strict"; - /** - * @returns {Schema} - */ - propertyNames() { - if (!this._json.propertyNames) return null; - return new Schema(this._json.propertyNames); - } +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.renderTemplate = void 0; +var renderer_1 = __nccwpck_require__(79653); +var utils_1 = __nccwpck_require__(12796); +/** + * render a file with react. This function automatically transforms jsx to js before importing the component. + * + * @param filepath the path to file to render + */ +function renderTemplate(filepath, context) { + return __awaiter(this, void 0, void 0, function () { + var data, component, err_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!utils_1.isJsFile(filepath)) { + return [2 /*return*/, undefined]; + } + data = undefined; + _a.label = 1; + case 1: + _a.trys.push([1, 4, , 5]); + return [4 /*yield*/, importComponent(filepath)]; + case 2: + component = _a.sent(); + if (component === undefined) { + return [2 /*return*/, undefined]; + } + return [4 /*yield*/, component(context)]; + case 3: + data = _a.sent(); + return [3 /*break*/, 5]; + case 4: + err_1 = _a.sent(); + throw err_1; + case 5: + // undefined, null etc. cases + if (!data) { + return [2 /*return*/, undefined]; + } + if (Array.isArray(data)) { + return [2 /*return*/, data.map(function (file) { return file && renderFile(file); }).filter(Boolean)]; + } + return [2 /*return*/, renderFile(data)]; + } + }); + }); +} +exports.renderTemplate = renderTemplate; +/** + * Imports a given file and return the imported component + * + * @private + * @param filepath to import + */ +function importComponent(filepath) { + return new Promise(function (resolve, reject) { + try { + // we should import component only in NodeJS + if (require === undefined) + resolve(undefined); + // remove from cache imported file + delete require.cache[require.resolve(filepath)]; + var component = require(filepath); + if (typeof component === "function") + resolve(component); + if (typeof component.default === "function") + resolve(component.default); + resolve(undefined); + } + catch (err) { + reject(err); + } + }); +} +/** + * Render a single File component. + * + * @private + * @param {React.ReactElement} file to import + */ +function renderFile(file) { + if (typeof file !== "object") { + return undefined; + } + var type = file.type, _a = file.props, props = _a === void 0 ? {} : _a; + // if no File component is found as root, don't render it. + if (typeof type !== "function" || type.name !== "File") { + return undefined; + } + return { + content: renderer_1.render(props.children), + metadata: { + fileName: props.name, + permissions: props.permissions, + } + }; +} +//# sourceMappingURL=template.js.map - /** - * @returns {Schema} - */ - if() { - if (!this._json.if) return null; - return new Schema(this._json.if); - } +/***/ }), - /** - * @returns {Schema} - */ - then() { - if (!this._json.then) return null; - return new Schema(this._json.then); - } +/***/ 94292: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - /** - * @returns {Schema} - */ - else() { - if (!this._json.else) return null; - return new Schema(this._json.else); - } +"use strict"; - /** - * @returns {string} - */ - format() { - return this._json.format; - } +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(12117), exports); +//# sourceMappingURL=index.js.map - /** - * @returns {string} - */ - contentEncoding() { - return this._json.contentEncoding; - } +/***/ }), - /** - * @returns {string} - */ - contentMediaType() { - return this._json.contentMediaType; - } +/***/ 12117: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - /** - * @returns {Object} - */ - definitions() { - return createMapOfType(this._json.definitions, Schema); - } +"use strict"; - /** - * @returns {string} - */ - title() { - return this._json.title; - } +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.transpileFiles = void 0; +var path_1 = __importDefault(__nccwpck_require__(85622)); +var rollup_1 = __nccwpck_require__(97323); +var plugin_babel_1 = __importDefault(__nccwpck_require__(46447)); +var utils_1 = __nccwpck_require__(12796); +var ROOT_DIR = path_1.default.resolve(__dirname, '../..'); +/** + * Transpile files in a given directory (and sub directory if recursive option are passed) and write it to an output directory, if no errors are thrown it completed successfully. + * + * @param directory to transpile. + * @param outputDir to write the transpiled files to. + * @param options any extra options that should be passed. + */ +function transpileFiles(directory, outputDir, options) { + return __awaiter(this, void 0, void 0, function () { + var _a, files, dirs, bundles, _i, dirs_1, subdir, subdirPath; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: return [4 /*yield*/, utils_1.getStatsInDir(directory)]; + case 1: + _a = _b.sent(), files = _a.files, dirs = _a.dirs; + if (!files.length) return [3 /*break*/, 4]; + return [4 /*yield*/, rollup_1.rollup({ + input: files, + onwarn: function () { }, + plugins: [ + plugin_babel_1.default({ + cwd: ROOT_DIR, + babelHelpers: "bundled", + plugins: [ + "source-map-support", + ], + presets: [ + ["@babel/preset-env", { + targets: { node: "12.16" }, + }], + ["@babel/preset-react", { + runtime: "automatic", + }], + ], + }) + ] + })]; + case 2: + bundles = _b.sent(); + return [4 /*yield*/, bundles.write({ + format: "commonjs", + sourcemap: true, + dir: outputDir, + exports: "auto", + paths: { + 'react/jsx-runtime': 'react/cjs/react-jsx-runtime.production.min', + } + })]; + case 3: + _b.sent(); + _b.label = 4; + case 4: + if (!((options === null || options === void 0 ? void 0 : options.recursive) === true && dirs.length > 0)) return [3 /*break*/, 8]; + _i = 0, dirs_1 = dirs; + _b.label = 5; + case 5: + if (!(_i < dirs_1.length)) return [3 /*break*/, 8]; + subdir = dirs_1[_i]; + subdirPath = path_1.default.parse(subdir); + return [4 /*yield*/, transpileFiles(subdir, path_1.default.resolve(outputDir, subdirPath.base), options)]; + case 6: + _b.sent(); + _b.label = 7; + case 7: + _i++; + return [3 /*break*/, 5]; + case 8: return [2 /*return*/]; + } + }); + }); +} +exports.transpileFiles = transpileFiles; +//# sourceMappingURL=transpiler.js.map - /** - * @returns {any} - */ - default() { - return this._json.default; - } +/***/ }), - /** - * @returns {boolean} - */ - deprecated() { - return this._json.deprecated; - } +/***/ 39038: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - /** - * @returns {string} - */ - discriminator() { - return this._json.discriminator; - } - /** - * @returns {boolean} - */ - readOnly() { - return !!this._json.readOnly; - } +"use strict"; - /** - * @returns {boolean} - */ - writeOnly() { - return !!this._json.writeOnly; - } +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Component = void 0; +var react_1 = __importDefault(__nccwpck_require__(18444)); +var Component = /** @class */ (function (_super) { + __extends(Component, _super); + function Component() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Component; +}(react_1.default.Component)); +exports.Component = Component; +//# sourceMappingURL=types.js.map - /** - * @returns {any[]} - */ - examples() { - return this._json.examples; - } +/***/ }), - /** - * @returns {boolean} - */ - isCircular() { - return !!this.ext('x-parser-circular'); - } +/***/ 48987: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - /** - * @returns {boolean} - */ - hasCircularProps() { - return !!this.ext('x-parser-circular-props'); - } +"use strict"; - /** - * @returns {string[]} - */ - circularProps() { - return this.ext('x-parser-circular-props'); - } +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getStatsInDir = void 0; +var path_1 = __importDefault(__nccwpck_require__(85622)); +var fs_1 = __importDefault(__nccwpck_require__(35747)); +var util_1 = __nccwpck_require__(31669); +var _1 = __nccwpck_require__(12796); +var readdir = util_1.promisify(fs_1.default.readdir); +var stat = util_1.promisify(fs_1.default.stat); +var GetFilesResponse = /** @class */ (function () { + function GetFilesResponse(files, dirs) { + this.files = files; + this.dirs = dirs; + } + return GetFilesResponse; +}()); +/** + * Function which finds all the files and dirs in folders + * @private + * @param dir directory to find files and dirs in. + * @param includeSubDirs should the function iterate through subdirectories to search for files and dirs? + */ +function getStatsInDir(dir) { + return __awaiter(this, void 0, void 0, function () { + var allFiles, files, dirs, _i, allFiles_1, filename, res, stats, resolveFilenameCallback; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, readdir(dir)]; + case 1: + allFiles = _a.sent(); + files = []; + dirs = []; + _i = 0, allFiles_1 = allFiles; + _a.label = 2; + case 2: + if (!(_i < allFiles_1.length)) return [3 /*break*/, 5]; + filename = allFiles_1[_i]; + res = path_1.default.resolve(dir, filename); + return [4 /*yield*/, stat(res)]; + case 3: + stats = _a.sent(); + if (stats.isDirectory()) { + dirs.push(res); + } + else if (_1.isJsFile(filename)) { + files.push(res); + } + _a.label = 4; + case 4: + _i++; + return [3 /*break*/, 2]; + case 5: + resolveFilenameCallback = function (filename) { + return path_1.default.resolve(dir, filename); + }; + files = files.map(resolveFilenameCallback); + dirs = dirs.map(resolveFilenameCallback); + return [2 /*return*/, new GetFilesResponse(files, dirs)]; + } + }); + }); } +exports.getStatsInDir = getStatsInDir; +//# sourceMappingURL=getStatsInDir.js.map -module.exports = mix(Schema, MixinDescription, MixinExternalDocs, MixinSpecificationExtensions); +/***/ }), + +/***/ 12796: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(48987), exports); +__exportStar(__nccwpck_require__(96751), exports); +__exportStar(__nccwpck_require__(25466), exports); +__exportStar(__nccwpck_require__(19542), exports); +//# sourceMappingURL=index.js.map /***/ }), -/***/ 53601: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 96751: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isJsFile = void 0; +var ALLOWED_EXTS = ['js', 'jsx', 'cjs']; +/** + * Function which checks if file is JS file + * @private + * @param {string} filename + * @returns {boolean} + */ +function isJsFile(filename) { + if (filename === void 0) { filename = ''; } + var ext = filename.split('.').pop() || ''; + return ALLOWED_EXTS.includes(ext); +} +exports.isJsFile = isJsFile; +//# sourceMappingURL=isJsFile.js.map -const { createMapOfType, mix } = __webpack_require__(12065); +/***/ }), -const Base = __webpack_require__(69281); -const OAuthFlow = __webpack_require__(92548); +/***/ 25466: +/***/ ((__unused_webpack_module, exports) => { -const MixinDescription = __webpack_require__(13518); -const MixinSpecificationExtensions = __webpack_require__(25999); +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.withIndendation = exports.IndentationTypes = void 0; /** - * Implements functions to deal with a SecurityScheme object. - * @class - * @alias module:@asyncapi/parser#SecurityScheme - * @extends Base - * @mixes MixinDescription - * @mixes MixinSpecificationExtensions - * @returns {SecurityScheme} + * Type of indentation to use + * @readonly + * @enum {string} + * @property {string} TABS - indicate to use tabs as separator + * @property {string} SPACES - indicate to use spaces as separator */ -class SecurityScheme extends Base { - /** - * @returns {string} - */ - type() { - return this._json.type; - } - - /** - * @returns {string} - */ - name() { - return this._json.name; - } - - /** - * @returns {string} - */ - in() { - return this._json.in; - } - - /** - * @returns {string} - */ - scheme() { - return this._json.scheme; - } - - /** - * @returns {string} - */ - bearerFormat() { - return this._json.bearerFormat; - } - - /** - * @returns {string} - */ - openIdConnectUrl() { - return this._json.openIdConnectUrl; - } - - /** - * @returns {Object} - */ - flows() { - return createMapOfType(this._json.flows, OAuthFlow); - } +var IndentationTypes; +(function (IndentationTypes) { + IndentationTypes["TABS"] = "tabs"; + IndentationTypes["SPACES"] = "spaces"; +})(IndentationTypes = exports.IndentationTypes || (exports.IndentationTypes = {})); +/** + * Ensures indentations are prepended to content. + * @private + * @param {string} content to prepend the indentation + * @param {number} size the number of indendations to use + * @param {IndentationTypes} type the type of indendations to use. SPACES by default. + * @returns {string} + */ +function withIndendation(content, size, type) { + if (content === void 0) { content = ''; } + if (type === void 0) { type = IndentationTypes.SPACES; } + if (size < 1) { + return content; + } + // if the content includes new lines ensure that they have the added indentation as well. + if (content.includes('\n')) { + var newLineArray = content.split('\n'); + return newLineArray.reduce(function (accumulator, value) { + var newValue = value.trim() === '' ? value : "" + getIndentation(size, type) + value; + return accumulator === "" ? newValue : accumulator + "\n" + newValue; + }, ""); + } + return "" + getIndentation(size, type) + content; +} +exports.withIndendation = withIndendation; +/** + * Get the indendation string based on how many and which type of indentation are requested. + * @private + * @param {number} size the number of indendations to use + * @param {IndentationTypes} type the type of indendations to use. SPACES by default. + * @returns {string} + */ +function getIndentation(size, type) { + if (size === void 0) { size = 0; } + if (type === void 0) { type = IndentationTypes.SPACES; } + var whitespaceChar = type === IndentationTypes.SPACES ? ' ' : '\t'; + return Array(size).fill(whitespaceChar).join(""); } +//# sourceMappingURL=withIndendation.js.map -module.exports = mix(SecurityScheme, MixinDescription, MixinSpecificationExtensions); +/***/ }), + +/***/ 19542: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.withNewLines = void 0; +/** + * Prepend given number of the new lines to content. + * @private + * @param {string} content + * @param {number} number + * @returns {string} + */ +function withNewLines(content, number) { + if (content === void 0) { content = ''; } + if (number === void 0) { number = 0; } + var newLines = Array(number).fill('\n').join(''); + return content + newLines; +} +exports.withNewLines = withNewLines; +//# sourceMappingURL=withNewLines.js.map /***/ }), -/***/ 55817: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 80851: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const Base = __webpack_require__(69281); +const path = __nccwpck_require__(85622); +const fs = __nccwpck_require__(35747); +const xfs = __nccwpck_require__(52088); +const { isAsyncFunction } = __nccwpck_require__(65015); /** - * Implements functions to deal with a ServerSecurityRequirement object. - * @class - * @alias module:@asyncapi/parser#ServerSecurityRequirement - * @extends Base - * @returns {ServerSecurityRequirement} + * Registers all template filters. + * @param {Object} nunjucks Nunjucks environment. + * @param {Object} templateConfig Template configuration. + * @param {String} templateDir Directory where template is located. + * @param {String} filtersDir Directory where local filters are located. */ -class ServerSecurityRequirement extends Base { -} +module.exports.registerFilters = async (nunjucks, templateConfig, templateDir, filtersDir) => { + await registerLocalFilters(nunjucks, templateDir, filtersDir); + await registerConfigFilters(nunjucks, templateDir, templateConfig); +}; -module.exports = ServerSecurityRequirement; +/** + * Registers the local template filters. + * @private + * @param {Object} nunjucks Nunjucks environment. + * @param {String} templateDir Directory where template is located. + * @param {String} filtersDir Directory where local filters are located. + */ +function registerLocalFilters(nunjucks, templateDir, filtersDir) { + return new Promise((resolve, reject) => { + const localFilters = path.resolve(templateDir, filtersDir); + if (!fs.existsSync(localFilters)) return resolve(); -/***/ }), + const walker = xfs.walk(localFilters, { + followLinks: false + }); -/***/ 96217: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + walker.on('file', async (root, stats, next) => { + try { + const filePath = path.resolve(templateDir, path.resolve(root, stats.name)); + // If it's a module constructor, inject dependencies to ensure consistent usage in remote templates in other projects or plain directories. + delete require.cache[require.resolve(filePath)]; + const mod = require(filePath); -const { mix } = __webpack_require__(12065); + addFilters(nunjucks, mod); + + next(); + } catch (e) { + reject(e); + } + }); -const Base = __webpack_require__(69281); + walker.on('errors', (root, nodeStatsArray) => { + reject(nodeStatsArray); + }); -const MixinDescription = __webpack_require__(13518); -const MixinSpecificationExtensions = __webpack_require__(25999); + walker.on('end', async () => { + resolve(); + }); + }); +} /** - * Implements functions to deal with a ServerVariable object. - * @class - * @alias module:@asyncapi/parser#ServerVariable - * @extends Base - * @mixes MixinDescription - * @mixes MixinSpecificationExtensions - * @returns {ServerVariable} - */ -class ServerVariable extends Base { - /** - * @returns {any[]} - */ - allowedValues() { - return this._json.enum; - } +* Registers the additionally configured filters. +* @private +* @param {Object} nunjucks Nunjucks environment. +* @param {String} templateDir Directory where template is located. +* @param {Object} templateConfig Template configuration. +*/ +async function registerConfigFilters(nunjucks, templateDir, templateConfig) { + const confFilters = templateConfig.filters; + const DEFAULT_MODULES_DIR = 'node_modules'; + if (!Array.isArray(confFilters)) return; - /** - * @param {string} name - Name of the variable. - * @returns {boolean} - */ - allows(name) { - if (this._json.enum === undefined) return true; - return this._json.enum.includes(name); - } + const promises = confFilters.map(async filtersModule => { + let mod; + try { + //first we try to grab module with filters by the module name + //this is when generation is used on production using remote templates + mod = require(filtersModule); + } catch (error) { + //in case template is local but was not installed in node_modules of the generator then we need to explicitly provide modules location + mod = require(path.resolve(templateDir, DEFAULT_MODULES_DIR, filtersModule)); + } - /** - * @returns {boolean} - */ - hasAllowedValues() { - return this._json.enum !== undefined; - } + addFilters(nunjucks, mod); + }); - /** - * @returns {string} - */ - defaultValue() { - return this._json.default; - } + await Promise.all(promises); +} - /** - * @returns {boolean} - */ - hasDefaultValue() { - return this._json.default !== undefined; - } +/** + * Add filter functions to Nunjucks environment. Only owned functions from the module are added. + * @private + * @param {Object} nunjucks Nunjucks environment. + * @param {Object} filters Module with functions. + */ +function addFilters(nunjucks, filters) { + Object.getOwnPropertyNames(filters).forEach((key) => { + const value = filters[key]; + if (!(value instanceof Function)) return; - /** - * @returns {string[]} - */ - examples() { - return this._json.examples; - } + if (isAsyncFunction(value)) { + nunjucks.addFilter(key, value, true); + } else { + nunjucks.addFilter(key, value); + } + }); } -module.exports = mix(ServerVariable, MixinDescription, MixinSpecificationExtensions); - /***/ }), -/***/ 27549: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 56814: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const path = __nccwpck_require__(85622); +const fs = __nccwpck_require__(35747); +const xfs = __nccwpck_require__(52088); +const minimatch = __nccwpck_require__(83973); +const parser = __nccwpck_require__(44479); +const { configureReact, renderReact, saveRenderedReactContent } = __nccwpck_require__(64744); +const { configureNunjucks, renderNunjucks } = __nccwpck_require__(75094); +const { parse, AsyncAPIDocument } = parser; +const ramlDtParser = __nccwpck_require__(54443); +const openapiSchemaParser = __nccwpck_require__(3149); +const avroSchemaParser = __nccwpck_require__(89067); +const jmespath = __nccwpck_require__(87783); +const filenamify = __nccwpck_require__(16094); +const git = __nccwpck_require__(18577); +const log = __nccwpck_require__(78063); +const Arborist = __nccwpck_require__(67126); +const { validateTemplateConfig } = __nccwpck_require__(45881); +const { + convertMapToObject, + isFileSystemPath, + readFile, + readDir, + writeFile, + copyFile, + exists, + fetchSpec, + getInvalidOptions, + isReactTemplate, + isJsFile, + registerSourceMap, + registerTypeScript, + getTemplateDetails, + getMapBaseUrlToFolderResolver +} = __nccwpck_require__(65015); +const { registerFilters } = __nccwpck_require__(80851); +const { registerHooks } = __nccwpck_require__(27014); -const { createMapOfType, getMapValueOfType, mix } = __webpack_require__(12065); +const FILTERS_DIRNAME = 'filters'; +const HOOKS_DIRNAME = 'hooks'; +const CONFIG_FILENAME = 'package.json'; +const PACKAGE_JSON_FILENAME = 'package.json'; +const GIT_IGNORE_FILENAME = '{.gitignore}'; +const NPM_IGNORE_FILENAME = '{.npmignore}'; +const ROOT_DIR = path.resolve(__dirname, '..'); +const DEFAULT_TEMPLATES_DIR = path.resolve(ROOT_DIR, 'node_modules'); -const Base = __webpack_require__(69281); -const ServerVariable = __webpack_require__(96217); -const ServerSecurityRequirement = __webpack_require__(55817); +const TRANSPILED_TEMPLATE_LOCATION = '__transpiled'; +const TEMPLATE_CONTENT_DIRNAME = 'template'; +const GENERATOR_OPTIONS = ['debug', 'disabledHooks', 'entrypoint', 'forceWrite', 'install', 'noOverwriteGlobs', 'output', 'templateParams', 'mapBaseUrlToFolder']; -const MixinDescription = __webpack_require__(13518); -const MixinBindings = __webpack_require__(58052); -const MixinSpecificationExtensions = __webpack_require__(25999); +const logMessage = __nccwpck_require__(85137); -/** - * Implements functions to deal with a Server object. - * @class - * @alias module:@asyncapi/parser#Server - * @extends Base - * @mixes MixinDescription - * @mixes MixinBindings - * @mixes MixinSpecificationExtensions - * @returns {Server} - */ -class Server extends Base { +const shouldIgnoreFile = filePath => + filePath.startsWith(`.git${path.sep}`); + +const shouldIgnoreDir = dirPath => + dirPath === '.git' + || dirPath.startsWith(`.git${path.sep}`); + +parser.registerSchemaParser(openapiSchemaParser); +parser.registerSchemaParser(ramlDtParser); +parser.registerSchemaParser(avroSchemaParser); +registerSourceMap(); +registerTypeScript(); + +class Generator { /** - * @returns {string} + * Instantiates a new Generator object. + * + * @example + * const path = require('path'); + * const generator = new Generator('@asyncapi/html-template', path.resolve(__dirname, 'example')); + * + * @example Passing custom params to the template + * const path = require('path'); + * const generator = new Generator('@asyncapi/html-template', path.resolve(__dirname, 'example'), { + * templateParams: { + * sidebarOrganization: 'byTags' + * } + * }); + * + * @param {String} templateName Name of the template to generate. + * @param {String} targetDir Path to the directory where the files will be generated. + * @param {Object} options + * @param {String} [options.templateParams] Optional parameters to pass to the template. Each template define their own params. + * @param {String} [options.entrypoint] Name of the file to use as the entry point for the rendering process. Use in case you want to use only a specific template file. Note: this potentially avoids rendering every file in the template. + * @param {String[]} [options.noOverwriteGlobs] List of globs to skip when regenerating the template. + * @param {Object} [options.disabledHooks] Object with hooks to disable. The key is a hook type. If key has "true" value, then the generator skips all hooks from the given type. If the value associated with a key is a string with the name of a single hook, then the generator skips only this single hook name. If the value associated with a key is an array of strings, then the generator skips only hooks from the array. + * @param {String} [options.output='fs'] Type of output. Can be either 'fs' (default) or 'string'. Only available when entrypoint is set. + * @param {Boolean} [options.forceWrite=false] Force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir. Default is set to false. + * @param {Boolean} [options.install=false] Install the template and its dependencies, even when the template has already been installed. + * @param {Boolean} [options.debug=false] Enable more specific errors in the console. At the moment it only shows specific errors about filters. Keep in mind that as a result errors about template are less descriptive. + * @param {Object} [options.mapBaseUrlToFolder] Optional parameter to map schema references from a base url to a local base folder e.g. url=https://schema.example.com/crm/ folder=./test/docs/ . */ - url() { - return this._json.url; + constructor(templateName, targetDir, { templateParams = {}, entrypoint, noOverwriteGlobs, disabledHooks, output = 'fs', forceWrite = false, install = false, debug = false, mapBaseUrlToFolder = {} } = {}) { + const invalidOptions = getInvalidOptions(GENERATOR_OPTIONS, arguments[arguments.length - 1] || []); + if (invalidOptions.length) throw new Error(`These options are not supported by the generator: ${invalidOptions.join(', ')}`); + if (!templateName) throw new Error('No template name has been specified.'); + if (!entrypoint && !targetDir) throw new Error('No target directory has been specified.'); + if (!['fs', 'string'].includes(output)) throw new Error(`Invalid output type ${output}. Valid values are 'fs' and 'string'.`); + + /** @type {String} Name of the template to generate. */ + this.templateName = templateName; + /** @type {String} Path to the directory where the files will be generated. */ + this.targetDir = targetDir; + /** @type {String} Name of the file to use as the entry point for the rendering process. Use in case you want to use only a specific template file. Note: this potentially avoids rendering every file in the template. */ + this.entrypoint = entrypoint; + /** @type {String[]} List of globs to skip when regenerating the template. */ + this.noOverwriteGlobs = noOverwriteGlobs || []; + /** @type {Object} Object with hooks to disable. The key is a hook type. If key has "true" value, then the generator skips all hooks from the given type. If the value associated with a key is a string with the name of a single hook, then the generator skips only this single hook name. If the value associated with a key is an array of strings, then the generator skips only hooks from the array. */ + this.disabledHooks = disabledHooks || {}; + /** @type {String} Type of output. Can be either 'fs' (default) or 'string'. Only available when entrypoint is set. */ + this.output = output; + /** @type {Boolean} Force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir. Default is set to false. */ + this.forceWrite = forceWrite; + /** @type {Boolean} Enable more specific errors in the console. At the moment it only shows specific errors about filters. Keep in mind that as a result errors about template are less descriptive. */ + this.debug = debug; + /** @type {Boolean} Install the template and its dependencies, even when the template has already been installed. */ + this.install = install; + /** @type {Object} The template configuration. */ + this.templateConfig = {}; + /** @type {Object} Hooks object with hooks functions grouped by the hook type. */ + this.hooks = {}; + /** @type {Object} Maps schema URL to folder. */ + this.mapBaseUrlToFolder = mapBaseUrlToFolder; + + // Load template configuration + /** @type {Object} The template parameters. The structure for this object is based on each individual template. */ + this.templateParams = {}; + Object.keys(templateParams).forEach(key => { + const self = this; + Object.defineProperty(this.templateParams, key, { + enumerable: true, + get() { + if (!self.templateConfig.parameters || !self.templateConfig.parameters[key]) { + throw new Error(`Template parameter "${key}" has not been defined in the package.json file under generator property. Please make sure it's listed there before you use it in your template.`); + } + return templateParams[key]; + } + }); + }); } /** - * @returns {string} + * Generates files from a given template and an AsyncAPIDocument object. + * + * @example + * generator + * .generate(myAsyncAPIdocument) + * .then(() => { + * console.log('Done!'); + * }) + * .catch(console.error); + * + * @example Using async/await + * try { + * await generator.generate(myAsyncAPIdocument); + * console.log('Done!'); + * } catch (e) { + * console.error(e); + * } + * + * @param {AsyncAPIDocument} asyncapiDocument AsyncAPIDocument object to use as source. + * @return {Promise} */ - protocol() { - return this._json.protocol; + async generate(asyncapiDocument) { + if (!(asyncapiDocument instanceof AsyncAPIDocument)) throw new Error('Parameter "asyncapiDocument" must be an AsyncAPIDocument object.'); + + if (this.output === 'fs') { + xfs.mkdirpSync(this.targetDir); + if (!this.forceWrite) await this.verifyTargetDir(this.targetDir); + } else if (this.output === 'string' && this.entrypoint === undefined) { + throw new Error('Parameter entrypoint is required when using output = "string"'); + } + + if (this.debug) log.setLevel('debug'); + + const { name: templatePkgName, path: templatePkgPath } = await this.installTemplate(this.install); + this.templateDir = templatePkgPath; + this.templateName = templatePkgName; + this.templateContentDir = path.resolve(this.templateDir, TEMPLATE_CONTENT_DIRNAME); + await this.loadTemplateConfig(); + validateTemplateConfig(this.templateConfig, this.templateParams, asyncapiDocument); + await this.configureTemplate(); + + if (!isReactTemplate(this.templateConfig)) { + await registerFilters(this.nunjucks, this.templateConfig, this.templateDir, FILTERS_DIRNAME); + } + await registerHooks(this.hooks, this.templateConfig, this.templateDir, HOOKS_DIRNAME); + await this.launchHook('generate:before'); + + if (this.entrypoint) { + const entrypointPath = path.resolve(this.templateContentDir, this.entrypoint); + if (!(await exists(entrypointPath))) throw new Error(`Template entrypoint "${entrypointPath}" couldn't be found.`); + if (this.output === 'fs') { + await this.generateFile(asyncapiDocument, path.basename(entrypointPath), path.dirname(entrypointPath)); + await this.launchHook('generate:after'); + } else if (this.output === 'string') { + return this.renderFile(asyncapiDocument, entrypointPath); + } + } else { + await this.generateDirectoryStructure(asyncapiDocument); + await this.launchHook('generate:after'); + } } /** - * @returns {string} + * Configure the templates based the desired renderer. */ - protocolVersion() { - return this._json.protocolVersion; + async configureTemplate() { + if (isReactTemplate(this.templateConfig)) { + await configureReact(this.templateDir, this.templateContentDir, TRANSPILED_TEMPLATE_LOCATION); + } else { + this.nunjucks = configureNunjucks(this.debug, this.templateDir); + } } /** - * @returns {Object} + * Generates files from a given template and AsyncAPI string. + * + * @example + * const asyncapiString = ` + * asyncapi: '2.0.0' + * info: + * title: Example + * version: 1.0.0 + * ... + * `; + * generator + * .generateFromString(asyncapiString) + * .then(() => { + * console.log('Done!'); + * }) + * .catch(console.error); + * + * @example Using async/await + * const asyncapiString = ` + * asyncapi: '2.0.0' + * info: + * title: Example + * version: 1.0.0 + * ... + * `; + * + * try { + * await generator.generateFromString(asyncapiString); + * console.log('Done!'); + * } catch (e) { + * console.error(e); + * } + * + * @param {String} asyncapiString AsyncAPI string to use as source. + * @param {Object} [parserOptions={}] AsyncAPI parser options. Check out {@link https://www.github.com/asyncapi/parser-js|@asyncapi/parser} for more information. + * @return {Promise} */ - variables() { - return createMapOfType(this._json.variables, ServerVariable); + async generateFromString(asyncapiString, parserOptions = {}) { + if (!asyncapiString || typeof asyncapiString !== 'string') throw new Error('Parameter "asyncapiString" must be a non-empty string.'); + + /** @type {String} AsyncAPI string to use as a source. */ + this.originalAsyncAPI = asyncapiString; + + /** @type {AsyncAPIDocument} Parsed AsyncAPI schema. See {@link https://github.com/asyncapi/parser-js/blob/master/API.md#module_@asyncapi/parser+AsyncAPIDocument|AsyncAPIDocument} for details on object structure. */ + this.asyncapi = await parse(asyncapiString, parserOptions); + return this.generate(this.asyncapi); } /** - * @param {string} name - Name of the server variable. - * @returns {ServerVariable} + * Generates files from a given template and AsyncAPI file stored on external server. + * + * @example + * generator + * .generateFromURL('https://example.com/asyncapi.yaml') + * .then(() => { + * console.log('Done!'); + * }) + * .catch(console.error); + * + * @example Using async/await + * try { + * await generator.generateFromURL('https://example.com/asyncapi.yaml'); + * console.log('Done!'); + * } catch (e) { + * console.error(e); + * } + * + * @param {String} asyncapiURL Link to AsyncAPI file + * @return {Promise} */ - variable(name) { - return getMapValueOfType(this._json.variables, name, ServerVariable); + async generateFromURL(asyncapiURL) { + const doc = await fetchSpec(asyncapiURL); + const parserOptions = {}; + if (this.mapBaseUrlToFolder.url) { + parserOptions.resolve = {resolver: getMapBaseUrlToFolderResolver(this.mapBaseUrlToFolder)}; + } + + return this.generateFromString(doc, parserOptions); } /** - * @returns {boolean} + * Generates files from a given template and AsyncAPI file. + * + * @example + * generator + * .generateFromFile('asyncapi.yaml') + * .then(() => { + * console.log('Done!'); + * }) + * .catch(console.error); + * + * @example Using async/await + * try { + * await generator.generateFromFile('asyncapi.yaml'); + * console.log('Done!'); + * } catch (e) { + * console.error(e); + * } + * + * @param {String} asyncapiFile AsyncAPI file to use as source. + * @return {Promise} */ - hasVariables() { - return !!this._json.variables; + async generateFromFile(asyncapiFile) { + const doc = await readFile(asyncapiFile, { encoding: 'utf8' }); + const parserOptions = { path: asyncapiFile }; + if (this.mapBaseUrlToFolder.url) { + parserOptions.resolve = {resolver: getMapBaseUrlToFolderResolver(this.mapBaseUrlToFolder)}; + } + + return this.generateFromString(doc, parserOptions); } /** - * @returns {ServerSecurityRequirement[]} + * Returns the content of a given template file. + * + * @example + * const Generator = require('asyncapi-generator'); + * const content = await Generator.getTemplateFile('@asyncapi/html-template', 'partials/content.html'); + * + * @example Using a custom `templatesDir` + * const Generator = require('asyncapi-generator'); + * const content = await Generator.getTemplateFile('@asyncapi/html-template', 'partials/content.html', '~/my-templates'); + * + * @static + * @param {String} templateName Name of the template to generate. + * @param {String} filePath Path to the file to render. Relative to the template directory. + * @param {String} [templatesDir=DEFAULT_TEMPLATES_DIR] Path to the directory where the templates are installed. + * @return {Promise} */ - security() { - if (!this._json.security) return null; - return this._json.security.map(sec => new ServerSecurityRequirement(sec)); + static async getTemplateFile(templateName, filePath, templatesDir = DEFAULT_TEMPLATES_DIR) { + return await readFile(path.resolve(templatesDir, templateName, filePath), 'utf8'); } -} - -module.exports = mix(Server, MixinDescription, MixinBindings, MixinSpecificationExtensions); - -/***/ }), + /** + * Downloads and installs a template and its dependencies + * + * @param {Boolean} [force=false] Whether to force installation (and skip cache) or not. + */ + installTemplate(force = false) { + return new Promise(async (resolve, reject) => { + if (!force) { + let pkgPath; + let installedPkg; + let packageVersion; -/***/ 99065: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + try { + installedPkg = getTemplateDetails(this.templateName, PACKAGE_JSON_FILENAME); + pkgPath = installedPkg && installedPkg.pkgPath; + packageVersion = installedPkg && installedPkg.version; + log.debug(logMessage.templateSource(pkgPath)); + if (packageVersion) log.debug(logMessage.templateVersion(packageVersion)); -const Operation = __webpack_require__(35682); - -/** - * Implements functions to deal with a SubscribeOperation object. - * @class - * @alias module:@asyncapi/parser#SubscribeOperation - * @extends Operation - * @returns {SubscribeOperation} - */ -class SubscribeOperation extends Operation { - /** - * @returns {boolean} - */ - isPublish() { - return false; - } - - /** - * @returns {boolean} - */ - isSubscribe() { - return true; - } + return resolve({ + name: installedPkg.name, + path: pkgPath + }); + } catch (e) { + log.debug(logMessage.packageNotAvailable(pkgPath), e); + // We did our best. Proceed with installation... + } + } - /** - * @returns {string} - */ - kind() { - return 'subscribe'; - } -} + const debugMessage = force ? logMessage.TEMPLATE_INSTALL_FLAG_MSG : logMessage.TEMPLATE_INSTALL_DISK_MSG; + log.debug(logMessage.installationDebugMessage(debugMessage)); -module.exports = SubscribeOperation; + if (isFileSystemPath(this.templateName)) log.debug(logMessage.NPM_INSTALL_TRIGGER); + const arb = new Arborist({ + path: ROOT_DIR + }); -/***/ }), + try { + const installResult = await arb.reify({ + add: [this.templateName], + saveType: 'prod', + save: false + }); -/***/ 71238: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + const addResult = arb[Symbol.for('resolvedAdd')]; + if (!addResult) return reject('Unable to resolve the name of the added package. It was most probably not added to node_modules successfully'); -const { mix } = __webpack_require__(12065); + const packageName = addResult[0].name; + const packageVersion = installResult.children.get(packageName).version; + const packagePath = installResult.children.get(packageName).path; -const Base = __webpack_require__(69281); + if (!isFileSystemPath(this.templateName)) log.debug(logMessage.templateSuccessfullyInstalled(packageName, packagePath)); + if (packageVersion) log.debug(logMessage.templateVersion(packageVersion)); -const MixinDescription = __webpack_require__(13518); -const MixinExternalDocs = __webpack_require__(44001); -const MixinSpecificationExtensions = __webpack_require__(25999); + return resolve({ + name: packageName, + path: packagePath, + }); + } catch (err) { + reject(err); + } + }); + } -/** - * Implements functions to deal with a Tag object. - * @class - * @alias module:@asyncapi/parser#Tag - * @extends Base - * @mixes MixinDescription - * @mixes MixinExternalDocs - * @mixes MixinSpecificationExtensions - * @returns {Tag} - */ -class Tag extends Base { /** - * @returns {string} + * Returns all the parameters on the AsyncAPI document. + * + * @private + * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source. */ - name() { - return this._json.name; - } -} + getAllParameters(asyncapiDocument) { + const parameters = new Map(); -module.exports = mix(Tag, MixinDescription, MixinExternalDocs, MixinSpecificationExtensions); + if (asyncapiDocument.hasChannels()) { + asyncapiDocument.channelNames().forEach(channelName => { + const channel = asyncapiDocument.channel(channelName); + for (const [key, value] of Object.entries(channel.parameters())) { + parameters.set(key, value); + } + }); + } + if (asyncapiDocument.hasComponents()) { + for (const [key, value] of Object.entries(asyncapiDocument.components().parameters())) { + parameters.set(key, value); + } + } -/***/ }), + return parameters; + } -/***/ 32720: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const path = __webpack_require__(85622); -const Ajv = __webpack_require__(64941); -const fetch = __webpack_require__(80467); -const asyncapi = __webpack_require__(78100); -const $RefParser = __webpack_require__(85862); -const mergePatch = __webpack_require__(29674)/* .apply */ .nn; -const ParserError = __webpack_require__(21978); -const { validateChannels, validateServerVariables, validateOperationId, validateServerSecurity } = __webpack_require__(10254); -const { toJS, findRefs, getLocationOf, improveAjvErrors } = __webpack_require__(12065); -const AsyncAPIDocument = __webpack_require__(41527); + /** + * Generates the directory structure. + * + * @private + * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source. + * @return {Promise} + */ + generateDirectoryStructure(asyncapiDocument) { + const objectMap = {}; + asyncapiDocument.allSchemas().forEach((schema, schemaId) => { if (schema.type() === 'object') objectMap[schemaId] = schema; }); -const DEFAULT_SCHEMA_FORMAT = 'application/vnd.aai.asyncapi;version=2.0.0'; -const OPERATIONS = ['publish', 'subscribe']; -//the only security types that can have a non empty array in the server security item -const SPECIAL_SECURITY_TYPES = ['oauth2', 'openIdConnect']; -const PARSERS = {}; -const xParserCircle = 'x-parser-circular'; + return new Promise((resolve, reject) => { + xfs.mkdirpSync(this.targetDir); -/** - * @module @asyncapi/parser - */ -module.exports = { - parse, - parseFromUrl, - registerSchemaParser, - ParserError, - AsyncAPIDocument, -}; + const walker = xfs.walk(this.templateContentDir, { + followLinks: false + }); -/** - * Parses and validate an AsyncAPI document from YAML or JSON. - * - * @param {String} asyncapiYAMLorJSON An AsyncAPI document in JSON or YAML format. - * @param {Object} [options] Configuration options. - * @param {String} [options.path] Path to the AsyncAPI document. It will be used to resolve relative references. Defaults to current working dir. - * @param {Object} [options.parse] Options object to pass to {@link https://apidevtools.org/json-schema-ref-parser/docs/options.html|json-schema-ref-parser}. - * @param {Object} [options.resolve] Options object to pass to {@link https://apidevtools.org/json-schema-ref-parser/docs/options.html|json-schema-ref-parser}. - * @param {Object} [options.applyTraits=true] Whether to resolve and apply traits or not. - * @returns {Promise} The parsed AsyncAPI document. - */ -async function parse(asyncapiYAMLorJSON, options = {}) { - let parsedJSON; - let initialFormat; + walker.on('file', async (root, stats, next) => { + try { + await this.filesGenerationHandler(asyncapiDocument, objectMap, root, stats, next); + } catch (e) { + reject(e); + } + }); - options.path = options.path || `${process.cwd()}${path.sep}`; + walker.on('directory', async (root, stats, next) => { + try { + this.ignoredDirHandler(root, stats, next); + } catch (e) { + reject(e); + } + }); - try { - ({ initialFormat, parsedJSON } = toJS(asyncapiYAMLorJSON)); + walker.on('errors', (root, nodeStatsArray) => { + reject(nodeStatsArray); + }); - if (typeof parsedJSON !== 'object') { - throw new ParserError({ - type: 'impossible-to-convert-to-json', - title: 'Could not convert AsyncAPI to JSON.', - detail: 'Most probably the AsyncAPI document contains invalid YAML or YAML features not supported in JSON.' + walker.on('end', async () => { + resolve(); }); + }); + } + + /** + * Makes sure that during directory structure generation ignored dirs are not modified + * @private + * + * @param {String} root Dir name. + * @param {String} stats Information about the file. + * @param {Function} next Callback function + */ + ignoredDirHandler(root, stats, next) { + const relativeDir = path.relative(this.templateContentDir, path.resolve(root, stats.name)); + const dirPath = path.resolve(this.targetDir, relativeDir); + if (!shouldIgnoreDir(relativeDir)) { + xfs.mkdirpSync(dirPath); } - - if (!parsedJSON.asyncapi) { - throw new ParserError({ - type: 'missing-asyncapi-field', - title: 'The `asyncapi` field is missing.', - parsedJSON, - }); + next(); + } + + /** + * Makes sure that during directory structure generation ignored dirs are not modified + * @private + * + * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source. + * @param {String} objectMap Map of schemas of type object + * @param {String} root Dir name. + * @param {String} stats Information about the file. + * @param {Function} next Callback function + */ + async filesGenerationHandler(asyncapiDocument, objectMap, root, stats, next) { + const fileNamesForSeparation = { + channel: asyncapiDocument.channels(), + message: convertMapToObject(asyncapiDocument.allMessages()), + securityScheme: asyncapiDocument.components() ? asyncapiDocument.components().securitySchemes() : {}, + schema: asyncapiDocument.components() ? asyncapiDocument.components().schemas() : {}, + objectSchema: objectMap, + parameter: convertMapToObject(this.getAllParameters(asyncapiDocument)), + everySchema: convertMapToObject(asyncapiDocument.allSchemas()), + }; + + // Check if the filename dictates it should be separated + let wasSeparated = false; + for (const prop in fileNamesForSeparation) { + if (Object.prototype.hasOwnProperty.call(fileNamesForSeparation, prop) && stats.name.includes(`$$${prop}$$`)) { + await this.generateSeparateFiles(asyncapiDocument, fileNamesForSeparation[prop], prop, stats.name, root); + const templateFilePath = path.relative(this.templateContentDir, path.resolve(root, stats.name)); + fs.unlink(path.resolve(this.targetDir, templateFilePath), next); + wasSeparated = true; + //The filename can only contain 1 specifier (message, scheme etc) + break; + } } - - if (parsedJSON.asyncapi.startsWith('1.') || !asyncapi[parsedJSON.asyncapi]) { - throw new ParserError({ - type: 'unsupported-version', - title: `Version ${parsedJSON.asyncapi} is not supported.`, - detail: 'Please use latest version of the specification.', - parsedJSON, - validationErrors: [getLocationOf('/asyncapi', asyncapiYAMLorJSON, initialFormat)], - }); + // If it was not separated process normally + if (!wasSeparated) { + await this.generateFile(asyncapiDocument, stats.name, root); + next(); } + } - if (options.applyTraits === undefined) options.applyTraits = true; - - const refParser = new $RefParser; - //because of Ajv lacks support for circular refs, parser should not resolve them before Ajv validation and first needs to ignore them and leave circular $refs to successfully validate the document - //this is done pair to advice from Ajv creator https://github.com/ajv-validator/ajv/issues/1122#issuecomment-559378449 - //later we perform full dereference of circular refs if they occure - await dereference(refParser, parsedJSON, initialFormat, asyncapiYAMLorJSON, { ...options, dereference: { circular: 'ignore' } }); + /** + * Generates all the files for each in array + * + * @private + * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source. + * @param {Array} array The components/channels to generate the separeted files for. + * @param {String} template The template filename to replace. + * @param {String} fileName Name of the file to generate for each security schema. + * @param {String} baseDir Base directory of the given file name. + * @returns {Promise} + */ + generateSeparateFiles(asyncapiDocument, array, template, fileName, baseDir) { + const promises = []; - const ajv = new Ajv({ - jsonPointers: true, - allErrors: true, - schemaId: 'id', - logger: false, - }); - - ajv.addMetaSchema(__webpack_require__(52689)); - - const validate = ajv.compile(asyncapi[parsedJSON.asyncapi]); - const valid = validate(parsedJSON); - if (!valid) throw new ParserError({ - type: 'validation-errors', - title: 'There were errors validating the AsyncAPI document.', - parsedJSON, - validationErrors: improveAjvErrors(validate.errors, asyncapiYAMLorJSON, initialFormat), + Object.keys(array).forEach((name) => { + const component = array[name]; + promises.push(this.generateSeparateFile(asyncapiDocument, name, component, template, fileName, baseDir)); }); - await customDocumentOperations(parsedJSON, asyncapiYAMLorJSON, initialFormat, options); - if (refParser.$refs.circular) await handleCircularRefs(refParser, parsedJSON, initialFormat, asyncapiYAMLorJSON, options); - } catch (e) { - if (e instanceof ParserError) throw e; - throw new ParserError({ - type: 'unexpected-error', - title: e.message, - parsedJSON, - }); + return Promise.all(promises); } - return new AsyncAPIDocument(parsedJSON); -} + /** + * Generates a file for a component/channel + * + * @private + * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source. + * @param {String} name The name of the component (filename to use) + * @param {Object} component The component/channel object used to generate the file. + * @param {String} template The template filename to replace. + * @param {String} fileName Name of the file to generate for each security schema. + * @param {String} baseDir Base directory of the given file name. + * @returns {Promise} + */ + async generateSeparateFile(asyncapiDocument, name, component, template, fileName, baseDir) { + const relativeBaseDir = path.relative(this.templateContentDir, baseDir); -/** - * Fetches an AsyncAPI document from the given URL and passes its content to the `parse` method. - * - * @param {String} url URL where the AsyncAPI document is located. - * @param {Object} [fetchOptions] Configuration to pass to the {@link https://developer.mozilla.org/en-US/docs/Web/API/Request|fetch} call. - * @param {Object} [options] Configuration to pass to the {@link module:Parser#parse} method. - * @returns {Promise} The parsed AsyncAPI document. - */ -function parseFromUrl(url, fetchOptions, options) { - //Why not just addinga default to the arguments list? - //All function parameters with default values should be declared after the function parameters without default values. Otherwise, it makes it impossible for callers to take advantage of defaults; they must re-specify the defaulted values or pass undefined in order to "get to" the non-default parameters. - //To not break the API by changing argument position and to silet the linter it is just better to move adding - if (!fetchOptions) fetchOptions = {}; + const setFileTemplateNameHookName = 'setFileTemplateName'; + let filename = name; + if (this.isHookAvailable(setFileTemplateNameHookName)) { + const filenamesFromHooks = await this.launchHook(setFileTemplateNameHookName, { originalFilename: filename }); + //Use the result of the first hook + filename = filenamesFromHooks[0]; + } else { + filename = filenamify(filename, { replacement: '-', maxLength: 255 }); + } - return new Promise((resolve, reject) => { - fetch(url, fetchOptions) - .then(res => res.text()) - .then(doc => parse(doc, options)) - .then(result => resolve(result)) - .catch(reject); - }); -} + const newFileName = fileName.replace(`\$\$${template}\$\$`, filename); + const targetFile = path.resolve(this.targetDir, relativeBaseDir, newFileName); + const relativeTargetFile = path.relative(this.targetDir, targetFile); + const shouldOverwriteFile = this.shouldOverwriteFile(relativeTargetFile); + if (!shouldOverwriteFile) return; + //Ensure the same object are parsed to the renderFile method as before. + const temp = {}; + const key = template === 'everySchema' || template === 'objectSchema' ? 'schema' : template; + temp[`${key}Name`] = name; + temp[key] = component; + await this.renderAndWriteToFile(asyncapiDocument, path.resolve(baseDir, fileName), targetFile, temp); + } -async function dereference(refParser, parsedJSON, initialFormat, asyncapiYAMLorJSON, options) { - try { - return await refParser.dereference(options.path, parsedJSON, { - continueOnError: true, - parse: options.parse, - resolve: options.resolve, - dereference: options.dereference, - }); - } catch (err) { - throw new ParserError({ - type: 'dereference-error', - title: err.errors[0].message, - parsedJSON, - refs: findRefs(err.errors, initialFormat, asyncapiYAMLorJSON), - }); + /** + * Renders a template and writes the result into a file. + * + * @private + * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to pass to the template. + * @param {String} templateFilePath Path to the input file being rendered. + * @param {String} outputPath Path to the resulting rendered file. + * @param {Object} [extraTemplateData] Extra data to pass to the template. + */ + async renderAndWriteToFile(asyncapiDocument, templateFilePath, outputpath, extraTemplateData) { + const renderContent = await this.renderFile(asyncapiDocument, templateFilePath, extraTemplateData); + if (renderContent === undefined) { + return; + } else if (isReactTemplate(this.templateConfig)) { + await saveRenderedReactContent(renderContent, outputpath); + } else { + await writeFile(outputpath, renderContent); + } } -} -/* - * In case of circular refs, this function dereferences the spec again to dereference circular dependencies - * Special property is added to the document that indicates it contains circular refs -*/ -async function handleCircularRefs(refParser, parsedJSON, initialFormat, asyncapiYAMLorJSON, options) { - await dereference(refParser, parsedJSON, initialFormat, asyncapiYAMLorJSON, { ...options, dereference: { circular: true } }); - //mark entire document as containing circular references - parsedJSON[String(xParserCircle)] = true; -} + /** + * Generates a file. + * + * @private + * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source. + * @param {String} fileName Name of the file to generate for each channel. + * @param {String} baseDir Base directory of the given file name. + * @return {Promise} + */ + async generateFile(asyncapiDocument, fileName, baseDir) { + const sourceFile = path.resolve(baseDir, fileName); + const relativeSourceFile = path.relative(this.templateContentDir, sourceFile); + const targetFile = path.resolve(this.targetDir, this.maybeRenameSourceFile(relativeSourceFile)); + const relativeTargetFile = path.relative(this.targetDir, targetFile); -async function customDocumentOperations(parsedJSON, asyncapiYAMLorJSON, initialFormat, options) { - validateServerVariables(parsedJSON, asyncapiYAMLorJSON, initialFormat); - validateServerSecurity(parsedJSON, asyncapiYAMLorJSON, initialFormat, SPECIAL_SECURITY_TYPES); + if (shouldIgnoreFile(relativeSourceFile)) return; - if (!parsedJSON.channels) return; - - validateChannels(parsedJSON, asyncapiYAMLorJSON, initialFormat); - validateOperationId(parsedJSON, asyncapiYAMLorJSON, initialFormat, OPERATIONS); + const shouldOverwriteFile = this.shouldOverwriteFile(relativeTargetFile); + if (!shouldOverwriteFile) return; - await customChannelsOperations(parsedJSON, asyncapiYAMLorJSON, initialFormat, options); -} + if (this.templateConfig.conditionalFiles && this.templateConfig.conditionalFiles[relativeSourceFile]) { + const server = this.templateParams.server && asyncapiDocument.server(this.templateParams.server); + const source = jmespath.search({ + ...asyncapiDocument.json(), + ...{ + server: server ? server.json() : undefined, + }, + }, this.templateConfig.conditionalFiles[relativeSourceFile].subject); -async function validateAndConvertMessage(msg, originalAsyncAPIDocument, fileFormat, parsedAsyncAPIDocument, pathToPayload) { - const schemaFormat = msg.schemaFormat || DEFAULT_SCHEMA_FORMAT; + if (!source) return log.debug(logMessage.relativeSourceFileNotGenerated(relativeSourceFile, this.templateConfig.conditionalFiles[relativeSourceFile].subject)); - await PARSERS[String(schemaFormat)]({ - schemaFormat, - message: msg, - defaultSchemaFormat: DEFAULT_SCHEMA_FORMAT, - originalAsyncAPIDocument, - parsedAsyncAPIDocument, - fileFormat, - pathToPayload - }); + if (source) { + const validate = this.templateConfig.conditionalFiles[relativeSourceFile].validate; + const valid = validate(source); + if (!valid) return log.debug(logMessage.conditionalFilesMatched(relativeSourceFile)); + } + } - msg.schemaFormat = DEFAULT_SCHEMA_FORMAT; -} + if (this.isNonRenderableFile(relativeSourceFile)) return await copyFile(sourceFile, targetFile); -/** - * Registers a new schema parser. Schema parsers are in charge of parsing and transforming payloads to AsyncAPI Schema format. - * - * @param {Object} parserModule The schema parser module containing parse() and getMimeTypes() functions. - */ -function registerSchemaParser(parserModule) { - if (typeof parserModule !== 'object' - || typeof parserModule.parse !== 'function' - || typeof parserModule.getMimeTypes !== 'function') - throw new ParserError({ - type: 'impossible-to-register-parser', - title: 'parserModule must have parse() and getMimeTypes() functions.' - }); + await this.renderAndWriteToFile(asyncapiDocument, sourceFile, targetFile); + } - parserModule.getMimeTypes().forEach((schemaFormat) => { - PARSERS[String(schemaFormat)] = parserModule.parse; - }); -} + /** + * It may rename the source file name in cases where special names are not supported, like .gitignore or .npmignore. + * + * Since we're using npm to install templates, these files are never downloaded (that's npm behavior we can't change). + * @private + * @param {String} sourceFile Path to the source file + * @returns {String} New path name + */ + maybeRenameSourceFile(sourceFile) { + switch (path.basename(sourceFile)) { + case GIT_IGNORE_FILENAME: + return path.join(path.dirname(sourceFile), '.gitignore'); + case NPM_IGNORE_FILENAME: + return path.join(path.dirname(sourceFile), '.npmignore'); + default: + return sourceFile; + } + } -function applyTraits(js) { - if (Array.isArray(js.traits)) { - for (const trait of js.traits) { - for (const key in trait) { - js[String(key)] = mergePatch(js[String(key)], trait[String(key)]); - } + /** + * Renders the content of a file and outputs it. + * + * @private + * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to pass to the template. + * @param {String} filePath Path to the file you want to render. + * @param {Object} [extraTemplateData] Extra data to pass to the template. + * @return {Promise|undefined>} + */ + async renderFile(asyncapiDocument, filePath, extraTemplateData = {}) { + if (isReactTemplate(this.templateConfig)) { + return await renderReact(asyncapiDocument, filePath, extraTemplateData, this.templateDir, this.templateContentDir, TRANSPILED_TEMPLATE_LOCATION, this.templateParams, this.debug, this.originalAsyncAPI); } + const templateString = await readFile(filePath, 'utf8'); + return renderNunjucks(asyncapiDocument, templateString, filePath, extraTemplateData, this.templateParams, this.originalAsyncAPI, this.nunjucks); + } - js['x-parser-original-traits'] = js.traits; - delete js.traits; + /** + * Checks if a given file name matches the list of non-renderable files. + * + * @private + * @param {string} fileName Name of the file to check against a list of glob patterns. + * @return {boolean} + */ + isNonRenderableFile(fileName) { + const nonRenderableFiles = this.templateConfig.nonRenderableFiles || []; + if (!Array.isArray(nonRenderableFiles)) return false; + if (nonRenderableFiles.some(globExp => minimatch(fileName, globExp))) return true; + if (isReactTemplate(this.templateConfig) && !isJsFile(fileName)) return true; + return false; } -} -/** - * Triggers additional operations on the AsyncAPI channels like traits application or message validation and conversion - * - * @private - * - * @param {Object} parsedJSON parsed AsyncAPI document - * @param {String} asyncapiYAMLorJSON AsyncAPI document in string - * @param {String} initialFormat information of the document was oryginally JSON or YAML - * @param {Object} options Configuration options. - */ -async function customChannelsOperations(parsedJSON, asyncapiYAMLorJSON, initialFormat, options) { - const promisesArray = []; - Object.entries(parsedJSON.channels).forEach(([channelName, channel]) => { - promisesArray.push(...OPERATIONS.map(async (opName) => { - const op = channel[String(opName)]; - if (!op) return; + /** + * Checks if a given file should be overwritten. + * + * @private + * @param {string} filePath Path to the file to check against a list of glob patterns. + * @return {boolean} + */ + async shouldOverwriteFile(filePath) { + if (!Array.isArray(this.noOverwriteGlobs)) return true; + const fileExists = await exists(path.resolve(this.targetDir, filePath)); + if (!fileExists) return true; - const messages = op.message ? (op.message.oneOf || [op.message]) : []; - if (options.applyTraits) { - applyTraits(op); - messages.forEach(m => applyTraits(m)); - } - const pathToPayload = `/channels/${channelName}/${opName}/message/payload`; - for (const m of messages) { - await validateAndConvertMessage(m, asyncapiYAMLorJSON, initialFormat, parsedJSON, pathToPayload); - } - })); - }); - await Promise.all(promisesArray); -} + return !this.noOverwriteGlobs.some(globExp => minimatch(filePath, globExp)); + } -/***/ }), + /** + * Loads the template configuration. + * @private + */ + async loadTemplateConfig() { + try { + const configPath = path.resolve(this.templateDir, CONFIG_FILENAME); + if (!fs.existsSync(configPath)) { + this.templateConfig = {}; + return; + } -/***/ 12065: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + const json = await readFile(configPath, { encoding: 'utf8' }); + const generatorProp = JSON.parse(json).generator; + this.templateConfig = generatorProp || {}; + } catch (e) { + this.templateConfig = {}; + } + await this.loadDefaultValues(); + } -const YAML = __webpack_require__(21917); -const { yamlAST, loc } = __webpack_require__(54178); -const jsonAST = __webpack_require__(86675); -const jsonParseBetterErrors = __webpack_require__(78280); -const ParserError = __webpack_require__(21978); + /** + * Loads default values of parameters from template config. If value was already set as parameter it will not be + * overriden. + * @private + */ + async loadDefaultValues() { + const parameters = this.templateConfig.parameters; + const defaultValues = Object.keys(parameters || {}).filter(key => parameters[key].default); -const jsonPointerToArray = jsonPointer => (jsonPointer || '/').split('/').splice(1); + defaultValues.filter(dv => this.templateParams[dv] === undefined).forEach(dv => + Object.defineProperty(this.templateParams, dv, { + enumerable: true, + get() { + return parameters[dv].default; + } + }) + ); + } -const utils = module.exports; + /** + * Launches all the hooks registered at a given hook point/name. + * + * @param {string} hookName + * @param {*} hookArguments + * @private + */ + async launchHook(hookName, hookArguments) { + let disabledHooks = this.disabledHooks[hookName] || []; + if (disabledHooks === true) return; + if (typeof disabledHooks === 'string') disabledHooks = [disabledHooks]; -const getAST = (asyncapiYAMLorJSON, initialFormat) => { - if (initialFormat === 'yaml') { - return yamlAST(asyncapiYAMLorJSON); - } else if (initialFormat === 'json') { - return jsonAST(asyncapiYAMLorJSON); - } -}; + const hooks = this.hooks[hookName]; + if (!Array.isArray(hooks)) return; + const promises = hooks.map(async (hook) => { + if (typeof hook !== 'function') return; + if (disabledHooks.includes(hook.name)) return; + return await hook(this, hookArguments); + }).filter(Boolean); -const findNode = (obj, location) => { - for (const key of location) { - obj = obj ? obj[utils.untilde(key)] : null; + return Promise.all(promises); } - return obj; -}; - -const findNodeInAST = (ast, location) => { - let obj = ast; - for (const key of location) { - if (!Array.isArray(obj.children)) return; - let childArray; - const child = obj.children.find(c => { - if (!c) return; + /** + * Check if any hooks are available + * + * @param {string} hookName + * @private + */ + isHookAvailable(hookName) { + const hooks = this.hooks[hookName]; - if (c.type === 'Object') return childArray = c.children.find(a => a.key.value === utils.untilde(key)); - return c.type === 'Property' && c.key && c.key.value === utils.untilde(key); - }); + if (this.disabledHooks[hookName] === true + || !Array.isArray(hooks) + || hooks.length === 0) return false; - if (!child) return; - obj = childArray ? childArray.value : child.value; - } - return obj; -}; + let disabledHooks = this.disabledHooks[hookName] || []; + if (typeof disabledHooks === 'string') disabledHooks = [disabledHooks]; -const findLocationOf = (keys, ast, initialFormat) => { - if (initialFormat === 'js') return { jsonPointer: `/${keys.join('/')}` }; - - let node; - if (initialFormat === 'yaml') { - node = findNode(ast, keys); - } else if (initialFormat === 'json') { - node = findNodeInAST(ast, keys); + return !!hooks.filter(h => !disabledHooks.includes(h.name)).length; } - if (!node) return { jsonPointer: `/${keys.join('/')}` }; + /** + * Check if given directory is a git repo with unstaged changes and is not in .gitignore or is not empty + * @private + * @param {String} dir Directory that needs to be tested for a given condition. + */ + async verifyTargetDir(dir) { + const isGitRepo = await git(dir).checkIsRepo(); - let info; - if (initialFormat === 'yaml') { - // disable eslint because loc is a Symbol - // eslint-disable-next-line security/detect-object-injection - info = node[loc]; - } else if (initialFormat === 'json') { - info = node.loc; - } + if (isGitRepo) { + //Need to figure out root of the repository to properly verify .gitignore + const root = await git(dir).revparse(['--show-toplevel']); + const gitInfo = git(root); - if (!info) return { jsonPointer: `/${keys.join('/')}` }; + //Skipping verification if workDir inside repo is declared in .gitignore + const workDir = path.relative(root, dir); + if (workDir) { + const checkGitIgnore = await gitInfo.checkIgnore(workDir); + if (checkGitIgnore.length !== 0) return; + } - return { - jsonPointer: `/${keys.join('/')}`, - startLine: info.start.line, - startColumn: info.start.column + 1, - startOffset: info.start.offset, - endLine: info.end ? info.end.line : undefined, - endColumn: info.end ? info.end.column + 1 : undefined, - endOffset: info.end ? info.end.offset : undefined, - }; -}; + const gitStatus = await gitInfo.status(); + //New files are not tracked and not visible as modified + const hasUntrackedUnstagedFiles = gitStatus.not_added.length !== 0; -const getMapValue = (obj, key, Type) => { - if (typeof key !== 'string' || !obj) return null; - const v = obj[String(key)]; - if (v === undefined) return null; - return Type ? new Type(v) : v; -}; + const stagedFiles = gitStatus.staged; + const modifiedFiles = gitStatus.modified; + const hasModifiedUstagedFiles = (modifiedFiles.filter(e => stagedFiles.indexOf(e) === -1)).length !== 0; -utils.tilde = (str) => { - return str.replace(/[~\/]{1}/g, (m) => { - switch (m) { - case '/': return '~1'; - case '~': return '~0'; - } - return m; - }); -}; + if (hasModifiedUstagedFiles || hasUntrackedUnstagedFiles) throw new Error(`"${this.targetDir}" is in a git repository with unstaged changes. Please commit your changes before proceeding or add proper directory to .gitignore file. You can also use the --force-write flag to skip this rule (not recommended).`); + } else { + const isDirEmpty = (await readDir(dir)).length === 0; -utils.untilde = (str) => { - if (!str.includes('~')) return str; - return str.replace(/~[01]/g, (m) => { - switch (m) { - case '~1': return '/'; - case '~0': return '~'; + if (!isDirEmpty) throw new Error(`"${this.targetDir}" is not an empty directory. You might override your work. To skip this rule, please make your code a git repository or use the --force-write flag (not recommended).`); } - return m; - }); -}; - -utils.toJS = (asyncapiYAMLorJSON) => { - if (!asyncapiYAMLorJSON) { - throw new ParserError({ - type: 'null-or-falsey-document', - title: 'Document can\'t be null or falsey.', - }); } +} - if (asyncapiYAMLorJSON.constructor && asyncapiYAMLorJSON.constructor.name === 'Object') { - return { - initialFormat: 'js', - parsedJSON: asyncapiYAMLorJSON, - }; - } - - if (typeof asyncapiYAMLorJSON !== 'string') { - throw new ParserError({ - type: 'invalid-document-type', - title: 'The AsyncAPI document has to be either a string or a JS object.', - }); - } - if (asyncapiYAMLorJSON.trimLeft().startsWith('{')) { - try { - return { - initialFormat: 'json', - parsedJSON: jsonParseBetterErrors(asyncapiYAMLorJSON), - }; - } catch (e) { - throw new ParserError({ - type: 'invalid-json', - title: 'The provided JSON is not valid.', - detail: e.message, - location: { - startOffset: e.offset, - startLine: e.startLine, - startColumn: e.startColumn, - }, - }); - } - } else { - try { - return { - initialFormat: 'yaml', - parsedJSON: YAML.safeLoad(asyncapiYAMLorJSON), - }; - } catch (err) { - throw new ParserError({ - type: 'invalid-yaml', - title: 'The provided YAML is not valid.', - detail: err.message, - location: { - startOffset: err.mark.position, - startLine: err.mark.line + 1, - startColumn: err.mark.column + 1, - }, - }); - } - } -}; +Generator.DEFAULT_TEMPLATES_DIR = DEFAULT_TEMPLATES_DIR; +Generator.TRANSPILED_TEMPLATE_LOCATION = TRANSPILED_TEMPLATE_LOCATION; -utils.createMapOfType = (obj, Type) => { - const result = {}; - if (!obj) return result; +module.exports = Generator; - Object.entries(obj).forEach(([key, value]) => { - result[String(key)] = new Type(value); - }); - return result; -}; +/***/ }), -utils.getMapValueOfType = (obj, key, Type) => { - return getMapValue(obj, key, Type); -}; +/***/ 27014: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -utils.getMapValueByKey = (obj, key) => { - return getMapValue(obj, key); -}; +const path = __nccwpck_require__(85622); +const xfs = __nccwpck_require__(52088); +const { exists } = __nccwpck_require__(65015); /** - * Extends a given model with additional methods related to frequently recurring models - * @function mix - * @private - * @param {Object} model model to extend - * @param {Array} mixins array with mixins to extend the model with + * Registers all template hooks. + * @param {Object} hooks Object that stores information about all available hook functions grouped by the type of the hook. + * @param {Object} templateConfig Template configuration. + * @param {String} templateDir Directory where template is located. + * @param {String} hooksDir Directory where local hooks are located. */ -utils.mix = (model, ...mixins) => { - let duplicatedMethods = false; - function checkDuplication(mixin) { - // check duplication of model in mixins array - if (model === mixin) return true; - // check duplication of model's methods - duplicatedMethods = Object.keys(mixin).some(mixinMethod => model.prototype.hasOwnProperty(mixinMethod)); - return duplicatedMethods; - } +module.exports.registerHooks = async (hooks, templateConfig, templateDir, hooksDir) => { + await registerLocalHooks(hooks, templateDir, hooksDir); + + if (templateConfig && Object.keys(templateConfig).length > 0) await registerConfigHooks(hooks, templateDir, templateConfig); - if (mixins.some(checkDuplication)) { - if (duplicatedMethods) { - throw new Error(`invalid mix function: model ${model.name} has at least one method that it is trying to replace by mixin`); - } else { - throw new Error(`invalid mix function: cannot use the model ${model.name} as a mixin`); - } - } - mixins.forEach(mixin => Object.assign(model.prototype, mixin)); - return model; + return hooks; }; -utils.findRefs = (errors, initialFormat, asyncapiYAMLorJSON) => { - let refs = []; - - errors.map(({ path }) => refs.push({ location: [...path.map(utils.tilde), '$ref'] })); - - if (initialFormat === 'js') { - return refs.map(ref => ({ jsonPointer: `/${ref.location.join('/')}` })); - } +/** + * Loads the local template hooks from default location. + * @private + * @param {Object} hooks Object that stores information about all available hook functions grouped by the type of the hook. + * @param {String} templateDir Directory where template is located. + * @param {String} hooksDir Directory where local hooks are located. + */ +async function registerLocalHooks(hooks, templateDir, hooksDir) { + return new Promise(async (resolve, reject) => { + const localHooks = path.resolve(templateDir, hooksDir); - if (initialFormat === 'yaml') { - const pseudoAST = yamlAST(asyncapiYAMLorJSON); - refs = refs.map(ref => findLocationOf(ref.location, pseudoAST, initialFormat)); - } else if (initialFormat === 'json') { - const ast = jsonAST(asyncapiYAMLorJSON); - refs = refs.map(ref => findLocationOf(ref.location, ast, initialFormat)); - } + if (!await exists(localHooks)) return resolve(hooks); - return refs; -}; + const walker = xfs.walk(localHooks, { + followLinks: false + }); + + walker.on('file', async (root, stats, next) => { + try { + const filePath = path.resolve(templateDir, path.resolve(root, stats.name)); + delete require.cache[require.resolve(filePath)]; + const mod = require(filePath); -utils.getLocationOf = (jsonPointer, asyncapiYAMLorJSON, initialFormat) => { - const ast = getAST(asyncapiYAMLorJSON, initialFormat); - if (!ast) return { jsonPointer }; + addHook(hooks, mod); - return findLocationOf(jsonPointerToArray(jsonPointer), ast, initialFormat); -}; + next(); + } catch (e) { + reject(e); + } + }); -utils.improveAjvErrors = (errors, asyncapiYAMLorJSON, initialFormat) => { - const ast = getAST(asyncapiYAMLorJSON, initialFormat); - return errors.map(error => { - const defaultLocation = { jsonPointer: error.dataPath || '/' }; + walker.on('errors', (root, nodeStatsArray) => { + reject(nodeStatsArray); + }); - return { - title: `${error.dataPath || '/'} ${error.message}`, - location: ast ? findLocationOf(jsonPointerToArray(error.dataPath), ast, initialFormat) : defaultLocation, - }; + walker.on('end', async () => { + resolve(hooks); + }); }); -}; +} /** - * It parses the string and returns an array with all values that are between curly braces, including braces - * @function parseUrlVariables + * Loads the template hooks provided in template config. * @private + * + * @param {Object} hooks Object that stores information about all available hook functions grouped by the type of the hook. + * @param {String} templateDir Directory where template is located. + * @param {String} templateConfig Template configuration. */ -utils.parseUrlVariables = str => { - if (typeof str !== 'string') return; - - return str.match(/{(.+?)}/g); -}; +async function registerConfigHooks(hooks, templateDir, templateConfig) { + const configHooks = templateConfig.hooks; + const DEFAULT_MODULES_DIR = 'node_modules'; -/** - * It parses the string and returns url parameters as string - * @function parseUrlQueryParameters - * @private - */ -utils.parseUrlQueryParameters = str => { - if (typeof str !== 'string') return; - - return str.match(/\?((.*=.*)(&?))/g); -}; + if (typeof configHooks !== 'object' || !Object.keys(configHooks).length > 0) return; -/** - * Returns an array of not existing properties in provided object with names specified in provided array - * @function getMissingProps - * @private - */ -utils.getMissingProps = (arr, obj) => { - arr = arr.map(val => val.replace(/[{}]/g, '')); + const promises = Object.keys(configHooks).map(async hooksModuleName => { + let mod; + try { + //first we try to grab module with hooks by the module name + //this is when generation is used on production using remote templates + mod = require(hooksModuleName); + } catch (error) { + //in case template is local but was not installed in node_modules of the generator then we need to explicitly provide modules location + mod = require(path.resolve(templateDir, DEFAULT_MODULES_DIR, hooksModuleName)); + } + const configHooksArray = [].concat(configHooks[hooksModuleName]); - if (!obj) return arr; - - return arr.filter(val => { - return !obj.hasOwnProperty(val); + addHook(hooks, mod, configHooksArray); }); -}; + await Promise.all(promises); + return hooks; +} /** - * Returns array of errors messages compatible with validationErrors parameter from ParserError - * - * @function groupValidationErrors + * Add hook from given module to list of available hooks * @private - * @param {String} root name of the root element in the AsyncAPI document, for example channels - * @param {String} errorMessage the text of the custom error message that will follow the path that points the error - * @param {Map} errorElements map of error elements cause the validation error might happen in many places in the document. - * The key should have a path information where the error was found, the value holds information about error element but it is not mandatory - * @param {String} asyncapiYAMLorJSON AsyncAPI document in string - * @param {String} initialFormat information of the document was oryginally JSON or YAML - * @returns {Array} Object has always 2 keys, title and location. Title is a combination of errorElement key + errorMessage + errorElement value. - * Location is the object with information about location of the issue in the file and json Pointer + * @param {Object} hooks Object that stores information about all available hook functions grouped by the type of the hook. + * @param {Object} mod Single module with object of hook functions grouped by the type of the hook + * @param {Array} config List of hooks configured in template configuration */ -utils.groupValidationErrors = (root, errorMessage, errorElements, asyncapiYAMLorJSON, initialFormat) => { - const errors = []; +function addHook(hooks, mod, config) { + /** + * ESM `export default { ... }` is transpiled to: + * module.exports = { default: { ... } }; + * First check the `default` object, and if it exists the override mod to `default`. + */ + if (typeof mod.default === 'object') { + mod = mod.default; + } - errorElements.forEach((val, key) => { - if (typeof val === 'string') val = utils.untilde(val); + Object.keys(mod).forEach(hookType => { + const moduleHooksArray = [].concat(mod[hookType]); - errors.push({ - title: val ? `${ utils.untilde(key) } ${errorMessage}: ${val}` : `${ utils.untilde(key) } ${errorMessage}`, - location: utils.getLocationOf(`/${root}/${key}`, asyncapiYAMLorJSON, initialFormat) + moduleHooksArray.forEach(hook => { + if (config && !config.includes(hook.name)) return; + + hooks[hookType] = hooks[hookType] || []; + hooks[hookType].push(hook); }); }); + return hooks; +} - return errors; -}; -/** - * extend map with channel params missing corresponding param object - * - * @function setNotProvidedParams - * @private - * @param {Array} variables array of all identified URL variables in a channel name - * @param {Object} val the channel object for which to identify the missing parameters - * @param {String} key the channel name. - * @param {Array} notProvidedChannelParams concatinated list of missing parameters for all channels - * @param {Map} notProvidedParams result map of all missing parameters extended by this function - */ -utils.setNotProvidedParams = (variables, val, key, notProvidedChannelParams, notProvidedParams) => { - const missingChannelParams = utils.getMissingProps(variables, val.parameters); +/***/ }), - if (missingChannelParams.length) { - notProvidedParams.set(utils.tilde(key), - notProvidedChannelParams - ? notProvidedChannelParams.concat(missingChannelParams) - : missingChannelParams); - } -}; +/***/ 85137: +/***/ ((module) => { -/***/ }), +const TEMPLATE_INSTALL_FLAG_MSG = 'because you passed --install flag'; -/***/ 54443: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +const TEMPLATE_INSTALL_DISK_MSG = 'because the template cannot be found on disk'; -const yaml = __webpack_require__(21917); -const r2j = __webpack_require__(33601); +const NODE_MODULES_INSTALL ='Remember that your local template must have its own node_modules installed first, \"npm install\" is not triggered by the generator.'; -module.exports = { - parse, - getMimeTypes -}; +const NPM_INSTALL_TRIGGER = 'Installation of template located on disk technically means symlink creation betweed node_modules of the generator and template sources. Your local template must have its own node_modules, "npm install" is not triggered.'; -async function parse({ message, defaultSchemaFormat }) { - try { - let payload = message.payload; - if (typeof payload === 'object') { - payload = `#%RAML 1.0 Library\n${ - yaml.safeDump({ types: { tmpType: payload } })}`; - } +function templateVersion(ver) { + return `Version of used template is ${ver}.`; +} - // Draft 6 is compatible with 7. - const jsonModel = await r2j.dt2js(payload, 'tmpType', { draft: '06' }); - const convertedType = jsonModel.definitions.tmpType; +function templateSource(localHtmlTemplate) { + return `Template sources taken from ${localHtmlTemplate}.`; +} - message['x-parser-original-schema-format'] = message.schemaFormat || defaultSchemaFormat; - message['x-parser-original-payload'] = payload; - message.payload = convertedType; - delete message.schemaFormat; - } catch (e) { - console.error(e); - } -}; +function templateNotFound(templateName) { + return `${templateName} not found in local dependencies but found it installed as a global package.`; +} -function getMimeTypes() { - return [ - 'application/raml+yaml;version=1.0', - ]; +function packageNotAvailable(pkgPath) { + return `Unable to resolve template location at ${pkgPath}. Package is not available locally.`; } +function installationDebugMessage(debugMessage) { + return `Template installation started ${debugMessage}.`; +} +function templateSuccessfullyInstalled(packageName, packagePath) { + return `Template ${packageName} successfully installed in ${packagePath}.`; +} -/***/ }), +function relativeSourceFileNotGenerated(relativeSourceFile , subject) { + return `${relativeSourceFile} was not generated because ${subject} specified in template configuration in conditionalFiles was not found in provided AsyncAPI specification file.`; +} -/***/ 78100: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +function conditionalFilesMatched(relativeSourceFile) { + return `${relativeSourceFile} was not generated because condition specified for this file in template configuration in conditionalFiles matched.`; +} module.exports = { - '1.0.0': __webpack_require__(26727), - '1.1.0': __webpack_require__(56409), - '1.2.0': __webpack_require__(14679), - '2.0.0-rc1': __webpack_require__(34146), - '2.0.0-rc2': __webpack_require__(49121), - '2.0.0': __webpack_require__(88547), -}; + TEMPLATE_INSTALL_FLAG_MSG, + TEMPLATE_INSTALL_DISK_MSG, + NODE_MODULES_INSTALL, + NPM_INSTALL_TRIGGER, + templateVersion, + templateSource, + templateNotFound, + packageNotAvailable, + installationDebugMessage, + templateSuccessfullyInstalled, + relativeSourceFileNotGenerated, + conditionalFilesMatched +}; /***/ }), -/***/ 54178: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 75094: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { load, Kind } = __webpack_require__(68342); +const Nunjucks = __nccwpck_require__(17006); +const nunjucksExport = module.exports; -const loc = Symbol('pseudo-yaml-ast-loc'); -const hasOwnProp = (obj, key) => (obj && typeof obj === 'object' && Object.prototype.hasOwnProperty.call(obj, key)); -const isUndefined = v => v === undefined; -const isNull = v => v === null; - -const isPrimitive = v => - Number.isNaN(v) || isNull(v) || isUndefined(v) || typeof v === 'symbol'; - -const isPrimitiveNode = node => - isPrimitive(node.value) || !hasOwnProp(node, 'value'); +/** + * Configures Nunjucks templating system + * + * @private + * @param {boolean} debug flag + * @param {string} templateDir path + */ +nunjucksExport.configureNunjucks = (debug, templateDir) => { + const config = {}; + if (debug) config.dev = true; -const isBetween = (start, pos, end) => pos <= end && pos >= start; + return new Nunjucks.Environment(new Nunjucks.FileSystemLoader(templateDir), config); +}; -const getLoc = (input, { start = 0, end = 0 }) => { - const lines = input.split(/\n/); +/** + * Renders the template with nunjucks and returns a string. + * + * @param {import('@asyncapi/parser').AsyncAPIDocument} asyncapiDocument + * @param {string} templateString template filecontent to be rendered with nunjucks + * @param {string} filePath path to the template file + * @param {Object} extraTemplateData Extra data to pass to the template. + * @param {Object} templateParams provided template parameters + * @param {string} originalAsyncAPI + * @param {} nunjucks instance + * @return {Promise} + */ +nunjucksExport.renderNunjucks = (asyncapiDocument, templateString, filePath, extraTemplateData, templateParams, originalAsyncAPI, nunjucks) => { + return new Promise((resolve, reject) => { + nunjucks.renderString(templateString, { + asyncapi: asyncapiDocument, + params: templateParams, + originalAsyncAPI, + ...extraTemplateData + }, { path: filePath }, (err, result) => { + if (err) return reject(err); + resolve(result); + }); + }); +}; - const loc = { - start: {}, - end: {} - }; - let sum = 0; +/***/ }), - for (const i of lines.keys()) { - const line = lines[i]; - const ls = sum; - const le = sum + line.length; +/***/ 64744: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (isUndefined(loc.start.line) && isBetween(ls, start, le)) { - loc.start.line = i + 1; - loc.start.column = start - ls; - loc.start.offset = start; - } +const path = __nccwpck_require__(85622); +const AsyncReactSDK = __nccwpck_require__(87824); +const { + writeFile +} = __nccwpck_require__(65015); - if (isUndefined(loc.end.line) && isBetween(ls, end, le)) { - loc.end.line = i + 1; - loc.end.column = end - ls; - loc.end.offset = end; - } +const reactExport = module.exports; - sum = le + 1; // +1 because the break is also a char - } +/** + * Configures React templating system, this handles all the transpilation work. + * + * @private + * @param {string} templateLocation located for thetemplate + * @param {string} templateContentDir where the template content are located + * @param {string} transpiledTemplateLocation folder for the transpiled code + */ +reactExport.configureReact = async (templateLocation, templateContentDir, transpiledTemplateLocation) => { + const outputDir = path.resolve(templateLocation, `./${transpiledTemplateLocation}`); + await AsyncReactSDK.transpileFiles(templateContentDir, outputDir, { + recursive: true + }); +}; - return loc; +/** + * Renders the template with react and returns the content and meta data for the file. + * + * @private + * @param {AsyncAPIDocument} asyncapiDocument + * @param {string} filePath path to the template file + * @param {Object} extraTemplateData Extra data to pass to the template. + * @param {string} templateLocation located for thetemplate + * @param {string} templateContentDir where the template content are located + * @param {string} transpiledTemplateLocation folder for the transpiled code + * @param {Object} templateParams provided template parameters + * @param {boolean} debug flag + * @param {string} originalAsyncAPI + * @return {Promise} + */ +reactExport.renderReact = async (asyncapiDocument, filePath, extraTemplateData, templateLocation, templateContentDir, transpiledTemplateLocation, templateParams, debug, originalAsyncAPI) => { + extraTemplateData = extraTemplateData || {}; + filePath = filePath.replace(templateContentDir, path.resolve(templateLocation, transpiledTemplateLocation)); + return await AsyncReactSDK.renderTemplate( + filePath, + { + asyncapi: asyncapiDocument, + params: templateParams, + originalAsyncAPI, + ...extraTemplateData + }, + debug + ); }; -const visitors = { - MAP: (node = {}, input = '', ctx = {}) => - Object.assign(walk(node.mappings, input), { - [loc]: getLoc(input, { - start: node.startPosition, - end: node.endPosition - }) - }), - MAPPING: (node = {}, input = '', ctx = {}) => { - const value = walk([node.value], input); +/** + * Save the single rendered react content based on the meta data available. + * + * @private + * @param {TemplateRenderResult} renderedContent the react content rendered + * @param {String} outputPath Path to the file being rendered. + */ +const saveContentToFile = async (renderedContent, outputPath) => { + let filePath = outputPath; + // Might be the same as in the `fs` package, but is an active choice for our default file permission for any rendered files. + let permissions = 0o666; + const content = renderedContent.content; - if (!isPrimitive(value)) { - value[loc] = getLoc(input, { - start: node.startPosition, - end: node.endPosition - }); + if (content === undefined || typeof content !== 'string') { + throw Error(`Template file not rendered correctly, was rendered as ${content}`); + } + if (renderedContent.metadata !== undefined) { + if (renderedContent.metadata.permissions !== undefined) { + permissions = renderedContent.metadata.permissions; } - - return Object.assign(ctx, { - [node.key.value]: value - }); - }, - SCALAR: (node = {}, input = '') => { - if (isPrimitiveNode(node)) { - return node.value; + if (renderedContent.metadata.fileName !== undefined) { + const newFileName = renderedContent.metadata.fileName.trim(); + const basepath = path.basename(filePath); + filePath = filePath.replace(basepath, newFileName); } + } - const _loc = getLoc(input, { - start: node.startPosition, - end: node.endPosition - }); - - const wrappable = Constructor => () => { - const v = new Constructor(node.value); - v[loc] = _loc; - return v; - }; - - const object = () => { - node.value[loc] = _loc; - return node.value; - }; - - const types = { - boolean: wrappable(Boolean), - number: wrappable(Number), - string: wrappable(String), - function: object, - object - }; - - return types[typeof node.value](); - }, - SEQ: (node = {}, input = '') => { - const items = walk(node.items, input, []); - - items[loc] = getLoc(input, { - start: node.startPosition, - end: node.endPosition - }); + await writeFile(filePath, content, { + mode: permissions + }); +}; - return items; +/** + * Save the rendered react content based on the meta data available. + * + * @private + * @param {TemplateRenderResult[] | TemplateRenderResult} renderedContent the react content rendered + * @param {String} outputPath Path to the file being rendered. + */ +reactExport.saveRenderedReactContent = async (renderedContent, outputPath) => { + if (Array.isArray(renderedContent)) { + return Promise.all(renderedContent.map(content => saveContentToFile(content, outputPath))); } + return saveContentToFile(renderedContent, outputPath); }; -const walk = (nodes = [], input, ctx = {}) => { - const onNode = (node, ctx, fallback) => { - let visitor; - if (node) visitor = visitors[Kind[node.kind]]; - return visitor ? visitor(node, input, ctx) : fallback; - }; - - const walkObj = () => - nodes.reduce((sum, node) => { - return onNode(node, sum, sum); - }, ctx); - const walkArr = () => - nodes.map(node => onNode(node, ctx, null), ctx).filter(Boolean); +/***/ }), - return Array.isArray(ctx) ? walkArr() : walkObj(); -}; +/***/ 45881: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports.loc = loc; -module.exports.yamlAST = input => walk([load(input)], input); +const semver = __nccwpck_require__(57489); +const Ajv = __nccwpck_require__(64941); +const { getGeneratorVersion } = __nccwpck_require__(65015); +const levenshtein = __nccwpck_require__(30592); +const ajv = new Ajv({ allErrors: true }); -/***/ }), +/** + * Validates the template configuration. + * + * @param {Object} templateConfig Template configuration. + * @param {Object} templateParams Params specified when running generator. + * @param {AsyncAPIDocument} asyncapiDocument AsyncAPIDocument object to use as source. + * @return {Boolean} + */ +module.exports.validateTemplateConfig = (templateConfig, templateParams, asyncapiDocument) => { + const { parameters, supportedProtocols, conditionalFiles, generator } = templateConfig; + + validateConditionalFiles(conditionalFiles); + isTemplateCompatible(generator); + isRequiredParamProvided(parameters, templateParams); + isProvidedTemplateRendererSupported(templateConfig); + if (asyncapiDocument) { + const server = asyncapiDocument.server(templateParams.server); + isServerProvidedInDocument(server, templateParams.server); + isServerProtocolSupported(server, supportedProtocols, templateParams.server); + } -/***/ 50326: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + isProvidedParameterSupported(parameters, templateParams); -"use strict"; + return true; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Ono = void 0; -const extend_error_1 = __webpack_require__(43561); -const normalize_1 = __webpack_require__(19322); -const to_json_1 = __webpack_require__(24833); -const constructor = Ono; -exports.Ono = constructor; /** - * Creates an `Ono` instance for a specifc error type. + * Checks if template is compatible with the version of the generator that is used + * @private + * @param {String} generator Information about supported generator version that is part of the template configuration */ -// eslint-disable-next-line @typescript-eslint/naming-convention -function Ono(ErrorConstructor, options) { - options = normalize_1.normalizeOptions(options); - function ono(...args) { - let { originalError, props, message } = normalize_1.normalizeArgs(args, options); - // Create a new error of the specified type - let newError = new ErrorConstructor(message); - // Extend the error with the properties of the original error and the `props` object - return extend_error_1.extendError(newError, originalError, props); - } - ono[Symbol.species] = ErrorConstructor; - return ono; +function isTemplateCompatible(generator) { + const generatorVersion = getGeneratorVersion(); + if (typeof generator === 'string' && !semver.satisfies(generatorVersion, generator, {includePrerelease: true})) { + throw new Error(`This template is not compatible with the current version of the generator (${generatorVersion}). This template is compatible with the following version range: ${generator}.`); + } } + /** - * Returns an object containing all properties of the given Error object, - * which can be used with `JSON.stringify()`. + * Checks if parameters described in template configuration as required are passed to the generator + * @private + * @param {Object} configParams Parameters specified in template configuration + * @param {Object} templateParams All parameters provided to generator */ -Ono.toJSON = function toJSON(error) { - return to_json_1.toJSON.call(error); -}; +function isRequiredParamProvided(configParams, templateParams) { + const missingParams = Object.keys(configParams || {}) + .filter(key => configParams[key].required && !templateParams[key]); + + if (missingParams.length) { + throw new Error(`This template requires the following missing params: ${missingParams}.`); + } +} + /** - * Extends the given Error object with enhanced Ono functionality, such as nested stack traces, - * additional properties, and improved support for `JSON.stringify()`. + * Provides a hint for a user about correct parameter name. + * @private + * @param {Object} wrongParam Incorrectly written parameter + * @param {Object} configParams Parameters specified in template configuration */ -Ono.extend = function extend(error, originalError, props) { - if (props || originalError instanceof Error) { - return extend_error_1.extendError(error, originalError, props); - } - else if (originalError) { - return extend_error_1.extendError(error, undefined, originalError); - } - else { - return extend_error_1.extendError(error); - } -}; -//# sourceMappingURL=constructor.js.map +function getParamSuggestion(wrongParam, configParams) { + const sortInt = (a, b) => { + return a[0] - b[0]; + }; + const arr = Object.keys(configParams).map(param => [levenshtein(wrongParam, param), param]); -/***/ }), + return arr.sort(sortInt)[0][1]; +} -/***/ 43561: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/** + * Checks if parameters provided to generator is supported by the template + * @private + * @param {Object} configParams Parameters specified in template configuration + * @param {Object} templateParams All parameters provided to generator + */ +function isProvidedParameterSupported(configParams, templateParams) { + const wrongParams = Object.keys(templateParams || {}).filter(key => !configParams || !configParams[key]); + + if (!wrongParams.length) return; + if (!configParams) throw new Error('This template doesn\'t have any params.'); -"use strict"; + let suggestionsString = ''; + + wrongParams.forEach(wp => { + suggestionsString += `\nDid you mean "${getParamSuggestion(wp,configParams)}" instead of "${wp}"?`; + }); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.extendError = void 0; -const isomorphic_node_1 = __webpack_require__(26315); -const stack_1 = __webpack_require__(55254); -const to_json_1 = __webpack_require__(24833); -const protectedProps = ["name", "message", "stack"]; + throw new Error(`This template doesn't have the following params: ${wrongParams}.${suggestionsString}`); +} + /** - * Extends the new error with the properties of the original error and the `props` object. - * - * @param newError - The error object to extend - * @param originalError - The original error object, if any - * @param props - Additional properties to add, if any + * Checks if given AsyncAPI document has servers with protocol that is supported by the template + * @private + * @param {Object} server Server object from AsyncAPI file + * @param {String[]} supportedProtocols Supported protocols specified in template configuration + * @param {String} paramsServerName Name of the server specified as a param for the generator */ -function extendError(error, originalError, props) { - let onoError = error; - extendStack(onoError, originalError); - // Copy properties from the original error - if (originalError && typeof originalError === "object") { - mergeErrors(onoError, originalError); - } - // The default `toJSON` method doesn't output props like `name`, `message`, `stack`, etc. - // So replace it with one that outputs every property of the error. - onoError.toJSON = to_json_1.toJSON; - // On Node.js, add support for the `util.inspect()` method - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (isomorphic_node_1.addInspectMethod) { - isomorphic_node_1.addInspectMethod(onoError); - } - // Finally, copy custom properties that were specified by the user. - // These props OVERWRITE any previous props - if (props && typeof props === "object") { - Object.assign(onoError, props); - } - return onoError; +function isServerProtocolSupported(server, supportedProtocols, paramsServerName) { + if (server && Array.isArray(supportedProtocols) && !supportedProtocols.includes(server.protocol())) { + throw new Error(`Server "${paramsServerName}" uses the ${server.protocol()} protocol but this template only supports the following ones: ${supportedProtocols}.`); + } } -exports.extendError = extendError; + /** - * Extend the error stack to include its cause + * Checks if the the provided renderer are supported (no renderer are also supported, defaults to nunjucks) + * + * @param {Object} templateConfig Template configuration. */ -function extendStack(newError, originalError) { - let stackProp = Object.getOwnPropertyDescriptor(newError, "stack"); - if (stack_1.isLazyStack(stackProp)) { - stack_1.lazyJoinStacks(stackProp, newError, originalError); - } - else if (stack_1.isWritableStack(stackProp)) { - newError.stack = stack_1.joinStacks(newError, originalError); - } +function isProvidedTemplateRendererSupported(templateConfig) { + const supportedRenderers = [undefined, 'react', 'nunjucks']; + if (supportedRenderers.includes(templateConfig.renderer)) { + return; + } + + throw new Error(`We do not support '${templateConfig.renderer}' as a renderer for a template. Only 'react' or 'nunjucks' are supported.`); } + /** - * Merges properties of the original error with the new error. - * - * @param newError - The error object to extend - * @param originalError - The original error object, if any + * Checks if given AsyncAPI document has servers with protocol that is supported by the template + * @private + * @param {Object} server Server object from AsyncAPI file + * @param {String} paramsServerName Name of the server specified as a param for the generator */ -function mergeErrors(newError, originalError) { - // Get the original error's keys - // NOTE: We specifically exclude properties that we have already set on the new error. - // This is _especially_ important for the `stack` property, because this property has - // a lazy getter in some environments - let keys = to_json_1.getDeepKeys(originalError, protectedProps); - // HACK: We have to cast the errors to `any` so we can use symbol indexers. - // see https://github.com/Microsoft/TypeScript/issues/1863 - let _newError = newError; - let _originalError = originalError; - for (let key of keys) { - if (_newError[key] === undefined) { - try { - _newError[key] = _originalError[key]; - } - catch (e) { - // This property is read-only, so it can't be copied - } - } - } +function isServerProvidedInDocument(server, paramsServerName) { + if (typeof paramsServerName === 'string' && !server) throw new Error(`Couldn't find server with name ${paramsServerName}.`); +} + +/** + * Checks if conditional files are specified properly in the template + * @private + * @param {Object} conditionalFiles conditions specified in the template config + */ +function validateConditionalFiles(conditionalFiles) { + if (typeof conditionalFiles === 'object') { + const fileNames = Object.keys(conditionalFiles); + + fileNames.forEach(fileName => { + const def = conditionalFiles[fileName]; + if (typeof def.subject !== 'string') throw new Error(`Invalid conditional file subject for ${fileName}: ${def.subject}.`); + if (typeof def.validation !== 'object') throw new Error(`Invalid conditional file validation object for ${fileName}: ${def.validation}.`); + conditionalFiles[fileName].validate = ajv.compile(conditionalFiles[fileName].validation); + }); + } } -//# sourceMappingURL=extend-error.js.map /***/ }), -/***/ 33436: -/***/ (function(module, exports, __webpack_require__) { +/***/ 65015: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +const fs = __nccwpck_require__(35747); +const util = __nccwpck_require__(31669); +const path = __nccwpck_require__(85622); +const fetch = __nccwpck_require__(80467); +const url = __nccwpck_require__(78835); +const resolvePkg = __nccwpck_require__(22846); +const resolveFrom = __nccwpck_require__(34417); +const globalDirs = __nccwpck_require__(80891); +const log = __nccwpck_require__(78063); +const packageJson = __nccwpck_require__(94532); -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ono = void 0; -/* eslint-env commonjs */ -const singleton_1 = __webpack_require__(54760); -Object.defineProperty(exports, "ono", ({ enumerable: true, get: function () { return singleton_1.ono; } })); -var constructor_1 = __webpack_require__(50326); -Object.defineProperty(exports, "Ono", ({ enumerable: true, get: function () { return constructor_1.Ono; } })); -__exportStar(__webpack_require__(97905), exports); -exports.default = singleton_1.ono; -// CommonJS default export hack -if ( true && typeof module.exports === "object") { - module.exports = Object.assign(module.exports.default, module.exports); -} -//# sourceMappingURL=index.js.map +const logMessage = __nccwpck_require__(85137); -/***/ }), +const utils = module.exports; -/***/ 26315: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +utils.lstat = util.promisify(fs.lstat); +utils.readlink = util.promisify(fs.readlink); +utils.readFile = util.promisify(fs.readFile); +utils.writeFile = util.promisify(fs.writeFile); +utils.copyFile = util.promisify(fs.copyFile); +utils.exists = util.promisify(fs.exists); +utils.readDir = util.promisify(fs.readdir); -"use strict"; +/** + * Checks if a string is a filesystem path. + * @private + * @param {String} string The string to check. + * @returns {Boolean} Whether the string is a filesystem path or not. + */ +utils.isFileSystemPath = (string) => { + return path.isAbsolute(string) + || string.startsWith(`.${path.sep}`) + || string.startsWith(`..${path.sep}`) + || string.startsWith('~'); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.addInspectMethod = exports.format = void 0; -const util = __webpack_require__(31669); -const to_json_1 = __webpack_require__(24833); -// The `inspect()` method is actually a Symbol, not a string key. -// https://nodejs.org/api/util.html#util_util_inspect_custom -const inspectMethod = util.inspect.custom || Symbol.for("nodejs.util.inspect.custom"); /** - * Ono supports Node's `util.format()` formatting for error messages. - * - * @see https://nodejs.org/api/util.html#util_util_format_format_args + * Converts a Map into an object. + * @private + * @param {Map} map The map to transform. + * @returns {Object} */ -exports.format = util.format; +utils.convertMapToObject = (map) => { + const tempObject = {}; + for (const [key, value] of map.entries()) { + tempObject[key] = value; + } + return tempObject; +}; + /** - * Adds an `inspect()` method to support Node's `util.inspect()` function. - * - * @see https://nodejs.org/api/util.html#util_util_inspect_custom + * Checks if template is local or not (i.e., it's remote). + * @private + * @param {String} templatePath The path to the template. + * @returns {Promise} */ -function addInspectMethod(newError) { - // @ts-expect-error - TypeScript doesn't support symbol indexers - newError[inspectMethod] = inspect; -} -exports.addInspectMethod = addInspectMethod; +utils.isLocalTemplate = async (templatePath) => { + const stats = await utils.lstat(templatePath); + return stats.isSymbolicLink(); +}; + /** - * Returns a representation of the error for Node's `util.inspect()` method. + * Returns whether or not the template is a react template * - * @see https://nodejs.org/api/util.html#util_custom_inspection_functions_on_objects + * @param {object} templateConfig + * @returns {boolean} Whether the template is a React template or not. */ -function inspect() { - // HACK: We have to cast the objects to `any` so we can use symbol indexers. - // see https://github.com/Microsoft/TypeScript/issues/1863 - let pojo = {}; - let error = this; - for (let key of to_json_1.getDeepKeys(error)) { - let value = error[key]; - pojo[key] = value; - } - // Don't include the `inspect()` method on the output object, - // otherwise it will cause `util.inspect()` to go into an infinite loop - // eslint-disable-next-line @typescript-eslint/no-dynamic-delete - delete pojo[inspectMethod]; - return pojo; -} -//# sourceMappingURL=isomorphic.node.js.map - -/***/ }), +utils.isReactTemplate = (templateConfig) => { + return templateConfig !== undefined && templateConfig.renderer === 'react'; +}; -/***/ 19322: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/** + * Fetches an AsyncAPI document from the given URL and return its content as string + * + * @param {String} link URL where the AsyncAPI document is located. + * @returns {Promise} Content of fetched file. + */ +utils.fetchSpec = (link) => { + return new Promise((resolve, reject) => { + fetch(link) + .then(res => resolve(res.text())) + .catch(reject); + }); +}; -"use strict"; +/** + * Checks if given string is URL and if not, we assume it is file path + * + * @param {String} str information representing file path or url + * @returns {Boolean} + */ +utils.isFilePath = (str) => { + return !url.parse(str).hostname; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.normalizeArgs = exports.normalizeOptions = void 0; -const isomorphic_node_1 = __webpack_require__(26315); /** - * Normalizes Ono options, accounting for defaults and optional options. + * Checks if given file path is JS file + * + * @param {String} filename information representing file path + * @returns {Boolean} */ -function normalizeOptions(options) { - options = options || {}; - return { - concatMessages: options.concatMessages === undefined ? true : Boolean(options.concatMessages), - format: options.format === undefined ? isomorphic_node_1.format - : (typeof options.format === "function" ? options.format : false), - }; -} -exports.normalizeOptions = normalizeOptions; +utils.isJsFile = (filepath) => { + const ext = filepath.split('.').pop() || ''; + return ['js', 'jsx', 'cjs'].includes(ext); +}; + /** - * Normalizes the Ono arguments, accounting for defaults, options, and optional arguments. + * Get version of the generator + * + * @returns {String} */ -function normalizeArgs(args, options) { - let originalError; - let props; - let formatArgs; - let message = ""; - // Determine which arguments were actually specified - if (typeof args[0] === "string") { - formatArgs = args; - } - else if (typeof args[1] === "string") { - if (args[0] instanceof Error) { - originalError = args[0]; - } - else { - props = args[0]; - } - formatArgs = args.slice(1); - } - else { - originalError = args[0]; - props = args[1]; - formatArgs = args.slice(2); - } - // If there are any format arguments, then format the error message - if (formatArgs.length > 0) { - if (options.format) { - message = options.format.apply(undefined, formatArgs); - } - else { - message = formatArgs.join(" "); - } - } - if (options.concatMessages && originalError && originalError.message) { - // The inner-error's message will be added to the new message - message += (message ? " \n" : "") + originalError.message; - } - return { originalError, props, message }; -} -exports.normalizeArgs = normalizeArgs; -//# sourceMappingURL=normalize.js.map - -/***/ }), - -/***/ 54760: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; +utils.getGeneratorVersion = () => { + return packageJson.version; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ono = void 0; -const constructor_1 = __webpack_require__(50326); -const singleton = ono; -exports.ono = singleton; -ono.error = new constructor_1.Ono(Error); -ono.eval = new constructor_1.Ono(EvalError); -ono.range = new constructor_1.Ono(RangeError); -ono.reference = new constructor_1.Ono(ReferenceError); -ono.syntax = new constructor_1.Ono(SyntaxError); -ono.type = new constructor_1.Ono(TypeError); -ono.uri = new constructor_1.Ono(URIError); -const onoMap = ono; /** - * Creates a new error with the specified message, properties, and/or inner error. - * If an inner error is provided, then the new error will match its type, if possible. + * Filters out the Generator invalid options given + * + * @param {Array} + * @returns {Array} */ -function ono(...args) { - let originalError = args[0]; - // Is the first argument an Error-like object? - if (typeof originalError === "object" && typeof originalError.name === "string") { - // Try to find an Ono singleton method that matches this error type - for (let typedOno of Object.values(onoMap)) { - if (typeof typedOno === "function" && typedOno.name === "ono") { - let species = typedOno[Symbol.species]; - if (species && species !== Error && (originalError instanceof species || originalError.name === species.name)) { - // Create an error of the same type - return typedOno.apply(undefined, args); - } - } - } - } - // By default, create a base Error object - return ono.error.apply(undefined, args); -} -//# sourceMappingURL=singleton.js.map - -/***/ }), - -/***/ 55254: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +utils.getInvalidOptions = (generatorOptions, options) => { + if (typeof options !== 'object') return []; + return Object.keys(options).filter(param => !generatorOptions.includes(param)); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.lazyJoinStacks = exports.joinStacks = exports.isWritableStack = exports.isLazyStack = void 0; -const newline = /\r?\n/; -const onoCall = /\bono[ @]/; -/** - * Is the property lazily computed? - */ -function isLazyStack(stackProp) { - return Boolean(stackProp && - stackProp.configurable && - typeof stackProp.get === "function"); -} -exports.isLazyStack = isLazyStack; -/** - * Is the stack property writable? - */ -function isWritableStack(stackProp) { - return Boolean( - // If there is no stack property, then it's writable, since assigning it will create it - !stackProp || - stackProp.writable || - typeof stackProp.set === "function"); -} -exports.isWritableStack = isWritableStack; /** - * Appends the original `Error.stack` property to the new Error's stack. + * Determine whether the given function is asynchronous. + * @private + * @param {*} fn to check + * @returns {Boolean} is function asynchronous */ -function joinStacks(newError, originalError) { - let newStack = popStack(newError.stack); - let originalStack = originalError ? originalError.stack : undefined; - if (newStack && originalStack) { - return newStack + "\n\n" + originalStack; - } - else { - return newStack || originalStack; - } -} -exports.joinStacks = joinStacks; +utils.isAsyncFunction = (fn) => { + return fn && fn.constructor && fn.constructor.name === 'AsyncFunction'; +}; + /** - * Calls `joinStacks` lazily, when the `Error.stack` property is accessed. + * Register `source-map-support` package. + * This package provides source map support for stack traces in Node - also for transpiled code from TS. + * + * @private */ -function lazyJoinStacks(lazyStack, newError, originalError) { - if (originalError) { - Object.defineProperty(newError, "stack", { - get: () => { - let newStack = lazyStack.get.apply(newError); - return joinStacks({ stack: newStack }, originalError); - }, - enumerable: false, - configurable: true - }); - } - else { - lazyPopStack(newError, lazyStack); - } -} -exports.lazyJoinStacks = lazyJoinStacks; +utils.registerSourceMap = () => { + __nccwpck_require__(9249).install(); +}; + /** - * Removes Ono from the stack, so that the stack starts at the original error location + * Register TypeScript transpiler. It enables transpilation of TS filters and hooks on the fly. + * + * @private */ -function popStack(stack) { - if (stack) { - let lines = stack.split(newline); - // Find the Ono call(s) in the stack, and remove them - let onoStart; - for (let i = 0; i < lines.length; i++) { - let line = lines[i]; - if (onoCall.test(line)) { - if (onoStart === undefined) { - // We found the first Ono call in the stack trace. - // There may be other subsequent Ono calls as well. - onoStart = i; - } - } - else if (onoStart !== undefined) { - // We found the first non-Ono call after one or more Ono calls. - // So remove the Ono call lines from the stack trace - lines.splice(onoStart, i - onoStart); - break; - } - } - if (lines.length > 0) { - return lines.join("\n"); - } - } - // If we get here, then the stack doesn't contain a call to `ono`. - // This may be due to minification or some optimization of the JS engine. - // So just return the stack as-is. - return stack; -} +utils.registerTypeScript = () => { + __nccwpck_require__(72719).register(); +}; + /** - * Calls `popStack` lazily, when the `Error.stack` property is accessed. + * Check if given template is installed and return details about it located in the package.json + * + * @private + * @param {String} name name of the template + * @param {String} PACKAGE_JSON_FILENAME standard name of the package.json file + * @returns {Object|undefined} object representing content of the package.json file with additional field -> pkgPath (absolute path to the package). Read {@link https://raw.githubusercontent.com/sindresorhus/type-fest/main/source/package-json.d.ts|PackageJson} for more details on the content of the package.json object + */ -function lazyPopStack(error, lazyStack) { - Object.defineProperty(error, "stack", { - get: () => popStack(lazyStack.get.apply(error)), - enumerable: false, - configurable: true - }); -} -//# sourceMappingURL=stack.js.map +utils.getTemplateDetails = (name, PACKAGE_JSON_FILENAME) => { + let pkgPath; + let pkgPackageJsonPath; + let installedPkg; -/***/ }), + //first trying to resolve package by its path + //this could be done at the end, without additional if but the advantage if below approach is that we explicitly know resolving was successful by the template file path and we can log proper debug info + if (utils.isFileSystemPath(name)) { + pkgPath = path.resolve(name); -/***/ 24833: -/***/ ((__unused_webpack_module, exports) => { + log.debug(logMessage.NODE_MODULES_INSTALL); + } else { + //first trying to resolve package in local dependencies of generator or the project that uses generator library + //return path doesn't point to package.json + pkgPath = resolvePkg(name); + //resolvePkg returns undefined if dependency is not found in local dependencies + + //now we need to look for the template in the global location + //we use resolveFrom with package.json reference as normal resolve fails on template because they do not have entrypoint ("main" property) as packages normally do. + if (!pkgPath) { + try { + //trying to find in global yarn location + pkgPackageJsonPath = resolveFrom(globalDirs.yarn.packages, path.join(name, PACKAGE_JSON_FILENAME)); + } catch (_) { + //trying to find in global npm location + pkgPackageJsonPath = resolveFrom(globalDirs.npm.packages, path.join(name, PACKAGE_JSON_FILENAME)); + } -"use strict"; + if (pkgPackageJsonPath) { + log.debug(logMessage.templateNotFound(name)); + //removing package.json from path + pkgPath = path.dirname(pkgPackageJsonPath); + } + } + } + + if (pkgPath) { + installedPkg = require(path.join(pkgPath, PACKAGE_JSON_FILENAME)); + //we add path to returned object only because later we want to use it in debug logs + installedPkg.pkgPath = pkgPath; + } + + return installedPkg; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getDeepKeys = exports.toJSON = void 0; -const nonJsonTypes = ["function", "symbol", "undefined"]; -const protectedProps = ["constructor", "prototype", "__proto__"]; -const objectPrototype = Object.getPrototypeOf({}); /** - * Custom JSON serializer for Error objects. - * Returns all built-in error properties, as well as extended properties. + * Creates a custom resolver that maps urlToFolder.url to urlToFolder.folder + * Building your custom resolver is explained here: https://apitools.dev/json-schema-ref-parser/docs/plugins/resolvers.html + * + * @private + * @param {object} urlToFolder to resolve url e.g. https://schema.example.com/crm/ to a folder e.g. ./test/docs/. + * @return {{read(*, *, *): Promise, canRead(*): boolean, order: number}} */ -function toJSON() { - // HACK: We have to cast the objects to `any` so we can use symbol indexers. - // see https://github.com/Microsoft/TypeScript/issues/1863 - let pojo = {}; - let error = this; - for (let key of getDeepKeys(error)) { - if (typeof key === "string") { - let value = error[key]; - let type = typeof value; - if (!nonJsonTypes.includes(type)) { - pojo[key] = value; +utils.getMapBaseUrlToFolderResolver = (urlToFolder) => { + return { + order: 1, + canRead (file) { + return true; + }, + read(file, callback, $refs) { + const baseUrl = urlToFolder.url; + const baseDir = urlToFolder.folder; + + return new Promise(((resolve, reject) => { + let localpath = file.url; + localpath = localpath.replace(baseUrl,baseDir); + try { + fs.readFile(localpath, (err, data) => { + if (err) { + reject(`Error opening file "${localpath}"`); + } else { + resolve(data); } + }); + } catch (err) { + reject(`Error opening file "${localpath}"`); } + })); } - return pojo; -} -exports.toJSON = toJSON; -/** - * Returns own, inherited, enumerable, non-enumerable, string, and symbol keys of `obj`. - * Does NOT return members of the base Object prototype, or the specified omitted keys. - */ -function getDeepKeys(obj, omit = []) { - let keys = []; - // Crawl the prototype chain, finding all the string and symbol keys - while (obj && obj !== objectPrototype) { - keys = keys.concat(Object.getOwnPropertyNames(obj), Object.getOwnPropertySymbols(obj)); - obj = Object.getPrototypeOf(obj); - } - // De-duplicate the list of keys - let uniqueKeys = new Set(keys); - // Remove any omitted keys - for (let key of omit.concat(protectedProps)) { - uniqueKeys.delete(key); - } - return uniqueKeys; -} -exports.getDeepKeys = getDeepKeys; -//# sourceMappingURL=to-json.js.map - -/***/ }), - -/***/ 97905: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + }; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const util_1 = __webpack_require__(31669); -//# sourceMappingURL=types.js.map /***/ }), -/***/ 17040: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var deepEqual = __webpack_require__(28206); -var convert = __webpack_require__(66486); +/***/ 2400: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = openapiSchemaToJsonSchema; -module.exports.fromSchema = openapiSchemaToJsonSchema; -module.exports.fromParameter = openapiParameterToJsonSchema; +const ANY = Symbol('SemVer ANY') +// hoisted class for cyclic dependency +class Comparator { + static get ANY () { + return ANY + } + constructor (comp, options) { + options = parseOptions(options) -function openapiSchemaToJsonSchema(schema, options) { - options = resolveOptions(options); + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } - var jsonSchema = convert.fromSchema(schema, options); - return jsonSchema; -} + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) -function openapiParameterToJsonSchema(parameter, options) { - options = resolveOptions(options); + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } - var jsonSchema = convert.fromParameter(parameter, options); - return jsonSchema; -} + debug('comp', this) + } -function resolveOptions(options) { - var notSupported = [ - 'nullable', 'discriminator', 'readOnly', - 'writeOnly', 'xml', 'externalDocs', - 'example', 'deprecated' - ]; + parse (comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const m = comp.match(r) - options = options || {}; - options.dateToDateTime = options.dateToDateTime || false; - options.cloneSchema = options.cloneSchema == false ? false : true; - options.supportPatternProperties = options.supportPatternProperties || false; - options.keepNotSupported = options.keepNotSupported || []; - options.strictMode = options.strictMode == false ? false : true; + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`) + } - if (typeof options.patternPropertiesHandler !== 'function') { - options.patternPropertiesHandler = patternPropertiesHandler; - } + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } - options._removeProps = []; + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } + } - if (options.removeReadOnly === true) { - options._removeProps.push('readOnly'); - } + toString () { + return this.value + } - if (options.removeWriteOnly === true) { - options._removeProps.push('writeOnly'); - } + test (version) { + debug('Comparator.test', version, this.options.loose) - options._structs = ['allOf', 'anyOf', 'oneOf', 'not', 'items', 'additionalProperties']; - options._notSupported = resolveNotSupported(notSupported, options.keepNotSupported); + if (this.semver === ANY || version === ANY) { + return true + } - return options; -} + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } -function patternPropertiesHandler(schema) { - var pattern; - var patternsObj = schema.patternProperties; - var additProps = schema.additionalProperties; + return cmp(version, this.operator, this.semver, this.options) + } - if (typeof additProps !== 'object') { - return schema; - } + intersects (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } - for (pattern in patternsObj) { - if (deepEqual(patternsObj[pattern], additProps)) { - schema.additionalProperties = false; - break; - } - } + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } - return schema; -} + if (this.operator === '') { + if (this.value === '') { + return true + } + return new Range(comp.value, options).test(this.value) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + return new Range(this.value, options).test(comp.semver) + } -function resolveNotSupported(notSupported, toRetain) { - var i = 0; - var index; + const sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>') + const sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<') + const sameSemVer = this.semver.version === comp.semver.version + const differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<=') + const oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<') + const oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>') - for (i; i < toRetain.length; i++) { - index = notSupported.indexOf(toRetain[i]); + return ( + sameDirectionIncreasing || + sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || + oppositeDirectionsGreaterThan + ) + } +} - if (index >= 0) { - notSupported.splice(index, 1); - } - } +module.exports = Comparator - return notSupported; -} +const parseOptions = __nccwpck_require__(20459) +const {re, t} = __nccwpck_require__(97559) +const cmp = __nccwpck_require__(27323) +const debug = __nccwpck_require__(4709) +const SemVer = __nccwpck_require__(2975) +const Range = __nccwpck_require__(17151) /***/ }), -/***/ 66486: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 17151: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var convertFromSchema = __webpack_require__(64228) -var convertFromParameter = __webpack_require__(53859) +// hoisted class for cyclic dependency +class Range { + constructor (range, options) { + options = parseOptions(options) -module.exports = { - fromSchema: convertFromSchema, - fromParameter: convertFromParameter -} + if (range instanceof Range) { + if ( + range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease + ) { + return range + } else { + return new Range(range.raw, options) + } + } + if (range instanceof Comparator) { + // just put it in the set and return + this.raw = range.value + this.set = [[range]] + this.format() + return this + } -/***/ }), + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease -/***/ 53859: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + // First, split based on boolean or || + this.raw = range + this.set = range + .split(/\s*\|\|\s*/) + // map the range to a 2d array of comparators + .map(range => this.parseRange(range.trim())) + // throw out any comparator lists that are empty + // this generally means that it was not a valid range, which is allowed + // in loose mode, but will still throw if the WHOLE range is invalid. + .filter(c => c.length) -var convertFromSchema = __webpack_require__(64228) -var InvalidInputError = __webpack_require__(67667) + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${range}`) + } -module.exports = convertFromParameter + // if we have any that are not the null set, throw out null sets. + if (this.set.length > 1) { + // keep the first one, in case they're all null sets + const first = this.set[0] + this.set = this.set.filter(c => !isNullSet(c[0])) + if (this.set.length === 0) + this.set = [first] + else if (this.set.length > 1) { + // if we have any that are *, then the range is just * + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c] + break + } + } + } + } -// Convert from OpenAPI 3.0 `ParameterObject` to JSON schema v4 -function convertFromParameter (parameter, options) { - if (parameter.schema !== undefined) { - return convertParameterSchema(parameter, parameter.schema, options) - } else if (parameter.content !== undefined) { - return convertFromContents(parameter, options) - } else { - if (options.strictMode) { - throw new InvalidInputError('OpenAPI parameter must have either a \'schema\' or a \'content\' property') - } - return convertParameterSchema(parameter, {}, options) + this.format() } -} - -function convertFromContents (parameter, options) { - var schemas = {} - for (var mime in parameter.content) { - schemas[mime] = convertParameterSchema(parameter, parameter.content[mime].schema, options) + format () { + this.range = this.set + .map((comps) => { + return comps.join(' ').trim() + }) + .join('||') + .trim() + return this.range } - return schemas -} - -function convertParameterSchema (parameter, schema, options) { - var jsonSchema = convertFromSchema(schema || {}, options) - - if (parameter.description) { - jsonSchema.description = parameter.description + toString () { + return this.range } - return jsonSchema -} + parseRange (range) { + range = range.trim() + // memoize range parsing for performance. + // this is a very hot path, and fully deterministic. + const memoOpts = Object.keys(this.options).join(',') + const memoKey = `parseRange:${memoOpts}:${range}` + const cached = cache.get(memoKey) + if (cached) + return cached -/***/ }), + const loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) + debug('hyphen replace', range) + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, re[t.COMPARATORTRIM]) -/***/ 64228: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) -var isObject = __webpack_require__(45397)/* .isObject */ .K -var InvalidTypeError = __webpack_require__(8277) + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace) -module.exports = convertFromSchema + // normalize spaces + range = range.split(/\s+/).join(' ') -// Convert from OpenAPI 3.0 `SchemaObject` to JSON schema v4 -function convertFromSchema (schema, options) { - schema = convertSchema(schema, options) + // At this point, the range is completely trimmed and + // ready to be split into comparators. - schema.$schema = 'http://json-schema.org/draft-04/schema#' + const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const rangeList = range + .split(' ') + .map(comp => parseComparator(comp, this.options)) + .join(' ') + .split(/\s+/) + // >=0.0.0 is equivalent to * + .map(comp => replaceGTE0(comp, this.options)) + // in loose mode, throw out any that are not valid comparators + .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) + .map(comp => new Comparator(comp, this.options)) - return schema -} + // if any comparators are the null set, then replace with JUST null set + // if more than one comparator, remove any * comparators + // also, don't include the same comparator more than once + const l = rangeList.length + const rangeMap = new Map() + for (const comp of rangeList) { + if (isNullSet(comp)) + return [comp] + rangeMap.set(comp.value, comp) + } + if (rangeMap.size > 1 && rangeMap.has('')) + rangeMap.delete('') -function convertSchema (schema, options) { - if (options.cloneSchema) { - schema = Object.assign({}, schema); + const result = [...rangeMap.values()] + cache.set(memoKey, result) + return result } - var structs = options._structs; - var notSupported = options._notSupported; - var strictMode = options.strictMode; - var i = 0; - var j = 0; - var struct = null; - - for (i; i < structs.length; i++) { - struct = structs[i] - - if (Array.isArray(schema[struct])) { - var cloned = false; + intersects (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } - for (j; j < schema[struct].length; j++) { - if (!isObject(schema[struct][j])) { - if (options.cloneSchema && !cloned) { - cloned = true; - schema[struct] = schema[struct].slice(); - } + return this.set.some((thisComparators) => { + return ( + isSatisfiable(thisComparators, options) && + range.set.some((rangeComparators) => { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) + } - schema[struct].splice(j, 1) - j-- - continue - } + // if ANY of the sets match ALL of its comparators, then pass + test (version) { + if (!version) { + return false + } - schema[struct][j] = convertSchema(schema[struct][j], options) - } - } else if (schema[struct] === null) { - delete schema[struct] - } else if (typeof schema[struct] === 'object') { - schema[struct] = convertSchema(schema[struct], options) - } - } + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } - if ('properties' in schema) { - schema.properties = convertProperties(schema.properties, options) + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false + } +} +module.exports = Range - if (Array.isArray(schema.required)) { - schema.required = cleanRequired(schema.required, schema.properties) +const LRU = __nccwpck_require__(7129) +const cache = new LRU({ max: 1000 }) - if (schema.required.length === 0) { - delete schema.required - } - } - if (Object.keys(schema.properties).length === 0) { - delete schema.properties - } - } +const parseOptions = __nccwpck_require__(20459) +const Comparator = __nccwpck_require__(2400) +const debug = __nccwpck_require__(4709) +const SemVer = __nccwpck_require__(2975) +const { + re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace +} = __nccwpck_require__(97559) - if (strictMode) { - validateType(schema.type) - } +const isNullSet = c => c.value === '<0.0.0-0' +const isAny = c => c.value === '' - schema = convertTypes(schema) - schema = convertFormat(schema, options) +// take a set of comparators and determine whether there +// exists a version which can satisfy it +const isSatisfiable = (comparators, options) => { + let result = true + const remainingComparators = comparators.slice() + let testComparator = remainingComparators.pop() - if ('x-patternProperties' in schema && options.supportPatternProperties) { - schema = convertPatternProperties(schema, options.patternPropertiesHandler) - } + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options) + }) - for (i = 0; i < notSupported.length; i++) { - delete schema[notSupported[i]] - } + testComparator = remainingComparators.pop() + } - return schema + return result } -function validateType (type) { - var validTypes = ['integer', 'number', 'string', 'boolean', 'object', 'array', 'null'] - - if (validTypes.indexOf(type) < 0 && type !== undefined) { - throw new InvalidTypeError('Type ' + JSON.stringify(type) + ' is not a valid type') - } +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +const parseComparator = (comp, options) => { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp } -function convertProperties (properties, options) { - var key; - var property; - var props = {}; - var removeProp; - - if (!isObject(properties)) { - return props - } +const isX = id => !id || id.toLowerCase() === 'x' || id === '*' - for (key in properties) { - property = properties[key] +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 +const replaceTildes = (comp, options) => + comp.trim().split(/\s+/).map((comp) => { + return replaceTilde(comp, options) + }).join(' ') - if (!isObject(property)) { - continue - } +const replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + return comp.replace(r, (_, M, m, p, pr) => { + debug('tilde', comp, _, M, m, p, pr) + let ret - removeProp = options._removeProps.some(function (prop) { - return property[prop] === true - }) + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0` + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0-0 + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` + } else if (pr) { + debug('replaceTilde pr', pr) + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } else { + // ~1.2.3 == >=1.2.3 <1.3.0-0 + ret = `>=${M}.${m}.${p + } <${M}.${+m + 1}.0-0` + } - if (removeProp) { - continue - } + debug('tilde return', ret) + return ret + }) +} - props[key] = convertSchema(property, options) - } +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 +// ^1.2.3 --> >=1.2.3 <2.0.0-0 +// ^1.2.0 --> >=1.2.0 <2.0.0-0 +const replaceCarets = (comp, options) => + comp.trim().split(/\s+/).map((comp) => { + return replaceCaret(comp, options) + }).join(' ') - return props -} +const replaceCaret = (comp, options) => { + debug('caret', comp, options) + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + const z = options.includePrerelease ? '-0' : '' + return comp.replace(r, (_, M, m, p, pr) => { + debug('caret', comp, _, M, m, p, pr) + let ret -function convertTypes (schema) { - if (schema.type !== undefined && schema.nullable === true) { - schema.type = [schema.type, 'null'] + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` + } else if (isX(p)) { + if (M === '0') { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${+M + 1}.0.0-0` + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p + }${z} <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p + }${z} <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p + } <${+M + 1}.0.0-0` + } + } - if (Array.isArray(schema.enum)) { - schema.enum = schema.enum.concat([null]) - } - } + debug('caret return', ret) + return ret + }) +} - return schema +const replaceXRanges = (comp, options) => { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map((comp) => { + return replaceXRange(comp, options) + }).join(' ') } -function convertFormat (schema, options) { - var format = schema.format - var settings = { - MIN_INT_32: 0 - Math.pow(2, 31), - MAX_INT_32: Math.pow(2, 31) - 1, - MIN_INT_64: 0 - Math.pow(2, 63), - MAX_INT_64: Math.pow(2, 63) - 1, - MIN_FLOAT: 0 - Math.pow(2, 128), - MAX_FLOAT: Math.pow(2, 128) - 1, - MIN_DOUBLE: 0 - Number.MAX_VALUE, - MAX_DOUBLE: Number.MAX_VALUE, +const replaceXRange = (comp, options) => { + comp = comp.trim() + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + const xM = isX(M) + const xm = xM || isX(m) + const xp = xm || isX(p) + const anyX = xp - // Matches base64 (RFC 4648) - // Matches `standard` base64 not `base64url`. The specification does not - // exclude it but current ongoing OpenAPI plans will distinguish btoh. - BYTE_PATTERN: '^[\\w\\d+\\/=]*$' - } + if (gtlt === '=' && anyX) { + gtlt = '' + } - // Valid JSON schema v4 formats - var FORMATS = ['date-time', 'email', 'hostname', 'ipv4', 'ipv6', 'uri', 'uri-reference'] + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' - if (format === undefined || FORMATS.indexOf(format) !== -1) { - return schema - } + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 - if (format === 'date' && options.dateToDateTime === true) { - return convertFormatDate(schema) - } + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } - var formatConverters = { - int32: convertFormatInt32, - int64: convertFormatInt64, - float: convertFormatFloat, - double: convertFormatDouble, - byte: convertFormatByte - } + if (gtlt === '<') + pr = '-0' - var converter = formatConverters[format] + ret = `${gtlt + M}.${m}.${p}${pr}` + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` + } else if (xp) { + ret = `>=${M}.${m}.0${pr + } <${M}.${+m + 1}.0-0` + } - if (converter === undefined) { return schema } + debug('xRange return', ret) - return converter(schema, settings) + return ret + }) } -function convertFormatInt32 (schema, settings) { - if ((!schema.minimum && schema.minimum !== 0) || schema.minimum < settings.MIN_INT_32) { - schema.minimum = settings.MIN_INT_32; - } - if ((!schema.maximum && schema.maximum !== 0) || schema.maximum > settings.MAX_INT_32) { - schema.maximum = settings.MAX_INT_32; - } - return schema +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +const replaceStars = (comp, options) => { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[t.STAR], '') } -function convertFormatInt64 (schema, settings) { - if ((!schema.minimum && schema.minimum !== 0) || schema.minimum < settings.MIN_INT_64) { - schema.minimum = settings.MIN_INT_64; - } - if ((!schema.maximum && schema.maximum !== 0) || schema.maximum > settings.MAX_INT_64) { - schema.maximum = settings.MAX_INT_64; - } - return schema +const replaceGTE0 = (comp, options) => { + debug('replaceGTE0', comp, options) + return comp.trim() + .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') } -function convertFormatFloat (schema, settings) { - if ((!schema.minimum && schema.minimum !== 0) || schema.minimum < settings.MIN_FLOAT) { - schema.minimum = settings.MIN_FLOAT; - } - if ((!schema.maximum && schema.maximum !== 0) || schema.maximum > settings.MAX_FLOAT) { - schema.maximum = settings.MAX_FLOAT; - } - return schema +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 +const hyphenReplace = incPr => ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) => { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? '-0' : ''}` + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` + } else if (fpr) { + from = `>=${from}` + } else { + from = `>=${from}${incPr ? '-0' : ''}` + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0` + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0` + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}` + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0` + } else { + to = `<=${to}` + } + + return (`${from} ${to}`).trim() } -function convertFormatDouble (schema, settings) { - if ((!schema.minimum && schema.minimum !== 0) || schema.minimum < settings.MIN_DOUBLE) { - schema.minimum = settings.MIN_DOUBLE; - } - if ((!schema.maximum && schema.maximum !== 0) || schema.maximum > settings.MAX_DOUBLE) { - schema.maximum = settings.MAX_DOUBLE; - } - return schema -} +const testSet = (set, version, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } -function convertFormatDate (schema) { - schema.format = 'date-time' - return schema -} + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (let i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === Comparator.ANY) { + continue + } -function convertFormatByte (schema, settings) { - schema.pattern = settings.BYTE_PATTERN - return schema + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true } -function convertPatternProperties (schema, handler) { - if (isObject(schema['x-patternProperties'])) { - schema.patternProperties = schema['x-patternProperties'] - } - delete schema['x-patternProperties'] +/***/ }), - return handler(schema) -} +/***/ 2975: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function cleanRequired (required, properties) { - required = required || [] - properties = properties || {} - let remainedRequired = [] +const debug = __nccwpck_require__(4709) +const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(14762) +const { re, t } = __nccwpck_require__(97559) - for (let i = 0; i < required.length; i++) { - if (properties[required[i]]) { - remainedRequired.push(required[i]) +const parseOptions = __nccwpck_require__(20459) +const { compareIdentifiers } = __nccwpck_require__(34170) +class SemVer { + constructor (version, options) { + options = parseOptions(options) + + if (version instanceof SemVer) { + if (version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError(`Invalid Version: ${version}`) } - } - return remainedRequired -} + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ) + } + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease -/***/ }), + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) -/***/ 67667: -/***/ ((module) => { + if (!m) { + throw new TypeError(`Invalid Version: ${version}`) + } -module.exports = InvalidInputError + this.raw = version -function InvalidInputError (message) { - this.name = 'InvalidInputError' - this.message = message -} + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] -InvalidInputError.prototype = new Error() + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } -/***/ }), + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } -/***/ 8277: -/***/ ((module) => { + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } -module.exports = InvalidTypeError + this.build = m[5] ? m[5].split('.') : [] + this.format() + } -function InvalidTypeError (message) { - this.name = 'InvalidTypeError' - this.message = message -} + format () { + this.version = `${this.major}.${this.minor}.${this.patch}` + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}` + } + return this.version + } -InvalidTypeError.prototype = Error.prototype + toString () { + return this.version + } + compare (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + if (typeof other === 'string' && other === this.version) { + return 0 + } + other = new SemVer(other, this.options) + } -/***/ }), + if (other.version === this.version) { + return 0 + } -/***/ 45397: -/***/ ((__unused_webpack_module, exports) => { + return this.compareMain(other) || this.comparePre(other) + } -exports.K = function (maybeObj) { - return maybeObj !== null && typeof maybeObj === 'object' -} + compareMain (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + return ( + compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) + ) + } -/***/ }), + comparePre (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } -/***/ 13980: -/***/ (function(module) { + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } -// MIT license (by Elan Shanker). -(function(globals) { - 'use strict'; + let i = 0 + do { + const a = this.prerelease[i] + const b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } - var executeSync = function(){ - var args = Array.prototype.slice.call(arguments); - if (typeof args[0] === 'function'){ - args[0].apply(null, args.splice(1)); + compareBuild (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) } - }; - var executeAsync = function(fn){ - if (typeof setImmediate === 'function') { - setImmediate(fn); - } else if (typeof process !== 'undefined' && process.nextTick) { - process.nextTick(fn); - } else { - setTimeout(fn, 0); - } - }; + let i = 0 + do { + const a = this.build[i] + const b = other.build[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } - var makeIterator = function (tasks) { - var makeCallback = function (index) { - var fn = function () { - if (tasks.length) { - tasks[index].apply(null, arguments); + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier) + this.inc('pre', identifier) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier) } - return fn.next(); - }; - fn.next = function () { - return (index < tasks.length - 1) ? makeCallback(index + 1): null; - }; - return fn; - }; - return makeCallback(0); - }; - - var _isArray = Array.isArray || function(maybeArray){ - return Object.prototype.toString.call(maybeArray) === '[object Array]'; - }; + this.inc('pre', identifier) + break - var waterfall = function (tasks, callback, forceAsync) { - var nextTick = forceAsync ? executeAsync : executeSync; - callback = callback || function () {}; - if (!_isArray(tasks)) { - var err = new Error('First argument to waterfall must be an array of functions'); - return callback(err); - } - if (!tasks.length) { - return callback(); - } - var wrapIterator = function (iterator) { - return function (err) { - if (err) { - callback.apply(null, arguments); - callback = function () {}; + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if ( + this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0 + ) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) { + this.prerelease = [0] } else { - var args = Array.prototype.slice.call(arguments, 1); - var next = iterator.next(); - if (next) { - args.push(wrapIterator(next)); + let i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + this.prerelease.push(0) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0] + } } else { - args.push(callback); + this.prerelease = [identifier, 0] } - nextTick(function () { - iterator.apply(null, args); - }); } - }; - }; - wrapIterator(makeIterator(tasks))(); - }; + break - if (typeof define !== 'undefined' && define.amd) { - define([], function () { - return waterfall; - }); // RequireJS - } else if ( true && module.exports) { - module.exports = waterfall; // CommonJS - } else { - globals.waterfall = waterfall; //