From afbdfa51127ee0f274ff69acb7995d3b6c57526a Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Wed, 11 Jan 2023 18:12:44 +0100 Subject: [PATCH 01/39] Fix broken test by updating test certs (#148733) --- .../__fixtures__/localhost.p12 | Bin 4184 -> 4192 bytes .../__fixtures__/test_intermediate_ca.crt | 112 +++++++++--------- .../__fixtures__/test_root_ca.crt | 36 +++--- .../http/ssl_with_p12_intermediate/index.js | 3 +- 4 files changed, 75 insertions(+), 76 deletions(-) diff --git a/test/server_integration/__fixtures__/localhost.p12 b/test/server_integration/__fixtures__/localhost.p12 index 1b0d11fb880980d2f8ce3c919afe3319cab74360..9928eff6251ed2a993e54e0e9135fb88039a6f2d 100644 GIT binary patch delta 4090 zcmVD}jwslTQ&i<@=5vLZyi! zjc9kjq|8R7!F)u_P%Mj0{~?joAWw?Z&I8Y3bL`ed1m26$mWN^J3*a||5$cUaf1uY3 z%$Dei&uaJnV`b zb5(lwV836a+s!a>a<$s_RHx^V*>M9<SA0p1+ZpqNgy7H(>WSgD2 zEu8-D>*^zOZNb=ev>~Mq#xJ8->gQqF&b3%}l)0b!!@_-Z7!y1Au7)UrB~^sP*_Y4s zjsW~-a0$xxqxJA&sz!~XTrA3eV%(xQ&OOJ`LKFM@TdaQ2#ku5vPQDY{w2ex82VqQ7qr^cQIc1SkcZw zu3L!k>1;i$>e}}_xJ9tJN{J=a=FAflPQ!8w)(<-cti&Ik-Kw-g(N`URaZ@mUSoBS5 zjbCsDIX%NZE3Ha&n#I*xG5mJC8v?dP!{Ne!nDDSAbNVEJREaWFTWA9PvId=rR`1Ig zjO>HYiPApJu|Q_UHo}MSW%s!>tPe(3pf`?V5g*oh*Hv*Jz(bU__nMprX&3P zpg*ZdPpv@I4k&fh6L*2`J-=sceS{JrC2OmN5o?4_64dTv!4y_An-bi~jrZuMTz z)p%0pm`;+U4>lmfKBK^nUDc_Fim%F%Mfrhi5t&x8qhQKjl1?%O>h>mIeF_D+0$I9f0QZ+zr?RMOnAK*Dg8)KUCmOB*!; z!Iah$fRT=cnALoku(5dqIlmp%x7^u7a!tBpx9@Q?I7-QnpQrMS$kyxnA3^+M}M# zGYyn?Ey>jTmnk62v6Vd|{K%9zQwebWFS2T4aHdlAWQqcxg=@SX&$5@Pd;B)9%85$S ziq9W2Sca;Bq7gj*i(dD?^qO>4>euFiKcbb@v zLJ?MflA&5nqWlE^Ov?a(@{YpH6?r%5ESJLSn3czx8jWIC=xWAgwM*NbqJ54z6y1J z4ew<5T0GsvbO63&?D*B&6VDr2-X<-yrm$j=qUqe~;53z5JOFvk?D`?};Xq!a%iSo@ zg3WOYBq~C-$N6$=!PFS>73*XU%8LEd=I6ZZco&96NwLIR06wqNa453iytm5>vzhto z;$_7>7lN}eujdO`!zvBP;|PD2l>88X2bEkdFM2YI`wST^F!N?-D`u8UTbZlxOU7h) z)M2u3(%E=NyN!5nbk)35jj-w8=uv>zms5C2eCEQv_uob51XiELCYTxgm@`q{Ia5>( z8M?%J#4$S9>KTf6dt;=H>HrgPDIrMt?}^yOQROZ<2oSsuiBAj#G=XjX(zJ7b8L1vj z`i0KClL*Smk^f@}^x$xfFD$mca}dn4vL3pPHs{v!V~VB76Luvpi{DLOZbYk_wN5?g*AAU>NeNtkE9|7UiMw+w z>TQoJal^E^UF!^et0*x!&r6+@mT=+Qf7>bwjQXFGfcrXrgg6l7Nt)_YDH3W*epx`%APcto z(txLrU_Y7;=GU}yrilp-G5WQfj;+)ScF#xKKfgX$UcJEasz8XN8EXHJp}1~ zrXC#1AL^tfx z^Gs@5+Tb>hdKT^nis5jp0{F(Nqpo}|(BJjJ8eKd^uJG8nO$WVo1}6VF?2u)%HSxDZ zdGH^usZH0fOD*ol2)SU9)G$gimv7_3;jx<%JbIJ@rA0%tFN%lDcNVi~eT1rYz@{-0 zP4%V94VN+4FoFe>zzRcuNYT7G9MF&O0s;sC1cC&}VXqJN2N_#}MN4CzGK5(BkTCb| zIpe~fivUXau2i7Si|sRdeDm~dA@6cA3-6NE}8@VXp zU67D-ZOc<{bbtct#U68RXq>J{94I$}G?$Eoj2cW@TB8@Pb9AG1McgDf&gzw1m| z%ApAXZCPUZq6;ai8oD5Tf&-3kiMq!=8BZ|f6Mab&3uk>bqijzYt1qu}oUB5$Go4R% ze#k9<&O9b*H?T~97#0QO!GGL?)bg8XZ&7C&>X~X1k1!b1@=BrhG)Ke$xX<8%WiEvE zM~%Dq-Wa?nak!m*9lvw>_F5*f2=_u#ky*12#i%yvjgo9lj8P>GK@-Jqw z{ye5CfzuPc`fxq!j~4<$`NaQ@0IcJ80DFfhg`au(>+eHpUWQ4cjC(swLx#`+@ zjM>1Ax&k+z;YEusYH|bpMd}9#_L{`BgvZzBVIe9XnM;7e>-~ina|k_!$}^X{wyYZ1 z7F=3c^n9UzK4i$}#9wCLqP7Wpn5&HCwuLx~%S6^Jwt<`k4W)BlEm< zkJ9TiM2CvlVVh_;T^R5@@Vym1+nLQ5)~o~3zex-FWD;s&D}5tw@BQn2XA#-C(@i;x!Tx?RH7i>*PC1~ zRK#=%ve!-Je&D3C#QN$O=J-|DDWO7y$K$7`Q;#ytZ&>oX6F)$Yai z@vpF>x^>a;(ENBjeq?2e(ZN~ut?oyBY`cAAovZNzavFXk@@1B{LVQ;-xhgF_aC630 z+zo8CY`{{eWp)UnOn{DxtJJi(T+838_-wt|Bj@TXrL7f&=|UhUtD$@65SL z87jCJx{{uXK8$ZgBv-(1kU8n&-jLioo(zYAy#Iqenk;mwan+qNg5weCXe(@mEpgX> zQj_bzN|wpO>=kAR$FOaFODlx$#Kr5L3G~v(x290NVlXC<-5@<`o9Ebv**&)r3aE&U z#;pX5*LXvYU0>>WPVtrZv2=w+POq0+L{^Ap>rs3=zq&E><2kkjAjwMh_PPO%{%AJS z9l))zkY;JMkW}5g-FNIX1DyA-3>EKT-*Y$U;Qb7nX;5d4T>}9gu)}E@iE^JFFYwt^ z;ZAhEYVtp;)aL_C!%B9zxgj2VMpe_e*Srrs4=CMRjy?wjCa{Rvj}>FSci}Dy;E?!z0<+HH801(=Gc(D(CCAmKWoZK;uxv0fFd;Ar1_dh) s0|FWa00b0`$*4>>Hm7@h6y6-TYp`2W*Y-dJ2!@-M&C1$^L;?Z`0E0*B0RR91 delta 4090 zcmVoqZ=Eo3!6t)hX$aHRyKl}@L>GKDmu=@`p1LKgoc*Vg+X2}eyGIn^ljxphHU2>T zf;s4XX2Zh@(PX2(sckaN)2}lfItjAq$0@cQ7c(6t``Hu{{#vU*nEZog2Q7*{~c`gy*i12hS=}Q;@ig z27QJJcEm?A{Lq&*X?Sf44jHzIF`nsMtGgpm#ZhZQZ z=RQ<(ytz-FO8T$6#}N&43s!yAhz5dx10*3MetB_?wE%*`h;>=cZ`qmqFz4%I^A(~p zqpo>^Dh1Ge_dF(PqbA!4q8UWbK`~xy(MLMX7A6=e)V)*KUu34kug6YK|EnH?Yh$fg zn5$7dXQR^WKlk@+BpdfySa(LszR?a53$0ic(C1_@r@GkzyE|0{8HAp6~ zx6t<+Fc-~jxB1}q6#H;`R$B#eGioq3S?m5lHZI3LsI@j|SC58Q`*luM#(4PmzU&F( z5dd`xV{l!RvsVSnF9F1e4=lIps^9Smq#Hdzde>PGKP0_Mnq=MkEBYwK+vPbcfvli* z%%10K6YL~kZ;#U6I7=-?C=d;7+55~+v3Qv<+8O0be z?|$tJGP1vOP~Gc!o1QaGs_Sx-o=UDdN)!ABaL;~{Ek!3HvRsG53>9qQJFKnuyuB;q z9=~-;nF1p(f%L9nKl~|Mt66#_;OFXmeBjEP-2wA;%0T|(qle<23k#lq*aC4~u&L(q z!`YNk%#FFl1sH5f2wGaom=dJ&mCL<>cwcC9Rr^ASrf?7gQ98ov+pYJ1GOGw#BfeomS~)%5 zKvU579YEnXE%1E%qr9?ztMd$?+j@8F$8Ik%<<#(*!Ya458cuE0Gy@@$yhK&cl4Mn} zvpueIs%gQYvmtFa22_W{f}ttt;^k_=BIh=(=)s}?A37ViBui>N-+?n}LWG^|=sd zH!F=&f#D~Xd$^tHvp%|ZO%f>r$6?PSY_lM?j_!hmKPgFn$+8x76*-Kd^>c(JI^%P< zx;t2MrNJcoo_wwbkjmc`ZYroG2YEVibN)fj(E1#3TN%v^JGdI~E?Q+tC?E~mz4*D!bE|0)9m^9?@%&`+8%k`X zNXk8^Un+VEeD|2YJU|e*J$N-_epnmm1`%QTE6CV?7%@UD{12DpQyma~30r{r-i4Fb z)%|PZJy0AB+xT=8vT;;*A9O>0y0-Y>fH3$KX|%D%k>v6-x=S|HpvNj^x=09R{2#4z zDkUNiPD=H-AG!+{<)l^k%g(|BNf&ZMP9UZekCn}|^o`(iWsgke4V|PAXZf;fw5VQ`nnEINJo;DWPmeCIxVzJ8* z#viewIduo=P>ygjgHm;xSOv|^~`lIE}vUOdqlvj^)-kBY_+i4>*)RjCc5O&Rw>dfO`f0 zr`Aqvk2Ksm!DeXyTJ-+Wnx2Vb=yLKzZ{$?h3=gs$0K*ocXNRAIjU;XTpG~OLwv>MzfBM!yy@n``yCaPLWoeARS0}#> z7dnKcy^3Wbzd4?F)*(OI4++xf@-;qnPr@32WY4z{4l4O>QOTIV81JqKy1HrP+n|J@@?NE$(o2G==gFLN%hahM+vDp(^h%<)^&j;fmgi>Kbhzh} zzj>3d;p0XWglFfyPqj^MymZ}~ev5)_VwJ9Bcm>GDXnf=j2=`|!r!{GEi4?|289{MuR&tohdKie3vcN7 zw{l9(rg;qhQOE8`fl>A$Z1Q$RmoHHUzpYLt_K7R zndmkBgxx{IZ7!LS7$0pN5ZV5L&lC)6Lceta7Q#|zj-=+e5U-3Cl>+ismoR?T-*Pek{H zpvyX)+&A}YDMY7ejsQi|-HO|Udh<>lrP6}cJ{VT+6LES!C~o6QB=KEkdW5E^M&5Z~#BxLi^BLe!Zp(d`NO%X&fzpGkrtii@ zXG}!l#+Bc}fkVXfb9Z{+AyAYj98W;481>GhSlN~(4GgiDBKgLDd!7z!GD;LH7*(Ua zFoFeS1_>&LNQU>5&u_5csu8w};c90=0jHX^O+YGimxj1Ryb1GBOE?K4MqUFw*LmXcP>{pJMsEV$!kJMq zy>iQ3L3gGi=CNrj-NbY|*c(AjsLGhhlv@war1UY9di@nzBU0uz2ft$7czSwj-o1AD zY-Ny61)syyC>H~Z)K42#1}b6hT0okei#wu@nyZmtkgCOh_;)|hLbnI08E4wdLm7;& zDpF8JC#m?F^I~^|2i4%i@u(}$y)0WhsK(l@J`=y^5 zD^YHQRr!lNGzQJ`C@Bf11?s)(EWd9q0$vtl(n@igqi`2V;{7sY6?m$N1Q~AFgR1_FH4+{Q>o#ovA?NPyL9{{&y;issa98wzkv%d9V z7J0WlQS~$7n%Z^Y26aA=(Fa>u(xCW8Kr=*tWiUEc7QHuIh4e8=i9iGn%`l+9Z||W} z9*8`$i_99&<-X%ph~UX=KSn7=(wV+*t!I(tX#8M7P$VSOHRa8@;%^~cC<>OyKa|%K z9)PvX*30B=^NRA|-u$5b>KOtUB1z%8R^2DrwNdH}IX@sQzJ2X*}hRkhTly=-iHf z41O?+jr!U0zDu^P8@O`zvjc+RN&L#uxpeq_#8FUiRR#QV@8E5AH`caGJo|+-!yTSc z8|kOYKpCkVz`Y?qks?g)_Z>#Pe+C>)c{rG%vw&8|7;_+T1IXEM6*is&hNB1ihVcp5 z`G@>gg_0JQB~9VYIW=m!?%H#O*)Mfr93;QSjkYx{#p(S?cwkh0!}uJ7a8`u+C5MU3 zvPCHcNvM!YoGxS+&U6wI{!by{6A&vW60Y+LjG;b*IL~YVUMJsX@fZ1JHj0jZq9R)i z0`gRdT~phA72KELw#1mR#gpR?Hb>J3zCBwDJ~aw-4eau_?jpqIxDqfiFd;Ar1_dh) s0|FWa00b0ACfOe>K|hMo8WFnKN^6NnZ*4FH2n_MyC|K-SbOHhh09g&&6951J diff --git a/test/server_integration/__fixtures__/test_intermediate_ca.crt b/test/server_integration/__fixtures__/test_intermediate_ca.crt index 2e143200d290a..3b3197c10f9f0 100644 --- a/test/server_integration/__fixtures__/test_intermediate_ca.crt +++ b/test/server_integration/__fixtures__/test_intermediate_ca.crt @@ -5,75 +5,75 @@ Certificate: Signature Algorithm: sha256WithRSAEncryption Issuer: CN=Test Root CA Validity - Not Before: Jan 9 15:50:00 2020 GMT - Not After : Dec 27 15:50:00 2069 GMT + Not Before: Jan 11 15:02:45 2023 GMT + Not After : Dec 29 15:02:45 2072 GMT Subject: CN=Test Intermediate CA Subject Public Key Info: Public Key Algorithm: rsaEncryption - Public-Key: (2048 bit) + RSA Public-Key: (2048 bit) Modulus: - 00:ba:bb:d5:d7:5a:0a:b0:95:43:63:73:bc:1f:3f: - a4:71:3c:3f:69:96:8c:5d:e1:5b:82:95:2c:d1:b3: - 3b:7a:5c:f0:54:c9:d2:be:37:c7:81:ce:db:90:fa: - c0:0c:e8:b7:e5:51:18:29:0b:47:89:0f:b1:e3:7f: - 06:f0:fe:f6:a7:e8:42:36:58:4b:c7:04:81:48:5b: - 20:11:be:95:6b:bd:8c:0b:1b:21:2d:26:47:0b:c5: - 98:59:d7:a2:35:09:4f:1a:eb:74:d4:bc:fd:df:41: - 45:5d:fd:a6:0e:dd:02:7e:52:a4:21:9d:ac:c7:0e: - 73:50:2d:7b:6e:30:05:20:a2:ee:60:fa:0e:80:7d: - d0:0c:fd:24:ae:ef:96:70:7e:a3:bc:87:e4:fc:50: - 43:a7:a6:ef:dc:0d:7d:9e:02:73:3d:6b:b1:b3:e9: - d5:98:42:2b:ed:63:c1:a2:bb:49:19:a4:5b:d6:6e: - 33:54:44:19:f3:51:db:a4:ea:92:67:13:5e:80:bf: - 6d:1f:59:e4:f0:8c:93:10:38:54:37:8f:a6:4a:42: - 56:5f:db:d6:d5:2c:12:58:4c:42:aa:2c:19:8c:f7: - 30:51:b2:2c:29:c1:6b:29:73:bc:c6:45:63:41:90: - 80:0a:84:d5:02:0c:9c:67:cf:73:4e:62:40:51:ee: - 67:03 + 00:8e:2a:7d:75:9d:f6:b0:d1:87:bb:33:f9:52:ee: + 9f:d4:fe:c1:1f:d4:c1:ef:5c:36:7f:15:27:0b:9b: + d9:4e:c9:6a:31:6c:5c:79:39:db:40:8c:58:7d:cb: + b2:91:78:5c:1e:9d:b8:20:5a:28:b1:85:b3:c5:d6: + 8f:0d:40:db:8f:9e:f5:15:2b:82:d0:7f:bf:99:3a: + 86:7d:83:ce:53:9e:04:ba:15:69:f5:d0:a7:22:36: + 72:db:4e:b4:9c:2d:8f:0c:5f:46:c4:75:14:c0:82: + 24:b5:2b:94:c5:b2:59:25:c0:19:28:90:be:73:f1: + 7c:d3:8c:c9:49:89:fb:15:19:b8:7f:5c:02:65:6e: + 93:a5:b8:56:3b:33:1b:0c:23:7a:f0:ba:a4:07:c5: + 54:9f:c8:f3:19:d3:94:07:6c:a3:c1:04:40:49:5c: + 4c:4f:26:e4:5b:d7:08:4b:64:d2:a9:ff:cc:b5:99: + 8a:b8:c0:66:a7:30:d4:29:28:d2:d6:25:0d:fa:61: + cd:e2:ec:03:29:e5:fa:a5:21:7e:65:48:8a:47:27: + 20:15:3e:a6:09:90:7a:4d:79:8f:c5:88:f0:a3:40: + 3f:fc:ce:f7:ef:25:4b:be:d4:51:15:1d:13:d9:1b: + a5:71:82:01:2e:54:d4:c0:98:79:9c:74:02:79:a3: + bd:43 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - B4:48:6A:C8:21:77:A5:03:CF:48:C4:62:74:26:03:3F:BC:88:8C:92 + 47:A3:6D:34:23:13:C6:4E:62:BA:48:0B:23:75:08:7E:B8:F2:D0:97 X509v3 Authority Key Identifier: - keyid:03:9B:FF:88:CA:33:A2:71:C5:31:51:A6:DA:15:EF:44:C2:CB:D3:9F + keyid:DE:52:F2:C0:B2:99:22:C2:CE:93:B6:F9:07:9C:87:45:4F:C0:69:E8 DirName:/CN=Test Root CA - serial:78:77:49:60:3B:E7:73:18:06:75:45:A7:8E:8E:B4:4E:E4:9A:E3:B0 + serial:A1:4C:C1:A1:D9:F6:FE:83:07:F7:97:6D:1C:D4:8C:B1:1B:63:0D:D6 X509v3 Basic Constraints: CA:TRUE Signature Algorithm: sha256WithRSAEncryption - a3:10:97:ab:dd:43:8a:5b:c7:a6:b9:33:92:7b:61:fb:f0:3f: - 54:05:50:46:9e:62:11:d3:60:59:77:93:53:48:0b:c9:cf:bc: - c0:3c:b4:47:f4:f6:66:2c:86:76:38:3b:5d:13:77:41:ce:d7: - 16:ca:5e:29:33:1f:a7:ea:82:e4:0c:ad:f8:50:1d:54:cd:28: - a9:22:59:a8:e1:3f:05:b8:fb:5e:54:72:58:fa:a1:3e:f8:99: - bf:d6:50:99:8b:12:52:37:41:be:5f:c9:7d:04:46:8b:fd:8f: - 7f:64:a1:0d:b8:2b:ca:e9:4a:54:e2:bb:8b:39:b7:87:6f:8b: - 17:46:b4:5d:16:aa:75:5c:fb:33:29:52:51:24:7b:f2:d9:b3: - 9b:99:bf:08:6c:2c:43:8a:74:63:c1:32:ed:6b:4a:53:88:51: - c2:10:dd:92:f2:6f:af:65:f1:08:5a:cc:a6:2b:54:95:2b:2a: - a1:90:f2:eb:08:91:26:18:44:b7:49:11:09:c1:1c:aa:2d:b2: - d6:56:02:34:7a:97:fb:60:c5:1e:66:84:c0:40:6f:26:52:77: - 85:a3:ab:d5:8e:f0:d0:d0:2e:e0:6f:8a:de:72:e0:ee:96:e5: - 5d:4a:e9:c1:4c:c6:45:c7:36:6b:7a:1a:a6:64:71:9b:7c:7e: - 59:93:bd:b6 + 1b:d9:a2:a1:4c:25:a1:57:1f:98:36:e9:61:e8:19:33:12:49: + d8:8c:96:07:45:10:f7:82:6a:1c:fc:69:3d:0b:84:6f:8e:13: + db:3e:5c:fd:ec:a3:64:2d:26:49:2e:02:0a:5e:55:b5:d5:a4: + cf:02:11:59:22:d9:f8:75:5d:42:31:17:62:c7:3f:b7:da:40: + a7:a3:9f:99:8a:b2:59:6b:f8:2c:ef:7d:b8:c3:fc:90:48:7e: + cf:67:9a:b2:d5:de:f4:73:06:69:23:0b:7e:06:20:dc:70:b1: + ce:97:9b:f6:5f:99:18:73:b6:b3:94:7f:9b:2d:2f:a7:a3:b0: + 2d:a2:05:1f:9a:b4:81:22:e2:e9:23:31:09:61:08:2f:90:d8: + 9f:ba:a6:1e:2d:8a:ed:2a:db:a6:7e:f6:75:50:1f:ff:6b:99: + 88:7d:b0:c4:8c:c1:d6:58:26:5b:a0:1a:c8:75:a2:99:9d:c1: + 66:5d:60:9f:3a:e3:ab:40:d9:d2:10:2c:94:70:b6:13:be:bb: + 00:33:24:c8:0e:fc:0d:36:06:71:d6:51:99:81:16:63:38:47: + 53:48:69:0f:2c:68:f3:ac:e5:57:5c:bb:92:8e:fe:46:dc:db: + f2:7c:91:e4:c5:68:a3:a2:f0:ba:70:fb:d8:a2:25:49:13:3c: + 18:4d:a1:62 -----BEGIN CERTIFICATE----- -MIIDODCCAiCgAwIBAgIBATANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDEwxUZXN0 -IFJvb3QgQ0EwIBcNMjAwMTA5MTU1MDAwWhgPMjA2OTEyMjcxNTUwMDBaMB8xHTAb +MIIDOTCCAiGgAwIBAgIBATANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDEwxUZXN0 +IFJvb3QgQ0EwIBcNMjMwMTExMTUwMjQ1WhgPMjA3MjEyMjkxNTAyNDVaMB8xHTAb BgNVBAMTFFRlc3QgSW50ZXJtZWRpYXRlIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEAurvV11oKsJVDY3O8Hz+kcTw/aZaMXeFbgpUs0bM7elzwVMnS -vjfHgc7bkPrADOi35VEYKQtHiQ+x438G8P72p+hCNlhLxwSBSFsgEb6Va72MCxsh -LSZHC8WYWdeiNQlPGut01Lz930FFXf2mDt0CflKkIZ2sxw5zUC17bjAFIKLuYPoO -gH3QDP0kru+WcH6jvIfk/FBDp6bv3A19ngJzPWuxs+nVmEIr7WPBortJGaRb1m4z -VEQZ81HbpOqSZxNegL9tH1nk8IyTEDhUN4+mSkJWX9vW1SwSWExCqiwZjPcwUbIs -KcFrKXO8xkVjQZCACoTVAgycZ89zTmJAUe5nAwIDAQABo4GEMIGBMB0GA1UdDgQW -BBS0SGrIIXelA89IxGJ0JgM/vIiMkjBSBgNVHSMESzBJgBQDm/+IyjOiccUxUaba -Fe9EwsvTn6EbpBkwFzEVMBMGA1UEAxMMVGVzdCBSb290IENBghR4d0lgO+dzGAZ1 -RaeOjrRO5JrjsDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCjEJer -3UOKW8emuTOSe2H78D9UBVBGnmIR02BZd5NTSAvJz7zAPLRH9PZmLIZ2ODtdE3dB -ztcWyl4pMx+n6oLkDK34UB1UzSipIlmo4T8FuPteVHJY+qE++Jm/1lCZixJSN0G+ -X8l9BEaL/Y9/ZKENuCvK6UpU4ruLObeHb4sXRrRdFqp1XPszKVJRJHvy2bObmb8I -bCxDinRjwTLta0pTiFHCEN2S8m+vZfEIWsymK1SVKyqhkPLrCJEmGES3SREJwRyq -LbLWVgI0epf7YMUeZoTAQG8mUneFo6vVjvDQ0C7gb4recuDuluVdSunBTMZFxzZr -ehqmZHGbfH5Zk722 +AQ8AMIIBCgKCAQEAjip9dZ32sNGHuzP5Uu6f1P7BH9TB71w2fxUnC5vZTslqMWxc +eTnbQIxYfcuykXhcHp24IFoosYWzxdaPDUDbj571FSuC0H+/mTqGfYPOU54EuhVp +9dCnIjZy2060nC2PDF9GxHUUwIIktSuUxbJZJcAZKJC+c/F804zJSYn7FRm4f1wC +ZW6TpbhWOzMbDCN68LqkB8VUn8jzGdOUB2yjwQRASVxMTybkW9cIS2TSqf/MtZmK +uMBmpzDUKSjS1iUN+mHN4uwDKeX6pSF+ZUiKRycgFT6mCZB6TXmPxYjwo0A//M73 +7yVLvtRRFR0T2RulcYIBLlTUwJh5nHQCeaO9QwIDAQABo4GFMIGCMB0GA1UdDgQW +BBRHo200IxPGTmK6SAsjdQh+uPLQlzBTBgNVHSMETDBKgBTeUvLAspkiws6TtvkH +nIdFT8Bp6KEbpBkwFzEVMBMGA1UEAxMMVGVzdCBSb290IENBghUAoUzBodn2/oMH +95dtHNSMsRtjDdYwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAG9mi +oUwloVcfmDbpYegZMxJJ2IyWB0UQ94JqHPxpPQuEb44T2z5c/eyjZC0mSS4CCl5V +tdWkzwIRWSLZ+HVdQjEXYsc/t9pAp6OfmYqyWWv4LO99uMP8kEh+z2eastXe9HMG +aSMLfgYg3HCxzpeb9l+ZGHO2s5R/my0vp6OwLaIFH5q0gSLi6SMxCWEIL5DYn7qm +Hi2K7Srbpn72dVAf/2uZiH2wxIzB1lgmW6AayHWimZ3BZl1gnzrjq0DZ0hAslHC2 +E767ADMkyA78DTYGcdZRmYEWYzhHU0hpDyxo86zlV1y7ko7+Rtzb8nyR5MVoo6Lw +unD72KIlSRM8GE2hYg== -----END CERTIFICATE----- diff --git a/test/server_integration/__fixtures__/test_root_ca.crt b/test/server_integration/__fixtures__/test_root_ca.crt index 678c9a7467a22..42b698f58f7b5 100644 --- a/test/server_integration/__fixtures__/test_root_ca.crt +++ b/test/server_integration/__fixtures__/test_root_ca.crt @@ -1,24 +1,24 @@ Bag Attributes friendlyName: ca - localKeyID: 54 69 6D 65 20 31 35 37 38 35 38 34 39 34 35 33 30 37 + localKeyID: 54 69 6D 65 20 31 36 37 33 34 34 39 31 31 30 31 33 33 subject=/CN=Test Root CA issuer=/CN=Test Root CA -----BEGIN CERTIFICATE----- -MIIDETCCAfmgAwIBAgIUeHdJYDvncxgGdUWnjo60TuSa47AwDQYJKoZIhvcNAQEL -BQAwFzEVMBMGA1UEAxMMVGVzdCBSb290IENBMCAXDTIwMDEwOTE1NDkwNVoYDzIw -NjkxMjI3MTU0OTA1WjAXMRUwEwYDVQQDEwxUZXN0IFJvb3QgQ0EwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQC2G9Bmax5yFvdWEMleXcFK7G0ir04/sd4v -pRuqYhg+LhxlDOnd7HFtSsI2GGZaBktpL4eWOA8sAZ+eL89P3JV5WFDAuvlK8RZt -ECnPzl7Yar3nhPjNO5F1xbyHCPNSiQVYx7avkLJu3sv/okA65ON+BHYijbNNwS0/ -YtZYZWF7qR6rygXiLHcCIwWwZntBAKHGsBzxZv+28xRMUGsYWHq1PI25CRfDuVub -jC3LpAiJUTkrN5cE8Mpy6R9EH3c/qCk1I2daUKJVJhIzrUrsyNYwpCpbtrE605lK -qsRVkxoAK5i3zZRqiQ/m4FEmr0rTmbLJw09u+jIzfye2ivNiC7PZAgMBAAGjUzBR -MB0GA1UdDgQWBBQDm/+IyjOiccUxUabaFe9EwsvTnzAfBgNVHSMEGDAWgBQDm/+I -yjOiccUxUabaFe9EwsvTnzAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUA -A4IBAQBclwdYhVNp3I4gTzxl0kbjya28auokp1+NUhAJ++eGGeTySEzbggHWkSSw -jXhzbwri1T+80smvj4XkbSvLzPurSxT1if4kmUDh+XApx/pQb/2l88lRdLqBCcSn -UxrdeDGPGMAYsxH/+/s2rMoaagBb4n8dayBesqIa+Nt+Mf8cqfM30pRGqk5HtoI/ -ZUZDOQ7JJc3mg1usjA3mtgsUQ88zAH9C3fMpf/I3sr2UQqaXYZlzmh3r5U9yNYyw -SV0NnaDd3BVJ4qOumTjlYalRJFDrvn+aNkyPN6XiwxA1qd/uVW5mIJhkoxPYWkG4 -M1b0sea/9IVucYYyXI+GyFNI7B5N +MIIDEjCCAfqgAwIBAgIVAKFMwaHZ9v6DB/eXbRzUjLEbYw3WMA0GCSqGSIb3DQEB +CwUAMBcxFTATBgNVBAMTDFRlc3QgUm9vdCBDQTAgFw0yMzAxMTExNDU4MzBaGA8y +MDcyMTIyOTE0NTgzMFowFzEVMBMGA1UEAxMMVGVzdCBSb290IENBMIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2LBEaZX4ym+/Q0ibZAst2sFMdv3kuxwH +TjYudmbae36GTGKXdMMBYzhnMTJdmoMALt+ItpJ4ATD1HgMtlcV+7/Z1xZai0Kk1 +6OgweYruR4NxDhx/rUI9XAkNtW+Nz0BTcB5PkD5eDdcEWEHyt086CfGEN+hOIqIK +dftWwLHnSnqcv9D1c+QN1dQTdwsnQoJ2LHtcTQSAoCmDb1f9oAMYdKp6xjCKE/bv +YaXZkFXsh6GR3HM/o9P0v0CLe+C8SeJbxFztg6Qfs4t4Hsn9fXqyhRgOdq9WSnoF +/dNwUQKWWgWXvcoMyY3ORk8bDAR277bfUTnzARzqlxZspAPvFOdKqwIDAQABo1Mw +UTAdBgNVHQ4EFgQU3lLywLKZIsLOk7b5B5yHRU/AaegwHwYDVR0jBBgwFoAU3lLy +wLKZIsLOk7b5B5yHRU/AaegwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsF +AAOCAQEASfiIJ8v8nsoi6PCKF8BhFFWhZn/VpPHY12FyFBh+s9oVe5Ll4q94AmVz +W8IgUjyFrCYV4WH9g0gS5DXxuU3tVShXMU8MTKMu2eaRJevJ21ZWNG/h6ZSi7Cm7 +kWnUdUPLhhajW1apWFaRwLnwxs3iCShP32/4ON7eNC4JCeksqhXUU4iKVLvSTL7M +vrh5sc/AQ8faQL+3F7x574zzgOOjUEoIG4v12n/v2xZCAyQV73upReaYQZ3n/Div +RLznyIRQE29mS+U5yT31Xy/3MF1LSoyKSjdwEpdvXysw5fuHfHoUvDbTqatQyT+G +82UxYdf7Eqg3xZY62G+7QZsfHjtT5g== -----END CERTIFICATE----- diff --git a/test/server_integration/http/ssl_with_p12_intermediate/index.js b/test/server_integration/http/ssl_with_p12_intermediate/index.js index e6ea68d7f8af9..54ec6f53d144d 100644 --- a/test/server_integration/http/ssl_with_p12_intermediate/index.js +++ b/test/server_integration/http/ssl_with_p12_intermediate/index.js @@ -9,8 +9,7 @@ export default function ({ getService }) { const supertest = getService('supertest'); - // FLAKY: https://github.com/elastic/kibana/issues/148515 - describe.skip('kibana server with ssl', () => { + describe('kibana server with ssl', () => { it('handles requests using ssl with a P12 keystore that uses an intermediate CA', async () => { await supertest.get('/').expect(302); }); From ed71baf7782e5445c96db57e906a51d5cee26e24 Mon Sep 17 00:00:00 2001 From: Mark Hopkin Date: Wed, 11 Jan 2023 18:45:56 +0000 Subject: [PATCH 02/39] [Fleet] Do not allow namespace or dataset to be edited for input only package policies (#148737) ## Summary Part of #145529. Input packages will create component and index templates on package policy creation. These changes make it so that to change the namespace or dataset of an input only package the user must create a new package policy, this is because by changing these the user is sending the data to a new destination which semantically is a different policy. Screenshot 2023-01-04 at 21 05 15 Co-authored-by: Kyle Pollich --- .../fleet/common/services/policy_template.ts | 2 +- .../steps/components/dataset_combo.tsx | 5 +- .../package_policy_input_config.tsx | 4 + .../components/package_policy_input_panel.tsx | 5 +- .../package_policy_input_stream.tsx | 4 + .../package_policy_input_var_field.tsx | 26 +- .../steps/step_configure_package.tsx | 3 + .../steps/step_define_package_policy.test.tsx | 5 +- .../steps/step_define_package_policy.tsx | 49 ++-- .../single_page_layout/index.tsx | 1 - .../edit_package_policy_page/index.tsx | 3 +- .../server/services/package_policy.test.ts | 128 +++++++++ .../fleet/server/services/package_policy.ts | 52 +++- .../1.0.0/agent/input/input.yml.hbs | 18 ++ .../input_package/1.0.0/changelog.yml | 6 + .../input_package/1.0.0/docs/README.md | 1 + .../input_package/1.0.0/fields/input.yml | 4 + .../input_package/1.0.0/manifest.yml | 37 +++ .../apis/package_policy/update.ts | 260 +++++++++++------- 19 files changed, 482 insertions(+), 131 deletions(-) create mode 100644 x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/agent/input/input.yml.hbs create mode 100644 x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/changelog.yml create mode 100644 x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/docs/README.md create mode 100644 x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/fields/input.yml create mode 100644 x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/manifest.yml diff --git a/x-pack/plugins/fleet/common/services/policy_template.ts b/x-pack/plugins/fleet/common/services/policy_template.ts index 1d523af8b05ec..912ec96f6091f 100644 --- a/x-pack/plugins/fleet/common/services/policy_template.ts +++ b/x-pack/plugins/fleet/common/services/policy_template.ts @@ -20,7 +20,7 @@ const DATA_STREAM_DATASET_VAR: RegistryVarsEntry = { type: 'text', title: 'Dataset name', description: - "Set the name for your dataset. Changing the dataset will send the data to a different index. You can't use `-` in the name of a dataset and only valid characters for [Elasticsearch index names](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html).\n", + "Set the name for your dataset. Once selected a dataset cannot be changed without creating a new integration policy. You can't use `-` in the name of a dataset and only valid characters for [Elasticsearch index names](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html) are permitted.\n", multi: false, required: true, show_user: true, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/dataset_combo.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/dataset_combo.tsx index 4588ebc4912b3..15e1a18f26dcd 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/dataset_combo.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/dataset_combo.tsx @@ -13,7 +13,8 @@ export const DatasetComboBox: React.FC<{ value: any; onChange: (newValue: any) => void; datasets: string[]; -}> = ({ value, onChange, datasets }) => { + isDisabled?: boolean; +}> = ({ value, onChange, datasets, isDisabled }) => { const datasetOptions = datasets.map((dataset: string) => ({ label: dataset })) ?? []; const defaultOption = 'generic'; const [selectedOptions, setSelectedOptions] = useState>([ @@ -42,7 +43,6 @@ export const DatasetComboBox: React.FC<{ setSelectedOptions([newOption]); onChange(searchValue); }; - return ( ); }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_config.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_config.tsx index dff5d719dc36d..fd4a3a752eacd 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_config.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_config.tsx @@ -29,6 +29,7 @@ export const PackagePolicyInputConfig: React.FunctionComponent<{ updatePackagePolicyInput: (updatedInput: Partial) => void; inputVarsValidationResults: PackagePolicyConfigValidationResults; forceShowErrors?: boolean; + isEditPage?: boolean; }> = memo( ({ hasInputStreams, @@ -37,6 +38,7 @@ export const PackagePolicyInputConfig: React.FunctionComponent<{ updatePackagePolicyInput, inputVarsValidationResults, forceShowErrors, + isEditPage = false, }) => { // Showing advanced options toggle state const [isShowingAdvanced, setIsShowingAdvanced] = useState(false); @@ -121,6 +123,7 @@ export const PackagePolicyInputConfig: React.FunctionComponent<{ }} errors={inputVarsValidationResults.vars?.[varName]} forceShowErrors={forceShowErrors} + isEditPage={isEditPage} /> ); @@ -178,6 +181,7 @@ export const PackagePolicyInputConfig: React.FunctionComponent<{ }} errors={inputVarsValidationResults.vars?.[varName]} forceShowErrors={forceShowErrors} + isEditPage={isEditPage} /> ); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_panel.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_panel.tsx index ccb6a6f47e1c8..68f26a3cf6121 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_panel.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_panel.tsx @@ -80,6 +80,7 @@ export const PackagePolicyInputPanel: React.FunctionComponent<{ updatePackagePolicyInput: (updatedInput: Partial) => void; inputValidationResults: PackagePolicyInputValidationResults; forceShowErrors?: boolean; + isEditPage?: boolean; }> = memo( ({ packageInput, @@ -91,6 +92,7 @@ export const PackagePolicyInputPanel: React.FunctionComponent<{ updatePackagePolicyInput, inputValidationResults, forceShowErrors, + isEditPage = false, }) => { const defaultDataStreamId = useDataStreamId(); // Showing streams toggle state @@ -213,7 +215,6 @@ export const PackagePolicyInputPanel: React.FunctionComponent<{ {/* Header rule break */} {isShowingStreams ? : null} - {/* Input level policy */} {isShowingStreams && packageInput.vars && packageInput.vars.length ? ( @@ -224,6 +225,7 @@ export const PackagePolicyInputPanel: React.FunctionComponent<{ updatePackagePolicyInput={updatePackagePolicyInput} inputVarsValidationResults={{ vars: inputValidationResults?.vars }} forceShowErrors={forceShowErrors} + isEditPage={isEditPage} /> {hasInputStreams ? : } @@ -273,6 +275,7 @@ export const PackagePolicyInputPanel: React.FunctionComponent<{ inputValidationResults?.streams![packagePolicyInputStream!.data_stream!.dataset] } forceShowErrors={forceShowErrors} + isEditPage={isEditPage} /> {index !== inputStreams.length - 1 ? ( <> diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx index 2191b151414ba..814d1b47783f3 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx @@ -58,6 +58,7 @@ interface Props { updatePackagePolicyInputStream: (updatedStream: Partial) => void; inputStreamValidationResults: PackagePolicyConfigValidationResults; forceShowErrors?: boolean; + isEditPage?: boolean; } export const PackagePolicyInputStreamConfig = memo( @@ -70,6 +71,7 @@ export const PackagePolicyInputStreamConfig = memo( updatePackagePolicyInputStream, inputStreamValidationResults, forceShowErrors, + isEditPage, }) => { const config = useConfig(); const isExperimentalDataStreamSettingsEnabled = @@ -226,6 +228,7 @@ export const PackagePolicyInputStreamConfig = memo( forceShowErrors={forceShowErrors} packageType={packageInfo.type} datasets={datasets} + isEditPage={isEditPage} /> ); @@ -287,6 +290,7 @@ export const PackagePolicyInputStreamConfig = memo( forceShowErrors={forceShowErrors} packageType={packageInfo.type} datasets={datasets} + isEditPage={isEditPage} /> ); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_var_field.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_var_field.tsx index e314fb2c79ca6..48b67d3078336 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_var_field.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_var_field.tsx @@ -40,6 +40,7 @@ export const PackagePolicyInputVarField: React.FunctionComponent<{ frozen?: boolean; packageType?: string; datasets?: string[]; + isEditPage?: boolean; }> = memo( ({ varDef, @@ -50,6 +51,7 @@ export const PackagePolicyInputVarField: React.FunctionComponent<{ frozen, packageType, datasets = [], + isEditPage = false, }) => { const [isDirty, setIsDirty] = useState(false); const { multi, required, type, title, name, description } = varDef; @@ -68,9 +70,15 @@ export const PackagePolicyInputVarField: React.FunctionComponent<{ /> ); } - if (name === 'data_stream.dataset' && packageType === 'input') { - return ; + return ( + + ); } switch (type) { case 'textarea': @@ -152,7 +160,19 @@ export const PackagePolicyInputVarField: React.FunctionComponent<{ /> ); } - }, [isInvalid, multi, onChange, type, value, fieldLabel, frozen, datasets, name, packageType]); + }, [ + multi, + name, + packageType, + type, + value, + onChange, + frozen, + datasets, + isEditPage, + isInvalid, + fieldLabel, + ]); // Boolean cannot be optional by default set to false const isOptional = useMemo(() => type !== 'bool' && !required, [required, type]); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_configure_package.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_configure_package.tsx index 01968fd601996..edcea931b5535 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_configure_package.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_configure_package.tsx @@ -37,6 +37,7 @@ export const StepConfigurePackagePolicy: React.FunctionComponent<{ validationResults: PackagePolicyValidationResults; submitAttempted: boolean; noTopRule?: boolean; + isEditPage?: boolean; }> = ({ packageInfo, showOnlyIntegration, @@ -45,6 +46,7 @@ export const StepConfigurePackagePolicy: React.FunctionComponent<{ validationResults, submitAttempted, noTopRule = false, + isEditPage = false, }) => { const hasIntegrations = useMemo(() => doesPackageHaveIntegrations(packageInfo), [packageInfo]); const packagePolicyTemplates = useMemo( @@ -109,6 +111,7 @@ export const StepConfigurePackagePolicy: React.FunctionComponent<{ ] } forceShowErrors={submitAttempted} + isEditPage={isEditPage} /> diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_define_package_policy.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_define_package_policy.test.tsx index be9e7425ca617..e088e00d2f95a 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_define_package_policy.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_define_package_policy.test.tsx @@ -92,7 +92,7 @@ describe('StepDefinePackagePolicy', () => { let testRenderer: TestRenderer; let renderResult: ReturnType; - const render = ({ isUpdate } = { isUpdate: false }) => + const render = () => (renderResult = testRenderer.render( { updatePackagePolicy={mockUpdatePackagePolicy} validationResults={validationResults} submitAttempted={false} - isUpdate={isUpdate} /> )); @@ -165,7 +164,7 @@ describe('StepDefinePackagePolicy', () => { describe('update', () => { describe('when package vars are introduced in a new package version', () => { it('should display new package vars', () => { - render({ isUpdate: true }); + render(); waitFor(async () => { expect(renderResult.getByDisplayValue('showUserVarVal')).toBeInTheDocument(); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_define_package_policy.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_define_package_policy.tsx index 186dea6c3c3da..07cebf31baebc 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_define_package_policy.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_define_package_policy.tsx @@ -50,23 +50,21 @@ export const StepDefinePackagePolicy: React.FunctionComponent<{ agentPolicy?: AgentPolicy; packageInfo: PackageInfo; packagePolicy: NewPackagePolicy; - integrationToEnable?: string; updatePackagePolicy: (fields: Partial) => void; validationResults: PackagePolicyValidationResults; submitAttempted: boolean; - isUpdate?: boolean; + isEditPage?: boolean; noAdvancedToggle?: boolean; }> = memo( ({ agentPolicy, packageInfo, packagePolicy, - integrationToEnable, - isUpdate, updatePackagePolicy, validationResults, submitAttempted, noAdvancedToggle = false, + isEditPage = false, }) => { const { docLinks } = useStartServices(); @@ -251,7 +249,6 @@ export const StepDefinePackagePolicy: React.FunctionComponent<{ )} {/* Advanced options content */} - {/* Todo: Populate list of existing namespaces */} {isShowingAdvanced ? ( @@ -266,27 +263,35 @@ export const StepDefinePackagePolicy: React.FunctionComponent<{ /> } helpText={ - - {i18n.translate( - 'xpack.fleet.createPackagePolicy.stepConfigure.packagePolicyNamespaceHelpLearnMoreLabel', - { defaultMessage: 'Learn more' } - )} - - ), - }} - /> + isEditPage && packageInfo.type === 'input' ? ( + + ) : ( + + {i18n.translate( + 'xpack.fleet.createPackagePolicy.stepConfigure.packagePolicyNamespaceHelpLearnMoreLabel', + { defaultMessage: 'Learn more' } + )} + + ), + }} + /> + ) } > {/* Only show the out-of-box configuration step if a UI extension is NOT registered */} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx index 07e0636f04640..afab7a48ebb76 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx @@ -286,7 +286,7 @@ export const EditPackagePolicyForm = memo<{ updatePackagePolicy={updatePackagePolicy} validationResults={validationResults!} submitAttempted={formState === 'INVALID'} - isUpdate={true} + isEditPage={true} /> )} @@ -298,6 +298,7 @@ export const EditPackagePolicyForm = memo<{ updatePackagePolicy={updatePackagePolicy} validationResults={validationResults!} submitAttempted={formState === 'INVALID'} + isEditPage={true} /> )} diff --git a/x-pack/plugins/fleet/server/services/package_policy.test.ts b/x-pack/plugins/fleet/server/services/package_policy.test.ts index faf7e41f15378..ae50ec3f785f3 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.test.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.test.ts @@ -55,6 +55,7 @@ import { packagePolicyService, _applyIndexPrivileges, _compilePackagePolicyInputs, + _validateRestrictedFieldsNotModifiedOrThrow, } from './package_policy'; import { appContextService } from './app_context'; @@ -4578,3 +4579,130 @@ describe('_applyIndexPrivileges()', () => { expect(streamOut).toEqual(expectedStream); }); }); + +describe('_validateRestrictedFieldsNotModifiedOrThrow()', () => { + const pkgInfo = { + name: 'custom_logs', + title: 'Custom Logs', + version: '1.0.0', + type: 'input', + } as any as PackageInfo; + + const createInputPkgPolicy = (opts: { namespace: string; dataset: string }) => { + const { namespace, dataset } = opts; + return { + id: 'id-1234', + version: 'WzI1MywxXQ==', + name: 'custom_logs-1', + namespace, + description: '', + enabled: true, + policy_id: '1234', + revision: 1, + created_at: '2023-01-04T14:51:53.061Z', + created_by: 'elastic', + updated_at: '2023-01-04T14:51:53.061Z', + updated_by: 'elastic', + vars: {}, + inputs: [ + { + type: 'logfile', + policy_template: 'logs', + enabled: true, + streams: [ + { + enabled: true, + data_stream: { + type: 'logs', + dataset: 'custom_logs.logs', + }, + vars: { + 'data_stream.dataset': { + type: 'text', + value: dataset, + }, + }, + id: 'logfile-custom_logs.logs-1', + }, + ], + }, + ], + package: { + name: 'custom_logs', + title: 'Custom Logs', + version: '1.0.0', + }, + }; + }; + it('should not throw if restricted fields are not modified', () => { + const oldPackagePolicy = createInputPkgPolicy({ + namespace: 'default', + dataset: 'custom_logs.logs', + }); + expect(() => + _validateRestrictedFieldsNotModifiedOrThrow({ + oldPackagePolicy, + packagePolicyUpdate: oldPackagePolicy, + pkgInfo, + }) + ).not.toThrow(); + }); + + it('should throw if namespace is modified', () => { + const oldPackagePolicy = createInputPkgPolicy({ + namespace: 'default', + dataset: 'custom_logs.logs', + }); + const newPackagePolicy = createInputPkgPolicy({ + namespace: 'new-namespace', + dataset: 'custom_logs.logs', + }); + expect(() => + _validateRestrictedFieldsNotModifiedOrThrow({ + oldPackagePolicy, + packagePolicyUpdate: newPackagePolicy, + pkgInfo, + }) + ).toThrowErrorMatchingInlineSnapshot( + `"Package policy namespace cannot be modified for input only packages, please create a new package policy."` + ); + }); + + it('should throw if dataset is modified', () => { + const oldPackagePolicy = createInputPkgPolicy({ + namespace: 'default', + dataset: 'custom_logs.logs', + }); + const newPackagePolicy = createInputPkgPolicy({ + namespace: 'default', + dataset: 'new-dataset', + }); + expect(() => + _validateRestrictedFieldsNotModifiedOrThrow({ + oldPackagePolicy, + packagePolicyUpdate: newPackagePolicy, + pkgInfo, + }) + ).toThrowErrorMatchingInlineSnapshot( + `"Package policy dataset cannot be modified for input only packages, please create a new package policy."` + ); + }); + + it('should not throw if dataset is modified but package is integration package', () => { + const oldPackagePolicy = createInputPkgPolicy({ + namespace: 'default', + dataset: 'custom_logs.logs', + }); + const newPackagePolicy = createInputPkgPolicy({ + namespace: 'default', + dataset: 'new-dataset', + }); + expect(() => + _validateRestrictedFieldsNotModifiedOrThrow({ + oldPackagePolicy, + packagePolicyUpdate: newPackagePolicy, + pkgInfo: { ...pkgInfo, type: 'integration' }, + }) + ).not.toThrow(); + }); +}); diff --git a/x-pack/plugins/fleet/server/services/package_policy.ts b/x-pack/plugins/fleet/server/services/package_policy.ts index 0c824211ab2d5..73fda5ac50aff 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.ts @@ -519,7 +519,11 @@ class PackagePolicyClientImpl implements PackagePolicyClient { pkgVersion: packagePolicy.package.version, prerelease: true, }); - + _validateRestrictedFieldsNotModifiedOrThrow({ + pkgInfo, + oldPackagePolicy, + packagePolicyUpdate, + }); validatePackagePolicyOrThrow(packagePolicy, pkgInfo); inputs = await _compilePackagePolicyInputs(pkgInfo, packagePolicy.vars || {}, inputs); @@ -1950,6 +1954,52 @@ export function preconfigurePackageInputs( return resultingPackagePolicy; } +// input only packages cannot have their namespace or dataset modified +export function _validateRestrictedFieldsNotModifiedOrThrow(opts: { + pkgInfo: PackageInfo; + oldPackagePolicy: PackagePolicy; + packagePolicyUpdate: UpdatePackagePolicy; +}) { + const { pkgInfo, oldPackagePolicy, packagePolicyUpdate } = opts; + + if (pkgInfo.type !== 'input') return; + + const { namespace, inputs } = packagePolicyUpdate; + if (namespace && namespace !== oldPackagePolicy.namespace) { + throw new PackagePolicyValidationError( + i18n.translate('xpack.fleet.updatePackagePolicy.namespaceCannotBeModified', { + defaultMessage: + 'Package policy namespace cannot be modified for input only packages, please create a new package policy.', + }) + ); + } + + if (inputs) { + for (const input of inputs) { + const oldInput = oldPackagePolicy.inputs.find((i) => i.id === input.id); + if (oldInput) { + for (const stream of input.streams || []) { + const oldStream = oldInput.streams.find( + (s) => s.data_stream.dataset === stream.data_stream.dataset + ); + if ( + oldStream && + oldStream?.vars?.['data_stream.dataset'] && + oldStream?.vars['data_stream.dataset'] !== stream?.vars?.['data_stream.dataset'] + ) { + throw new PackagePolicyValidationError( + i18n.translate('xpack.fleet.updatePackagePolicy.datasetCannotBeModified', { + defaultMessage: + 'Package policy dataset cannot be modified for input only packages, please create a new package policy.', + }) + ); + } + } + } + } + } +} + async function validateIsNotHostedPolicy( soClient: SavedObjectsClientContract, id: string, diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/agent/input/input.yml.hbs b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/agent/input/input.yml.hbs new file mode 100644 index 0000000000000..1ba86fa98a2f8 --- /dev/null +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/agent/input/input.yml.hbs @@ -0,0 +1,18 @@ +paths: +{{#each paths}} + - {{this}} +{{/each}} + +{{#if tags}} +tags: +{{#each tags as |tag i|}} + - {{tag}} +{{/each}} +{{/if}} + +{{#if pipeline}} +pipeline: {{pipeline}} +{{/if}} + +data_stream: + dataset: {{data_stream.dataset}} \ No newline at end of file diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/changelog.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/changelog.yml new file mode 100644 index 0000000000000..b7bc82c1696ba --- /dev/null +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/changelog.yml @@ -0,0 +1,6 @@ +# newer versions go on top +- version: "1.0.0" + changes: + - description: basic input package + type: enhancement + link: https://github.com/elastic/package-spec/pull/325 diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/docs/README.md b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/docs/README.md new file mode 100644 index 0000000000000..9f29c89e0f5ef --- /dev/null +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/docs/README.md @@ -0,0 +1 @@ +# Custom Logs \ No newline at end of file diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/fields/input.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/fields/input.yml new file mode 100644 index 0000000000000..f5851c64b6b3a --- /dev/null +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/fields/input.yml @@ -0,0 +1,4 @@ +- name: input.name + type: constant_keyword + description: Sample field to be added. + value: logs \ No newline at end of file diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/manifest.yml new file mode 100644 index 0000000000000..7ca322f5f1b37 --- /dev/null +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/input_package/1.0.0/manifest.yml @@ -0,0 +1,37 @@ +format_version: 1.0.0 +name: input_package +title: Test Custom Logs Input Package +description: >- + Read lines from active log files with Elastic Agent. +type: input +version: 1.0.0 +license: basic +categories: + - custom +policy_templates: + - name: logs + type: logs + title: Custom log file + description: Collect your custom log files. + input: logfile + template_path: input.yml.hbs + vars: + - name: paths + type: text + title: Paths + multi: true + required: true + show_user: true + - name: tags + type: text + title: Tags + multi: true + required: true + show_user: false + - name: ignore_older + type: text + title: Ignore events older than + required: false + default: 72h +owner: + github: elastic/integrations \ No newline at end of file diff --git a/x-pack/test/fleet_api_integration/apis/package_policy/update.ts b/x-pack/test/fleet_api_integration/apis/package_policy/update.ts index 3a931ca09ca3d..08a0681f7cde6 100644 --- a/x-pack/test/fleet_api_integration/apis/package_policy/update.ts +++ b/x-pack/test/fleet_api_integration/apis/package_policy/update.ts @@ -6,10 +6,10 @@ */ import expect from '@kbn/expect'; import { policyFactory } from '@kbn/security-solution-plugin/common/endpoint/models/policy_config'; +import type { NewPackagePolicy } from '@kbn/fleet-plugin/common'; import { FtrProviderContext } from '../../../api_integration/ftr_provider_context'; import { skipIfNoDockerRegistry } from '../../helpers'; import { testUsers } from '../test_users'; - export default function (providerContext: FtrProviderContext) { const { getService } = providerContext; const supertest = getService('supertest'); @@ -36,6 +36,10 @@ export default function (providerContext: FtrProviderContext) { let packagePolicyId2: string; let packagePolicyId3: string; let endpointPackagePolicyId: string; + let inputOnlyPackagePolicyId: string; + + let inputOnlyBasePackagePolicy: NewPackagePolicy; + before(async () => { await kibanaServer.savedObjects.cleanStandardList(); await esArchiver.load('x-pack/test/functional/es_archives/fleet/empty_fleet_server'); @@ -45,25 +49,21 @@ export default function (providerContext: FtrProviderContext) { if (!server.enabled) { return; } - const { body: agentPolicyResponse } = await supertest - .post(`/api/fleet/agent_policies`) - .set('kbn-xsrf', 'xxxx') - .send({ - name: 'Test policy', - namespace: 'default', - }); + const [{ body: agentPolicyResponse }, { body: managedAgentPolicyResponse }] = + await Promise.all([ + supertest.post(`/api/fleet/agent_policies`).set('kbn-xsrf', 'xxxx').send({ + name: 'Test policy', + namespace: 'default', + }), + supertest.post(`/api/fleet/agent_policies`).set('kbn-xsrf', 'xxxx').send({ + name: 'Test hosted agent policy', + namespace: 'default', + is_managed: true, + }), + ]); agentPolicyId = agentPolicyResponse.item.id; - const { body: managedAgentPolicyResponse } = await supertest - .post(`/api/fleet/agent_policies`) - .set('kbn-xsrf', 'xxxx') - .send({ - name: 'Test hosted agent policy', - namespace: 'default', - is_managed: true, - }); - // if one already exists, re-use that const managedExists = managedAgentPolicyResponse.statusCode === 409; if (managedExists) { @@ -76,90 +76,128 @@ export default function (providerContext: FtrProviderContext) { managedAgentPolicyId = managedAgentPolicyResponse.item.id; } - const { body: packagePolicyResponse } = await supertest - .post(`/api/fleet/package_policies`) - .set('kbn-xsrf', 'xxxx') - .send({ - name: 'filetest-1', - description: '', - namespace: 'default', - policy_id: agentPolicyId, - enabled: true, - inputs: [], - package: { - name: 'filetest', - title: 'For File Tests', - version: '0.1.0', - }, - }); - packagePolicyId = packagePolicyResponse.item.id; - - const { body: packagePolicyResponse2 } = await supertest - .post(`/api/fleet/package_policies`) - .set('kbn-xsrf', 'xxxx') - .send({ - name: 'filetest-2', - description: '', - namespace: 'default', - policy_id: agentPolicyId, - enabled: true, - inputs: [], - package: { - name: 'filetest', - title: 'For File Tests', - version: '0.1.0', + inputOnlyBasePackagePolicy = { + name: 'input-only-test-1', + description: '', + namespace: 'default', + policy_id: agentPolicyId, + enabled: true, + inputs: [ + { + type: 'logfile', + policy_template: 'logs', + enabled: true, + streams: [ + { + enabled: true, + data_stream: { type: 'logs', dataset: 'input_package.logs' }, + vars: { + paths: { type: 'text', value: ['/tmp/test.log'] }, + tags: { type: 'text', value: ['tag1'] }, + ignore_older: { value: '72h', type: 'text' }, + 'data_stream.dataset': { type: 'text', value: 'generic' }, + }, + }, + ], }, - }); - packagePolicyId2 = packagePolicyResponse2.item.id; + ], + package: { name: 'input_package', title: 'Input only package', version: '1.0.0' }, + }; - const { body: packagePolicyResponse3 } = await supertest - .post(`/api/fleet/package_policies`) - .set('kbn-xsrf', 'xxxx') - .send({ - name: 'update-package-policy-with_required_variables-1', - description: '', - namespace: 'default', - policy_id: agentPolicyId, - inputs: { - 'with_required_variables-test_input': { - streams: { - 'with_required_variables.log': { - vars: { test_var_required: 'I am required' }, + const [ + { body: packagePolicyResponse }, + { body: packagePolicyResponse2 }, + { body: packagePolicyResponse3 }, + { body: endpointPackagePolicyResponse }, + { body: inputOnlyPolicyResponse }, + ] = await Promise.all([ + supertest + .post(`/api/fleet/package_policies`) + .set('kbn-xsrf', 'xxxx') + .send({ + name: 'filetest-1', + description: '', + namespace: 'default', + policy_id: agentPolicyId, + enabled: true, + inputs: [], + package: { + name: 'filetest', + title: 'For File Tests', + version: '0.1.0', + }, + }), + supertest + .post(`/api/fleet/package_policies`) + .set('kbn-xsrf', 'xxxx') + .send({ + name: 'filetest-2', + description: '', + namespace: 'default', + policy_id: agentPolicyId, + enabled: true, + inputs: [], + package: { + name: 'filetest', + title: 'For File Tests', + version: '0.1.0', + }, + }), + supertest + .post(`/api/fleet/package_policies`) + .set('kbn-xsrf', 'xxxx') + .send({ + name: 'update-package-policy-with_required_variables-1', + description: '', + namespace: 'default', + policy_id: agentPolicyId, + inputs: { + 'with_required_variables-test_input': { + streams: { + 'with_required_variables.log': { + vars: { test_var_required: 'I am required' }, + }, }, }, }, - }, - package: { - name: 'with_required_variables', - version: '0.1.0', - }, - }); - packagePolicyId3 = packagePolicyResponse3.item.id; - - const { body: endpointPackagePolicyResponse } = await supertest - .post(`/api/fleet/package_policies`) - .set('kbn-xsrf', 'xxxx') - .send({ - name: 'endpoint-1', - description: '', - namespace: 'default', - policy_id: agentPolicyId, - enabled: true, - inputs: [ - { - enabled: true, - streams: [], - type: 'endpoint', + package: { + name: 'with_required_variables', + version: '0.1.0', }, - ], - force: true, - package: { - name: 'endpoint', - title: 'Elastic Defend', - version: '8.6.1', - }, - }); + }), + supertest + .post(`/api/fleet/package_policies`) + .set('kbn-xsrf', 'xxxx') + .send({ + name: 'endpoint-1', + description: '', + namespace: 'default', + policy_id: agentPolicyId, + enabled: true, + inputs: [ + { + enabled: true, + streams: [], + type: 'endpoint', + }, + ], + force: true, + package: { + name: 'endpoint', + title: 'Elastic Defend', + version: '8.6.1', + }, + }), + supertest + .post(`/api/fleet/package_policies`) + .set('kbn-xsrf', 'xxxx') + .send(inputOnlyBasePackagePolicy), + ]); + packagePolicyId = packagePolicyResponse.item.id; + packagePolicyId2 = packagePolicyResponse2.item.id; + packagePolicyId3 = packagePolicyResponse3.item.id; endpointPackagePolicyId = endpointPackagePolicyResponse.item.id; + inputOnlyPackagePolicyId = inputOnlyPolicyResponse.item.id; }); after(async function () { @@ -167,12 +205,14 @@ export default function (providerContext: FtrProviderContext) { .post(`/api/fleet/agent_policies/delete`) .set('kbn-xsrf', 'xxxx') .send({ agentPolicyId }); - // uninstall endpoint package await supertest .delete(`/api/fleet/epm/packages/endpoint-8.6.1`) .set('kbn-xsrf', 'xxxx') - .send({ force: true }) + .expect(200); + await supertest + .delete(`/api/fleet/epm/packages/input_package-1.0.0`) + .set('kbn-xsrf', 'xxxx') .expect(200); }); @@ -438,6 +478,34 @@ export default function (providerContext: FtrProviderContext) { .expect(400); expect(body.message).eql('Input not found: with_required_variables-i-do-not-exists'); }); + + it('should return a 400 if namespace is edited on input only package policy', async function () { + const { body } = await supertest + .put(`/api/fleet/package_policies/${inputOnlyPackagePolicyId}`) + .set('kbn-xsrf', 'xxxx') + .send({ + ...inputOnlyBasePackagePolicy, + namespace: 'updated_namespace', + }) + .expect(400); + expect(body.message).eql( + 'Package policy namespace cannot be modified for input only packages, please create a new package policy.' + ); + }); + it('should return a 400 if dataset is edited on input only package policy', async function () { + const updatedPolicy = JSON.parse(JSON.stringify(inputOnlyBasePackagePolicy)); + + updatedPolicy.inputs[0].streams[0].vars['data_stream.dataset'].value = 'updated_dataset'; + + const { body } = await supertest + .put(`/api/fleet/package_policies/${inputOnlyPackagePolicyId}`) + .set('kbn-xsrf', 'xxxx') + .send(updatedPolicy) + .expect(400); + expect(body.message).eql( + 'Package policy dataset cannot be modified for input only packages, please create a new package policy.' + ); + }); }); }); } From b13515ad517925073f87c77da96f60cdbc7e12fa Mon Sep 17 00:00:00 2001 From: Dominique Clarke Date: Wed, 11 Jan 2023 17:01:14 -0500 Subject: [PATCH 03/39] [Synthetics] adjust the status for project monitor cards (#148674) ## Summary Resolves https://github.com/elastic/kibana/issues/148673 Adjusts the status for project monitors to ensure they are rendered in the correct color. Screen Shot 2023-01-10 at 3 10 38 PM ### Testing 1. Create a project monitor. Wait a minute or two for it to execute against the service 2. Navigate to the Overview page 3. Ensure the project monitor card is displayed in the correct color, red for up and green for down --- .../components/monitors_page/overview/overview/metric_item.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx index d90264858cc46..952b1b4a8a667 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx @@ -60,7 +60,7 @@ export const MetricItem = ({ const [isMouseOver, setIsMouseOver] = useState(false); const [isPopoverOpen, setIsPopoverOpen] = useState(false); const locationName = useLocationName({ locationId: monitor.location?.id }); - const { status, timestamp } = useStatusByLocationOverview(monitor.id, locationName); + const { status, timestamp } = useStatusByLocationOverview(monitor.configId, locationName); const theme = useTheme(); const testInProgress = useSelector(manualTestRunInProgressSelector(monitor.configId)); @@ -71,6 +71,7 @@ export const MetricItem = ({
{loaded ? ( { if (!isMouseOver) { From b8334e20205dfd4040ce0e8dec1a68a34d029d33 Mon Sep 17 00:00:00 2001 From: Spencer Date: Wed, 11 Jan 2023 17:09:11 -0600 Subject: [PATCH 04/39] [tsProjects] auto-rebuild tsconfig-paths.json cache (#148743) Updates the TsProject loading logic to automatically rebuild the tsconfig-paths.json cache of tsconfig file locations which was previously only updated by bootstrap. This means that people will no longer be stopped when they are running tasks which didn't used to strictly require a bootstrap, and told to bootstrap the repo. This is specifically usable in this context because we are only populating the cache in bootstrap because we are already scanning all the files in the repo at that point. It's a quick operation (though one we ideally wouldn't be executing constantly), so adding it here too just provides a better DX. Additionally, this PR adds a check to the start of the precommit hook which will bootstrap the repo if the user just finished resolving a merge. This puts the repo in a more correct state before running code to validate code via eslint, etc. Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../src/precommit_hook/script_source.ts | 4 +- packages/kbn-get-repo-files/index.ts | 2 +- .../kbn-get-repo-files/src/get_repo_files.ts | 63 +++++++++++++------ packages/kbn-ts-projects/ts_project.ts | 36 ++++++++--- packages/kbn-ts-projects/tsconfig.json | 2 + 5 files changed, 77 insertions(+), 30 deletions(-) diff --git a/packages/kbn-dev-utils/src/precommit_hook/script_source.ts b/packages/kbn-dev-utils/src/precommit_hook/script_source.ts index 767b720081fdc..66038b31a9062 100644 --- a/packages/kbn-dev-utils/src/precommit_hook/script_source.ts +++ b/packages/kbn-dev-utils/src/precommit_hook/script_source.ts @@ -18,8 +18,8 @@ export const SCRIPT_SOURCE = `#!/usr/bin/env bash # ** PLEASE DO NOT CHANGE IT MANUALLY ** # # GENERATED BY \`node scripts/register_git_hook\` -# IF YOU WANNA CHANGE SOMETHING IN THIS SCRIPT -# PLEASE RE-RUN 'yarn kbn bootstrap' or 'node scripts/register_git_hook' +# IF YOU CHANGE SOMETHING IN THIS SCRIPT IT WILL +# BE REWRITTEN BY 'node scripts/register_git_hook' # pre-commit script takes zero arguments: https://git-scm.com/docs/githooks#_pre_commit diff --git a/packages/kbn-get-repo-files/index.ts b/packages/kbn-get-repo-files/index.ts index 245bade1c0627..0d33a512abda5 100644 --- a/packages/kbn-get-repo-files/index.ts +++ b/packages/kbn-get-repo-files/index.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -export { getRepoFiles } from './src/get_repo_files'; +export { getRepoFiles, getRepoFilesSync } from './src/get_repo_files'; diff --git a/packages/kbn-get-repo-files/src/get_repo_files.ts b/packages/kbn-get-repo-files/src/get_repo_files.ts index f0b52b5021510..b68e1b1e40bdf 100644 --- a/packages/kbn-get-repo-files/src/get_repo_files.ts +++ b/packages/kbn-get-repo-files/src/get_repo_files.ts @@ -13,28 +13,11 @@ import execa from 'execa'; import { REPO_ROOT } from '@kbn/repo-info'; import { RepoPath } from '@kbn/repo-path'; -/** - * List the files in the repo, only including files which are manged by version - * control or "untracked" (new, not committed, and not ignored). - * @param include limit the list to specfic absolute paths - * @param exclude exclude specific absolute paths - */ -export async function getRepoFiles(include?: string[], exclude?: string[]) { - const flags = [ - include?.map((p) => Path.relative(REPO_ROOT, p)) ?? [], - exclude?.map((p) => `--exclude=${Path.relative(REPO_ROOT, p)}`) ?? [], - ].flat(); - - const proc = await execa('git', ['ls-files', '-comt', '--exclude-standard', ...flags], { - cwd: REPO_ROOT, - stdio: ['ignore', 'pipe', 'pipe'], - buffer: true, - }); - +function parseLsFilesOutput(output: string) { const paths = new Map(); const files = new Set(); - for (const line of proc.stdout.split('\n').map((l) => l.trim())) { + for (const line of output.split('\n').map((l) => l.trim())) { if (!line) { continue; } @@ -59,3 +42,45 @@ export async function getRepoFiles(include?: string[], exclude?: string[]) { return files; } + +function getGitFlags(include?: string[], exclude?: string[]) { + return [ + 'ls-files', + '-comt', + '--exclude-standard', + include?.map((p) => Path.relative(REPO_ROOT, p)) ?? [], + exclude?.map((p) => `--exclude=${Path.relative(REPO_ROOT, p)}`) ?? [], + ].flat(); +} + +/** + * List the files in the repo, only including files which are manged by version + * control or "untracked" (new, not committed, and not ignored). + * @param include limit the list to specfic absolute paths + * @param exclude exclude specific absolute paths + */ +export async function getRepoFiles(include?: string[], exclude?: string[]) { + const proc = await execa('git', getGitFlags(include, exclude), { + cwd: REPO_ROOT, + stdio: ['ignore', 'pipe', 'pipe'], + buffer: true, + }); + + return parseLsFilesOutput(proc.stdout); +} + +/** + * Synchronously list the files in the repo, only including files which are manged by version + * control or "untracked" (new, not committed, and not ignored). + * @param include limit the list to specfic absolute paths + * @param exclude exclude specific absolute paths + */ +export function getRepoFilesSync(include?: string[], exclude?: string[]) { + const proc = execa.sync('git', getGitFlags(include, exclude), { + cwd: REPO_ROOT, + stdio: ['ignore', 'pipe', 'pipe'], + buffer: true, + }); + + return parseLsFilesOutput(proc.stdout); +} diff --git a/packages/kbn-ts-projects/ts_project.ts b/packages/kbn-ts-projects/ts_project.ts index c4e17cd169e0f..305354314c3c7 100644 --- a/packages/kbn-ts-projects/ts_project.ts +++ b/packages/kbn-ts-projects/ts_project.ts @@ -12,6 +12,8 @@ import Fs from 'fs'; import { REPO_ROOT } from '@kbn/repo-info'; import { makeMatcher } from '@kbn/picomatcher'; import { findPackageInfoForPath } from '@kbn/repo-packages'; +import { createFailError } from '@kbn/dev-cli-errors'; +import { getRepoFilesSync } from '@kbn/get-repo-files'; import { readTsConfig, parseTsConfig, TsConfig } from './ts_configfile'; @@ -56,7 +58,11 @@ function expand(name: string, patterns: string[], knownPaths: string[]) { } export class TsProject { - static loadAll(options: { ignore: string[]; disableTypeCheck: string[] }) { + static loadAll(options: { + ignore: string[]; + disableTypeCheck: string[]; + noTsconfigPathsRefresh?: boolean; + }): TsProject[] { const mapPath = Path.resolve(__dirname, 'config-paths.json'); if (!Fs.existsSync(mapPath)) { throw new Error('missing config-paths.json file, make sure you run `yarn kbn bootstrap`'); @@ -68,23 +74,37 @@ export class TsProject { const disableTypeCheck = expand('disableTypeCheck', options.disableTypeCheck, tsConfigRepoRels); const cache = new Map(); - const projects = tsConfigRepoRels.flatMap((repoRel) => { + const projects: TsProject[] = []; + for (const repoRel of tsConfigRepoRels) { if (ignores.has(repoRel)) { - return []; + continue; } const proj = TsProject.createFromCache(cache, Path.resolve(REPO_ROOT, repoRel), { disableTypeCheck: disableTypeCheck.has(repoRel), }); - if (!proj) { - throw new Error( - `The tsconfig at ${repoRel} has been removed, please run "yarn kbn bootstrap" to update map of tsconfig files in the repository` + if (proj) { + projects.push(proj); + continue; + } + + if (options.noTsconfigPathsRefresh) { + throw createFailError( + `Run "yarn kbn bootstrap" to update the tsconfig.json path cache. ${repoRel} no longer exists.` ); } - return proj; - }); + // rebuild the tsconfig.json path cache + const tsConfigPaths = Array.from(getRepoFilesSync()).flatMap((r) => + r.basename === 'tsconfig.json' ? r.repoRel : [] + ); + Fs.writeFileSync(mapPath, JSON.stringify(tsConfigPaths, null, 2)); + return TsProject.loadAll({ + ...options, + noTsconfigPathsRefresh: true, + }); + } return projects; } diff --git a/packages/kbn-ts-projects/tsconfig.json b/packages/kbn-ts-projects/tsconfig.json index 19c47f3ff08c3..0b8b0d367bf1d 100644 --- a/packages/kbn-ts-projects/tsconfig.json +++ b/packages/kbn-ts-projects/tsconfig.json @@ -17,5 +17,7 @@ "@kbn/repo-info", "@kbn/repo-packages", "@kbn/picomatcher", + "@kbn/dev-cli-errors", + "@kbn/get-repo-files", ] } From 6770d75ac423656b72a9c47dffca0d5ed08623cd Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 12 Jan 2023 01:00:59 -0500 Subject: [PATCH 05/39] [api-docs] 2023-01-12 Daily api_docs build (#148776) Generated by https://buildkite.com/elastic/kibana-api-docs-daily/builds/215 --- api_docs/actions.mdx | 2 +- api_docs/advanced_settings.mdx | 2 +- api_docs/aiops.mdx | 2 +- api_docs/alerting.mdx | 2 +- api_docs/apm.mdx | 2 +- api_docs/banners.mdx | 2 +- api_docs/bfetch.mdx | 2 +- api_docs/canvas.mdx | 2 +- api_docs/cases.mdx | 2 +- api_docs/charts.mdx | 2 +- api_docs/cloud.mdx | 2 +- api_docs/cloud_chat.mdx | 2 +- api_docs/cloud_data_migration.mdx | 2 +- api_docs/cloud_defend.mdx | 2 +- api_docs/cloud_experiments.mdx | 2 +- api_docs/cloud_security_posture.mdx | 2 +- api_docs/console.mdx | 2 +- api_docs/controls.mdx | 2 +- api_docs/core.devdocs.json | 88 ++++++++++ api_docs/core.mdx | 4 +- api_docs/custom_integrations.mdx | 2 +- api_docs/dashboard.mdx | 2 +- api_docs/dashboard_enhanced.mdx | 2 +- api_docs/data.mdx | 2 +- api_docs/data_query.mdx | 2 +- api_docs/data_search.mdx | 2 +- api_docs/data_view_editor.mdx | 2 +- api_docs/data_view_field_editor.mdx | 2 +- api_docs/data_view_management.mdx | 2 +- api_docs/data_views.mdx | 2 +- api_docs/data_visualizer.mdx | 2 +- api_docs/deprecations_by_api.mdx | 4 +- api_docs/deprecations_by_plugin.mdx | 5 +- api_docs/deprecations_by_team.mdx | 2 +- api_docs/dev_tools.mdx | 2 +- api_docs/discover.devdocs.json | 4 + api_docs/discover.mdx | 2 +- api_docs/discover_enhanced.mdx | 2 +- api_docs/embeddable.mdx | 2 +- api_docs/embeddable_enhanced.mdx | 2 +- api_docs/encrypted_saved_objects.mdx | 2 +- api_docs/enterprise_search.mdx | 2 +- api_docs/es_ui_shared.mdx | 2 +- api_docs/event_annotation.mdx | 2 +- api_docs/event_log.mdx | 2 +- api_docs/expression_error.mdx | 2 +- api_docs/expression_gauge.mdx | 2 +- api_docs/expression_heatmap.mdx | 2 +- api_docs/expression_image.mdx | 2 +- api_docs/expression_legacy_metric_vis.mdx | 2 +- api_docs/expression_metric.mdx | 2 +- api_docs/expression_metric_vis.mdx | 2 +- api_docs/expression_partition_vis.mdx | 2 +- api_docs/expression_repeat_image.mdx | 2 +- api_docs/expression_reveal_image.mdx | 2 +- api_docs/expression_shape.mdx | 2 +- api_docs/expression_tagcloud.mdx | 2 +- api_docs/expression_x_y.mdx | 2 +- api_docs/expressions.mdx | 2 +- api_docs/features.mdx | 2 +- api_docs/field_formats.mdx | 2 +- api_docs/file_upload.mdx | 2 +- api_docs/files.mdx | 2 +- api_docs/files_management.mdx | 2 +- api_docs/fleet.devdocs.json | 41 +++++ api_docs/fleet.mdx | 4 +- api_docs/global_search.mdx | 2 +- api_docs/guided_onboarding.mdx | 2 +- api_docs/home.mdx | 2 +- api_docs/image_embeddable.mdx | 2 +- api_docs/index_lifecycle_management.mdx | 2 +- api_docs/index_management.mdx | 2 +- api_docs/infra.mdx | 2 +- api_docs/inspector.mdx | 2 +- api_docs/interactive_setup.mdx | 2 +- api_docs/kbn_ace.mdx | 2 +- api_docs/kbn_aiops_components.mdx | 2 +- api_docs/kbn_aiops_utils.mdx | 2 +- api_docs/kbn_alerts.mdx | 2 +- api_docs/kbn_analytics.mdx | 2 +- api_docs/kbn_analytics_client.mdx | 2 +- ..._analytics_shippers_elastic_v3_browser.mdx | 2 +- ...n_analytics_shippers_elastic_v3_common.mdx | 2 +- ...n_analytics_shippers_elastic_v3_server.mdx | 2 +- api_docs/kbn_analytics_shippers_fullstory.mdx | 2 +- api_docs/kbn_analytics_shippers_gainsight.mdx | 2 +- api_docs/kbn_apm_config_loader.mdx | 2 +- api_docs/kbn_apm_synthtrace.mdx | 2 +- api_docs/kbn_apm_synthtrace_client.mdx | 2 +- api_docs/kbn_apm_utils.mdx | 2 +- api_docs/kbn_axe_config.mdx | 2 +- api_docs/kbn_cases_components.mdx | 2 +- api_docs/kbn_chart_icons.mdx | 2 +- api_docs/kbn_ci_stats_core.mdx | 2 +- api_docs/kbn_ci_stats_performance_metrics.mdx | 2 +- api_docs/kbn_ci_stats_reporter.mdx | 2 +- api_docs/kbn_cli_dev_mode.mdx | 2 +- api_docs/kbn_coloring.mdx | 2 +- api_docs/kbn_config.mdx | 2 +- api_docs/kbn_config_mocks.mdx | 2 +- api_docs/kbn_config_schema.mdx | 2 +- .../kbn_content_management_content_editor.mdx | 2 +- .../kbn_content_management_table_list.mdx | 2 +- api_docs/kbn_core_analytics_browser.mdx | 2 +- .../kbn_core_analytics_browser_internal.mdx | 2 +- api_docs/kbn_core_analytics_browser_mocks.mdx | 2 +- api_docs/kbn_core_analytics_server.mdx | 2 +- .../kbn_core_analytics_server_internal.mdx | 2 +- api_docs/kbn_core_analytics_server_mocks.mdx | 2 +- api_docs/kbn_core_application_browser.mdx | 2 +- .../kbn_core_application_browser_internal.mdx | 2 +- .../kbn_core_application_browser_mocks.mdx | 2 +- api_docs/kbn_core_application_common.mdx | 2 +- api_docs/kbn_core_apps_browser_internal.mdx | 2 +- api_docs/kbn_core_apps_browser_mocks.mdx | 2 +- api_docs/kbn_core_apps_server_internal.mdx | 2 +- api_docs/kbn_core_base_browser_mocks.mdx | 2 +- api_docs/kbn_core_base_common.mdx | 2 +- api_docs/kbn_core_base_server_internal.mdx | 2 +- api_docs/kbn_core_base_server_mocks.mdx | 2 +- .../kbn_core_capabilities_browser_mocks.mdx | 2 +- api_docs/kbn_core_capabilities_common.mdx | 2 +- api_docs/kbn_core_capabilities_server.mdx | 2 +- .../kbn_core_capabilities_server_mocks.mdx | 2 +- api_docs/kbn_core_chrome_browser.mdx | 2 +- api_docs/kbn_core_chrome_browser_mocks.mdx | 2 +- api_docs/kbn_core_config_server_internal.mdx | 2 +- ..._core_custom_branding_browser.devdocs.json | 160 +++++++++++++++++ api_docs/kbn_core_custom_branding_browser.mdx | 30 ++++ ...tom_branding_browser_internal.devdocs.json | 134 ++++++++++++++ ..._core_custom_branding_browser_internal.mdx | 30 ++++ ...custom_branding_browser_mocks.devdocs.json | 114 ++++++++++++ ...kbn_core_custom_branding_browser_mocks.mdx | 30 ++++ ...n_core_custom_branding_common.devdocs.json | 122 +++++++++++++ api_docs/kbn_core_custom_branding_common.mdx | 30 ++++ ...n_core_custom_branding_server.devdocs.json | 165 ++++++++++++++++++ api_docs/kbn_core_custom_branding_server.mdx | 33 ++++ ...stom_branding_server_internal.devdocs.json | 130 ++++++++++++++ ...n_core_custom_branding_server_internal.mdx | 30 ++++ ..._custom_branding_server_mocks.devdocs.json | 98 +++++++++++ .../kbn_core_custom_branding_server_mocks.mdx | 30 ++++ api_docs/kbn_core_deprecations_browser.mdx | 2 +- ...kbn_core_deprecations_browser_internal.mdx | 2 +- .../kbn_core_deprecations_browser_mocks.mdx | 2 +- api_docs/kbn_core_deprecations_common.mdx | 2 +- api_docs/kbn_core_deprecations_server.mdx | 2 +- .../kbn_core_deprecations_server_internal.mdx | 2 +- .../kbn_core_deprecations_server_mocks.mdx | 2 +- api_docs/kbn_core_doc_links_browser.mdx | 2 +- api_docs/kbn_core_doc_links_browser_mocks.mdx | 2 +- api_docs/kbn_core_doc_links_server.mdx | 2 +- api_docs/kbn_core_doc_links_server_mocks.mdx | 2 +- ...e_elasticsearch_client_server_internal.mdx | 2 +- ...core_elasticsearch_client_server_mocks.mdx | 2 +- api_docs/kbn_core_elasticsearch_server.mdx | 2 +- ...kbn_core_elasticsearch_server_internal.mdx | 2 +- .../kbn_core_elasticsearch_server_mocks.mdx | 2 +- .../kbn_core_environment_server_internal.mdx | 2 +- .../kbn_core_environment_server_mocks.mdx | 2 +- .../kbn_core_execution_context_browser.mdx | 2 +- ...ore_execution_context_browser_internal.mdx | 2 +- ...n_core_execution_context_browser_mocks.mdx | 2 +- .../kbn_core_execution_context_common.mdx | 2 +- .../kbn_core_execution_context_server.mdx | 2 +- ...core_execution_context_server_internal.mdx | 2 +- ...bn_core_execution_context_server_mocks.mdx | 2 +- api_docs/kbn_core_fatal_errors_browser.mdx | 2 +- .../kbn_core_fatal_errors_browser_mocks.mdx | 2 +- api_docs/kbn_core_http_browser.mdx | 2 +- api_docs/kbn_core_http_browser_internal.mdx | 2 +- api_docs/kbn_core_http_browser_mocks.mdx | 2 +- api_docs/kbn_core_http_common.mdx | 2 +- .../kbn_core_http_context_server_mocks.mdx | 2 +- ...re_http_request_handler_context_server.mdx | 2 +- api_docs/kbn_core_http_resources_server.mdx | 2 +- ...bn_core_http_resources_server_internal.mdx | 2 +- .../kbn_core_http_resources_server_mocks.mdx | 2 +- .../kbn_core_http_router_server_internal.mdx | 2 +- .../kbn_core_http_router_server_mocks.mdx | 2 +- api_docs/kbn_core_http_server.mdx | 2 +- api_docs/kbn_core_http_server_internal.mdx | 2 +- api_docs/kbn_core_http_server_mocks.mdx | 2 +- api_docs/kbn_core_i18n_browser.mdx | 2 +- api_docs/kbn_core_i18n_browser_mocks.mdx | 2 +- api_docs/kbn_core_i18n_server.mdx | 2 +- api_docs/kbn_core_i18n_server_internal.mdx | 2 +- api_docs/kbn_core_i18n_server_mocks.mdx | 2 +- ...n_core_injected_metadata_browser_mocks.mdx | 2 +- ...kbn_core_integrations_browser_internal.mdx | 2 +- .../kbn_core_integrations_browser_mocks.mdx | 2 +- .../kbn_core_lifecycle_browser.devdocs.json | 44 +++++ api_docs/kbn_core_lifecycle_browser.mdx | 4 +- ..._core_lifecycle_browser_mocks.devdocs.json | 42 ++++- api_docs/kbn_core_lifecycle_browser_mocks.mdx | 2 +- .../kbn_core_lifecycle_server.devdocs.json | 44 +++++ api_docs/kbn_core_lifecycle_server.mdx | 4 +- ...n_core_lifecycle_server_mocks.devdocs.json | 4 +- api_docs/kbn_core_lifecycle_server_mocks.mdx | 2 +- api_docs/kbn_core_logging_browser_mocks.mdx | 2 +- api_docs/kbn_core_logging_common_internal.mdx | 2 +- api_docs/kbn_core_logging_server.mdx | 2 +- api_docs/kbn_core_logging_server_internal.mdx | 2 +- api_docs/kbn_core_logging_server_mocks.mdx | 2 +- ...ore_metrics_collectors_server_internal.mdx | 2 +- ...n_core_metrics_collectors_server_mocks.mdx | 2 +- api_docs/kbn_core_metrics_server.mdx | 2 +- api_docs/kbn_core_metrics_server_internal.mdx | 2 +- api_docs/kbn_core_metrics_server_mocks.mdx | 2 +- api_docs/kbn_core_mount_utils_browser.mdx | 2 +- api_docs/kbn_core_node_server.mdx | 2 +- api_docs/kbn_core_node_server_internal.mdx | 2 +- api_docs/kbn_core_node_server_mocks.mdx | 2 +- api_docs/kbn_core_notifications_browser.mdx | 2 +- ...bn_core_notifications_browser_internal.mdx | 2 +- .../kbn_core_notifications_browser_mocks.mdx | 2 +- api_docs/kbn_core_overlays_browser.mdx | 2 +- .../kbn_core_overlays_browser_internal.mdx | 2 +- api_docs/kbn_core_overlays_browser_mocks.mdx | 2 +- api_docs/kbn_core_plugins_browser.mdx | 2 +- api_docs/kbn_core_plugins_browser_mocks.mdx | 2 +- api_docs/kbn_core_plugins_server.mdx | 2 +- api_docs/kbn_core_plugins_server_mocks.mdx | 2 +- api_docs/kbn_core_preboot_server.mdx | 2 +- api_docs/kbn_core_preboot_server_mocks.mdx | 2 +- api_docs/kbn_core_rendering_browser_mocks.mdx | 2 +- .../kbn_core_rendering_server_internal.mdx | 2 +- api_docs/kbn_core_rendering_server_mocks.mdx | 2 +- api_docs/kbn_core_root_server_internal.mdx | 2 +- .../kbn_core_saved_objects_api_browser.mdx | 2 +- .../kbn_core_saved_objects_api_server.mdx | 2 +- ...core_saved_objects_api_server_internal.mdx | 2 +- ...bn_core_saved_objects_api_server_mocks.mdx | 2 +- ...ore_saved_objects_base_server_internal.mdx | 2 +- ...n_core_saved_objects_base_server_mocks.mdx | 2 +- api_docs/kbn_core_saved_objects_browser.mdx | 2 +- ...bn_core_saved_objects_browser_internal.mdx | 2 +- .../kbn_core_saved_objects_browser_mocks.mdx | 2 +- api_docs/kbn_core_saved_objects_common.mdx | 2 +- ..._objects_import_export_server_internal.mdx | 2 +- ...ved_objects_import_export_server_mocks.mdx | 2 +- ...aved_objects_migration_server_internal.mdx | 2 +- ...e_saved_objects_migration_server_mocks.mdx | 2 +- api_docs/kbn_core_saved_objects_server.mdx | 2 +- ...kbn_core_saved_objects_server_internal.mdx | 2 +- .../kbn_core_saved_objects_server_mocks.mdx | 2 +- .../kbn_core_saved_objects_utils_server.mdx | 2 +- api_docs/kbn_core_status_common.mdx | 2 +- api_docs/kbn_core_status_common_internal.mdx | 2 +- api_docs/kbn_core_status_server.mdx | 2 +- api_docs/kbn_core_status_server_internal.mdx | 2 +- api_docs/kbn_core_status_server_mocks.mdx | 2 +- ...core_test_helpers_deprecations_getters.mdx | 2 +- ...st_helpers_http_setup_browser.devdocs.json | 10 +- ...n_core_test_helpers_http_setup_browser.mdx | 2 +- api_docs/kbn_core_test_helpers_kbn_server.mdx | 2 +- ...n_core_test_helpers_so_type_serializer.mdx | 2 +- api_docs/kbn_core_test_helpers_test_utils.mdx | 2 +- api_docs/kbn_core_theme_browser.mdx | 2 +- api_docs/kbn_core_theme_browser_internal.mdx | 2 +- api_docs/kbn_core_theme_browser_mocks.mdx | 2 +- api_docs/kbn_core_ui_settings_browser.mdx | 2 +- .../kbn_core_ui_settings_browser_internal.mdx | 2 +- .../kbn_core_ui_settings_browser_mocks.mdx | 2 +- api_docs/kbn_core_ui_settings_common.mdx | 2 +- api_docs/kbn_core_ui_settings_server.mdx | 2 +- .../kbn_core_ui_settings_server_internal.mdx | 2 +- .../kbn_core_ui_settings_server_mocks.mdx | 2 +- api_docs/kbn_core_usage_data_server.mdx | 2 +- .../kbn_core_usage_data_server_internal.mdx | 2 +- api_docs/kbn_core_usage_data_server_mocks.mdx | 2 +- api_docs/kbn_crypto.mdx | 2 +- api_docs/kbn_crypto_browser.mdx | 2 +- api_docs/kbn_cypress_config.mdx | 2 +- api_docs/kbn_datemath.mdx | 2 +- api_docs/kbn_dev_cli_errors.mdx | 2 +- api_docs/kbn_dev_cli_runner.mdx | 2 +- api_docs/kbn_dev_proc_runner.mdx | 2 +- api_docs/kbn_dev_utils.mdx | 2 +- api_docs/kbn_doc_links.mdx | 2 +- api_docs/kbn_docs_utils.mdx | 2 +- api_docs/kbn_ebt_tools.mdx | 2 +- api_docs/kbn_ecs.mdx | 2 +- api_docs/kbn_es.mdx | 2 +- api_docs/kbn_es_archiver.mdx | 2 +- api_docs/kbn_es_errors.mdx | 2 +- api_docs/kbn_es_query.mdx | 2 +- api_docs/kbn_es_types.mdx | 2 +- api_docs/kbn_eslint_plugin_imports.mdx | 2 +- api_docs/kbn_field_types.mdx | 2 +- api_docs/kbn_find_used_node_modules.mdx | 2 +- .../kbn_ftr_common_functional_services.mdx | 2 +- api_docs/kbn_generate.mdx | 2 +- api_docs/kbn_get_repo_files.devdocs.json | 62 +++++++ api_docs/kbn_get_repo_files.mdx | 4 +- api_docs/kbn_guided_onboarding.mdx | 2 +- api_docs/kbn_handlebars.mdx | 2 +- api_docs/kbn_hapi_mocks.mdx | 2 +- api_docs/kbn_health_gateway_server.mdx | 2 +- api_docs/kbn_home_sample_data_card.mdx | 2 +- api_docs/kbn_home_sample_data_tab.mdx | 2 +- api_docs/kbn_i18n.mdx | 2 +- api_docs/kbn_i18n_react.mdx | 2 +- api_docs/kbn_import_resolver.mdx | 2 +- api_docs/kbn_interpreter.mdx | 2 +- api_docs/kbn_io_ts_utils.mdx | 2 +- api_docs/kbn_jest_serializers.mdx | 2 +- api_docs/kbn_journeys.mdx | 2 +- api_docs/kbn_json_ast.mdx | 2 +- api_docs/kbn_kibana_manifest_schema.mdx | 2 +- .../kbn_language_documentation_popover.mdx | 2 +- api_docs/kbn_logging.mdx | 2 +- api_docs/kbn_logging_mocks.mdx | 2 +- api_docs/kbn_managed_vscode_config.mdx | 2 +- api_docs/kbn_mapbox_gl.mdx | 2 +- api_docs/kbn_ml_agg_utils.mdx | 2 +- api_docs/kbn_ml_is_defined.mdx | 2 +- api_docs/kbn_ml_is_populated_object.mdx | 2 +- api_docs/kbn_ml_local_storage.mdx | 2 +- api_docs/kbn_ml_nested_property.mdx | 2 +- api_docs/kbn_ml_string_hash.mdx | 2 +- api_docs/kbn_ml_url_state.mdx | 2 +- api_docs/kbn_monaco.mdx | 2 +- api_docs/kbn_optimizer.mdx | 2 +- api_docs/kbn_optimizer_webpack_helpers.mdx | 2 +- api_docs/kbn_osquery_io_ts_types.mdx | 2 +- ..._performance_testing_dataset_extractor.mdx | 2 +- api_docs/kbn_plugin_generator.mdx | 2 +- api_docs/kbn_plugin_helpers.mdx | 2 +- api_docs/kbn_react_field.mdx | 2 +- api_docs/kbn_repo_file_maps.mdx | 2 +- api_docs/kbn_repo_linter.mdx | 2 +- api_docs/kbn_repo_path.mdx | 2 +- api_docs/kbn_repo_source_classifier.mdx | 2 +- api_docs/kbn_rison.mdx | 2 +- api_docs/kbn_rule_data_utils.mdx | 2 +- .../kbn_securitysolution_autocomplete.mdx | 2 +- api_docs/kbn_securitysolution_es_utils.mdx | 2 +- ...ritysolution_exception_list_components.mdx | 2 +- api_docs/kbn_securitysolution_hook_utils.mdx | 2 +- ..._securitysolution_io_ts_alerting_types.mdx | 2 +- .../kbn_securitysolution_io_ts_list_types.mdx | 2 +- api_docs/kbn_securitysolution_io_ts_types.mdx | 2 +- api_docs/kbn_securitysolution_io_ts_utils.mdx | 2 +- api_docs/kbn_securitysolution_list_api.mdx | 2 +- .../kbn_securitysolution_list_constants.mdx | 2 +- api_docs/kbn_securitysolution_list_hooks.mdx | 2 +- api_docs/kbn_securitysolution_list_utils.mdx | 2 +- api_docs/kbn_securitysolution_rules.mdx | 2 +- api_docs/kbn_securitysolution_t_grid.mdx | 2 +- api_docs/kbn_securitysolution_utils.mdx | 2 +- api_docs/kbn_server_http_tools.mdx | 2 +- api_docs/kbn_server_route_repository.mdx | 2 +- api_docs/kbn_shared_svg.mdx | 2 +- api_docs/kbn_shared_ux_avatar_solution.mdx | 2 +- ...ared_ux_avatar_user_profile_components.mdx | 2 +- .../kbn_shared_ux_button_exit_full_screen.mdx | 2 +- ...hared_ux_button_exit_full_screen_mocks.mdx | 2 +- api_docs/kbn_shared_ux_button_toolbar.mdx | 2 +- api_docs/kbn_shared_ux_card_no_data.mdx | 2 +- api_docs/kbn_shared_ux_card_no_data_mocks.mdx | 2 +- api_docs/kbn_shared_ux_file_context.mdx | 2 +- api_docs/kbn_shared_ux_file_image.mdx | 2 +- api_docs/kbn_shared_ux_file_image_mocks.mdx | 2 +- api_docs/kbn_shared_ux_file_mocks.mdx | 2 +- api_docs/kbn_shared_ux_file_picker.mdx | 2 +- api_docs/kbn_shared_ux_file_upload.mdx | 2 +- api_docs/kbn_shared_ux_file_util.mdx | 2 +- api_docs/kbn_shared_ux_link_redirect_app.mdx | 2 +- .../kbn_shared_ux_link_redirect_app_mocks.mdx | 2 +- api_docs/kbn_shared_ux_markdown.mdx | 2 +- api_docs/kbn_shared_ux_markdown_mocks.mdx | 2 +- .../kbn_shared_ux_page_analytics_no_data.mdx | 2 +- ...shared_ux_page_analytics_no_data_mocks.mdx | 2 +- .../kbn_shared_ux_page_kibana_no_data.mdx | 2 +- ...bn_shared_ux_page_kibana_no_data_mocks.mdx | 2 +- .../kbn_shared_ux_page_kibana_template.mdx | 2 +- ...n_shared_ux_page_kibana_template_mocks.mdx | 2 +- api_docs/kbn_shared_ux_page_no_data.mdx | 2 +- .../kbn_shared_ux_page_no_data_config.mdx | 2 +- ...bn_shared_ux_page_no_data_config_mocks.mdx | 2 +- api_docs/kbn_shared_ux_page_no_data_mocks.mdx | 2 +- api_docs/kbn_shared_ux_page_solution_nav.mdx | 2 +- .../kbn_shared_ux_prompt_no_data_views.mdx | 2 +- ...n_shared_ux_prompt_no_data_views_mocks.mdx | 2 +- api_docs/kbn_shared_ux_prompt_not_found.mdx | 2 +- api_docs/kbn_shared_ux_router.mdx | 2 +- api_docs/kbn_shared_ux_router_mocks.mdx | 2 +- api_docs/kbn_shared_ux_storybook_config.mdx | 2 +- api_docs/kbn_shared_ux_storybook_mock.mdx | 2 +- api_docs/kbn_shared_ux_utility.mdx | 2 +- api_docs/kbn_slo_schema.mdx | 2 +- api_docs/kbn_some_dev_log.mdx | 2 +- api_docs/kbn_std.mdx | 2 +- api_docs/kbn_stdio_dev_helpers.mdx | 2 +- api_docs/kbn_storybook.mdx | 2 +- api_docs/kbn_telemetry_tools.mdx | 2 +- api_docs/kbn_test.mdx | 2 +- api_docs/kbn_test_jest_helpers.mdx | 2 +- api_docs/kbn_test_subj_selector.mdx | 2 +- api_docs/kbn_tooling_log.mdx | 2 +- api_docs/kbn_ts_projects.devdocs.json | 16 +- api_docs/kbn_ts_projects.mdx | 4 +- api_docs/kbn_typed_react_router_config.mdx | 2 +- api_docs/kbn_ui_shared_deps_src.mdx | 2 +- api_docs/kbn_ui_theme.mdx | 2 +- api_docs/kbn_user_profile_components.mdx | 2 +- api_docs/kbn_utility_types.mdx | 2 +- api_docs/kbn_utility_types_jest.mdx | 2 +- api_docs/kbn_utils.mdx | 2 +- api_docs/kbn_yarn_lock_validator.mdx | 2 +- api_docs/kibana_overview.mdx | 2 +- api_docs/kibana_react.devdocs.json | 20 +-- api_docs/kibana_react.mdx | 2 +- api_docs/kibana_utils.mdx | 2 +- api_docs/kubernetes_security.mdx | 2 +- api_docs/lens.mdx | 2 +- api_docs/license_api_guard.mdx | 2 +- api_docs/license_management.mdx | 2 +- api_docs/licensing.mdx | 2 +- api_docs/lists.mdx | 2 +- api_docs/management.mdx | 2 +- api_docs/maps.mdx | 2 +- api_docs/maps_ems.mdx | 2 +- api_docs/ml.mdx | 2 +- api_docs/monitoring.mdx | 2 +- api_docs/monitoring_collection.mdx | 2 +- api_docs/navigation.mdx | 2 +- api_docs/newsfeed.mdx | 2 +- api_docs/notifications.mdx | 2 +- api_docs/observability.mdx | 2 +- api_docs/osquery.mdx | 2 +- api_docs/plugin_directory.mdx | 27 +-- api_docs/presentation_util.mdx | 2 +- api_docs/profiling.mdx | 2 +- api_docs/remote_clusters.mdx | 2 +- api_docs/reporting.mdx | 2 +- api_docs/rollup.mdx | 2 +- api_docs/rule_registry.mdx | 2 +- api_docs/runtime_fields.mdx | 2 +- api_docs/saved_objects.mdx | 2 +- api_docs/saved_objects_finder.mdx | 2 +- api_docs/saved_objects_management.mdx | 2 +- api_docs/saved_objects_tagging.mdx | 2 +- api_docs/saved_objects_tagging_oss.mdx | 2 +- api_docs/saved_search.mdx | 2 +- api_docs/screenshot_mode.mdx | 2 +- api_docs/screenshotting.mdx | 2 +- api_docs/security.mdx | 2 +- api_docs/security_solution.mdx | 2 +- api_docs/session_view.mdx | 2 +- api_docs/share.mdx | 2 +- api_docs/snapshot_restore.mdx | 2 +- api_docs/spaces.mdx | 2 +- api_docs/stack_alerts.mdx | 2 +- api_docs/stack_connectors.mdx | 2 +- api_docs/task_manager.mdx | 2 +- api_docs/telemetry.mdx | 2 +- api_docs/telemetry_collection_manager.mdx | 2 +- api_docs/telemetry_collection_xpack.mdx | 2 +- api_docs/telemetry_management_section.mdx | 2 +- api_docs/threat_intelligence.mdx | 2 +- api_docs/timelines.mdx | 2 +- api_docs/transform.mdx | 2 +- api_docs/triggers_actions_ui.mdx | 2 +- api_docs/ui_actions.devdocs.json | 94 ++++++++++ api_docs/ui_actions.mdx | 4 +- api_docs/ui_actions_enhanced.mdx | 2 +- api_docs/unified_field_list.mdx | 2 +- api_docs/unified_histogram.mdx | 2 +- api_docs/unified_search.mdx | 2 +- api_docs/unified_search_autocomplete.mdx | 2 +- api_docs/url_forwarding.mdx | 2 +- api_docs/usage_collection.mdx | 2 +- api_docs/ux.mdx | 2 +- api_docs/vis_default_editor.mdx | 2 +- api_docs/vis_type_gauge.mdx | 2 +- api_docs/vis_type_heatmap.mdx | 2 +- api_docs/vis_type_pie.mdx | 2 +- api_docs/vis_type_table.mdx | 2 +- api_docs/vis_type_timelion.mdx | 2 +- api_docs/vis_type_timeseries.mdx | 2 +- api_docs/vis_type_vega.mdx | 2 +- api_docs/vis_type_vislib.mdx | 2 +- api_docs/vis_type_xy.mdx | 2 +- api_docs/visualizations.mdx | 2 +- 485 files changed, 2070 insertions(+), 497 deletions(-) create mode 100644 api_docs/kbn_core_custom_branding_browser.devdocs.json create mode 100644 api_docs/kbn_core_custom_branding_browser.mdx create mode 100644 api_docs/kbn_core_custom_branding_browser_internal.devdocs.json create mode 100644 api_docs/kbn_core_custom_branding_browser_internal.mdx create mode 100644 api_docs/kbn_core_custom_branding_browser_mocks.devdocs.json create mode 100644 api_docs/kbn_core_custom_branding_browser_mocks.mdx create mode 100644 api_docs/kbn_core_custom_branding_common.devdocs.json create mode 100644 api_docs/kbn_core_custom_branding_common.mdx create mode 100644 api_docs/kbn_core_custom_branding_server.devdocs.json create mode 100644 api_docs/kbn_core_custom_branding_server.mdx create mode 100644 api_docs/kbn_core_custom_branding_server_internal.devdocs.json create mode 100644 api_docs/kbn_core_custom_branding_server_internal.mdx create mode 100644 api_docs/kbn_core_custom_branding_server_mocks.devdocs.json create mode 100644 api_docs/kbn_core_custom_branding_server_mocks.mdx diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index d38314b28b56a..cd65d416b2516 100644 --- a/api_docs/actions.mdx +++ b/api_docs/actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/actions title: "actions" image: https://source.unsplash.com/400x175/?github description: API docs for the actions plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions'] --- import actionsObj from './actions.devdocs.json'; diff --git a/api_docs/advanced_settings.mdx b/api_docs/advanced_settings.mdx index da5ee1b7eca43..1c0460e350cb6 100644 --- a/api_docs/advanced_settings.mdx +++ b/api_docs/advanced_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/advancedSettings title: "advancedSettings" image: https://source.unsplash.com/400x175/?github description: API docs for the advancedSettings plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings'] --- import advancedSettingsObj from './advanced_settings.devdocs.json'; diff --git a/api_docs/aiops.mdx b/api_docs/aiops.mdx index 6a7c971e347f1..7920ce65f28d7 100644 --- a/api_docs/aiops.mdx +++ b/api_docs/aiops.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiops title: "aiops" image: https://source.unsplash.com/400x175/?github description: API docs for the aiops plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops'] --- import aiopsObj from './aiops.devdocs.json'; diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index 65d99b6a57be5..91aba2e6524f9 100644 --- a/api_docs/alerting.mdx +++ b/api_docs/alerting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/alerting title: "alerting" image: https://source.unsplash.com/400x175/?github description: API docs for the alerting plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting'] --- import alertingObj from './alerting.devdocs.json'; diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index ee82a6c104d05..a4a4e32750f73 100644 --- a/api_docs/apm.mdx +++ b/api_docs/apm.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/apm title: "apm" image: https://source.unsplash.com/400x175/?github description: API docs for the apm plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm'] --- import apmObj from './apm.devdocs.json'; diff --git a/api_docs/banners.mdx b/api_docs/banners.mdx index dd9ab76e02699..426be72c2cf0d 100644 --- a/api_docs/banners.mdx +++ b/api_docs/banners.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/banners title: "banners" image: https://source.unsplash.com/400x175/?github description: API docs for the banners plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'banners'] --- import bannersObj from './banners.devdocs.json'; diff --git a/api_docs/bfetch.mdx b/api_docs/bfetch.mdx index b3417530dbe36..ffa344f67a1db 100644 --- a/api_docs/bfetch.mdx +++ b/api_docs/bfetch.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/bfetch title: "bfetch" image: https://source.unsplash.com/400x175/?github description: API docs for the bfetch plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'bfetch'] --- import bfetchObj from './bfetch.devdocs.json'; diff --git a/api_docs/canvas.mdx b/api_docs/canvas.mdx index 2293e1ec6aea4..9d16e9dc3b87a 100644 --- a/api_docs/canvas.mdx +++ b/api_docs/canvas.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/canvas title: "canvas" image: https://source.unsplash.com/400x175/?github description: API docs for the canvas plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'canvas'] --- import canvasObj from './canvas.devdocs.json'; diff --git a/api_docs/cases.mdx b/api_docs/cases.mdx index 03640dd157d17..6923887d65519 100644 --- a/api_docs/cases.mdx +++ b/api_docs/cases.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cases title: "cases" image: https://source.unsplash.com/400x175/?github description: API docs for the cases plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases'] --- import casesObj from './cases.devdocs.json'; diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index 5e9ade15851c1..570fda61250dd 100644 --- a/api_docs/charts.mdx +++ b/api_docs/charts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/charts title: "charts" image: https://source.unsplash.com/400x175/?github description: API docs for the charts plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'charts'] --- import chartsObj from './charts.devdocs.json'; diff --git a/api_docs/cloud.mdx b/api_docs/cloud.mdx index bb14c0a3f29b9..2d6d77259d840 100644 --- a/api_docs/cloud.mdx +++ b/api_docs/cloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloud title: "cloud" image: https://source.unsplash.com/400x175/?github description: API docs for the cloud plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloud'] --- import cloudObj from './cloud.devdocs.json'; diff --git a/api_docs/cloud_chat.mdx b/api_docs/cloud_chat.mdx index 29531be48a10d..c02654a8d4a42 100644 --- a/api_docs/cloud_chat.mdx +++ b/api_docs/cloud_chat.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudChat title: "cloudChat" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudChat plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudChat'] --- import cloudChatObj from './cloud_chat.devdocs.json'; diff --git a/api_docs/cloud_data_migration.mdx b/api_docs/cloud_data_migration.mdx index 776353d2f62d1..1d63048e6461c 100644 --- a/api_docs/cloud_data_migration.mdx +++ b/api_docs/cloud_data_migration.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudDataMigration title: "cloudDataMigration" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudDataMigration plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudDataMigration'] --- import cloudDataMigrationObj from './cloud_data_migration.devdocs.json'; diff --git a/api_docs/cloud_defend.mdx b/api_docs/cloud_defend.mdx index 0c3a66a6fdf95..c6ed2c67bc0e2 100644 --- a/api_docs/cloud_defend.mdx +++ b/api_docs/cloud_defend.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudDefend title: "cloudDefend" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudDefend plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudDefend'] --- import cloudDefendObj from './cloud_defend.devdocs.json'; diff --git a/api_docs/cloud_experiments.mdx b/api_docs/cloud_experiments.mdx index f536dc3b09546..c43ab443184de 100644 --- a/api_docs/cloud_experiments.mdx +++ b/api_docs/cloud_experiments.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudExperiments title: "cloudExperiments" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudExperiments plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudExperiments'] --- import cloudExperimentsObj from './cloud_experiments.devdocs.json'; diff --git a/api_docs/cloud_security_posture.mdx b/api_docs/cloud_security_posture.mdx index be24a5c57be72..a2a6207a93f64 100644 --- a/api_docs/cloud_security_posture.mdx +++ b/api_docs/cloud_security_posture.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudSecurityPosture title: "cloudSecurityPosture" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudSecurityPosture plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudSecurityPosture'] --- import cloudSecurityPostureObj from './cloud_security_posture.devdocs.json'; diff --git a/api_docs/console.mdx b/api_docs/console.mdx index 453405c6b38bc..68a36cc307921 100644 --- a/api_docs/console.mdx +++ b/api_docs/console.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/console title: "console" image: https://source.unsplash.com/400x175/?github description: API docs for the console plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'console'] --- import consoleObj from './console.devdocs.json'; diff --git a/api_docs/controls.mdx b/api_docs/controls.mdx index a77a8e254d615..fe8b74e271e0b 100644 --- a/api_docs/controls.mdx +++ b/api_docs/controls.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/controls title: "controls" image: https://source.unsplash.com/400x175/?github description: API docs for the controls plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'controls'] --- import controlsObj from './controls.devdocs.json'; diff --git a/api_docs/core.devdocs.json b/api_docs/core.devdocs.json index 5f2c37c14594b..e83e1c5de3239 100644 --- a/api_docs/core.devdocs.json +++ b/api_docs/core.devdocs.json @@ -4495,6 +4495,28 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "core", + "id": "def-public.CoreSetup.customBranding", + "type": "Object", + "tags": [], + "label": "customBranding", + "description": [ + "{@link CustomBrandingSetup}" + ], + "signature": [ + { + "pluginId": "@kbn/core-custom-branding-browser", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingBrowserPluginApi", + "section": "def-common.CustomBrandingSetup", + "text": "CustomBrandingSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "core", "id": "def-public.CoreSetup.fatalErrors", @@ -4771,6 +4793,28 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "core", + "id": "def-public.CoreStart.customBranding", + "type": "Object", + "tags": [], + "label": "customBranding", + "description": [ + "{@link CustomBrandingStart}" + ], + "signature": [ + { + "pluginId": "@kbn/core-custom-branding-browser", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingBrowserPluginApi", + "section": "def-common.CustomBrandingStart", + "text": "CustomBrandingStart" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "core", "id": "def-public.CoreStart.docLinks", @@ -25606,6 +25650,28 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "core", + "id": "def-server.CoreSetup.customBranding", + "type": "Object", + "tags": [], + "label": "customBranding", + "description": [ + "{@link CustomBrandingSetup}" + ], + "signature": [ + { + "pluginId": "@kbn/core-custom-branding-server", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingServerPluginApi", + "section": "def-common.CustomBrandingSetup", + "text": "CustomBrandingSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "core", "id": "def-server.CoreSetup.docLinks", @@ -25963,6 +26029,28 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "core", + "id": "def-server.CoreStart.customBranding", + "type": "Object", + "tags": [], + "label": "customBranding", + "description": [ + "{@link CustomBrandingStart}" + ], + "signature": [ + { + "pluginId": "@kbn/core-custom-branding-server", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingServerPluginApi", + "section": "def-common.CustomBrandingStart", + "text": "CustomBrandingStart" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "core", "id": "def-server.CoreStart.docLinks", diff --git a/api_docs/core.mdx b/api_docs/core.mdx index 72e36c749e449..963a33d84b02b 100644 --- a/api_docs/core.mdx +++ b/api_docs/core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/core title: "core" image: https://source.unsplash.com/400x175/?github description: API docs for the core plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core'] --- import coreObj from './core.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2818 | 17 | 1018 | 0 | +| 2822 | 17 | 1018 | 0 | ## Client diff --git a/api_docs/custom_integrations.mdx b/api_docs/custom_integrations.mdx index 5577fd0a1d0d6..dc5d65f21e3b5 100644 --- a/api_docs/custom_integrations.mdx +++ b/api_docs/custom_integrations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/customIntegrations title: "customIntegrations" image: https://source.unsplash.com/400x175/?github description: API docs for the customIntegrations plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'customIntegrations'] --- import customIntegrationsObj from './custom_integrations.devdocs.json'; diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index 7f35790413ac9..5129d9caf2898 100644 --- a/api_docs/dashboard.mdx +++ b/api_docs/dashboard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboard title: "dashboard" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboard plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboard'] --- import dashboardObj from './dashboard.devdocs.json'; diff --git a/api_docs/dashboard_enhanced.mdx b/api_docs/dashboard_enhanced.mdx index 63112528cd062..ea4b105088d64 100644 --- a/api_docs/dashboard_enhanced.mdx +++ b/api_docs/dashboard_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboardEnhanced title: "dashboardEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboardEnhanced plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboardEnhanced'] --- import dashboardEnhancedObj from './dashboard_enhanced.devdocs.json'; diff --git a/api_docs/data.mdx b/api_docs/data.mdx index 0126c7c8407ad..5231cc1c2f068 100644 --- a/api_docs/data.mdx +++ b/api_docs/data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data title: "data" image: https://source.unsplash.com/400x175/?github description: API docs for the data plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data'] --- import dataObj from './data.devdocs.json'; diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index 33e91d540c8b0..9f21f69b52dbb 100644 --- a/api_docs/data_query.mdx +++ b/api_docs/data_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-query title: "data.query" image: https://source.unsplash.com/400x175/?github description: API docs for the data.query plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.query'] --- import dataQueryObj from './data_query.devdocs.json'; diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index 39af0cdd0b399..452946bcf4c1d 100644 --- a/api_docs/data_search.mdx +++ b/api_docs/data_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-search title: "data.search" image: https://source.unsplash.com/400x175/?github description: API docs for the data.search plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.search'] --- import dataSearchObj from './data_search.devdocs.json'; diff --git a/api_docs/data_view_editor.mdx b/api_docs/data_view_editor.mdx index dc082712dde78..7ed52adf064c9 100644 --- a/api_docs/data_view_editor.mdx +++ b/api_docs/data_view_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewEditor title: "dataViewEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewEditor plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewEditor'] --- import dataViewEditorObj from './data_view_editor.devdocs.json'; diff --git a/api_docs/data_view_field_editor.mdx b/api_docs/data_view_field_editor.mdx index 037d3a302c99e..da6c783c5d4f7 100644 --- a/api_docs/data_view_field_editor.mdx +++ b/api_docs/data_view_field_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewFieldEditor title: "dataViewFieldEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewFieldEditor plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewFieldEditor'] --- import dataViewFieldEditorObj from './data_view_field_editor.devdocs.json'; diff --git a/api_docs/data_view_management.mdx b/api_docs/data_view_management.mdx index c59a546b54348..01ccfbee68d5a 100644 --- a/api_docs/data_view_management.mdx +++ b/api_docs/data_view_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewManagement title: "dataViewManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewManagement plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewManagement'] --- import dataViewManagementObj from './data_view_management.devdocs.json'; diff --git a/api_docs/data_views.mdx b/api_docs/data_views.mdx index f6214b3e272a9..dc014d18e681a 100644 --- a/api_docs/data_views.mdx +++ b/api_docs/data_views.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViews title: "dataViews" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViews plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViews'] --- import dataViewsObj from './data_views.devdocs.json'; diff --git a/api_docs/data_visualizer.mdx b/api_docs/data_visualizer.mdx index e5802922bad99..7d068b33bea0d 100644 --- a/api_docs/data_visualizer.mdx +++ b/api_docs/data_visualizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataVisualizer title: "dataVisualizer" image: https://source.unsplash.com/400x175/?github description: API docs for the dataVisualizer plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataVisualizer'] --- import dataVisualizerObj from './data_visualizer.devdocs.json'; diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index bdbf371b53ec3..0c7a12c90e406 100644 --- a/api_docs/deprecations_by_api.mdx +++ b/api_docs/deprecations_by_api.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByApi slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-api title: Deprecated API usage by API description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -70,7 +70,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | spaces, savedObjectsManagement | - | | | spaces, savedObjectsManagement | - | | | spaces, savedObjectsManagement | - | -| | home, spaces, ml, canvas, osquery | - | +| | home, ml, canvas, osquery | - | | | actions, ml, savedObjectsTagging, enterpriseSearch | - | | | canvas | - | | | canvas | - | diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index 85dda11f84128..83aedb79bd1fe 100644 --- a/api_docs/deprecations_by_plugin.mdx +++ b/api_docs/deprecations_by_plugin.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByPlugin slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-plugin title: Deprecated API usage by plugin description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -944,7 +944,6 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [space_selector.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/public/space_selector/space_selector.tsx#:~:text=KibanaPageTemplate), [space_selector.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/public/space_selector/space_selector.tsx#:~:text=KibanaPageTemplate), [space_selector.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/public/space_selector/space_selector.tsx#:~:text=KibanaPageTemplate) | - | | | [spaces_management_app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/public/management/spaces_management_app.tsx#:~:text=RedirectAppLinks), [spaces_management_app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/public/management/spaces_management_app.tsx#:~:text=RedirectAppLinks), [spaces_management_app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/public/management/spaces_management_app.tsx#:~:text=RedirectAppLinks) | - | | | [on_post_auth_interceptor.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/server/lib/request_interceptors/on_post_auth_interceptor.ts#:~:text=getKibanaFeatures), [spaces_usage_collector.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts#:~:text=getKibanaFeatures), [on_post_auth_interceptor.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/server/lib/request_interceptors/on_post_auth_interceptor.test.ts#:~:text=getKibanaFeatures) | 8.8.0 | | | [spaces_usage_collector.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts#:~:text=license%24), [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/server/plugin.ts#:~:text=license%24), [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/server/plugin.ts#:~:text=license%24), [spaces_usage_collector.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.test.ts#:~:text=license%24) | 8.8.0 | @@ -975,7 +974,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | | [filter_group.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/filter_group/filter_group.tsx#:~:text=title), [filters_expression_select.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx#:~:text=title), [filter_group.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/filter_group/filter_group.tsx#:~:text=title), [filters_expression_select.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx#:~:text=title) | - | | | [filter_group.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/filter_group/filter_group.tsx#:~:text=title), [filters_expression_select.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx#:~:text=title), [filter_group.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/filter_group/filter_group.tsx#:~:text=title), [filters_expression_select.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx#:~:text=title) | - | | | [filter_group.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/filter_group/filter_group.tsx#:~:text=title), [filters_expression_select.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx#:~:text=title) | - | -| | [stderr_logs.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/stderr_logs.tsx#:~:text=indexPatternId) | - | +| | [stderr_logs.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/stderr_logs.tsx#:~:text=indexPatternId), [stderr_logs.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/apps/synthetics/components/common/components/stderr_logs.tsx#:~:text=indexPatternId) | - | | | [alert_messages.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/alert_messages.tsx#:~:text=RedirectAppLinks), [alert_messages.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/alert_messages.tsx#:~:text=RedirectAppLinks), [alert_messages.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/alert_messages.tsx#:~:text=RedirectAppLinks), [uptime_app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/app/uptime_app.tsx#:~:text=RedirectAppLinks), [uptime_app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/app/uptime_app.tsx#:~:text=RedirectAppLinks), [uptime_app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/legacy_uptime/app/uptime_app.tsx#:~:text=RedirectAppLinks), [synthetics_app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/apps/synthetics/synthetics_app.tsx#:~:text=RedirectAppLinks), [synthetics_app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/apps/synthetics/synthetics_app.tsx#:~:text=RedirectAppLinks), [synthetics_app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/synthetics/public/apps/synthetics/synthetics_app.tsx#:~:text=RedirectAppLinks) | - | diff --git a/api_docs/deprecations_by_team.mdx b/api_docs/deprecations_by_team.mdx index 45437e923bb7c..faa42034ab0df 100644 --- a/api_docs/deprecations_by_team.mdx +++ b/api_docs/deprecations_by_team.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsDueByTeam slug: /kibana-dev-docs/api-meta/deprecations-due-by-team title: Deprecated APIs due to be removed, by team description: Lists the teams that are referencing deprecated APIs with a remove by date. -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index 2de56e0f31aa3..fee35c390140e 100644 --- a/api_docs/dev_tools.mdx +++ b/api_docs/dev_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/devTools title: "devTools" image: https://source.unsplash.com/400x175/?github description: API docs for the devTools plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'devTools'] --- import devToolsObj from './dev_tools.devdocs.json'; diff --git a/api_docs/discover.devdocs.json b/api_docs/discover.devdocs.json index af684dd0a989d..438a91e5d2171 100644 --- a/api_docs/discover.devdocs.json +++ b/api_docs/discover.devdocs.json @@ -1489,6 +1489,10 @@ { "plugin": "synthetics", "path": "x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/stderr_logs.tsx" + }, + { + "plugin": "synthetics", + "path": "x-pack/plugins/synthetics/public/apps/synthetics/components/common/components/stderr_logs.tsx" } ] }, diff --git a/api_docs/discover.mdx b/api_docs/discover.mdx index 8d8a505a5586f..bcb1212df3401 100644 --- a/api_docs/discover.mdx +++ b/api_docs/discover.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discover title: "discover" image: https://source.unsplash.com/400x175/?github description: API docs for the discover plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discover'] --- import discoverObj from './discover.devdocs.json'; diff --git a/api_docs/discover_enhanced.mdx b/api_docs/discover_enhanced.mdx index cebea0b8d2b71..26bd039833ebc 100644 --- a/api_docs/discover_enhanced.mdx +++ b/api_docs/discover_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discoverEnhanced title: "discoverEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the discoverEnhanced plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discoverEnhanced'] --- import discoverEnhancedObj from './discover_enhanced.devdocs.json'; diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index 4d795a01d4aa4..08628420161f3 100644 --- a/api_docs/embeddable.mdx +++ b/api_docs/embeddable.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddable title: "embeddable" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddable plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddable'] --- import embeddableObj from './embeddable.devdocs.json'; diff --git a/api_docs/embeddable_enhanced.mdx b/api_docs/embeddable_enhanced.mdx index 6a05c6fdf541e..9f2f26688b4fe 100644 --- a/api_docs/embeddable_enhanced.mdx +++ b/api_docs/embeddable_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddableEnhanced title: "embeddableEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddableEnhanced plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddableEnhanced'] --- import embeddableEnhancedObj from './embeddable_enhanced.devdocs.json'; diff --git a/api_docs/encrypted_saved_objects.mdx b/api_docs/encrypted_saved_objects.mdx index e6a05c5ecdef8..36937accd7204 100644 --- a/api_docs/encrypted_saved_objects.mdx +++ b/api_docs/encrypted_saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/encryptedSavedObjects title: "encryptedSavedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the encryptedSavedObjects plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'encryptedSavedObjects'] --- import encryptedSavedObjectsObj from './encrypted_saved_objects.devdocs.json'; diff --git a/api_docs/enterprise_search.mdx b/api_docs/enterprise_search.mdx index 4a1f6aaeee032..58f7378f5fbf8 100644 --- a/api_docs/enterprise_search.mdx +++ b/api_docs/enterprise_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/enterpriseSearch title: "enterpriseSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the enterpriseSearch plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'enterpriseSearch'] --- import enterpriseSearchObj from './enterprise_search.devdocs.json'; diff --git a/api_docs/es_ui_shared.mdx b/api_docs/es_ui_shared.mdx index d484bea09a97d..99242dc123b22 100644 --- a/api_docs/es_ui_shared.mdx +++ b/api_docs/es_ui_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/esUiShared title: "esUiShared" image: https://source.unsplash.com/400x175/?github description: API docs for the esUiShared plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esUiShared'] --- import esUiSharedObj from './es_ui_shared.devdocs.json'; diff --git a/api_docs/event_annotation.mdx b/api_docs/event_annotation.mdx index e10edd6eae6c1..d3374b84d909e 100644 --- a/api_docs/event_annotation.mdx +++ b/api_docs/event_annotation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventAnnotation title: "eventAnnotation" image: https://source.unsplash.com/400x175/?github description: API docs for the eventAnnotation plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotation'] --- import eventAnnotationObj from './event_annotation.devdocs.json'; diff --git a/api_docs/event_log.mdx b/api_docs/event_log.mdx index 7aa71a6b63137..9ce66717183ff 100644 --- a/api_docs/event_log.mdx +++ b/api_docs/event_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventLog title: "eventLog" image: https://source.unsplash.com/400x175/?github description: API docs for the eventLog plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventLog'] --- import eventLogObj from './event_log.devdocs.json'; diff --git a/api_docs/expression_error.mdx b/api_docs/expression_error.mdx index a5dec9b80b664..8c65703a4df67 100644 --- a/api_docs/expression_error.mdx +++ b/api_docs/expression_error.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionError title: "expressionError" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionError plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionError'] --- import expressionErrorObj from './expression_error.devdocs.json'; diff --git a/api_docs/expression_gauge.mdx b/api_docs/expression_gauge.mdx index e2df912d27e98..bf4342896146e 100644 --- a/api_docs/expression_gauge.mdx +++ b/api_docs/expression_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionGauge title: "expressionGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionGauge plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionGauge'] --- import expressionGaugeObj from './expression_gauge.devdocs.json'; diff --git a/api_docs/expression_heatmap.mdx b/api_docs/expression_heatmap.mdx index 2ab887c8c86f2..75f9c001077b7 100644 --- a/api_docs/expression_heatmap.mdx +++ b/api_docs/expression_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionHeatmap title: "expressionHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionHeatmap plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionHeatmap'] --- import expressionHeatmapObj from './expression_heatmap.devdocs.json'; diff --git a/api_docs/expression_image.mdx b/api_docs/expression_image.mdx index 9c710b1bc876c..7135745d37cd1 100644 --- a/api_docs/expression_image.mdx +++ b/api_docs/expression_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionImage title: "expressionImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionImage plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionImage'] --- import expressionImageObj from './expression_image.devdocs.json'; diff --git a/api_docs/expression_legacy_metric_vis.mdx b/api_docs/expression_legacy_metric_vis.mdx index d0563c73a340f..4e169effe5c20 100644 --- a/api_docs/expression_legacy_metric_vis.mdx +++ b/api_docs/expression_legacy_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionLegacyMetricVis title: "expressionLegacyMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionLegacyMetricVis plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionLegacyMetricVis'] --- import expressionLegacyMetricVisObj from './expression_legacy_metric_vis.devdocs.json'; diff --git a/api_docs/expression_metric.mdx b/api_docs/expression_metric.mdx index bbfe8b100ca8c..261cd11d69c0f 100644 --- a/api_docs/expression_metric.mdx +++ b/api_docs/expression_metric.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetric title: "expressionMetric" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetric plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetric'] --- import expressionMetricObj from './expression_metric.devdocs.json'; diff --git a/api_docs/expression_metric_vis.mdx b/api_docs/expression_metric_vis.mdx index 42937c28cf015..4e3cfa7112d0a 100644 --- a/api_docs/expression_metric_vis.mdx +++ b/api_docs/expression_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetricVis title: "expressionMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetricVis plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetricVis'] --- import expressionMetricVisObj from './expression_metric_vis.devdocs.json'; diff --git a/api_docs/expression_partition_vis.mdx b/api_docs/expression_partition_vis.mdx index 1bc4ba095234e..b8f4afd9f8d86 100644 --- a/api_docs/expression_partition_vis.mdx +++ b/api_docs/expression_partition_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionPartitionVis title: "expressionPartitionVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionPartitionVis plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionPartitionVis'] --- import expressionPartitionVisObj from './expression_partition_vis.devdocs.json'; diff --git a/api_docs/expression_repeat_image.mdx b/api_docs/expression_repeat_image.mdx index 52bf3022c24d0..326bae0b549a3 100644 --- a/api_docs/expression_repeat_image.mdx +++ b/api_docs/expression_repeat_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRepeatImage title: "expressionRepeatImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRepeatImage plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRepeatImage'] --- import expressionRepeatImageObj from './expression_repeat_image.devdocs.json'; diff --git a/api_docs/expression_reveal_image.mdx b/api_docs/expression_reveal_image.mdx index e0e5cd7e71bf5..d82f23f80a498 100644 --- a/api_docs/expression_reveal_image.mdx +++ b/api_docs/expression_reveal_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRevealImage title: "expressionRevealImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRevealImage plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRevealImage'] --- import expressionRevealImageObj from './expression_reveal_image.devdocs.json'; diff --git a/api_docs/expression_shape.mdx b/api_docs/expression_shape.mdx index 99cd5db7bdf4f..ebda2b8d0aaaf 100644 --- a/api_docs/expression_shape.mdx +++ b/api_docs/expression_shape.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionShape title: "expressionShape" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionShape plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionShape'] --- import expressionShapeObj from './expression_shape.devdocs.json'; diff --git a/api_docs/expression_tagcloud.mdx b/api_docs/expression_tagcloud.mdx index f8e87b6ce3751..c076ec1d9db02 100644 --- a/api_docs/expression_tagcloud.mdx +++ b/api_docs/expression_tagcloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionTagcloud title: "expressionTagcloud" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionTagcloud plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionTagcloud'] --- import expressionTagcloudObj from './expression_tagcloud.devdocs.json'; diff --git a/api_docs/expression_x_y.mdx b/api_docs/expression_x_y.mdx index 54e8f99689df2..4787e256ed67d 100644 --- a/api_docs/expression_x_y.mdx +++ b/api_docs/expression_x_y.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionXY title: "expressionXY" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionXY plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionXY'] --- import expressionXYObj from './expression_x_y.devdocs.json'; diff --git a/api_docs/expressions.mdx b/api_docs/expressions.mdx index 288a0c94deba8..0e83e6b3181cf 100644 --- a/api_docs/expressions.mdx +++ b/api_docs/expressions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressions title: "expressions" image: https://source.unsplash.com/400x175/?github description: API docs for the expressions plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressions'] --- import expressionsObj from './expressions.devdocs.json'; diff --git a/api_docs/features.mdx b/api_docs/features.mdx index 3049cbbcbf23d..5b39f6e43ba66 100644 --- a/api_docs/features.mdx +++ b/api_docs/features.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/features title: "features" image: https://source.unsplash.com/400x175/?github description: API docs for the features plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'features'] --- import featuresObj from './features.devdocs.json'; diff --git a/api_docs/field_formats.mdx b/api_docs/field_formats.mdx index 35236ce5ffd98..efd72d485b909 100644 --- a/api_docs/field_formats.mdx +++ b/api_docs/field_formats.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fieldFormats title: "fieldFormats" image: https://source.unsplash.com/400x175/?github description: API docs for the fieldFormats plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldFormats'] --- import fieldFormatsObj from './field_formats.devdocs.json'; diff --git a/api_docs/file_upload.mdx b/api_docs/file_upload.mdx index 95839090b11b6..7e706976f4f42 100644 --- a/api_docs/file_upload.mdx +++ b/api_docs/file_upload.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fileUpload title: "fileUpload" image: https://source.unsplash.com/400x175/?github description: API docs for the fileUpload plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fileUpload'] --- import fileUploadObj from './file_upload.devdocs.json'; diff --git a/api_docs/files.mdx b/api_docs/files.mdx index 3a05cc363e4c7..5f1d6cd58a6d2 100644 --- a/api_docs/files.mdx +++ b/api_docs/files.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/files title: "files" image: https://source.unsplash.com/400x175/?github description: API docs for the files plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'files'] --- import filesObj from './files.devdocs.json'; diff --git a/api_docs/files_management.mdx b/api_docs/files_management.mdx index e64a8ab367122..0f5c043b65080 100644 --- a/api_docs/files_management.mdx +++ b/api_docs/files_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/filesManagement title: "filesManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the filesManagement plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'filesManagement'] --- import filesManagementObj from './files_management.devdocs.json'; diff --git a/api_docs/fleet.devdocs.json b/api_docs/fleet.devdocs.json index 29d4d9411e1fb..9cd8b5fccaf31 100644 --- a/api_docs/fleet.devdocs.json +++ b/api_docs/fleet.devdocs.json @@ -8295,6 +8295,47 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "fleet", + "id": "def-server.PostPackagePolicyDeleteCallback", + "type": "Type", + "tags": [], + "label": "PostPackagePolicyDeleteCallback", + "description": [], + "signature": [ + "(packagePolicies: ", + "DeletePackagePoliciesResponse", + ") => Promise" + ], + "path": "x-pack/plugins/fleet/server/types/extensions.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PostPackagePolicyDeleteCallback.$1", + "type": "Array", + "tags": [], + "label": "packagePolicies", + "description": [], + "signature": [ + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.PackagePolicy", + "text": "PackagePolicy" + }, + "[]" + ], + "path": "x-pack/plugins/fleet/server/types/extensions.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "fleet", "id": "def-server.PostPackagePolicyPostCreateCallback", diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index 2a8536222fc35..5f8c88c8841ce 100644 --- a/api_docs/fleet.mdx +++ b/api_docs/fleet.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fleet title: "fleet" image: https://source.unsplash.com/400x175/?github description: API docs for the fleet plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fleet'] --- import fleetObj from './fleet.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Fleet](https://github.com/orgs/elastic/teams/fleet) for questions regar | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 1035 | 3 | 929 | 23 | +| 1037 | 3 | 931 | 23 | ## Client diff --git a/api_docs/global_search.mdx b/api_docs/global_search.mdx index bc9ee089cea46..ac3be52199bef 100644 --- a/api_docs/global_search.mdx +++ b/api_docs/global_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/globalSearch title: "globalSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the globalSearch plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'globalSearch'] --- import globalSearchObj from './global_search.devdocs.json'; diff --git a/api_docs/guided_onboarding.mdx b/api_docs/guided_onboarding.mdx index a40767c4651a8..57a46f743a44d 100644 --- a/api_docs/guided_onboarding.mdx +++ b/api_docs/guided_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/guidedOnboarding title: "guidedOnboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the guidedOnboarding plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'guidedOnboarding'] --- import guidedOnboardingObj from './guided_onboarding.devdocs.json'; diff --git a/api_docs/home.mdx b/api_docs/home.mdx index 9ac4f5339a02f..a64fbc91478d5 100644 --- a/api_docs/home.mdx +++ b/api_docs/home.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/home title: "home" image: https://source.unsplash.com/400x175/?github description: API docs for the home plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'home'] --- import homeObj from './home.devdocs.json'; diff --git a/api_docs/image_embeddable.mdx b/api_docs/image_embeddable.mdx index ad0c51ffc26b7..ed8b7dd0d3200 100644 --- a/api_docs/image_embeddable.mdx +++ b/api_docs/image_embeddable.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/imageEmbeddable title: "imageEmbeddable" image: https://source.unsplash.com/400x175/?github description: API docs for the imageEmbeddable plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'imageEmbeddable'] --- import imageEmbeddableObj from './image_embeddable.devdocs.json'; diff --git a/api_docs/index_lifecycle_management.mdx b/api_docs/index_lifecycle_management.mdx index 777f0d7bf4049..998c00b65e45f 100644 --- a/api_docs/index_lifecycle_management.mdx +++ b/api_docs/index_lifecycle_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexLifecycleManagement title: "indexLifecycleManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexLifecycleManagement plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexLifecycleManagement'] --- import indexLifecycleManagementObj from './index_lifecycle_management.devdocs.json'; diff --git a/api_docs/index_management.mdx b/api_docs/index_management.mdx index ee216a49303f6..8992deef139a6 100644 --- a/api_docs/index_management.mdx +++ b/api_docs/index_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexManagement title: "indexManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexManagement plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexManagement'] --- import indexManagementObj from './index_management.devdocs.json'; diff --git a/api_docs/infra.mdx b/api_docs/infra.mdx index 83eabee752a90..ddd22713180dc 100644 --- a/api_docs/infra.mdx +++ b/api_docs/infra.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/infra title: "infra" image: https://source.unsplash.com/400x175/?github description: API docs for the infra plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'infra'] --- import infraObj from './infra.devdocs.json'; diff --git a/api_docs/inspector.mdx b/api_docs/inspector.mdx index e75c374f2d6bb..4c8b91f88c321 100644 --- a/api_docs/inspector.mdx +++ b/api_docs/inspector.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/inspector title: "inspector" image: https://source.unsplash.com/400x175/?github description: API docs for the inspector plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inspector'] --- import inspectorObj from './inspector.devdocs.json'; diff --git a/api_docs/interactive_setup.mdx b/api_docs/interactive_setup.mdx index 7639af18c0735..066fcb403c6a6 100644 --- a/api_docs/interactive_setup.mdx +++ b/api_docs/interactive_setup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/interactiveSetup title: "interactiveSetup" image: https://source.unsplash.com/400x175/?github description: API docs for the interactiveSetup plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'interactiveSetup'] --- import interactiveSetupObj from './interactive_setup.devdocs.json'; diff --git a/api_docs/kbn_ace.mdx b/api_docs/kbn_ace.mdx index 76a7f147c5a2d..673d4e99fc5e0 100644 --- a/api_docs/kbn_ace.mdx +++ b/api_docs/kbn_ace.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ace title: "@kbn/ace" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ace plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ace'] --- import kbnAceObj from './kbn_ace.devdocs.json'; diff --git a/api_docs/kbn_aiops_components.mdx b/api_docs/kbn_aiops_components.mdx index e1479c86b6eb1..9389f85a9a022 100644 --- a/api_docs/kbn_aiops_components.mdx +++ b/api_docs/kbn_aiops_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-components title: "@kbn/aiops-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-components plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-components'] --- import kbnAiopsComponentsObj from './kbn_aiops_components.devdocs.json'; diff --git a/api_docs/kbn_aiops_utils.mdx b/api_docs/kbn_aiops_utils.mdx index 9cc0e9edb4f88..2915ea24bfc5a 100644 --- a/api_docs/kbn_aiops_utils.mdx +++ b/api_docs/kbn_aiops_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-utils title: "@kbn/aiops-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-utils plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-utils'] --- import kbnAiopsUtilsObj from './kbn_aiops_utils.devdocs.json'; diff --git a/api_docs/kbn_alerts.mdx b/api_docs/kbn_alerts.mdx index b55a3333851b6..0beedba67d271 100644 --- a/api_docs/kbn_alerts.mdx +++ b/api_docs/kbn_alerts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerts title: "@kbn/alerts" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerts plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts'] --- import kbnAlertsObj from './kbn_alerts.devdocs.json'; diff --git a/api_docs/kbn_analytics.mdx b/api_docs/kbn_analytics.mdx index c54d649db5712..e8bfd5be851f3 100644 --- a/api_docs/kbn_analytics.mdx +++ b/api_docs/kbn_analytics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics title: "@kbn/analytics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics'] --- import kbnAnalyticsObj from './kbn_analytics.devdocs.json'; diff --git a/api_docs/kbn_analytics_client.mdx b/api_docs/kbn_analytics_client.mdx index 9b0c416e77f72..0ab23a1583398 100644 --- a/api_docs/kbn_analytics_client.mdx +++ b/api_docs/kbn_analytics_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-client title: "@kbn/analytics-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-client plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-client'] --- import kbnAnalyticsClientObj from './kbn_analytics_client.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx index b7a3914d5e8b4..e0dfe97501f1b 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-browser title: "@kbn/analytics-shippers-elastic-v3-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-browser'] --- import kbnAnalyticsShippersElasticV3BrowserObj from './kbn_analytics_shippers_elastic_v3_browser.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx index acb68d03e047b..71d5a5d4416fd 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-common title: "@kbn/analytics-shippers-elastic-v3-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-common plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-common'] --- import kbnAnalyticsShippersElasticV3CommonObj from './kbn_analytics_shippers_elastic_v3_common.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx index 146e7ca211722..eaf1a026182f9 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-server title: "@kbn/analytics-shippers-elastic-v3-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-server'] --- import kbnAnalyticsShippersElasticV3ServerObj from './kbn_analytics_shippers_elastic_v3_server.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_fullstory.mdx b/api_docs/kbn_analytics_shippers_fullstory.mdx index 95aeac29dc2c5..bd6a734102c3b 100644 --- a/api_docs/kbn_analytics_shippers_fullstory.mdx +++ b/api_docs/kbn_analytics_shippers_fullstory.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-fullstory title: "@kbn/analytics-shippers-fullstory" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-fullstory plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-fullstory'] --- import kbnAnalyticsShippersFullstoryObj from './kbn_analytics_shippers_fullstory.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_gainsight.mdx b/api_docs/kbn_analytics_shippers_gainsight.mdx index 9d389c31e41fb..e0d43b1f2ad66 100644 --- a/api_docs/kbn_analytics_shippers_gainsight.mdx +++ b/api_docs/kbn_analytics_shippers_gainsight.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-gainsight title: "@kbn/analytics-shippers-gainsight" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-gainsight plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-gainsight'] --- import kbnAnalyticsShippersGainsightObj from './kbn_analytics_shippers_gainsight.devdocs.json'; diff --git a/api_docs/kbn_apm_config_loader.mdx b/api_docs/kbn_apm_config_loader.mdx index 9dbdc6cde557e..16a0bac49a0e2 100644 --- a/api_docs/kbn_apm_config_loader.mdx +++ b/api_docs/kbn_apm_config_loader.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-config-loader title: "@kbn/apm-config-loader" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-config-loader plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-config-loader'] --- import kbnApmConfigLoaderObj from './kbn_apm_config_loader.devdocs.json'; diff --git a/api_docs/kbn_apm_synthtrace.mdx b/api_docs/kbn_apm_synthtrace.mdx index 96abcb2acf4aa..fb467047ff599 100644 --- a/api_docs/kbn_apm_synthtrace.mdx +++ b/api_docs/kbn_apm_synthtrace.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-synthtrace title: "@kbn/apm-synthtrace" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-synthtrace plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace'] --- import kbnApmSynthtraceObj from './kbn_apm_synthtrace.devdocs.json'; diff --git a/api_docs/kbn_apm_synthtrace_client.mdx b/api_docs/kbn_apm_synthtrace_client.mdx index 48a7e841c4305..394fc861cce3b 100644 --- a/api_docs/kbn_apm_synthtrace_client.mdx +++ b/api_docs/kbn_apm_synthtrace_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-synthtrace-client title: "@kbn/apm-synthtrace-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-synthtrace-client plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace-client'] --- import kbnApmSynthtraceClientObj from './kbn_apm_synthtrace_client.devdocs.json'; diff --git a/api_docs/kbn_apm_utils.mdx b/api_docs/kbn_apm_utils.mdx index 127798752d693..a6b10609ddfb6 100644 --- a/api_docs/kbn_apm_utils.mdx +++ b/api_docs/kbn_apm_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-utils title: "@kbn/apm-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-utils plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-utils'] --- import kbnApmUtilsObj from './kbn_apm_utils.devdocs.json'; diff --git a/api_docs/kbn_axe_config.mdx b/api_docs/kbn_axe_config.mdx index 5bbc26e0a8113..c3e39398d97d7 100644 --- a/api_docs/kbn_axe_config.mdx +++ b/api_docs/kbn_axe_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-axe-config title: "@kbn/axe-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/axe-config plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/axe-config'] --- import kbnAxeConfigObj from './kbn_axe_config.devdocs.json'; diff --git a/api_docs/kbn_cases_components.mdx b/api_docs/kbn_cases_components.mdx index 81cfb9e3e90fd..9348dd1d08774 100644 --- a/api_docs/kbn_cases_components.mdx +++ b/api_docs/kbn_cases_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cases-components title: "@kbn/cases-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cases-components plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cases-components'] --- import kbnCasesComponentsObj from './kbn_cases_components.devdocs.json'; diff --git a/api_docs/kbn_chart_icons.mdx b/api_docs/kbn_chart_icons.mdx index 5d374cce00bb6..4297d32905dd4 100644 --- a/api_docs/kbn_chart_icons.mdx +++ b/api_docs/kbn_chart_icons.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-chart-icons title: "@kbn/chart-icons" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/chart-icons plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/chart-icons'] --- import kbnChartIconsObj from './kbn_chart_icons.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_core.mdx b/api_docs/kbn_ci_stats_core.mdx index 3c25e1a85b5ee..1b1d0655875a9 100644 --- a/api_docs/kbn_ci_stats_core.mdx +++ b/api_docs/kbn_ci_stats_core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-core title: "@kbn/ci-stats-core" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-core plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-core'] --- import kbnCiStatsCoreObj from './kbn_ci_stats_core.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_performance_metrics.mdx b/api_docs/kbn_ci_stats_performance_metrics.mdx index b339a51fa2d5c..390ee30a5d919 100644 --- a/api_docs/kbn_ci_stats_performance_metrics.mdx +++ b/api_docs/kbn_ci_stats_performance_metrics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-performance-metrics title: "@kbn/ci-stats-performance-metrics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-performance-metrics plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-performance-metrics'] --- import kbnCiStatsPerformanceMetricsObj from './kbn_ci_stats_performance_metrics.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_reporter.mdx b/api_docs/kbn_ci_stats_reporter.mdx index 4e3ddf7418c20..f764935fe57ad 100644 --- a/api_docs/kbn_ci_stats_reporter.mdx +++ b/api_docs/kbn_ci_stats_reporter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-reporter title: "@kbn/ci-stats-reporter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-reporter plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-reporter'] --- import kbnCiStatsReporterObj from './kbn_ci_stats_reporter.devdocs.json'; diff --git a/api_docs/kbn_cli_dev_mode.mdx b/api_docs/kbn_cli_dev_mode.mdx index fb69ca734d42f..39ac02e2445f8 100644 --- a/api_docs/kbn_cli_dev_mode.mdx +++ b/api_docs/kbn_cli_dev_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cli-dev-mode title: "@kbn/cli-dev-mode" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cli-dev-mode plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cli-dev-mode'] --- import kbnCliDevModeObj from './kbn_cli_dev_mode.devdocs.json'; diff --git a/api_docs/kbn_coloring.mdx b/api_docs/kbn_coloring.mdx index dea70237e7771..63d6ad17b131c 100644 --- a/api_docs/kbn_coloring.mdx +++ b/api_docs/kbn_coloring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-coloring title: "@kbn/coloring" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/coloring plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/coloring'] --- import kbnColoringObj from './kbn_coloring.devdocs.json'; diff --git a/api_docs/kbn_config.mdx b/api_docs/kbn_config.mdx index 64a6740b54b29..dec2ee5528dd6 100644 --- a/api_docs/kbn_config.mdx +++ b/api_docs/kbn_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config title: "@kbn/config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config'] --- import kbnConfigObj from './kbn_config.devdocs.json'; diff --git a/api_docs/kbn_config_mocks.mdx b/api_docs/kbn_config_mocks.mdx index ba25d5da0a36d..29e22f3764ee9 100644 --- a/api_docs/kbn_config_mocks.mdx +++ b/api_docs/kbn_config_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-mocks title: "@kbn/config-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-mocks'] --- import kbnConfigMocksObj from './kbn_config_mocks.devdocs.json'; diff --git a/api_docs/kbn_config_schema.mdx b/api_docs/kbn_config_schema.mdx index a911f569446bc..8b9aff335d4f4 100644 --- a/api_docs/kbn_config_schema.mdx +++ b/api_docs/kbn_config_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-schema title: "@kbn/config-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-schema plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-schema'] --- import kbnConfigSchemaObj from './kbn_config_schema.devdocs.json'; diff --git a/api_docs/kbn_content_management_content_editor.mdx b/api_docs/kbn_content_management_content_editor.mdx index 759c69f73b9f4..c1bf3a8d1db02 100644 --- a/api_docs/kbn_content_management_content_editor.mdx +++ b/api_docs/kbn_content_management_content_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-content-editor title: "@kbn/content-management-content-editor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-content-editor plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-content-editor'] --- import kbnContentManagementContentEditorObj from './kbn_content_management_content_editor.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list.mdx b/api_docs/kbn_content_management_table_list.mdx index 0ffccabce86bb..00a12e7374cfc 100644 --- a/api_docs/kbn_content_management_table_list.mdx +++ b/api_docs/kbn_content_management_table_list.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-table-list title: "@kbn/content-management-table-list" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-table-list plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list'] --- import kbnContentManagementTableListObj from './kbn_content_management_table_list.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser.mdx b/api_docs/kbn_core_analytics_browser.mdx index 32c6a32fb9102..4dd3271ccd795 100644 --- a/api_docs/kbn_core_analytics_browser.mdx +++ b/api_docs/kbn_core_analytics_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser title: "@kbn/core-analytics-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser'] --- import kbnCoreAnalyticsBrowserObj from './kbn_core_analytics_browser.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser_internal.mdx b/api_docs/kbn_core_analytics_browser_internal.mdx index 720c4bef54a77..750c458ded9ad 100644 --- a/api_docs/kbn_core_analytics_browser_internal.mdx +++ b/api_docs/kbn_core_analytics_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-internal title: "@kbn/core-analytics-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-internal'] --- import kbnCoreAnalyticsBrowserInternalObj from './kbn_core_analytics_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser_mocks.mdx b/api_docs/kbn_core_analytics_browser_mocks.mdx index 81a3918f61231..0fd38dcd76c97 100644 --- a/api_docs/kbn_core_analytics_browser_mocks.mdx +++ b/api_docs/kbn_core_analytics_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-mocks title: "@kbn/core-analytics-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-mocks'] --- import kbnCoreAnalyticsBrowserMocksObj from './kbn_core_analytics_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server.mdx b/api_docs/kbn_core_analytics_server.mdx index 43748c33fe1b7..381969e573c82 100644 --- a/api_docs/kbn_core_analytics_server.mdx +++ b/api_docs/kbn_core_analytics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server title: "@kbn/core-analytics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server'] --- import kbnCoreAnalyticsServerObj from './kbn_core_analytics_server.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server_internal.mdx b/api_docs/kbn_core_analytics_server_internal.mdx index 602dd06a41f26..f166437d5ea38 100644 --- a/api_docs/kbn_core_analytics_server_internal.mdx +++ b/api_docs/kbn_core_analytics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-internal title: "@kbn/core-analytics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-internal'] --- import kbnCoreAnalyticsServerInternalObj from './kbn_core_analytics_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server_mocks.mdx b/api_docs/kbn_core_analytics_server_mocks.mdx index 3ab2293a0e21d..bcdd2fca778d7 100644 --- a/api_docs/kbn_core_analytics_server_mocks.mdx +++ b/api_docs/kbn_core_analytics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-mocks title: "@kbn/core-analytics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-mocks'] --- import kbnCoreAnalyticsServerMocksObj from './kbn_core_analytics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser.mdx b/api_docs/kbn_core_application_browser.mdx index 522ce91e505a7..7038d150ccf03 100644 --- a/api_docs/kbn_core_application_browser.mdx +++ b/api_docs/kbn_core_application_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser title: "@kbn/core-application-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser'] --- import kbnCoreApplicationBrowserObj from './kbn_core_application_browser.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser_internal.mdx b/api_docs/kbn_core_application_browser_internal.mdx index 13ce20343912c..daa7f8a7ad78e 100644 --- a/api_docs/kbn_core_application_browser_internal.mdx +++ b/api_docs/kbn_core_application_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser-internal title: "@kbn/core-application-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser-internal'] --- import kbnCoreApplicationBrowserInternalObj from './kbn_core_application_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser_mocks.mdx b/api_docs/kbn_core_application_browser_mocks.mdx index db6b3446bf875..081e54a4ee13f 100644 --- a/api_docs/kbn_core_application_browser_mocks.mdx +++ b/api_docs/kbn_core_application_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser-mocks title: "@kbn/core-application-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser-mocks'] --- import kbnCoreApplicationBrowserMocksObj from './kbn_core_application_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_application_common.mdx b/api_docs/kbn_core_application_common.mdx index abae64edee3af..92a7e9719cb88 100644 --- a/api_docs/kbn_core_application_common.mdx +++ b/api_docs/kbn_core_application_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-common title: "@kbn/core-application-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-common plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-common'] --- import kbnCoreApplicationCommonObj from './kbn_core_application_common.devdocs.json'; diff --git a/api_docs/kbn_core_apps_browser_internal.mdx b/api_docs/kbn_core_apps_browser_internal.mdx index f36359e78dd03..82c1b4fef9359 100644 --- a/api_docs/kbn_core_apps_browser_internal.mdx +++ b/api_docs/kbn_core_apps_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-browser-internal title: "@kbn/core-apps-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-browser-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-browser-internal'] --- import kbnCoreAppsBrowserInternalObj from './kbn_core_apps_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_apps_browser_mocks.mdx b/api_docs/kbn_core_apps_browser_mocks.mdx index 6a695be2670a3..eab8785f1c1ea 100644 --- a/api_docs/kbn_core_apps_browser_mocks.mdx +++ b/api_docs/kbn_core_apps_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-browser-mocks title: "@kbn/core-apps-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-browser-mocks'] --- import kbnCoreAppsBrowserMocksObj from './kbn_core_apps_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_apps_server_internal.mdx b/api_docs/kbn_core_apps_server_internal.mdx index ae807387ca278..8cd3313f5951f 100644 --- a/api_docs/kbn_core_apps_server_internal.mdx +++ b/api_docs/kbn_core_apps_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-server-internal title: "@kbn/core-apps-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-server-internal'] --- import kbnCoreAppsServerInternalObj from './kbn_core_apps_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_base_browser_mocks.mdx b/api_docs/kbn_core_base_browser_mocks.mdx index 43b298b029085..42536c493eab6 100644 --- a/api_docs/kbn_core_base_browser_mocks.mdx +++ b/api_docs/kbn_core_base_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-browser-mocks title: "@kbn/core-base-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-browser-mocks'] --- import kbnCoreBaseBrowserMocksObj from './kbn_core_base_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_base_common.mdx b/api_docs/kbn_core_base_common.mdx index 02de71b9df0fd..508e98dae8bc3 100644 --- a/api_docs/kbn_core_base_common.mdx +++ b/api_docs/kbn_core_base_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-common title: "@kbn/core-base-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-common plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-common'] --- import kbnCoreBaseCommonObj from './kbn_core_base_common.devdocs.json'; diff --git a/api_docs/kbn_core_base_server_internal.mdx b/api_docs/kbn_core_base_server_internal.mdx index 78c084ffa5fc2..cb9c6457fe60d 100644 --- a/api_docs/kbn_core_base_server_internal.mdx +++ b/api_docs/kbn_core_base_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-internal title: "@kbn/core-base-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-internal'] --- import kbnCoreBaseServerInternalObj from './kbn_core_base_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_base_server_mocks.mdx b/api_docs/kbn_core_base_server_mocks.mdx index 9e9b9c0ac2a20..333e3595e9c25 100644 --- a/api_docs/kbn_core_base_server_mocks.mdx +++ b/api_docs/kbn_core_base_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-mocks title: "@kbn/core-base-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-mocks'] --- import kbnCoreBaseServerMocksObj from './kbn_core_base_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_browser_mocks.mdx b/api_docs/kbn_core_capabilities_browser_mocks.mdx index 5411cd19d0983..a388ffce34785 100644 --- a/api_docs/kbn_core_capabilities_browser_mocks.mdx +++ b/api_docs/kbn_core_capabilities_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-browser-mocks title: "@kbn/core-capabilities-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-browser-mocks'] --- import kbnCoreCapabilitiesBrowserMocksObj from './kbn_core_capabilities_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_common.mdx b/api_docs/kbn_core_capabilities_common.mdx index f1659ed01890f..74aded4019f3c 100644 --- a/api_docs/kbn_core_capabilities_common.mdx +++ b/api_docs/kbn_core_capabilities_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-common title: "@kbn/core-capabilities-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-common plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-common'] --- import kbnCoreCapabilitiesCommonObj from './kbn_core_capabilities_common.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_server.mdx b/api_docs/kbn_core_capabilities_server.mdx index 72cd251029405..a5f2c3b5df292 100644 --- a/api_docs/kbn_core_capabilities_server.mdx +++ b/api_docs/kbn_core_capabilities_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server title: "@kbn/core-capabilities-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server'] --- import kbnCoreCapabilitiesServerObj from './kbn_core_capabilities_server.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_server_mocks.mdx b/api_docs/kbn_core_capabilities_server_mocks.mdx index f414b8708d898..3ba6cbcd1f738 100644 --- a/api_docs/kbn_core_capabilities_server_mocks.mdx +++ b/api_docs/kbn_core_capabilities_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server-mocks title: "@kbn/core-capabilities-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server-mocks'] --- import kbnCoreCapabilitiesServerMocksObj from './kbn_core_capabilities_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_chrome_browser.mdx b/api_docs/kbn_core_chrome_browser.mdx index 48289b3250945..a31ecd8a59d8e 100644 --- a/api_docs/kbn_core_chrome_browser.mdx +++ b/api_docs/kbn_core_chrome_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-chrome-browser title: "@kbn/core-chrome-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-chrome-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-chrome-browser'] --- import kbnCoreChromeBrowserObj from './kbn_core_chrome_browser.devdocs.json'; diff --git a/api_docs/kbn_core_chrome_browser_mocks.mdx b/api_docs/kbn_core_chrome_browser_mocks.mdx index 4887aa485b0ca..809356c107027 100644 --- a/api_docs/kbn_core_chrome_browser_mocks.mdx +++ b/api_docs/kbn_core_chrome_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-chrome-browser-mocks title: "@kbn/core-chrome-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-chrome-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-chrome-browser-mocks'] --- import kbnCoreChromeBrowserMocksObj from './kbn_core_chrome_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_config_server_internal.mdx b/api_docs/kbn_core_config_server_internal.mdx index 751de962c19f0..93db444323bdd 100644 --- a/api_docs/kbn_core_config_server_internal.mdx +++ b/api_docs/kbn_core_config_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-config-server-internal title: "@kbn/core-config-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-config-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-config-server-internal'] --- import kbnCoreConfigServerInternalObj from './kbn_core_config_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_browser.devdocs.json b/api_docs/kbn_core_custom_branding_browser.devdocs.json new file mode 100644 index 0000000000000..1655e176440c8 --- /dev/null +++ b/api_docs/kbn_core_custom_branding_browser.devdocs.json @@ -0,0 +1,160 @@ +{ + "id": "@kbn/core-custom-branding-browser", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [ + { + "parentPluginId": "@kbn/core-custom-branding-browser", + "id": "def-common.CustomBrandingSetup", + "type": "Interface", + "tags": [], + "label": "CustomBrandingSetup", + "description": [], + "path": "packages/core/custom-branding/core-custom-branding-browser/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-custom-branding-browser", + "id": "def-common.CustomBrandingSetup.customBranding$", + "type": "Object", + "tags": [], + "label": "customBranding$", + "description": [], + "signature": [ + "Observable", + "<", + { + "pluginId": "@kbn/core-custom-branding-common", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingCommonPluginApi", + "section": "def-common.CustomBranding", + "text": "CustomBranding" + }, + ">" + ], + "path": "packages/core/custom-branding/core-custom-branding-browser/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-custom-branding-browser", + "id": "def-common.CustomBrandingSetup.hasCustomBranding$", + "type": "Object", + "tags": [], + "label": "hasCustomBranding$", + "description": [], + "signature": [ + "Observable", + "" + ], + "path": "packages/core/custom-branding/core-custom-branding-browser/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-custom-branding-browser", + "id": "def-common.CustomBrandingSetupDeps", + "type": "Interface", + "tags": [], + "label": "CustomBrandingSetupDeps", + "description": [], + "path": "packages/core/custom-branding/core-custom-branding-browser/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-custom-branding-browser", + "id": "def-common.CustomBrandingSetupDeps.injectedMetadata", + "type": "Object", + "tags": [], + "label": "injectedMetadata", + "description": [], + "signature": [ + "InternalInjectedMetadataSetup" + ], + "path": "packages/core/custom-branding/core-custom-branding-browser/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-custom-branding-browser", + "id": "def-common.CustomBrandingStart", + "type": "Interface", + "tags": [], + "label": "CustomBrandingStart", + "description": [], + "path": "packages/core/custom-branding/core-custom-branding-browser/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-custom-branding-browser", + "id": "def-common.CustomBrandingStart.customBranding$", + "type": "Object", + "tags": [], + "label": "customBranding$", + "description": [], + "signature": [ + "Observable", + "<", + { + "pluginId": "@kbn/core-custom-branding-common", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingCommonPluginApi", + "section": "def-common.CustomBranding", + "text": "CustomBranding" + }, + ">" + ], + "path": "packages/core/custom-branding/core-custom-branding-browser/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-custom-branding-browser", + "id": "def-common.CustomBrandingStart.hasCustomBranding$", + "type": "Object", + "tags": [], + "label": "hasCustomBranding$", + "description": [], + "signature": [ + "Observable", + "" + ], + "path": "packages/core/custom-branding/core-custom-branding-browser/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_core_custom_branding_browser.mdx b/api_docs/kbn_core_custom_branding_browser.mdx new file mode 100644 index 0000000000000..1130853d3a31c --- /dev/null +++ b/api_docs/kbn_core_custom_branding_browser.mdx @@ -0,0 +1,30 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnCoreCustomBrandingBrowserPluginApi +slug: /kibana-dev-docs/api/kbn-core-custom-branding-browser +title: "@kbn/core-custom-branding-browser" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/core-custom-branding-browser plugin +date: 2023-01-12 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-browser'] +--- +import kbnCoreCustomBrandingBrowserObj from './kbn_core_custom_branding_browser.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 8 | 0 | 8 | 0 | + +## Common + +### Interfaces + + diff --git a/api_docs/kbn_core_custom_branding_browser_internal.devdocs.json b/api_docs/kbn_core_custom_branding_browser_internal.devdocs.json new file mode 100644 index 0000000000000..7fa86db6a0b61 --- /dev/null +++ b/api_docs/kbn_core_custom_branding_browser_internal.devdocs.json @@ -0,0 +1,134 @@ +{ + "id": "@kbn/core-custom-branding-browser-internal", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [ + { + "parentPluginId": "@kbn/core-custom-branding-browser-internal", + "id": "def-common.CustomBrandingService", + "type": "Class", + "tags": [], + "label": "CustomBrandingService", + "description": [], + "path": "packages/core/custom-branding/core-custom-branding-browser-internal/src/custom_branding_service.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-custom-branding-browser-internal", + "id": "def-common.CustomBrandingService.setup", + "type": "Function", + "tags": [], + "label": "setup", + "description": [], + "signature": [ + "({ injectedMetadata }: ", + { + "pluginId": "@kbn/core-custom-branding-browser", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingBrowserPluginApi", + "section": "def-common.CustomBrandingSetupDeps", + "text": "CustomBrandingSetupDeps" + }, + ") => ", + { + "pluginId": "@kbn/core-custom-branding-browser", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingBrowserPluginApi", + "section": "def-common.CustomBrandingSetup", + "text": "CustomBrandingSetup" + } + ], + "path": "packages/core/custom-branding/core-custom-branding-browser-internal/src/custom_branding_service.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-custom-branding-browser-internal", + "id": "def-common.CustomBrandingService.setup.$1", + "type": "Object", + "tags": [], + "label": "{ injectedMetadata }", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-custom-branding-browser", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingBrowserPluginApi", + "section": "def-common.CustomBrandingSetupDeps", + "text": "CustomBrandingSetupDeps" + } + ], + "path": "packages/core/custom-branding/core-custom-branding-browser-internal/src/custom_branding_service.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-custom-branding-browser-internal", + "id": "def-common.CustomBrandingService.start", + "type": "Function", + "tags": [], + "label": "start", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/core-custom-branding-browser", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingBrowserPluginApi", + "section": "def-common.CustomBrandingStart", + "text": "CustomBrandingStart" + } + ], + "path": "packages/core/custom-branding/core-custom-branding-browser-internal/src/custom_branding_service.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-custom-branding-browser-internal", + "id": "def-common.CustomBrandingService.stop", + "type": "Function", + "tags": [], + "label": "stop", + "description": [], + "signature": [ + "() => void" + ], + "path": "packages/core/custom-branding/core-custom-branding-browser-internal/src/custom_branding_service.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_core_custom_branding_browser_internal.mdx b/api_docs/kbn_core_custom_branding_browser_internal.mdx new file mode 100644 index 0000000000000..10843c4719549 --- /dev/null +++ b/api_docs/kbn_core_custom_branding_browser_internal.mdx @@ -0,0 +1,30 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnCoreCustomBrandingBrowserInternalPluginApi +slug: /kibana-dev-docs/api/kbn-core-custom-branding-browser-internal +title: "@kbn/core-custom-branding-browser-internal" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/core-custom-branding-browser-internal plugin +date: 2023-01-12 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-browser-internal'] +--- +import kbnCoreCustomBrandingBrowserInternalObj from './kbn_core_custom_branding_browser_internal.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 5 | 0 | 5 | 0 | + +## Common + +### Classes + + diff --git a/api_docs/kbn_core_custom_branding_browser_mocks.devdocs.json b/api_docs/kbn_core_custom_branding_browser_mocks.devdocs.json new file mode 100644 index 0000000000000..094f94d9ea539 --- /dev/null +++ b/api_docs/kbn_core_custom_branding_browser_mocks.devdocs.json @@ -0,0 +1,114 @@ +{ + "id": "@kbn/core-custom-branding-browser-mocks", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [ + { + "parentPluginId": "@kbn/core-custom-branding-browser-mocks", + "id": "def-common.customBrandingServiceMock", + "type": "Object", + "tags": [], + "label": "customBrandingServiceMock", + "description": [], + "path": "packages/core/custom-branding/core-custom-branding-browser-mocks/custom_branding_service.mock.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-custom-branding-browser-mocks", + "id": "def-common.customBrandingServiceMock.create", + "type": "Function", + "tags": [], + "label": "create", + "description": [], + "signature": [ + "() => any" + ], + "path": "packages/core/custom-branding/core-custom-branding-browser-mocks/custom_branding_service.mock.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + }, + { + "parentPluginId": "@kbn/core-custom-branding-browser-mocks", + "id": "def-common.customBrandingServiceMock.createSetupContract", + "type": "Function", + "tags": [], + "label": "createSetupContract", + "description": [], + "signature": [ + "() => { customBranding$: ", + "Observable", + "<", + { + "pluginId": "@kbn/core-custom-branding-common", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingCommonPluginApi", + "section": "def-common.CustomBranding", + "text": "CustomBranding" + }, + ">; hasCustomBranding$: ", + "Observable", + "; }" + ], + "path": "packages/core/custom-branding/core-custom-branding-browser-mocks/custom_branding_service.mock.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + }, + { + "parentPluginId": "@kbn/core-custom-branding-browser-mocks", + "id": "def-common.customBrandingServiceMock.createStartContract", + "type": "Function", + "tags": [], + "label": "createStartContract", + "description": [], + "signature": [ + "() => { customBranding$: ", + "Observable", + "<", + { + "pluginId": "@kbn/core-custom-branding-common", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingCommonPluginApi", + "section": "def-common.CustomBranding", + "text": "CustomBranding" + }, + ">; hasCustomBranding$: ", + "Observable", + "; }" + ], + "path": "packages/core/custom-branding/core-custom-branding-browser-mocks/custom_branding_service.mock.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + } + ], + "initialIsOpen": false + } + ] + } +} \ No newline at end of file diff --git a/api_docs/kbn_core_custom_branding_browser_mocks.mdx b/api_docs/kbn_core_custom_branding_browser_mocks.mdx new file mode 100644 index 0000000000000..25373ecf0b693 --- /dev/null +++ b/api_docs/kbn_core_custom_branding_browser_mocks.mdx @@ -0,0 +1,30 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnCoreCustomBrandingBrowserMocksPluginApi +slug: /kibana-dev-docs/api/kbn-core-custom-branding-browser-mocks +title: "@kbn/core-custom-branding-browser-mocks" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/core-custom-branding-browser-mocks plugin +date: 2023-01-12 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-browser-mocks'] +--- +import kbnCoreCustomBrandingBrowserMocksObj from './kbn_core_custom_branding_browser_mocks.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 4 | 0 | 4 | 0 | + +## Common + +### Objects + + diff --git a/api_docs/kbn_core_custom_branding_common.devdocs.json b/api_docs/kbn_core_custom_branding_common.devdocs.json new file mode 100644 index 0000000000000..909563114b26b --- /dev/null +++ b/api_docs/kbn_core_custom_branding_common.devdocs.json @@ -0,0 +1,122 @@ +{ + "id": "@kbn/core-custom-branding-common", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [ + { + "parentPluginId": "@kbn/core-custom-branding-common", + "id": "def-common.CustomBranding", + "type": "Interface", + "tags": [], + "label": "CustomBranding", + "description": [], + "path": "packages/core/custom-branding/core-custom-branding-common/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-custom-branding-common", + "id": "def-common.CustomBranding.logo", + "type": "string", + "tags": [], + "label": "logo", + "description": [ + "\nCustom replacement for the Elastic logo in the top lef *" + ], + "signature": [ + "string | undefined" + ], + "path": "packages/core/custom-branding/core-custom-branding-common/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-custom-branding-common", + "id": "def-common.CustomBranding.faviconSVG", + "type": "string", + "tags": [], + "label": "faviconSVG", + "description": [ + "\nCustom replacement for favicon in SVG format" + ], + "signature": [ + "string | undefined" + ], + "path": "packages/core/custom-branding/core-custom-branding-common/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-custom-branding-common", + "id": "def-common.CustomBranding.pageTitle", + "type": "string", + "tags": [], + "label": "pageTitle", + "description": [ + "\nCustom page title" + ], + "signature": [ + "string | undefined" + ], + "path": "packages/core/custom-branding/core-custom-branding-common/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-custom-branding-common", + "id": "def-common.CustomBranding.customizedLogo", + "type": "string", + "tags": [], + "label": "customizedLogo", + "description": [ + "\nCustom replacement for Elastic Mark" + ], + "signature": [ + "string | undefined" + ], + "path": "packages/core/custom-branding/core-custom-branding-common/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-custom-branding-common", + "id": "def-common.CustomBranding.faviconPNG", + "type": "string", + "tags": [], + "label": "faviconPNG", + "description": [ + "\nCustom replacement for favicon in PNG format" + ], + "signature": [ + "string | undefined" + ], + "path": "packages/core/custom-branding/core-custom-branding-common/index.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_core_custom_branding_common.mdx b/api_docs/kbn_core_custom_branding_common.mdx new file mode 100644 index 0000000000000..52e236274c6f3 --- /dev/null +++ b/api_docs/kbn_core_custom_branding_common.mdx @@ -0,0 +1,30 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnCoreCustomBrandingCommonPluginApi +slug: /kibana-dev-docs/api/kbn-core-custom-branding-common +title: "@kbn/core-custom-branding-common" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/core-custom-branding-common plugin +date: 2023-01-12 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-common'] +--- +import kbnCoreCustomBrandingCommonObj from './kbn_core_custom_branding_common.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 6 | 0 | 1 | 0 | + +## Common + +### Interfaces + + diff --git a/api_docs/kbn_core_custom_branding_server.devdocs.json b/api_docs/kbn_core_custom_branding_server.devdocs.json new file mode 100644 index 0000000000000..bf777d2385605 --- /dev/null +++ b/api_docs/kbn_core_custom_branding_server.devdocs.json @@ -0,0 +1,165 @@ +{ + "id": "@kbn/core-custom-branding-server", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [ + { + "parentPluginId": "@kbn/core-custom-branding-server", + "id": "def-common.CustomBrandingSetup", + "type": "Interface", + "tags": [], + "label": "CustomBrandingSetup", + "description": [], + "path": "packages/core/custom-branding/core-custom-branding-server/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-custom-branding-server", + "id": "def-common.CustomBrandingSetup.register", + "type": "Function", + "tags": [], + "label": "register", + "description": [], + "signature": [ + "(fetchFn: ", + { + "pluginId": "@kbn/core-custom-branding-server", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingServerPluginApi", + "section": "def-common.CustomBrandingFetchFn", + "text": "CustomBrandingFetchFn" + }, + ") => void" + ], + "path": "packages/core/custom-branding/core-custom-branding-server/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-custom-branding-server", + "id": "def-common.CustomBrandingSetup.register.$1", + "type": "Function", + "tags": [], + "label": "fetchFn", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-custom-branding-server", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingServerPluginApi", + "section": "def-common.CustomBrandingFetchFn", + "text": "CustomBrandingFetchFn" + } + ], + "path": "packages/core/custom-branding/core-custom-branding-server/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-custom-branding-server", + "id": "def-common.CustomBrandingStart", + "type": "Interface", + "tags": [], + "label": "CustomBrandingStart", + "description": [], + "path": "packages/core/custom-branding/core-custom-branding-server/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/core-custom-branding-server", + "id": "def-common.CustomBrandingFetchFn", + "type": "Type", + "tags": [], + "label": "CustomBrandingFetchFn", + "description": [], + "signature": [ + "(request: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + ") => ", + { + "pluginId": "@kbn/utility-types", + "scope": "common", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-common.MaybePromise", + "text": "MaybePromise" + }, + "<", + { + "pluginId": "@kbn/core-custom-branding-common", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingCommonPluginApi", + "section": "def-common.CustomBranding", + "text": "CustomBranding" + }, + ">" + ], + "path": "packages/core/custom-branding/core-custom-branding-server/types.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/core-custom-branding-server", + "id": "def-common.CustomBrandingFetchFn.$1", + "type": "Object", + "tags": [], + "label": "request", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "path": "packages/core/custom-branding/core-custom-branding-server/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_core_custom_branding_server.mdx b/api_docs/kbn_core_custom_branding_server.mdx new file mode 100644 index 0000000000000..567a48d4c50d5 --- /dev/null +++ b/api_docs/kbn_core_custom_branding_server.mdx @@ -0,0 +1,33 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnCoreCustomBrandingServerPluginApi +slug: /kibana-dev-docs/api/kbn-core-custom-branding-server +title: "@kbn/core-custom-branding-server" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/core-custom-branding-server plugin +date: 2023-01-12 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-server'] +--- +import kbnCoreCustomBrandingServerObj from './kbn_core_custom_branding_server.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 6 | 0 | 6 | 0 | + +## Common + +### Interfaces + + +### Consts, variables and types + + diff --git a/api_docs/kbn_core_custom_branding_server_internal.devdocs.json b/api_docs/kbn_core_custom_branding_server_internal.devdocs.json new file mode 100644 index 0000000000000..29a2202248064 --- /dev/null +++ b/api_docs/kbn_core_custom_branding_server_internal.devdocs.json @@ -0,0 +1,130 @@ +{ + "id": "@kbn/core-custom-branding-server-internal", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [ + { + "parentPluginId": "@kbn/core-custom-branding-server-internal", + "id": "def-common.CustomBrandingService", + "type": "Class", + "tags": [], + "label": "CustomBrandingService", + "description": [], + "path": "packages/core/custom-branding/core-custom-branding-server-internal/custom_branding_service.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-custom-branding-server-internal", + "id": "def-common.CustomBrandingService.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "packages/core/custom-branding/core-custom-branding-server-internal/custom_branding_service.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-custom-branding-server-internal", + "id": "def-common.CustomBrandingService.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "coreContext", + "description": [], + "signature": [ + "CoreContext" + ], + "path": "packages/core/custom-branding/core-custom-branding-server-internal/custom_branding_service.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-custom-branding-server-internal", + "id": "def-common.CustomBrandingService.setup", + "type": "Function", + "tags": [], + "label": "setup", + "description": [], + "signature": [ + "() => ", + "InternalCustomBrandingSetup" + ], + "path": "packages/core/custom-branding/core-custom-branding-server-internal/custom_branding_service.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-custom-branding-server-internal", + "id": "def-common.CustomBrandingService.start", + "type": "Function", + "tags": [], + "label": "start", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/core-custom-branding-server", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingServerPluginApi", + "section": "def-common.CustomBrandingStart", + "text": "CustomBrandingStart" + } + ], + "path": "packages/core/custom-branding/core-custom-branding-server-internal/custom_branding_service.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-custom-branding-server-internal", + "id": "def-common.CustomBrandingService.stop", + "type": "Function", + "tags": [], + "label": "stop", + "description": [], + "signature": [ + "() => void" + ], + "path": "packages/core/custom-branding/core-custom-branding-server-internal/custom_branding_service.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_core_custom_branding_server_internal.mdx b/api_docs/kbn_core_custom_branding_server_internal.mdx new file mode 100644 index 0000000000000..2df20dd2708ad --- /dev/null +++ b/api_docs/kbn_core_custom_branding_server_internal.mdx @@ -0,0 +1,30 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnCoreCustomBrandingServerInternalPluginApi +slug: /kibana-dev-docs/api/kbn-core-custom-branding-server-internal +title: "@kbn/core-custom-branding-server-internal" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/core-custom-branding-server-internal plugin +date: 2023-01-12 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-server-internal'] +--- +import kbnCoreCustomBrandingServerInternalObj from './kbn_core_custom_branding_server_internal.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 6 | 0 | 6 | 1 | + +## Common + +### Classes + + diff --git a/api_docs/kbn_core_custom_branding_server_mocks.devdocs.json b/api_docs/kbn_core_custom_branding_server_mocks.devdocs.json new file mode 100644 index 0000000000000..a0dcf7cd134cf --- /dev/null +++ b/api_docs/kbn_core_custom_branding_server_mocks.devdocs.json @@ -0,0 +1,98 @@ +{ + "id": "@kbn/core-custom-branding-server-mocks", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [ + { + "parentPluginId": "@kbn/core-custom-branding-server-mocks", + "id": "def-common.customBrandingServiceMock", + "type": "Object", + "tags": [], + "label": "customBrandingServiceMock", + "description": [], + "path": "packages/core/custom-branding/core-custom-branding-server-mocks/src/custom_branding_service.mock.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-custom-branding-server-mocks", + "id": "def-common.customBrandingServiceMock.create", + "type": "Function", + "tags": [], + "label": "create", + "description": [], + "signature": [ + "() => jest.Mocked<", + { + "pluginId": "@kbn/core-custom-branding-server-internal", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingServerInternalPluginApi", + "section": "def-common.CustomBrandingService", + "text": "CustomBrandingService" + }, + ">" + ], + "path": "packages/core/custom-branding/core-custom-branding-server-mocks/src/custom_branding_service.mock.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + }, + { + "parentPluginId": "@kbn/core-custom-branding-server-mocks", + "id": "def-common.customBrandingServiceMock.createSetupContract", + "type": "Function", + "tags": [], + "label": "createSetupContract", + "description": [], + "signature": [ + "() => { register: jest.Mock; getBrandingFor: jest.Mock; }" + ], + "path": "packages/core/custom-branding/core-custom-branding-server-mocks/src/custom_branding_service.mock.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + }, + { + "parentPluginId": "@kbn/core-custom-branding-server-mocks", + "id": "def-common.customBrandingServiceMock.createStartContract", + "type": "Function", + "tags": [], + "label": "createStartContract", + "description": [], + "signature": [ + "() => {}" + ], + "path": "packages/core/custom-branding/core-custom-branding-server-mocks/src/custom_branding_service.mock.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + } + ], + "initialIsOpen": false + } + ] + } +} \ No newline at end of file diff --git a/api_docs/kbn_core_custom_branding_server_mocks.mdx b/api_docs/kbn_core_custom_branding_server_mocks.mdx new file mode 100644 index 0000000000000..6e5583b99d7f2 --- /dev/null +++ b/api_docs/kbn_core_custom_branding_server_mocks.mdx @@ -0,0 +1,30 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnCoreCustomBrandingServerMocksPluginApi +slug: /kibana-dev-docs/api/kbn-core-custom-branding-server-mocks +title: "@kbn/core-custom-branding-server-mocks" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/core-custom-branding-server-mocks plugin +date: 2023-01-12 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-server-mocks'] +--- +import kbnCoreCustomBrandingServerMocksObj from './kbn_core_custom_branding_server_mocks.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 4 | 0 | 4 | 0 | + +## Common + +### Objects + + diff --git a/api_docs/kbn_core_deprecations_browser.mdx b/api_docs/kbn_core_deprecations_browser.mdx index a8c0384ae02fa..8cbcea3803d5c 100644 --- a/api_docs/kbn_core_deprecations_browser.mdx +++ b/api_docs/kbn_core_deprecations_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser title: "@kbn/core-deprecations-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser'] --- import kbnCoreDeprecationsBrowserObj from './kbn_core_deprecations_browser.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser_internal.mdx b/api_docs/kbn_core_deprecations_browser_internal.mdx index 90f792f77b5ff..c17e7f5c5eec1 100644 --- a/api_docs/kbn_core_deprecations_browser_internal.mdx +++ b/api_docs/kbn_core_deprecations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-internal title: "@kbn/core-deprecations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-internal'] --- import kbnCoreDeprecationsBrowserInternalObj from './kbn_core_deprecations_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser_mocks.mdx b/api_docs/kbn_core_deprecations_browser_mocks.mdx index cb4f5b796469a..e8f7753149758 100644 --- a/api_docs/kbn_core_deprecations_browser_mocks.mdx +++ b/api_docs/kbn_core_deprecations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-mocks title: "@kbn/core-deprecations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-mocks'] --- import kbnCoreDeprecationsBrowserMocksObj from './kbn_core_deprecations_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_common.mdx b/api_docs/kbn_core_deprecations_common.mdx index 0a85eee1d6728..7d5a7e0cadb97 100644 --- a/api_docs/kbn_core_deprecations_common.mdx +++ b/api_docs/kbn_core_deprecations_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-common title: "@kbn/core-deprecations-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-common plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-common'] --- import kbnCoreDeprecationsCommonObj from './kbn_core_deprecations_common.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server.mdx b/api_docs/kbn_core_deprecations_server.mdx index 81e416ab84675..11ca9c69fe7ae 100644 --- a/api_docs/kbn_core_deprecations_server.mdx +++ b/api_docs/kbn_core_deprecations_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server title: "@kbn/core-deprecations-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server'] --- import kbnCoreDeprecationsServerObj from './kbn_core_deprecations_server.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server_internal.mdx b/api_docs/kbn_core_deprecations_server_internal.mdx index b51d9316539c5..a995a4412778a 100644 --- a/api_docs/kbn_core_deprecations_server_internal.mdx +++ b/api_docs/kbn_core_deprecations_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server-internal title: "@kbn/core-deprecations-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server-internal'] --- import kbnCoreDeprecationsServerInternalObj from './kbn_core_deprecations_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server_mocks.mdx b/api_docs/kbn_core_deprecations_server_mocks.mdx index ee5f6407c83ad..accb88edd146b 100644 --- a/api_docs/kbn_core_deprecations_server_mocks.mdx +++ b/api_docs/kbn_core_deprecations_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server-mocks title: "@kbn/core-deprecations-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server-mocks'] --- import kbnCoreDeprecationsServerMocksObj from './kbn_core_deprecations_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_browser.mdx b/api_docs/kbn_core_doc_links_browser.mdx index d2672cfd4a889..5d221549da3ac 100644 --- a/api_docs/kbn_core_doc_links_browser.mdx +++ b/api_docs/kbn_core_doc_links_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser title: "@kbn/core-doc-links-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser'] --- import kbnCoreDocLinksBrowserObj from './kbn_core_doc_links_browser.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_browser_mocks.mdx b/api_docs/kbn_core_doc_links_browser_mocks.mdx index 4eab8138be349..8e283537575e1 100644 --- a/api_docs/kbn_core_doc_links_browser_mocks.mdx +++ b/api_docs/kbn_core_doc_links_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser-mocks title: "@kbn/core-doc-links-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser-mocks'] --- import kbnCoreDocLinksBrowserMocksObj from './kbn_core_doc_links_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_server.mdx b/api_docs/kbn_core_doc_links_server.mdx index 1a32460043849..5d4db50e1c81a 100644 --- a/api_docs/kbn_core_doc_links_server.mdx +++ b/api_docs/kbn_core_doc_links_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server title: "@kbn/core-doc-links-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server'] --- import kbnCoreDocLinksServerObj from './kbn_core_doc_links_server.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_server_mocks.mdx b/api_docs/kbn_core_doc_links_server_mocks.mdx index e223b6bb83432..7f98acb27d876 100644 --- a/api_docs/kbn_core_doc_links_server_mocks.mdx +++ b/api_docs/kbn_core_doc_links_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server-mocks title: "@kbn/core-doc-links-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server-mocks'] --- import kbnCoreDocLinksServerMocksObj from './kbn_core_doc_links_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx index 0b3618949906c..55f22654effe2 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-internal title: "@kbn/core-elasticsearch-client-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-internal'] --- import kbnCoreElasticsearchClientServerInternalObj from './kbn_core_elasticsearch_client_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx index 7b0b67d9ef231..732912f44c281 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-mocks title: "@kbn/core-elasticsearch-client-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-mocks'] --- import kbnCoreElasticsearchClientServerMocksObj from './kbn_core_elasticsearch_client_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server.mdx b/api_docs/kbn_core_elasticsearch_server.mdx index 08929cf8f6bfd..432467d534fb1 100644 --- a/api_docs/kbn_core_elasticsearch_server.mdx +++ b/api_docs/kbn_core_elasticsearch_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server title: "@kbn/core-elasticsearch-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server'] --- import kbnCoreElasticsearchServerObj from './kbn_core_elasticsearch_server.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_internal.mdx b/api_docs/kbn_core_elasticsearch_server_internal.mdx index 6f71cdc13c4a1..75e52f293df22 100644 --- a/api_docs/kbn_core_elasticsearch_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-internal title: "@kbn/core-elasticsearch-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server-internal'] --- import kbnCoreElasticsearchServerInternalObj from './kbn_core_elasticsearch_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_server_mocks.mdx index 5d4b9d19bd915..f95d64dd650fa 100644 --- a/api_docs/kbn_core_elasticsearch_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-mocks title: "@kbn/core-elasticsearch-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server-mocks'] --- import kbnCoreElasticsearchServerMocksObj from './kbn_core_elasticsearch_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_environment_server_internal.mdx b/api_docs/kbn_core_environment_server_internal.mdx index 397246e11404d..bf76277e8abcb 100644 --- a/api_docs/kbn_core_environment_server_internal.mdx +++ b/api_docs/kbn_core_environment_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-internal title: "@kbn/core-environment-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-internal'] --- import kbnCoreEnvironmentServerInternalObj from './kbn_core_environment_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_environment_server_mocks.mdx b/api_docs/kbn_core_environment_server_mocks.mdx index b4b6415ecc15c..52df731dd1f8c 100644 --- a/api_docs/kbn_core_environment_server_mocks.mdx +++ b/api_docs/kbn_core_environment_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-mocks title: "@kbn/core-environment-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-mocks'] --- import kbnCoreEnvironmentServerMocksObj from './kbn_core_environment_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser.mdx b/api_docs/kbn_core_execution_context_browser.mdx index 92c416ee2331c..44370871808cf 100644 --- a/api_docs/kbn_core_execution_context_browser.mdx +++ b/api_docs/kbn_core_execution_context_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser title: "@kbn/core-execution-context-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser'] --- import kbnCoreExecutionContextBrowserObj from './kbn_core_execution_context_browser.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser_internal.mdx b/api_docs/kbn_core_execution_context_browser_internal.mdx index 2150aed31f5e6..f810fb1fc0add 100644 --- a/api_docs/kbn_core_execution_context_browser_internal.mdx +++ b/api_docs/kbn_core_execution_context_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-internal title: "@kbn/core-execution-context-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-internal'] --- import kbnCoreExecutionContextBrowserInternalObj from './kbn_core_execution_context_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser_mocks.mdx b/api_docs/kbn_core_execution_context_browser_mocks.mdx index c8953fb8fda81..4c9ddd27d80d5 100644 --- a/api_docs/kbn_core_execution_context_browser_mocks.mdx +++ b/api_docs/kbn_core_execution_context_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-mocks title: "@kbn/core-execution-context-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-mocks'] --- import kbnCoreExecutionContextBrowserMocksObj from './kbn_core_execution_context_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_common.mdx b/api_docs/kbn_core_execution_context_common.mdx index 529f5eccf5c35..36036e0655111 100644 --- a/api_docs/kbn_core_execution_context_common.mdx +++ b/api_docs/kbn_core_execution_context_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-common title: "@kbn/core-execution-context-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-common plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-common'] --- import kbnCoreExecutionContextCommonObj from './kbn_core_execution_context_common.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server.mdx b/api_docs/kbn_core_execution_context_server.mdx index 9a1d1b557c9ff..a1a994b55b63a 100644 --- a/api_docs/kbn_core_execution_context_server.mdx +++ b/api_docs/kbn_core_execution_context_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server title: "@kbn/core-execution-context-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server'] --- import kbnCoreExecutionContextServerObj from './kbn_core_execution_context_server.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server_internal.mdx b/api_docs/kbn_core_execution_context_server_internal.mdx index 15dc46821eb57..2aaab5d13a1e7 100644 --- a/api_docs/kbn_core_execution_context_server_internal.mdx +++ b/api_docs/kbn_core_execution_context_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-internal title: "@kbn/core-execution-context-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-internal'] --- import kbnCoreExecutionContextServerInternalObj from './kbn_core_execution_context_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server_mocks.mdx b/api_docs/kbn_core_execution_context_server_mocks.mdx index ac280c8e4ece0..336d45e8d4ccc 100644 --- a/api_docs/kbn_core_execution_context_server_mocks.mdx +++ b/api_docs/kbn_core_execution_context_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-mocks title: "@kbn/core-execution-context-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-mocks'] --- import kbnCoreExecutionContextServerMocksObj from './kbn_core_execution_context_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_fatal_errors_browser.mdx b/api_docs/kbn_core_fatal_errors_browser.mdx index 95987de3977e3..f7a447f8237c3 100644 --- a/api_docs/kbn_core_fatal_errors_browser.mdx +++ b/api_docs/kbn_core_fatal_errors_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser title: "@kbn/core-fatal-errors-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-fatal-errors-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser'] --- import kbnCoreFatalErrorsBrowserObj from './kbn_core_fatal_errors_browser.devdocs.json'; diff --git a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx index 0ad9b62a23687..c33ad9ad1841f 100644 --- a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx +++ b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser-mocks title: "@kbn/core-fatal-errors-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-fatal-errors-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser-mocks'] --- import kbnCoreFatalErrorsBrowserMocksObj from './kbn_core_fatal_errors_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser.mdx b/api_docs/kbn_core_http_browser.mdx index d28bf3b17e49a..8476919b14e86 100644 --- a/api_docs/kbn_core_http_browser.mdx +++ b/api_docs/kbn_core_http_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser title: "@kbn/core-http-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser'] --- import kbnCoreHttpBrowserObj from './kbn_core_http_browser.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser_internal.mdx b/api_docs/kbn_core_http_browser_internal.mdx index b5d626e69adbc..474a56a72c76c 100644 --- a/api_docs/kbn_core_http_browser_internal.mdx +++ b/api_docs/kbn_core_http_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-internal title: "@kbn/core-http-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-internal'] --- import kbnCoreHttpBrowserInternalObj from './kbn_core_http_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser_mocks.mdx b/api_docs/kbn_core_http_browser_mocks.mdx index 2b44d239adbb8..99293ee031c76 100644 --- a/api_docs/kbn_core_http_browser_mocks.mdx +++ b/api_docs/kbn_core_http_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-mocks title: "@kbn/core-http-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-mocks'] --- import kbnCoreHttpBrowserMocksObj from './kbn_core_http_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_common.mdx b/api_docs/kbn_core_http_common.mdx index 12bba3525d085..ea35678204a21 100644 --- a/api_docs/kbn_core_http_common.mdx +++ b/api_docs/kbn_core_http_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-common title: "@kbn/core-http-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-common plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-common'] --- import kbnCoreHttpCommonObj from './kbn_core_http_common.devdocs.json'; diff --git a/api_docs/kbn_core_http_context_server_mocks.mdx b/api_docs/kbn_core_http_context_server_mocks.mdx index e8fc75a5a2def..fca51631fb9f2 100644 --- a/api_docs/kbn_core_http_context_server_mocks.mdx +++ b/api_docs/kbn_core_http_context_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-context-server-mocks title: "@kbn/core-http-context-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-context-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-context-server-mocks'] --- import kbnCoreHttpContextServerMocksObj from './kbn_core_http_context_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_request_handler_context_server.mdx b/api_docs/kbn_core_http_request_handler_context_server.mdx index 1ea31df7c8696..ea83de1b3b28d 100644 --- a/api_docs/kbn_core_http_request_handler_context_server.mdx +++ b/api_docs/kbn_core_http_request_handler_context_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-request-handler-context-server title: "@kbn/core-http-request-handler-context-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-request-handler-context-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-request-handler-context-server'] --- import kbnCoreHttpRequestHandlerContextServerObj from './kbn_core_http_request_handler_context_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server.mdx b/api_docs/kbn_core_http_resources_server.mdx index ebf191df6a117..27b131f09885b 100644 --- a/api_docs/kbn_core_http_resources_server.mdx +++ b/api_docs/kbn_core_http_resources_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server title: "@kbn/core-http-resources-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server'] --- import kbnCoreHttpResourcesServerObj from './kbn_core_http_resources_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server_internal.mdx b/api_docs/kbn_core_http_resources_server_internal.mdx index 18744752e5398..6fa1a3a3ea1cc 100644 --- a/api_docs/kbn_core_http_resources_server_internal.mdx +++ b/api_docs/kbn_core_http_resources_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server-internal title: "@kbn/core-http-resources-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server-internal'] --- import kbnCoreHttpResourcesServerInternalObj from './kbn_core_http_resources_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server_mocks.mdx b/api_docs/kbn_core_http_resources_server_mocks.mdx index 50c9a1e36926f..2b6a096cafdfb 100644 --- a/api_docs/kbn_core_http_resources_server_mocks.mdx +++ b/api_docs/kbn_core_http_resources_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server-mocks title: "@kbn/core-http-resources-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server-mocks'] --- import kbnCoreHttpResourcesServerMocksObj from './kbn_core_http_resources_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_router_server_internal.mdx b/api_docs/kbn_core_http_router_server_internal.mdx index f65bb74799ad9..43d0ad1c9823e 100644 --- a/api_docs/kbn_core_http_router_server_internal.mdx +++ b/api_docs/kbn_core_http_router_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-internal title: "@kbn/core-http-router-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-router-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-internal'] --- import kbnCoreHttpRouterServerInternalObj from './kbn_core_http_router_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_router_server_mocks.mdx b/api_docs/kbn_core_http_router_server_mocks.mdx index 222c76b51e0d4..7970cda507b07 100644 --- a/api_docs/kbn_core_http_router_server_mocks.mdx +++ b/api_docs/kbn_core_http_router_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-mocks title: "@kbn/core-http-router-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-router-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-mocks'] --- import kbnCoreHttpRouterServerMocksObj from './kbn_core_http_router_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_server.mdx b/api_docs/kbn_core_http_server.mdx index 8660b736754c4..4bbd573b312c2 100644 --- a/api_docs/kbn_core_http_server.mdx +++ b/api_docs/kbn_core_http_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server title: "@kbn/core-http-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server'] --- import kbnCoreHttpServerObj from './kbn_core_http_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_internal.mdx b/api_docs/kbn_core_http_server_internal.mdx index 5a16fe4c415c4..d1cc3ad033275 100644 --- a/api_docs/kbn_core_http_server_internal.mdx +++ b/api_docs/kbn_core_http_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-internal title: "@kbn/core-http-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-internal'] --- import kbnCoreHttpServerInternalObj from './kbn_core_http_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_mocks.mdx b/api_docs/kbn_core_http_server_mocks.mdx index 3faaff34cd952..8942fa1755c5d 100644 --- a/api_docs/kbn_core_http_server_mocks.mdx +++ b/api_docs/kbn_core_http_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-mocks title: "@kbn/core-http-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-mocks'] --- import kbnCoreHttpServerMocksObj from './kbn_core_http_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_browser.mdx b/api_docs/kbn_core_i18n_browser.mdx index 4b404d1f50774..405471f75be31 100644 --- a/api_docs/kbn_core_i18n_browser.mdx +++ b/api_docs/kbn_core_i18n_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser title: "@kbn/core-i18n-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser'] --- import kbnCoreI18nBrowserObj from './kbn_core_i18n_browser.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_browser_mocks.mdx b/api_docs/kbn_core_i18n_browser_mocks.mdx index 680d8f6d86149..0a920f8888f8d 100644 --- a/api_docs/kbn_core_i18n_browser_mocks.mdx +++ b/api_docs/kbn_core_i18n_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser-mocks title: "@kbn/core-i18n-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser-mocks'] --- import kbnCoreI18nBrowserMocksObj from './kbn_core_i18n_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server.mdx b/api_docs/kbn_core_i18n_server.mdx index 5445c88ba5658..7087d07ac2a4e 100644 --- a/api_docs/kbn_core_i18n_server.mdx +++ b/api_docs/kbn_core_i18n_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server title: "@kbn/core-i18n-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server'] --- import kbnCoreI18nServerObj from './kbn_core_i18n_server.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server_internal.mdx b/api_docs/kbn_core_i18n_server_internal.mdx index 3442d47fa676d..f9b1961d7937d 100644 --- a/api_docs/kbn_core_i18n_server_internal.mdx +++ b/api_docs/kbn_core_i18n_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server-internal title: "@kbn/core-i18n-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server-internal'] --- import kbnCoreI18nServerInternalObj from './kbn_core_i18n_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server_mocks.mdx b/api_docs/kbn_core_i18n_server_mocks.mdx index 1c7555a4782d3..016cb7dda71dc 100644 --- a/api_docs/kbn_core_i18n_server_mocks.mdx +++ b/api_docs/kbn_core_i18n_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server-mocks title: "@kbn/core-i18n-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server-mocks'] --- import kbnCoreI18nServerMocksObj from './kbn_core_i18n_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx index 7a95b381b9004..ff73d95db8461 100644 --- a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx +++ b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-injected-metadata-browser-mocks title: "@kbn/core-injected-metadata-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-injected-metadata-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-injected-metadata-browser-mocks'] --- import kbnCoreInjectedMetadataBrowserMocksObj from './kbn_core_injected_metadata_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_integrations_browser_internal.mdx b/api_docs/kbn_core_integrations_browser_internal.mdx index 265b88182ece7..528661e0a6724 100644 --- a/api_docs/kbn_core_integrations_browser_internal.mdx +++ b/api_docs/kbn_core_integrations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-internal title: "@kbn/core-integrations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-internal'] --- import kbnCoreIntegrationsBrowserInternalObj from './kbn_core_integrations_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_integrations_browser_mocks.mdx b/api_docs/kbn_core_integrations_browser_mocks.mdx index 72ca8f902162f..5f43df48011fb 100644 --- a/api_docs/kbn_core_integrations_browser_mocks.mdx +++ b/api_docs/kbn_core_integrations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-mocks title: "@kbn/core-integrations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-mocks'] --- import kbnCoreIntegrationsBrowserMocksObj from './kbn_core_integrations_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_browser.devdocs.json b/api_docs/kbn_core_lifecycle_browser.devdocs.json index a1fa9416bf1a4..7dc5c13d4c1de 100644 --- a/api_docs/kbn_core_lifecycle_browser.devdocs.json +++ b/api_docs/kbn_core_lifecycle_browser.devdocs.json @@ -139,6 +139,28 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "@kbn/core-lifecycle-browser", + "id": "def-common.CoreSetup.customBranding", + "type": "Object", + "tags": [], + "label": "customBranding", + "description": [ + "{@link CustomBrandingSetup}" + ], + "signature": [ + { + "pluginId": "@kbn/core-custom-branding-browser", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingBrowserPluginApi", + "section": "def-common.CustomBrandingSetup", + "text": "CustomBrandingSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "@kbn/core-lifecycle-browser", "id": "def-common.CoreSetup.fatalErrors", @@ -415,6 +437,28 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "@kbn/core-lifecycle-browser", + "id": "def-common.CoreStart.customBranding", + "type": "Object", + "tags": [], + "label": "customBranding", + "description": [ + "{@link CustomBrandingStart}" + ], + "signature": [ + { + "pluginId": "@kbn/core-custom-branding-browser", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingBrowserPluginApi", + "section": "def-common.CustomBrandingStart", + "text": "CustomBrandingStart" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "@kbn/core-lifecycle-browser", "id": "def-common.CoreStart.docLinks", diff --git a/api_docs/kbn_core_lifecycle_browser.mdx b/api_docs/kbn_core_lifecycle_browser.mdx index 27bfa439be142..1119b90025372 100644 --- a/api_docs/kbn_core_lifecycle_browser.mdx +++ b/api_docs/kbn_core_lifecycle_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-browser title: "@kbn/core-lifecycle-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-browser'] --- import kbnCoreLifecycleBrowserObj from './kbn_core_lifecycle_browser.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 28 | 0 | 0 | 0 | +| 30 | 0 | 0 | 0 | ## Common diff --git a/api_docs/kbn_core_lifecycle_browser_mocks.devdocs.json b/api_docs/kbn_core_lifecycle_browser_mocks.devdocs.json index 346b4b938041c..6dbd5cb58f515 100644 --- a/api_docs/kbn_core_lifecycle_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_lifecycle_browser_mocks.devdocs.json @@ -58,7 +58,19 @@ "section": "def-common.ApplicationSetup", "text": "ApplicationSetup" }, - ">; docLinks: jest.Mock; executionContext: jest.Mocked<", + ">; customBranding: { customBranding$: ", + "Observable", + "<", + { + "pluginId": "@kbn/core-custom-branding-common", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingCommonPluginApi", + "section": "def-common.CustomBranding", + "text": "CustomBranding" + }, + ">; hasCustomBranding$: ", + "Observable", + "; }; docLinks: jest.Mock; executionContext: jest.Mocked<", { "pluginId": "@kbn/core-execution-context-browser", "scope": "common", @@ -100,7 +112,19 @@ }, "<", "InternalChromeStart", - ">; docLinks: ", + ">; customBranding: { customBranding$: ", + "Observable", + "<", + { + "pluginId": "@kbn/core-custom-branding-common", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingCommonPluginApi", + "section": "def-common.CustomBranding", + "text": "CustomBranding" + }, + ">; hasCustomBranding$: ", + "Observable", + "; }; docLinks: ", { "pluginId": "@kbn/core-doc-links-browser", "scope": "common", @@ -333,7 +357,19 @@ }, "<", "InternalChromeStart", - ">; docLinks: ", + ">; customBranding: { customBranding$: ", + "Observable", + "<", + { + "pluginId": "@kbn/core-custom-branding-common", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingCommonPluginApi", + "section": "def-common.CustomBranding", + "text": "CustomBranding" + }, + ">; hasCustomBranding$: ", + "Observable", + "; }; docLinks: ", { "pluginId": "@kbn/core-doc-links-browser", "scope": "common", diff --git a/api_docs/kbn_core_lifecycle_browser_mocks.mdx b/api_docs/kbn_core_lifecycle_browser_mocks.mdx index 9af6fb7ee5646..94636b5b7d07c 100644 --- a/api_docs/kbn_core_lifecycle_browser_mocks.mdx +++ b/api_docs/kbn_core_lifecycle_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-browser-mocks title: "@kbn/core-lifecycle-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-browser-mocks'] --- import kbnCoreLifecycleBrowserMocksObj from './kbn_core_lifecycle_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_server.devdocs.json b/api_docs/kbn_core_lifecycle_server.devdocs.json index 67ce539a4ba9d..d15b4bd0e4970 100644 --- a/api_docs/kbn_core_lifecycle_server.devdocs.json +++ b/api_docs/kbn_core_lifecycle_server.devdocs.json @@ -304,6 +304,28 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-common.CoreSetup.customBranding", + "type": "Object", + "tags": [], + "label": "customBranding", + "description": [ + "{@link CustomBrandingSetup}" + ], + "signature": [ + { + "pluginId": "@kbn/core-custom-branding-server", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingServerPluginApi", + "section": "def-common.CustomBrandingSetup", + "text": "CustomBrandingSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "@kbn/core-lifecycle-server", "id": "def-common.CoreSetup.docLinks", @@ -661,6 +683,28 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-common.CoreStart.customBranding", + "type": "Object", + "tags": [], + "label": "customBranding", + "description": [ + "{@link CustomBrandingStart}" + ], + "signature": [ + { + "pluginId": "@kbn/core-custom-branding-server", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingServerPluginApi", + "section": "def-common.CustomBrandingStart", + "text": "CustomBrandingStart" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "@kbn/core-lifecycle-server", "id": "def-common.CoreStart.docLinks", diff --git a/api_docs/kbn_core_lifecycle_server.mdx b/api_docs/kbn_core_lifecycle_server.mdx index 07b0bbade4e93..92a90d0b06298 100644 --- a/api_docs/kbn_core_lifecycle_server.mdx +++ b/api_docs/kbn_core_lifecycle_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-server title: "@kbn/core-lifecycle-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-server'] --- import kbnCoreLifecycleServerObj from './kbn_core_lifecycle_server.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 31 | 0 | 0 | 0 | +| 33 | 0 | 0 | 0 | ## Common diff --git a/api_docs/kbn_core_lifecycle_server_mocks.devdocs.json b/api_docs/kbn_core_lifecycle_server_mocks.devdocs.json index 310892b9568ab..8d8123f538805 100644 --- a/api_docs/kbn_core_lifecycle_server_mocks.devdocs.json +++ b/api_docs/kbn_core_lifecycle_server_mocks.devdocs.json @@ -184,7 +184,7 @@ "IExecutionContext", ">; coreUsageData: jest.Mocked<", "InternalCoreUsageDataSetup", - ">; }" + ">; customBranding: { register: jest.Mock; getBrandingFor: jest.Mock; }; }" ], "path": "packages/core/lifecycle/core-lifecycle-server-mocks/src/index.ts", "deprecated": false, @@ -282,7 +282,7 @@ "section": "def-common.InternalDeprecationsServiceStart", "text": "InternalDeprecationsServiceStart" }, - ">; }" + ">; customBranding: {}; }" ], "path": "packages/core/lifecycle/core-lifecycle-server-mocks/src/index.ts", "deprecated": false, diff --git a/api_docs/kbn_core_lifecycle_server_mocks.mdx b/api_docs/kbn_core_lifecycle_server_mocks.mdx index 3cfb7363e4ea7..efe5510f7addc 100644 --- a/api_docs/kbn_core_lifecycle_server_mocks.mdx +++ b/api_docs/kbn_core_lifecycle_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-server-mocks title: "@kbn/core-lifecycle-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-server-mocks'] --- import kbnCoreLifecycleServerMocksObj from './kbn_core_lifecycle_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_logging_browser_mocks.mdx b/api_docs/kbn_core_logging_browser_mocks.mdx index fb9d5979a1659..2c0724ca9bbcb 100644 --- a/api_docs/kbn_core_logging_browser_mocks.mdx +++ b/api_docs/kbn_core_logging_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-browser-mocks title: "@kbn/core-logging-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-browser-mocks'] --- import kbnCoreLoggingBrowserMocksObj from './kbn_core_logging_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_logging_common_internal.mdx b/api_docs/kbn_core_logging_common_internal.mdx index 0266000e0591c..181bdc39a0d00 100644 --- a/api_docs/kbn_core_logging_common_internal.mdx +++ b/api_docs/kbn_core_logging_common_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-common-internal title: "@kbn/core-logging-common-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-common-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-common-internal'] --- import kbnCoreLoggingCommonInternalObj from './kbn_core_logging_common_internal.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server.mdx b/api_docs/kbn_core_logging_server.mdx index 35d19fa2cd209..1a4860f642414 100644 --- a/api_docs/kbn_core_logging_server.mdx +++ b/api_docs/kbn_core_logging_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server title: "@kbn/core-logging-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server'] --- import kbnCoreLoggingServerObj from './kbn_core_logging_server.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_internal.mdx b/api_docs/kbn_core_logging_server_internal.mdx index 4e1fbf04fc837..4fe8838567a56 100644 --- a/api_docs/kbn_core_logging_server_internal.mdx +++ b/api_docs/kbn_core_logging_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-internal title: "@kbn/core-logging-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-internal'] --- import kbnCoreLoggingServerInternalObj from './kbn_core_logging_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_mocks.mdx b/api_docs/kbn_core_logging_server_mocks.mdx index 2790e72444eb2..09ef15496514d 100644 --- a/api_docs/kbn_core_logging_server_mocks.mdx +++ b/api_docs/kbn_core_logging_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-mocks title: "@kbn/core-logging-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-mocks'] --- import kbnCoreLoggingServerMocksObj from './kbn_core_logging_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_collectors_server_internal.mdx b/api_docs/kbn_core_metrics_collectors_server_internal.mdx index 1df8be2a2308c..7df045b3f624a 100644 --- a/api_docs/kbn_core_metrics_collectors_server_internal.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-internal title: "@kbn/core-metrics-collectors-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-internal'] --- import kbnCoreMetricsCollectorsServerInternalObj from './kbn_core_metrics_collectors_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx index 51ab200336502..821bfc784f856 100644 --- a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-mocks title: "@kbn/core-metrics-collectors-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-mocks'] --- import kbnCoreMetricsCollectorsServerMocksObj from './kbn_core_metrics_collectors_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server.mdx b/api_docs/kbn_core_metrics_server.mdx index 8b026bcd9b622..93baaf6931d50 100644 --- a/api_docs/kbn_core_metrics_server.mdx +++ b/api_docs/kbn_core_metrics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server title: "@kbn/core-metrics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server'] --- import kbnCoreMetricsServerObj from './kbn_core_metrics_server.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server_internal.mdx b/api_docs/kbn_core_metrics_server_internal.mdx index 09d5baa3fddf0..cd607c8e2291e 100644 --- a/api_docs/kbn_core_metrics_server_internal.mdx +++ b/api_docs/kbn_core_metrics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-internal title: "@kbn/core-metrics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server-internal'] --- import kbnCoreMetricsServerInternalObj from './kbn_core_metrics_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server_mocks.mdx b/api_docs/kbn_core_metrics_server_mocks.mdx index 0e199fc156d07..4752596100d1c 100644 --- a/api_docs/kbn_core_metrics_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-mocks title: "@kbn/core-metrics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server-mocks'] --- import kbnCoreMetricsServerMocksObj from './kbn_core_metrics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_mount_utils_browser.mdx b/api_docs/kbn_core_mount_utils_browser.mdx index 326dcd3139add..658f8fb19bcd8 100644 --- a/api_docs/kbn_core_mount_utils_browser.mdx +++ b/api_docs/kbn_core_mount_utils_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-mount-utils-browser title: "@kbn/core-mount-utils-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-mount-utils-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-mount-utils-browser'] --- import kbnCoreMountUtilsBrowserObj from './kbn_core_mount_utils_browser.devdocs.json'; diff --git a/api_docs/kbn_core_node_server.mdx b/api_docs/kbn_core_node_server.mdx index 532f177ff9cc3..68183857c5846 100644 --- a/api_docs/kbn_core_node_server.mdx +++ b/api_docs/kbn_core_node_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server title: "@kbn/core-node-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server'] --- import kbnCoreNodeServerObj from './kbn_core_node_server.devdocs.json'; diff --git a/api_docs/kbn_core_node_server_internal.mdx b/api_docs/kbn_core_node_server_internal.mdx index ea8ff82296ae2..3a56a297c410a 100644 --- a/api_docs/kbn_core_node_server_internal.mdx +++ b/api_docs/kbn_core_node_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-internal title: "@kbn/core-node-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-internal'] --- import kbnCoreNodeServerInternalObj from './kbn_core_node_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_node_server_mocks.mdx b/api_docs/kbn_core_node_server_mocks.mdx index bd91a86809010..34e6be20aa199 100644 --- a/api_docs/kbn_core_node_server_mocks.mdx +++ b/api_docs/kbn_core_node_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-mocks title: "@kbn/core-node-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-mocks'] --- import kbnCoreNodeServerMocksObj from './kbn_core_node_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser.mdx b/api_docs/kbn_core_notifications_browser.mdx index 2e647091b3a18..6b874cb6ad907 100644 --- a/api_docs/kbn_core_notifications_browser.mdx +++ b/api_docs/kbn_core_notifications_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser title: "@kbn/core-notifications-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser'] --- import kbnCoreNotificationsBrowserObj from './kbn_core_notifications_browser.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser_internal.mdx b/api_docs/kbn_core_notifications_browser_internal.mdx index ef3d7242d61fe..d8ceedade579b 100644 --- a/api_docs/kbn_core_notifications_browser_internal.mdx +++ b/api_docs/kbn_core_notifications_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-internal title: "@kbn/core-notifications-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser-internal'] --- import kbnCoreNotificationsBrowserInternalObj from './kbn_core_notifications_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser_mocks.mdx b/api_docs/kbn_core_notifications_browser_mocks.mdx index d5f8f1d28fb9d..e93c7f27312bd 100644 --- a/api_docs/kbn_core_notifications_browser_mocks.mdx +++ b/api_docs/kbn_core_notifications_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-mocks title: "@kbn/core-notifications-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser-mocks'] --- import kbnCoreNotificationsBrowserMocksObj from './kbn_core_notifications_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser.mdx b/api_docs/kbn_core_overlays_browser.mdx index 0602e515b1a22..730a998ea691b 100644 --- a/api_docs/kbn_core_overlays_browser.mdx +++ b/api_docs/kbn_core_overlays_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser title: "@kbn/core-overlays-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser'] --- import kbnCoreOverlaysBrowserObj from './kbn_core_overlays_browser.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser_internal.mdx b/api_docs/kbn_core_overlays_browser_internal.mdx index ee836433c9fe4..13620dc5e6565 100644 --- a/api_docs/kbn_core_overlays_browser_internal.mdx +++ b/api_docs/kbn_core_overlays_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-internal title: "@kbn/core-overlays-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-internal'] --- import kbnCoreOverlaysBrowserInternalObj from './kbn_core_overlays_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser_mocks.mdx b/api_docs/kbn_core_overlays_browser_mocks.mdx index 5c16207cf1232..a484d35225bcc 100644 --- a/api_docs/kbn_core_overlays_browser_mocks.mdx +++ b/api_docs/kbn_core_overlays_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-mocks title: "@kbn/core-overlays-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-mocks'] --- import kbnCoreOverlaysBrowserMocksObj from './kbn_core_overlays_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_browser.mdx b/api_docs/kbn_core_plugins_browser.mdx index 1ee65c2773fbe..0dfdab41596d0 100644 --- a/api_docs/kbn_core_plugins_browser.mdx +++ b/api_docs/kbn_core_plugins_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-browser title: "@kbn/core-plugins-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-browser'] --- import kbnCorePluginsBrowserObj from './kbn_core_plugins_browser.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_browser_mocks.mdx b/api_docs/kbn_core_plugins_browser_mocks.mdx index 7456ee7e2b3c8..8e3ed1e37b11d 100644 --- a/api_docs/kbn_core_plugins_browser_mocks.mdx +++ b/api_docs/kbn_core_plugins_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-browser-mocks title: "@kbn/core-plugins-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-browser-mocks'] --- import kbnCorePluginsBrowserMocksObj from './kbn_core_plugins_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_server.mdx b/api_docs/kbn_core_plugins_server.mdx index ec2026956caa6..28968243844d8 100644 --- a/api_docs/kbn_core_plugins_server.mdx +++ b/api_docs/kbn_core_plugins_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-server title: "@kbn/core-plugins-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-server'] --- import kbnCorePluginsServerObj from './kbn_core_plugins_server.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_server_mocks.mdx b/api_docs/kbn_core_plugins_server_mocks.mdx index 444bd58f2e891..c78e58243e9ab 100644 --- a/api_docs/kbn_core_plugins_server_mocks.mdx +++ b/api_docs/kbn_core_plugins_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-server-mocks title: "@kbn/core-plugins-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-server-mocks'] --- import kbnCorePluginsServerMocksObj from './kbn_core_plugins_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_preboot_server.mdx b/api_docs/kbn_core_preboot_server.mdx index f7cf58ab48e35..d2e43337ab690 100644 --- a/api_docs/kbn_core_preboot_server.mdx +++ b/api_docs/kbn_core_preboot_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server title: "@kbn/core-preboot-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server'] --- import kbnCorePrebootServerObj from './kbn_core_preboot_server.devdocs.json'; diff --git a/api_docs/kbn_core_preboot_server_mocks.mdx b/api_docs/kbn_core_preboot_server_mocks.mdx index 3d7a32999cdb4..8bb4890f1fe4b 100644 --- a/api_docs/kbn_core_preboot_server_mocks.mdx +++ b/api_docs/kbn_core_preboot_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server-mocks title: "@kbn/core-preboot-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server-mocks'] --- import kbnCorePrebootServerMocksObj from './kbn_core_preboot_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_browser_mocks.mdx b/api_docs/kbn_core_rendering_browser_mocks.mdx index abab7c773dffe..9dac5140a50f6 100644 --- a/api_docs/kbn_core_rendering_browser_mocks.mdx +++ b/api_docs/kbn_core_rendering_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-browser-mocks title: "@kbn/core-rendering-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-browser-mocks'] --- import kbnCoreRenderingBrowserMocksObj from './kbn_core_rendering_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_server_internal.mdx b/api_docs/kbn_core_rendering_server_internal.mdx index b15348e614e39..8e7e39c8c1ce8 100644 --- a/api_docs/kbn_core_rendering_server_internal.mdx +++ b/api_docs/kbn_core_rendering_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-server-internal title: "@kbn/core-rendering-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-server-internal'] --- import kbnCoreRenderingServerInternalObj from './kbn_core_rendering_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_server_mocks.mdx b/api_docs/kbn_core_rendering_server_mocks.mdx index 3bead939d17ba..c3668bc225388 100644 --- a/api_docs/kbn_core_rendering_server_mocks.mdx +++ b/api_docs/kbn_core_rendering_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-server-mocks title: "@kbn/core-rendering-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-server-mocks'] --- import kbnCoreRenderingServerMocksObj from './kbn_core_rendering_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_root_server_internal.mdx b/api_docs/kbn_core_root_server_internal.mdx index ca5161266da93..6a163cc5b75a5 100644 --- a/api_docs/kbn_core_root_server_internal.mdx +++ b/api_docs/kbn_core_root_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-root-server-internal title: "@kbn/core-root-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-root-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-root-server-internal'] --- import kbnCoreRootServerInternalObj from './kbn_core_root_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_browser.mdx b/api_docs/kbn_core_saved_objects_api_browser.mdx index 2e29de577f854..ba253dd84f9ff 100644 --- a/api_docs/kbn_core_saved_objects_api_browser.mdx +++ b/api_docs/kbn_core_saved_objects_api_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-browser title: "@kbn/core-saved-objects-api-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-browser'] --- import kbnCoreSavedObjectsApiBrowserObj from './kbn_core_saved_objects_api_browser.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server.mdx b/api_docs/kbn_core_saved_objects_api_server.mdx index 7686f31fc61b8..c3d6b284f8b7f 100644 --- a/api_docs/kbn_core_saved_objects_api_server.mdx +++ b/api_docs/kbn_core_saved_objects_api_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server title: "@kbn/core-saved-objects-api-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server'] --- import kbnCoreSavedObjectsApiServerObj from './kbn_core_saved_objects_api_server.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server_internal.mdx b/api_docs/kbn_core_saved_objects_api_server_internal.mdx index de8372e361bc3..c3717ff8155a5 100644 --- a/api_docs/kbn_core_saved_objects_api_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_api_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server-internal title: "@kbn/core-saved-objects-api-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server-internal'] --- import kbnCoreSavedObjectsApiServerInternalObj from './kbn_core_saved_objects_api_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server_mocks.mdx b/api_docs/kbn_core_saved_objects_api_server_mocks.mdx index ca4066a926143..4c1173c307e6f 100644 --- a/api_docs/kbn_core_saved_objects_api_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_api_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server-mocks title: "@kbn/core-saved-objects-api-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server-mocks'] --- import kbnCoreSavedObjectsApiServerMocksObj from './kbn_core_saved_objects_api_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_base_server_internal.mdx b/api_docs/kbn_core_saved_objects_base_server_internal.mdx index c2a45b5378ce3..9b8414c74cd98 100644 --- a/api_docs/kbn_core_saved_objects_base_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_base_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-base-server-internal title: "@kbn/core-saved-objects-base-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-base-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-base-server-internal'] --- import kbnCoreSavedObjectsBaseServerInternalObj from './kbn_core_saved_objects_base_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_base_server_mocks.mdx b/api_docs/kbn_core_saved_objects_base_server_mocks.mdx index 24496cc7269ea..249b7de281c00 100644 --- a/api_docs/kbn_core_saved_objects_base_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_base_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-base-server-mocks title: "@kbn/core-saved-objects-base-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-base-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-base-server-mocks'] --- import kbnCoreSavedObjectsBaseServerMocksObj from './kbn_core_saved_objects_base_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser.mdx b/api_docs/kbn_core_saved_objects_browser.mdx index af1ad88129ac1..f58bb03f3cf53 100644 --- a/api_docs/kbn_core_saved_objects_browser.mdx +++ b/api_docs/kbn_core_saved_objects_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser title: "@kbn/core-saved-objects-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser'] --- import kbnCoreSavedObjectsBrowserObj from './kbn_core_saved_objects_browser.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser_internal.mdx b/api_docs/kbn_core_saved_objects_browser_internal.mdx index 81d6d5a9e3ae5..5bc49228fe59d 100644 --- a/api_docs/kbn_core_saved_objects_browser_internal.mdx +++ b/api_docs/kbn_core_saved_objects_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-internal title: "@kbn/core-saved-objects-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser-internal'] --- import kbnCoreSavedObjectsBrowserInternalObj from './kbn_core_saved_objects_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser_mocks.mdx b/api_docs/kbn_core_saved_objects_browser_mocks.mdx index a24f31d482631..ff6dfc584fa94 100644 --- a/api_docs/kbn_core_saved_objects_browser_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-mocks title: "@kbn/core-saved-objects-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser-mocks'] --- import kbnCoreSavedObjectsBrowserMocksObj from './kbn_core_saved_objects_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_common.mdx b/api_docs/kbn_core_saved_objects_common.mdx index 888153b96ec84..a877446495773 100644 --- a/api_docs/kbn_core_saved_objects_common.mdx +++ b/api_docs/kbn_core_saved_objects_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-common title: "@kbn/core-saved-objects-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-common plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-common'] --- import kbnCoreSavedObjectsCommonObj from './kbn_core_saved_objects_common.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx b/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx index 59df5d6bffeec..93aca0aabe6ed 100644 --- a/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-import-export-server-internal title: "@kbn/core-saved-objects-import-export-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-import-export-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-import-export-server-internal'] --- import kbnCoreSavedObjectsImportExportServerInternalObj from './kbn_core_saved_objects_import_export_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx b/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx index 27345771c0ec9..7b4c3a8b7653a 100644 --- a/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-import-export-server-mocks title: "@kbn/core-saved-objects-import-export-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-import-export-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-import-export-server-mocks'] --- import kbnCoreSavedObjectsImportExportServerMocksObj from './kbn_core_saved_objects_import_export_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_migration_server_internal.mdx b/api_docs/kbn_core_saved_objects_migration_server_internal.mdx index a268c5dc027cf..76eaf336279f7 100644 --- a/api_docs/kbn_core_saved_objects_migration_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_migration_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-migration-server-internal title: "@kbn/core-saved-objects-migration-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-migration-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-migration-server-internal'] --- import kbnCoreSavedObjectsMigrationServerInternalObj from './kbn_core_saved_objects_migration_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx b/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx index fa1382a2f74fc..b0d5c98a33639 100644 --- a/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-migration-server-mocks title: "@kbn/core-saved-objects-migration-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-migration-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-migration-server-mocks'] --- import kbnCoreSavedObjectsMigrationServerMocksObj from './kbn_core_saved_objects_migration_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server.mdx b/api_docs/kbn_core_saved_objects_server.mdx index a6e7cbe95a4bb..7e3b2d7554597 100644 --- a/api_docs/kbn_core_saved_objects_server.mdx +++ b/api_docs/kbn_core_saved_objects_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server title: "@kbn/core-saved-objects-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server'] --- import kbnCoreSavedObjectsServerObj from './kbn_core_saved_objects_server.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server_internal.mdx b/api_docs/kbn_core_saved_objects_server_internal.mdx index 49544bf554b89..10728f8b39e3f 100644 --- a/api_docs/kbn_core_saved_objects_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server-internal title: "@kbn/core-saved-objects-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server-internal'] --- import kbnCoreSavedObjectsServerInternalObj from './kbn_core_saved_objects_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server_mocks.mdx b/api_docs/kbn_core_saved_objects_server_mocks.mdx index 25abdbfe6fccd..28910780d674a 100644 --- a/api_docs/kbn_core_saved_objects_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server-mocks title: "@kbn/core-saved-objects-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server-mocks'] --- import kbnCoreSavedObjectsServerMocksObj from './kbn_core_saved_objects_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_utils_server.mdx b/api_docs/kbn_core_saved_objects_utils_server.mdx index 19f650ac067d0..6cf528bd6fc30 100644 --- a/api_docs/kbn_core_saved_objects_utils_server.mdx +++ b/api_docs/kbn_core_saved_objects_utils_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-utils-server title: "@kbn/core-saved-objects-utils-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-utils-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-utils-server'] --- import kbnCoreSavedObjectsUtilsServerObj from './kbn_core_saved_objects_utils_server.devdocs.json'; diff --git a/api_docs/kbn_core_status_common.mdx b/api_docs/kbn_core_status_common.mdx index 7d430cda49915..4856eb5cfac36 100644 --- a/api_docs/kbn_core_status_common.mdx +++ b/api_docs/kbn_core_status_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-common title: "@kbn/core-status-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-common plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-common'] --- import kbnCoreStatusCommonObj from './kbn_core_status_common.devdocs.json'; diff --git a/api_docs/kbn_core_status_common_internal.mdx b/api_docs/kbn_core_status_common_internal.mdx index e9eb21a53a651..a231ca3435d87 100644 --- a/api_docs/kbn_core_status_common_internal.mdx +++ b/api_docs/kbn_core_status_common_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-common-internal title: "@kbn/core-status-common-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-common-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-common-internal'] --- import kbnCoreStatusCommonInternalObj from './kbn_core_status_common_internal.devdocs.json'; diff --git a/api_docs/kbn_core_status_server.mdx b/api_docs/kbn_core_status_server.mdx index 49bb92b86f4a7..4ebbe176a9ce2 100644 --- a/api_docs/kbn_core_status_server.mdx +++ b/api_docs/kbn_core_status_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server title: "@kbn/core-status-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server'] --- import kbnCoreStatusServerObj from './kbn_core_status_server.devdocs.json'; diff --git a/api_docs/kbn_core_status_server_internal.mdx b/api_docs/kbn_core_status_server_internal.mdx index 971602b81d551..377de44a9db1e 100644 --- a/api_docs/kbn_core_status_server_internal.mdx +++ b/api_docs/kbn_core_status_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server-internal title: "@kbn/core-status-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server-internal'] --- import kbnCoreStatusServerInternalObj from './kbn_core_status_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_status_server_mocks.mdx b/api_docs/kbn_core_status_server_mocks.mdx index b03e68544bc2a..eeb7c857b689b 100644 --- a/api_docs/kbn_core_status_server_mocks.mdx +++ b/api_docs/kbn_core_status_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server-mocks title: "@kbn/core-status-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server-mocks'] --- import kbnCoreStatusServerMocksObj from './kbn_core_status_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx index 0fee9a242978c..81a1deecf1302 100644 --- a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx +++ b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-deprecations-getters title: "@kbn/core-test-helpers-deprecations-getters" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-deprecations-getters plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-deprecations-getters'] --- import kbnCoreTestHelpersDeprecationsGettersObj from './kbn_core_test_helpers_deprecations_getters.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_http_setup_browser.devdocs.json b/api_docs/kbn_core_test_helpers_http_setup_browser.devdocs.json index d15212aedffd6..f60b10783ed6e 100644 --- a/api_docs/kbn_core_test_helpers_http_setup_browser.devdocs.json +++ b/api_docs/kbn_core_test_helpers_http_setup_browser.devdocs.json @@ -129,7 +129,15 @@ "InjectedMetadataClusterInfo", ", []>; getPlugins: jest.MockInstance<", "InjectedMetadataPlugin", - "[], []>; getAnonymousStatusPage: jest.MockInstance; getLegacyMetadata: jest.MockInstance<{ uiSettings: { defaults: Record; user?: Record | undefined; }; globalUiSettings: { defaults: Record; user?: Record | undefined; }; }, []>; getInjectedVar: jest.MockInstance; getInjectedVars: jest.MockInstance<{ [key: string]: unknown; }, []>; } & ", + "[], []>; getAnonymousStatusPage: jest.MockInstance; getLegacyMetadata: jest.MockInstance<{ uiSettings: { defaults: Record; user?: Record | undefined; }; globalUiSettings: { defaults: Record; user?: Record | undefined; }; }, []>; getInjectedVar: jest.MockInstance; getInjectedVars: jest.MockInstance<{ [key: string]: unknown; }, []>; getCustomBranding: jest.MockInstance<", + { + "pluginId": "@kbn/core-custom-branding-common", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingCommonPluginApi", + "section": "def-common.CustomBranding", + "text": "CustomBranding" + }, + ", []>; } & ", "InternalInjectedMetadataSetup" ], "path": "packages/core/test-helpers/core-test-helpers-http-setup-browser/src/http_test_setup.ts", diff --git a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx index c7619c33df816..78c541af15429 100644 --- a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx +++ b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-http-setup-browser title: "@kbn/core-test-helpers-http-setup-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-http-setup-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-http-setup-browser'] --- import kbnCoreTestHelpersHttpSetupBrowserObj from './kbn_core_test_helpers_http_setup_browser.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_kbn_server.mdx b/api_docs/kbn_core_test_helpers_kbn_server.mdx index 377db9c757691..d9f45fafbbe9f 100644 --- a/api_docs/kbn_core_test_helpers_kbn_server.mdx +++ b/api_docs/kbn_core_test_helpers_kbn_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-kbn-server title: "@kbn/core-test-helpers-kbn-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-kbn-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-kbn-server'] --- import kbnCoreTestHelpersKbnServerObj from './kbn_core_test_helpers_kbn_server.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_so_type_serializer.mdx b/api_docs/kbn_core_test_helpers_so_type_serializer.mdx index 4a81c4a347c92..fbde2eb58dcea 100644 --- a/api_docs/kbn_core_test_helpers_so_type_serializer.mdx +++ b/api_docs/kbn_core_test_helpers_so_type_serializer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-so-type-serializer title: "@kbn/core-test-helpers-so-type-serializer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-so-type-serializer plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-so-type-serializer'] --- import kbnCoreTestHelpersSoTypeSerializerObj from './kbn_core_test_helpers_so_type_serializer.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_test_utils.mdx b/api_docs/kbn_core_test_helpers_test_utils.mdx index ffe3ed28d60aa..040ff81ad65e1 100644 --- a/api_docs/kbn_core_test_helpers_test_utils.mdx +++ b/api_docs/kbn_core_test_helpers_test_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-test-utils title: "@kbn/core-test-helpers-test-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-test-utils plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-test-utils'] --- import kbnCoreTestHelpersTestUtilsObj from './kbn_core_test_helpers_test_utils.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser.mdx b/api_docs/kbn_core_theme_browser.mdx index d053175800787..a3cd7c54ce988 100644 --- a/api_docs/kbn_core_theme_browser.mdx +++ b/api_docs/kbn_core_theme_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser title: "@kbn/core-theme-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser'] --- import kbnCoreThemeBrowserObj from './kbn_core_theme_browser.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser_internal.mdx b/api_docs/kbn_core_theme_browser_internal.mdx index 4dbbd543b43cf..5191afb6a40c7 100644 --- a/api_docs/kbn_core_theme_browser_internal.mdx +++ b/api_docs/kbn_core_theme_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-internal title: "@kbn/core-theme-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-internal'] --- import kbnCoreThemeBrowserInternalObj from './kbn_core_theme_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser_mocks.mdx b/api_docs/kbn_core_theme_browser_mocks.mdx index f10c1daa9e6ed..5d681f2ec548e 100644 --- a/api_docs/kbn_core_theme_browser_mocks.mdx +++ b/api_docs/kbn_core_theme_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-mocks title: "@kbn/core-theme-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-mocks'] --- import kbnCoreThemeBrowserMocksObj from './kbn_core_theme_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser.mdx b/api_docs/kbn_core_ui_settings_browser.mdx index c86440e72a2a2..2c30b9fd9a5c0 100644 --- a/api_docs/kbn_core_ui_settings_browser.mdx +++ b/api_docs/kbn_core_ui_settings_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser title: "@kbn/core-ui-settings-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser'] --- import kbnCoreUiSettingsBrowserObj from './kbn_core_ui_settings_browser.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser_internal.mdx b/api_docs/kbn_core_ui_settings_browser_internal.mdx index 40c85d9360d3a..35d7a82694f12 100644 --- a/api_docs/kbn_core_ui_settings_browser_internal.mdx +++ b/api_docs/kbn_core_ui_settings_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-internal title: "@kbn/core-ui-settings-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-internal'] --- import kbnCoreUiSettingsBrowserInternalObj from './kbn_core_ui_settings_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser_mocks.mdx b/api_docs/kbn_core_ui_settings_browser_mocks.mdx index 0f6ce5faab66d..1eafee1472bfd 100644 --- a/api_docs/kbn_core_ui_settings_browser_mocks.mdx +++ b/api_docs/kbn_core_ui_settings_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-mocks title: "@kbn/core-ui-settings-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-mocks'] --- import kbnCoreUiSettingsBrowserMocksObj from './kbn_core_ui_settings_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_common.mdx b/api_docs/kbn_core_ui_settings_common.mdx index 3313d0571f4a1..ea06b4a04883d 100644 --- a/api_docs/kbn_core_ui_settings_common.mdx +++ b/api_docs/kbn_core_ui_settings_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-common title: "@kbn/core-ui-settings-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-common plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-common'] --- import kbnCoreUiSettingsCommonObj from './kbn_core_ui_settings_common.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server.mdx b/api_docs/kbn_core_ui_settings_server.mdx index 932595659710f..fc200c5f1bcdb 100644 --- a/api_docs/kbn_core_ui_settings_server.mdx +++ b/api_docs/kbn_core_ui_settings_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server title: "@kbn/core-ui-settings-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server'] --- import kbnCoreUiSettingsServerObj from './kbn_core_ui_settings_server.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server_internal.mdx b/api_docs/kbn_core_ui_settings_server_internal.mdx index a7d2426893e07..e18e1c6f98002 100644 --- a/api_docs/kbn_core_ui_settings_server_internal.mdx +++ b/api_docs/kbn_core_ui_settings_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server-internal title: "@kbn/core-ui-settings-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server-internal'] --- import kbnCoreUiSettingsServerInternalObj from './kbn_core_ui_settings_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server_mocks.mdx b/api_docs/kbn_core_ui_settings_server_mocks.mdx index 9c16cc78d0e5e..07b11304a88bf 100644 --- a/api_docs/kbn_core_ui_settings_server_mocks.mdx +++ b/api_docs/kbn_core_ui_settings_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server-mocks title: "@kbn/core-ui-settings-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server-mocks'] --- import kbnCoreUiSettingsServerMocksObj from './kbn_core_ui_settings_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server.mdx b/api_docs/kbn_core_usage_data_server.mdx index 16c02c6d1bfff..21f5d3c444b16 100644 --- a/api_docs/kbn_core_usage_data_server.mdx +++ b/api_docs/kbn_core_usage_data_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server title: "@kbn/core-usage-data-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server'] --- import kbnCoreUsageDataServerObj from './kbn_core_usage_data_server.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server_internal.mdx b/api_docs/kbn_core_usage_data_server_internal.mdx index 1f04b45aad738..ba4297a67861b 100644 --- a/api_docs/kbn_core_usage_data_server_internal.mdx +++ b/api_docs/kbn_core_usage_data_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server-internal title: "@kbn/core-usage-data-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server-internal plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server-internal'] --- import kbnCoreUsageDataServerInternalObj from './kbn_core_usage_data_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server_mocks.mdx b/api_docs/kbn_core_usage_data_server_mocks.mdx index 35474866467fc..53c498965747e 100644 --- a/api_docs/kbn_core_usage_data_server_mocks.mdx +++ b/api_docs/kbn_core_usage_data_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server-mocks title: "@kbn/core-usage-data-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server-mocks'] --- import kbnCoreUsageDataServerMocksObj from './kbn_core_usage_data_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_crypto.mdx b/api_docs/kbn_crypto.mdx index 1511054fc237b..7e723c553f8fd 100644 --- a/api_docs/kbn_crypto.mdx +++ b/api_docs/kbn_crypto.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto title: "@kbn/crypto" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto'] --- import kbnCryptoObj from './kbn_crypto.devdocs.json'; diff --git a/api_docs/kbn_crypto_browser.mdx b/api_docs/kbn_crypto_browser.mdx index 8b8f24df354a1..211fecee9d022 100644 --- a/api_docs/kbn_crypto_browser.mdx +++ b/api_docs/kbn_crypto_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto-browser title: "@kbn/crypto-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto-browser plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto-browser'] --- import kbnCryptoBrowserObj from './kbn_crypto_browser.devdocs.json'; diff --git a/api_docs/kbn_cypress_config.mdx b/api_docs/kbn_cypress_config.mdx index 20ff6a27c2a59..e5294bd6aef3f 100644 --- a/api_docs/kbn_cypress_config.mdx +++ b/api_docs/kbn_cypress_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cypress-config title: "@kbn/cypress-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cypress-config plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cypress-config'] --- import kbnCypressConfigObj from './kbn_cypress_config.devdocs.json'; diff --git a/api_docs/kbn_datemath.mdx b/api_docs/kbn_datemath.mdx index 7490dee981669..5603f313d4d30 100644 --- a/api_docs/kbn_datemath.mdx +++ b/api_docs/kbn_datemath.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-datemath title: "@kbn/datemath" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/datemath plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/datemath'] --- import kbnDatemathObj from './kbn_datemath.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_errors.mdx b/api_docs/kbn_dev_cli_errors.mdx index 075c0623b9bdf..0ea72d71dcf20 100644 --- a/api_docs/kbn_dev_cli_errors.mdx +++ b/api_docs/kbn_dev_cli_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-errors title: "@kbn/dev-cli-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-errors plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-errors'] --- import kbnDevCliErrorsObj from './kbn_dev_cli_errors.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_runner.mdx b/api_docs/kbn_dev_cli_runner.mdx index 30dc470a3e0ee..86e5025a4cf9e 100644 --- a/api_docs/kbn_dev_cli_runner.mdx +++ b/api_docs/kbn_dev_cli_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-runner title: "@kbn/dev-cli-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-runner plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-runner'] --- import kbnDevCliRunnerObj from './kbn_dev_cli_runner.devdocs.json'; diff --git a/api_docs/kbn_dev_proc_runner.mdx b/api_docs/kbn_dev_proc_runner.mdx index 1fbca47799267..14df44f7eaa64 100644 --- a/api_docs/kbn_dev_proc_runner.mdx +++ b/api_docs/kbn_dev_proc_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-proc-runner title: "@kbn/dev-proc-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-proc-runner plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-proc-runner'] --- import kbnDevProcRunnerObj from './kbn_dev_proc_runner.devdocs.json'; diff --git a/api_docs/kbn_dev_utils.mdx b/api_docs/kbn_dev_utils.mdx index 4ce6137fe9130..01a7f8781a023 100644 --- a/api_docs/kbn_dev_utils.mdx +++ b/api_docs/kbn_dev_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-utils title: "@kbn/dev-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-utils plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-utils'] --- import kbnDevUtilsObj from './kbn_dev_utils.devdocs.json'; diff --git a/api_docs/kbn_doc_links.mdx b/api_docs/kbn_doc_links.mdx index 028ab4b6dc790..42e168f91385c 100644 --- a/api_docs/kbn_doc_links.mdx +++ b/api_docs/kbn_doc_links.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-doc-links title: "@kbn/doc-links" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/doc-links plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/doc-links'] --- import kbnDocLinksObj from './kbn_doc_links.devdocs.json'; diff --git a/api_docs/kbn_docs_utils.mdx b/api_docs/kbn_docs_utils.mdx index 278278ba74947..75bba8bc6d90a 100644 --- a/api_docs/kbn_docs_utils.mdx +++ b/api_docs/kbn_docs_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-docs-utils title: "@kbn/docs-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/docs-utils plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/docs-utils'] --- import kbnDocsUtilsObj from './kbn_docs_utils.devdocs.json'; diff --git a/api_docs/kbn_ebt_tools.mdx b/api_docs/kbn_ebt_tools.mdx index 0bdbaf935e7c0..795f89c271b91 100644 --- a/api_docs/kbn_ebt_tools.mdx +++ b/api_docs/kbn_ebt_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ebt-tools title: "@kbn/ebt-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ebt-tools plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ebt-tools'] --- import kbnEbtToolsObj from './kbn_ebt_tools.devdocs.json'; diff --git a/api_docs/kbn_ecs.mdx b/api_docs/kbn_ecs.mdx index ec6225ce47b33..56f1438e7fd1b 100644 --- a/api_docs/kbn_ecs.mdx +++ b/api_docs/kbn_ecs.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ecs title: "@kbn/ecs" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ecs plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ecs'] --- import kbnEcsObj from './kbn_ecs.devdocs.json'; diff --git a/api_docs/kbn_es.mdx b/api_docs/kbn_es.mdx index 2b4213d68adbc..bf5c42f560227 100644 --- a/api_docs/kbn_es.mdx +++ b/api_docs/kbn_es.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es title: "@kbn/es" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es'] --- import kbnEsObj from './kbn_es.devdocs.json'; diff --git a/api_docs/kbn_es_archiver.mdx b/api_docs/kbn_es_archiver.mdx index 253affb0bf008..ca2c822508a8f 100644 --- a/api_docs/kbn_es_archiver.mdx +++ b/api_docs/kbn_es_archiver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-archiver title: "@kbn/es-archiver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-archiver plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-archiver'] --- import kbnEsArchiverObj from './kbn_es_archiver.devdocs.json'; diff --git a/api_docs/kbn_es_errors.mdx b/api_docs/kbn_es_errors.mdx index 33def74bd7036..cf97a58b9761f 100644 --- a/api_docs/kbn_es_errors.mdx +++ b/api_docs/kbn_es_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-errors title: "@kbn/es-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-errors plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-errors'] --- import kbnEsErrorsObj from './kbn_es_errors.devdocs.json'; diff --git a/api_docs/kbn_es_query.mdx b/api_docs/kbn_es_query.mdx index 09c1abfa49dd8..32b07ed11166d 100644 --- a/api_docs/kbn_es_query.mdx +++ b/api_docs/kbn_es_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-query title: "@kbn/es-query" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-query plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-query'] --- import kbnEsQueryObj from './kbn_es_query.devdocs.json'; diff --git a/api_docs/kbn_es_types.mdx b/api_docs/kbn_es_types.mdx index 9f8174d669308..614df933cb04c 100644 --- a/api_docs/kbn_es_types.mdx +++ b/api_docs/kbn_es_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-types title: "@kbn/es-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-types plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-types'] --- import kbnEsTypesObj from './kbn_es_types.devdocs.json'; diff --git a/api_docs/kbn_eslint_plugin_imports.mdx b/api_docs/kbn_eslint_plugin_imports.mdx index 966a2970a5bb5..0c96e8a80cc52 100644 --- a/api_docs/kbn_eslint_plugin_imports.mdx +++ b/api_docs/kbn_eslint_plugin_imports.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-eslint-plugin-imports title: "@kbn/eslint-plugin-imports" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/eslint-plugin-imports plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/eslint-plugin-imports'] --- import kbnEslintPluginImportsObj from './kbn_eslint_plugin_imports.devdocs.json'; diff --git a/api_docs/kbn_field_types.mdx b/api_docs/kbn_field_types.mdx index bdb540b654281..3de1b6dad9431 100644 --- a/api_docs/kbn_field_types.mdx +++ b/api_docs/kbn_field_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-field-types title: "@kbn/field-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/field-types plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-types'] --- import kbnFieldTypesObj from './kbn_field_types.devdocs.json'; diff --git a/api_docs/kbn_find_used_node_modules.mdx b/api_docs/kbn_find_used_node_modules.mdx index 39497a8e42258..7004fc837c9a3 100644 --- a/api_docs/kbn_find_used_node_modules.mdx +++ b/api_docs/kbn_find_used_node_modules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-find-used-node-modules title: "@kbn/find-used-node-modules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/find-used-node-modules plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/find-used-node-modules'] --- import kbnFindUsedNodeModulesObj from './kbn_find_used_node_modules.devdocs.json'; diff --git a/api_docs/kbn_ftr_common_functional_services.mdx b/api_docs/kbn_ftr_common_functional_services.mdx index 8e1a0fe82c519..01e66072950d5 100644 --- a/api_docs/kbn_ftr_common_functional_services.mdx +++ b/api_docs/kbn_ftr_common_functional_services.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ftr-common-functional-services title: "@kbn/ftr-common-functional-services" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ftr-common-functional-services plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ftr-common-functional-services'] --- import kbnFtrCommonFunctionalServicesObj from './kbn_ftr_common_functional_services.devdocs.json'; diff --git a/api_docs/kbn_generate.mdx b/api_docs/kbn_generate.mdx index af19948d1ab16..6e36af98c2b25 100644 --- a/api_docs/kbn_generate.mdx +++ b/api_docs/kbn_generate.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate title: "@kbn/generate" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate'] --- import kbnGenerateObj from './kbn_generate.devdocs.json'; diff --git a/api_docs/kbn_get_repo_files.devdocs.json b/api_docs/kbn_get_repo_files.devdocs.json index f246288cf40ce..e578f06b33325 100644 --- a/api_docs/kbn_get_repo_files.devdocs.json +++ b/api_docs/kbn_get_repo_files.devdocs.json @@ -80,6 +80,68 @@ ], "returnComment": [], "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/get-repo-files", + "id": "def-common.getRepoFilesSync", + "type": "Function", + "tags": [], + "label": "getRepoFilesSync", + "description": [ + "\nSynchronously list the files in the repo, only including files which are manged by version\ncontrol or \"untracked\" (new, not committed, and not ignored)." + ], + "signature": [ + "(include: string[] | undefined, exclude: string[] | undefined) => Set<", + { + "pluginId": "@kbn/repo-path", + "scope": "common", + "docId": "kibKbnRepoPathPluginApi", + "section": "def-common.RepoPath", + "text": "RepoPath" + }, + ">" + ], + "path": "packages/kbn-get-repo-files/src/get_repo_files.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/get-repo-files", + "id": "def-common.getRepoFilesSync.$1", + "type": "Array", + "tags": [], + "label": "include", + "description": [ + "limit the list to specfic absolute paths" + ], + "signature": [ + "string[] | undefined" + ], + "path": "packages/kbn-get-repo-files/src/get_repo_files.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + }, + { + "parentPluginId": "@kbn/get-repo-files", + "id": "def-common.getRepoFilesSync.$2", + "type": "Array", + "tags": [], + "label": "exclude", + "description": [ + "exclude specific absolute paths" + ], + "signature": [ + "string[] | undefined" + ], + "path": "packages/kbn-get-repo-files/src/get_repo_files.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [], + "initialIsOpen": false } ], "interfaces": [], diff --git a/api_docs/kbn_get_repo_files.mdx b/api_docs/kbn_get_repo_files.mdx index 5c4fc0a56023b..81825dfb130c6 100644 --- a/api_docs/kbn_get_repo_files.mdx +++ b/api_docs/kbn_get_repo_files.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-get-repo-files title: "@kbn/get-repo-files" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/get-repo-files plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/get-repo-files'] --- import kbnGetRepoFilesObj from './kbn_get_repo_files.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3 | 0 | 0 | 0 | +| 6 | 0 | 0 | 0 | ## Common diff --git a/api_docs/kbn_guided_onboarding.mdx b/api_docs/kbn_guided_onboarding.mdx index 7aeaeefe3516e..f39593690b62b 100644 --- a/api_docs/kbn_guided_onboarding.mdx +++ b/api_docs/kbn_guided_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-guided-onboarding title: "@kbn/guided-onboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/guided-onboarding plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/guided-onboarding'] --- import kbnGuidedOnboardingObj from './kbn_guided_onboarding.devdocs.json'; diff --git a/api_docs/kbn_handlebars.mdx b/api_docs/kbn_handlebars.mdx index 36707c8b77c28..175d33f29f431 100644 --- a/api_docs/kbn_handlebars.mdx +++ b/api_docs/kbn_handlebars.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-handlebars title: "@kbn/handlebars" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/handlebars plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/handlebars'] --- import kbnHandlebarsObj from './kbn_handlebars.devdocs.json'; diff --git a/api_docs/kbn_hapi_mocks.mdx b/api_docs/kbn_hapi_mocks.mdx index 8d330ff44e8df..fb06cb3915395 100644 --- a/api_docs/kbn_hapi_mocks.mdx +++ b/api_docs/kbn_hapi_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-hapi-mocks title: "@kbn/hapi-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/hapi-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/hapi-mocks'] --- import kbnHapiMocksObj from './kbn_hapi_mocks.devdocs.json'; diff --git a/api_docs/kbn_health_gateway_server.mdx b/api_docs/kbn_health_gateway_server.mdx index 6de5df7c5f0d9..7b7c640ddda00 100644 --- a/api_docs/kbn_health_gateway_server.mdx +++ b/api_docs/kbn_health_gateway_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-health-gateway-server title: "@kbn/health-gateway-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/health-gateway-server plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/health-gateway-server'] --- import kbnHealthGatewayServerObj from './kbn_health_gateway_server.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_card.mdx b/api_docs/kbn_home_sample_data_card.mdx index 1fa5fadc88d36..6fbf58f229bdc 100644 --- a/api_docs/kbn_home_sample_data_card.mdx +++ b/api_docs/kbn_home_sample_data_card.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-card title: "@kbn/home-sample-data-card" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-card plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-card'] --- import kbnHomeSampleDataCardObj from './kbn_home_sample_data_card.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_tab.mdx b/api_docs/kbn_home_sample_data_tab.mdx index 681683ea2be88..8919dfc0def03 100644 --- a/api_docs/kbn_home_sample_data_tab.mdx +++ b/api_docs/kbn_home_sample_data_tab.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-tab title: "@kbn/home-sample-data-tab" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-tab plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-tab'] --- import kbnHomeSampleDataTabObj from './kbn_home_sample_data_tab.devdocs.json'; diff --git a/api_docs/kbn_i18n.mdx b/api_docs/kbn_i18n.mdx index e7a9562b20788..3b19a55ea5ea0 100644 --- a/api_docs/kbn_i18n.mdx +++ b/api_docs/kbn_i18n.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-i18n title: "@kbn/i18n" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/i18n plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n'] --- import kbnI18nObj from './kbn_i18n.devdocs.json'; diff --git a/api_docs/kbn_i18n_react.mdx b/api_docs/kbn_i18n_react.mdx index 62b830a258d95..4569a96f2db3c 100644 --- a/api_docs/kbn_i18n_react.mdx +++ b/api_docs/kbn_i18n_react.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-i18n-react title: "@kbn/i18n-react" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/i18n-react plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n-react'] --- import kbnI18nReactObj from './kbn_i18n_react.devdocs.json'; diff --git a/api_docs/kbn_import_resolver.mdx b/api_docs/kbn_import_resolver.mdx index 312f33ef376c8..8a47f532fb1df 100644 --- a/api_docs/kbn_import_resolver.mdx +++ b/api_docs/kbn_import_resolver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-import-resolver title: "@kbn/import-resolver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/import-resolver plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/import-resolver'] --- import kbnImportResolverObj from './kbn_import_resolver.devdocs.json'; diff --git a/api_docs/kbn_interpreter.mdx b/api_docs/kbn_interpreter.mdx index a76a512b8e166..53d1ff42703c7 100644 --- a/api_docs/kbn_interpreter.mdx +++ b/api_docs/kbn_interpreter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-interpreter title: "@kbn/interpreter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/interpreter plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/interpreter'] --- import kbnInterpreterObj from './kbn_interpreter.devdocs.json'; diff --git a/api_docs/kbn_io_ts_utils.mdx b/api_docs/kbn_io_ts_utils.mdx index 7d2ff7a6c401d..1fed2565a7e93 100644 --- a/api_docs/kbn_io_ts_utils.mdx +++ b/api_docs/kbn_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-io-ts-utils title: "@kbn/io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/io-ts-utils plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/io-ts-utils'] --- import kbnIoTsUtilsObj from './kbn_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_jest_serializers.mdx b/api_docs/kbn_jest_serializers.mdx index d1a15f091432d..67b58ab1cfe92 100644 --- a/api_docs/kbn_jest_serializers.mdx +++ b/api_docs/kbn_jest_serializers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-jest-serializers title: "@kbn/jest-serializers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/jest-serializers plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/jest-serializers'] --- import kbnJestSerializersObj from './kbn_jest_serializers.devdocs.json'; diff --git a/api_docs/kbn_journeys.mdx b/api_docs/kbn_journeys.mdx index e65917718523e..9e55041c393e1 100644 --- a/api_docs/kbn_journeys.mdx +++ b/api_docs/kbn_journeys.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-journeys title: "@kbn/journeys" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/journeys plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/journeys'] --- import kbnJourneysObj from './kbn_journeys.devdocs.json'; diff --git a/api_docs/kbn_json_ast.mdx b/api_docs/kbn_json_ast.mdx index d07d38e17a7d7..48932fc4de9f1 100644 --- a/api_docs/kbn_json_ast.mdx +++ b/api_docs/kbn_json_ast.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-json-ast title: "@kbn/json-ast" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/json-ast plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/json-ast'] --- import kbnJsonAstObj from './kbn_json_ast.devdocs.json'; diff --git a/api_docs/kbn_kibana_manifest_schema.mdx b/api_docs/kbn_kibana_manifest_schema.mdx index 4dfddbc166f13..c3bfd1e7e0568 100644 --- a/api_docs/kbn_kibana_manifest_schema.mdx +++ b/api_docs/kbn_kibana_manifest_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-kibana-manifest-schema title: "@kbn/kibana-manifest-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/kibana-manifest-schema plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/kibana-manifest-schema'] --- import kbnKibanaManifestSchemaObj from './kbn_kibana_manifest_schema.devdocs.json'; diff --git a/api_docs/kbn_language_documentation_popover.mdx b/api_docs/kbn_language_documentation_popover.mdx index 1191e4aa6a55f..fb35f0b157ef3 100644 --- a/api_docs/kbn_language_documentation_popover.mdx +++ b/api_docs/kbn_language_documentation_popover.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-language-documentation-popover title: "@kbn/language-documentation-popover" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/language-documentation-popover plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/language-documentation-popover'] --- import kbnLanguageDocumentationPopoverObj from './kbn_language_documentation_popover.devdocs.json'; diff --git a/api_docs/kbn_logging.mdx b/api_docs/kbn_logging.mdx index 508d0d09ecb6e..631ee6de7c81c 100644 --- a/api_docs/kbn_logging.mdx +++ b/api_docs/kbn_logging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging title: "@kbn/logging" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging'] --- import kbnLoggingObj from './kbn_logging.devdocs.json'; diff --git a/api_docs/kbn_logging_mocks.mdx b/api_docs/kbn_logging_mocks.mdx index 124ed2626001b..609ba19f182e5 100644 --- a/api_docs/kbn_logging_mocks.mdx +++ b/api_docs/kbn_logging_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging-mocks title: "@kbn/logging-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging-mocks'] --- import kbnLoggingMocksObj from './kbn_logging_mocks.devdocs.json'; diff --git a/api_docs/kbn_managed_vscode_config.mdx b/api_docs/kbn_managed_vscode_config.mdx index 414b50ce9a2ec..56c750070307f 100644 --- a/api_docs/kbn_managed_vscode_config.mdx +++ b/api_docs/kbn_managed_vscode_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-managed-vscode-config title: "@kbn/managed-vscode-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/managed-vscode-config plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/managed-vscode-config'] --- import kbnManagedVscodeConfigObj from './kbn_managed_vscode_config.devdocs.json'; diff --git a/api_docs/kbn_mapbox_gl.mdx b/api_docs/kbn_mapbox_gl.mdx index d4dd761d720fc..56f21f95e01a7 100644 --- a/api_docs/kbn_mapbox_gl.mdx +++ b/api_docs/kbn_mapbox_gl.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-mapbox-gl title: "@kbn/mapbox-gl" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/mapbox-gl plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/mapbox-gl'] --- import kbnMapboxGlObj from './kbn_mapbox_gl.devdocs.json'; diff --git a/api_docs/kbn_ml_agg_utils.mdx b/api_docs/kbn_ml_agg_utils.mdx index 2d1288274b555..50887eb29855e 100644 --- a/api_docs/kbn_ml_agg_utils.mdx +++ b/api_docs/kbn_ml_agg_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-agg-utils title: "@kbn/ml-agg-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-agg-utils plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-agg-utils'] --- import kbnMlAggUtilsObj from './kbn_ml_agg_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_is_defined.mdx b/api_docs/kbn_ml_is_defined.mdx index f100abc713589..d1de854ef8b9a 100644 --- a/api_docs/kbn_ml_is_defined.mdx +++ b/api_docs/kbn_ml_is_defined.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-is-defined title: "@kbn/ml-is-defined" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-is-defined plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-is-defined'] --- import kbnMlIsDefinedObj from './kbn_ml_is_defined.devdocs.json'; diff --git a/api_docs/kbn_ml_is_populated_object.mdx b/api_docs/kbn_ml_is_populated_object.mdx index be3584c217214..da5072896cf7d 100644 --- a/api_docs/kbn_ml_is_populated_object.mdx +++ b/api_docs/kbn_ml_is_populated_object.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-is-populated-object title: "@kbn/ml-is-populated-object" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-is-populated-object plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-is-populated-object'] --- import kbnMlIsPopulatedObjectObj from './kbn_ml_is_populated_object.devdocs.json'; diff --git a/api_docs/kbn_ml_local_storage.mdx b/api_docs/kbn_ml_local_storage.mdx index ea462f4b1d07d..478e877e93303 100644 --- a/api_docs/kbn_ml_local_storage.mdx +++ b/api_docs/kbn_ml_local_storage.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-local-storage title: "@kbn/ml-local-storage" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-local-storage plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-local-storage'] --- import kbnMlLocalStorageObj from './kbn_ml_local_storage.devdocs.json'; diff --git a/api_docs/kbn_ml_nested_property.mdx b/api_docs/kbn_ml_nested_property.mdx index 21544c038df69..873df90573bbd 100644 --- a/api_docs/kbn_ml_nested_property.mdx +++ b/api_docs/kbn_ml_nested_property.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-nested-property title: "@kbn/ml-nested-property" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-nested-property plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-nested-property'] --- import kbnMlNestedPropertyObj from './kbn_ml_nested_property.devdocs.json'; diff --git a/api_docs/kbn_ml_string_hash.mdx b/api_docs/kbn_ml_string_hash.mdx index a6851f59cd1ee..41a9ff49d87a6 100644 --- a/api_docs/kbn_ml_string_hash.mdx +++ b/api_docs/kbn_ml_string_hash.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-string-hash title: "@kbn/ml-string-hash" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-string-hash plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-string-hash'] --- import kbnMlStringHashObj from './kbn_ml_string_hash.devdocs.json'; diff --git a/api_docs/kbn_ml_url_state.mdx b/api_docs/kbn_ml_url_state.mdx index 6dea1b2821486..c0c3f747c9974 100644 --- a/api_docs/kbn_ml_url_state.mdx +++ b/api_docs/kbn_ml_url_state.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-url-state title: "@kbn/ml-url-state" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-url-state plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-url-state'] --- import kbnMlUrlStateObj from './kbn_ml_url_state.devdocs.json'; diff --git a/api_docs/kbn_monaco.mdx b/api_docs/kbn_monaco.mdx index 5965a59f23872..43650397dd823 100644 --- a/api_docs/kbn_monaco.mdx +++ b/api_docs/kbn_monaco.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-monaco title: "@kbn/monaco" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/monaco plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/monaco'] --- import kbnMonacoObj from './kbn_monaco.devdocs.json'; diff --git a/api_docs/kbn_optimizer.mdx b/api_docs/kbn_optimizer.mdx index f4fc4b71b7407..e82a381200f88 100644 --- a/api_docs/kbn_optimizer.mdx +++ b/api_docs/kbn_optimizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer title: "@kbn/optimizer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer'] --- import kbnOptimizerObj from './kbn_optimizer.devdocs.json'; diff --git a/api_docs/kbn_optimizer_webpack_helpers.mdx b/api_docs/kbn_optimizer_webpack_helpers.mdx index 5f28aa2b6d039..2df99839df954 100644 --- a/api_docs/kbn_optimizer_webpack_helpers.mdx +++ b/api_docs/kbn_optimizer_webpack_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer-webpack-helpers title: "@kbn/optimizer-webpack-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer-webpack-helpers plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer-webpack-helpers'] --- import kbnOptimizerWebpackHelpersObj from './kbn_optimizer_webpack_helpers.devdocs.json'; diff --git a/api_docs/kbn_osquery_io_ts_types.mdx b/api_docs/kbn_osquery_io_ts_types.mdx index 79ac9ba088f52..c5bbd4649e708 100644 --- a/api_docs/kbn_osquery_io_ts_types.mdx +++ b/api_docs/kbn_osquery_io_ts_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-osquery-io-ts-types title: "@kbn/osquery-io-ts-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/osquery-io-ts-types plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/osquery-io-ts-types'] --- import kbnOsqueryIoTsTypesObj from './kbn_osquery_io_ts_types.devdocs.json'; diff --git a/api_docs/kbn_performance_testing_dataset_extractor.mdx b/api_docs/kbn_performance_testing_dataset_extractor.mdx index 791b940a86fed..682406ab007c8 100644 --- a/api_docs/kbn_performance_testing_dataset_extractor.mdx +++ b/api_docs/kbn_performance_testing_dataset_extractor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-performance-testing-dataset-extractor title: "@kbn/performance-testing-dataset-extractor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/performance-testing-dataset-extractor plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/performance-testing-dataset-extractor'] --- import kbnPerformanceTestingDatasetExtractorObj from './kbn_performance_testing_dataset_extractor.devdocs.json'; diff --git a/api_docs/kbn_plugin_generator.mdx b/api_docs/kbn_plugin_generator.mdx index c7d476799031c..52329ba1b3305 100644 --- a/api_docs/kbn_plugin_generator.mdx +++ b/api_docs/kbn_plugin_generator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-generator title: "@kbn/plugin-generator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-generator plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-generator'] --- import kbnPluginGeneratorObj from './kbn_plugin_generator.devdocs.json'; diff --git a/api_docs/kbn_plugin_helpers.mdx b/api_docs/kbn_plugin_helpers.mdx index 94157180d9be2..8da242310264a 100644 --- a/api_docs/kbn_plugin_helpers.mdx +++ b/api_docs/kbn_plugin_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-helpers title: "@kbn/plugin-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-helpers plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-helpers'] --- import kbnPluginHelpersObj from './kbn_plugin_helpers.devdocs.json'; diff --git a/api_docs/kbn_react_field.mdx b/api_docs/kbn_react_field.mdx index 090f519f4877a..d5f376107dff8 100644 --- a/api_docs/kbn_react_field.mdx +++ b/api_docs/kbn_react_field.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-field title: "@kbn/react-field" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-field plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-field'] --- import kbnReactFieldObj from './kbn_react_field.devdocs.json'; diff --git a/api_docs/kbn_repo_file_maps.mdx b/api_docs/kbn_repo_file_maps.mdx index 0c36bc2ac001f..e8eeb2c0f2ef9 100644 --- a/api_docs/kbn_repo_file_maps.mdx +++ b/api_docs/kbn_repo_file_maps.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-file-maps title: "@kbn/repo-file-maps" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-file-maps plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-file-maps'] --- import kbnRepoFileMapsObj from './kbn_repo_file_maps.devdocs.json'; diff --git a/api_docs/kbn_repo_linter.mdx b/api_docs/kbn_repo_linter.mdx index cda5c837dcb2d..eda376798c73f 100644 --- a/api_docs/kbn_repo_linter.mdx +++ b/api_docs/kbn_repo_linter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-linter title: "@kbn/repo-linter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-linter plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-linter'] --- import kbnRepoLinterObj from './kbn_repo_linter.devdocs.json'; diff --git a/api_docs/kbn_repo_path.mdx b/api_docs/kbn_repo_path.mdx index b7483bfa8f28d..a729e5bb0f6a3 100644 --- a/api_docs/kbn_repo_path.mdx +++ b/api_docs/kbn_repo_path.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-path title: "@kbn/repo-path" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-path plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-path'] --- import kbnRepoPathObj from './kbn_repo_path.devdocs.json'; diff --git a/api_docs/kbn_repo_source_classifier.mdx b/api_docs/kbn_repo_source_classifier.mdx index b690383772b28..6730c455dee30 100644 --- a/api_docs/kbn_repo_source_classifier.mdx +++ b/api_docs/kbn_repo_source_classifier.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-source-classifier title: "@kbn/repo-source-classifier" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-source-classifier plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-source-classifier'] --- import kbnRepoSourceClassifierObj from './kbn_repo_source_classifier.devdocs.json'; diff --git a/api_docs/kbn_rison.mdx b/api_docs/kbn_rison.mdx index 16e3c28363af7..3e655ba3f8975 100644 --- a/api_docs/kbn_rison.mdx +++ b/api_docs/kbn_rison.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rison title: "@kbn/rison" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rison plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rison'] --- import kbnRisonObj from './kbn_rison.devdocs.json'; diff --git a/api_docs/kbn_rule_data_utils.mdx b/api_docs/kbn_rule_data_utils.mdx index b3b281db95db0..672dd101ccf64 100644 --- a/api_docs/kbn_rule_data_utils.mdx +++ b/api_docs/kbn_rule_data_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rule-data-utils title: "@kbn/rule-data-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rule-data-utils plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rule-data-utils'] --- import kbnRuleDataUtilsObj from './kbn_rule_data_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_autocomplete.mdx b/api_docs/kbn_securitysolution_autocomplete.mdx index e3ccd5e164e1e..5877a8e3843c4 100644 --- a/api_docs/kbn_securitysolution_autocomplete.mdx +++ b/api_docs/kbn_securitysolution_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-autocomplete title: "@kbn/securitysolution-autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-autocomplete plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-autocomplete'] --- import kbnSecuritysolutionAutocompleteObj from './kbn_securitysolution_autocomplete.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_es_utils.mdx b/api_docs/kbn_securitysolution_es_utils.mdx index 62607d61d68a8..96df90e45a865 100644 --- a/api_docs/kbn_securitysolution_es_utils.mdx +++ b/api_docs/kbn_securitysolution_es_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-es-utils title: "@kbn/securitysolution-es-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-es-utils plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-es-utils'] --- import kbnSecuritysolutionEsUtilsObj from './kbn_securitysolution_es_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_exception_list_components.mdx b/api_docs/kbn_securitysolution_exception_list_components.mdx index 819db32cf312e..693589f33947e 100644 --- a/api_docs/kbn_securitysolution_exception_list_components.mdx +++ b/api_docs/kbn_securitysolution_exception_list_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-exception-list-components title: "@kbn/securitysolution-exception-list-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-exception-list-components plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-exception-list-components'] --- import kbnSecuritysolutionExceptionListComponentsObj from './kbn_securitysolution_exception_list_components.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_hook_utils.mdx b/api_docs/kbn_securitysolution_hook_utils.mdx index c68bb7078568c..34b3e36de6dc1 100644 --- a/api_docs/kbn_securitysolution_hook_utils.mdx +++ b/api_docs/kbn_securitysolution_hook_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-hook-utils title: "@kbn/securitysolution-hook-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-hook-utils plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-hook-utils'] --- import kbnSecuritysolutionHookUtilsObj from './kbn_securitysolution_hook_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx index 7666a4f982388..a4a68cbd6da50 100644 --- a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-alerting-types title: "@kbn/securitysolution-io-ts-alerting-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-alerting-types plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-alerting-types'] --- import kbnSecuritysolutionIoTsAlertingTypesObj from './kbn_securitysolution_io_ts_alerting_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_list_types.mdx b/api_docs/kbn_securitysolution_io_ts_list_types.mdx index aea7d4c025422..fe1e76e355153 100644 --- a/api_docs/kbn_securitysolution_io_ts_list_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_list_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-list-types title: "@kbn/securitysolution-io-ts-list-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-list-types plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-list-types'] --- import kbnSecuritysolutionIoTsListTypesObj from './kbn_securitysolution_io_ts_list_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_types.mdx b/api_docs/kbn_securitysolution_io_ts_types.mdx index b03bceac91d95..503d18d8be7b5 100644 --- a/api_docs/kbn_securitysolution_io_ts_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-types title: "@kbn/securitysolution-io-ts-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-types plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-types'] --- import kbnSecuritysolutionIoTsTypesObj from './kbn_securitysolution_io_ts_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_utils.mdx b/api_docs/kbn_securitysolution_io_ts_utils.mdx index fc769b9f42dc6..6173e5809099a 100644 --- a/api_docs/kbn_securitysolution_io_ts_utils.mdx +++ b/api_docs/kbn_securitysolution_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-utils title: "@kbn/securitysolution-io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-utils plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-utils'] --- import kbnSecuritysolutionIoTsUtilsObj from './kbn_securitysolution_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_api.mdx b/api_docs/kbn_securitysolution_list_api.mdx index 03bd392706ef9..112a9f11031c1 100644 --- a/api_docs/kbn_securitysolution_list_api.mdx +++ b/api_docs/kbn_securitysolution_list_api.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-api title: "@kbn/securitysolution-list-api" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-api plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-api'] --- import kbnSecuritysolutionListApiObj from './kbn_securitysolution_list_api.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_constants.mdx b/api_docs/kbn_securitysolution_list_constants.mdx index 75919889199cd..316a8552affbc 100644 --- a/api_docs/kbn_securitysolution_list_constants.mdx +++ b/api_docs/kbn_securitysolution_list_constants.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-constants title: "@kbn/securitysolution-list-constants" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-constants plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-constants'] --- import kbnSecuritysolutionListConstantsObj from './kbn_securitysolution_list_constants.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_hooks.mdx b/api_docs/kbn_securitysolution_list_hooks.mdx index 4c5884d6357c0..7ca460db697ab 100644 --- a/api_docs/kbn_securitysolution_list_hooks.mdx +++ b/api_docs/kbn_securitysolution_list_hooks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-hooks title: "@kbn/securitysolution-list-hooks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-hooks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-hooks'] --- import kbnSecuritysolutionListHooksObj from './kbn_securitysolution_list_hooks.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_utils.mdx b/api_docs/kbn_securitysolution_list_utils.mdx index 77706bb4d9d62..6f21fc1fdccfd 100644 --- a/api_docs/kbn_securitysolution_list_utils.mdx +++ b/api_docs/kbn_securitysolution_list_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-utils title: "@kbn/securitysolution-list-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-utils plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-utils'] --- import kbnSecuritysolutionListUtilsObj from './kbn_securitysolution_list_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_rules.mdx b/api_docs/kbn_securitysolution_rules.mdx index 8d3cd5505ab31..0b5f840bcf193 100644 --- a/api_docs/kbn_securitysolution_rules.mdx +++ b/api_docs/kbn_securitysolution_rules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-rules title: "@kbn/securitysolution-rules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-rules plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-rules'] --- import kbnSecuritysolutionRulesObj from './kbn_securitysolution_rules.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_t_grid.mdx b/api_docs/kbn_securitysolution_t_grid.mdx index ec5b14c5f2505..112872b232283 100644 --- a/api_docs/kbn_securitysolution_t_grid.mdx +++ b/api_docs/kbn_securitysolution_t_grid.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-t-grid title: "@kbn/securitysolution-t-grid" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-t-grid plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-t-grid'] --- import kbnSecuritysolutionTGridObj from './kbn_securitysolution_t_grid.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_utils.mdx b/api_docs/kbn_securitysolution_utils.mdx index d0fd92a74cb79..c3f23620fdbd6 100644 --- a/api_docs/kbn_securitysolution_utils.mdx +++ b/api_docs/kbn_securitysolution_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-utils title: "@kbn/securitysolution-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-utils plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-utils'] --- import kbnSecuritysolutionUtilsObj from './kbn_securitysolution_utils.devdocs.json'; diff --git a/api_docs/kbn_server_http_tools.mdx b/api_docs/kbn_server_http_tools.mdx index 8c20b875f3c09..2242aa44e8d3a 100644 --- a/api_docs/kbn_server_http_tools.mdx +++ b/api_docs/kbn_server_http_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-http-tools title: "@kbn/server-http-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-http-tools plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-http-tools'] --- import kbnServerHttpToolsObj from './kbn_server_http_tools.devdocs.json'; diff --git a/api_docs/kbn_server_route_repository.mdx b/api_docs/kbn_server_route_repository.mdx index 365b77b34a9ae..f26fa852e0cbd 100644 --- a/api_docs/kbn_server_route_repository.mdx +++ b/api_docs/kbn_server_route_repository.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository title: "@kbn/server-route-repository" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-route-repository plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository'] --- import kbnServerRouteRepositoryObj from './kbn_server_route_repository.devdocs.json'; diff --git a/api_docs/kbn_shared_svg.mdx b/api_docs/kbn_shared_svg.mdx index 8dff33d0d1ccb..dbb69746d6fd8 100644 --- a/api_docs/kbn_shared_svg.mdx +++ b/api_docs/kbn_shared_svg.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-svg title: "@kbn/shared-svg" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-svg plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-svg'] --- import kbnSharedSvgObj from './kbn_shared_svg.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_avatar_solution.mdx b/api_docs/kbn_shared_ux_avatar_solution.mdx index afe1927a858b6..82e6d923373f2 100644 --- a/api_docs/kbn_shared_ux_avatar_solution.mdx +++ b/api_docs/kbn_shared_ux_avatar_solution.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-avatar-solution title: "@kbn/shared-ux-avatar-solution" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-avatar-solution plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-avatar-solution'] --- import kbnSharedUxAvatarSolutionObj from './kbn_shared_ux_avatar_solution.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx b/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx index 6f29c0670edcb..b5b0b98346411 100644 --- a/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx +++ b/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-avatar-user-profile-components title: "@kbn/shared-ux-avatar-user-profile-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-avatar-user-profile-components plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-avatar-user-profile-components'] --- import kbnSharedUxAvatarUserProfileComponentsObj from './kbn_shared_ux_avatar_user_profile_components.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen.mdx b/api_docs/kbn_shared_ux_button_exit_full_screen.mdx index 1db1a0e8fac12..1eedd6bfe10e7 100644 --- a/api_docs/kbn_shared_ux_button_exit_full_screen.mdx +++ b/api_docs/kbn_shared_ux_button_exit_full_screen.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-exit-full-screen title: "@kbn/shared-ux-button-exit-full-screen" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-exit-full-screen plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-exit-full-screen'] --- import kbnSharedUxButtonExitFullScreenObj from './kbn_shared_ux_button_exit_full_screen.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx index 6f5e6cda7b67b..9a3a40b044418 100644 --- a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx +++ b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-exit-full-screen-mocks title: "@kbn/shared-ux-button-exit-full-screen-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-exit-full-screen-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-exit-full-screen-mocks'] --- import kbnSharedUxButtonExitFullScreenMocksObj from './kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_toolbar.mdx b/api_docs/kbn_shared_ux_button_toolbar.mdx index a63c1e981385e..54f4a1d901d7d 100644 --- a/api_docs/kbn_shared_ux_button_toolbar.mdx +++ b/api_docs/kbn_shared_ux_button_toolbar.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-toolbar title: "@kbn/shared-ux-button-toolbar" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-toolbar plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-toolbar'] --- import kbnSharedUxButtonToolbarObj from './kbn_shared_ux_button_toolbar.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data.mdx b/api_docs/kbn_shared_ux_card_no_data.mdx index d6219960caa07..9eddb5bc08490 100644 --- a/api_docs/kbn_shared_ux_card_no_data.mdx +++ b/api_docs/kbn_shared_ux_card_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data title: "@kbn/shared-ux-card-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-card-no-data plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data'] --- import kbnSharedUxCardNoDataObj from './kbn_shared_ux_card_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx index a8ac72393ad6b..d489ec6f6e102 100644 --- a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data-mocks title: "@kbn/shared-ux-card-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-card-no-data-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data-mocks'] --- import kbnSharedUxCardNoDataMocksObj from './kbn_shared_ux_card_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_context.mdx b/api_docs/kbn_shared_ux_file_context.mdx index 1162117d58911..2a16308999e0f 100644 --- a/api_docs/kbn_shared_ux_file_context.mdx +++ b/api_docs/kbn_shared_ux_file_context.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-context title: "@kbn/shared-ux-file-context" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-context plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-context'] --- import kbnSharedUxFileContextObj from './kbn_shared_ux_file_context.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_image.mdx b/api_docs/kbn_shared_ux_file_image.mdx index 0e1954ddf4c70..9c098147ec2a5 100644 --- a/api_docs/kbn_shared_ux_file_image.mdx +++ b/api_docs/kbn_shared_ux_file_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-image title: "@kbn/shared-ux-file-image" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-image plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-image'] --- import kbnSharedUxFileImageObj from './kbn_shared_ux_file_image.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_image_mocks.mdx b/api_docs/kbn_shared_ux_file_image_mocks.mdx index d787a1a203d60..020370d505463 100644 --- a/api_docs/kbn_shared_ux_file_image_mocks.mdx +++ b/api_docs/kbn_shared_ux_file_image_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-image-mocks title: "@kbn/shared-ux-file-image-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-image-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-image-mocks'] --- import kbnSharedUxFileImageMocksObj from './kbn_shared_ux_file_image_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_mocks.mdx b/api_docs/kbn_shared_ux_file_mocks.mdx index c5dc84b540e7b..1ac44819a020f 100644 --- a/api_docs/kbn_shared_ux_file_mocks.mdx +++ b/api_docs/kbn_shared_ux_file_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-mocks title: "@kbn/shared-ux-file-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-mocks'] --- import kbnSharedUxFileMocksObj from './kbn_shared_ux_file_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_picker.mdx b/api_docs/kbn_shared_ux_file_picker.mdx index 73d46e5eb1305..488cb720c4fc9 100644 --- a/api_docs/kbn_shared_ux_file_picker.mdx +++ b/api_docs/kbn_shared_ux_file_picker.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-picker title: "@kbn/shared-ux-file-picker" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-picker plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-picker'] --- import kbnSharedUxFilePickerObj from './kbn_shared_ux_file_picker.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_upload.mdx b/api_docs/kbn_shared_ux_file_upload.mdx index fdbf7d6240abf..b9b726182c326 100644 --- a/api_docs/kbn_shared_ux_file_upload.mdx +++ b/api_docs/kbn_shared_ux_file_upload.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-upload title: "@kbn/shared-ux-file-upload" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-upload plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-upload'] --- import kbnSharedUxFileUploadObj from './kbn_shared_ux_file_upload.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_util.mdx b/api_docs/kbn_shared_ux_file_util.mdx index 0a0ef8dfa483f..42dd2314bd3e8 100644 --- a/api_docs/kbn_shared_ux_file_util.mdx +++ b/api_docs/kbn_shared_ux_file_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-util title: "@kbn/shared-ux-file-util" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-util plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-util'] --- import kbnSharedUxFileUtilObj from './kbn_shared_ux_file_util.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_link_redirect_app.mdx b/api_docs/kbn_shared_ux_link_redirect_app.mdx index 50e114e9ef130..2d96cfc953641 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app.mdx +++ b/api_docs/kbn_shared_ux_link_redirect_app.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-link-redirect-app title: "@kbn/shared-ux-link-redirect-app" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-link-redirect-app plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-link-redirect-app'] --- import kbnSharedUxLinkRedirectAppObj from './kbn_shared_ux_link_redirect_app.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx index ccd69562b9a11..1e42b19151375 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx +++ b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-link-redirect-app-mocks title: "@kbn/shared-ux-link-redirect-app-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-link-redirect-app-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-link-redirect-app-mocks'] --- import kbnSharedUxLinkRedirectAppMocksObj from './kbn_shared_ux_link_redirect_app_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_markdown.mdx b/api_docs/kbn_shared_ux_markdown.mdx index a07f00ea35eca..5858264d5431a 100644 --- a/api_docs/kbn_shared_ux_markdown.mdx +++ b/api_docs/kbn_shared_ux_markdown.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-markdown title: "@kbn/shared-ux-markdown" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-markdown plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-markdown'] --- import kbnSharedUxMarkdownObj from './kbn_shared_ux_markdown.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_markdown_mocks.mdx b/api_docs/kbn_shared_ux_markdown_mocks.mdx index 93e4238d8a66d..2ae47bf1a80fc 100644 --- a/api_docs/kbn_shared_ux_markdown_mocks.mdx +++ b/api_docs/kbn_shared_ux_markdown_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-markdown-mocks title: "@kbn/shared-ux-markdown-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-markdown-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-markdown-mocks'] --- import kbnSharedUxMarkdownMocksObj from './kbn_shared_ux_markdown_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx index 0a5701b42d41b..1999e3088503a 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data title: "@kbn/shared-ux-page-analytics-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-analytics-no-data plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data'] --- import kbnSharedUxPageAnalyticsNoDataObj from './kbn_shared_ux_page_analytics_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx index 5f56c38d3dd46..62012658658b7 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data-mocks title: "@kbn/shared-ux-page-analytics-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-analytics-no-data-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data-mocks'] --- import kbnSharedUxPageAnalyticsNoDataMocksObj from './kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx index 7706ab1c53a93..f8b0464e7af81 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data title: "@kbn/shared-ux-page-kibana-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-no-data plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data'] --- import kbnSharedUxPageKibanaNoDataObj from './kbn_shared_ux_page_kibana_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx index 37955a1cbe673..4228b748e514d 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data-mocks title: "@kbn/shared-ux-page-kibana-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-no-data-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data-mocks'] --- import kbnSharedUxPageKibanaNoDataMocksObj from './kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_template.mdx b/api_docs/kbn_shared_ux_page_kibana_template.mdx index 61511f94d3d13..b46ee8a97fd2d 100644 --- a/api_docs/kbn_shared_ux_page_kibana_template.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_template.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template title: "@kbn/shared-ux-page-kibana-template" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-template plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template'] --- import kbnSharedUxPageKibanaTemplateObj from './kbn_shared_ux_page_kibana_template.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx index 0af576d5c8d1b..74ade0cf465a6 100644 --- a/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template-mocks title: "@kbn/shared-ux-page-kibana-template-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-template-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template-mocks'] --- import kbnSharedUxPageKibanaTemplateMocksObj from './kbn_shared_ux_page_kibana_template_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data.mdx b/api_docs/kbn_shared_ux_page_no_data.mdx index c7e35f76ea322..11f7232b74335 100644 --- a/api_docs/kbn_shared_ux_page_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data title: "@kbn/shared-ux-page-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data'] --- import kbnSharedUxPageNoDataObj from './kbn_shared_ux_page_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_config.mdx b/api_docs/kbn_shared_ux_page_no_data_config.mdx index 6717ea77e7e06..3935f3897026f 100644 --- a/api_docs/kbn_shared_ux_page_no_data_config.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config title: "@kbn/shared-ux-page-no-data-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-config plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config'] --- import kbnSharedUxPageNoDataConfigObj from './kbn_shared_ux_page_no_data_config.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx index b455ecf787648..6dd9e0b9caac6 100644 --- a/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config-mocks title: "@kbn/shared-ux-page-no-data-config-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-config-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config-mocks'] --- import kbnSharedUxPageNoDataConfigMocksObj from './kbn_shared_ux_page_no_data_config_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx index 834cd55790b54..c023da4650be9 100644 --- a/api_docs/kbn_shared_ux_page_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-mocks title: "@kbn/shared-ux-page-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-mocks'] --- import kbnSharedUxPageNoDataMocksObj from './kbn_shared_ux_page_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_solution_nav.mdx b/api_docs/kbn_shared_ux_page_solution_nav.mdx index c1d2fa78fc1ac..75302a81896d3 100644 --- a/api_docs/kbn_shared_ux_page_solution_nav.mdx +++ b/api_docs/kbn_shared_ux_page_solution_nav.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-solution-nav title: "@kbn/shared-ux-page-solution-nav" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-solution-nav plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-solution-nav'] --- import kbnSharedUxPageSolutionNavObj from './kbn_shared_ux_page_solution_nav.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx index f90b9eb473b6d..1e31441c5c7e4 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views title: "@kbn/shared-ux-prompt-no-data-views" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-no-data-views plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views'] --- import kbnSharedUxPromptNoDataViewsObj from './kbn_shared_ux_prompt_no_data_views.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx index 522bdb396a836..e697faddd4fc5 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views-mocks title: "@kbn/shared-ux-prompt-no-data-views-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-no-data-views-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views-mocks'] --- import kbnSharedUxPromptNoDataViewsMocksObj from './kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_not_found.mdx b/api_docs/kbn_shared_ux_prompt_not_found.mdx index ba53dd0d65fc0..c8c516ef761fe 100644 --- a/api_docs/kbn_shared_ux_prompt_not_found.mdx +++ b/api_docs/kbn_shared_ux_prompt_not_found.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-not-found title: "@kbn/shared-ux-prompt-not-found" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-not-found plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-not-found'] --- import kbnSharedUxPromptNotFoundObj from './kbn_shared_ux_prompt_not_found.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_router.mdx b/api_docs/kbn_shared_ux_router.mdx index 576ae47328b70..c8277a1b65a3b 100644 --- a/api_docs/kbn_shared_ux_router.mdx +++ b/api_docs/kbn_shared_ux_router.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-router title: "@kbn/shared-ux-router" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-router plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-router'] --- import kbnSharedUxRouterObj from './kbn_shared_ux_router.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_router_mocks.mdx b/api_docs/kbn_shared_ux_router_mocks.mdx index b29cfb850ebff..9da6d22b1abda 100644 --- a/api_docs/kbn_shared_ux_router_mocks.mdx +++ b/api_docs/kbn_shared_ux_router_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-router-mocks title: "@kbn/shared-ux-router-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-router-mocks plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-router-mocks'] --- import kbnSharedUxRouterMocksObj from './kbn_shared_ux_router_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_storybook_config.mdx b/api_docs/kbn_shared_ux_storybook_config.mdx index 1347a43c00338..4d880f77bbf3c 100644 --- a/api_docs/kbn_shared_ux_storybook_config.mdx +++ b/api_docs/kbn_shared_ux_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook-config title: "@kbn/shared-ux-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-storybook-config plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook-config'] --- import kbnSharedUxStorybookConfigObj from './kbn_shared_ux_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_storybook_mock.mdx b/api_docs/kbn_shared_ux_storybook_mock.mdx index 7f626ae5cd3ae..073cebbc4dbdd 100644 --- a/api_docs/kbn_shared_ux_storybook_mock.mdx +++ b/api_docs/kbn_shared_ux_storybook_mock.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook-mock title: "@kbn/shared-ux-storybook-mock" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-storybook-mock plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook-mock'] --- import kbnSharedUxStorybookMockObj from './kbn_shared_ux_storybook_mock.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_utility.mdx b/api_docs/kbn_shared_ux_utility.mdx index 622fc4a1aad0b..19a3566050996 100644 --- a/api_docs/kbn_shared_ux_utility.mdx +++ b/api_docs/kbn_shared_ux_utility.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-utility title: "@kbn/shared-ux-utility" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-utility plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-utility'] --- import kbnSharedUxUtilityObj from './kbn_shared_ux_utility.devdocs.json'; diff --git a/api_docs/kbn_slo_schema.mdx b/api_docs/kbn_slo_schema.mdx index 21cd440cdd235..1f67095bd4102 100644 --- a/api_docs/kbn_slo_schema.mdx +++ b/api_docs/kbn_slo_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-slo-schema title: "@kbn/slo-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/slo-schema plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/slo-schema'] --- import kbnSloSchemaObj from './kbn_slo_schema.devdocs.json'; diff --git a/api_docs/kbn_some_dev_log.mdx b/api_docs/kbn_some_dev_log.mdx index 827d474a4500b..904f90c7df0c9 100644 --- a/api_docs/kbn_some_dev_log.mdx +++ b/api_docs/kbn_some_dev_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-some-dev-log title: "@kbn/some-dev-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/some-dev-log plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/some-dev-log'] --- import kbnSomeDevLogObj from './kbn_some_dev_log.devdocs.json'; diff --git a/api_docs/kbn_std.mdx b/api_docs/kbn_std.mdx index 09bb3ce44fbea..013e13c3c3e48 100644 --- a/api_docs/kbn_std.mdx +++ b/api_docs/kbn_std.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-std title: "@kbn/std" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/std plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/std'] --- import kbnStdObj from './kbn_std.devdocs.json'; diff --git a/api_docs/kbn_stdio_dev_helpers.mdx b/api_docs/kbn_stdio_dev_helpers.mdx index d4b4300b85a5b..bd93e014b1d8f 100644 --- a/api_docs/kbn_stdio_dev_helpers.mdx +++ b/api_docs/kbn_stdio_dev_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-stdio-dev-helpers title: "@kbn/stdio-dev-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/stdio-dev-helpers plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/stdio-dev-helpers'] --- import kbnStdioDevHelpersObj from './kbn_stdio_dev_helpers.devdocs.json'; diff --git a/api_docs/kbn_storybook.mdx b/api_docs/kbn_storybook.mdx index 608b0ee1baa34..4175fba6eadd7 100644 --- a/api_docs/kbn_storybook.mdx +++ b/api_docs/kbn_storybook.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-storybook title: "@kbn/storybook" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/storybook plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/storybook'] --- import kbnStorybookObj from './kbn_storybook.devdocs.json'; diff --git a/api_docs/kbn_telemetry_tools.mdx b/api_docs/kbn_telemetry_tools.mdx index 5d7f05ac9f2e9..0006c9f8a02c5 100644 --- a/api_docs/kbn_telemetry_tools.mdx +++ b/api_docs/kbn_telemetry_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-telemetry-tools title: "@kbn/telemetry-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/telemetry-tools plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/telemetry-tools'] --- import kbnTelemetryToolsObj from './kbn_telemetry_tools.devdocs.json'; diff --git a/api_docs/kbn_test.mdx b/api_docs/kbn_test.mdx index a125224803b8d..cde0ba43c7c41 100644 --- a/api_docs/kbn_test.mdx +++ b/api_docs/kbn_test.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test title: "@kbn/test" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test'] --- import kbnTestObj from './kbn_test.devdocs.json'; diff --git a/api_docs/kbn_test_jest_helpers.mdx b/api_docs/kbn_test_jest_helpers.mdx index 0c54ae4c9a28c..fc6eb4813dbc5 100644 --- a/api_docs/kbn_test_jest_helpers.mdx +++ b/api_docs/kbn_test_jest_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-jest-helpers title: "@kbn/test-jest-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-jest-helpers plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-jest-helpers'] --- import kbnTestJestHelpersObj from './kbn_test_jest_helpers.devdocs.json'; diff --git a/api_docs/kbn_test_subj_selector.mdx b/api_docs/kbn_test_subj_selector.mdx index 4bea539c49489..bd768e53e9cae 100644 --- a/api_docs/kbn_test_subj_selector.mdx +++ b/api_docs/kbn_test_subj_selector.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-subj-selector title: "@kbn/test-subj-selector" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-subj-selector plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-subj-selector'] --- import kbnTestSubjSelectorObj from './kbn_test_subj_selector.devdocs.json'; diff --git a/api_docs/kbn_tooling_log.mdx b/api_docs/kbn_tooling_log.mdx index 11d80d78a37a9..c81b13a27c5bb 100644 --- a/api_docs/kbn_tooling_log.mdx +++ b/api_docs/kbn_tooling_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-tooling-log title: "@kbn/tooling-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/tooling-log plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/tooling-log'] --- import kbnToolingLogObj from './kbn_tooling_log.devdocs.json'; diff --git a/api_docs/kbn_ts_projects.devdocs.json b/api_docs/kbn_ts_projects.devdocs.json index bda5b2bd4e47a..f8a6588efec9b 100644 --- a/api_docs/kbn_ts_projects.devdocs.json +++ b/api_docs/kbn_ts_projects.devdocs.json @@ -37,7 +37,7 @@ "label": "loadAll", "description": [], "signature": [ - "(options: { ignore: string[]; disableTypeCheck: string[]; }) => ", + "(options: { ignore: string[]; disableTypeCheck: string[]; noTsconfigPathsRefresh?: boolean | undefined; }) => ", { "pluginId": "@kbn/ts-projects", "scope": "common", @@ -89,6 +89,20 @@ "path": "packages/kbn-ts-projects/ts_project.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ts-projects", + "id": "def-common.TsProject.loadAll.$1.noTsconfigPathsRefresh", + "type": "CompoundType", + "tags": [], + "label": "noTsconfigPathsRefresh", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-ts-projects/ts_project.ts", + "deprecated": false, + "trackAdoption": false } ] } diff --git a/api_docs/kbn_ts_projects.mdx b/api_docs/kbn_ts_projects.mdx index 64aed65796826..f2f64029d9e87 100644 --- a/api_docs/kbn_ts_projects.mdx +++ b/api_docs/kbn_ts_projects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ts-projects title: "@kbn/ts-projects" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ts-projects plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ts-projects'] --- import kbnTsProjectsObj from './kbn_ts_projects.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 38 | 0 | 25 | 1 | +| 39 | 0 | 26 | 1 | ## Common diff --git a/api_docs/kbn_typed_react_router_config.mdx b/api_docs/kbn_typed_react_router_config.mdx index c1daab9698ee4..d4997422c6309 100644 --- a/api_docs/kbn_typed_react_router_config.mdx +++ b/api_docs/kbn_typed_react_router_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-typed-react-router-config title: "@kbn/typed-react-router-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/typed-react-router-config plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/typed-react-router-config'] --- import kbnTypedReactRouterConfigObj from './kbn_typed_react_router_config.devdocs.json'; diff --git a/api_docs/kbn_ui_shared_deps_src.mdx b/api_docs/kbn_ui_shared_deps_src.mdx index a855eb77a4428..9968ab54fe4e1 100644 --- a/api_docs/kbn_ui_shared_deps_src.mdx +++ b/api_docs/kbn_ui_shared_deps_src.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-shared-deps-src title: "@kbn/ui-shared-deps-src" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-shared-deps-src plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-shared-deps-src'] --- import kbnUiSharedDepsSrcObj from './kbn_ui_shared_deps_src.devdocs.json'; diff --git a/api_docs/kbn_ui_theme.mdx b/api_docs/kbn_ui_theme.mdx index afe53309dfedc..7239223179255 100644 --- a/api_docs/kbn_ui_theme.mdx +++ b/api_docs/kbn_ui_theme.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-theme title: "@kbn/ui-theme" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-theme plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-theme'] --- import kbnUiThemeObj from './kbn_ui_theme.devdocs.json'; diff --git a/api_docs/kbn_user_profile_components.mdx b/api_docs/kbn_user_profile_components.mdx index 629017b596639..75f9457c56ad5 100644 --- a/api_docs/kbn_user_profile_components.mdx +++ b/api_docs/kbn_user_profile_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-user-profile-components title: "@kbn/user-profile-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/user-profile-components plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/user-profile-components'] --- import kbnUserProfileComponentsObj from './kbn_user_profile_components.devdocs.json'; diff --git a/api_docs/kbn_utility_types.mdx b/api_docs/kbn_utility_types.mdx index 2f9f547c0006e..5a3db1238a215 100644 --- a/api_docs/kbn_utility_types.mdx +++ b/api_docs/kbn_utility_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types title: "@kbn/utility-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types'] --- import kbnUtilityTypesObj from './kbn_utility_types.devdocs.json'; diff --git a/api_docs/kbn_utility_types_jest.mdx b/api_docs/kbn_utility_types_jest.mdx index 82a1886870d8b..6203d224f12e1 100644 --- a/api_docs/kbn_utility_types_jest.mdx +++ b/api_docs/kbn_utility_types_jest.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types-jest title: "@kbn/utility-types-jest" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types-jest plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types-jest'] --- import kbnUtilityTypesJestObj from './kbn_utility_types_jest.devdocs.json'; diff --git a/api_docs/kbn_utils.mdx b/api_docs/kbn_utils.mdx index 8acb2659a100b..e9e0232180862 100644 --- a/api_docs/kbn_utils.mdx +++ b/api_docs/kbn_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utils title: "@kbn/utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utils plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utils'] --- import kbnUtilsObj from './kbn_utils.devdocs.json'; diff --git a/api_docs/kbn_yarn_lock_validator.mdx b/api_docs/kbn_yarn_lock_validator.mdx index 724edb1707f62..594baba7cb045 100644 --- a/api_docs/kbn_yarn_lock_validator.mdx +++ b/api_docs/kbn_yarn_lock_validator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-yarn-lock-validator title: "@kbn/yarn-lock-validator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/yarn-lock-validator plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/yarn-lock-validator'] --- import kbnYarnLockValidatorObj from './kbn_yarn_lock_validator.devdocs.json'; diff --git a/api_docs/kibana_overview.mdx b/api_docs/kibana_overview.mdx index cb3b4114d0970..1ffaa1c8ce515 100644 --- a/api_docs/kibana_overview.mdx +++ b/api_docs/kibana_overview.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaOverview title: "kibanaOverview" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaOverview plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaOverview'] --- import kibanaOverviewObj from './kibana_overview.devdocs.json'; diff --git a/api_docs/kibana_react.devdocs.json b/api_docs/kibana_react.devdocs.json index c25850ef4f6c0..38fd13a5e66a8 100644 --- a/api_docs/kibana_react.devdocs.json +++ b/api_docs/kibana_react.devdocs.json @@ -580,18 +580,6 @@ "plugin": "home", "path": "src/plugins/home/public/application/components/tutorial/tutorial.js" }, - { - "plugin": "spaces", - "path": "x-pack/plugins/spaces/public/space_selector/space_selector.tsx" - }, - { - "plugin": "spaces", - "path": "x-pack/plugins/spaces/public/space_selector/space_selector.tsx" - }, - { - "plugin": "spaces", - "path": "x-pack/plugins/spaces/public/space_selector/space_selector.tsx" - }, { "plugin": "ml", "path": "x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx" @@ -3128,6 +3116,14 @@ "section": "def-common.ChromeStart", "text": "ChromeStart" }, + " | undefined; customBranding?: ", + { + "pluginId": "@kbn/core-custom-branding-browser", + "scope": "common", + "docId": "kibKbnCoreCustomBrandingBrowserPluginApi", + "section": "def-common.CustomBrandingStart", + "text": "CustomBrandingStart" + }, " | undefined; docLinks?: ", { "pluginId": "@kbn/core-doc-links-browser", diff --git a/api_docs/kibana_react.mdx b/api_docs/kibana_react.mdx index 99560f8bb9680..59125cf6e9ae6 100644 --- a/api_docs/kibana_react.mdx +++ b/api_docs/kibana_react.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaReact title: "kibanaReact" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaReact plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaReact'] --- import kibanaReactObj from './kibana_react.devdocs.json'; diff --git a/api_docs/kibana_utils.mdx b/api_docs/kibana_utils.mdx index 8573670776a21..d0753f6172a65 100644 --- a/api_docs/kibana_utils.mdx +++ b/api_docs/kibana_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaUtils title: "kibanaUtils" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaUtils plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaUtils'] --- import kibanaUtilsObj from './kibana_utils.devdocs.json'; diff --git a/api_docs/kubernetes_security.mdx b/api_docs/kubernetes_security.mdx index 996078246c93c..2477d1fe4ac36 100644 --- a/api_docs/kubernetes_security.mdx +++ b/api_docs/kubernetes_security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kubernetesSecurity title: "kubernetesSecurity" image: https://source.unsplash.com/400x175/?github description: API docs for the kubernetesSecurity plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kubernetesSecurity'] --- import kubernetesSecurityObj from './kubernetes_security.devdocs.json'; diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index c6a0296d03c70..c93075db9c0f2 100644 --- a/api_docs/lens.mdx +++ b/api_docs/lens.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lens title: "lens" image: https://source.unsplash.com/400x175/?github description: API docs for the lens plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lens'] --- import lensObj from './lens.devdocs.json'; diff --git a/api_docs/license_api_guard.mdx b/api_docs/license_api_guard.mdx index a642a826dc79e..807670c18b49d 100644 --- a/api_docs/license_api_guard.mdx +++ b/api_docs/license_api_guard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseApiGuard title: "licenseApiGuard" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseApiGuard plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseApiGuard'] --- import licenseApiGuardObj from './license_api_guard.devdocs.json'; diff --git a/api_docs/license_management.mdx b/api_docs/license_management.mdx index 3ea0f563643ef..3b5df8962e5f7 100644 --- a/api_docs/license_management.mdx +++ b/api_docs/license_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseManagement title: "licenseManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseManagement plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseManagement'] --- import licenseManagementObj from './license_management.devdocs.json'; diff --git a/api_docs/licensing.mdx b/api_docs/licensing.mdx index 11736426a0aa9..dccf7a41377c7 100644 --- a/api_docs/licensing.mdx +++ b/api_docs/licensing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licensing title: "licensing" image: https://source.unsplash.com/400x175/?github description: API docs for the licensing plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licensing'] --- import licensingObj from './licensing.devdocs.json'; diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index 643f3fa0ef849..41eeeaa0ba9a1 100644 --- a/api_docs/lists.mdx +++ b/api_docs/lists.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lists title: "lists" image: https://source.unsplash.com/400x175/?github description: API docs for the lists plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lists'] --- import listsObj from './lists.devdocs.json'; diff --git a/api_docs/management.mdx b/api_docs/management.mdx index 2d3d64a240b68..e8271f4c7ad18 100644 --- a/api_docs/management.mdx +++ b/api_docs/management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/management title: "management" image: https://source.unsplash.com/400x175/?github description: API docs for the management plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'management'] --- import managementObj from './management.devdocs.json'; diff --git a/api_docs/maps.mdx b/api_docs/maps.mdx index ced5414d48e7c..f8797381b8046 100644 --- a/api_docs/maps.mdx +++ b/api_docs/maps.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/maps title: "maps" image: https://source.unsplash.com/400x175/?github description: API docs for the maps plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'maps'] --- import mapsObj from './maps.devdocs.json'; diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index 280fe9274d563..92dfef0616a41 100644 --- a/api_docs/maps_ems.mdx +++ b/api_docs/maps_ems.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/mapsEms title: "mapsEms" image: https://source.unsplash.com/400x175/?github description: API docs for the mapsEms plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsEms'] --- import mapsEmsObj from './maps_ems.devdocs.json'; diff --git a/api_docs/ml.mdx b/api_docs/ml.mdx index c37cf4638ab2f..208c9e1ea72b1 100644 --- a/api_docs/ml.mdx +++ b/api_docs/ml.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ml title: "ml" image: https://source.unsplash.com/400x175/?github description: API docs for the ml plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ml'] --- import mlObj from './ml.devdocs.json'; diff --git a/api_docs/monitoring.mdx b/api_docs/monitoring.mdx index e48451c75e77a..a3b02309daa84 100644 --- a/api_docs/monitoring.mdx +++ b/api_docs/monitoring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoring title: "monitoring" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoring plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoring'] --- import monitoringObj from './monitoring.devdocs.json'; diff --git a/api_docs/monitoring_collection.mdx b/api_docs/monitoring_collection.mdx index 99a85987b5464..994e7c81218b7 100644 --- a/api_docs/monitoring_collection.mdx +++ b/api_docs/monitoring_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoringCollection title: "monitoringCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoringCollection plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoringCollection'] --- import monitoringCollectionObj from './monitoring_collection.devdocs.json'; diff --git a/api_docs/navigation.mdx b/api_docs/navigation.mdx index 7e1cce49bd20b..75355c6a81dd4 100644 --- a/api_docs/navigation.mdx +++ b/api_docs/navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/navigation title: "navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the navigation plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'navigation'] --- import navigationObj from './navigation.devdocs.json'; diff --git a/api_docs/newsfeed.mdx b/api_docs/newsfeed.mdx index 8499e7ad7a8d1..2d4c8f0e72b12 100644 --- a/api_docs/newsfeed.mdx +++ b/api_docs/newsfeed.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/newsfeed title: "newsfeed" image: https://source.unsplash.com/400x175/?github description: API docs for the newsfeed plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'newsfeed'] --- import newsfeedObj from './newsfeed.devdocs.json'; diff --git a/api_docs/notifications.mdx b/api_docs/notifications.mdx index 35226361803f0..83b39e5bf1d45 100644 --- a/api_docs/notifications.mdx +++ b/api_docs/notifications.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/notifications title: "notifications" image: https://source.unsplash.com/400x175/?github description: API docs for the notifications plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'notifications'] --- import notificationsObj from './notifications.devdocs.json'; diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index 86f5977d20926..bd3be0620733c 100644 --- a/api_docs/observability.mdx +++ b/api_docs/observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observability title: "observability" image: https://source.unsplash.com/400x175/?github description: API docs for the observability plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observability'] --- import observabilityObj from './observability.devdocs.json'; diff --git a/api_docs/osquery.mdx b/api_docs/osquery.mdx index 22f57f78eb50f..bbb5392f8c3ff 100644 --- a/api_docs/osquery.mdx +++ b/api_docs/osquery.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/osquery title: "osquery" image: https://source.unsplash.com/400x175/?github description: API docs for the osquery plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'osquery'] --- import osqueryObj from './osquery.devdocs.json'; diff --git a/api_docs/plugin_directory.mdx b/api_docs/plugin_directory.mdx index d3583cf21fa81..55c058766a987 100644 --- a/api_docs/plugin_directory.mdx +++ b/api_docs/plugin_directory.mdx @@ -7,7 +7,7 @@ id: kibDevDocsPluginDirectory slug: /kibana-dev-docs/api-meta/plugin-api-directory title: Directory description: Directory of public APIs available through plugins or packages. -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -15,13 +15,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Count | Plugins or Packages with a
public API | Number of teams | |--------------|----------|------------------------| -| 549 | 452 | 42 | +| 556 | 459 | 42 | ### Public API health stats | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 34242 | 526 | 23954 | 1186 | +| 34300 | 526 | 23993 | 1188 | ## Plugin Directory @@ -48,7 +48,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Cloud Security Posture](https://github.com/orgs/elastic/teams/cloud-posture-security) | The cloud security posture plugin | 17 | 0 | 2 | 2 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 13 | 0 | 13 | 1 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Controls Plugin contains embeddable components intended to create a simple query interface for end users, and a powerful editing suite that allows dashboard authors to build controls | 264 | 0 | 260 | 9 | -| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 2818 | 17 | 1018 | 0 | +| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 2822 | 17 | 1018 | 0 | | crossClusterReplication | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | customBranding | [global-experience](https://github.com/orgs/elastic/teams/kibana-global-experience) | Enables customization of Kibana | 0 | 0 | 0 | 0 | | | [Fleet](https://github.com/orgs/elastic/teams/fleet) | Add custom data integrations so they can be displayed in the Fleet integrations app | 107 | 0 | 88 | 1 | @@ -89,7 +89,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The file upload plugin contains components and services for uploading a file, analyzing its data, and then importing the data into an Elasticsearch index. Supported file types include CSV, TSV, newline-delimited JSON and GeoJSON. | 62 | 0 | 62 | 2 | | | [@elastic/kibana-app-services](https://github.com/orgs/elastic/teams/team:AppServicesUx) | File upload, download, sharing, and serving over HTTP implementation in Kibana. | 254 | 1 | 45 | 5 | | | [@elastic/kibana-global-experience](https://github.com/orgs/elastic/teams/@elastic/kibana-global-experience) | Simple UI for managing files in Kibana | 2 | 1 | 2 | 0 | -| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 1035 | 3 | 929 | 23 | +| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 1037 | 3 | 931 | 23 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 68 | 0 | 14 | 5 | | globalSearchBar | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | | globalSearchProviders | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | @@ -163,7 +163,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the transforms features provided by Elastic. Transforms enable you to convert existing Elasticsearch indices into summarized indices, which provide opportunities for new insights and analytics. | 4 | 0 | 4 | 1 | | translations | [Kibana Localization](https://github.com/orgs/elastic/teams/kibana-localization) | - | 0 | 0 | 0 | 0 | | | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 579 | 11 | 550 | 53 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds UI Actions service to Kibana | 139 | 2 | 97 | 11 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds UI Actions service to Kibana | 144 | 2 | 99 | 12 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Extends UI Actions plugin with more functionality | 206 | 0 | 140 | 9 | | | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | Contains functionality for the field list which can be integrated into apps | 270 | 0 | 245 | 7 | | | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | The `unifiedHistogram` plugin provides UI components to create a layout including a resizable histogram and a main display. | 52 | 0 | 15 | 0 | @@ -245,6 +245,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | Kibana Core | - | 119 | 0 | 46 | 0 | | | Kibana Core | - | 3 | 0 | 3 | 0 | | | Kibana Core | - | 4 | 0 | 4 | 0 | +| | [Owner missing] | - | 8 | 0 | 8 | 0 | +| | [Owner missing] | - | 5 | 0 | 5 | 0 | +| | [Owner missing] | - | 4 | 0 | 4 | 0 | +| | [Owner missing] | - | 6 | 0 | 1 | 0 | +| | [Owner missing] | - | 6 | 0 | 6 | 0 | +| | [Owner missing] | - | 6 | 0 | 6 | 1 | +| | [Owner missing] | - | 4 | 0 | 4 | 0 | | | Kibana Core | - | 9 | 0 | 3 | 0 | | | Kibana Core | - | 6 | 0 | 6 | 0 | | | Kibana Core | - | 4 | 0 | 4 | 0 | @@ -294,9 +301,9 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | Kibana Core | - | 4 | 0 | 4 | 0 | | | Kibana Core | - | 2 | 0 | 2 | 0 | | | Kibana Core | - | 4 | 0 | 4 | 0 | -| | Kibana Core | - | 28 | 0 | 0 | 0 | +| | Kibana Core | - | 30 | 0 | 0 | 0 | | | Kibana Core | - | 5 | 0 | 5 | 0 | -| | Kibana Core | - | 31 | 0 | 0 | 0 | +| | Kibana Core | - | 33 | 0 | 0 | 0 | | | Kibana Core | - | 9 | 0 | 9 | 0 | | | Kibana Core | - | 4 | 0 | 4 | 0 | | | Kibana Core | - | 38 | 0 | 31 | 0 | @@ -391,7 +398,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Owner missing] | - | 2 | 0 | 0 | 0 | | | [Owner missing] | - | 29 | 0 | 29 | 1 | | | [Owner missing] | - | 1 | 0 | 0 | 0 | -| | [Owner missing] | - | 3 | 0 | 0 | 0 | +| | [Owner missing] | - | 6 | 0 | 0 | 0 | | | [Owner missing] | - | 23 | 0 | 21 | 1 | | | [Owner missing] | - | 19 | 1 | 12 | 0 | | | [Owner missing] | - | 3 | 0 | 3 | 0 | @@ -498,7 +505,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Owner missing] | - | 135 | 5 | 103 | 2 | | | [Owner missing] | - | 2 | 0 | 1 | 0 | | | [Owner missing] | - | 72 | 0 | 55 | 0 | -| | [Owner missing] | - | 38 | 0 | 25 | 1 | +| | [Owner missing] | - | 39 | 0 | 26 | 1 | | | [Owner missing] | - | 83 | 0 | 83 | 1 | | | [Owner missing] | - | 44 | 0 | 35 | 0 | | | [Owner missing] | - | 7 | 0 | 6 | 0 | diff --git a/api_docs/presentation_util.mdx b/api_docs/presentation_util.mdx index d0f98e3bd0a60..edc19ce76f746 100644 --- a/api_docs/presentation_util.mdx +++ b/api_docs/presentation_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/presentationUtil title: "presentationUtil" image: https://source.unsplash.com/400x175/?github description: API docs for the presentationUtil plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationUtil'] --- import presentationUtilObj from './presentation_util.devdocs.json'; diff --git a/api_docs/profiling.mdx b/api_docs/profiling.mdx index 50a7f8cee0057..983972531ad22 100644 --- a/api_docs/profiling.mdx +++ b/api_docs/profiling.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/profiling title: "profiling" image: https://source.unsplash.com/400x175/?github description: API docs for the profiling plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'profiling'] --- import profilingObj from './profiling.devdocs.json'; diff --git a/api_docs/remote_clusters.mdx b/api_docs/remote_clusters.mdx index 494db2adf3a18..ce4ce54cddce8 100644 --- a/api_docs/remote_clusters.mdx +++ b/api_docs/remote_clusters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/remoteClusters title: "remoteClusters" image: https://source.unsplash.com/400x175/?github description: API docs for the remoteClusters plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'remoteClusters'] --- import remoteClustersObj from './remote_clusters.devdocs.json'; diff --git a/api_docs/reporting.mdx b/api_docs/reporting.mdx index 917e37e50d40c..05ca1995b85de 100644 --- a/api_docs/reporting.mdx +++ b/api_docs/reporting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/reporting title: "reporting" image: https://source.unsplash.com/400x175/?github description: API docs for the reporting plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'reporting'] --- import reportingObj from './reporting.devdocs.json'; diff --git a/api_docs/rollup.mdx b/api_docs/rollup.mdx index 81f65edd030a2..91604362b75be 100644 --- a/api_docs/rollup.mdx +++ b/api_docs/rollup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/rollup title: "rollup" image: https://source.unsplash.com/400x175/?github description: API docs for the rollup plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'rollup'] --- import rollupObj from './rollup.devdocs.json'; diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index 45dab0c916af2..b8df8051867d0 100644 --- a/api_docs/rule_registry.mdx +++ b/api_docs/rule_registry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ruleRegistry title: "ruleRegistry" image: https://source.unsplash.com/400x175/?github description: API docs for the ruleRegistry plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ruleRegistry'] --- import ruleRegistryObj from './rule_registry.devdocs.json'; diff --git a/api_docs/runtime_fields.mdx b/api_docs/runtime_fields.mdx index 6014cefbb2e15..51be7d976d759 100644 --- a/api_docs/runtime_fields.mdx +++ b/api_docs/runtime_fields.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/runtimeFields title: "runtimeFields" image: https://source.unsplash.com/400x175/?github description: API docs for the runtimeFields plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'runtimeFields'] --- import runtimeFieldsObj from './runtime_fields.devdocs.json'; diff --git a/api_docs/saved_objects.mdx b/api_docs/saved_objects.mdx index 62e533fe4f1c3..e5e579a3f7ead 100644 --- a/api_docs/saved_objects.mdx +++ b/api_docs/saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjects title: "savedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjects plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjects'] --- import savedObjectsObj from './saved_objects.devdocs.json'; diff --git a/api_docs/saved_objects_finder.mdx b/api_docs/saved_objects_finder.mdx index 58355b5a311f2..1465d07711bdd 100644 --- a/api_docs/saved_objects_finder.mdx +++ b/api_docs/saved_objects_finder.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsFinder title: "savedObjectsFinder" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsFinder plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsFinder'] --- import savedObjectsFinderObj from './saved_objects_finder.devdocs.json'; diff --git a/api_docs/saved_objects_management.mdx b/api_docs/saved_objects_management.mdx index db77c02de1840..751943506da22 100644 --- a/api_docs/saved_objects_management.mdx +++ b/api_docs/saved_objects_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsManagement title: "savedObjectsManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsManagement plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsManagement'] --- import savedObjectsManagementObj from './saved_objects_management.devdocs.json'; diff --git a/api_docs/saved_objects_tagging.mdx b/api_docs/saved_objects_tagging.mdx index f847bbe179344..22468b69a7854 100644 --- a/api_docs/saved_objects_tagging.mdx +++ b/api_docs/saved_objects_tagging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTagging title: "savedObjectsTagging" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTagging plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTagging'] --- import savedObjectsTaggingObj from './saved_objects_tagging.devdocs.json'; diff --git a/api_docs/saved_objects_tagging_oss.mdx b/api_docs/saved_objects_tagging_oss.mdx index f35f9410cdeca..4e064dc65edb8 100644 --- a/api_docs/saved_objects_tagging_oss.mdx +++ b/api_docs/saved_objects_tagging_oss.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTaggingOss title: "savedObjectsTaggingOss" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTaggingOss plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTaggingOss'] --- import savedObjectsTaggingOssObj from './saved_objects_tagging_oss.devdocs.json'; diff --git a/api_docs/saved_search.mdx b/api_docs/saved_search.mdx index 0c275e2ca90f4..8d9ddd4226083 100644 --- a/api_docs/saved_search.mdx +++ b/api_docs/saved_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedSearch title: "savedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the savedSearch plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedSearch'] --- import savedSearchObj from './saved_search.devdocs.json'; diff --git a/api_docs/screenshot_mode.mdx b/api_docs/screenshot_mode.mdx index b75d894c8e5d4..80ce4091badcf 100644 --- a/api_docs/screenshot_mode.mdx +++ b/api_docs/screenshot_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotMode title: "screenshotMode" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotMode plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotMode'] --- import screenshotModeObj from './screenshot_mode.devdocs.json'; diff --git a/api_docs/screenshotting.mdx b/api_docs/screenshotting.mdx index d57dc198c42cb..ccb604e1041a5 100644 --- a/api_docs/screenshotting.mdx +++ b/api_docs/screenshotting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotting title: "screenshotting" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotting plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotting'] --- import screenshottingObj from './screenshotting.devdocs.json'; diff --git a/api_docs/security.mdx b/api_docs/security.mdx index 0a52129fe607b..7333b301c60fd 100644 --- a/api_docs/security.mdx +++ b/api_docs/security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/security title: "security" image: https://source.unsplash.com/400x175/?github description: API docs for the security plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'security'] --- import securityObj from './security.devdocs.json'; diff --git a/api_docs/security_solution.mdx b/api_docs/security_solution.mdx index a42d4a6f3fad9..781a3a71ee137 100644 --- a/api_docs/security_solution.mdx +++ b/api_docs/security_solution.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/securitySolution title: "securitySolution" image: https://source.unsplash.com/400x175/?github description: API docs for the securitySolution plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolution'] --- import securitySolutionObj from './security_solution.devdocs.json'; diff --git a/api_docs/session_view.mdx b/api_docs/session_view.mdx index 69a679656807a..f82de90f5a357 100644 --- a/api_docs/session_view.mdx +++ b/api_docs/session_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/sessionView title: "sessionView" image: https://source.unsplash.com/400x175/?github description: API docs for the sessionView plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'sessionView'] --- import sessionViewObj from './session_view.devdocs.json'; diff --git a/api_docs/share.mdx b/api_docs/share.mdx index dffac2bf6b701..8e6314b4e4a06 100644 --- a/api_docs/share.mdx +++ b/api_docs/share.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/share title: "share" image: https://source.unsplash.com/400x175/?github description: API docs for the share plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'share'] --- import shareObj from './share.devdocs.json'; diff --git a/api_docs/snapshot_restore.mdx b/api_docs/snapshot_restore.mdx index 004e7ac37b178..e81dd26d664b8 100644 --- a/api_docs/snapshot_restore.mdx +++ b/api_docs/snapshot_restore.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/snapshotRestore title: "snapshotRestore" image: https://source.unsplash.com/400x175/?github description: API docs for the snapshotRestore plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'snapshotRestore'] --- import snapshotRestoreObj from './snapshot_restore.devdocs.json'; diff --git a/api_docs/spaces.mdx b/api_docs/spaces.mdx index ea024e11d8525..af878d77d9b28 100644 --- a/api_docs/spaces.mdx +++ b/api_docs/spaces.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/spaces title: "spaces" image: https://source.unsplash.com/400x175/?github description: API docs for the spaces plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'spaces'] --- import spacesObj from './spaces.devdocs.json'; diff --git a/api_docs/stack_alerts.mdx b/api_docs/stack_alerts.mdx index 69e069366ace9..970a070b0b6a4 100644 --- a/api_docs/stack_alerts.mdx +++ b/api_docs/stack_alerts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/stackAlerts title: "stackAlerts" image: https://source.unsplash.com/400x175/?github description: API docs for the stackAlerts plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackAlerts'] --- import stackAlertsObj from './stack_alerts.devdocs.json'; diff --git a/api_docs/stack_connectors.mdx b/api_docs/stack_connectors.mdx index 60705a2a59389..c3e29cceac110 100644 --- a/api_docs/stack_connectors.mdx +++ b/api_docs/stack_connectors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/stackConnectors title: "stackConnectors" image: https://source.unsplash.com/400x175/?github description: API docs for the stackConnectors plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackConnectors'] --- import stackConnectorsObj from './stack_connectors.devdocs.json'; diff --git a/api_docs/task_manager.mdx b/api_docs/task_manager.mdx index 774b164172b35..f504bad3fea56 100644 --- a/api_docs/task_manager.mdx +++ b/api_docs/task_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/taskManager title: "taskManager" image: https://source.unsplash.com/400x175/?github description: API docs for the taskManager plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'taskManager'] --- import taskManagerObj from './task_manager.devdocs.json'; diff --git a/api_docs/telemetry.mdx b/api_docs/telemetry.mdx index ef81da067804d..43b1a31ce0a36 100644 --- a/api_docs/telemetry.mdx +++ b/api_docs/telemetry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetry title: "telemetry" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetry plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetry'] --- import telemetryObj from './telemetry.devdocs.json'; diff --git a/api_docs/telemetry_collection_manager.mdx b/api_docs/telemetry_collection_manager.mdx index 6d4a5a987de83..65f3942d8d0a0 100644 --- a/api_docs/telemetry_collection_manager.mdx +++ b/api_docs/telemetry_collection_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionManager title: "telemetryCollectionManager" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionManager plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionManager'] --- import telemetryCollectionManagerObj from './telemetry_collection_manager.devdocs.json'; diff --git a/api_docs/telemetry_collection_xpack.mdx b/api_docs/telemetry_collection_xpack.mdx index 7de84a7ce0ae0..26fad1ca22705 100644 --- a/api_docs/telemetry_collection_xpack.mdx +++ b/api_docs/telemetry_collection_xpack.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionXpack title: "telemetryCollectionXpack" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionXpack plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionXpack'] --- import telemetryCollectionXpackObj from './telemetry_collection_xpack.devdocs.json'; diff --git a/api_docs/telemetry_management_section.mdx b/api_docs/telemetry_management_section.mdx index af3d2eef38081..1a79c639e215e 100644 --- a/api_docs/telemetry_management_section.mdx +++ b/api_docs/telemetry_management_section.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryManagementSection title: "telemetryManagementSection" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryManagementSection plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryManagementSection'] --- import telemetryManagementSectionObj from './telemetry_management_section.devdocs.json'; diff --git a/api_docs/threat_intelligence.mdx b/api_docs/threat_intelligence.mdx index 23793e1fd8404..837670b340d2a 100644 --- a/api_docs/threat_intelligence.mdx +++ b/api_docs/threat_intelligence.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/threatIntelligence title: "threatIntelligence" image: https://source.unsplash.com/400x175/?github description: API docs for the threatIntelligence plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'threatIntelligence'] --- import threatIntelligenceObj from './threat_intelligence.devdocs.json'; diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index de0e5243d415d..1507b2f344338 100644 --- a/api_docs/timelines.mdx +++ b/api_docs/timelines.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/timelines title: "timelines" image: https://source.unsplash.com/400x175/?github description: API docs for the timelines plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'timelines'] --- import timelinesObj from './timelines.devdocs.json'; diff --git a/api_docs/transform.mdx b/api_docs/transform.mdx index 5a85c0a6b041e..167292b0bb6c0 100644 --- a/api_docs/transform.mdx +++ b/api_docs/transform.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/transform title: "transform" image: https://source.unsplash.com/400x175/?github description: API docs for the transform plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'transform'] --- import transformObj from './transform.devdocs.json'; diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index 76c96bbdb8943..d57488b414445 100644 --- a/api_docs/triggers_actions_ui.mdx +++ b/api_docs/triggers_actions_ui.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/triggersActionsUi title: "triggersActionsUi" image: https://source.unsplash.com/400x175/?github description: API docs for the triggersActionsUi plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'triggersActionsUi'] --- import triggersActionsUiObj from './triggers_actions_ui.devdocs.json'; diff --git a/api_docs/ui_actions.devdocs.json b/api_docs/ui_actions.devdocs.json index db27ac7d73469..e26733fbbb269 100644 --- a/api_docs/ui_actions.devdocs.json +++ b/api_docs/ui_actions.devdocs.json @@ -1700,6 +1700,100 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "uiActions", + "id": "def-public.CellActionExecutionContext", + "type": "Interface", + "tags": [], + "label": "CellActionExecutionContext", + "description": [], + "signature": [ + { + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.CellActionExecutionContext", + "text": "CellActionExecutionContext" + }, + " extends ", + { + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.ActionExecutionContext", + "text": "ActionExecutionContext" + }, + "" + ], + "path": "src/plugins/ui_actions/public/cell_actions/components/cell_actions.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "uiActions", + "id": "def-public.CellActionExecutionContext.extraContentNodeRef", + "type": "Object", + "tags": [], + "label": "extraContentNodeRef", + "description": [ + "\nRef to a DOM node where the action can add custom HTML." + ], + "signature": [ + "React.MutableRefObject" + ], + "path": "src/plugins/ui_actions/public/cell_actions/components/cell_actions.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "uiActions", + "id": "def-public.CellActionExecutionContext.nodeRef", + "type": "Object", + "tags": [], + "label": "nodeRef", + "description": [ + "\nRef to the node where the cell action are rendered." + ], + "signature": [ + "React.MutableRefObject" + ], + "path": "src/plugins/ui_actions/public/cell_actions/components/cell_actions.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "uiActions", + "id": "def-public.CellActionExecutionContext.metadata", + "type": "Object", + "tags": [], + "label": "metadata", + "description": [ + "\nExtra configurations for actions." + ], + "signature": [ + "Record | undefined" + ], + "path": "src/plugins/ui_actions/public/cell_actions/components/cell_actions.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "uiActions", + "id": "def-public.CellActionExecutionContext.field", + "type": "Object", + "tags": [], + "label": "field", + "description": [], + "signature": [ + "CellActionField" + ], + "path": "src/plugins/ui_actions/public/cell_actions/components/cell_actions.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "uiActions", "id": "def-public.Presentable", diff --git a/api_docs/ui_actions.mdx b/api_docs/ui_actions.mdx index 9d39d588c79c2..36dcf82c978b7 100644 --- a/api_docs/ui_actions.mdx +++ b/api_docs/ui_actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActions title: "uiActions" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActions plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActions'] --- import uiActionsObj from './ui_actions.devdocs.json'; @@ -21,7 +21,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 139 | 2 | 97 | 11 | +| 144 | 2 | 99 | 12 | ## Client diff --git a/api_docs/ui_actions_enhanced.mdx b/api_docs/ui_actions_enhanced.mdx index 92375404b6702..284608b075d03 100644 --- a/api_docs/ui_actions_enhanced.mdx +++ b/api_docs/ui_actions_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActionsEnhanced title: "uiActionsEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActionsEnhanced plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActionsEnhanced'] --- import uiActionsEnhancedObj from './ui_actions_enhanced.devdocs.json'; diff --git a/api_docs/unified_field_list.mdx b/api_docs/unified_field_list.mdx index b69567b97f11d..3033f89910be2 100644 --- a/api_docs/unified_field_list.mdx +++ b/api_docs/unified_field_list.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedFieldList title: "unifiedFieldList" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedFieldList plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedFieldList'] --- import unifiedFieldListObj from './unified_field_list.devdocs.json'; diff --git a/api_docs/unified_histogram.mdx b/api_docs/unified_histogram.mdx index acf9881ef2019..45fff0396034b 100644 --- a/api_docs/unified_histogram.mdx +++ b/api_docs/unified_histogram.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedHistogram title: "unifiedHistogram" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedHistogram plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedHistogram'] --- import unifiedHistogramObj from './unified_histogram.devdocs.json'; diff --git a/api_docs/unified_search.mdx b/api_docs/unified_search.mdx index f1c514ee20f0b..3ecc5a7cea6b7 100644 --- a/api_docs/unified_search.mdx +++ b/api_docs/unified_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch title: "unifiedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch'] --- import unifiedSearchObj from './unified_search.devdocs.json'; diff --git a/api_docs/unified_search_autocomplete.mdx b/api_docs/unified_search_autocomplete.mdx index 458c31264a46a..e341e9b0d4b65 100644 --- a/api_docs/unified_search_autocomplete.mdx +++ b/api_docs/unified_search_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch-autocomplete title: "unifiedSearch.autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch.autocomplete plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch.autocomplete'] --- import unifiedSearchAutocompleteObj from './unified_search_autocomplete.devdocs.json'; diff --git a/api_docs/url_forwarding.mdx b/api_docs/url_forwarding.mdx index 2c33a6060400d..c99120aeb7b47 100644 --- a/api_docs/url_forwarding.mdx +++ b/api_docs/url_forwarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/urlForwarding title: "urlForwarding" image: https://source.unsplash.com/400x175/?github description: API docs for the urlForwarding plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'urlForwarding'] --- import urlForwardingObj from './url_forwarding.devdocs.json'; diff --git a/api_docs/usage_collection.mdx b/api_docs/usage_collection.mdx index 635e1960ce666..0b7db37e34abe 100644 --- a/api_docs/usage_collection.mdx +++ b/api_docs/usage_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/usageCollection title: "usageCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the usageCollection plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'usageCollection'] --- import usageCollectionObj from './usage_collection.devdocs.json'; diff --git a/api_docs/ux.mdx b/api_docs/ux.mdx index b8a5d9128337d..edd695391ca49 100644 --- a/api_docs/ux.mdx +++ b/api_docs/ux.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ux title: "ux" image: https://source.unsplash.com/400x175/?github description: API docs for the ux plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ux'] --- import uxObj from './ux.devdocs.json'; diff --git a/api_docs/vis_default_editor.mdx b/api_docs/vis_default_editor.mdx index 0b9ca0967682a..e4e0f4e16f4f7 100644 --- a/api_docs/vis_default_editor.mdx +++ b/api_docs/vis_default_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visDefaultEditor title: "visDefaultEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the visDefaultEditor plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visDefaultEditor'] --- import visDefaultEditorObj from './vis_default_editor.devdocs.json'; diff --git a/api_docs/vis_type_gauge.mdx b/api_docs/vis_type_gauge.mdx index 4813456ca4bf7..977eee9fa2da3 100644 --- a/api_docs/vis_type_gauge.mdx +++ b/api_docs/vis_type_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeGauge title: "visTypeGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeGauge plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeGauge'] --- import visTypeGaugeObj from './vis_type_gauge.devdocs.json'; diff --git a/api_docs/vis_type_heatmap.mdx b/api_docs/vis_type_heatmap.mdx index fa3810dfa9ed9..c950fb3d162d3 100644 --- a/api_docs/vis_type_heatmap.mdx +++ b/api_docs/vis_type_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeHeatmap title: "visTypeHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeHeatmap plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeHeatmap'] --- import visTypeHeatmapObj from './vis_type_heatmap.devdocs.json'; diff --git a/api_docs/vis_type_pie.mdx b/api_docs/vis_type_pie.mdx index 7e736b0446f99..54e0e21d10ea6 100644 --- a/api_docs/vis_type_pie.mdx +++ b/api_docs/vis_type_pie.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypePie title: "visTypePie" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypePie plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypePie'] --- import visTypePieObj from './vis_type_pie.devdocs.json'; diff --git a/api_docs/vis_type_table.mdx b/api_docs/vis_type_table.mdx index 8ad0218e277f3..5b5702e261336 100644 --- a/api_docs/vis_type_table.mdx +++ b/api_docs/vis_type_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTable title: "visTypeTable" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTable plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTable'] --- import visTypeTableObj from './vis_type_table.devdocs.json'; diff --git a/api_docs/vis_type_timelion.mdx b/api_docs/vis_type_timelion.mdx index e3f737a8b0d8c..b731c5d0c5b30 100644 --- a/api_docs/vis_type_timelion.mdx +++ b/api_docs/vis_type_timelion.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimelion title: "visTypeTimelion" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimelion plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimelion'] --- import visTypeTimelionObj from './vis_type_timelion.devdocs.json'; diff --git a/api_docs/vis_type_timeseries.mdx b/api_docs/vis_type_timeseries.mdx index a2a6fced05de0..a44cbc4f5608e 100644 --- a/api_docs/vis_type_timeseries.mdx +++ b/api_docs/vis_type_timeseries.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimeseries title: "visTypeTimeseries" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimeseries plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimeseries'] --- import visTypeTimeseriesObj from './vis_type_timeseries.devdocs.json'; diff --git a/api_docs/vis_type_vega.mdx b/api_docs/vis_type_vega.mdx index 47fd67875ed98..f3cef13925d49 100644 --- a/api_docs/vis_type_vega.mdx +++ b/api_docs/vis_type_vega.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVega title: "visTypeVega" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVega plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVega'] --- import visTypeVegaObj from './vis_type_vega.devdocs.json'; diff --git a/api_docs/vis_type_vislib.mdx b/api_docs/vis_type_vislib.mdx index 75fb96ecac441..376780c0c6429 100644 --- a/api_docs/vis_type_vislib.mdx +++ b/api_docs/vis_type_vislib.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVislib title: "visTypeVislib" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVislib plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVislib'] --- import visTypeVislibObj from './vis_type_vislib.devdocs.json'; diff --git a/api_docs/vis_type_xy.mdx b/api_docs/vis_type_xy.mdx index 89d8d7b315ab2..17c0c06e0d2b6 100644 --- a/api_docs/vis_type_xy.mdx +++ b/api_docs/vis_type_xy.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeXy title: "visTypeXy" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeXy plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeXy'] --- import visTypeXyObj from './vis_type_xy.devdocs.json'; diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index 8778fd5949bda..7bb2af74c584a 100644 --- a/api_docs/visualizations.mdx +++ b/api_docs/visualizations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visualizations title: "visualizations" image: https://source.unsplash.com/400x175/?github description: API docs for the visualizations plugin -date: 2023-01-11 +date: 2023-01-12 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visualizations'] --- import visualizationsObj from './visualizations.devdocs.json'; From b05880e6ac5580936922549e1caebbdf0c7c0868 Mon Sep 17 00:00:00 2001 From: Miriam <31922082+MiriamAparicio@users.noreply.github.com> Date: Thu, 12 Jan 2023 08:30:33 +0000 Subject: [PATCH 06/39] [APM] Update the sparklines to support the bar chart graph style (#148702) Closes https://github.com/elastic/kibana/issues/146982 and https://github.com/elastic/kibana/issues/125009 image image Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../read_only_user/errors/error_details.cy.ts | 2 +- .../distribution/index.tsx | 13 +++- .../app/error_group_details/index.tsx | 2 +- .../top_erroneous_transactions/index.tsx | 3 +- .../error_group_list/index.tsx | 3 +- .../charts/helper/get_timeseries_color.ts | 5 ++ .../shared/charts/spark_plot/index.tsx | 77 ++++++++++++++----- .../shared/errors_table/get_columns.tsx | 3 +- 8 files changed, 79 insertions(+), 29 deletions(-) diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/errors/error_details.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/errors/error_details.cy.ts index d00d8036df3bb..2c837abd2bc4d 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/errors/error_details.cy.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/errors/error_details.cy.ts @@ -68,7 +68,7 @@ describe('Error details', () => { it('shows errors distribution chart', () => { cy.visitKibana(errorDetailsPageHref); cy.contains('Error group 00000'); - cy.getByTestSubj('errorDistribution').contains('Occurrences'); + cy.getByTestSubj('errorDistribution').contains('Error occurrences'); }); it('shows top erroneous transactions table', () => { diff --git a/x-pack/plugins/apm/public/components/app/error_group_details/distribution/index.tsx b/x-pack/plugins/apm/public/components/app/error_group_details/distribution/index.tsx index a3bbadbf7a363..0c97c2bcd9fcd 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_details/distribution/index.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_details/distribution/index.tsx @@ -28,6 +28,10 @@ import { usePreviousPeriodLabel } from '../../../../hooks/use_previous_period_te import { useTheme } from '../../../../hooks/use_theme'; import { APIReturnType } from '../../../../services/rest/create_call_apm_api'; import { ChartContainer } from '../../../shared/charts/chart_container'; +import { + ChartType, + getTimeSeriesColor, +} from '../../../shared/charts/helper/get_timeseries_color'; import { getTimeZone } from '../../../shared/charts/helper/timezone'; type ErrorDistributionAPIResponse = @@ -47,19 +51,22 @@ export function ErrorDistribution({ distribution, title, fetchStatus }: Props) { const { comparisonEnabled } = urlParams; const previousPeriodLabel = usePreviousPeriodLabel(); + const { currentPeriodColor, previousPeriodColor } = getTimeSeriesColor( + ChartType.ERROR_OCCURRENCES + ); const timeseries = [ { data: distribution.currentPeriod, - color: theme.eui.euiColorVis1, + color: currentPeriodColor, title: i18n.translate('xpack.apm.errorGroup.chart.ocurrences', { - defaultMessage: 'Occurrences', + defaultMessage: 'Error occurrences', }), }, ...(comparisonEnabled ? [ { data: distribution.previousPeriod, - color: theme.eui.euiColorMediumShade, + color: previousPeriodColor, title: previousPeriodLabel, }, ] diff --git a/x-pack/plugins/apm/public/components/app/error_group_details/index.tsx b/x-pack/plugins/apm/public/components/app/error_group_details/index.tsx index f80d5f741df44..19fc3895f7597 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_details/index.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_details/index.tsx @@ -229,7 +229,7 @@ export function ErrorGroupDetails() { title={i18n.translate( 'xpack.apm.errorGroupDetails.occurrencesChartLabel', { - defaultMessage: 'Occurrences', + defaultMessage: 'Error occurrences', } )} /> diff --git a/x-pack/plugins/apm/public/components/app/error_group_details/top_erroneous_transactions/index.tsx b/x-pack/plugins/apm/public/components/app/error_group_details/top_erroneous_transactions/index.tsx index 2fc31645b5d39..52380f9e5083d 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_details/top_erroneous_transactions/index.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_details/top_erroneous_transactions/index.tsx @@ -144,11 +144,12 @@ export function TopErroneousTransactions({ serviceName }: Props) { { occurrences, currentPeriodTimeseries, previousPeriodTimeseries } ) => { const { currentPeriodColor, previousPeriodColor } = getTimeSeriesColor( - ChartType.FAILED_TRANSACTION_RATE + ChartType.ERROR_OCCURRENCES ); return ( - - {hasComparisonSeries && ( - + {type && type === 'bar' ? ( + <> + + {hasComparisonSeries && ( + + )} + + ) : ( + <> + + {hasComparisonSeries && ( + + )} + )} ); diff --git a/x-pack/plugins/apm/public/components/shared/errors_table/get_columns.tsx b/x-pack/plugins/apm/public/components/shared/errors_table/get_columns.tsx index 3a6913688498b..63baae7ab52ec 100644 --- a/x-pack/plugins/apm/public/components/shared/errors_table/get_columns.tsx +++ b/x-pack/plugins/apm/public/components/shared/errors_table/get_columns.tsx @@ -136,11 +136,12 @@ export function getColumns({ errorGroupDetailedStatistics?.previousPeriod?.[errorGroupId] ?.timeseries; const { currentPeriodColor, previousPeriodColor } = getTimeSeriesColor( - ChartType.FAILED_TRANSACTION_RATE + ChartType.ERROR_OCCURRENCES ); return ( Date: Thu, 12 Jan 2023 09:37:35 +0100 Subject: [PATCH 07/39] [APM] Introduce mobile top metrics (#148330) ## Summary closes: #146854 https://user-images.githubusercontent.com/3369346/211276601-92fb9d6e-60fd-4ca3-be37-66daac08d7ac.mov ![Screenshot 2023-01-10 at 16 20 59](https://user-images.githubusercontent.com/3369346/211756906-b3ded4dd-6fb3-489d-8165-e5fc1239e369.png) ![Screenshot 2023-01-10 at 16 17 58](https://user-images.githubusercontent.com/3369346/211756916-e8c57859-b8a6-4f9a-87d4-a72e27711485.png) References for mobile fields (WIP) - events https://github.com/elastic/apm/blob/69a52f23d5ca308455ad733c608c93a2ec0072c4/specs/agents/mobile/events.md#crashes - metrics https://github.com/elastic/apm/blob/69a52f23d5ca308455ad733c608c93a2ec0072c4/specs/agents/mobile/metrics.md ### Notes Comparison is not included in this PR. Thus the color remains is the default one. Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../src/scenarios/mobile.ts | 2 +- .../__snapshots__/es_fields.test.ts.snap | 18 ++ x-pack/plugins/apm/common/es_fields/apm.ts | 3 + .../app/mobile/service_overview/index.tsx | 8 + .../mobile/service_overview/stats/index.tsx | 130 ++++++++++++++ .../service_overview/stats/metric_item.tsx | 41 +++++ .../routes/mobile/get_mobile_filters.ts | 1 + .../server/routes/mobile/get_mobile_stats.ts | 146 +++++++++++++++ .../plugins/apm/server/routes/mobile/route.ts | 38 ++++ .../tests/mobile/generate_mobile_data.ts | 163 +++++++++++++++++ .../tests/mobile/mobile_stats.spec.ts | 170 ++++++++++++++++++ 11 files changed, 719 insertions(+), 1 deletion(-) create mode 100644 x-pack/plugins/apm/public/components/app/mobile/service_overview/stats/index.tsx create mode 100644 x-pack/plugins/apm/public/components/app/mobile/service_overview/stats/metric_item.tsx create mode 100644 x-pack/plugins/apm/server/routes/mobile/get_mobile_stats.ts create mode 100644 x-pack/test/apm_api_integration/tests/mobile/generate_mobile_data.ts create mode 100644 x-pack/test/apm_api_integration/tests/mobile/mobile_stats.spec.ts diff --git a/packages/kbn-apm-synthtrace/src/scenarios/mobile.ts b/packages/kbn-apm-synthtrace/src/scenarios/mobile.ts index e0c0ca0927329..85fdee43b713c 100644 --- a/packages/kbn-apm-synthtrace/src/scenarios/mobile.ts +++ b/packages/kbn-apm-synthtrace/src/scenarios/mobile.ts @@ -368,7 +368,7 @@ const scenario: Scenario = async ({ scenarioOpts, logger }) => { httpUrl: 'https://backend:1234/api/start', }) .duration(800) - .success() + .failure() .timestamp(timestamp + 400) ), device diff --git a/x-pack/plugins/apm/common/es_fields/__snapshots__/es_fields.test.ts.snap b/x-pack/plugins/apm/common/es_fields/__snapshots__/es_fields.test.ts.snap index 80cee93aba10f..224b0b3b78ab3 100644 --- a/x-pack/plugins/apm/common/es_fields/__snapshots__/es_fields.test.ts.snap +++ b/x-pack/plugins/apm/common/es_fields/__snapshots__/es_fields.test.ts.snap @@ -11,6 +11,8 @@ exports[`Error AGENT_NAME 1`] = `"java"`; exports[`Error AGENT_VERSION 1`] = `"agent version"`; +exports[`Error APP_LAUNCH_TIME 1`] = `undefined`; + exports[`Error CHILD_ID 1`] = `undefined`; exports[`Error CLIENT_GEO_COUNTRY_ISO_CODE 1`] = `undefined`; @@ -78,6 +80,8 @@ exports[`Error ERROR_LOG_MESSAGE 1`] = `undefined`; exports[`Error ERROR_PAGE_URL 1`] = `undefined`; +exports[`Error EVENT_NAME 1`] = `undefined`; + exports[`Error EVENT_OUTCOME 1`] = `undefined`; exports[`Error FAAS_BILLED_DURATION 1`] = `undefined`; @@ -210,6 +214,8 @@ exports[`Error SERVICE_RUNTIME_VERSION 1`] = `undefined`; exports[`Error SERVICE_VERSION 1`] = `undefined`; +exports[`Error SESSION_ID 1`] = `undefined`; + exports[`Error SPAN_ACTION 1`] = `undefined`; exports[`Error SPAN_COMPOSITE_COMPRESSION_STRATEGY 1`] = `undefined`; @@ -293,6 +299,8 @@ exports[`Span AGENT_NAME 1`] = `"java"`; exports[`Span AGENT_VERSION 1`] = `"agent version"`; +exports[`Span APP_LAUNCH_TIME 1`] = `undefined`; + exports[`Span CHILD_ID 1`] = `undefined`; exports[`Span CLIENT_GEO_COUNTRY_ISO_CODE 1`] = `undefined`; @@ -351,6 +359,8 @@ exports[`Span ERROR_LOG_MESSAGE 1`] = `undefined`; exports[`Span ERROR_PAGE_URL 1`] = `undefined`; +exports[`Span EVENT_NAME 1`] = `undefined`; + exports[`Span EVENT_OUTCOME 1`] = `"unknown"`; exports[`Span FAAS_BILLED_DURATION 1`] = `undefined`; @@ -475,6 +485,8 @@ exports[`Span SERVICE_RUNTIME_VERSION 1`] = `undefined`; exports[`Span SERVICE_VERSION 1`] = `undefined`; +exports[`Span SESSION_ID 1`] = `undefined`; + exports[`Span SPAN_ACTION 1`] = `"my action"`; exports[`Span SPAN_COMPOSITE_COMPRESSION_STRATEGY 1`] = `undefined`; @@ -558,6 +570,8 @@ exports[`Transaction AGENT_NAME 1`] = `"java"`; exports[`Transaction AGENT_VERSION 1`] = `"agent version"`; +exports[`Transaction APP_LAUNCH_TIME 1`] = `undefined`; + exports[`Transaction CHILD_ID 1`] = `undefined`; exports[`Transaction CLIENT_GEO_COUNTRY_ISO_CODE 1`] = `undefined`; @@ -620,6 +634,8 @@ exports[`Transaction ERROR_LOG_MESSAGE 1`] = `undefined`; exports[`Transaction ERROR_PAGE_URL 1`] = `undefined`; +exports[`Transaction EVENT_NAME 1`] = `undefined`; + exports[`Transaction EVENT_OUTCOME 1`] = `"unknown"`; exports[`Transaction FAAS_BILLED_DURATION 1`] = `undefined`; @@ -758,6 +774,8 @@ exports[`Transaction SERVICE_RUNTIME_VERSION 1`] = `undefined`; exports[`Transaction SERVICE_VERSION 1`] = `undefined`; +exports[`Transaction SESSION_ID 1`] = `undefined`; + exports[`Transaction SPAN_ACTION 1`] = `undefined`; exports[`Transaction SPAN_COMPOSITE_COMPRESSION_STRATEGY 1`] = `undefined`; diff --git a/x-pack/plugins/apm/common/es_fields/apm.ts b/x-pack/plugins/apm/common/es_fields/apm.ts index f7e15dc292aa8..3bf8c1919946f 100644 --- a/x-pack/plugins/apm/common/es_fields/apm.ts +++ b/x-pack/plugins/apm/common/es_fields/apm.ts @@ -159,5 +159,8 @@ export const INDEX = '_index'; // Mobile export const NETWORK_CONNECTION_TYPE = 'network.connection.type'; export const DEVICE_MODEL_NAME = 'device.model.name'; +export const SESSION_ID = 'session.id'; +export const APP_LAUNCH_TIME = 'application.launch.time'; +export const EVENT_NAME = 'event.name'; export const CHILD_ID = 'child.id'; diff --git a/x-pack/plugins/apm/public/components/app/mobile/service_overview/index.tsx b/x-pack/plugins/apm/public/components/app/mobile/service_overview/index.tsx index 56e13d6e41bf0..c8ac865fc3a40 100644 --- a/x-pack/plugins/apm/public/components/app/mobile/service_overview/index.tsx +++ b/x-pack/plugins/apm/public/components/app/mobile/service_overview/index.tsx @@ -42,6 +42,7 @@ import { AggregatedTransactionsBadge } from '../../../shared/aggregated_transact import { LatencyChart } from '../../../shared/charts/latency_chart'; import { useFiltersForEmbeddableCharts } from '../../../../hooks/use_filters_for_embeddable_charts'; import { getKueryWithMobileFilters } from '../../../../../common/utils/get_kuery_with_mobile_filters'; +import { MobileStats } from './stats'; /** * The height a chart should be if it's next to a table with 5 rows and a title. * Add the height of the pagination row. @@ -146,6 +147,13 @@ export function MobileServiceOverview() { )} + + + diff --git a/x-pack/plugins/apm/public/components/app/mobile/service_overview/stats/index.tsx b/x-pack/plugins/apm/public/components/app/mobile/service_overview/stats/index.tsx new file mode 100644 index 0000000000000..744cfb13f3c75 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/mobile/service_overview/stats/index.tsx @@ -0,0 +1,130 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { MetricDatum, MetricTrendShape } from '@elastic/charts'; +import { i18n } from '@kbn/i18n'; +import { EuiIcon, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import React from 'react'; +import { useTheme } from '@kbn/observability-plugin/public'; +import { useAnyOfApmParams } from '../../../../../hooks/use_apm_params'; +import { useFetcher, FETCH_STATUS } from '../../../../../hooks/use_fetcher'; +import { MetricItem } from './metric_item'; + +const valueFormatter = (value: number, suffix = '') => { + return `${value} ${suffix}`; +}; + +const getIcon = + (type: string) => + ({ + width = 20, + height = 20, + color, + }: { + width: number; + height: number; + color: string; + }) => + ; + +export function MobileStats({ + start, + end, + kuery, +}: { + start: string; + end: string; + kuery: string; +}) { + const euiTheme = useTheme(); + + const { + path: { serviceName }, + query: { environment, transactionType }, + } = useAnyOfApmParams('/mobile-services/{serviceName}/overview'); + + const { data, status } = useFetcher( + (callApmApi) => { + return callApmApi( + 'GET /internal/apm/mobile-services/{serviceName}/stats', + { + params: { + path: { serviceName }, + query: { + start, + end, + environment, + kuery, + transactionType, + }, + }, + } + ); + }, + [start, end, environment, kuery, serviceName, transactionType] + ); + + const metrics: MetricDatum[] = [ + { + color: euiTheme.eui.euiColorLightestShade, + title: i18n.translate('xpack.apm.mobile.metrics.crash.rate', { + defaultMessage: 'Crash Rate', + }), + icon: getIcon('bug'), + value: data?.crashCount?.value ?? NaN, + valueFormatter: (value: number) => valueFormatter(value, 'cpm'), + trend: data?.maxLoadTime?.timeseries, + trendShape: MetricTrendShape.Area, + }, + { + color: euiTheme.eui.euiColorLightestShade, + title: i18n.translate('xpack.apm.mobile.metrics.load.time', { + defaultMessage: 'Slowest App load time', + }), + icon: getIcon('visGauge'), + value: data?.maxLoadTime?.value ?? NaN, + valueFormatter: (value: number) => valueFormatter(value, 's'), + trend: data?.maxLoadTime.timeseries, + trendShape: MetricTrendShape.Area, + }, + { + color: euiTheme.eui.euiColorLightestShade, + title: i18n.translate('xpack.apm.mobile.metrics.sessions', { + defaultMessage: 'Sessions', + }), + icon: getIcon('timeslider'), + value: data?.sessions?.value ?? NaN, + valueFormatter: (value: number) => valueFormatter(value), + trend: data?.sessions.timeseries, + trendShape: MetricTrendShape.Area, + }, + { + color: euiTheme.eui.euiColorLightestShade, + title: i18n.translate('xpack.apm.mobile.metrics.http.requests', { + defaultMessage: 'HTTP requests', + }), + icon: getIcon('kubernetesPod'), + value: data?.requests?.value ?? NaN, + valueFormatter: (value: number) => valueFormatter(value), + trend: data?.requests.timeseries, + trendShape: MetricTrendShape.Area, + }, + ]; + + return ( + + {metrics.map((metric, key) => ( + + + + ))} + + ); +} diff --git a/x-pack/plugins/apm/public/components/app/mobile/service_overview/stats/metric_item.tsx b/x-pack/plugins/apm/public/components/app/mobile/service_overview/stats/metric_item.tsx new file mode 100644 index 0000000000000..fb90e775780a9 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/mobile/service_overview/stats/metric_item.tsx @@ -0,0 +1,41 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React from 'react'; +import { Chart, Metric, MetricDatum } from '@elastic/charts'; +import { EuiLoadingContent, EuiPanel } from '@elastic/eui'; + +export function MetricItem({ + data, + id, + isLoading, +}: { + data: MetricDatum[]; + id: number; + isLoading: boolean; +}) { + return ( +
+ {isLoading ? ( + + + + ) : ( + + + + )} +
+ ); +} diff --git a/x-pack/plugins/apm/server/routes/mobile/get_mobile_filters.ts b/x-pack/plugins/apm/server/routes/mobile/get_mobile_filters.ts index f5b8fcb2c1fdc..1b1553fa3be8c 100644 --- a/x-pack/plugins/apm/server/routes/mobile/get_mobile_filters.ts +++ b/x-pack/plugins/apm/server/routes/mobile/get_mobile_filters.ts @@ -27,6 +27,7 @@ type MobileFiltersTypes = | 'appVersion' | 'osVersion' | 'netConnectionType'; + type MobileFilters = Array<{ key: MobileFiltersTypes; options: string[]; diff --git a/x-pack/plugins/apm/server/routes/mobile/get_mobile_stats.ts b/x-pack/plugins/apm/server/routes/mobile/get_mobile_stats.ts new file mode 100644 index 0000000000000..1102c728ce8db --- /dev/null +++ b/x-pack/plugins/apm/server/routes/mobile/get_mobile_stats.ts @@ -0,0 +1,146 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + termQuery, + kqlQuery, + rangeQuery, +} from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; +import { + SERVICE_NAME, + TRANSACTION_TYPE, + SESSION_ID, + SPAN_SUBTYPE, + APP_LAUNCH_TIME, + EVENT_NAME, +} from '../../../common/es_fields/apm'; +import { environmentQuery } from '../../../common/utils/environment_query'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; +import { getBucketSize } from '../../lib/helpers/get_bucket_size'; + +type Timeseries = Array<{ x: number; y: number }>; +export interface MobileStats { + sessions: { value?: number; timeseries: Timeseries }; + requests: { value?: number | null; timeseries: Timeseries }; + maxLoadTime: { value?: number | null; timeseries: Timeseries }; + crashCount: { value?: number | null; timeseries: Timeseries }; +} + +export async function getMobileStats({ + kuery, + apmEventClient, + serviceName, + transactionType, + environment, + start, + end, +}: { + kuery: string; + apmEventClient: APMEventClient; + serviceName: string; + transactionType?: string; + environment: string; + start: number; + end: number; +}): Promise { + const { intervalString } = getBucketSize({ + start, + end, + minBucketSize: 60, + }); + + const aggs = { + sessions: { + cardinality: { field: SESSION_ID }, + }, + requests: { + filter: { term: { [SPAN_SUBTYPE]: 'http' } }, + }, + maxLoadTime: { + max: { field: APP_LAUNCH_TIME }, + }, + crashCount: { + filter: { term: { [EVENT_NAME]: 'crash' } }, + }, + }; + + const response = await apmEventClient.search('get_mobile_stats', { + apm: { + events: [ + ProcessorEvent.error, + ProcessorEvent.metric, + ProcessorEvent.transaction, + ProcessorEvent.span, + ], + }, + body: { + track_total_hits: false, + size: 0, + query: { + bool: { + filter: [ + ...termQuery(SERVICE_NAME, serviceName), + ...termQuery(TRANSACTION_TYPE, transactionType), + ...rangeQuery(start, end), + ...environmentQuery(environment), + ...kqlQuery(kuery), + ], + }, + }, + aggs: { + timeseries: { + date_histogram: { + field: '@timestamp', + fixed_interval: intervalString, + min_doc_count: 0, + }, + aggs, + }, + ...aggs, + }, + }, + }); + + const durationAsMinutes = (end - start) / 1000 / 60; + + return { + sessions: { + value: response.aggregations?.sessions?.value, + timeseries: + response.aggregations?.timeseries?.buckets.map((bucket) => ({ + x: bucket.key, + y: bucket.sessions.value ?? 0, + })) ?? [], + }, + requests: { + value: response.aggregations?.requests?.doc_count, + timeseries: + response.aggregations?.timeseries?.buckets.map((bucket) => ({ + x: bucket.key, + y: bucket.requests.doc_count ?? 0, + })) ?? [], + }, + maxLoadTime: { + value: response.aggregations?.maxLoadTime?.value, + timeseries: + response.aggregations?.timeseries?.buckets.map((bucket) => ({ + x: bucket.key, + y: bucket.maxLoadTime?.value ?? 0, + })) ?? [], + }, + crashCount: { + value: + response.aggregations?.crashCount?.doc_count ?? 0 / durationAsMinutes, + timeseries: + response.aggregations?.timeseries?.buckets.map((bucket) => ({ + x: bucket.key, + y: bucket.crashCount.doc_count ?? 0, + })) ?? [], + }, + }; +} diff --git a/x-pack/plugins/apm/server/routes/mobile/route.ts b/x-pack/plugins/apm/server/routes/mobile/route.ts index 81042f9522d92..966a12ab776ed 100644 --- a/x-pack/plugins/apm/server/routes/mobile/route.ts +++ b/x-pack/plugins/apm/server/routes/mobile/route.ts @@ -10,6 +10,7 @@ import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { environmentRt, kueryRt, rangeRt } from '../default_api_types'; import { getMobileFilters } from './get_mobile_filters'; +import { getMobileStats, MobileStats } from './get_mobile_stats'; const mobileFilters = createApmServerRoute({ endpoint: 'GET /internal/apm/services/{serviceName}/mobile/filters', @@ -50,6 +51,43 @@ const mobileFilters = createApmServerRoute({ }, }); +const mobileStats = createApmServerRoute({ + endpoint: 'GET /internal/apm/mobile-services/{serviceName}/stats', + params: t.type({ + path: t.type({ + serviceName: t.string, + }), + query: t.intersection([ + kueryRt, + rangeRt, + environmentRt, + t.partial({ + transactionType: t.string, + }), + ]), + }), + options: { tags: ['access:apm'] }, + handler: async (resources): Promise => { + const apmEventClient = await getApmEventClient(resources); + const { params } = resources; + const { serviceName } = params.path; + const { kuery, environment, start, end, transactionType } = params.query; + + const stats = await getMobileStats({ + kuery, + environment, + transactionType, + start, + end, + serviceName, + apmEventClient, + }); + + return stats; + }, +}); + export const mobileRouteRepository = { ...mobileFilters, + ...mobileStats, }; diff --git a/x-pack/test/apm_api_integration/tests/mobile/generate_mobile_data.ts b/x-pack/test/apm_api_integration/tests/mobile/generate_mobile_data.ts new file mode 100644 index 0000000000000..0e488773cadce --- /dev/null +++ b/x-pack/test/apm_api_integration/tests/mobile/generate_mobile_data.ts @@ -0,0 +1,163 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { apm, timerange } from '@kbn/apm-synthtrace-client'; +import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; + +export async function generateMobileData({ + start, + end, + synthtraceEsClient, +}: { + start: number; + end: number; + synthtraceEsClient: ApmSynthtraceEsClient; +}) { + const galaxy10 = apm + .mobileApp({ + name: 'synth-android', + environment: 'production', + agentName: 'android/java', + }) + .mobileDevice() + .deviceInfo({ + manufacturer: 'Samsung', + modelIdentifier: 'SM-G930F', + modelName: 'Galaxy S7', + }) + .osInfo({ + osType: 'android', + osVersion: '10', + osFull: 'Android 10, API level 29, BUILD A022MUBU2AUD1', + runtimeVersion: '2.1.0', + }) + .setGeoInfo({ + clientIp: '223.72.43.22', + cityName: 'Beijing', + continentName: 'Asia', + countryIsoCode: 'CN', + countryName: 'China', + regionIsoCode: 'CN-BJ', + regionName: 'Beijing', + location: { coordinates: [116.3861, 39.9143], type: 'Point' }, + }) + .setNetworkConnection({ type: 'wifi' }); + + const galaxy7 = apm + .mobileApp({ + name: 'synth-android', + environment: 'production', + agentName: 'android/java', + }) + .mobileDevice() + .deviceInfo({ + manufacturer: 'Samsung', + modelIdentifier: 'SM-G930F', + modelName: 'Galaxy S7', + }) + .osInfo({ + osType: 'android', + osVersion: '10', + osFull: 'Android 10, API level 29, BUILD A022MUBU2AUD1', + runtimeVersion: '2.1.0', + }) + .setGeoInfo({ + clientIp: '223.72.43.22', + cityName: 'Beijing', + continentName: 'Asia', + countryIsoCode: 'CN', + countryName: 'China', + regionIsoCode: 'CN-BJ', + regionName: 'Beijing', + location: { coordinates: [116.3861, 39.9143], type: 'Point' }, + }) + .setNetworkConnection({ + type: 'cell', + subType: 'edge', + carrierName: 'M1 Limited', + carrierMNC: '03', + carrierICC: 'SG', + carrierMCC: '525', + }); + + return await synthtraceEsClient.index([ + timerange(start, end) + .interval('5m') + .rate(1) + .generator((timestamp) => { + galaxy10.startNewSession(); + galaxy7.startNewSession(); + return [ + galaxy10 + .transaction('Start View - View Appearing', 'Android Activity') + .timestamp(timestamp) + .duration(500) + .success() + .children( + galaxy10 + .span({ + spanName: 'onCreate', + spanType: 'app', + spanSubtype: 'internal', + }) + .duration(50) + .success() + .timestamp(timestamp + 20), + galaxy10 + .httpSpan({ + spanName: 'GET backend:1234', + httpMethod: 'GET', + httpUrl: 'https://backend:1234/api/start', + }) + .duration(800) + .success() + .timestamp(timestamp + 400) + ), + galaxy10 + .transaction('Second View - View Appearing', 'Android Activity') + .timestamp(10000 + timestamp) + .duration(300) + .failure() + .children( + galaxy10 + .httpSpan({ + spanName: 'GET backend:1234', + httpMethod: 'GET', + httpUrl: 'https://backend:1234/api/second', + }) + .duration(400) + .success() + .timestamp(10000 + timestamp + 250) + ), + galaxy7 + .transaction('Start View - View Appearing', 'Android Activity') + .timestamp(timestamp) + .duration(20) + .success() + .children( + galaxy7 + .span({ + spanName: 'onCreate', + spanType: 'app', + spanSubtype: 'internal', + }) + .duration(50) + .success() + .timestamp(timestamp + 20), + galaxy7 + .httpSpan({ + spanName: 'GET backend:1234', + httpMethod: 'GET', + httpUrl: 'https://backend:1234/api/start', + }) + .duration(800) + .success() + .timestamp(timestamp + 400) + ), + ]; + }), + ]); +} diff --git a/x-pack/test/apm_api_integration/tests/mobile/mobile_stats.spec.ts b/x-pack/test/apm_api_integration/tests/mobile/mobile_stats.spec.ts new file mode 100644 index 0000000000000..c21839a5058b2 --- /dev/null +++ b/x-pack/test/apm_api_integration/tests/mobile/mobile_stats.spec.ts @@ -0,0 +1,170 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { APIReturnType } from '@kbn/apm-plugin/public/services/rest/create_call_apm_api'; +import { ENVIRONMENT_ALL } from '@kbn/apm-plugin/common/environment_filter_values'; +import { sumBy } from 'lodash'; +import { FtrProviderContext } from '../../common/ftr_provider_context'; +import { generateMobileData } from './generate_mobile_data'; + +type MobileStats = APIReturnType<'GET /internal/apm/mobile-services/{serviceName}/stats'>; + +export default function ApiTest({ getService }: FtrProviderContext) { + const apmApiClient = getService('apmApiClient'); + const registry = getService('registry'); + const synthtraceEsClient = getService('synthtraceEsClient'); + + const start = new Date('2023-01-01T00:00:00.000Z').getTime(); + const end = new Date('2023-01-01T00:15:00.000Z').getTime() - 1; + + async function getMobileStats({ + environment = ENVIRONMENT_ALL.value, + kuery = '', + serviceName, + transactionType = 'mobile', + }: { + environment?: string; + kuery?: string; + serviceName: string; + transactionType?: string; + }) { + return await apmApiClient + .readUser({ + endpoint: 'GET /internal/apm/mobile-services/{serviceName}/stats', + params: { + path: { serviceName }, + query: { + environment, + start: new Date(start).toISOString(), + end: new Date(end).toISOString(), + kuery, + transactionType, + }, + }, + }) + .then(({ body }) => body); + } + + registry.when('Mobile stats when data is not loaded', { config: 'basic', archives: [] }, () => { + describe('when no data', () => { + it('handles empty state', async () => { + const response = await getMobileStats({ serviceName: 'foo' }); + expect(response).to.eql({ + sessions: { + timeseries: [], + }, + requests: { + timeseries: [], + }, + maxLoadTime: { + timeseries: [], + }, + crashCount: { + value: 0, + timeseries: [], + }, + }); + }); + }); + }); + + registry.when('Mobile stats', { config: 'basic', archives: [] }, () => { + before(async () => { + await generateMobileData({ + synthtraceEsClient, + start, + end, + }); + }); + + after(() => synthtraceEsClient.clean()); + + describe('when data is loaded', () => { + let response: MobileStats; + + before(async () => { + response = await getMobileStats({ + serviceName: 'synth-android', + environment: 'production', + }); + }); + + it('returns same sessions', () => { + const { value, timeseries } = response.sessions; + const timeseriesTotal = sumBy(timeseries, 'y'); + expect(value).to.be(timeseriesTotal); + }); + + it('returns same crashCount', () => { + const { value, timeseries } = response.crashCount; + const timeseriesTotal = sumBy(timeseries, 'y'); + expect(value).to.be(timeseriesTotal); + }); + + it('returns same requests', () => { + const { value, timeseries } = response.requests; + const timeseriesTotal = sumBy(timeseries, 'y'); + expect(value).to.be(timeseriesTotal); + }); + }); + + describe('when filters are applied', () => { + it('returns empty state for filters', async () => { + const response = await getMobileStats({ + serviceName: 'synth-android', + environment: 'production', + kuery: `app.version:"none"`, + }); + + expect(response).to.eql({ + sessions: { + value: 0, + timeseries: [], + }, + requests: { + value: 0, + timeseries: [], + }, + maxLoadTime: { + value: null, + timeseries: [], + }, + crashCount: { + value: 0, + timeseries: [], + }, + }); + }); + + it('returns the correct values when single filter is applied', async () => { + const response = await getMobileStats({ + serviceName: 'synth-android', + environment: 'production', + kuery: `network.connection.type:"wifi"`, + }); + + expect(response.sessions.value).to.eql(3); + expect(response.requests.value).to.eql(6); + expect(response.crashCount.value).to.eql(0); + expect(response.maxLoadTime.value).to.eql(null); + }); + + it('returns the correct values when multiple filters are applied', async () => { + const response = await getMobileStats({ + serviceName: 'synth-android', + kuery: `app.version:"1.0" and environment: "production"`, + }); + + expect(response.sessions.value).to.eql(0); + expect(response.requests.value).to.eql(0); + expect(response.crashCount.value).to.eql(0); + expect(response.maxLoadTime.value).to.eql(null); + }); + }); + }); +} From a275262b8a608ca0d0f14db4858d9cbbef6893e8 Mon Sep 17 00:00:00 2001 From: Angela Chuang <6295984+angorayc@users.noreply.github.com> Date: Thu, 12 Jan 2023 09:59:39 +0000 Subject: [PATCH 08/39] [Security Solution] Resolve JS warnings triggered by incorrect state changed (#148552) ## Summary Found these js warning after replacing charts with Lens in https://github.com/elastic/kibana/pull/148519: Screenshot 2023-01-09 at 15 31 17 Wrap `search.session.start()` with useEffect to avoid incorrect state changed. ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios Co-authored-by: Steph Milovic --- .github/CODEOWNERS | 1 + .../common/components/page/manage_query.tsx | 22 ++++++++++------ .../page/use_refetch_by_session.test.tsx | 18 +++++-------- .../page/use_refetch_by_session.tsx | 25 +++++++++---------- .../components/kpi_hosts/hosts/index.test.tsx | 8 +++--- .../components/kpi_hosts/hosts/index.tsx | 4 +-- .../kpi_hosts/unique_ips/index.test.tsx | 8 +++--- .../components/kpi_hosts/unique_ips/index.tsx | 4 +-- .../components/kpi_network/dns/index.test.tsx | 8 +++--- .../components/kpi_network/dns/index.tsx | 4 +-- .../kpi_network/network_events/index.test.tsx | 8 +++--- .../kpi_network/network_events/index.tsx | 4 +-- .../kpi_network/tls_handshakes/index.test.tsx | 6 ++--- .../kpi_network/tls_handshakes/index.tsx | 4 +-- .../kpi_network/unique_flows/index.test.tsx | 6 ++--- .../kpi_network/unique_flows/index.tsx | 4 +-- .../unique_private_ips/index.test.tsx | 6 ++--- .../kpi_network/unique_private_ips/index.tsx | 4 +-- .../kpi_users/authentications/index.test.tsx | 8 +++--- .../kpi_users/authentications/index.tsx | 6 ++--- .../kpi_users/total_users/index.test.tsx | 8 +++--- .../kpi_users/total_users/index.tsx | 4 +-- .../alert_donut_embeddable.tsx | 21 ++++++++++++---- 23 files changed, 102 insertions(+), 89 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0cd43a0be9b54..41c5b37e68f6e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -496,6 +496,7 @@ /x-pack/plugins/security_solution/public/common/components/navigation @elastic/security-threat-hunting-explore /x-pack/plugins/security_solution/public/common/components/news_feed @elastic/security-threat-hunting-explore /x-pack/plugins/security_solution/public/common/components/overview_description_list @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/components/page @elastic/security-threat-hunting-explore /x-pack/plugins/security_solution/public/common/components/sidebar_header @elastic/security-threat-hunting-explore /x-pack/plugins/security_solution/public/common/components/tables @elastic/security-threat-hunting-explore /x-pack/plugins/security_solution/public/common/components/top_n @elastic/security-threat-hunting-explore diff --git a/x-pack/plugins/security_solution/public/common/components/page/manage_query.tsx b/x-pack/plugins/security_solution/public/common/components/page/manage_query.tsx index 5b381fbad26fe..bfb439a8872ec 100644 --- a/x-pack/plugins/security_solution/public/common/components/page/manage_query.tsx +++ b/x-pack/plugins/security_solution/public/common/components/page/manage_query.tsx @@ -7,8 +7,10 @@ import type { Position } from '@elastic/charts'; import { omit } from 'lodash/fp'; +import type { MutableRefObject } from 'react'; import React, { useEffect } from 'react'; +import type { ISessionService } from '@kbn/data-plugin/public'; import type { inputsModel } from '../../store'; import type { GlobalTimeArgs } from '../../containers/use_global_time'; import type { InputsModelId } from '../../store/inputs/constants'; @@ -21,14 +23,14 @@ export interface OwnProps extends Pick; } export function manageQuery( WrappedComponent: React.ComponentClass | React.ComponentType ): React.FC { const ManageQuery = (props: OwnProps & T) => { - const { deleteQuery, id, inspect = null, loading, refetch, setQuery, searchSessionId } = props; + const { deleteQuery, id, inspect = null, loading, refetch, setQuery, session } = props; useQueryInspector({ deleteQuery, @@ -36,7 +38,7 @@ export function manageQuery( loading, queryId: id, refetch, - searchSessionId, + session, setQuery, }); @@ -54,7 +56,7 @@ interface UseQueryInspectorTypes extends Pick; } export const useQueryInspector = ({ @@ -64,11 +66,17 @@ export const useQueryInspector = ({ inspect, loading, queryId, - searchSessionId, + session, }: UseQueryInspectorTypes) => { useEffect(() => { - setQuery({ id: queryId, inspect: inspect ?? null, loading, refetch, searchSessionId }); - }, [deleteQuery, setQuery, queryId, refetch, inspect, loading, searchSessionId]); + setQuery({ + id: queryId, + inspect: inspect ?? null, + loading, + refetch, + searchSessionId: session?.current.start(), + }); + }, [deleteQuery, setQuery, queryId, refetch, inspect, loading, session]); useEffect(() => { return () => { diff --git a/x-pack/plugins/security_solution/public/common/components/page/use_refetch_by_session.test.tsx b/x-pack/plugins/security_solution/public/common/components/page/use_refetch_by_session.test.tsx index 58992fd098a1c..a800266a8ac6d 100644 --- a/x-pack/plugins/security_solution/public/common/components/page/use_refetch_by_session.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/page/use_refetch_by_session.test.tsx @@ -4,6 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import type { MutableRefObject } from 'react'; import React from 'react'; import type { RenderHookResult } from '@testing-library/react-hooks'; import { renderHook } from '@testing-library/react-hooks'; @@ -21,6 +22,7 @@ import { InputsModelId } from '../../store/inputs/constants'; import { useRefetchByRestartingSession } from './use_refetch_by_session'; import { inputsActions } from '../../store/actions'; import type { Refetch } from '../../store/inputs/model'; +import type { ISessionService } from '@kbn/data-plugin/public'; const state: State = mockGlobalState; @@ -60,14 +62,11 @@ describe(`useRefetchByRestartingSession`, () => { children: React.ReactNode; }, { - searchSessionId: string | undefined; + session: MutableRefObject; refetchByRestartingSession: Refetch; } >; - const mockSessionStart = jest - .fn() - .mockReturnValueOnce('mockSessionId') - .mockReturnValue('mockSessionId1'); + const mockSessionStart = jest.fn().mockReturnValue('mockSessionId'); const mockSession = { start: mockSessionStart, }; @@ -97,20 +96,15 @@ describe(`useRefetchByRestartingSession`, () => { ); }); - it('should start a session', () => { - expect(mockSessionStart).toHaveBeenCalledTimes(1); - expect(res.result.current.searchSessionId).toBe('mockSessionId'); - }); - it('should start a session when clicking refetchByRestartingSession', () => { res.result.current.refetchByRestartingSession(); - expect(mockSessionStart).toHaveBeenCalledTimes(2); + expect(mockSessionStart).toHaveBeenCalledTimes(1); expect(inputsActions.setInspectionParameter).toHaveBeenCalledWith({ id: 'test', selectedInspectIndex: 0, isInspected: false, inputId: InputsModelId.global, - searchSessionId: 'mockSessionId1', + searchSessionId: 'mockSessionId', }); }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/page/use_refetch_by_session.tsx b/x-pack/plugins/security_solution/public/common/components/page/use_refetch_by_session.tsx index 23c95449f28ee..930934fb177ba 100644 --- a/x-pack/plugins/security_solution/public/common/components/page/use_refetch_by_session.tsx +++ b/x-pack/plugins/security_solution/public/common/components/page/use_refetch_by_session.tsx @@ -5,8 +5,10 @@ * 2.0. */ -import { useCallback, useRef, useMemo } from 'react'; +import type { MutableRefObject } from 'react'; +import { useCallback, useRef } from 'react'; import { useDispatch } from 'react-redux'; +import type { ISessionService } from '@kbn/data-plugin/public'; import { useDeepEqualSelector } from '../../hooks/use_selector'; import { useKibana } from '../../lib/kibana'; import { inputsSelectors } from '../../store'; @@ -25,7 +27,7 @@ export const useRefetchByRestartingSession = ({ queryId, skip, }: UseRefetchByRestartingSessionProps): { - searchSessionId: string | undefined; + session: MutableRefObject; refetchByRestartingSession: Refetch; } => { const dispatch = useDispatch(); @@ -35,16 +37,10 @@ export const useRefetchByRestartingSession = ({ const getGlobalQuery = inputsSelectors.globalQueryByIdSelector(); const getTimelineQuery = inputsSelectors.timelineQueryByIdSelector(); - const { selectedInspectIndex, searchSessionId: existingSearchSessionId } = useDeepEqualSelector( - (state) => - inputId === InputsModelId.global - ? getGlobalQuery(state, queryId) - : getTimelineQuery(state, queryId) - ); - - const searchSessionId = useMemo( - () => (skip ? undefined : existingSearchSessionId ?? session.current.start()), - [existingSearchSessionId, skip] + const { selectedInspectIndex } = useDeepEqualSelector((state) => + inputId === InputsModelId.global + ? getGlobalQuery(state, queryId) + : getTimelineQuery(state, queryId) ); const refetchByRestartingSession = useCallback(() => { @@ -63,5 +59,8 @@ export const useRefetchByRestartingSession = ({ ); }, [dispatch, queryId, selectedInspectIndex, skip]); - return { searchSessionId, refetchByRestartingSession }; + return { + session, + refetchByRestartingSession, + }; }; diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/index.test.tsx b/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/index.test.tsx index 44e8fce95725b..fb592f3910fb6 100644 --- a/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/index.test.tsx +++ b/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/index.test.tsx @@ -35,6 +35,7 @@ describe('KPI Hosts', () => { const MockKpiBaseComponentManage = KpiBaseComponentManage as jest.Mock; const mockRefetchByRestartingSession = jest.fn(); const mockRefetch = jest.fn(); + const mockSession = { current: { start: jest.fn(() => 'mockNewSearchSessionId') } }; const defaultProps = { from: '2019-06-25T04:31:59.345Z', to: '2019-06-25T06:31:59.345Z', @@ -58,6 +59,7 @@ describe('KPI Hosts', () => { ]); (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(false); (useRefetchByRestartingSession as jest.Mock).mockReturnValue({ + session: mockSession, searchSessionId: 'mockSearchSessionId', refetchByRestartingSession: mockRefetchByRestartingSession, }); @@ -90,7 +92,7 @@ describe('KPI Hosts', () => { ); expect(MockKpiBaseComponentManage.mock.calls[0][0].refetch).toEqual(mockRefetch); - expect(MockKpiBaseComponentManage.mock.calls[0][0].searchSessionId).toBeUndefined(); + expect(MockKpiBaseComponentManage.mock.calls[0][0].session).toBeUndefined(); }); it('Refetch by restarting search session ID if isChartEmbeddablesEnabled = true', () => { (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(true); @@ -104,8 +106,6 @@ describe('KPI Hosts', () => { expect(MockKpiBaseComponentManage.mock.calls[0][0].refetch).toEqual( mockRefetchByRestartingSession ); - expect(MockKpiBaseComponentManage.mock.calls[0][0].searchSessionId).toEqual( - 'mockSearchSessionId' - ); + expect(MockKpiBaseComponentManage.mock.calls[0][0].session).toEqual(mockSession); }); }); diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/index.tsx b/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/index.tsx index 4cf9bd91f6c35..476aedd473586 100644 --- a/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/index.tsx +++ b/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/index.tsx @@ -63,7 +63,7 @@ const HostsKpiHostsComponent: React.FC = ({ skip: querySkip || isChartEmbeddablesEnabled, }); - const { searchSessionId, refetchByRestartingSession } = useRefetchByRestartingSession({ + const { session, refetchByRestartingSession } = useRefetchByRestartingSession({ inputId: InputsModelId.global, queryId: id, }); @@ -81,7 +81,7 @@ const HostsKpiHostsComponent: React.FC = ({ refetch={isChartEmbeddablesEnabled ? refetchByRestartingSession : refetch} setQuery={setQuery} setQuerySkip={setQuerySkip} - searchSessionId={isChartEmbeddablesEnabled ? searchSessionId : undefined} + session={isChartEmbeddablesEnabled ? session : undefined} /> ); }; diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/index.test.tsx b/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/index.test.tsx index 17e5ebd5e1306..67d9aa0366c4f 100644 --- a/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/index.test.tsx +++ b/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/index.test.tsx @@ -34,6 +34,7 @@ describe('KPI Unique IPs', () => { const mockUseQueryToggle = useQueryToggle as jest.Mock; const MockKpiBaseComponentManage = KpiBaseComponentManage as jest.Mock; const mockRefetchByRestartingSession = jest.fn(); + const mockSession = { current: { start: jest.fn(() => 'mockNewSearchSessionId') } }; const mockRefetch = jest.fn(); const defaultProps = { from: '2019-06-25T04:31:59.345Z', @@ -58,6 +59,7 @@ describe('KPI Unique IPs', () => { ]); (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(false); (useRefetchByRestartingSession as jest.Mock).mockReturnValue({ + session: mockSession, searchSessionId: 'mockSearchSessionId', refetchByRestartingSession: mockRefetchByRestartingSession, }); @@ -90,7 +92,7 @@ describe('KPI Unique IPs', () => { ); expect(MockKpiBaseComponentManage.mock.calls[0][0].refetch).toEqual(mockRefetch); - expect(MockKpiBaseComponentManage.mock.calls[0][0].searchSessionId).toBeUndefined(); + expect(MockKpiBaseComponentManage.mock.calls[0][0].session).toBeUndefined(); }); it('Refetch by restarting search session ID if isChartEmbeddablesEnabled = true', () => { (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(true); @@ -104,8 +106,6 @@ describe('KPI Unique IPs', () => { expect(MockKpiBaseComponentManage.mock.calls[0][0].refetch).toEqual( mockRefetchByRestartingSession ); - expect(MockKpiBaseComponentManage.mock.calls[0][0].searchSessionId).toEqual( - 'mockSearchSessionId' - ); + expect(MockKpiBaseComponentManage.mock.calls[0][0].session).toEqual(mockSession); }); }); diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/index.tsx b/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/index.tsx index 3cb0122d5687d..a5bf77d5d1f94 100644 --- a/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/index.tsx +++ b/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/index.tsx @@ -78,7 +78,7 @@ const HostsKpiUniqueIpsComponent: React.FC = ({ skip: querySkip || isChartEmbeddablesEnabled, }); - const { searchSessionId, refetchByRestartingSession } = useRefetchByRestartingSession({ + const { session, refetchByRestartingSession } = useRefetchByRestartingSession({ inputId: InputsModelId.global, queryId: id, }); @@ -96,7 +96,7 @@ const HostsKpiUniqueIpsComponent: React.FC = ({ refetch={isChartEmbeddablesEnabled ? refetchByRestartingSession : refetch} setQuery={setQuery} setQuerySkip={setQuerySkip} - searchSessionId={isChartEmbeddablesEnabled ? searchSessionId : undefined} + session={isChartEmbeddablesEnabled ? session : undefined} /> ); }; diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/dns/index.test.tsx b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/dns/index.test.tsx index 46c26543ab862..2945d3cc5d862 100644 --- a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/dns/index.test.tsx +++ b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/dns/index.test.tsx @@ -34,6 +34,7 @@ describe('DNS KPI', () => { const mockUseQueryToggle = useQueryToggle as jest.Mock; const MockKpiBaseComponentManage = KpiBaseComponentManage as jest.Mock; const mockRefetchByRestartingSession = jest.fn(); + const mockSession = { current: { start: jest.fn(() => 'mockNewSearchSessionId') } }; const mockRefetch = jest.fn(); const defaultProps = { from: '2019-06-25T04:31:59.345Z', @@ -59,6 +60,7 @@ describe('DNS KPI', () => { ]); (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(false); (useRefetchByRestartingSession as jest.Mock).mockReturnValue({ + session: mockSession, searchSessionId: 'mockSearchSessionId', refetchByRestartingSession: mockRefetchByRestartingSession, }); @@ -91,7 +93,7 @@ describe('DNS KPI', () => { ); expect(MockKpiBaseComponentManage.mock.calls[0][0].refetch).toEqual(mockRefetch); - expect(MockKpiBaseComponentManage.mock.calls[0][0].searchSessionId).toBeUndefined(); + expect(MockKpiBaseComponentManage.mock.calls[0][0].session).toBeUndefined(); }); it('Refetch by restarting search session ID if isChartEmbeddablesEnabled = true', () => { (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(true); @@ -105,8 +107,6 @@ describe('DNS KPI', () => { expect(MockKpiBaseComponentManage.mock.calls[0][0].refetch).toEqual( mockRefetchByRestartingSession ); - expect(MockKpiBaseComponentManage.mock.calls[0][0].searchSessionId).toEqual( - 'mockSearchSessionId' - ); + expect(MockKpiBaseComponentManage.mock.calls[0][0].session).toEqual(mockSession); }); }); diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/dns/index.tsx b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/dns/index.tsx index bea6ef43de363..9069c0b44276b 100644 --- a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/dns/index.tsx +++ b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/dns/index.tsx @@ -58,7 +58,7 @@ const NetworkKpiDnsComponent: React.FC = ({ skip: querySkip || isChartEmbeddablesEnabled, }); - const { searchSessionId, refetchByRestartingSession } = useRefetchByRestartingSession({ + const { session, refetchByRestartingSession } = useRefetchByRestartingSession({ inputId: InputsModelId.global, queryId: id, }); @@ -76,7 +76,7 @@ const NetworkKpiDnsComponent: React.FC = ({ refetch={isChartEmbeddablesEnabled ? refetchByRestartingSession : refetch} setQuery={setQuery} setQuerySkip={setQuerySkip} - searchSessionId={isChartEmbeddablesEnabled ? searchSessionId : undefined} + session={isChartEmbeddablesEnabled ? session : undefined} /> ); }; diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/network_events/index.test.tsx b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/network_events/index.test.tsx index bb894d795e16c..bd1bc90855894 100644 --- a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/network_events/index.test.tsx +++ b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/network_events/index.test.tsx @@ -34,6 +34,7 @@ describe('Network Events KPI', () => { const mockUseQueryToggle = useQueryToggle as jest.Mock; const MockKpiBaseComponentManage = KpiBaseComponentManage as jest.Mock; const mockRefetchByRestartingSession = jest.fn(); + const mockSession = { current: { start: jest.fn(() => 'mockNewSearchSessionId') } }; const mockRefetch = jest.fn(); const defaultProps = { from: '2019-06-25T04:31:59.345Z', @@ -58,6 +59,7 @@ describe('Network Events KPI', () => { ]); (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(false); (useRefetchByRestartingSession as jest.Mock).mockReturnValue({ + session: mockSession, searchSessionId: 'mockSearchSessionId', refetchByRestartingSession: mockRefetchByRestartingSession, }); @@ -90,7 +92,7 @@ describe('Network Events KPI', () => { ); expect(MockKpiBaseComponentManage.mock.calls[0][0].refetch).toEqual(mockRefetch); - expect(MockKpiBaseComponentManage.mock.calls[0][0].searchSessionId).toBeUndefined(); + expect(MockKpiBaseComponentManage.mock.calls[0][0].session).toBeUndefined(); }); it('Refetch by restarting search session ID if isChartEmbeddablesEnabled = true', () => { (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(true); @@ -104,8 +106,6 @@ describe('Network Events KPI', () => { expect(MockKpiBaseComponentManage.mock.calls[0][0].refetch).toEqual( mockRefetchByRestartingSession ); - expect(MockKpiBaseComponentManage.mock.calls[0][0].searchSessionId).toEqual( - 'mockSearchSessionId' - ); + expect(MockKpiBaseComponentManage.mock.calls[0][0].session).toEqual(mockSession); }); }); diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/network_events/index.tsx b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/network_events/index.tsx index 5aa792fd7c220..08173486c5d10 100644 --- a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/network_events/index.tsx +++ b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/network_events/index.tsx @@ -62,7 +62,7 @@ const NetworkKpiNetworkEventsComponent: React.FC = ({ skip: querySkip || isChartEmbeddablesEnabled, }); - const { searchSessionId, refetchByRestartingSession } = useRefetchByRestartingSession({ + const { session, refetchByRestartingSession } = useRefetchByRestartingSession({ inputId: InputsModelId.global, queryId: id, }); @@ -80,7 +80,7 @@ const NetworkKpiNetworkEventsComponent: React.FC = ({ refetch={isChartEmbeddablesEnabled ? refetchByRestartingSession : refetch} setQuery={setQuery} setQuerySkip={setQuerySkip} - searchSessionId={isChartEmbeddablesEnabled ? searchSessionId : undefined} + session={isChartEmbeddablesEnabled ? session : undefined} /> ); }; diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/index.test.tsx b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/index.test.tsx index f3d6192536ad4..965be78e4675f 100644 --- a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/index.test.tsx +++ b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/index.test.tsx @@ -34,6 +34,7 @@ describe('TLS Handshakes KPI', () => { const mockUseQueryToggle = useQueryToggle as jest.Mock; const MockKpiBaseComponentManage = KpiBaseComponentManage as jest.Mock; const mockRefetchByRestartingSession = jest.fn(); + const mockSession = { current: { start: jest.fn(() => 'mockNewSearchSessionId') } }; const mockRefetch = jest.fn(); const defaultProps = { from: '2019-06-25T04:31:59.345Z', @@ -58,6 +59,7 @@ describe('TLS Handshakes KPI', () => { ]); (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(false); (useRefetchByRestartingSession as jest.Mock).mockReturnValue({ + session: mockSession, searchSessionId: 'mockSearchSessionId', refetchByRestartingSession: mockRefetchByRestartingSession, }); @@ -104,8 +106,6 @@ describe('TLS Handshakes KPI', () => { expect(MockKpiBaseComponentManage.mock.calls[0][0].refetch).toEqual( mockRefetchByRestartingSession ); - expect(MockKpiBaseComponentManage.mock.calls[0][0].searchSessionId).toEqual( - 'mockSearchSessionId' - ); + expect(MockKpiBaseComponentManage.mock.calls[0][0].session).toEqual(mockSession); }); }); diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/index.tsx b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/index.tsx index 53eb79d88e3fa..08d3d401307a6 100644 --- a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/index.tsx +++ b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/index.tsx @@ -57,7 +57,7 @@ const NetworkKpiTlsHandshakesComponent: React.FC = ({ skip: querySkip || isChartEmbeddablesEnabled, }); - const { searchSessionId, refetchByRestartingSession } = useRefetchByRestartingSession({ + const { session, refetchByRestartingSession } = useRefetchByRestartingSession({ inputId: InputsModelId.global, queryId: id, }); @@ -75,7 +75,7 @@ const NetworkKpiTlsHandshakesComponent: React.FC = ({ refetch={isChartEmbeddablesEnabled ? refetchByRestartingSession : refetch} setQuery={setQuery} setQuerySkip={setQuerySkip} - searchSessionId={isChartEmbeddablesEnabled ? searchSessionId : undefined} + session={isChartEmbeddablesEnabled ? session : undefined} /> ); }; diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/index.test.tsx b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/index.test.tsx index 39bbe9a2968c2..494c7e43abd5d 100644 --- a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/index.test.tsx +++ b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/index.test.tsx @@ -34,6 +34,7 @@ describe('Unique Flows KPI', () => { const mockUseQueryToggle = useQueryToggle as jest.Mock; const MockKpiBaseComponentManage = KpiBaseComponentManage as jest.Mock; const mockRefetchByRestartingSession = jest.fn(); + const mockSession = { current: { start: jest.fn(() => 'mockNewSearchSessionId') } }; const mockRefetch = jest.fn(); const defaultProps = { from: '2019-06-25T04:31:59.345Z', @@ -58,6 +59,7 @@ describe('Unique Flows KPI', () => { ]); (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(false); (useRefetchByRestartingSession as jest.Mock).mockReturnValue({ + session: mockSession, searchSessionId: 'mockSearchSessionId', refetchByRestartingSession: mockRefetchByRestartingSession, }); @@ -104,8 +106,6 @@ describe('Unique Flows KPI', () => { expect(MockKpiBaseComponentManage.mock.calls[0][0].refetch).toEqual( mockRefetchByRestartingSession ); - expect(MockKpiBaseComponentManage.mock.calls[0][0].searchSessionId).toEqual( - 'mockSearchSessionId' - ); + expect(MockKpiBaseComponentManage.mock.calls[0][0].session).toEqual(mockSession); }); }); diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/index.tsx b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/index.tsx index 6df7b9a2798a4..b7b145e9681ba 100644 --- a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/index.tsx +++ b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/index.tsx @@ -57,7 +57,7 @@ const NetworkKpiUniqueFlowsComponent: React.FC = ({ skip: querySkip || isChartEmbeddablesEnabled, }); - const { searchSessionId, refetchByRestartingSession } = useRefetchByRestartingSession({ + const { session, refetchByRestartingSession } = useRefetchByRestartingSession({ inputId: InputsModelId.global, queryId: id, }); @@ -75,7 +75,7 @@ const NetworkKpiUniqueFlowsComponent: React.FC = ({ refetch={isChartEmbeddablesEnabled ? refetchByRestartingSession : refetch} setQuery={setQuery} setQuerySkip={setQuerySkip} - searchSessionId={isChartEmbeddablesEnabled ? searchSessionId : undefined} + session={isChartEmbeddablesEnabled ? session : undefined} /> ); }; diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/index.test.tsx b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/index.test.tsx index 9d7cfdf128bd5..7e7309c85b48c 100644 --- a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/index.test.tsx +++ b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/index.test.tsx @@ -34,6 +34,7 @@ describe('Unique Private IPs KPI', () => { const mockUseQueryToggle = useQueryToggle as jest.Mock; const MockKpiBaseComponentManage = KpiBaseComponentManage as jest.Mock; const mockRefetchByRestartingSession = jest.fn(); + const mockSession = { current: { start: jest.fn(() => 'mockNewSearchSessionId') } }; const mockRefetch = jest.fn(); const defaultProps = { from: '2019-06-25T04:31:59.345Z', @@ -58,6 +59,7 @@ describe('Unique Private IPs KPI', () => { ]); (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(false); (useRefetchByRestartingSession as jest.Mock).mockReturnValue({ + session: mockSession, searchSessionId: 'mockSearchSessionId', refetchByRestartingSession: mockRefetchByRestartingSession, }); @@ -104,8 +106,6 @@ describe('Unique Private IPs KPI', () => { expect(MockKpiBaseComponentManage.mock.calls[0][0].refetch).toEqual( mockRefetchByRestartingSession ); - expect(MockKpiBaseComponentManage.mock.calls[0][0].searchSessionId).toEqual( - 'mockSearchSessionId' - ); + expect(MockKpiBaseComponentManage.mock.calls[0][0].session).toEqual(mockSession); }); }); diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/index.tsx b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/index.tsx index 8f8e5e5df620f..1f1e8e5d63724 100644 --- a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/index.tsx +++ b/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/index.tsx @@ -85,7 +85,7 @@ const NetworkKpiUniquePrivateIpsComponent: React.FC = ({ skip: querySkip || isChartEmbeddablesEnabled, }); - const { searchSessionId, refetchByRestartingSession } = useRefetchByRestartingSession({ + const { session, refetchByRestartingSession } = useRefetchByRestartingSession({ inputId: InputsModelId.global, queryId: id, }); @@ -103,7 +103,7 @@ const NetworkKpiUniquePrivateIpsComponent: React.FC = ({ refetch={isChartEmbeddablesEnabled ? refetchByRestartingSession : refetch} setQuery={setQuery} setQuerySkip={setQuerySkip} - searchSessionId={isChartEmbeddablesEnabled ? searchSessionId : undefined} + session={isChartEmbeddablesEnabled ? session : undefined} /> ); }; diff --git a/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/authentications/index.test.tsx b/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/authentications/index.test.tsx index 0ca07a48d03ca..68d03def9fd8d 100644 --- a/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/authentications/index.test.tsx +++ b/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/authentications/index.test.tsx @@ -33,6 +33,7 @@ describe('Authentications KPI', () => { const mockUseQueryToggle = useQueryToggle as jest.Mock; const MockKpiBaseComponentManage = KpiBaseComponentManage as jest.Mock; const mockRefetchByRestartingSession = jest.fn(); + const mockSession = { current: { start: jest.fn(() => 'mockNewSearchSessionId') } }; const mockRefetch = jest.fn(); const defaultProps = { from: '2019-06-25T04:31:59.345Z', @@ -57,6 +58,7 @@ describe('Authentications KPI', () => { ]); (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(false); (useRefetchByRestartingSession as jest.Mock).mockReturnValue({ + session: mockSession, searchSessionId: 'mockSearchSessionId', refetchByRestartingSession: mockRefetchByRestartingSession, }); @@ -89,7 +91,7 @@ describe('Authentications KPI', () => { ); expect(MockKpiBaseComponentManage.mock.calls[0][0].refetch).toEqual(mockRefetch); - expect(MockKpiBaseComponentManage.mock.calls[0][0].searchSessionId).toBeUndefined(); + expect(MockKpiBaseComponentManage.mock.calls[0][0].session).toBeUndefined(); }); it('Refetch by restarting search session ID if isChartEmbeddablesEnabled = true', () => { (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(true); @@ -103,8 +105,6 @@ describe('Authentications KPI', () => { expect(MockKpiBaseComponentManage.mock.calls[0][0].refetch).toEqual( mockRefetchByRestartingSession ); - expect(MockKpiBaseComponentManage.mock.calls[0][0].searchSessionId).toEqual( - 'mockSearchSessionId' - ); + expect(MockKpiBaseComponentManage.mock.calls[0][0].session).toEqual(mockSession); }); }); diff --git a/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/authentications/index.tsx b/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/authentications/index.tsx index 743d07bfa32f0..4cd4e4fbfd07f 100644 --- a/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/authentications/index.tsx +++ b/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/authentications/index.tsx @@ -79,10 +79,10 @@ const UsersKpiAuthenticationsComponent: React.FC = ({ endDate: to, indexNames, startDate: from, - skip: querySkip, + skip: querySkip || isChartEmbeddablesEnabled, }); - const { searchSessionId, refetchByRestartingSession } = useRefetchByRestartingSession({ + const { session, refetchByRestartingSession } = useRefetchByRestartingSession({ inputId: InputsModelId.global, queryId: id, }); @@ -100,7 +100,7 @@ const UsersKpiAuthenticationsComponent: React.FC = ({ refetch={isChartEmbeddablesEnabled ? refetchByRestartingSession : refetch} setQuery={setQuery} setQuerySkip={setQuerySkip} - searchSessionId={isChartEmbeddablesEnabled ? searchSessionId : undefined} + session={isChartEmbeddablesEnabled ? session : undefined} /> ); }; diff --git a/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/total_users/index.test.tsx b/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/total_users/index.test.tsx index 0adcd5e628761..a02b27d06ac99 100644 --- a/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/total_users/index.test.tsx +++ b/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/total_users/index.test.tsx @@ -34,6 +34,7 @@ describe('Total Users KPI', () => { const mockUseQueryToggle = useQueryToggle as jest.Mock; const MockKpiBaseComponentManage = KpiBaseComponentManage as jest.Mock; const mockRefetchByRestartingSession = jest.fn(); + const mockSession = { current: { start: jest.fn(() => 'mockNewSearchSessionId') } }; const mockRefetch = jest.fn(); const defaultProps = { from: '2019-06-25T04:31:59.345Z', @@ -58,6 +59,7 @@ describe('Total Users KPI', () => { }); (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(false); (useRefetchByRestartingSession as jest.Mock).mockReturnValue({ + session: mockSession, searchSessionId: 'mockSearchSessionId', refetchByRestartingSession: mockRefetchByRestartingSession, }); @@ -92,7 +94,7 @@ describe('Total Users KPI', () => { ); expect(MockKpiBaseComponentManage.mock.calls[0][0].refetch).toEqual(mockRefetch); - expect(MockKpiBaseComponentManage.mock.calls[0][0].searchSessionId).toBeUndefined(); + expect(MockKpiBaseComponentManage.mock.calls[0][0].session).toBeUndefined(); }); it('Refetch by restarting search session ID if isChartEmbeddablesEnabled = true', () => { (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(true); @@ -106,8 +108,6 @@ describe('Total Users KPI', () => { expect(MockKpiBaseComponentManage.mock.calls[0][0].refetch).toEqual( mockRefetchByRestartingSession ); - expect(MockKpiBaseComponentManage.mock.calls[0][0].searchSessionId).toEqual( - 'mockSearchSessionId' - ); + expect(MockKpiBaseComponentManage.mock.calls[0][0].session).toEqual(mockSession); }); }); diff --git a/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/total_users/index.tsx b/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/total_users/index.tsx index 930eb25b8a429..25326c38b1346 100644 --- a/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/total_users/index.tsx +++ b/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/total_users/index.tsx @@ -68,7 +68,7 @@ const TotalUsersKpiComponent: React.FC = ({ abort: querySkip || isChartEmbeddablesEnabled, }); - const { searchSessionId, refetchByRestartingSession } = useRefetchByRestartingSession({ + const { session, refetchByRestartingSession } = useRefetchByRestartingSession({ inputId: InputsModelId.global, queryId: QUERY_ID, }); @@ -100,7 +100,7 @@ const TotalUsersKpiComponent: React.FC = ({ refetch={isChartEmbeddablesEnabled ? refetchByRestartingSession : refetch} setQuery={setQuery} setQuerySkip={setQuerySkip} - searchSessionId={isChartEmbeddablesEnabled ? searchSessionId : undefined} + session={isChartEmbeddablesEnabled ? session : undefined} /> ); }; diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/alert_donut_embeddable.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/alert_donut_embeddable.tsx index 9ebac08c8b363..029bffdd8bc2b 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/alert_donut_embeddable.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/alert_donut_embeddable.tsx @@ -29,7 +29,7 @@ const AlertDonutEmbeddableComponent: React.FC = ({ }) => { const dispatch = useDispatch(); const queryId = `${DETECTION_RESPONSE_ALERTS_BY_STATUS_ID}-${status}`; - const { searchSessionId, refetchByRestartingSession } = useRefetchByRestartingSession({ + const { session, refetchByRestartingSession } = useRefetchByRestartingSession({ inputId: InputsModelId.global, queryId, }); @@ -45,14 +45,14 @@ const AlertDonutEmbeddableComponent: React.FC = ({ inputsActions.setQuery({ inputId: InputsModelId.global, id: queryId, - searchSessionId, + searchSessionId: session.current.start(), refetch: refetchByRestartingSession, loading: isLoading, inspect: { dsl: requests, response: responses }, }) ); }, - [dispatch, queryId, refetchByRestartingSession, searchSessionId] + [dispatch, queryId, refetchByRestartingSession, session] ); const extraOptions = useMemo(() => ({ status }), [status]); @@ -62,13 +62,24 @@ const AlertDonutEmbeddableComponent: React.FC = ({ inputsActions.setQuery({ inputId: InputsModelId.global, id: queryId, - searchSessionId, + searchSessionId: session.current.start(), refetch: refetchByRestartingSession, loading: false, inspect: null, }) ); - }, [dispatch, queryId, refetchByRestartingSession, searchSessionId, status]); + }, [dispatch, queryId, refetchByRestartingSession, session, status]); + + useEffect(() => { + return () => { + dispatch( + inputsActions.deleteOneQuery({ + inputId: InputsModelId.global, + id: queryId, + }) + ); + }; + }, [dispatch, queryId]); const dataExists = visualizationData != null && visualizationData[0].hits.total !== 0; From ae5594849c26775e5a6207258f5fe5139bd3e5a0 Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Thu, 12 Jan 2023 11:04:49 +0100 Subject: [PATCH 09/39] [ML] Move DatePickerWrapper and related code to package (#148063) - Moves duplicates of `DatePickerWrapper` and related code to package `@kbn/ml-date-picker`. The duplicated components across the code base have been consolidated and diverging features combined. Each duplicate has been checked with a diff against the package before deletion. - Moves duplicates of `query_utils.ts` to a package `@kbn/ml-query_utils`. - Some jest test were migrated from enzyme to react-testing-lib. - `i18n` strings and data-test-subjects have been updated to be prefixes in line with package names. - Replaces custom code related to the `compact` flag with EUI's breakpoints. --- .github/CODEOWNERS | 2 + package.json | 2 + tsconfig.base.json | 4 + x-pack/.i18nrc.json | 2 +- x-pack/packages/ml/date_picker/README.md | 3 + x-pack/packages/ml/date_picker/index.ts | 28 ++ .../ml/date_picker/jest.config.js} | 6 +- x-pack/packages/ml/date_picker/kibana.jsonc | 5 + x-pack/packages/ml/date_picker/package.json | 6 + .../components}/date_picker_wrapper.test.tsx | 142 +++++---- .../src/components}/date_picker_wrapper.tsx | 115 ++++--- .../full_time_range_selector.test.tsx | 43 ++- .../components}/full_time_range_selector.tsx | 111 ++++--- .../src/hooks/use_date_picker_context.tsx | 85 +++++ .../src/hooks}/use_timefilter.test.ts | 42 ++- .../date_picker/src/hooks/use_timefilter.ts} | 42 ++- .../full_time_range_selector_service.ts | 107 +++++++ .../src}/services/time_field_range.ts | 48 +-- .../services/timefilter_refresh_service.ts | 17 +- .../ml/date_picker/src/services/types.ts | 38 +++ x-pack/packages/ml/date_picker/src/storage.ts | 20 ++ x-pack/packages/ml/date_picker/tsconfig.json | 31 ++ .../packages/ml/is_defined/src/is_defined.ts | 2 +- x-pack/packages/ml/query_utils/README.md | 3 + .../ml/query_utils}/index.ts | 2 +- .../ml/query_utils/jest.config.js} | 6 +- x-pack/packages/ml/query_utils/kibana.jsonc | 5 + x-pack/packages/ml/query_utils/package.json | 6 + .../src/add_exclude_frozen_to_query.test.ts} | 2 +- .../src/add_exclude_frozen_to_query.ts} | 10 +- x-pack/packages/ml/query_utils/tsconfig.json | 21 ++ .../public/application/utils/query_utils.ts | 49 +-- .../change_point_detection_context.tsx | 2 +- .../change_point_detetion_root.tsx | 24 +- .../chart_component.tsx | 7 +- .../date_picker_wrapper.tsx | 278 ----------------- .../components/date_picker_wrapper/index.ts | 8 - .../explain_log_rate_spikes_app_state.tsx | 26 +- .../explain_log_rate_spikes_page.tsx | 72 +---- .../full_time_range_selector_service.ts | 75 ----- .../log_categorization_app_state.tsx | 23 +- .../log_categorization_page.tsx | 78 +---- .../components/page_header/page_header.tsx | 113 ++++--- .../public/hooks/use_aiops_app_context.ts | 9 +- x-pack/plugins/aiops/public/hooks/use_data.ts | 14 +- .../aiops/public/hooks/use_data_source.ts | 2 +- x-pack/plugins/aiops/public/types/storage.ts | 10 +- x-pack/plugins/aiops/tsconfig.json | 2 + .../date_picker_wrapper.tsx | 295 ------------------ .../field_data_row/action_menu/actions.ts | 7 +- .../actions_panel/actions_panel.tsx | 20 +- .../data_view_management.tsx | 4 +- .../full_time_range_selector.tsx | 206 ------------ .../full_time_range_selector_service.ts | 65 ---- .../full_time_range_selector/index.tsx | 10 - .../index_data_visualizer_view.tsx | 51 ++- .../components/search_panel/search_panel.tsx | 14 +- .../grid_embeddable/grid_embeddable.tsx | 32 +- .../hooks/use_data_visualizer_grid_data.ts | 5 +- .../hooks/use_time_filter.ts | 59 ---- .../index_data_visualizer.tsx | 75 ++--- .../services/timefilter_refresh_service.ts | 15 - .../index_data_visualizer/types/storage.ts | 10 +- .../utils/query_utils.test.ts | 76 ----- x-pack/plugins/data_visualizer/tsconfig.json | 1 + x-pack/plugins/ml/common/types/storage.ts | 10 +- x-pack/plugins/ml/common/util/query_utils.ts | 53 ---- x-pack/plugins/ml/public/application/app.tsx | 23 +- .../full_time_range_selector.test.tsx.snap | 79 ----- .../full_time_range_selector.tsx | 166 ---------- .../full_time_range_selector_service.ts | 68 ---- .../full_time_range_selector/index.tsx | 10 - .../components/ml_page/ml_page.tsx | 26 +- .../application/contexts/kibana/index.ts | 1 - .../contexts/kibana/use_timefilter.ts | 60 ---- .../datavisualizer_selector.tsx | 3 +- .../file_based/file_datavisualizer.tsx | 2 +- .../index_based/index_data_visualizer.tsx | 3 +- .../explorer/actions/load_explorer_data.ts | 3 +- .../explorer/anomaly_context_menu.tsx | 2 +- .../explorer/anomaly_explorer_context.tsx | 3 +- .../application/explorer/anomaly_timeline.tsx | 2 +- .../anomaly_timeline_state_service.ts | 4 +- .../new_job/common/job_creator/job_creator.ts | 2 +- .../components/time_range_step/time_range.tsx | 31 +- .../jobs/new_job/pages/new_job/page.tsx | 5 +- .../components/job_settings_form.tsx | 5 +- .../jobs/new_job/recognize/page.tsx | 2 +- .../components/notifications_list.test.tsx | 52 ++- .../components/notifications_list.tsx | 2 +- .../public/application/notifications/page.tsx | 3 +- .../anomaly_detection_panel/actions.tsx | 3 +- .../overview/components/content.tsx | 3 +- .../application/overview/overview_page.tsx | 4 +- .../application/routing/routes/explorer.tsx | 3 +- .../application/routing/routes/jobs_list.tsx | 8 +- .../routing/routes/notifications.tsx | 3 +- .../application/routing/routes/overview.tsx | 10 +- .../routing/routes/settings/calendar_list.tsx | 3 +- .../routes/settings/calendar_new_edit.tsx | 3 +- .../routing/routes/settings/filter_list.tsx | 3 +- .../routes/settings/filter_list_new_edit.tsx | 12 +- .../routing/routes/settings/settings.tsx | 3 +- .../routes/timeseriesexplorer.test.tsx | 62 ++-- .../routing/routes/timeseriesexplorer.tsx | 2 +- .../routes/trained_models/nodes_list.tsx | 3 +- .../public/application/routing/use_refresh.ts | 7 +- .../services/timefilter_refresh_service.tsx | 12 - .../models_management/models_list.tsx | 3 +- x-pack/plugins/ml/tsconfig.json | 4 +- .../translations/translations/fr-FR.json | 31 -- .../translations/translations/ja-JP.json | 31 -- .../translations/translations/zh-CN.json | 31 -- .../aiops/explain_log_rate_spikes_page.ts | 4 +- .../test/functional/services/ml/common_ui.ts | 2 +- .../services/ml/data_frame_analytics_table.ts | 4 +- .../ml/data_visualizer_index_based.ts | 2 +- .../test/functional/services/ml/job_table.ts | 2 +- .../services/ml/job_wizard_common.ts | 2 +- .../services/ml/trained_models_table.ts | 8 +- yarn.lock | 8 + 121 files changed, 1295 insertions(+), 2294 deletions(-) create mode 100644 x-pack/packages/ml/date_picker/README.md create mode 100644 x-pack/packages/ml/date_picker/index.ts rename x-pack/{plugins/ml/public/application/components/navigation_menu/date_picker_wrapper/index.ts => packages/ml/date_picker/jest.config.js} (66%) create mode 100644 x-pack/packages/ml/date_picker/kibana.jsonc create mode 100644 x-pack/packages/ml/date_picker/package.json rename x-pack/{plugins/ml/public/application/components/navigation_menu/date_picker_wrapper => packages/ml/date_picker/src/components}/date_picker_wrapper.test.tsx (52%) rename x-pack/{plugins/ml/public/application/components/navigation_menu/date_picker_wrapper => packages/ml/date_picker/src/components}/date_picker_wrapper.tsx (76%) rename x-pack/{plugins/ml/public/application/components/full_time_range_selector => packages/ml/date_picker/src/components}/full_time_range_selector.test.tsx (58%) rename x-pack/{plugins/aiops/public/components/full_time_range_selector => packages/ml/date_picker/src/components}/full_time_range_selector.tsx (65%) create mode 100644 x-pack/packages/ml/date_picker/src/hooks/use_date_picker_context.tsx rename x-pack/{plugins/ml/public/application/contexts/kibana => packages/ml/date_picker/src/hooks}/use_timefilter.test.ts (67%) rename x-pack/{plugins/aiops/public/hooks/use_time_filter.ts => packages/ml/date_picker/src/hooks/use_timefilter.ts} (64%) create mode 100644 x-pack/packages/ml/date_picker/src/services/full_time_range_selector_service.ts rename x-pack/{plugins/aiops/public/application => packages/ml/date_picker/src}/services/time_field_range.ts (55%) rename x-pack/{plugins/aiops/public/application => packages/ml/date_picker/src}/services/timefilter_refresh_service.ts (56%) create mode 100644 x-pack/packages/ml/date_picker/src/services/types.ts create mode 100644 x-pack/packages/ml/date_picker/src/storage.ts create mode 100644 x-pack/packages/ml/date_picker/tsconfig.json create mode 100644 x-pack/packages/ml/query_utils/README.md rename x-pack/{plugins/aiops/public/components/full_time_range_selector => packages/ml/query_utils}/index.ts (76%) rename x-pack/{plugins/data_visualizer/public/application/common/components/date_picker_wrapper/index.ts => packages/ml/query_utils/jest.config.js} (66%) create mode 100644 x-pack/packages/ml/query_utils/kibana.jsonc create mode 100644 x-pack/packages/ml/query_utils/package.json rename x-pack/{plugins/ml/common/util/query_utils.test.ts => packages/ml/query_utils/src/add_exclude_frozen_to_query.test.ts} (95%) rename x-pack/{plugins/data_visualizer/public/application/index_data_visualizer/utils/query_utils.ts => packages/ml/query_utils/src/add_exclude_frozen_to_query.ts} (81%) create mode 100644 x-pack/packages/ml/query_utils/tsconfig.json delete mode 100644 x-pack/plugins/aiops/public/components/date_picker_wrapper/date_picker_wrapper.tsx delete mode 100644 x-pack/plugins/aiops/public/components/date_picker_wrapper/index.ts delete mode 100644 x-pack/plugins/aiops/public/components/full_time_range_selector/full_time_range_selector_service.ts delete mode 100644 x-pack/plugins/data_visualizer/public/application/common/components/date_picker_wrapper/date_picker_wrapper.tsx delete mode 100644 x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx delete mode 100644 x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts delete mode 100644 x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/index.tsx delete mode 100644 x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_time_filter.ts delete mode 100644 x-pack/plugins/data_visualizer/public/application/index_data_visualizer/services/timefilter_refresh_service.ts delete mode 100644 x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/query_utils.test.ts delete mode 100644 x-pack/plugins/ml/common/util/query_utils.ts delete mode 100644 x-pack/plugins/ml/public/application/components/full_time_range_selector/__snapshots__/full_time_range_selector.test.tsx.snap delete mode 100644 x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.tsx delete mode 100644 x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector_service.ts delete mode 100644 x-pack/plugins/ml/public/application/components/full_time_range_selector/index.tsx delete mode 100644 x-pack/plugins/ml/public/application/contexts/kibana/use_timefilter.ts delete mode 100644 x-pack/plugins/ml/public/application/services/timefilter_refresh_service.tsx diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 41c5b37e68f6e..175494144b8f5 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1078,9 +1078,11 @@ src/plugins/chart_expressions/common @elastic/kibana-visualizations x-pack/packages/ml/agg_utils @elastic/ml-ui x-pack/packages/ml/aiops_components @elastic/ml-ui x-pack/packages/ml/aiops_utils @elastic/ml-ui +x-pack/packages/ml/date_picker @elastic/ml-ui x-pack/packages/ml/is_defined @elastic/ml-ui x-pack/packages/ml/is_populated_object @elastic/ml-ui x-pack/packages/ml/local_storage @elastic/ml-ui x-pack/packages/ml/nested_property @elastic/ml-ui +x-pack/packages/ml/query_utils @elastic/ml-ui x-pack/packages/ml/string_hash @elastic/ml-ui x-pack/packages/ml/url_state @elastic/ml-ui diff --git a/package.json b/package.json index ad4230c99f9ae..53c1023cc1e72 100644 --- a/package.json +++ b/package.json @@ -356,10 +356,12 @@ "@kbn/logging-mocks": "link:packages/kbn-logging-mocks", "@kbn/mapbox-gl": "link:packages/kbn-mapbox-gl", "@kbn/ml-agg-utils": "link:x-pack/packages/ml/agg_utils", + "@kbn/ml-date-picker": "link:x-pack/packages/ml/date_picker", "@kbn/ml-is-defined": "link:x-pack/packages/ml/is_defined", "@kbn/ml-is-populated-object": "link:x-pack/packages/ml/is_populated_object", "@kbn/ml-local-storage": "link:x-pack/packages/ml/local_storage", "@kbn/ml-nested-property": "link:x-pack/packages/ml/nested_property", + "@kbn/ml-query-utils": "link:x-pack/packages/ml/query_utils", "@kbn/ml-string-hash": "link:x-pack/packages/ml/string_hash", "@kbn/ml-url-state": "link:x-pack/packages/ml/url_state", "@kbn/monaco": "link:packages/kbn-monaco", diff --git a/tsconfig.base.json b/tsconfig.base.json index 2557759c0330f..3777e1088a2a8 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -838,6 +838,8 @@ "@kbn/maps-plugin/*": ["x-pack/plugins/maps/*"], "@kbn/ml-agg-utils": ["x-pack/packages/ml/agg_utils"], "@kbn/ml-agg-utils/*": ["x-pack/packages/ml/agg_utils/*"], + "@kbn/ml-date-picker": ["x-pack/packages/ml/date_picker"], + "@kbn/ml-date-picker/*": ["x-pack/packages/ml/date_picker/*"], "@kbn/ml-is-defined": ["x-pack/packages/ml/is_defined"], "@kbn/ml-is-defined/*": ["x-pack/packages/ml/is_defined/*"], "@kbn/ml-is-populated-object": ["x-pack/packages/ml/is_populated_object"], @@ -848,6 +850,8 @@ "@kbn/ml-nested-property/*": ["x-pack/packages/ml/nested_property/*"], "@kbn/ml-plugin": ["x-pack/plugins/ml"], "@kbn/ml-plugin/*": ["x-pack/plugins/ml/*"], + "@kbn/ml-query-utils": ["x-pack/packages/ml/query_utils"], + "@kbn/ml-query-utils/*": ["x-pack/packages/ml/query_utils/*"], "@kbn/ml-string-hash": ["x-pack/packages/ml/string_hash"], "@kbn/ml-string-hash/*": ["x-pack/packages/ml/string_hash/*"], "@kbn/ml-url-state": ["x-pack/packages/ml/url_state"], diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index 6e214dcb448e8..e0cb6b15760fb 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -44,7 +44,7 @@ "xpack.main": "legacy/plugins/xpack_main", "xpack.maps": ["plugins/maps"], "xpack.aiops": ["packages/ml/aiops_components", "plugins/aiops"], - "xpack.ml": ["plugins/ml"], + "xpack.ml": ["packages/ml/date_picker", "plugins/ml"], "xpack.monitoring": ["plugins/monitoring"], "xpack.osquery": ["plugins/osquery"], "xpack.painlessLab": "plugins/painless_lab", diff --git a/x-pack/packages/ml/date_picker/README.md b/x-pack/packages/ml/date_picker/README.md new file mode 100644 index 0000000000000..4cda1eba6ef66 --- /dev/null +++ b/x-pack/packages/ml/date_picker/README.md @@ -0,0 +1,3 @@ +# @kbn/ml-date-picker + +Date picker related components to be used in UIs maintained by the @elastic/ml-ui team. diff --git a/x-pack/packages/ml/date_picker/index.ts b/x-pack/packages/ml/date_picker/index.ts new file mode 100644 index 0000000000000..c3047c4957d5d --- /dev/null +++ b/x-pack/packages/ml/date_picker/index.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { + DatePickerContextProvider, + type DatePickerDependencies, +} from './src/hooks/use_date_picker_context'; +export { + useRefreshIntervalUpdates, + useTimefilter, + useTimeRangeUpdates, +} from './src/hooks/use_timefilter'; +export { DatePickerWrapper } from './src/components/date_picker_wrapper'; +export { + FullTimeRangeSelector, + type FullTimeRangeSelectorProps, +} from './src/components/full_time_range_selector'; +export { + getTimeFilterRange, + type TimeRange, +} from './src/services/full_time_range_selector_service'; +export { type GetTimeFieldRangeResponse } from './src/services/types'; +export { mlTimefilterRefresh$, type Refresh } from './src/services/timefilter_refresh_service'; +export { type FrozenTierPreference, FROZEN_TIER_PREFERENCE } from './src/storage'; diff --git a/x-pack/plugins/ml/public/application/components/navigation_menu/date_picker_wrapper/index.ts b/x-pack/packages/ml/date_picker/jest.config.js similarity index 66% rename from x-pack/plugins/ml/public/application/components/navigation_menu/date_picker_wrapper/index.ts rename to x-pack/packages/ml/date_picker/jest.config.js index 232f6c65d2b64..7538f57ac314e 100644 --- a/x-pack/plugins/ml/public/application/components/navigation_menu/date_picker_wrapper/index.ts +++ b/x-pack/packages/ml/date_picker/jest.config.js @@ -5,4 +5,8 @@ * 2.0. */ -export { DatePickerWrapper } from './date_picker_wrapper'; +module.exports = { + preset: '@kbn/test', + rootDir: '../../../..', + roots: ['/x-pack/packages/ml/date_picker'], +}; diff --git a/x-pack/packages/ml/date_picker/kibana.jsonc b/x-pack/packages/ml/date_picker/kibana.jsonc new file mode 100644 index 0000000000000..3fde0bf8c3bf2 --- /dev/null +++ b/x-pack/packages/ml/date_picker/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/ml-date-picker", + "owner": "@elastic/ml-ui" +} diff --git a/x-pack/packages/ml/date_picker/package.json b/x-pack/packages/ml/date_picker/package.json new file mode 100644 index 0000000000000..246cfba3e4b8b --- /dev/null +++ b/x-pack/packages/ml/date_picker/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/ml-date-picker", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/x-pack/plugins/ml/public/application/components/navigation_menu/date_picker_wrapper/date_picker_wrapper.test.tsx b/x-pack/packages/ml/date_picker/src/components/date_picker_wrapper.test.tsx similarity index 52% rename from x-pack/plugins/ml/public/application/components/navigation_menu/date_picker_wrapper/date_picker_wrapper.test.tsx rename to x-pack/packages/ml/date_picker/src/components/date_picker_wrapper.test.tsx index 30304d78c234e..bd5ed9a8f7b5b 100644 --- a/x-pack/plugins/ml/public/application/components/navigation_menu/date_picker_wrapper/date_picker_wrapper.test.tsx +++ b/x-pack/packages/ml/date_picker/src/components/date_picker_wrapper.test.tsx @@ -5,20 +5,24 @@ * 2.0. */ -import { mount } from 'enzyme'; +import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; import { EuiSuperDatePicker } from '@elastic/eui'; import { useUrlState } from '@kbn/ml-url-state'; +import type { UI_SETTINGS } from '@kbn/data-plugin/common'; -import { mlTimefilterRefresh$ } from '../../../services/timefilter_refresh_service'; -import { useToastNotificationService } from '../../../services/toast_notification_service'; +import { useDatePickerContext } from '../hooks/use_date_picker_context'; +import { mlTimefilterRefresh$ } from '../services/timefilter_refresh_service'; import { DatePickerWrapper } from './date_picker_wrapper'; jest.mock('@elastic/eui', () => { + const EuiButtonMock = jest.fn(() => { + return null; + }); const EuiSuperDatePickerMock = jest.fn(() => { return null; }); @@ -29,6 +33,9 @@ jest.mock('@elastic/eui', () => { return <>{children}; }); return { + useEuiBreakpoint: jest.fn(() => 'mediaQuery @media only screen and (max-width: 1199px)'), + useIsWithinMaxBreakpoint: jest.fn(() => false), + EuiButton: EuiButtonMock, EuiSuperDatePicker: EuiSuperDatePickerMock, EuiFlexGroup: EuiFlexGroupMock, EuiFlexItem: EuiFlexItemMock, @@ -43,67 +50,82 @@ jest.mock('@kbn/ml-url-state', () => { }; }); -jest.mock('../../../contexts/kibana/use_timefilter'); - -jest.mock('../../../services/toast_notification_service'); - -jest.mock('../../../contexts/kibana', () => ({ - useMlKibana: () => { +jest.mock('../hooks/use_timefilter', () => ({ + useRefreshIntervalUpdates: jest.fn(), + useTimefilter: () => { // eslint-disable-next-line @typescript-eslint/no-var-requires const { of } = require('rxjs'); return { - services: { - uiSettings: { - get: jest.fn().mockReturnValue([ - { - from: 'now/d', - to: 'now/d', - display: 'Today', - }, - { - from: 'now/w', - to: 'now/w', - display: 'This week', - }, - ]), + getRefreshIntervalUpdate$: of(), + }; + }, + useTimeRangeUpdates: jest.fn(() => { + return { from: '', to: '' }; + }), +})); + +jest.mock('../hooks/use_date_picker_context', () => ({ + useDatePickerContext: jest.fn(), +})); + +const mockContextFactory = (addWarning: jest.Mock) => { + // eslint-disable-next-line @typescript-eslint/no-var-requires + const { of } = require('rxjs'); + const mockedUiSettingsKeys = {} as typeof UI_SETTINGS; + const mockedToMountPoint = jest.fn(); + const mockedWrapWithTheme = jest.fn(); + + return () => ({ + notifications: { + toasts: { addWarning }, + }, + uiSettings: { + get: jest.fn().mockReturnValue([ + { + from: 'now/d', + to: 'now/d', + display: 'Today', }, - data: { - query: { - timefilter: { - timefilter: { - getRefreshInterval: jest.fn(), - setRefreshInterval: jest.fn(), - getTime: jest.fn(() => { - return { from: '', to: '' }; - }), - isAutoRefreshSelectorEnabled: jest.fn(() => true), - isTimeRangeSelectorEnabled: jest.fn(() => true), - getRefreshIntervalUpdate$: jest.fn(), - getTimeUpdate$: jest.fn(), - getEnabledUpdated$: jest.fn(), - }, - history: { get: jest.fn() }, - }, - }, + { + from: 'now/w', + to: 'now/w', + display: 'This week', }, - mlServices: { - httpService: { - getLoadingCount$: of(0), + ]), + }, + data: { + query: { + timefilter: { + timefilter: { + getRefreshInterval: jest.fn(), + setRefreshInterval: jest.fn(), + getTime: jest.fn(() => { + return { from: '', to: '' }; + }), + isAutoRefreshSelectorEnabled: jest.fn(() => true), + isTimeRangeSelectorEnabled: jest.fn(() => true), + getRefreshIntervalUpdate$: jest.fn(), + getTimeUpdate$: jest.fn(), + getEnabledUpdated$: jest.fn(), }, - }, - theme: { - theme$: of(), + history: { get: jest.fn() }, }, }, - }; - }, -})); + }, + theme: { + theme$: of(), + }, + uiSettingsKeys: mockedUiSettingsKeys, + toMountPoint: mockedToMountPoint, + wrapWithTheme: mockedWrapWithTheme, + }); +}; const MockedEuiSuperDatePicker = EuiSuperDatePicker as jest.MockedFunction< typeof EuiSuperDatePicker >; -describe('Navigation Menu: ', () => { +describe('', () => { beforeEach(() => { jest.useFakeTimers({ legacyFakeTimers: true }); MockedEuiSuperDatePicker.mockClear(); @@ -113,12 +135,16 @@ describe('Navigation Menu: ', () => { jest.useRealTimers(); }); - test('Minimal initialization.', () => { + test('Minimal initialization.', async () => { const refreshListener = jest.fn(); const refreshSubscription = mlTimefilterRefresh$.subscribe(refreshListener); - const wrapper = mount(); - expect(wrapper.find(DatePickerWrapper)).toHaveLength(1); + const displayWarningSpy = jest.fn(() => {}); + + (useDatePickerContext as jest.Mock).mockImplementation(mockContextFactory(displayWarningSpy)); + + render(); + expect(refreshListener).toBeCalledTimes(0); refreshSubscription.unsubscribe(); @@ -130,9 +156,7 @@ describe('Navigation Menu: ', () => { const displayWarningSpy = jest.fn(() => {}); - (useToastNotificationService as jest.Mock).mockReturnValueOnce({ - displayWarningToast: displayWarningSpy, - }); + (useDatePickerContext as jest.Mock).mockImplementation(mockContextFactory(displayWarningSpy)); // act render(); @@ -151,9 +175,7 @@ describe('Navigation Menu: ', () => { const displayWarningSpy = jest.fn(() => {}); - (useToastNotificationService as jest.Mock).mockReturnValueOnce({ - displayWarningToast: displayWarningSpy, - }); + (useDatePickerContext as jest.Mock).mockImplementation(mockContextFactory(displayWarningSpy)); // act render(); diff --git a/x-pack/plugins/ml/public/application/components/navigation_menu/date_picker_wrapper/date_picker_wrapper.tsx b/x-pack/packages/ml/date_picker/src/components/date_picker_wrapper.tsx similarity index 76% rename from x-pack/plugins/ml/public/application/components/navigation_menu/date_picker_wrapper/date_picker_wrapper.tsx rename to x-pack/packages/ml/date_picker/src/components/date_picker_wrapper.tsx index e8e42822ca885..0c707cc312944 100644 --- a/x-pack/plugins/ml/public/application/components/navigation_menu/date_picker_wrapper/date_picker_wrapper.tsx +++ b/x-pack/packages/ml/date_picker/src/components/date_picker_wrapper.tsx @@ -5,13 +5,14 @@ * 2.0. */ +import { css } from '@emotion/react'; import React, { FC, useCallback, useEffect, useMemo, useState } from 'react'; -import { i18n } from '@kbn/i18n'; import { Subscription } from 'rxjs'; import { debounce } from 'lodash'; -import { FormattedMessage } from '@kbn/i18n-react'; import { + useEuiBreakpoint, + useIsWithinMaxBreakpoint, EuiButton, EuiFlexGroup, EuiFlexItem, @@ -19,19 +20,19 @@ import { OnRefreshProps, OnTimeChangeProps, } from '@elastic/eui'; -import type { TimeRange } from '@kbn/es-query'; -import { TimeHistoryContract } from '@kbn/data-plugin/public'; -import { UI_SETTINGS } from '@kbn/data-plugin/common'; -import { wrapWithTheme, toMountPoint } from '@kbn/kibana-react-plugin/public'; +import type { TimeRange } from '@kbn/es-query'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import type { TimeHistoryContract } from '@kbn/data-plugin/public'; import { useUrlState } from '@kbn/ml-url-state'; -import { mlTimefilterRefresh$ } from '../../../services/timefilter_refresh_service'; -import { useMlKibana } from '../../../contexts/kibana'; -import { - useRefreshIntervalUpdates, - useTimeRangeUpdates, -} from '../../../contexts/kibana/use_timefilter'; -import { useToastNotificationService } from '../../../services/toast_notification_service'; + +import { useRefreshIntervalUpdates, useTimeRangeUpdates } from '../hooks/use_timefilter'; +import { useDatePickerContext } from '../hooks/use_date_picker_context'; +import { mlTimefilterRefresh$ } from '../services/timefilter_refresh_service'; + +const DEFAULT_REFRESH_INTERVAL_MS = 5000; +const DATE_PICKER_MAX_WIDTH = '540px'; interface TimePickerQuickRange { from: string; @@ -66,16 +67,46 @@ function updateLastRefresh(timeRange?: OnRefreshProps) { mlTimefilterRefresh$.next({ lastRefresh: Date.now(), ...(timeRange ? { timeRange } : {}) }); } -const DEFAULT_REFRESH_INTERVAL_MS = 5000; +/** + * DatePickerWrapper React Component props interface + */ +interface DatePickerWrapperProps { + /** + * Boolean flag to be passed on to `EuiSuperDatePicker`. + */ + isAutoRefreshOnly?: boolean; + /** + * Boolean flag to indicate loading state. + */ + isLoading?: boolean; + /** + * Boolean flag to enforce showing/hiding the refresh button. + */ + showRefresh?: boolean; +} + +/** + * DatePickerWrapper React Component + * + * @type {FC} + * @param props - `DatePickerWrapper` component props + * @returns {React.ReactElement} The DatePickerWrapper component. + */ +export const DatePickerWrapper: FC = (props) => { + const { isAutoRefreshOnly, isLoading = false, showRefresh } = props; + const { + data, + notifications: { toasts }, + theme: { theme$ }, + uiSettings: config, + uiSettingsKeys, + wrapWithTheme, + toMountPoint, + } = useDatePickerContext(); -export const DatePickerWrapper: FC = () => { - const { services } = useMlKibana(); - const config = services.uiSettings; - const theme$ = services.theme.theme$; + const isWithinLBreakpoint = useIsWithinMaxBreakpoint('l'); - const { httpService } = services.mlServices; - const { timefilter, history } = services.data.query.timefilter; - const { displayWarningToast } = useToastNotificationService(); + const { timefilter, history } = data.query.timefilter; const [globalState, setGlobalState] = useUrlState('_g'); const getRecentlyUsedRanges = getRecentlyUsedRangesFactory(history); @@ -117,7 +148,6 @@ export const DatePickerWrapper: FC = () => { [setGlobalState] ); - const [isLoading, setIsLoading] = useState(false); const [recentlyUsedRanges, setRecentlyUsedRanges] = useState(getRecentlyUsedRanges()); const [isAutoRefreshSelectorEnabled, setIsAutoRefreshSelectorEnabled] = useState( timefilter.isAutoRefreshSelectorEnabled() @@ -140,16 +170,16 @@ export const DatePickerWrapper: FC = () => { // Only warn about short interval with enabled auto-refresh. if (!isTooShort || refreshInterval.pause) return; - displayWarningToast( + toasts.addWarning( { title: isResolvedFromUrlState ? i18n.translate('xpack.ml.datePicker.shortRefreshIntervalURLWarningMessage', { defaultMessage: - 'The refresh interval in the URL is shorter than the minimum supported by Machine Learning.', + 'The refresh interval in the URL is shorter than the minimum supported interval.', }) : i18n.translate('xpack.ml.datePicker.shortRefreshIntervalTimeFilterWarningMessage', { defaultMessage: - 'The refresh interval in Advanced Settings is shorter than the minimum supported by Machine Learning.', + 'The refresh interval in Advanced Settings is shorter than the minimum supported interval.', }), text: toMountPoint( wrapWithTheme( @@ -160,7 +190,7 @@ export const DatePickerWrapper: FC = () => { })} > { const dateFormat = config.get('dateFormat'); const timePickerQuickRanges = config.get( - UI_SETTINGS.TIMEPICKER_QUICK_RANGES + uiSettingsKeys.TIMEPICKER_QUICK_RANGES ); const commonlyUsedRanges = useMemo( @@ -202,12 +232,6 @@ export const DatePickerWrapper: FC = () => { useEffect(() => { const subscriptions = new Subscription(); - subscriptions.add( - httpService.getLoadingCount$.subscribe((v) => { - setIsLoading(v !== 0); - }) - ); - const enabledUpdated$ = timefilter.getEnabledUpdated$(); if (enabledUpdated$ !== undefined) { subscriptions.add( @@ -250,19 +274,21 @@ export const DatePickerWrapper: FC = () => { setRefreshInterval({ pause, value }); } + const datePickerWidth = css({ + [useEuiBreakpoint(['xs', 's', 'm', 'l'])]: { + maxWidth: DATE_PICKER_MAX_WIDTH, + }, + }); + return isAutoRefreshSelectorEnabled || isTimeRangeSelectorEnabled ? ( - - + + { recentlyUsedRanges={recentlyUsedRanges} dateFormat={dateFormat} commonlyUsedRanges={commonlyUsedRanges} + updateButtonProps={{ iconOnly: isWithinLBreakpoint }} /> - {isTimeRangeSelectorEnabled ? null : ( + {showRefresh === true || !isTimeRangeSelectorEnabled ? ( updateLastRefresh()} - data-test-subj={`mlRefreshPageButton${isLoading ? ' loading' : ' loaded'}`} + data-test-subj={`mlDatePickerRefreshPageButton${isLoading ? ' loading' : ' loaded'}`} isLoading={isLoading} > - + - )} + ) : null} ) : null; }; diff --git a/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.test.tsx b/x-pack/packages/ml/date_picker/src/components/full_time_range_selector.test.tsx similarity index 58% rename from x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.test.tsx rename to x-pack/packages/ml/date_picker/src/components/full_time_range_selector.test.tsx index 442b1407aaf6d..1a5a964c61b32 100644 --- a/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.test.tsx +++ b/x-pack/packages/ml/date_picker/src/components/full_time_range_selector.test.tsx @@ -6,16 +6,30 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test-jest-helpers'; -import { FullTimeRangeSelector } from '.'; +import { render, fireEvent } from '@testing-library/react'; + import type { Query } from '@kbn/es-query'; import type { DataView } from '@kbn/data-views-plugin/public'; +import type { TimefilterContract } from '@kbn/data-plugin/public'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; + +import { + DatePickerContextProvider, + type DatePickerDependencies, +} from '../hooks/use_date_picker_context'; +import { FROZEN_TIER_PREFERENCE } from '../storage'; + +import { FullTimeRangeSelector } from './full_time_range_selector'; + +const mockDependencies = { + notifications: {}, +} as DatePickerDependencies; // Create a mock for the setFullTimeRange function in the service. // The mock is hoisted to the top, so need to prefix the mock function // with 'mock' so it can be used lazily. const mockSetFullTimeRange = jest.fn((indexPattern: DataView, query: Query) => true); -jest.mock('./full_time_range_selector_service', () => ({ +jest.mock('../services/full_time_range_selector_service', () => ({ setFullTimeRange: (indexPattern: DataView, query: Query) => mockSetFullTimeRange(indexPattern, query), })); @@ -44,24 +58,25 @@ describe('FullTimeRangeSelector', () => { query, }; - test('renders the selector', () => { + test('calls setFullTimeRange on clicking button', () => { const props = { ...requiredProps, disabled: false, + frozenDataPreference: FROZEN_TIER_PREFERENCE.EXCLUDE, + setFrozenDataPreference: jest.fn(), + timefilter: {} as TimefilterContract, }; - const wrapper = shallowWithIntl(); - expect(wrapper).toMatchSnapshot(); - }); + const { getByText } = render( + + + + + + ); - test('calls setFullTimeRange on clicking button', () => { - const props = { - ...requiredProps, - disabled: false, - }; + fireEvent.click(getByText(/use full data/i)); - const wrapper = shallowWithIntl(); - wrapper.find('EuiButton').simulate('click'); expect(mockSetFullTimeRange).toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/aiops/public/components/full_time_range_selector/full_time_range_selector.tsx b/x-pack/packages/ml/date_picker/src/components/full_time_range_selector.tsx similarity index 65% rename from x-pack/plugins/aiops/public/components/full_time_range_selector/full_time_range_selector.tsx rename to x-pack/packages/ml/date_picker/src/components/full_time_range_selector.tsx index 78cf53295cc26..dc0e9b269e1dd 100644 --- a/x-pack/plugins/aiops/public/components/full_time_range_selector/full_time_range_selector.tsx +++ b/x-pack/packages/ml/date_picker/src/components/full_time_range_selector.tsx @@ -5,14 +5,10 @@ * 2.0. */ -// TODO Consolidate with near duplicate component `FullTimeRangeSelector` in -// `x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx` - import React, { FC, useCallback, useMemo, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n-react'; + import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; -import { TimefilterContract } from '@kbn/data-plugin/public'; -import type { DataView } from '@kbn/data-plugin/common'; + import { EuiButton, EuiButtonIcon, @@ -24,40 +20,74 @@ import { EuiRadioGroupOption, EuiToolTip, } from '@elastic/eui'; + import { i18n } from '@kbn/i18n'; -import { useStorage } from '@kbn/ml-local-storage'; -import { useAiopsAppContext } from '../../hooks/use_aiops_app_context'; -import { - type GetTimeFieldRangeResponse, - setFullTimeRange, -} from './full_time_range_selector_service'; -import { - AIOPS_FROZEN_TIER_PREFERENCE, - FROZEN_TIER_PREFERENCE, - type AiOpsKey, - type AiOpsStorageMapped, - type FrozenTierPreference, -} from '../../types/storage'; +import type { DataView } from '@kbn/data-plugin/common'; +import type { TimefilterContract } from '@kbn/data-plugin/public'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { useDatePickerContext } from '../hooks/use_date_picker_context'; +import { setFullTimeRange } from '../services/full_time_range_selector_service'; +import type { GetTimeFieldRangeResponse } from '../services/types'; +import { FROZEN_TIER_PREFERENCE, type FrozenTierPreference } from '../storage'; +/** + * FullTimeRangeSelectorProps React Component props interface + */ export interface FullTimeRangeSelectorProps { + /** + * Frozen data preference ('exclude-frozen' | 'include-frozen') + */ + frozenDataPreference: FrozenTierPreference; + /** + * Callback to set frozen data preference. + * @param value - The updated frozen data preference. + */ + setFrozenDataPreference: (value: FrozenTierPreference | undefined) => void; + /** + * timefilter service. + */ timefilter: TimefilterContract; + /** + * Current data view. + */ dataView: DataView; + /** + * Boolean flag to enable/disable the full time range button. + */ disabled: boolean; + /** + * Optional DSL query. + */ query?: QueryDslQueryContainer; - callback?: (a: GetTimeFieldRangeResponse) => void; + /** + * Optional callback. + * @param value - The time field range response. + */ + callback?: (value: GetTimeFieldRangeResponse) => void; } -export const FullTimeRangeSelector: FC = ({ - timefilter, - dataView, - query, - disabled, - callback, -}) => { +/** + * Component for rendering a button which automatically sets the range of the time filter + * to the time range of data in the index(es) mapped to the supplied Kibana data view or query. + * + * @type {FC} + * @param props - `FullTimeRangeSelectorProps` component props + * @returns {React.ReactElement} The FullTimeRangeSelector component. + */ +export const FullTimeRangeSelector: FC = (props) => { + const { + frozenDataPreference, + setFrozenDataPreference, + timefilter, + dataView, + query, + disabled, + callback, + } = props; const { http, notifications: { toasts }, - } = useAiopsAppContext(); + } = useDatePickerContext(); // wrapper around setFullTimeRange to allow for the calling of the optional callBack prop const setRange = useCallback( @@ -77,7 +107,7 @@ export const FullTimeRangeSelector: FC = ({ } catch (e) { toasts.addDanger( i18n.translate( - 'xpack.aiops.index.fullTimeRangeSelector.errorSettingTimeRangeNotification', + 'xpack.ml.datePicker.fullTimeRangeSelector.errorSettingTimeRangeNotification', { defaultMessage: 'An error occurred setting the time range.', } @@ -90,15 +120,6 @@ export const FullTimeRangeSelector: FC = ({ const [isPopoverOpen, setPopover] = useState(false); - const [frozenDataPreference, setFrozenDataPreference] = useStorage< - AiOpsKey, - AiOpsStorageMapped - >( - AIOPS_FROZEN_TIER_PREFERENCE, - // By default we will exclude frozen data tier - FROZEN_TIER_PREFERENCE.EXCLUDE - ); - const setPreference = useCallback( (id: string) => { setFrozenDataPreference(id as FrozenTierPreference); @@ -121,7 +142,7 @@ export const FullTimeRangeSelector: FC = ({ { id: FROZEN_TIER_PREFERENCE.EXCLUDE, label: i18n.translate( - 'xpack.aiops.index.fullTimeRangeSelector.useFullDataExcludingFrozenMenuLabel', + 'xpack.ml.datePicker.fullTimeRangeSelector.useFullDataExcludingFrozenMenuLabel', { defaultMessage: 'Exclude frozen data tier', } @@ -130,7 +151,7 @@ export const FullTimeRangeSelector: FC = ({ { id: FROZEN_TIER_PREFERENCE.INCLUDE, label: i18n.translate( - 'xpack.aiops.index.fullTimeRangeSelector.useFullDataIncludingFrozenMenuLabel', + 'xpack.ml.datePicker.fullTimeRangeSelector.useFullDataIncludingFrozenMenuLabel', { defaultMessage: 'Include frozen data tier', } @@ -157,12 +178,12 @@ export const FullTimeRangeSelector: FC = ({ () => frozenDataPreference === FROZEN_TIER_PREFERENCE.EXCLUDE ? ( ) : ( ), @@ -175,10 +196,10 @@ export const FullTimeRangeSelector: FC = ({ setRange(dataView, query, true)} - data-test-subj="aiopsExplainLogRatesSpikeButtonUseFullData" + data-test-subj="mlDatePickerButtonUseFullData" > @@ -192,7 +213,7 @@ export const FullTimeRangeSelector: FC = ({ size="m" iconType="boxesVertical" aria-label={i18n.translate( - 'xpack.aiops.index.fullTimeRangeSelector.moreOptionsButtonAriaLabel', + 'xpack.ml.datePicker.fullTimeRangeSelector.moreOptionsButtonAriaLabel', { defaultMessage: 'More options', } diff --git a/x-pack/packages/ml/date_picker/src/hooks/use_date_picker_context.tsx b/x-pack/packages/ml/date_picker/src/hooks/use_date_picker_context.tsx new file mode 100644 index 0000000000000..19e59b58d392d --- /dev/null +++ b/x-pack/packages/ml/date_picker/src/hooks/use_date_picker_context.tsx @@ -0,0 +1,85 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { createContext, useContext, type FC } from 'react'; + +import type { UI_SETTINGS } from '@kbn/data-plugin/common'; +import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; +import type { CoreSetup, IUiSettingsClient, ThemeServiceStart } from '@kbn/core/public'; +import type { HttpStart } from '@kbn/core/public'; +import type { toMountPoint, wrapWithTheme } from '@kbn/kibana-react-plugin/public'; + +/** + * Date Picker Dependencies to be passed on via `DatePickerContextProvider`. + */ +export interface DatePickerDependencies { + /** + * data plugin + */ + data: DataPublicPluginStart; + /** + * http service + */ + http: HttpStart; + /** + * notifications service + */ + notifications: CoreSetup['notifications']; + /** + * EUI theme + */ + theme: ThemeServiceStart; + /** + * Kibana UI advanced settings + */ + uiSettings: IUiSettingsClient; + /** + * Kibana UI advanced settings keys. + */ + uiSettingsKeys: typeof UI_SETTINGS; + /** + * helper to be used with notifications. + */ + wrapWithTheme: typeof wrapWithTheme; + /** + * helper to be used with notifications. + */ + toMountPoint: typeof toMountPoint; +} + +/** + * The context holding the date picker dependencies. + */ +export const DatePickerContext = createContext(undefined); + +/** + * Custom hook to return date picker dependencies. + * @returns `DatePickerDependencies` + */ +export const useDatePickerContext = (): DatePickerDependencies => { + const datePickerContext = useContext(DatePickerContext); + + // if `undefined`, throw an error + if (datePickerContext === undefined) { + throw new Error('datePickerContext was used outside of its Provider'); + } + + return datePickerContext; +}; + +/** + * React Component that acts as a wrapper for DatePickerContext. + * + * @type {FC} + * @param props - The component props + * @returns {React.ReactElement} The DatePickerContextProvider component. + */ + +export const DatePickerContextProvider: FC = (props) => { + const { children, ...deps } = props; + return {children}; +}; diff --git a/x-pack/plugins/ml/public/application/contexts/kibana/use_timefilter.test.ts b/x-pack/packages/ml/date_picker/src/hooks/use_timefilter.test.ts similarity index 67% rename from x-pack/plugins/ml/public/application/contexts/kibana/use_timefilter.test.ts rename to x-pack/packages/ml/date_picker/src/hooks/use_timefilter.test.ts index 7ef42c321eef8..4b54b74d900f9 100644 --- a/x-pack/plugins/ml/public/application/contexts/kibana/use_timefilter.test.ts +++ b/x-pack/packages/ml/date_picker/src/hooks/use_timefilter.test.ts @@ -6,31 +6,35 @@ */ import { renderHook } from '@testing-library/react-hooks'; +import { useDatePickerContext } from './use_date_picker_context'; import { useTimefilter } from './use_timefilter'; -jest.mock('./kibana_context', () => ({ - useMlKibana: () => { - return { - services: { - data: { - query: { - timefilter: { - timefilter: { - disableTimeRangeSelector: jest.fn(), - disableAutoRefreshSelector: jest.fn(), - enableTimeRangeSelector: jest.fn(), - enableAutoRefreshSelector: jest.fn(), - }, - }, - }, +jest.mock('./use_date_picker_context'); + +const mockContextFactory = ( + isAutoRefreshSelectorEnabled: boolean = true, + isTimeRangeSelectorEnabled: boolean = true +) => ({ + data: { + query: { + timefilter: { + timefilter: { + disableTimeRangeSelector: jest.fn(), + disableAutoRefreshSelector: jest.fn(), + enableTimeRangeSelector: jest.fn(), + enableAutoRefreshSelector: jest.fn(), + isAutoRefreshSelectorEnabled: jest.fn(() => isAutoRefreshSelectorEnabled), + isTimeRangeSelectorEnabled: jest.fn(() => isTimeRangeSelectorEnabled), }, }, - }; + }, }, -})); +}); describe('useTimefilter', () => { test('will not trigger any date picker settings by default', () => { + (useDatePickerContext as jest.Mock).mockReturnValueOnce(mockContextFactory()); + const { result } = renderHook(() => useTimefilter()); const timefilter = result.current; @@ -41,6 +45,8 @@ describe('useTimefilter', () => { }); test('custom disabled overrides', () => { + (useDatePickerContext as jest.Mock).mockReturnValueOnce(mockContextFactory()); + const { result } = renderHook(() => useTimefilter({ timeRangeSelector: false, autoRefreshSelector: false }) ); @@ -53,6 +59,8 @@ describe('useTimefilter', () => { }); test('custom enabled overrides', () => { + (useDatePickerContext as jest.Mock).mockReturnValueOnce(mockContextFactory(false, false)); + const { result } = renderHook(() => useTimefilter({ timeRangeSelector: true, autoRefreshSelector: true }) ); diff --git a/x-pack/plugins/aiops/public/hooks/use_time_filter.ts b/x-pack/packages/ml/date_picker/src/hooks/use_timefilter.ts similarity index 64% rename from x-pack/plugins/aiops/public/hooks/use_time_filter.ts rename to x-pack/packages/ml/date_picker/src/hooks/use_timefilter.ts index c6026f9f38a55..9b610908d5dff 100644 --- a/x-pack/plugins/aiops/public/hooks/use_time_filter.ts +++ b/x-pack/packages/ml/date_picker/src/hooks/use_timefilter.ts @@ -9,24 +9,41 @@ import { useEffect, useMemo } from 'react'; import useObservable from 'react-use/lib/useObservable'; import { distinctUntilChanged, map } from 'rxjs/operators'; import { isEqual } from 'lodash'; -import { useAiopsAppContext } from './use_aiops_app_context'; +import type { TimeRange } from '@kbn/es-query'; +import type { TimefilterContract } from '@kbn/data-plugin/public'; + +import { useDatePickerContext } from './use_date_picker_context'; + +/** + * Options interface for the `useTimefilter` custom hook. + */ interface UseTimefilterOptions { + /** + * Boolean flag to enable/disable the time range selector + */ timeRangeSelector?: boolean; + /** + * Boolean flag to enable/disable the auto refresh selector + */ autoRefreshSelector?: boolean; } -export const useTimefilter = ({ - timeRangeSelector, - autoRefreshSelector, -}: UseTimefilterOptions = {}) => { +/** + * Custom hook to get the timefilter from runtime dependencies. + * + * @param {UseTimefilterOptions} options - time filter options + * @returns {TimefilterContract} timefilter + */ +export const useTimefilter = (options: UseTimefilterOptions = {}): TimefilterContract => { + const { timeRangeSelector, autoRefreshSelector } = options; const { data: { query: { timefilter: { timefilter }, }, }, - } = useAiopsAppContext(); + } = useDatePickerContext(); useEffect(() => { if (timeRangeSelector === true && !timefilter.isTimeRangeSelectorEnabled()) { @@ -45,6 +62,11 @@ export const useTimefilter = ({ return timefilter; }; +/** + * Custom hook to return refresh interval updates from the `refreshIntervalObservable$` observable. + * + * @returns refresh interval update + */ export const useRefreshIntervalUpdates = () => { const timefilter = useTimefilter(); @@ -56,7 +78,13 @@ export const useRefreshIntervalUpdates = () => { return useObservable(refreshIntervalObservable$, timefilter.getRefreshInterval()); }; -export const useTimeRangeUpdates = (absolute = false) => { +/** + * Custom hook to return time range updates from the `timeChangeObservable$` observable. + * + * @param absolute - flag to enforce absolute times + * @returns time range update + */ +export const useTimeRangeUpdates = (absolute = false): TimeRange => { const timefilter = useTimefilter(); const getTimeCallback = useMemo(() => { diff --git a/x-pack/packages/ml/date_picker/src/services/full_time_range_selector_service.ts b/x-pack/packages/ml/date_picker/src/services/full_time_range_selector_service.ts new file mode 100644 index 0000000000000..ab8d79292fd26 --- /dev/null +++ b/x-pack/packages/ml/date_picker/src/services/full_time_range_selector_service.ts @@ -0,0 +1,107 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import moment from 'moment'; +import type { TimefilterContract } from '@kbn/data-plugin/public'; +import dateMath from '@kbn/datemath'; +import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; +import { i18n } from '@kbn/i18n'; +import type { ToastsStart, HttpStart } from '@kbn/core/public'; +import type { DataView } from '@kbn/data-views-plugin/public'; +import { isPopulatedObject } from '@kbn/ml-is-populated-object'; +import { addExcludeFrozenToQuery } from '@kbn/ml-query-utils'; +import { getTimeFieldRange } from './time_field_range'; +import type { GetTimeFieldRangeResponse } from './types'; + +/** + * Determines the full available time range of the given Data View and updates + * the timefilter accordingly. + * + * @param timefilter - TimefilterContract + * @param dataView - DataView + * @param toasts - ToastsStart + * @param http - HttpStart + * @param query - optional query + * @param excludeFrozenData - optional boolean flag + * @returns {GetTimeFieldRangeResponse} + */ +export async function setFullTimeRange( + timefilter: TimefilterContract, + dataView: DataView, + toasts: ToastsStart, + http: HttpStart, + query?: QueryDslQueryContainer, + excludeFrozenData?: boolean +): Promise { + try { + const runtimeMappings = dataView.getRuntimeMappings(); + const resp = await getTimeFieldRange({ + index: dataView.getIndexPattern(), + timeFieldName: dataView.timeFieldName, + query: excludeFrozenData ? addExcludeFrozenToQuery(query) : query, + ...(isPopulatedObject(runtimeMappings) ? { runtimeMappings } : {}), + http, + }); + + if (resp.start.epoch && resp.end.epoch) { + timefilter.setTime({ + from: moment(resp.start.epoch).toISOString(), + to: moment(resp.end.epoch).toISOString(), + }); + } else { + toasts.addWarning({ + title: i18n.translate('xpack.ml.datePicker.fullTimeRangeSelector.noResults', { + defaultMessage: 'No results match your search criteria', + }), + }); + } + + return resp; + } catch (resp) { + toasts.addDanger( + i18n.translate( + 'xpack.ml.datePicker.fullTimeRangeSelector.errorSettingTimeRangeNotification', + { + defaultMessage: 'An error occurred setting the time range.', + } + ) + ); + return resp; + } +} + +/** + * Return type for the `getTimeFilterRange` function. + */ +export interface TimeRange { + /** + * From timestamp. + */ + from: number; + /** + * To timestamp. + */ + to: number; +} + +/** + * Function to get the time filter range as timestamps. + * + * @param timefilter - The timefilter + * @returns TimeRange + */ +export function getTimeFilterRange(timefilter: TimefilterContract): TimeRange { + const fromMoment = dateMath.parse(timefilter.getTime().from); + const toMoment = dateMath.parse(timefilter.getTime().to); + const from = fromMoment !== undefined ? fromMoment.valueOf() : 0; + const to = toMoment !== undefined ? toMoment.valueOf() : 0; + + return { + to, + from, + }; +} diff --git a/x-pack/plugins/aiops/public/application/services/time_field_range.ts b/x-pack/packages/ml/date_picker/src/services/time_field_range.ts similarity index 55% rename from x-pack/plugins/aiops/public/application/services/time_field_range.ts rename to x-pack/packages/ml/date_picker/src/services/time_field_range.ts index 845ec7f71f5f2..3cbf382ecc6c7 100644 --- a/x-pack/plugins/aiops/public/application/services/time_field_range.ts +++ b/x-pack/packages/ml/date_picker/src/services/time_field_range.ts @@ -5,38 +5,50 @@ * 2.0. */ -// TODO Consolidate with near duplicate service in -// `x-pack/plugins/data_visualizer/public/application/index_data_visualizer/services/time_field_range.ts` - import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; import type { HttpStart } from '@kbn/core/public'; -export interface GetTimeFieldRangeResponse { - success: boolean; - start: { epoch: number; string: string }; - end: { epoch: number; string: string }; -} +import type { GetTimeFieldRangeResponse } from './types'; -export async function getTimeFieldRange({ - index, - timeFieldName, - query, - runtimeMappings, - http, -}: { +/** + * Options definition for the `getTimeFieldRange` function. + */ +interface GetTimeFieldRangeOptions { + /** + * The index to be queried. + */ index: string; + /** + * Optional time field name. + */ timeFieldName?: string; + /** + * Optional DSL query. + */ query?: QueryDslQueryContainer; + /** + * Optional runtime mappings. + */ runtimeMappings?: estypes.MappingRuntimeFields; + /** + * HTTP client + */ http: HttpStart; -}) { - const body = JSON.stringify({ index, timeFieldName, query, runtimeMappings }); +} + +/** + * + * @param options - GetTimeFieldRangeOptions + * @returns GetTimeFieldRangeResponse + */ +export async function getTimeFieldRange(options: GetTimeFieldRangeOptions) { + const { http, ...body } = options; return await http.fetch({ path: `/internal/file_upload/time_field_range`, method: 'POST', - body, + body: JSON.stringify(body), }); } diff --git a/x-pack/plugins/aiops/public/application/services/timefilter_refresh_service.ts b/x-pack/packages/ml/date_picker/src/services/timefilter_refresh_service.ts similarity index 56% rename from x-pack/plugins/aiops/public/application/services/timefilter_refresh_service.ts rename to x-pack/packages/ml/date_picker/src/services/timefilter_refresh_service.ts index 8c98622a5e216..f985ab7e7be0e 100644 --- a/x-pack/plugins/aiops/public/application/services/timefilter_refresh_service.ts +++ b/x-pack/packages/ml/date_picker/src/services/timefilter_refresh_service.ts @@ -5,14 +5,23 @@ * 2.0. */ -// TODO Consolidate with near duplicate service in -// `x-pack/plugins/data_visualizer/public/application/index_data_visualizer/services/timefilter_refresh_service.ts` - import { Subject } from 'rxjs'; +/** + * State definition of `mlTimefilterRefresh$` observable. + */ export interface Refresh { + /** + * Timestamp of the last time a refresh got triggered. + */ lastRefresh: number; + /** + * The time range triggered by the refresh. + */ timeRange?: { start: string; end: string }; } -export const aiopsRefresh$ = new Subject(); +/** + * Observable to hold `Refresh` state. + */ +export const mlTimefilterRefresh$ = new Subject(); diff --git a/x-pack/packages/ml/date_picker/src/services/types.ts b/x-pack/packages/ml/date_picker/src/services/types.ts new file mode 100644 index 0000000000000..11b68946f1894 --- /dev/null +++ b/x-pack/packages/ml/date_picker/src/services/types.ts @@ -0,0 +1,38 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +/** + * Time definition for `GetTimeFieldRangeResponse` start/end attributes. + */ +interface GetTimeFieldRangeResponseTime { + /** + * Timestamp + */ + epoch: number; + /** + * String representation + */ + string: string; +} + +/** + * Response interface for the `setFullTimeRange` function. + */ +export interface GetTimeFieldRangeResponse { + /** + * Success boolean flag. + */ + success: boolean; + /** + * Start time of the time range. + */ + start: GetTimeFieldRangeResponseTime; + /** + * End time of the time range. + */ + end: GetTimeFieldRangeResponseTime; +} diff --git a/x-pack/packages/ml/date_picker/src/storage.ts b/x-pack/packages/ml/date_picker/src/storage.ts new file mode 100644 index 0000000000000..e0bab3872d5ea --- /dev/null +++ b/x-pack/packages/ml/date_picker/src/storage.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +/** + * Local storage options to include/exclude frozen tier. + */ +export const FROZEN_TIER_PREFERENCE = { + EXCLUDE: 'exclude-frozen', + INCLUDE: 'include-frozen', +} as const; + +/** + * Union type of `FROZEN_TIER_PREFERENCE` options. + */ +export type FrozenTierPreference = + typeof FROZEN_TIER_PREFERENCE[keyof typeof FROZEN_TIER_PREFERENCE]; diff --git a/x-pack/packages/ml/date_picker/tsconfig.json b/x-pack/packages/ml/date_picker/tsconfig.json new file mode 100644 index 0000000000000..ca83d94a598c1 --- /dev/null +++ b/x-pack/packages/ml/date_picker/tsconfig.json @@ -0,0 +1,31 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/es-query", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/ml-url-state", + "@kbn/data-plugin", + "@kbn/datemath", + "@kbn/core", + "@kbn/data-views-plugin", + "@kbn/ml-is-populated-object", + "@kbn/kibana-react-plugin", + "@kbn/ml-query-utils", + ] +} diff --git a/x-pack/packages/ml/is_defined/src/is_defined.ts b/x-pack/packages/ml/is_defined/src/is_defined.ts index 1cf980293277c..324f18a0cc5f9 100644 --- a/x-pack/packages/ml/is_defined/src/is_defined.ts +++ b/x-pack/packages/ml/is_defined/src/is_defined.ts @@ -8,7 +8,7 @@ /** * Checks whether the supplied argument is not `undefined` and not `null`. * - * @param argument + * @param argument - argument to check whether it is defined. * @returns boolean */ export function isDefined(argument: T | undefined | null): argument is T { diff --git a/x-pack/packages/ml/query_utils/README.md b/x-pack/packages/ml/query_utils/README.md new file mode 100644 index 0000000000000..69a1d5972b7dd --- /dev/null +++ b/x-pack/packages/ml/query_utils/README.md @@ -0,0 +1,3 @@ +# @kbn/ml-query-utils + +Query utilities. diff --git a/x-pack/plugins/aiops/public/components/full_time_range_selector/index.ts b/x-pack/packages/ml/query_utils/index.ts similarity index 76% rename from x-pack/plugins/aiops/public/components/full_time_range_selector/index.ts rename to x-pack/packages/ml/query_utils/index.ts index 842102e2395aa..f016fa6475c80 100644 --- a/x-pack/plugins/aiops/public/components/full_time_range_selector/index.ts +++ b/x-pack/packages/ml/query_utils/index.ts @@ -5,4 +5,4 @@ * 2.0. */ -export { FullTimeRangeSelector } from './full_time_range_selector'; +export { addExcludeFrozenToQuery } from './src/add_exclude_frozen_to_query'; diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/date_picker_wrapper/index.ts b/x-pack/packages/ml/query_utils/jest.config.js similarity index 66% rename from x-pack/plugins/data_visualizer/public/application/common/components/date_picker_wrapper/index.ts rename to x-pack/packages/ml/query_utils/jest.config.js index 232f6c65d2b64..d02c9d5ca6173 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/date_picker_wrapper/index.ts +++ b/x-pack/packages/ml/query_utils/jest.config.js @@ -5,4 +5,8 @@ * 2.0. */ -export { DatePickerWrapper } from './date_picker_wrapper'; +module.exports = { + preset: '@kbn/test', + rootDir: '../../../..', + roots: ['/x-pack/packages/ml/query_utils'], +}; diff --git a/x-pack/packages/ml/query_utils/kibana.jsonc b/x-pack/packages/ml/query_utils/kibana.jsonc new file mode 100644 index 0000000000000..a37eb31cb1da4 --- /dev/null +++ b/x-pack/packages/ml/query_utils/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/ml-query-utils", + "owner": "@elastic/ml-ui" +} diff --git a/x-pack/packages/ml/query_utils/package.json b/x-pack/packages/ml/query_utils/package.json new file mode 100644 index 0000000000000..a9ecd87080a77 --- /dev/null +++ b/x-pack/packages/ml/query_utils/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/ml-query-utils", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/x-pack/plugins/ml/common/util/query_utils.test.ts b/x-pack/packages/ml/query_utils/src/add_exclude_frozen_to_query.test.ts similarity index 95% rename from x-pack/plugins/ml/common/util/query_utils.test.ts rename to x-pack/packages/ml/query_utils/src/add_exclude_frozen_to_query.test.ts index 947b87e9976d5..4193b1486bdfe 100644 --- a/x-pack/plugins/ml/common/util/query_utils.test.ts +++ b/x-pack/packages/ml/query_utils/src/add_exclude_frozen_to_query.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { addExcludeFrozenToQuery } from './query_utils'; +import { addExcludeFrozenToQuery } from './add_exclude_frozen_to_query'; describe('Util: addExcludeFrozenToQuery()', () => { test('Validation checks.', () => { diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/query_utils.ts b/x-pack/packages/ml/query_utils/src/add_exclude_frozen_to_query.ts similarity index 81% rename from x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/query_utils.ts rename to x-pack/packages/ml/query_utils/src/add_exclude_frozen_to_query.ts index 5ceda44fa44b3..7162546034964 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/query_utils.ts +++ b/x-pack/packages/ml/query_utils/src/add_exclude_frozen_to_query.ts @@ -9,6 +9,12 @@ import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; import { cloneDeep } from 'lodash'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; +/** + * Extends an existing query with a clause to exclude the frozen tier. + * + * @param originalQuery - the original query + * @returns the original query exluding the frozen tier + */ export const addExcludeFrozenToQuery = (originalQuery: QueryDslQueryContainer | undefined) => { const FROZEN_TIER_TERM = { term: { @@ -31,11 +37,11 @@ export const addExcludeFrozenToQuery = (originalQuery: QueryDslQueryContainer | delete query.match_all; if (isPopulatedObject(query.bool)) { - // Must_not can be both arrays or singular object + // `must_not` can be both arrays or singular object if (Array.isArray(query.bool.must_not)) { query.bool.must_not.push(FROZEN_TIER_TERM); } else { - // If there's already a must_not condition + // If there's already a `must_not` condition if (isPopulatedObject(query.bool.must_not)) { query.bool.must_not = [query.bool.must_not, FROZEN_TIER_TERM]; } diff --git a/x-pack/packages/ml/query_utils/tsconfig.json b/x-pack/packages/ml/query_utils/tsconfig.json new file mode 100644 index 0000000000000..1db807def57b8 --- /dev/null +++ b/x-pack/packages/ml/query_utils/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/ml-is-populated-object", + ] +} diff --git a/x-pack/plugins/aiops/public/application/utils/query_utils.ts b/x-pack/plugins/aiops/public/application/utils/query_utils.ts index 94f5bc4d9f70b..c39aa62b377c0 100644 --- a/x-pack/plugins/aiops/public/application/utils/query_utils.ts +++ b/x-pack/plugins/aiops/public/application/utils/query_utils.ts @@ -8,13 +8,9 @@ // TODO Consolidate with duplicate query utils in // `x-pack/plugins/data_visualizer/common/utils/query_utils.ts` -import { cloneDeep } from 'lodash'; - -import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { Query } from '@kbn/es-query'; -import { isPopulatedObject } from '@kbn/ml-is-populated-object'; +import type { Query } from '@kbn/es-query'; import type { ChangePoint, FieldValuePair } from '@kbn/ml-agg-utils'; import type { GroupTableItem } from '../../components/spike_analysis_table/types'; @@ -93,46 +89,3 @@ export function buildBaseFilterCriteria( return filterCriteria; } - -export const addExcludeFrozenToQuery = (originalQuery: QueryDslQueryContainer | undefined) => { - const FROZEN_TIER_TERM = { - term: { - _tier: { - value: 'data_frozen', - }, - }, - }; - - if (!originalQuery) { - return { - bool: { - must_not: [FROZEN_TIER_TERM], - }, - }; - } - - const query = cloneDeep(originalQuery); - - delete query.match_all; - - if (isPopulatedObject(query.bool)) { - // Must_not can be both arrays or singular object - if (Array.isArray(query.bool.must_not)) { - query.bool.must_not.push(FROZEN_TIER_TERM); - } else { - // If there's already a must_not condition - if (isPopulatedObject(query.bool.must_not)) { - query.bool.must_not = [query.bool.must_not, FROZEN_TIER_TERM]; - } - if (query.bool.must_not === undefined) { - query.bool.must_not = [FROZEN_TIER_TERM]; - } - } - } else { - query.bool = { - must_not: [FROZEN_TIER_TERM], - }; - } - - return query; -}; diff --git a/x-pack/plugins/aiops/public/components/change_point_detection/change_point_detection_context.tsx b/x-pack/plugins/aiops/public/components/change_point_detection/change_point_detection_context.tsx index 8d67a28c3055f..7aaf4dbc6dc53 100644 --- a/x-pack/plugins/aiops/public/components/change_point_detection/change_point_detection_context.tsx +++ b/x-pack/plugins/aiops/public/components/change_point_detection/change_point_detection_context.tsx @@ -18,12 +18,12 @@ import { type DataViewField } from '@kbn/data-views-plugin/public'; import { startWith } from 'rxjs'; import type { Query, Filter } from '@kbn/es-query'; import { usePageUrlState } from '@kbn/ml-url-state'; +import { useTimefilter, useTimeRangeUpdates } from '@kbn/ml-date-picker'; import { createMergedEsQuery, getEsQueryFromSavedSearch, } from '../../application/utils/search_utils'; import { useAiopsAppContext } from '../../hooks/use_aiops_app_context'; -import { useTimefilter, useTimeRangeUpdates } from '../../hooks/use_time_filter'; import { useChangePointResults } from './use_change_point_agg_request'; import { type TimeBuckets, TimeBucketsInterval } from '../../../common/time_buckets'; import { useDataSource } from '../../hooks/use_data_source'; diff --git a/x-pack/plugins/aiops/public/components/change_point_detection/change_point_detetion_root.tsx b/x-pack/plugins/aiops/public/components/change_point_detection/change_point_detetion_root.tsx index f7a039c082dee..fb9dbc5156ed4 100644 --- a/x-pack/plugins/aiops/public/components/change_point_detection/change_point_detetion_root.tsx +++ b/x-pack/plugins/aiops/public/components/change_point_detection/change_point_detetion_root.tsx @@ -6,12 +6,18 @@ */ import React, { FC } from 'react'; +import { pick } from 'lodash'; + +import { EuiSpacer } from '@elastic/eui'; import { DataView } from '@kbn/data-views-plugin/common'; import { SavedSearch } from '@kbn/saved-search-plugin/public'; import { StorageContextProvider } from '@kbn/ml-local-storage'; import { UrlStateProvider } from '@kbn/ml-url-state'; import { Storage } from '@kbn/kibana-utils-plugin/public'; +import { DatePickerContextProvider } from '@kbn/ml-date-picker'; +import { UI_SETTINGS } from '@kbn/data-plugin/common'; +import { toMountPoint, wrapWithTheme } from '@kbn/kibana-react-plugin/public'; import { DataSourceContext } from '../../hooks/use_data_source'; import { SavedSearchSavedObject } from '../../application/utils/search_utils'; @@ -36,15 +42,25 @@ export const ChangePointDetectionAppState: FC savedSearch, appDependencies, }) => { + const datePickerDeps = { + ...pick(appDependencies, ['data', 'http', 'notifications', 'theme', 'uiSettings']), + toMountPoint, + wrapWithTheme, + uiSettingsKeys: UI_SETTINGS, + }; + return ( - - - - + + + + + + + diff --git a/x-pack/plugins/aiops/public/components/change_point_detection/chart_component.tsx b/x-pack/plugins/aiops/public/components/change_point_detection/chart_component.tsx index becfbd813fd4c..e1402496800ca 100644 --- a/x-pack/plugins/aiops/public/components/change_point_detection/chart_component.tsx +++ b/x-pack/plugins/aiops/public/components/change_point_detection/chart_component.tsx @@ -6,12 +6,15 @@ */ import React, { FC, useMemo } from 'react'; + import { type TypedLensByValueInput } from '@kbn/lens-plugin/public'; import { FilterStateStore } from '@kbn/es-query'; -import { useChangePointDetectionContext } from './change_point_detection_context'; +import { useTimeRangeUpdates } from '@kbn/ml-date-picker'; + import { useDataSource } from '../../hooks/use_data_source'; import { useAiopsAppContext } from '../../hooks/use_aiops_app_context'; -import { useTimeRangeUpdates } from '../../hooks/use_time_filter'; + +import { useChangePointDetectionContext } from './change_point_detection_context'; import { fnOperationTypeMapping } from './constants'; export interface ChartComponentProps { diff --git a/x-pack/plugins/aiops/public/components/date_picker_wrapper/date_picker_wrapper.tsx b/x-pack/plugins/aiops/public/components/date_picker_wrapper/date_picker_wrapper.tsx deleted file mode 100644 index 74ca9148309bc..0000000000000 --- a/x-pack/plugins/aiops/public/components/date_picker_wrapper/date_picker_wrapper.tsx +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -// TODO Consolidate with duplicate component `DatePickerWrapper` in -// `x-pack/plugins/data_visualizer/public/application/common/components/date_picker_wrapper/date_picker_wrapper.tsx` -// `x-pack/plugins/ml/public/application/components/navigation_menu/date_picker_wrapper/date_picker_wrapper.tsx` -import React, { FC, useCallback, useEffect, useMemo, useState } from 'react'; -import { Subscription } from 'rxjs'; -import { debounce } from 'lodash'; - -import { - EuiButton, - EuiFlexGroup, - EuiFlexItem, - EuiSuperDatePicker, - OnRefreshProps, - OnTimeChangeProps, -} from '@elastic/eui'; - -import type { TimeRange } from '@kbn/es-query'; -import { TimeHistoryContract, UI_SETTINGS } from '@kbn/data-plugin/public'; - -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { toMountPoint, wrapWithTheme } from '@kbn/kibana-react-plugin/public'; -import { useUrlState } from '@kbn/ml-url-state'; -import { useRefreshIntervalUpdates, useTimeRangeUpdates } from '../../hooks/use_time_filter'; -import { useAiopsAppContext } from '../../hooks/use_aiops_app_context'; -import { aiopsRefresh$ } from '../../application/services/timefilter_refresh_service'; - -const DEFAULT_REFRESH_INTERVAL_MS = 5000; - -interface TimePickerQuickRange { - from: string; - to: string; - display: string; -} - -interface Duration { - start: string; - end: string; -} - -interface RefreshInterval { - pause: boolean; - value: number; -} - -function getRecentlyUsedRangesFactory(timeHistory: TimeHistoryContract) { - return function (): Duration[] { - return ( - timeHistory.get()?.map(({ from, to }: TimeRange) => { - return { - start: from, - end: to, - }; - }) ?? [] - ); - }; -} - -function updateLastRefresh(timeRange?: OnRefreshProps) { - aiopsRefresh$.next({ lastRefresh: Date.now(), timeRange }); -} - -export const DatePickerWrapper: FC = () => { - const services = useAiopsAppContext(); - const { toasts } = services.notifications; - const config = services.uiSettings; - - const { timefilter, history } = services.data.query.timefilter; - const theme$ = services.theme.theme$; - - const [globalState, setGlobalState] = useUrlState('_g'); - const getRecentlyUsedRanges = getRecentlyUsedRangesFactory(history); - - const timeFilterRefreshInterval = useRefreshIntervalUpdates(); - const time = useTimeRangeUpdates(); - - useEffect( - function syncTimRangeFromUrlState() { - if (globalState?.time !== undefined) { - timefilter.setTime({ - from: globalState.time.from, - to: globalState.time.to, - }); - } - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [globalState?.time?.from, globalState?.time?.to, globalState?.time?.ts] - ); - - useEffect( - function syncRefreshIntervalFromUrlState() { - if (globalState?.refreshInterval !== undefined) { - timefilter.setRefreshInterval({ - pause: !!globalState?.refreshInterval?.pause, - value: globalState?.refreshInterval?.value, - }); - } - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [globalState?.refreshInterval] - ); - - // eslint-disable-next-line react-hooks/exhaustive-deps - const setRefreshInterval = useCallback( - debounce((refreshIntervalUpdate: RefreshInterval) => { - setGlobalState('refreshInterval', refreshIntervalUpdate, true); - }, 200), - [setGlobalState] - ); - - const [recentlyUsedRanges, setRecentlyUsedRanges] = useState(getRecentlyUsedRanges()); - const [isAutoRefreshSelectorEnabled, setIsAutoRefreshSelectorEnabled] = useState( - timefilter.isAutoRefreshSelectorEnabled() - ); - const [isTimeRangeSelectorEnabled, setIsTimeRangeSelectorEnabled] = useState( - timefilter.isTimeRangeSelectorEnabled() - ); - - const refreshInterval = useMemo( - (): RefreshInterval => globalState?.refreshInterval ?? timeFilterRefreshInterval, - // eslint-disable-next-line react-hooks/exhaustive-deps - [JSON.stringify(globalState?.refreshInterval), timeFilterRefreshInterval] - ); - - useEffect( - function warnAboutShortRefreshInterval() { - const isResolvedFromUrlState = !!globalState?.refreshInterval; - const isTooShort = refreshInterval.value < DEFAULT_REFRESH_INTERVAL_MS; - - // Only warn about short interval with enabled auto-refresh. - if (!isTooShort || refreshInterval.pause) return; - - toasts.addWarning( - { - title: isResolvedFromUrlState - ? i18n.translate('xpack.aiops.datePicker.shortRefreshIntervalURLWarningMessage', { - defaultMessage: - 'The refresh interval in the URL is shorter than the minimum supported by Machine Learning.', - }) - : i18n.translate( - 'xpack.aiops.datePicker.shortRefreshIntervalTimeFilterWarningMessage', - { - defaultMessage: - 'The refresh interval in Advanced Settings is shorter than the minimum supported by Machine Learning.', - } - ), - text: toMountPoint( - wrapWithTheme( - - - , - theme$ - ) - ), - }, - { toastLifeTimeMs: 30000 } - ); - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [ - // eslint-disable-next-line react-hooks/exhaustive-deps - JSON.stringify(refreshInterval), - // eslint-disable-next-line react-hooks/exhaustive-deps - JSON.stringify(globalState?.refreshInterval), - setRefreshInterval, - ] - ); - - const dateFormat = config.get('dateFormat'); - const timePickerQuickRanges = config.get( - UI_SETTINGS.TIMEPICKER_QUICK_RANGES - ); - - const commonlyUsedRanges = useMemo( - () => - timePickerQuickRanges.map(({ from, to, display }) => ({ - start: from, - end: to, - label: display, - })), - [timePickerQuickRanges] - ); - - useEffect(() => { - const subscriptions = new Subscription(); - - const enabledUpdated$ = timefilter.getEnabledUpdated$(); - if (enabledUpdated$ !== undefined) { - subscriptions.add( - enabledUpdated$.subscribe((w) => { - setIsAutoRefreshSelectorEnabled(timefilter.isAutoRefreshSelectorEnabled()); - setIsTimeRangeSelectorEnabled(timefilter.isTimeRangeSelectorEnabled()); - }) - ); - } - - return function cleanup() { - subscriptions.unsubscribe(); - }; - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - const updateTimeFilter = useCallback( - ({ start, end }: OnTimeChangeProps) => { - setRecentlyUsedRanges(getRecentlyUsedRanges()); - setGlobalState('time', { - from: start, - to: end, - ...(start === 'now' || end === 'now' ? { ts: Date.now() } : {}), - }); - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [setGlobalState] - ); - - function updateInterval({ - isPaused: pause, - refreshInterval: value, - }: { - isPaused: boolean; - refreshInterval: number; - }) { - setRefreshInterval({ pause, value }); - } - - return isAutoRefreshSelectorEnabled || isTimeRangeSelectorEnabled ? ( - - - - - - {isTimeRangeSelectorEnabled ? null : ( - - updateLastRefresh()} - data-test-subj="aiOpsRefreshPageButton" - > - - - - )} - - ) : null; -}; diff --git a/x-pack/plugins/aiops/public/components/date_picker_wrapper/index.ts b/x-pack/plugins/aiops/public/components/date_picker_wrapper/index.ts deleted file mode 100644 index 232f6c65d2b64..0000000000000 --- a/x-pack/plugins/aiops/public/components/date_picker_wrapper/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { DatePickerWrapper } from './date_picker_wrapper'; diff --git a/x-pack/plugins/aiops/public/components/explain_log_rate_spikes/explain_log_rate_spikes_app_state.tsx b/x-pack/plugins/aiops/public/components/explain_log_rate_spikes/explain_log_rate_spikes_app_state.tsx index 6b6b477807d41..ae67c55d87f05 100644 --- a/x-pack/plugins/aiops/public/components/explain_log_rate_spikes/explain_log_rate_spikes_app_state.tsx +++ b/x-pack/plugins/aiops/public/components/explain_log_rate_spikes/explain_log_rate_spikes_app_state.tsx @@ -6,6 +6,7 @@ */ import React, { FC } from 'react'; +import { pick } from 'lodash'; import { EuiCallOut } from '@elastic/eui'; @@ -16,6 +17,9 @@ import type { DataView } from '@kbn/data-views-plugin/public'; import { StorageContextProvider } from '@kbn/ml-local-storage'; import { UrlStateProvider } from '@kbn/ml-url-state'; import { Storage } from '@kbn/kibana-utils-plugin/public'; +import { DatePickerContextProvider } from '@kbn/ml-date-picker'; +import { UI_SETTINGS } from '@kbn/data-plugin/common'; +import { toMountPoint, wrapWithTheme } from '@kbn/kibana-react-plugin/public'; import { SEARCH_QUERY_LANGUAGE, @@ -24,6 +28,7 @@ import { } from '../../application/utils/search_utils'; import type { AiopsAppDependencies } from '../../hooks/use_aiops_app_context'; import { AiopsAppContext } from '../../hooks/use_aiops_app_context'; +import { DataSourceContext } from '../../hooks/use_data_source'; import { AIOPS_STORAGE_KEYS } from '../../types/storage'; import { SpikeAnalysisTableRowStateProvider } from '../spike_analysis_table/spike_analysis_table_row_provider'; @@ -95,14 +100,25 @@ export const ExplainLogRateSpikesAppState: FC ); } + const datePickerDeps = { + ...pick(appDependencies, ['data', 'http', 'notifications', 'theme', 'uiSettings']), + toMountPoint, + wrapWithTheme, + uiSettingsKeys: UI_SETTINGS, + }; + return ( - - - - - + + + + + + + + + ); diff --git a/x-pack/plugins/aiops/public/components/explain_log_rate_spikes/explain_log_rate_spikes_page.tsx b/x-pack/plugins/aiops/public/components/explain_log_rate_spikes/explain_log_rate_spikes_page.tsx index 4819f3efd4fae..88fedd74409bb 100644 --- a/x-pack/plugins/aiops/public/components/explain_log_rate_spikes/explain_log_rate_spikes_page.tsx +++ b/x-pack/plugins/aiops/public/components/explain_log_rate_spikes/explain_log_rate_spikes_page.tsx @@ -6,6 +6,7 @@ */ import React, { useCallback, useEffect, useState, FC } from 'react'; + import { EuiEmptyPrompt, EuiFlexGroup, @@ -13,34 +14,29 @@ import { EuiHorizontalRule, EuiPageBody, EuiPageContentBody_Deprecated as EuiPageContentBody, - EuiPageContentHeader_Deprecated as EuiPageContentHeader, - EuiPageContentHeaderSection_Deprecated as EuiPageContentHeaderSection, EuiPanel, - EuiTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import type { DataView } from '@kbn/data-views-plugin/public'; import type { WindowParameters } from '@kbn/aiops-utils'; import type { ChangePoint } from '@kbn/ml-agg-utils'; import { Filter, FilterStateStore, Query } from '@kbn/es-query'; import { FormattedMessage } from '@kbn/i18n-react'; -import { SavedSearch } from '@kbn/discover-plugin/public'; - import { useUrlState, usePageUrlState } from '@kbn/ml-url-state'; -import { useCss } from '../../hooks/use_css'; + +import { useDataSource } from '../../hooks/use_data_source'; import { useAiopsAppContext } from '../../hooks/use_aiops_app_context'; -import { SearchQueryLanguage, SavedSearchSavedObject } from '../../application/utils/search_utils'; +import { SearchQueryLanguage } from '../../application/utils/search_utils'; import { useData } from '../../hooks/use_data'; -import { FullTimeRangeSelector } from '../full_time_range_selector'; + import { DocumentCountContent } from '../document_count_content/document_count_content'; -import { DatePickerWrapper } from '../date_picker_wrapper'; import { SearchPanel } from '../search_panel'; +import type { GroupTableItem } from '../spike_analysis_table/types'; +import { useSpikeAnalysisTableRowContext } from '../spike_analysis_table/spike_analysis_table_row_provider'; +import { PageHeader } from '../page_header'; import { restorableDefaults, type AiOpsPageUrlState } from './explain_log_rate_spikes_app_state'; import { ExplainLogRateSpikesAnalysis } from './explain_log_rate_spikes_analysis'; -import type { GroupTableItem } from '../spike_analysis_table/types'; -import { useSpikeAnalysisTableRowContext } from '../spike_analysis_table/spike_analysis_table_row_provider'; function getDocumentCountStatsSplitLabel(changePoint?: ChangePoint, group?: GroupTableItem) { if (changePoint) { @@ -52,22 +48,9 @@ function getDocumentCountStatsSplitLabel(changePoint?: ChangePoint, group?: Grou } } -/** - * ExplainLogRateSpikes props require a data view. - */ -interface ExplainLogRateSpikesPageProps { - /** The data view to analyze. */ - dataView: DataView; - /** The saved search to analyze. */ - savedSearch: SavedSearch | SavedSearchSavedObject | null; -} - -export const ExplainLogRateSpikesPage: FC = ({ - dataView, - savedSearch, -}) => { - const { aiopsPageHeader, dataViewTitleHeader } = useCss(); +export const ExplainLogRateSpikesPage: FC = () => { const { data: dataService } = useAiopsAppContext(); + const { dataView, savedSearch } = useDataSource(); const { currentSelectedChangePoint, @@ -186,40 +169,7 @@ export const ExplainLogRateSpikesPage: FC = ({ return ( - - - - -
- -

{dataView.getName()}

-
-
-
- - - {dataView.timeFieldName !== undefined && ( - - - - )} - - - - -
-
-
+ diff --git a/x-pack/plugins/aiops/public/components/full_time_range_selector/full_time_range_selector_service.ts b/x-pack/plugins/aiops/public/components/full_time_range_selector/full_time_range_selector_service.ts deleted file mode 100644 index a363692f29c70..0000000000000 --- a/x-pack/plugins/aiops/public/components/full_time_range_selector/full_time_range_selector_service.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -// TODO Consolidate with duplicate service in -// `x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts` - -import moment from 'moment'; -import { TimefilterContract } from '@kbn/data-plugin/public'; -import dateMath from '@kbn/datemath'; -import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; -import { i18n } from '@kbn/i18n'; -import type { ToastsStart, HttpStart } from '@kbn/core/public'; -import { DataView } from '@kbn/data-views-plugin/public'; -import { isPopulatedObject } from '@kbn/ml-is-populated-object'; -import { getTimeFieldRange } from '../../application/services/time_field_range'; -import { addExcludeFrozenToQuery } from '../../application/utils/query_utils'; - -export interface GetTimeFieldRangeResponse { - success: boolean; - start: { epoch: number; string: string }; - end: { epoch: number; string: string }; -} - -export interface TimeRange { - from: number; - to: number; -} - -export async function setFullTimeRange( - timefilter: TimefilterContract, - dataView: DataView, - toasts: ToastsStart, - http: HttpStart, - query?: QueryDslQueryContainer, - excludeFrozenData?: boolean -): Promise { - const runtimeMappings = dataView.getRuntimeMappings(); - const resp = await getTimeFieldRange({ - index: dataView.getIndexPattern(), - timeFieldName: dataView.timeFieldName, - query: excludeFrozenData ? addExcludeFrozenToQuery(query) : query, - ...(isPopulatedObject(runtimeMappings) ? { runtimeMappings } : {}), - http, - }); - - if (resp.start.epoch && resp.end.epoch) { - timefilter.setTime({ - from: moment(resp.start.epoch).toISOString(), - to: moment(resp.end.epoch).toISOString(), - }); - } else { - toasts.addWarning({ - title: i18n.translate('xpack.aiops.index.fullTimeRangeSelector.noResults', { - defaultMessage: 'No results match your search criteria', - }), - }); - } - return resp; -} - -export function getTimeFilterRange(timefilter: TimefilterContract): TimeRange { - const fromMoment = dateMath.parse(timefilter.getTime().from); - const toMoment = dateMath.parse(timefilter.getTime().to); - const from = fromMoment !== undefined ? fromMoment.valueOf() : 0; - const to = toMoment !== undefined ? toMoment.valueOf() : 0; - - return { - to, - from, - }; -} diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_app_state.tsx b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_app_state.tsx index ee571d990c832..235aa1a518403 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_app_state.tsx +++ b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_app_state.tsx @@ -5,12 +5,18 @@ * 2.0. */ import React, { FC } from 'react'; +import { pick } from 'lodash'; + import type { SavedSearch } from '@kbn/discover-plugin/public'; import type { DataView } from '@kbn/data-views-plugin/public'; import { StorageContextProvider } from '@kbn/ml-local-storage'; import { UrlStateProvider } from '@kbn/ml-url-state'; import { Storage } from '@kbn/kibana-utils-plugin/public'; +import { DatePickerContextProvider } from '@kbn/ml-date-picker'; +import { UI_SETTINGS } from '@kbn/data-plugin/common'; +import { toMountPoint, wrapWithTheme } from '@kbn/kibana-react-plugin/public'; +import { DataSourceContext } from '../../hooks/use_data_source'; import { SavedSearchSavedObject } from '../../application/utils/search_utils'; import type { AiopsAppDependencies } from '../../hooks/use_aiops_app_context'; import { AIOPS_STORAGE_KEYS } from '../../types/storage'; @@ -31,12 +37,23 @@ export const LogCategorizationAppState: FC = ({ savedSearch, appDependencies, }) => { + const datePickerDeps = { + ...pick(appDependencies, ['data', 'http', 'notifications', 'theme', 'uiSettings']), + toMountPoint, + wrapWithTheme, + uiSettingsKeys: UI_SETTINGS, + }; + return ( - - - + + + + + + + ); diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_page.tsx b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_page.tsx index b4f57e6482ac9..ab66a75754e63 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_page.tsx +++ b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_page.tsx @@ -5,59 +5,46 @@ * 2.0. */ import React, { FC, useState, useEffect, useCallback, useMemo } from 'react'; -import type { SavedSearch } from '@kbn/discover-plugin/public'; -import type { DataView } from '@kbn/data-views-plugin/public'; -import { Filter, Query } from '@kbn/es-query'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; + import { EuiButton, EuiSpacer, EuiFlexGroup, EuiFlexItem, EuiPageBody, - EuiPageContentHeader_Deprecated as EuiPageContentHeader, - EuiPageContentHeaderSection_Deprecated as EuiPageContentHeaderSection, - EuiTitle, EuiComboBox, EuiComboBoxOptionOption, EuiFormRow, EuiLoadingContent, } from '@elastic/eui'; +import { Filter, Query } from '@kbn/es-query'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useUrlState } from '@kbn/ml-url-state'; -import { FullTimeRangeSelector } from '../full_time_range_selector'; -import { DatePickerWrapper } from '../date_picker_wrapper'; -import { useCss } from '../../hooks/use_css'; + +import { useDataSource } from '../../hooks/use_data_source'; import { useData } from '../../hooks/use_data'; -import { SearchPanel } from '../search_panel'; -import type { - SearchQueryLanguage, - SavedSearchSavedObject, -} from '../../application/utils/search_utils'; +import type { SearchQueryLanguage } from '../../application/utils/search_utils'; import { useAiopsAppContext } from '../../hooks/use_aiops_app_context'; + import { restorableDefaults } from '../explain_log_rate_spikes/explain_log_rate_spikes_app_state'; -import { useCategorizeRequest } from './use_categorize_request'; +import { SearchPanel } from '../search_panel'; +import { PageHeader } from '../page_header'; + import type { EventRate, Category, SparkLinesPerCategory } from './use_categorize_request'; +import { useCategorizeRequest } from './use_categorize_request'; import { CategoryTable } from './category_table'; import { DocumentCountChart } from './document_count_chart'; import { InformationText } from './information_text'; -export interface LogCategorizationPageProps { - dataView: DataView; - savedSearch: SavedSearch | SavedSearchSavedObject | null; -} - const BAR_TARGET = 20; -export const LogCategorizationPage: FC = ({ - dataView, - savedSearch, -}) => { - const { aiopsPageHeader, dataViewTitleHeader } = useCss(); +export const LogCategorizationPage: FC = () => { const { notifications: { toasts }, } = useAiopsAppContext(); + const { dataView, savedSearch } = useDataSource(); const { runCategorizeRequest, cancelRequest } = useCategorizeRequest(); const [aiopsListState, setAiopsListState] = useState(restorableDefaults); @@ -219,41 +206,8 @@ export const LogCategorizationPage: FC = ({ }; return ( - - - - - -
- -

{dataView.getName()}

-
-
-
- - - {dataView.timeFieldName !== undefined && ( - - - - )} - - - - -
-
-
+ + diff --git a/x-pack/plugins/aiops/public/components/page_header/page_header.tsx b/x-pack/plugins/aiops/public/components/page_header/page_header.tsx index 2278652dc4861..1eee60cfea8fc 100644 --- a/x-pack/plugins/aiops/public/components/page_header/page_header.tsx +++ b/x-pack/plugins/aiops/public/components/page_header/page_header.tsx @@ -5,8 +5,10 @@ * 2.0. */ -import React, { FC, useCallback } from 'react'; +import React, { FC, useCallback, useMemo } from 'react'; + import { + useIsWithinMaxBreakpoint, EuiFlexGroup, EuiFlexItem, EuiSpacer, @@ -14,19 +16,40 @@ import { EuiPageContentHeader_Deprecated as EuiPageContentHeader, EuiPageContentHeaderSection_Deprecated as EuiPageContentHeaderSection, } from '@elastic/eui'; + import { useUrlState } from '@kbn/ml-url-state'; -import { FullTimeRangeSelectorProps } from '../full_time_range_selector/full_time_range_selector'; +import { useStorage } from '@kbn/ml-local-storage'; +import { + useTimefilter, + DatePickerWrapper, + FullTimeRangeSelector, + type FullTimeRangeSelectorProps, + FROZEN_TIER_PREFERENCE, +} from '@kbn/ml-date-picker'; + import { useCss } from '../../hooks/use_css'; import { useDataSource } from '../../hooks/use_data_source'; -import { useTimefilter } from '../../hooks/use_time_filter'; -import { FullTimeRangeSelector } from '../full_time_range_selector'; -import { DatePickerWrapper } from '../date_picker_wrapper'; +import { + AIOPS_FROZEN_TIER_PREFERENCE, + type AiOpsKey, + type AiOpsStorageMapped, +} from '../../types/storage'; export const PageHeader: FC = () => { const { aiopsPageHeader, dataViewTitleHeader } = useCss(); + const [, setGlobalState] = useUrlState('_g'); const { dataView } = useDataSource(); + const [frozenDataPreference, setFrozenDataPreference] = useStorage< + AiOpsKey, + AiOpsStorageMapped + >( + AIOPS_FROZEN_TIER_PREFERENCE, + // By default we will exclude frozen data tier + FROZEN_TIER_PREFERENCE.EXCLUDE + ); + const timefilter = useTimefilter({ timeRangeSelector: dataView.timeFieldName !== undefined, autoRefreshSelector: true, @@ -39,44 +62,54 @@ export const PageHeader: FC = () => { [setGlobalState] ); + const hasValidTimeField = useMemo( + () => dataView.timeFieldName !== undefined && dataView.timeFieldName !== '', + [dataView.timeFieldName] + ); + + const isWithinLBreakpoint = useIsWithinMaxBreakpoint('l'); + return ( - <> - - - - -
- -

{dataView.getName()}

-
-
-
+ + + + +
+ +

{dataView.getName()}

+
+
+
- - {dataView.timeFieldName !== undefined && ( - - - - )} + {isWithinLBreakpoint ? : null} + + {hasValidTimeField ? ( - + - -
-
-
- - + ) : null} + + + +
+ +
+
); }; diff --git a/x-pack/plugins/aiops/public/hooks/use_aiops_app_context.ts b/x-pack/plugins/aiops/public/hooks/use_aiops_app_context.ts index 84a0e7283c7c1..92ea33c18e2d3 100644 --- a/x-pack/plugins/aiops/public/hooks/use_aiops_app_context.ts +++ b/x-pack/plugins/aiops/public/hooks/use_aiops_app_context.ts @@ -14,8 +14,13 @@ import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/ import type { ChartsPluginStart } from '@kbn/charts-plugin/public'; import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; import type { SharePluginStart } from '@kbn/share-plugin/public'; -import type { CoreStart, CoreSetup, HttpStart, IUiSettingsClient } from '@kbn/core/public'; -import type { ThemeServiceStart } from '@kbn/core/public'; +import type { + CoreStart, + CoreSetup, + HttpStart, + IUiSettingsClient, + ThemeServiceStart, +} from '@kbn/core/public'; import type { LensPublicStart } from '@kbn/lens-plugin/public'; export interface AiopsAppDependencies { diff --git a/x-pack/plugins/aiops/public/hooks/use_data.ts b/x-pack/plugins/aiops/public/hooks/use_data.ts index 37e2454f9fb70..29c544309d987 100644 --- a/x-pack/plugins/aiops/public/hooks/use_data.ts +++ b/x-pack/plugins/aiops/public/hooks/use_data.ts @@ -10,24 +10,22 @@ import { merge } from 'rxjs'; import type { DataView } from '@kbn/data-views-plugin/public'; import type { ChangePoint } from '@kbn/ml-agg-utils'; - import type { SavedSearch } from '@kbn/discover-plugin/public'; - import type { Dictionary } from '@kbn/ml-url-state'; -import { useTimeBuckets } from './use_time_buckets'; +import { mlTimefilterRefresh$, useTimefilter } from '@kbn/ml-date-picker'; -import { useAiopsAppContext } from './use_aiops_app_context'; -import { aiopsRefresh$ } from '../application/services/timefilter_refresh_service'; import type { DocumentStatsSearchStrategyParams } from '../get_document_stats'; import type { AiOpsIndexBasedAppState } from '../components/explain_log_rate_spikes/explain_log_rate_spikes_app_state'; import { getEsQueryFromSavedSearch, SavedSearchSavedObject, } from '../application/utils/search_utils'; +import type { GroupTableItem } from '../components/spike_analysis_table/types'; + +import { useTimeBuckets } from './use_time_buckets'; +import { useAiopsAppContext } from './use_aiops_app_context'; -import { useTimefilter } from './use_time_filter'; import { useDocumentCountStats } from './use_document_count_stats'; -import type { GroupTableItem } from '../components/spike_analysis_table/types'; const DEFAULT_BAR_TARGET = 75; @@ -153,7 +151,7 @@ export const useData = ( const timeUpdateSubscription = merge( timefilter.getAutoRefreshFetch$(), timefilter.getTimeUpdate$(), - aiopsRefresh$ + mlTimefilterRefresh$ ).subscribe(() => { if (onUpdate) { onUpdate({ diff --git a/x-pack/plugins/aiops/public/hooks/use_data_source.ts b/x-pack/plugins/aiops/public/hooks/use_data_source.ts index 2e887830f7042..e67aad07a338c 100644 --- a/x-pack/plugins/aiops/public/hooks/use_data_source.ts +++ b/x-pack/plugins/aiops/public/hooks/use_data_source.ts @@ -15,7 +15,7 @@ export const DataSourceContext = createContext<{ savedSearch: SavedSearch | SavedSearchSavedObject | null; }>({ get dataView(): never { - throw new Error('Context is not implemented'); + throw new Error('DataSourceContext is not implemented'); }, savedSearch: null, }); diff --git a/x-pack/plugins/aiops/public/types/storage.ts b/x-pack/plugins/aiops/public/types/storage.ts index 96eb612d9ca7a..bd10b2d25b0cd 100644 --- a/x-pack/plugins/aiops/public/types/storage.ts +++ b/x-pack/plugins/aiops/public/types/storage.ts @@ -5,15 +5,9 @@ * 2.0. */ -export const AIOPS_FROZEN_TIER_PREFERENCE = 'aiops.frozenDataTierPreference'; - -export const FROZEN_TIER_PREFERENCE = { - EXCLUDE: 'exclude-frozen', - INCLUDE: 'include-frozen', -} as const; +import { type FrozenTierPreference } from '@kbn/ml-date-picker'; -export type FrozenTierPreference = - typeof FROZEN_TIER_PREFERENCE[keyof typeof FROZEN_TIER_PREFERENCE]; +export const AIOPS_FROZEN_TIER_PREFERENCE = 'aiops.frozenDataTierPreference'; export type AiOps = Partial<{ [AIOPS_FROZEN_TIER_PREFERENCE]: FrozenTierPreference; diff --git a/x-pack/plugins/aiops/tsconfig.json b/x-pack/plugins/aiops/tsconfig.json index 9eef408f5a513..6e130d66384d6 100644 --- a/x-pack/plugins/aiops/tsconfig.json +++ b/x-pack/plugins/aiops/tsconfig.json @@ -44,6 +44,8 @@ "@kbn/es-types", "@kbn/ml-url-state", "@kbn/ml-local-storage", + "@kbn/ml-date-picker", + "@kbn/ml-local-storage", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/date_picker_wrapper/date_picker_wrapper.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/date_picker_wrapper/date_picker_wrapper.tsx deleted file mode 100644 index dee9fa17e0bd9..0000000000000 --- a/x-pack/plugins/data_visualizer/public/application/common/components/date_picker_wrapper/date_picker_wrapper.tsx +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -// TODO Consolidate with duplicate component `DatePickerWrapper` in -// `x-pack/plugins/aiops/public/components/date_picker_wrapper/date_picker_wrapper.tsx` - -import React, { FC, useCallback, useEffect, useMemo, useState } from 'react'; -import { Subscription } from 'rxjs'; -import { debounce } from 'lodash'; - -import { - EuiButton, - EuiFlexGroup, - EuiFlexItem, - EuiSuperDatePicker, - OnRefreshProps, - OnTimeChangeProps, -} from '@elastic/eui'; - -import type { TimeRange } from '@kbn/es-query'; -import { TimeHistoryContract, UI_SETTINGS } from '@kbn/data-plugin/public'; -import { i18n } from '@kbn/i18n'; -import { useUrlState } from '@kbn/ml-url-state'; -import { wrapWithTheme } from '@kbn/kibana-react-plugin/public'; -import { FormattedMessage } from '@kbn/i18n-react'; - -import { - useRefreshIntervalUpdates, - useTimeRangeUpdates, -} from '../../../index_data_visualizer/hooks/use_time_filter'; -import { useDataVisualizerKibana } from '../../../kibana_context'; -import { dataVisualizerRefresh$ } from '../../../index_data_visualizer/services/timefilter_refresh_service'; - -const DEFAULT_REFRESH_INTERVAL_MS = 5000; -const DATE_PICKER_MAX_WIDTH = 540; - -interface TimePickerQuickRange { - from: string; - to: string; - display: string; -} - -interface Duration { - start: string; - end: string; -} - -interface RefreshInterval { - pause: boolean; - value: number; -} - -function getRecentlyUsedRangesFactory(timeHistory: TimeHistoryContract) { - return function (): Duration[] { - return ( - timeHistory.get()?.map(({ from, to }: TimeRange) => { - return { - start: from, - end: to, - }; - }) ?? [] - ); - }; -} - -function updateLastRefresh(timeRange?: OnRefreshProps) { - dataVisualizerRefresh$.next({ lastRefresh: Date.now(), timeRange }); -} - -// FIXME: Consolidate this component with ML and AIOps's component -export const DatePickerWrapper: FC<{ - isAutoRefreshOnly?: boolean; - showRefresh?: boolean; - compact?: boolean; -}> = ({ isAutoRefreshOnly, showRefresh, compact = false }) => { - const { - services, - notifications: { toasts }, - } = useDataVisualizerKibana(); - const config = services.uiSettings; - const theme$ = services.theme.theme$; - - const { timefilter, history } = services.data.query.timefilter; - - const [globalState, setGlobalState] = useUrlState('_g'); - const getRecentlyUsedRanges = getRecentlyUsedRangesFactory(history); - - const timeFilterRefreshInterval = useRefreshIntervalUpdates(); - const time = useTimeRangeUpdates(); - - useEffect( - function syncTimRangeFromUrlState() { - if (globalState?.time !== undefined) { - timefilter.setTime({ - from: globalState.time.from, - to: globalState.time.to, - }); - } - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [globalState?.time?.from, globalState?.time?.to, globalState?.time?.ts] - ); - - useEffect( - function syncRefreshIntervalFromUrlState() { - if (globalState?.refreshInterval !== undefined) { - timefilter.setRefreshInterval({ - pause: !!globalState?.refreshInterval?.pause, - value: globalState?.refreshInterval?.value, - }); - } - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [globalState?.refreshInterval] - ); - - // eslint-disable-next-line react-hooks/exhaustive-deps - const setRefreshInterval = useCallback( - debounce((refreshIntervalUpdate: RefreshInterval) => { - setGlobalState('refreshInterval', refreshIntervalUpdate, true); - }, 200), - [setGlobalState] - ); - - const [recentlyUsedRanges, setRecentlyUsedRanges] = useState(getRecentlyUsedRanges()); - const [isAutoRefreshSelectorEnabled, setIsAutoRefreshSelectorEnabled] = useState( - timefilter.isAutoRefreshSelectorEnabled() - ); - const [isTimeRangeSelectorEnabled, setIsTimeRangeSelectorEnabled] = useState( - timefilter.isTimeRangeSelectorEnabled() - ); - - const refreshInterval = useMemo( - (): RefreshInterval => globalState?.refreshInterval ?? timeFilterRefreshInterval, - // eslint-disable-next-line react-hooks/exhaustive-deps - [JSON.stringify(globalState?.refreshInterval), timeFilterRefreshInterval] - ); - - useEffect( - function warnAboutShortRefreshInterval() { - const isTooShort = refreshInterval.value < DEFAULT_REFRESH_INTERVAL_MS; - - // Only warn about short interval with enabled auto-refresh. - if (!isTooShort || refreshInterval.pause) return; - - toasts.warning({ - title: i18n.translate( - 'xpack.dataVisualizer.index.datePicker.shortRefreshIntervalURLWarningMessage', - { - defaultMessage: - 'The refresh interval in the URL is shorter than the minimum supported by Machine Learning.', - } - ), - body: wrapWithTheme( - - - , - theme$ - ), - toastLifeTimeMs: 30000, - }); - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [ - // eslint-disable-next-line react-hooks/exhaustive-deps - JSON.stringify(refreshInterval), - // eslint-disable-next-line react-hooks/exhaustive-deps - JSON.stringify(globalState?.refreshInterval), - setRefreshInterval, - ] - ); - - const dateFormat = config.get('dateFormat'); - const timePickerQuickRanges = config.get( - UI_SETTINGS.TIMEPICKER_QUICK_RANGES - ); - - const commonlyUsedRanges = useMemo( - () => - timePickerQuickRanges.map(({ from, to, display }) => ({ - start: from, - end: to, - label: display, - })), - [timePickerQuickRanges] - ); - - useEffect(() => { - const subscriptions = new Subscription(); - - const enabledUpdated$ = timefilter.getEnabledUpdated$(); - if (enabledUpdated$ !== undefined) { - subscriptions.add( - enabledUpdated$.subscribe((w) => { - setIsAutoRefreshSelectorEnabled(timefilter.isAutoRefreshSelectorEnabled()); - setIsTimeRangeSelectorEnabled(timefilter.isTimeRangeSelectorEnabled()); - }) - ); - } - - return function cleanup() { - subscriptions.unsubscribe(); - }; - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - const updateTimeFilter = useCallback( - ({ start, end }: OnTimeChangeProps) => { - setRecentlyUsedRanges(getRecentlyUsedRanges()); - setGlobalState('time', { - from: start, - to: end, - ...(start === 'now' || end === 'now' ? { ts: Date.now() } : {}), - }); - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [setGlobalState] - ); - - function updateInterval({ - isPaused: pause, - refreshInterval: value, - }: { - isPaused: boolean; - refreshInterval: number; - }) { - setRefreshInterval({ pause, value }); - } - - return isAutoRefreshSelectorEnabled || isTimeRangeSelectorEnabled ? ( - - - - - - {showRefresh === true || !isTimeRangeSelectorEnabled ? ( - - updateLastRefresh()} - data-test-subj="dataVisualizerRefreshPageButton" - > - - - - ) : null} - - ) : null; -}; diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts b/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts index 314856e07554f..09a3e1b8ffb45 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts +++ b/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts @@ -10,14 +10,11 @@ import { Action } from '@elastic/eui/src/components/basic_table/action_types'; import { MutableRefObject } from 'react'; import { DataView } from '@kbn/data-views-plugin/public'; import { VISUALIZE_GEO_FIELD_TRIGGER } from '@kbn/ui-actions-plugin/public'; +import { mlTimefilterRefresh$, Refresh } from '@kbn/ml-date-picker'; import { getCompatibleLensDataType, getLensAttributes } from './lens_utils'; import { CombinedQuery } from '../../../../index_data_visualizer/types/combined_query'; import { FieldVisConfig } from '../../stats_table/types'; import { DataVisualizerKibanaReactContextValue } from '../../../../kibana_context'; -import { - dataVisualizerRefresh$, - Refresh, -} from '../../../../index_data_visualizer/services/timefilter_refresh_service'; import { SUPPORTED_FIELD_TYPES } from '../../../../../../common/constants'; import { APP_ID } from '../../../../../../common/constants'; @@ -36,7 +33,7 @@ export function getActions( const refresh: Refresh = { lastRefresh: Date.now(), }; - dataVisualizerRefresh$.next(refresh); + mlTimefilterRefresh$.next(refresh); }; // Navigate to Lens with prefilled chart for data field if (services.application?.capabilities?.visualize?.show === true && lensPlugin !== undefined) { diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx index a8f454816e2b6..58d730cff80e8 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx @@ -11,7 +11,7 @@ import React, { FC, useState, useEffect } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; -import { EuiSpacer, EuiTitle } from '@elastic/eui'; +import { useEuiBreakpoint, EuiSpacer, EuiTitle } from '@elastic/eui'; import { DataView } from '@kbn/data-views-plugin/public'; import { useUrlState } from '@kbn/ml-url-state'; import { isDefined } from '@kbn/ml-is-defined'; @@ -26,7 +26,6 @@ interface Props { searchString?: string | { [key: string]: any }; searchQueryLanguage?: string; getAdditionalLinks?: GetAdditionalLinks; - compact?: boolean; } const ACTIONS_PANEL_WIDTH = '240px'; @@ -36,7 +35,6 @@ export const ActionsPanel: FC = ({ searchString, searchQueryLanguage, getAdditionalLinks, - compact, }) => { const [globalState] = useUrlState('_g'); @@ -121,19 +119,17 @@ export const ActionsPanel: FC = ({ const showActionsPanel = discoverLink || (Array.isArray(asyncHrefCards) && asyncHrefCards.length > 0); + const dvActionsPanel = css({ + [useEuiBreakpoint(['xs', 's', 'm', 'l', 'xl'])]: { + width: ACTIONS_PANEL_WIDTH, + }, + }); + // Note we use display:none for the DataRecognizer section as it needs to be // passed the recognizerResults object, and then run the recognizer check which // controls whether the recognizer section is ultimately displayed. return showActionsPanel ? ( -
+

void; -} - -// Component for rendering a button which automatically sets the range of the time filter -// to the time range of data in the index(es) mapped to the supplied Kibana data view or query. -export const FullTimeRangeSelector: FC = ({ - timefilter, - dataView, - query, - disabled, - callback, -}) => { - const { - services: { - notifications: { toasts }, - }, - } = useDataVisualizerKibana(); - - // wrapper around setFullTimeRange to allow for the calling of the optional callBack prop - const setRange = useCallback( - async (i: DataView, q?: QueryDslQueryContainer, excludeFrozenData?: boolean) => { - try { - const fullTimeRange = await setFullTimeRange(timefilter, i, q, excludeFrozenData, toasts); - if (typeof callback === 'function') { - callback(fullTimeRange); - } - } catch (e) { - toasts.addDanger( - i18n.translate( - 'xpack.dataVisualizer.index.fullTimeRangeSelector.errorSettingTimeRangeNotification', - { - defaultMessage: 'An error occurred setting the time range.', - } - ) - ); - } - }, - [callback, timefilter, toasts] - ); - - const [isPopoverOpen, setPopover] = useState(false); - - const [frozenDataPreference, setFrozenDataPreference] = useStorage< - DVKey, - DVStorageMapped - >( - DV_FROZEN_TIER_PREFERENCE, - // By default we will exclude frozen data tier - FROZEN_TIER_PREFERENCE.EXCLUDE - ); - - const setPreference = useCallback( - (id: string) => { - setFrozenDataPreference(id as FrozenTierPreference); - setRange(dataView, query, id === FROZEN_TIER_PREFERENCE.EXCLUDE); - closePopover(); - }, - [dataView, query, setFrozenDataPreference, setRange] - ); - - const onButtonClick = () => { - setPopover(!isPopoverOpen); - }; - - const closePopover = () => { - setPopover(false); - }; - - const sortOptions: EuiRadioGroupOption[] = useMemo(() => { - return [ - { - id: FROZEN_TIER_PREFERENCE.EXCLUDE, - label: i18n.translate( - 'xpack.dataVisualizer.index.fullTimeRangeSelector.useFullDataExcludingFrozenMenuLabel', - { - defaultMessage: 'Exclude frozen data tier', - } - ), - }, - { - id: FROZEN_TIER_PREFERENCE.INCLUDE, - label: i18n.translate( - 'xpack.dataVisualizer.index.fullTimeRangeSelector.useFullDataIncludingFrozenMenuLabel', - { - defaultMessage: 'Include frozen data tier', - } - ), - }, - ]; - }, []); - - const popoverContent = useMemo( - () => ( - - - - ), - [sortOptions, frozenDataPreference, setPreference] - ); - - const buttonTooltip = useMemo( - () => - frozenDataPreference === FROZEN_TIER_PREFERENCE.EXCLUDE ? ( - - ) : ( - - ), - [frozenDataPreference] - ); - - return ( - - - setRange(dataView, query, true)} - data-test-subj="dataVisualizerButtonUseFullData" - > - - - - - - } - isOpen={isPopoverOpen} - closePopover={closePopover} - panelPaddingSize="none" - anchorPosition="downRight" - > - {popoverContent} - - - - ); -}; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts deleted file mode 100644 index 1740f4166db80..0000000000000 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import moment from 'moment'; -import { TimefilterContract } from '@kbn/data-plugin/public'; -import dateMath from '@kbn/datemath'; -import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; -import { i18n } from '@kbn/i18n'; -import type { ToastsStart } from '@kbn/core/public'; -import { DataView } from '@kbn/data-views-plugin/public'; -import { isPopulatedObject } from '@kbn/ml-is-populated-object'; -import { getTimeFieldRange } from '../../services/time_field_range'; -import type { GetTimeFieldRangeResponse } from '../../../../../common/types/time_field_request'; -import { addExcludeFrozenToQuery } from '../../utils/query_utils'; - -export interface TimeRange { - from: number; - to: number; -} - -export async function setFullTimeRange( - timefilter: TimefilterContract, - dataView: DataView, - query?: QueryDslQueryContainer, - excludeFrozenData?: boolean, - toasts?: ToastsStart -): Promise { - const runtimeMappings = dataView.getRuntimeMappings(); - const resp = await getTimeFieldRange({ - index: dataView.getIndexPattern(), - timeFieldName: dataView.timeFieldName, - query: excludeFrozenData ? addExcludeFrozenToQuery(query) : query, - ...(isPopulatedObject(runtimeMappings) ? { runtimeMappings } : {}), - }); - - if (resp.start.epoch && resp.end.epoch) { - timefilter.setTime({ - from: moment(resp.start.epoch).toISOString(), - to: moment(resp.end.epoch).toISOString(), - }); - } else { - toasts?.addWarning({ - title: i18n.translate('xpack.dataVisualizer.index.fullTimeRangeSelector.noResults', { - defaultMessage: 'No results match your search criteria', - }), - }); - } - return resp; -} - -export function getTimeFilterRange(timefilter: TimefilterContract): TimeRange { - const fromMoment = dateMath.parse(timefilter.getTime().from); - const toMoment = dateMath.parse(timefilter.getTime().to); - const from = fromMoment !== undefined ? fromMoment.valueOf() : 0; - const to = toMoment !== undefined ? toMoment.valueOf() : 0; - - return { - to, - from, - }; -} diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/index.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/index.tsx deleted file mode 100644 index 14ad77e2adc3a..0000000000000 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/index.tsx +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { FullTimeRangeSelector } from './full_time_range_selector'; -export type { TimeRange } from './full_time_range_selector_service'; -export { getTimeFilterRange } from './full_time_range_selector_service'; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx index 9ec8b90d84f02..2bdc8b68806bc 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx @@ -5,10 +5,13 @@ * 2.0. */ +import { css } from '@emotion/react'; import React, { FC, useEffect, useMemo, useState, useCallback, useRef } from 'react'; import type { Required } from 'utility-types'; import { + useEuiBreakpoint, + useIsWithinMaxBreakpoint, EuiFlexGroup, EuiFlexItem, EuiPageBody, @@ -26,15 +29,20 @@ import { Filter, FilterStateStore, Query } from '@kbn/es-query'; import { generateFilters } from '@kbn/data-plugin/public'; import { DataView, DataViewField } from '@kbn/data-views-plugin/public'; import { usePageUrlState, useUrlState } from '@kbn/ml-url-state'; - +import { + DatePickerWrapper, + FullTimeRangeSelector, + FROZEN_TIER_PREFERENCE, +} from '@kbn/ml-date-picker'; import { useStorage } from '@kbn/ml-local-storage'; + import { useCurrentEuiTheme } from '../../../common/hooks/use_current_eui_theme'; import { + DV_FROZEN_TIER_PREFERENCE, DV_RANDOM_SAMPLER_PREFERENCE, type DVKey, type DVStorageMapped, } from '../../types/storage'; -import { FullTimeRangeSelector } from '../full_time_range_selector'; import { DataVisualizerTable, ItemIdToExpandedRowMap, @@ -57,7 +65,6 @@ import { OMIT_FIELDS } from '../../../../../common/constants'; import { kbnTypeToJobType } from '../../../common/util/field_types_utils'; import { SearchPanel } from '../search_panel'; import { ActionsPanel } from '../actions_panel'; -import { DatePickerWrapper } from '../../../common/components/date_picker_wrapper'; import { createMergedEsQuery } from '../../utils/saved_search_utils'; import { DataVisualizerDataViewManagement } from '../data_view_management'; import { GetAdditionalLinks } from '../../../common/components/results_links'; @@ -125,7 +132,6 @@ export interface IndexDataVisualizerViewProps { currentSavedSearch: SavedSearchSavedObject | null; currentSessionId?: string; getAdditionalLinks?: GetAdditionalLinks; - compact?: boolean; } export const IndexDataVisualizerView: FC = (dataVisualizerProps) => { @@ -136,6 +142,15 @@ export const IndexDataVisualizerView: FC = (dataVi DVStorageMapped >(DV_RANDOM_SAMPLER_PREFERENCE, RANDOM_SAMPLER_OPTION.ON_AUTOMATIC); + const [frozenDataPreference, setFrozenDataPreference] = useStorage< + DVKey, + DVStorageMapped + >( + DV_FROZEN_TIER_PREFERENCE, + // By default we will exclude frozen data tier + FROZEN_TIER_PREFERENCE.EXCLUDE + ); + const restorableDefaults = useMemo( () => getDefaultDataVisualizerListState({ @@ -161,7 +176,7 @@ export const IndexDataVisualizerView: FC = (dataVi dataVisualizerProps.currentSavedSearch ); - const { currentDataView, currentSessionId, getAdditionalLinks, compact } = dataVisualizerProps; + const { currentDataView, currentSessionId, getAdditionalLinks } = dataVisualizerProps; useEffect(() => { if (dataVisualizerProps?.currentSavedSearch !== undefined) { @@ -458,14 +473,21 @@ export const IndexDataVisualizerView: FC = (dataVi () => currentDataView.timeFieldName !== undefined && currentDataView.timeFieldName !== '', [currentDataView.timeFieldName] ); + + const dvPageHeader = css({ + [useEuiBreakpoint(['xs', 's', 'm', 'l', 'xl'])]: { + flexDirection: 'column', + alignItems: 'flex-start', + }, + }); + + const isWithinXl = useIsWithinMaxBreakpoint('xl'); + return ( - + = (dataVi - {compact ? : null} + {isWithinXl ? : null} = (dataVi {hasValidTimeField ? ( = (dataVi @@ -513,7 +536,7 @@ export const IndexDataVisualizerView: FC = (dataVi - + = (dataVi setVisibleFieldNames={setVisibleFieldNames} showEmptyFields={showEmptyFields} onAddFilter={onAddFilter} - compact={compact} /> {overallStats?.totalCount !== undefined && ( @@ -576,14 +598,13 @@ export const IndexDataVisualizerView: FC = (dataVi /> - {compact ? : null} + {isWithinXl ? : null} diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx index ee4a002071b3f..ac93003d1817e 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx @@ -7,7 +7,13 @@ import React, { FC, useEffect, useState } from 'react'; import { css } from '@emotion/react'; -import { useEuiBreakpoint, EuiFlexItem, EuiFlexGroup, EuiSpacer } from '@elastic/eui'; +import { + useEuiBreakpoint, + useIsWithinMaxBreakpoint, + EuiFlexItem, + EuiFlexGroup, + EuiSpacer, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { Query, Filter } from '@kbn/es-query'; import type { TimeRange } from '@kbn/es-query'; @@ -45,7 +51,6 @@ interface Props { }): void; showEmptyFields: boolean; onAddFilter?: (field: DataViewField | string, value: string, type: '+' | '-') => void; - compact?: boolean; } export const SearchPanel: FC = ({ @@ -60,7 +65,6 @@ export const SearchPanel: FC = ({ visibleFieldNames, setSearchParams, showEmptyFields, - compact, }) => { const { services: { @@ -139,6 +143,8 @@ export const SearchPanel: FC = ({ }, }); + const isWithinXl = useIsWithinMaxBreakpoint('xl'); + return ( = ({ /> - {compact ? : null} + {isWithinXl ? : null} - - }> - this.updateOutput(output)} - /> - + + + }> + this.updateOutput(output)} + /> + + , diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts index 90ef0a616d7ff..858df7c6366b7 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts @@ -15,13 +15,12 @@ import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '@kbn/field-types'; import seedrandom from 'seedrandom'; import type { SamplingOption } from '@kbn/discover-plugin/public/application/main/components/field_stats_table/field_stats_table'; import type { Dictionary } from '@kbn/ml-url-state'; +import { mlTimefilterRefresh$, useTimefilter } from '@kbn/ml-date-picker'; import type { RandomSamplerOption } from '../constants/random_sampler'; import type { DataVisualizerIndexBasedAppState } from '../types/index_data_visualizer_state'; import { useDataVisualizerKibana } from '../../kibana_context'; import { getEsQueryFromSavedSearch } from '../utils/saved_search_utils'; import type { MetricFieldsStats } from '../../common/components/stats_table/components/field_count_stats'; -import { useTimefilter } from './use_time_filter'; -import { dataVisualizerRefresh$ } from '../services/timefilter_refresh_service'; import { TimeBuckets } from '../../../../common/services/time_buckets'; import type { FieldVisConfig } from '../../common/components/stats_table/types'; import { @@ -313,7 +312,7 @@ export const useDataVisualizerGridData = ( const timeUpdateSubscription = merge( timefilter.getTimeUpdate$(), timefilter.getAutoRefreshFetch$(), - dataVisualizerRefresh$ + mlTimefilterRefresh$ ).subscribe(() => { if (onUpdate) { onUpdate({ diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_time_filter.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_time_filter.ts deleted file mode 100644 index 727c8bab88dc3..0000000000000 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_time_filter.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { useEffect } from 'react'; -import useObservable from 'react-use/lib/useObservable'; -import { map } from 'rxjs/operators'; -import { useDataVisualizerKibana } from '../../kibana_context'; - -interface UseTimefilterOptions { - timeRangeSelector?: boolean; - autoRefreshSelector?: boolean; -} - -export const useTimefilter = ({ - timeRangeSelector, - autoRefreshSelector, -}: UseTimefilterOptions = {}) => { - const { services } = useDataVisualizerKibana(); - const { timefilter } = services.data.query.timefilter; - - useEffect(() => { - if (timeRangeSelector === true) { - timefilter.enableTimeRangeSelector(); - } else if (timeRangeSelector === false) { - timefilter.disableTimeRangeSelector(); - } - - if (autoRefreshSelector === true) { - timefilter.enableAutoRefreshSelector(); - } else if (autoRefreshSelector === false) { - timefilter.disableAutoRefreshSelector(); - } - }, [timeRangeSelector, autoRefreshSelector, timefilter]); - - return timefilter; -}; - -export const useRefreshIntervalUpdates = () => { - const timefilter = useTimefilter(); - - return useObservable( - timefilter.getRefreshIntervalUpdate$().pipe(map(timefilter.getRefreshInterval)), - timefilter.getRefreshInterval() - ); -}; - -export const useTimeRangeUpdates = (absolute = false) => { - const timefilter = useTimefilter(); - - const getTimeCallback = absolute - ? timefilter.getAbsoluteTime.bind(timefilter) - : timefilter.getTime.bind(timefilter); - - return useObservable(timefilter.getTimeUpdate$().pipe(map(getTimeCallback)), getTimeCallback()); -}; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx index 156898449ee79..f7c70625f0e65 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx @@ -5,19 +5,26 @@ * 2.0. */ import '../_index.scss'; -import React, { FC, useCallback, useEffect, useMemo, useState } from 'react'; +import { pick } from 'lodash'; +import React, { FC, useCallback, useEffect, useState } from 'react'; import { useHistory, useLocation } from 'react-router-dom'; import { parse, stringify } from 'query-string'; -import { isEqual, throttle } from 'lodash'; -import { EuiResizeObserver } from '@elastic/eui'; +import { isEqual } from 'lodash'; import { encode } from '@kbn/rison'; import { SimpleSavedObject } from '@kbn/core/public'; import { i18n } from '@kbn/i18n'; import { Storage } from '@kbn/kibana-utils-plugin/public'; -import { KibanaContextProvider, KibanaThemeProvider } from '@kbn/kibana-react-plugin/public'; +import { + KibanaContextProvider, + KibanaThemeProvider, + toMountPoint, + wrapWithTheme, +} from '@kbn/kibana-react-plugin/public'; import { StorageContextProvider } from '@kbn/ml-local-storage'; import { DataView } from '@kbn/data-views-plugin/public'; import { getNestedProperty } from '@kbn/ml-nested-property'; +import { DatePickerContextProvider } from '@kbn/ml-date-picker'; +import { UI_SETTINGS } from '@kbn/data-plugin/common'; import { Provider as UrlStateContextProvider, parseUrlState, @@ -38,6 +45,8 @@ import { DATA_VISUALIZER_INDEX_VIEWER } from './constants/index_data_visualizer_ import { INDEX_DATA_VISUALIZER_NAME } from '../common/constants'; import { DV_STORAGE_KEYS } from './types/storage'; +const XXL_BREAKPOINT = 1400; + const localStorage = new Storage(window.localStorage); export interface DataVisualizerStateContextProviderProps { @@ -247,36 +256,15 @@ export const DataVisualizerStateContextProvider: FC { - // When window or table is resized, - // update the page body width - setPanelWidth(e.width); - }, 500), - [] - ); - const compact = useMemo(() => panelWidth <= 1024, [panelWidth]); - return ( {currentDataView ? ( - // Needs ResizeObserver to measure window width - side bar navigation - - {(resizeRef) => ( -
- -
- )} -
+ ) : (
)} @@ -317,15 +305,30 @@ export const IndexDataVisualizer: FC<{ unifiedSearch, ...coreStart, }; + const datePickerDeps = { + ...pick(services, ['data', 'http', 'notifications', 'theme', 'uiSettings']), + toMountPoint, + wrapWithTheme, + uiSettingsKeys: UI_SETTINGS, + }; return ( - + - + + + diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/services/timefilter_refresh_service.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/services/timefilter_refresh_service.ts deleted file mode 100644 index 11f286e781219..0000000000000 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/services/timefilter_refresh_service.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { Subject } from 'rxjs'; - -export interface Refresh { - lastRefresh: number; - timeRange?: { start: string; end: string }; -} - -export const dataVisualizerRefresh$ = new Subject(); diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/types/storage.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/types/storage.ts index f2718bc8e803f..cbafcfd63c633 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/types/storage.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/types/storage.ts @@ -5,20 +5,14 @@ * 2.0. */ +import { type FrozenTierPreference } from '@kbn/ml-date-picker'; + import { RandomSamplerOption } from '../constants/random_sampler'; export const DV_FROZEN_TIER_PREFERENCE = 'dataVisualizer.frozenDataTierPreference'; export const DV_RANDOM_SAMPLER_PREFERENCE = 'dataVisualizer.randomSamplerPreference'; export const DV_RANDOM_SAMPLER_P_VALUE = 'dataVisualizer.randomSamplerPValue'; -export const FROZEN_TIER_PREFERENCE = { - EXCLUDE: 'exclude-frozen', - INCLUDE: 'include-frozen', -} as const; - -export type FrozenTierPreference = - typeof FROZEN_TIER_PREFERENCE[keyof typeof FROZEN_TIER_PREFERENCE]; - export type DV = Partial<{ [DV_FROZEN_TIER_PREFERENCE]: FrozenTierPreference; [DV_RANDOM_SAMPLER_PREFERENCE]: RandomSamplerOption; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/query_utils.test.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/query_utils.test.ts deleted file mode 100644 index 947b87e9976d5..0000000000000 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/query_utils.test.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { addExcludeFrozenToQuery } from './query_utils'; - -describe('Util: addExcludeFrozenToQuery()', () => { - test('Validation checks.', () => { - expect( - addExcludeFrozenToQuery({ - match_all: {}, - bool: { - must: [ - { - match_all: {}, - }, - ], - }, - }) - ).toMatchObject({ - bool: { - must: [{ match_all: {} }], - must_not: [{ term: { _tier: { value: 'data_frozen' } } }], - }, - }); - - expect( - addExcludeFrozenToQuery({ - bool: { - must: [], - must_not: { - term: { - category: { - value: 'clothing', - }, - }, - }, - }, - }) - ).toMatchObject({ - bool: { - must: [], - must_not: [ - { term: { category: { value: 'clothing' } } }, - { term: { _tier: { value: 'data_frozen' } } }, - ], - }, - }); - - expect( - addExcludeFrozenToQuery({ - bool: { - must: [], - must_not: [{ term: { category: { value: 'clothing' } } }], - }, - }) - ).toMatchObject({ - bool: { - must: [], - must_not: [ - { term: { category: { value: 'clothing' } } }, - { term: { _tier: { value: 'data_frozen' } } }, - ], - }, - }); - - expect(addExcludeFrozenToQuery(undefined)).toMatchObject({ - bool: { - must_not: [{ term: { _tier: { value: 'data_frozen' } } }], - }, - }); - }); -}); diff --git a/x-pack/plugins/data_visualizer/tsconfig.json b/x-pack/plugins/data_visualizer/tsconfig.json index 3098da0f61bc2..4730c35cd3658 100644 --- a/x-pack/plugins/data_visualizer/tsconfig.json +++ b/x-pack/plugins/data_visualizer/tsconfig.json @@ -53,6 +53,7 @@ "@kbn/ml-nested-property", "@kbn/ml-url-state", "@kbn/ml-local-storage", + "@kbn/ml-date-picker", "@kbn/ml-is-defined", ], "exclude": [ diff --git a/x-pack/plugins/ml/common/types/storage.ts b/x-pack/plugins/ml/common/types/storage.ts index 7e2e1ba799961..ddc32cf7d24db 100644 --- a/x-pack/plugins/ml/common/types/storage.ts +++ b/x-pack/plugins/ml/common/types/storage.ts @@ -5,6 +5,8 @@ * 2.0. */ +import { type FrozenTierPreference } from '@kbn/ml-date-picker'; + import { EntityFieldType } from './anomalies'; export const ML_ENTITY_FIELDS_CONFIG = 'ml.singleMetricViewer.partitionFields' as const; @@ -14,14 +16,6 @@ export const ML_FROZEN_TIER_PREFERENCE = 'ml.frozenDataTierPreference'; export const ML_ANOMALY_EXPLORER_PANELS = 'ml.anomalyExplorerPanels'; export const ML_NOTIFICATIONS_LAST_CHECKED_AT = 'ml.notificationsLastCheckedAt'; -export const FROZEN_TIER_PREFERENCE = { - EXCLUDE: 'exclude-frozen', - INCLUDE: 'include-frozen', -} as const; - -export type FrozenTierPreference = - typeof FROZEN_TIER_PREFERENCE[keyof typeof FROZEN_TIER_PREFERENCE]; - export type PartitionFieldConfig = | { /** diff --git a/x-pack/plugins/ml/common/util/query_utils.ts b/x-pack/plugins/ml/common/util/query_utils.ts deleted file mode 100644 index 5ceda44fa44b3..0000000000000 --- a/x-pack/plugins/ml/common/util/query_utils.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; -import { cloneDeep } from 'lodash'; -import { isPopulatedObject } from '@kbn/ml-is-populated-object'; - -export const addExcludeFrozenToQuery = (originalQuery: QueryDslQueryContainer | undefined) => { - const FROZEN_TIER_TERM = { - term: { - _tier: { - value: 'data_frozen', - }, - }, - }; - - if (!originalQuery) { - return { - bool: { - must_not: [FROZEN_TIER_TERM], - }, - }; - } - - const query = cloneDeep(originalQuery); - - delete query.match_all; - - if (isPopulatedObject(query.bool)) { - // Must_not can be both arrays or singular object - if (Array.isArray(query.bool.must_not)) { - query.bool.must_not.push(FROZEN_TIER_TERM); - } else { - // If there's already a must_not condition - if (isPopulatedObject(query.bool.must_not)) { - query.bool.must_not = [query.bool.must_not, FROZEN_TIER_TERM]; - } - if (query.bool.must_not === undefined) { - query.bool.must_not = [FROZEN_TIER_TERM]; - } - } - } else { - query.bool = { - must_not: [FROZEN_TIER_TERM], - }; - } - - return query; -}; diff --git a/x-pack/plugins/ml/public/application/app.tsx b/x-pack/plugins/ml/public/application/app.tsx index 463cb34691144..d10eb2c8e63ec 100644 --- a/x-pack/plugins/ml/public/application/app.tsx +++ b/x-pack/plugins/ml/public/application/app.tsx @@ -8,24 +8,28 @@ import React, { FC } from 'react'; import './_index.scss'; import ReactDOM from 'react-dom'; +import { pick } from 'lodash'; import { AppMountParameters, CoreStart, HttpStart } from '@kbn/core/public'; import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; +import { DatePickerContextProvider } from '@kbn/ml-date-picker'; import { Storage } from '@kbn/kibana-utils-plugin/public'; - +import { UI_SETTINGS } from '@kbn/data-plugin/common'; +import { toMountPoint, wrapWithTheme } from '@kbn/kibana-react-plugin/public'; import { KibanaContextProvider, KibanaThemeProvider } from '@kbn/kibana-react-plugin/public'; import { StorageContextProvider } from '@kbn/ml-local-storage'; + import { ML_STORAGE_KEYS } from '../../common/types/storage'; +import { ML_APP_LOCATOR, ML_PAGES } from '../../common/constants/locator'; +import type { MlSetupDependencies, MlStartDependencies } from '../plugin'; + import { setDependencyCache, clearCache } from './util/dependency_cache'; import { setLicenseCache } from './license'; -import type { MlSetupDependencies, MlStartDependencies } from '../plugin'; import { mlUsageCollectionProvider } from './services/usage_collection'; - import { MlRouter } from './routing'; import { mlApiServicesProvider } from './services/ml_api_service'; import { HttpService } from './services/http_service'; -import { ML_APP_LOCATOR, ML_PAGES } from '../../common/constants/locator'; export type MlDependencies = Omit< MlSetupDependencies, @@ -98,6 +102,13 @@ const App: FC = ({ coreStart, deps, appMountParams }) => { ...coreStart, }; + const datePickerDeps = { + ...pick(services, ['data', 'http', 'notifications', 'theme', 'uiSettings']), + toMountPoint, + wrapWithTheme, + uiSettingsKeys: UI_SETTINGS, + }; + const I18nContext = coreStart.i18n.Context; const ApplicationUsageTrackingProvider = deps.usageCollection?.components.ApplicationUsageTrackingProvider ?? React.Fragment; @@ -113,7 +124,9 @@ const App: FC = ({ coreStart, deps, appMountParams }) => { }} > - + + + diff --git a/x-pack/plugins/ml/public/application/components/full_time_range_selector/__snapshots__/full_time_range_selector.test.tsx.snap b/x-pack/plugins/ml/public/application/components/full_time_range_selector/__snapshots__/full_time_range_selector.test.tsx.snap deleted file mode 100644 index 0b8c8c81343b6..0000000000000 --- a/x-pack/plugins/ml/public/application/components/full_time_range_selector/__snapshots__/full_time_range_selector.test.tsx.snap +++ /dev/null @@ -1,79 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`FullTimeRangeSelector renders the selector 1`] = ` - - - } - delay="regular" - display="inlineBlock" - position="top" - > - - - - - - - } - closePopover={[Function]} - display="inline-block" - hasArrow={true} - id="mlFullTimeRangeSelectorOption" - isOpen={false} - ownFocus={true} - panelPaddingSize="none" - > - - - - - - -`; diff --git a/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.tsx b/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.tsx deleted file mode 100644 index 3f4c42bc30ca5..0000000000000 --- a/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.tsx +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { FC, useCallback, useMemo, useState } from 'react'; - -import { FormattedMessage } from '@kbn/i18n-react'; -import { - EuiFlexGroup, - EuiButton, - EuiFlexItem, - EuiButtonIcon, - EuiRadioGroup, - EuiPanel, - EuiToolTip, - EuiPopover, - EuiRadioGroupOption, -} from '@elastic/eui'; -import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; -import { i18n } from '@kbn/i18n'; -import type { DataView } from '@kbn/data-views-plugin/public'; -import { useStorage } from '@kbn/ml-local-storage'; -import { setFullTimeRange } from './full_time_range_selector_service'; -import { - ML_FROZEN_TIER_PREFERENCE, - FROZEN_TIER_PREFERENCE, - type MlStorageKey, - type TMlStorageMapped, - type FrozenTierPreference, -} from '../../../../common/types/storage'; -import { GetTimeFieldRangeResponse } from '../../services/ml_api_service'; - -interface Props { - dataView: DataView; - query: QueryDslQueryContainer; - disabled: boolean; - callback?: (a: GetTimeFieldRangeResponse) => void; -} - -// Component for rendering a button which automatically sets the range of the time filter -// to the time range of data in the index(es) mapped to the supplied Kibana index pattern or query. -export const FullTimeRangeSelector: FC = ({ dataView, query, disabled, callback }) => { - // wrapper around setFullTimeRange to allow for the calling of the optional callBack prop - async function setRange(i: DataView, q: QueryDslQueryContainer, excludeFrozenData = true) { - const fullTimeRange = await setFullTimeRange(i, q, excludeFrozenData); - if (typeof callback === 'function') { - callback(fullTimeRange); - } - } - - const [isPopoverOpen, setPopover] = useState(false); - const [frozenDataPreference, setFrozenDataPreference] = useStorage< - MlStorageKey, - TMlStorageMapped - >(ML_FROZEN_TIER_PREFERENCE, FROZEN_TIER_PREFERENCE.EXCLUDE); - - const onButtonClick = () => { - setPopover(!isPopoverOpen); - }; - - const closePopover = () => { - setPopover(false); - }; - - const sortOptions: EuiRadioGroupOption[] = useMemo(() => { - return [ - { - id: FROZEN_TIER_PREFERENCE.EXCLUDE, - label: i18n.translate( - 'xpack.ml.fullTimeRangeSelector.useFullDataExcludingFrozenMenuLabel', - { - defaultMessage: 'Exclude frozen data tier', - } - ), - }, - { - id: FROZEN_TIER_PREFERENCE.INCLUDE, - label: i18n.translate( - 'xpack.ml.fullTimeRangeSelector.useFullDataIncludingFrozenMenuLabel', - { - defaultMessage: 'Include frozen data tier', - } - ), - }, - ]; - }, []); - - const setPreference = useCallback((id: string) => { - setFrozenDataPreference(id as FrozenTierPreference); - setRange(dataView, query, id === FROZEN_TIER_PREFERENCE.EXCLUDE); - closePopover(); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - const popoverContent = useMemo( - () => ( - - - - ), - // eslint-disable-next-line react-hooks/exhaustive-deps - [frozenDataPreference, sortOptions] - ); - - const buttonTooltip = useMemo( - () => - frozenDataPreference === FROZEN_TIER_PREFERENCE.EXCLUDE ? ( - - ) : ( - - ), - [frozenDataPreference] - ); - - return ( - - - setRange(dataView, query, true)} - data-test-subj="mlButtonUseFullData" - > - - - - - - - } - isOpen={isPopoverOpen} - closePopover={closePopover} - panelPaddingSize="none" - anchorPosition="downRight" - > - {popoverContent} - - - - ); -}; diff --git a/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector_service.ts b/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector_service.ts deleted file mode 100644 index 4424b83ba60b5..0000000000000 --- a/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector_service.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import moment from 'moment'; - -import { i18n } from '@kbn/i18n'; -import dateMath from '@kbn/datemath'; -import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; -import type { DataView } from '@kbn/data-views-plugin/public'; -import { isPopulatedObject } from '@kbn/ml-is-populated-object'; -import { getTimefilter, getToastNotifications } from '../../util/dependency_cache'; -import { ml, GetTimeFieldRangeResponse } from '../../services/ml_api_service'; -import type { RuntimeMappings } from '../../../../common/types/fields'; -import { addExcludeFrozenToQuery } from '../../../../common/util/query_utils'; - -export interface TimeRange { - from: number; - to: number; -} - -export async function setFullTimeRange( - indexPattern: DataView, - query: QueryDslQueryContainer, - excludeFrozenData: boolean -): Promise { - try { - const timefilter = getTimefilter(); - const runtimeMappings = indexPattern.getComputedFields().runtimeFields as RuntimeMappings; - const resp = await ml.getTimeFieldRange({ - index: indexPattern.title, - timeFieldName: indexPattern.timeFieldName, - // By default we want to use full non-frozen time range - query: excludeFrozenData ? addExcludeFrozenToQuery(query) : query, - ...(isPopulatedObject(runtimeMappings) ? { runtimeMappings } : {}), - }); - - timefilter.setTime({ - from: moment(resp.start).toISOString(), - to: moment(resp.end).toISOString(), - }); - return resp; - } catch (resp) { - const toastNotifications = getToastNotifications(); - toastNotifications.addDanger( - i18n.translate('xpack.ml.fullTimeRangeSelector.errorSettingTimeRangeNotification', { - defaultMessage: 'An error occurred setting the time range.', - }) - ); - return resp; - } -} - -export function getTimeFilterRange(): TimeRange { - const timefilter = getTimefilter(); - const fromMoment = dateMath.parse(timefilter.getTime().from); - const toMoment = dateMath.parse(timefilter.getTime().to); - const from = fromMoment !== undefined ? fromMoment.valueOf() : 0; - const to = toMoment !== undefined ? toMoment.valueOf() : 0; - - return { - to, - from, - }; -} diff --git a/x-pack/plugins/ml/public/application/components/full_time_range_selector/index.tsx b/x-pack/plugins/ml/public/application/components/full_time_range_selector/index.tsx deleted file mode 100644 index 14ad77e2adc3a..0000000000000 --- a/x-pack/plugins/ml/public/application/components/full_time_range_selector/index.tsx +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { FullTimeRangeSelector } from './full_time_range_selector'; -export type { TimeRange } from './full_time_range_selector_service'; -export { getTimeFilterRange } from './full_time_range_selector_service'; diff --git a/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx b/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx index 4530ec0d8fd12..f85fe5649ffed 100644 --- a/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx +++ b/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx @@ -5,20 +5,21 @@ * 2.0. */ -import React, { createContext, FC, useMemo, useState } from 'react'; +import React, { createContext, FC, useEffect, useMemo, useState } from 'react'; +import { Subscription } from 'rxjs'; import { EuiPageContentBody_Deprecated as EuiPageContentBody } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { Redirect, Route, Switch } from 'react-router-dom'; import type { AppMountParameters } from '@kbn/core/public'; import { KibanaPageTemplate, RedirectAppLinks } from '@kbn/kibana-react-plugin/public'; import { createHtmlPortalNode, HtmlPortalNode } from 'react-reverse-portal'; +import { DatePickerWrapper } from '@kbn/ml-date-picker'; import { MlPageHeaderRenderer } from '../page_header/page_header'; import { useSideNavItems } from './side_nav'; import * as routes from '../../routing/routes'; import { MlPageWrapper } from '../../routing/ml_page_wrapper'; import { useMlKibana, useNavigateToPath } from '../../contexts/kibana'; import { MlRoute, PageDependencies } from '../../routing/router'; -import { DatePickerWrapper } from '../navigation_menu/date_picker_wrapper'; import { useActiveRoute } from '../../routing/use_active_route'; import { useDocTitle } from '../../routing/use_doc_title'; @@ -43,11 +44,28 @@ export const MlPage: FC<{ pageDeps: PageDependencies }> = React.memo(({ pageDeps const { services: { http: { basePath }, + mlServices: { httpService }, }, } = useMlKibana(); const headerPortalNode = useMemo(() => createHtmlPortalNode(), []); const [isHeaderMounted, setIsHeaderMounted] = useState(false); + const [isLoading, setIsLoading] = useState(false); + + useEffect(() => { + const subscriptions = new Subscription(); + + subscriptions.add( + httpService.getLoadingCount$.subscribe((v) => { + setIsLoading(v !== 0); + }) + ); + + return function cleanup() { + subscriptions.unsubscribe(); + }; + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); const routeList = useMemo( () => @@ -61,8 +79,8 @@ export const MlPage: FC<{ pageDeps: PageDependencies }> = React.memo(({ pageDeps const activeRoute = useActiveRoute(routeList); const rightSideItems = useMemo(() => { - return [...(activeRoute.enableDatePicker ? [] : [])]; - }, [activeRoute.enableDatePicker]); + return [...(activeRoute.enableDatePicker ? [] : [])]; + }, [activeRoute.enableDatePicker, isLoading]); useDocTitle(activeRoute); diff --git a/x-pack/plugins/ml/public/application/contexts/kibana/index.ts b/x-pack/plugins/ml/public/application/contexts/kibana/index.ts index 5db1956cd8400..d72119dac3cde 100644 --- a/x-pack/plugins/ml/public/application/contexts/kibana/index.ts +++ b/x-pack/plugins/ml/public/application/contexts/kibana/index.ts @@ -10,7 +10,6 @@ export { useMlKibana } from './kibana_context'; export type { NavigateToPath } from './use_navigate_to_path'; export { useNavigateToPath } from './use_navigate_to_path'; export { useUiSettings } from './use_ui_settings_context'; -export { useTimefilter } from './use_timefilter'; export { useNotifications } from './use_notifications_context'; export { useMlLocator, useMlLink } from './use_create_url'; export { useMlApiContext } from './use_ml_api_context'; diff --git a/x-pack/plugins/ml/public/application/contexts/kibana/use_timefilter.ts b/x-pack/plugins/ml/public/application/contexts/kibana/use_timefilter.ts deleted file mode 100644 index cc4cb51169a32..0000000000000 --- a/x-pack/plugins/ml/public/application/contexts/kibana/use_timefilter.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { useEffect } from 'react'; -import useObservable from 'react-use/lib/useObservable'; -import { map } from 'rxjs/operators'; -import { useMlKibana } from './kibana_context'; - -interface UseTimefilterOptions { - timeRangeSelector?: boolean; - autoRefreshSelector?: boolean; -} - -export const useTimefilter = ({ - timeRangeSelector, - autoRefreshSelector, -}: UseTimefilterOptions = {}) => { - const { services } = useMlKibana(); - const { timefilter } = services.data.query.timefilter; - - useEffect(() => { - if (timeRangeSelector === true) { - timefilter.enableTimeRangeSelector(); - } else if (timeRangeSelector === false) { - timefilter.disableTimeRangeSelector(); - } - - if (autoRefreshSelector === true) { - timefilter.enableAutoRefreshSelector(); - } else if (autoRefreshSelector === false) { - timefilter.disableAutoRefreshSelector(); - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [timeRangeSelector, autoRefreshSelector]); - - return timefilter; -}; - -export const useRefreshIntervalUpdates = () => { - const timefilter = useTimefilter(); - - return useObservable( - timefilter.getRefreshIntervalUpdate$().pipe(map(timefilter.getRefreshInterval)), - timefilter.getRefreshInterval() - ); -}; - -export const useTimeRangeUpdates = (absolute = false) => { - const timefilter = useTimefilter(); - - const getTimeCallback = absolute - ? timefilter.getAbsoluteTime.bind(timefilter) - : timefilter.getTime.bind(timefilter); - - return useObservable(timefilter.getTimeUpdate$().pipe(map(getTimeCallback)), getTimeCallback()); -}; diff --git a/x-pack/plugins/ml/public/application/datavisualizer/datavisualizer_selector.tsx b/x-pack/plugins/ml/public/application/datavisualizer/datavisualizer_selector.tsx index 52b08de11bb45..0a3f49cc882ff 100644 --- a/x-pack/plugins/ml/public/application/datavisualizer/datavisualizer_selector.tsx +++ b/x-pack/plugins/ml/public/application/datavisualizer/datavisualizer_selector.tsx @@ -20,8 +20,9 @@ import { } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; +import { useTimefilter } from '@kbn/ml-date-picker'; import { isFullLicense } from '../license'; -import { useTimefilter, useMlKibana, useNavigateToPath } from '../contexts/kibana'; +import { useMlKibana, useNavigateToPath } from '../contexts/kibana'; import { HelpMenu } from '../components/help_menu'; import { MlPageHeader } from '../components/page_header'; diff --git a/x-pack/plugins/ml/public/application/datavisualizer/file_based/file_datavisualizer.tsx b/x-pack/plugins/ml/public/application/datavisualizer/file_based/file_datavisualizer.tsx index c849b921546ba..3688c5053c536 100644 --- a/x-pack/plugins/ml/public/application/datavisualizer/file_based/file_datavisualizer.tsx +++ b/x-pack/plugins/ml/public/application/datavisualizer/file_based/file_datavisualizer.tsx @@ -13,7 +13,7 @@ import type { GetAdditionalLinksParams, GetAdditionalLinks, } from '@kbn/data-visualizer-plugin/public'; -import { useTimefilter } from '../../contexts/kibana'; +import { useTimefilter } from '@kbn/ml-date-picker'; import { HelpMenu } from '../../components/help_menu'; import { useMlKibana, useMlLocator } from '../../contexts/kibana'; diff --git a/x-pack/plugins/ml/public/application/datavisualizer/index_based/index_data_visualizer.tsx b/x-pack/plugins/ml/public/application/datavisualizer/index_based/index_data_visualizer.tsx index 2453801f5ea96..50da8f132cb6b 100644 --- a/x-pack/plugins/ml/public/application/datavisualizer/index_based/index_data_visualizer.tsx +++ b/x-pack/plugins/ml/public/application/datavisualizer/index_based/index_data_visualizer.tsx @@ -14,7 +14,8 @@ import type { GetAdditionalLinks, GetAdditionalLinksParams, } from '@kbn/data-visualizer-plugin/public'; -import { useMlKibana, useTimefilter, useMlLocator } from '../../contexts/kibana'; +import { useTimefilter } from '@kbn/ml-date-picker'; +import { useMlKibana, useMlLocator } from '../../contexts/kibana'; import { HelpMenu } from '../../components/help_menu'; import { ML_PAGES } from '../../../../common/constants/locator'; import { isFullLicense } from '../../license'; diff --git a/x-pack/plugins/ml/public/application/explorer/actions/load_explorer_data.ts b/x-pack/plugins/ml/public/application/explorer/actions/load_explorer_data.ts index 60288dd288b98..956db58467422 100644 --- a/x-pack/plugins/ml/public/application/explorer/actions/load_explorer_data.ts +++ b/x-pack/plugins/ml/public/application/explorer/actions/load_explorer_data.ts @@ -14,6 +14,7 @@ import { switchMap, map } from 'rxjs/operators'; import { useCallback, useMemo } from 'react'; import { TimefilterContract } from '@kbn/data-plugin/public'; +import { useTimefilter } from '@kbn/ml-date-picker'; import { getDateFormatTz, getSelectionInfluencers, @@ -28,7 +29,7 @@ import { ExplorerJob, } from '../explorer_utils'; import { ExplorerState } from '../reducers'; -import { useMlKibana, useTimefilter } from '../../contexts/kibana'; +import { useMlKibana } from '../../contexts/kibana'; import { MlResultsService, mlResultsServiceProvider } from '../../services/results_service'; import { AnomalyExplorerChartsService } from '../../services/anomaly_explorer_charts_service'; import type { InfluencersFilterQuery } from '../../../../common/types/es_client'; diff --git a/x-pack/plugins/ml/public/application/explorer/anomaly_context_menu.tsx b/x-pack/plugins/ml/public/application/explorer/anomaly_context_menu.tsx index 55feffe8ff5c4..f077d0f3dfd7f 100644 --- a/x-pack/plugins/ml/public/application/explorer/anomaly_context_menu.tsx +++ b/x-pack/plugins/ml/public/application/explorer/anomaly_context_menu.tsx @@ -20,13 +20,13 @@ import { i18n } from '@kbn/i18n'; import useObservable from 'react-use/lib/useObservable'; import type { Query, TimeRange } from '@kbn/es-query'; import { isDefined } from '@kbn/ml-is-defined'; +import { useTimeRangeUpdates } from '@kbn/ml-date-picker'; import { useAnomalyExplorerContext } from './anomaly_explorer_context'; import { escapeKueryForFieldValuePair } from '../util/string_utils'; import { SEARCH_QUERY_LANGUAGE } from '../../../common/constants/search'; import { useCasesModal } from '../contexts/kibana/use_cases_modal'; import { DEFAULT_MAX_SERIES_TO_PLOT } from '../services/anomaly_explorer_charts_service'; import { ANOMALY_EXPLORER_CHARTS_EMBEDDABLE_TYPE } from '../../embeddables'; -import { useTimeRangeUpdates } from '../contexts/kibana/use_timefilter'; import { useMlKibana } from '../contexts/kibana'; import { AppStateSelectedCells, diff --git a/x-pack/plugins/ml/public/application/explorer/anomaly_explorer_context.tsx b/x-pack/plugins/ml/public/application/explorer/anomaly_explorer_context.tsx index d0940cba5a8cc..2217c540ccf3b 100644 --- a/x-pack/plugins/ml/public/application/explorer/anomaly_explorer_context.tsx +++ b/x-pack/plugins/ml/public/application/explorer/anomaly_explorer_context.tsx @@ -6,9 +6,10 @@ */ import React, { useContext, useEffect, useMemo, useState, type FC } from 'react'; +import { useTimefilter } from '@kbn/ml-date-picker'; import { AnomalyTimelineStateService } from './anomaly_timeline_state_service'; import { AnomalyExplorerCommonStateService } from './anomaly_explorer_common_state'; -import { useMlKibana, useTimefilter } from '../contexts/kibana'; +import { useMlKibana } from '../contexts/kibana'; import { mlResultsServiceProvider } from '../services/results_service'; import { AnomalyTimelineService } from '../services/anomaly_timeline_service'; import { useExplorerUrlState } from './hooks/use_explorer_url_state'; diff --git a/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx b/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx index a0ff293a2b203..e9cbf84c090df 100644 --- a/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx +++ b/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx @@ -28,9 +28,9 @@ import useDebounce from 'react-use/lib/useDebounce'; import useObservable from 'react-use/lib/useObservable'; import type { Query } from '@kbn/es-query'; import { isDefined } from '@kbn/ml-is-defined'; +import { useTimeRangeUpdates } from '@kbn/ml-date-picker'; import { SEARCH_QUERY_LANGUAGE } from '../../../common/constants/search'; import { useCasesModal } from '../contexts/kibana/use_cases_modal'; -import { useTimeRangeUpdates } from '../contexts/kibana/use_timefilter'; import { ANOMALY_SWIMLANE_EMBEDDABLE_TYPE } from '../..'; import { OVERALL_LABEL, diff --git a/x-pack/plugins/ml/public/application/explorer/anomaly_timeline_state_service.ts b/x-pack/plugins/ml/public/application/explorer/anomaly_timeline_state_service.ts index 36584138647ba..b7d66bd91be40 100644 --- a/x-pack/plugins/ml/public/application/explorer/anomaly_timeline_state_service.ts +++ b/x-pack/plugins/ml/public/application/explorer/anomaly_timeline_state_service.ts @@ -19,6 +19,8 @@ import { import { isEqual, sortBy, uniq } from 'lodash'; import type { TimefilterContract } from '@kbn/data-plugin/public'; import type { TimeRangeBounds } from '@kbn/data-plugin/common'; +// FIXME get rid of the static import +import { mlTimefilterRefresh$ } from '@kbn/ml-date-picker'; import { AnomalyTimelineService } from '../services/anomaly_timeline_service'; import type { AppStateSelectedCells, @@ -38,8 +40,6 @@ import { mlJobService } from '../services/job_service'; import { getSelectionInfluencers, getSelectionTimeRange } from './explorer_utils'; import type { TimeBucketsInterval } from '../util/time_buckets'; import { InfluencersFilterQuery } from '../../../common/types/es_client'; -// FIXME get rid of the static import -import { mlTimefilterRefresh$ } from '../services/timefilter_refresh_service'; import type { Refresh } from '../routing/use_refresh'; import { StateService } from '../services/state_service'; import type { AnomalyExplorerUrlStateService } from './hooks/use_explorer_url_state'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts index 9edb81907722e..6550e5a6d58ca 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts @@ -9,6 +9,7 @@ import { BehaviorSubject } from 'rxjs'; import { cloneDeep } from 'lodash'; import { ES_FIELD_TYPES } from '@kbn/field-types'; import type { DataView } from '@kbn/data-views-plugin/public'; +import { addExcludeFrozenToQuery } from '@kbn/ml-query-utils'; import { SavedSearchSavedObject } from '../../../../../../common/types/kibana'; import { UrlConfig } from '../../../../../../common/types/custom_urls'; import { IndexPatternTitle } from '../../../../../../common/types/kibana'; @@ -28,7 +29,6 @@ import { } from '../../../../../../common/types/anomaly_detection_jobs'; import { Aggregation, Field, RuntimeMappings } from '../../../../../../common/types/fields'; import { combineFieldsAndAggs } from '../../../../../../common/util/fields_utils'; -import { addExcludeFrozenToQuery } from '../../../../../../common/util/query_utils'; import { createEmptyJob, createEmptyDatafeed } from './util/default_configs'; import { mlJobService } from '../../../../services/job_service'; import { JobRunner, ProgressSubscriber } from '../job_runner'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/time_range_step/time_range.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/time_range_step/time_range.tsx index df758734bd858..4dc7b498144cf 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/time_range_step/time_range.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/time_range_step/time_range.tsx @@ -10,19 +10,26 @@ import { i18n } from '@kbn/i18n'; import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; import moment from 'moment'; +import { FullTimeRangeSelector, FROZEN_TIER_PREFERENCE } from '@kbn/ml-date-picker'; +import { useTimefilter, type GetTimeFieldRangeResponse } from '@kbn/ml-date-picker'; +import { useStorage } from '@kbn/ml-local-storage'; import { WizardNav } from '../wizard_nav'; import { StepProps, WIZARD_STEPS } from '../step_types'; import { JobCreatorContext } from '../job_creator_context'; import { useMlContext } from '../../../../../contexts/ml'; -import { FullTimeRangeSelector } from '../../../../../components/full_time_range_selector'; import { EventRateChart } from '../charts/event_rate_chart'; import { LineChartPoint } from '../../../common/chart_loader'; import { JOB_TYPE } from '../../../../../../../common/constants/new_job'; -import { GetTimeFieldRangeResponse } from '../../../../../services/ml_api_service'; import { TimeRangePicker, TimeRange } from '../../../common/components'; import { useMlKibana } from '../../../../../contexts/kibana'; +import { + ML_FROZEN_TIER_PREFERENCE, + type MlStorageKey, + type TMlStorageMapped, +} from '../../../../../../../common/types/storage'; export const TimeRangeStep: FC = ({ setCurrentStep, isCurrentStep }) => { + const timefilter = useTimefilter(); const { services } = useMlKibana(); const mlContext = useMlContext(); @@ -36,6 +43,15 @@ export const TimeRangeStep: FC = ({ setCurrentStep, isCurrentStep }) const [eventRateChartData, setEventRateChartData] = useState([]); const [loadingData, setLoadingData] = useState(false); + const [frozenDataPreference, setFrozenDataPreference] = useStorage< + MlStorageKey, + TMlStorageMapped + >( + ML_FROZEN_TIER_PREFERENCE, + // By default we will exclude frozen data tier + FROZEN_TIER_PREFERENCE.EXCLUDE + ); + async function loadChart() { setLoadingData(true); try { @@ -61,8 +77,8 @@ export const TimeRangeStep: FC = ({ setCurrentStep, isCurrentStep }) max: moment(end), }); // update the timefilter, to keep the URL in sync - const { timefilter } = services.data.query.timefilter; - timefilter.setTime({ + const { timefilter: timefilterService } = services.data.query.timefilter; + timefilterService.setTime({ from: moment(start).toISOString(), to: moment(end).toISOString(), }); @@ -89,8 +105,8 @@ export const TimeRangeStep: FC = ({ setCurrentStep, isCurrentStep }) function fullTimeRangeCallback(range: GetTimeFieldRangeResponse) { if (range.start !== null && range.end !== null) { setTimeRange({ - start: range.start, - end: range.end, + start: range.start.epoch, + end: range.end.epoch, }); } else { const { toasts } = services.notifications; @@ -112,10 +128,13 @@ export const TimeRangeStep: FC = ({ setCurrentStep, isCurrentStep }) diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/page.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/page.tsx index daf04edaba4ed..4d27dba214242 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/page.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/page.tsx @@ -12,6 +12,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; +import { getTimeFilterRange, useTimefilter } from '@kbn/ml-date-picker'; import { useTimeBuckets } from '../../../../components/custom_hooks/use_time_buckets'; import { Wizard } from './wizard'; import { WIZARD_STEPS } from '../components/step_types'; @@ -34,7 +35,6 @@ import { ResultsLoader } from '../../common/results_loader'; import { JobValidator } from '../../common/job_validator'; import { useMlContext } from '../../../../contexts/ml'; import { useMlKibana } from '../../../../contexts/kibana'; -import { getTimeFilterRange } from '../../../../components/full_time_range_selector'; import { ExistingJobsAndGroups, mlJobService } from '../../../../services/job_service'; import { newJobCapsService } from '../../../../services/new_job_capabilities/new_job_capabilities_service'; import { EVENT_RATE_FIELD_ID } from '../../../../../../common/types/fields'; @@ -52,6 +52,7 @@ export interface PageProps { } export const Page: FC = ({ existingJobsAndGroups, jobType }) => { + const timefilter = useTimefilter(); const mlContext = useMlContext(); const { services: { maps: mapsPlugin }, @@ -74,7 +75,7 @@ export const Page: FC = ({ existingJobsAndGroups, jobType }) => { const { displayErrorToast } = useToastNotificationService(); - const { from, to } = getTimeFilterRange(); + const { from, to } = getTimeFilterRange(timefilter); jobCreator.setTimeRange(from, to); let firstWizardStep = diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/job_settings_form.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/job_settings_form.tsx index 613f1d4d2fa3b..6b84bf3c60e26 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/job_settings_form.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/job_settings_form.tsx @@ -19,8 +19,8 @@ import { EuiSwitch, EuiTextAlign, } from '@elastic/eui'; +import { getTimeFilterRange, useTimefilter } from '@kbn/ml-date-picker'; import { ModuleJobUI, SAVE_STATE } from '../page'; -import { getTimeFilterRange } from '../../../../components/full_time_range_selector'; import { useMlContext } from '../../../../contexts/ml'; import { composeValidators, @@ -51,7 +51,8 @@ export const JobSettingsForm: FC = ({ saveState, jobs, }) => { - const { from, to } = getTimeFilterRange(); + const timefilter = useTimefilter(); + const { from, to } = getTimeFilterRange(timefilter); const { currentDataView: dataView } = useMlContext(); const jobPrefixValidator = useMemo( diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/page.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/page.tsx index 1ee0130b8fee4..1dbf2b2e99a84 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/page.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/page.tsx @@ -20,6 +20,7 @@ import { import { isEqual, merge } from 'lodash'; import moment from 'moment'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; +import { addExcludeFrozenToQuery } from '@kbn/ml-query-utils'; import { useMlKibana, useMlLocator } from '../../../contexts/kibana'; import { useMlContext } from '../../../contexts/ml'; import { @@ -41,7 +42,6 @@ import { ML_PAGES } from '../../../../../common/constants/locator'; import { TIME_FORMAT } from '../../../../../common/constants/time_format'; import { JobsAwaitingNodeWarning } from '../../../components/jobs_awaiting_node_warning'; import { RuntimeMappings } from '../../../../../common/types/fields'; -import { addExcludeFrozenToQuery } from '../../../../../common/util/query_utils'; import { MlPageHeader } from '../../../components/page_header'; export interface ModuleJobUI extends ModuleJob { diff --git a/x-pack/plugins/ml/public/application/notifications/components/notifications_list.test.tsx b/x-pack/plugins/ml/public/application/notifications/components/notifications_list.test.tsx index b8c1afff137e3..f9f7478be6e3e 100644 --- a/x-pack/plugins/ml/public/application/notifications/components/notifications_list.test.tsx +++ b/x-pack/plugins/ml/public/application/notifications/components/notifications_list.test.tsx @@ -5,19 +5,65 @@ * 2.0. */ -import React from 'react'; +import React, { type FC } from 'react'; import { I18nProvider } from '@kbn/i18n-react'; import { render, waitFor } from '@testing-library/react'; +import { DatePickerContextProvider, type DatePickerDependencies } from '@kbn/ml-date-picker'; import { NotificationsList } from './notifications_list'; import { useMlKibana } from '../../contexts/kibana'; jest.mock('../../contexts/kibana'); jest.mock('../../services/toast_notification_service'); jest.mock('../../contexts/ml/ml_notifications_context'); -jest.mock('../../contexts/kibana/use_timefilter'); jest.mock('../../contexts/kibana/use_field_formatter'); jest.mock('../../components/saved_objects_warning'); +const getMockedTimefilter = () => { + // eslint-disable-next-line @typescript-eslint/no-var-requires + const { of } = require('rxjs'); + return { + timefilter: { + disableTimeRangeSelector: jest.fn(), + disableAutoRefreshSelector: jest.fn(), + enableTimeRangeSelector: jest.fn(), + enableAutoRefreshSelector: jest.fn(), + getRefreshInterval: jest.fn(), + setRefreshInterval: jest.fn(), + getTime: jest.fn(() => { + return { from: '', to: '' }; + }), + setTime: jest.fn(), + isAutoRefreshSelectorEnabled: jest.fn(), + isTimeRangeSelectorEnabled: jest.fn(), + getRefreshIntervalUpdate$: jest.fn(), + getTimeUpdate$: jest.fn(() => { + return of(); + }), + getEnabledUpdated$: jest.fn(), + }, + history: { get: jest.fn() }, + }; +}; + +const getMockedDatePickeDependencies = () => { + return { + data: { + query: { + timefilter: getMockedTimefilter(), + }, + }, + notifications: {}, + } as unknown as DatePickerDependencies; +}; + +const Wrapper: FC = ({ children }) => ( + + + {children} + + +); + describe('NotificationsList', () => { beforeEach(() => { jest.useFakeTimers(); @@ -29,7 +75,7 @@ describe('NotificationsList', () => { }); test('starts fetching notification on mount with default params', async () => { - const {} = render(, { wrapper: I18nProvider }); + const {} = render(, { wrapper: Wrapper }); jest.advanceTimersByTime(500); diff --git a/x-pack/plugins/ml/public/application/notifications/components/notifications_list.tsx b/x-pack/plugins/ml/public/application/notifications/components/notifications_list.tsx index 83c5f895c9b96..9a572f6730e3b 100644 --- a/x-pack/plugins/ml/public/application/notifications/components/notifications_list.tsx +++ b/x-pack/plugins/ml/public/application/notifications/components/notifications_list.tsx @@ -24,11 +24,11 @@ import { FIELD_FORMAT_IDS } from '@kbn/field-formats-plugin/common'; import useDebounce from 'react-use/lib/useDebounce'; import useMount from 'react-use/lib/useMount'; import { usePageUrlState } from '@kbn/ml-url-state'; +import { useTimefilter, useTimeRangeUpdates } from '@kbn/ml-date-picker'; import { EntityFilter } from './entity_filter'; import { useMlNotifications } from '../../contexts/ml/ml_notifications_context'; import { ML_NOTIFICATIONS_MESSAGE_LEVEL } from '../../../../common/constants/notifications'; import { SavedObjectsWarning } from '../../components/saved_objects_warning'; -import { useTimefilter, useTimeRangeUpdates } from '../../contexts/kibana/use_timefilter'; import { useToastNotificationService } from '../../services/toast_notification_service'; import { useFieldFormatter } from '../../contexts/kibana/use_field_formatter'; import { useRefresh } from '../../routing/use_refresh'; diff --git a/x-pack/plugins/ml/public/application/notifications/page.tsx b/x-pack/plugins/ml/public/application/notifications/page.tsx index 80d052bf818da..646bd607898c9 100644 --- a/x-pack/plugins/ml/public/application/notifications/page.tsx +++ b/x-pack/plugins/ml/public/application/notifications/page.tsx @@ -7,8 +7,9 @@ import React, { FC } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; +import { useTimefilter } from '@kbn/ml-date-picker'; import { NotificationsList } from './components/notifications_list'; -import { useMlKibana, useTimefilter } from '../contexts/kibana'; +import { useMlKibana } from '../contexts/kibana'; import { MlPageHeader } from '../components/page_header'; import { NodeAvailableWarning } from '../components/node_available_warning'; import { UpgradeWarning } from '../components/upgrade'; diff --git a/x-pack/plugins/ml/public/application/overview/components/anomaly_detection_panel/actions.tsx b/x-pack/plugins/ml/public/application/overview/components/anomaly_detection_panel/actions.tsx index fe74d84ea8a62..60ebb9c8479ec 100644 --- a/x-pack/plugins/ml/public/application/overview/components/anomaly_detection_panel/actions.tsx +++ b/x-pack/plugins/ml/public/application/overview/components/anomaly_detection_panel/actions.tsx @@ -7,7 +7,8 @@ import { i18n } from '@kbn/i18n'; import { Action } from '@elastic/eui/src/components/basic_table/action_types'; -import { useMlLocator, useNavigateToPath, useTimefilter } from '../../../contexts/kibana'; +import { useTimefilter } from '@kbn/ml-date-picker'; +import { useMlLocator, useNavigateToPath } from '../../../contexts/kibana'; import { ML_PAGES } from '../../../../../common/constants/locator'; import { Group } from './anomaly_detection_panel'; diff --git a/x-pack/plugins/ml/public/application/overview/components/content.tsx b/x-pack/plugins/ml/public/application/overview/components/content.tsx index dc9d7465b9862..ae0b9269de01d 100644 --- a/x-pack/plugins/ml/public/application/overview/components/content.tsx +++ b/x-pack/plugins/ml/public/application/overview/components/content.tsx @@ -7,11 +7,12 @@ import React, { useEffect, useState, type FC } from 'react'; import { EuiSpacer } from '@elastic/eui'; +import { useTimefilter } from '@kbn/ml-date-picker'; import { AnomalyDetectionPanel } from './anomaly_detection_panel'; import { AnalyticsPanel } from './analytics_panel'; import { AnomalyTimelineService } from '../../services/anomaly_timeline_service'; import { mlResultsServiceProvider } from '../../services/results_service'; -import { useMlKibana, useTimefilter } from '../../contexts/kibana'; +import { useMlKibana } from '../../contexts/kibana'; interface Props { createAnomalyDetectionJobDisabled: boolean; diff --git a/x-pack/plugins/ml/public/application/overview/overview_page.tsx b/x-pack/plugins/ml/public/application/overview/overview_page.tsx index a0d91f9e48d51..27771f56b6bc6 100644 --- a/x-pack/plugins/ml/public/application/overview/overview_page.tsx +++ b/x-pack/plugins/ml/public/application/overview/overview_page.tsx @@ -8,6 +8,7 @@ import React, { FC, useState } from 'react'; import { EuiPanel, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; +import { mlTimefilterRefresh$, useTimefilter } from '@kbn/ml-date-picker'; import { checkPermission } from '../capabilities/check_capabilities'; import { mlNodesAvailable } from '../ml_nodes_check'; import { GettingStartedCallout } from './components/getting_started_callout'; @@ -17,9 +18,8 @@ import { JobsAwaitingNodeWarning } from '../components/jobs_awaiting_node_warnin import { SavedObjectsWarning } from '../components/saved_objects_warning'; import { UpgradeWarning } from '../components/upgrade'; import { HelpMenu } from '../components/help_menu'; -import { useMlKibana, useTimefilter } from '../contexts/kibana'; +import { useMlKibana } from '../contexts/kibana'; import { NodesList } from '../trained_models/nodes_overview'; -import { mlTimefilterRefresh$ } from '../services/timefilter_refresh_service'; import { MlPageHeader } from '../components/page_header'; export const OverviewPage: FC = () => { diff --git a/x-pack/plugins/ml/public/application/routing/routes/explorer.tsx b/x-pack/plugins/ml/public/application/routing/routes/explorer.tsx index 7988309f5a6d7..ac90c88ea30ed 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/explorer.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/explorer.tsx @@ -14,7 +14,8 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiThemeProvider as StyledComponentsThemeProvider } from '@kbn/kibana-react-plugin/common'; import { useUrlState } from '@kbn/ml-url-state'; -import { NavigateToPath, useMlKibana, useTimefilter } from '../../contexts/kibana'; +import { useTimefilter } from '@kbn/ml-date-picker'; +import { NavigateToPath, useMlKibana } from '../../contexts/kibana'; import { MlJobWithTimeRange } from '../../../../common/types/anomaly_detection_jobs'; diff --git a/x-pack/plugins/ml/public/application/routing/routes/jobs_list.tsx b/x-pack/plugins/ml/public/application/routing/routes/jobs_list.tsx index 5106f151198d5..bfd183a628689 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/jobs_list.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/jobs_list.tsx @@ -8,18 +8,20 @@ import React, { useEffect, FC, useMemo } from 'react'; import useObservable from 'react-use/lib/useObservable'; import { i18n } from '@kbn/i18n'; +import { + mlTimefilterRefresh$, + useRefreshIntervalUpdates, + useTimefilter, +} from '@kbn/ml-date-picker'; import { NavigateToPath } from '../../contexts/kibana'; import { DEFAULT_REFRESH_INTERVAL_MS } from '../../../../common/constants/jobs_list'; -import { mlTimefilterRefresh$ } from '../../services/timefilter_refresh_service'; import { MlRoute, PageLoader, PageProps } from '../router'; import { useResolver } from '../use_resolver'; import { basicResolvers } from '../resolvers'; import { JobsPage } from '../../jobs/jobs_list'; -import { useTimefilter } from '../../contexts/kibana'; import { getBreadcrumbWithUrlForApp } from '../breadcrumbs'; import { AnnotationUpdatesService } from '../../services/annotations_service'; import { MlAnnotationUpdatesContext } from '../../contexts/ml/ml_annotation_updates_context'; -import { useRefreshIntervalUpdates } from '../../contexts/kibana/use_timefilter'; export const jobListRouteFactory = (navigateToPath: NavigateToPath, basePath: string): MlRoute => ({ id: 'anomaly_detection', diff --git a/x-pack/plugins/ml/public/application/routing/routes/notifications.tsx b/x-pack/plugins/ml/public/application/routing/routes/notifications.tsx index 238aacf86bdc7..c85b2c732fe25 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/notifications.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/notifications.tsx @@ -7,6 +7,7 @@ import React, { FC, Suspense } from 'react'; import { i18n } from '@kbn/i18n'; +import { useTimefilter } from '@kbn/ml-date-picker'; import { PageLoader, PageProps } from '../router'; import { useResolver } from '../use_resolver'; import { checkFullLicense } from '../../license'; @@ -15,7 +16,7 @@ import { getMlNodeCount } from '../../ml_nodes_check'; import { loadMlServerInfo } from '../../services/ml_server_info'; import { getBreadcrumbWithUrlForApp } from '../breadcrumbs'; import type { MlRoute } from '..'; -import { NavigateToPath, useTimefilter } from '../../contexts/kibana'; +import { NavigateToPath } from '../../contexts/kibana'; const NotificationsPage = React.lazy(() => import('../../notifications/page')); diff --git a/x-pack/plugins/ml/public/application/routing/routes/overview.tsx b/x-pack/plugins/ml/public/application/routing/routes/overview.tsx index 1a954f72f17e4..4f3edf38f08aa 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/overview.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/overview.tsx @@ -10,16 +10,16 @@ import { i18n } from '@kbn/i18n'; import { Redirect } from 'react-router-dom'; -import type { NavigateToPath } from '../../contexts/kibana'; - -import { MlRoute, PageLoader, PageProps } from '../router'; -import { useResolver } from '../use_resolver'; +import { useTimefilter } from '@kbn/ml-date-picker'; +import type { NavigateToPath } from '../../contexts/kibana'; import { checkFullLicense } from '../../license'; import { checkGetJobsCapabilitiesResolver } from '../../capabilities/check_capabilities'; import { getMlNodeCount } from '../../ml_nodes_check'; import { loadMlServerInfo } from '../../services/ml_server_info'; -import { useTimefilter } from '../../contexts/kibana'; + +import { MlRoute, PageLoader, PageProps } from '../router'; +import { useResolver } from '../use_resolver'; import { getBreadcrumbWithUrlForApp } from '../breadcrumbs'; const OverviewPage = React.lazy(() => import('../../overview/overview_page')); diff --git a/x-pack/plugins/ml/public/application/routing/routes/settings/calendar_list.tsx b/x-pack/plugins/ml/public/application/routing/routes/settings/calendar_list.tsx index 63db6a8c075a8..faf78b8a302d7 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/settings/calendar_list.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/settings/calendar_list.tsx @@ -7,7 +7,8 @@ import React, { FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { NavigateToPath, useTimefilter } from '../../../contexts/kibana'; +import { useTimefilter } from '@kbn/ml-date-picker'; +import { NavigateToPath } from '../../../contexts/kibana'; import { MlRoute, PageLoader, PageProps } from '../../router'; import { useResolver } from '../../use_resolver'; import { checkFullLicense } from '../../../license'; diff --git a/x-pack/plugins/ml/public/application/routing/routes/settings/calendar_new_edit.tsx b/x-pack/plugins/ml/public/application/routing/routes/settings/calendar_new_edit.tsx index c3fe9f03ebf61..95a9a38d95fcf 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/settings/calendar_new_edit.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/settings/calendar_new_edit.tsx @@ -7,7 +7,8 @@ import React, { FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { NavigateToPath, useTimefilter } from '../../../contexts/kibana'; +import { useTimefilter } from '@kbn/ml-date-picker'; +import { NavigateToPath } from '../../../contexts/kibana'; import { MlRoute, PageLoader, PageProps } from '../../router'; import { useResolver } from '../../use_resolver'; import { checkFullLicense } from '../../../license'; diff --git a/x-pack/plugins/ml/public/application/routing/routes/settings/filter_list.tsx b/x-pack/plugins/ml/public/application/routing/routes/settings/filter_list.tsx index 55e14172b656a..a8a1ffeb48c72 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/settings/filter_list.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/settings/filter_list.tsx @@ -7,7 +7,8 @@ import React, { FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { NavigateToPath, useTimefilter } from '../../../contexts/kibana'; +import { useTimefilter } from '@kbn/ml-date-picker'; +import { NavigateToPath } from '../../../contexts/kibana'; import { MlRoute, PageLoader, PageProps } from '../../router'; import { useResolver } from '../../use_resolver'; import { checkFullLicense } from '../../../license'; diff --git a/x-pack/plugins/ml/public/application/routing/routes/settings/filter_list_new_edit.tsx b/x-pack/plugins/ml/public/application/routing/routes/settings/filter_list_new_edit.tsx index d105d3d3aac5e..ce761541492bc 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/settings/filter_list_new_edit.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/settings/filter_list_new_edit.tsx @@ -8,12 +8,11 @@ import React, { FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { NavigateToPath } from '../../../contexts/kibana'; +import { useTimefilter } from '@kbn/ml-date-picker'; -import { MlRoute, PageLoader, PageProps } from '../../router'; -import { useResolver } from '../../use_resolver'; +import { ML_PAGES } from '../../../../../common/constants/locator'; -import { useTimefilter } from '../../../contexts/kibana'; +import { useCreateAndNavigateToMlLink } from '../../../contexts/kibana/use_create_url'; import { checkFullLicense } from '../../../license'; import { checkGetJobsCapabilitiesResolver, @@ -21,10 +20,11 @@ import { } from '../../../capabilities/check_capabilities'; import { checkMlNodesAvailable } from '../../../ml_nodes_check/check_ml_nodes'; import { EditFilterList } from '../../../settings/filter_lists'; +import { NavigateToPath } from '../../../contexts/kibana'; +import { MlRoute, PageLoader, PageProps } from '../../router'; +import { useResolver } from '../../use_resolver'; import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs'; -import { useCreateAndNavigateToMlLink } from '../../../contexts/kibana/use_create_url'; -import { ML_PAGES } from '../../../../../common/constants/locator'; enum MODE { NEW, diff --git a/x-pack/plugins/ml/public/application/routing/routes/settings/settings.tsx b/x-pack/plugins/ml/public/application/routing/routes/settings/settings.tsx index ca8215b320eeb..6d41c8eb8685f 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/settings/settings.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/settings/settings.tsx @@ -7,7 +7,8 @@ import React, { FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { NavigateToPath, useTimefilter } from '../../../contexts/kibana'; +import { useTimefilter } from '@kbn/ml-date-picker'; +import { NavigateToPath } from '../../../contexts/kibana'; import { MlRoute, PageLoader, PageProps } from '../../router'; import { useResolver } from '../../use_resolver'; import { checkFullLicense } from '../../../license'; diff --git a/x-pack/plugins/ml/public/application/routing/routes/timeseriesexplorer.test.tsx b/x-pack/plugins/ml/public/application/routing/routes/timeseriesexplorer.test.tsx index 1995a4b0b301a..fcd413b301108 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/timeseriesexplorer.test.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/timeseriesexplorer.test.tsx @@ -14,6 +14,7 @@ import { TimeSeriesExplorerUrlStateManager } from './timeseriesexplorer'; import { TimeSeriesExplorer } from '../../timeseriesexplorer'; import { TimeSeriesExplorerPage } from '../../timeseriesexplorer/timeseriesexplorer_page'; import { TimeseriesexplorerNoJobsFound } from '../../timeseriesexplorer/components/timeseriesexplorer_no_jobs_found'; +import { DatePickerContextProvider, type DatePickerDependencies } from '@kbn/ml-date-picker'; jest.mock('../../services/toast_notification_service'); @@ -43,6 +44,41 @@ const MockedTimeseriesexplorerNoJobsFound = TimeseriesexplorerNoJobsFound as jes typeof TimeseriesexplorerNoJobsFound >; +const getMockedTimefilter = () => { + // eslint-disable-next-line @typescript-eslint/no-var-requires + const { of } = require('rxjs'); + return { + timefilter: { + disableTimeRangeSelector: jest.fn(), + disableAutoRefreshSelector: jest.fn(), + enableTimeRangeSelector: jest.fn(), + enableAutoRefreshSelector: jest.fn(), + getRefreshInterval: jest.fn(), + setRefreshInterval: jest.fn(), + getTime: jest.fn(), + isAutoRefreshSelectorEnabled: jest.fn(), + isTimeRangeSelectorEnabled: jest.fn(), + getRefreshIntervalUpdate$: jest.fn(), + getTimeUpdate$: jest.fn(() => { + return of(); + }), + getEnabledUpdated$: jest.fn(), + }, + history: { get: jest.fn() }, + }; +}; + +const getMockedDatePickeDependencies = () => { + return { + data: { + query: { + timefilter: getMockedTimefilter(), + }, + }, + notifications: {}, + } as unknown as DatePickerDependencies; +}; + jest.mock('@kbn/ml-url-state', () => { return { usePageUrlState: jest.fn(() => { @@ -61,8 +97,6 @@ jest.mock('../../components/help_menu', () => ({ })); jest.mock('../../contexts/kibana/kibana_context', () => { - // eslint-disable-next-line @typescript-eslint/no-var-requires - const { of } = require('rxjs'); return { useMlKibana: () => { return { @@ -75,25 +109,7 @@ jest.mock('../../contexts/kibana/kibana_context', () => { uiSettings: { get: jest.fn() }, data: { query: { - timefilter: { - timefilter: { - disableTimeRangeSelector: jest.fn(), - disableAutoRefreshSelector: jest.fn(), - enableTimeRangeSelector: jest.fn(), - enableAutoRefreshSelector: jest.fn(), - getRefreshInterval: jest.fn(), - setRefreshInterval: jest.fn(), - getTime: jest.fn(), - isAutoRefreshSelectorEnabled: jest.fn(), - isTimeRangeSelectorEnabled: jest.fn(), - getRefreshIntervalUpdate$: jest.fn(), - getTimeUpdate$: jest.fn(() => { - return of(); - }), - getEnabledUpdated$: jest.fn(), - }, - history: { get: jest.fn() }, - }, + timefilter: getMockedTimefilter(), }, }, notifications: { @@ -122,7 +138,9 @@ describe('TimeSeriesExplorerUrlStateManager', () => { render( - + + + ); diff --git a/x-pack/plugins/ml/public/application/routing/routes/timeseriesexplorer.tsx b/x-pack/plugins/ml/public/application/routing/routes/timeseriesexplorer.tsx index 68bc9eef1f70c..c2d0fbabdd863 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/timeseriesexplorer.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/timeseriesexplorer.tsx @@ -13,6 +13,7 @@ import moment from 'moment'; import { i18n } from '@kbn/i18n'; import { useUrlState } from '@kbn/ml-url-state'; +import { useTimefilter } from '@kbn/ml-date-picker'; import { getViewableDetectors } from '../../timeseriesexplorer/timeseriesexplorer_utils/get_viewable_detectors'; import { NavigateToPath, useNotifications } from '../../contexts/kibana'; import { useMlContext } from '../../contexts/ml'; @@ -39,7 +40,6 @@ import { MlRoute, PageLoader, PageProps } from '../router'; import { useResolver } from '../use_resolver'; import { basicResolvers } from '../resolvers'; import { getBreadcrumbWithUrlForApp } from '../breadcrumbs'; -import { useTimefilter } from '../../contexts/kibana'; import { useToastNotificationService } from '../../services/toast_notification_service'; import { AnnotationUpdatesService } from '../../services/annotations_service'; import { MlAnnotationUpdatesContext } from '../../contexts/ml/ml_annotation_updates_context'; diff --git a/x-pack/plugins/ml/public/application/routing/routes/trained_models/nodes_list.tsx b/x-pack/plugins/ml/public/application/routing/routes/trained_models/nodes_list.tsx index 68cdd956719d3..9d09de3660f25 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/trained_models/nodes_list.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/trained_models/nodes_list.tsx @@ -9,7 +9,8 @@ import React, { FC } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { NavigateToPath, useTimefilter } from '../../../contexts/kibana'; +import { useTimefilter } from '@kbn/ml-date-picker'; +import { NavigateToPath } from '../../../contexts/kibana'; import { MlRoute, PageLoader, PageProps } from '../../router'; import { useResolver } from '../../use_resolver'; import { basicResolvers } from '../../resolvers'; diff --git a/x-pack/plugins/ml/public/application/routing/use_refresh.ts b/x-pack/plugins/ml/public/application/routing/use_refresh.ts index 8148a013ebc6e..691877ebcff0a 100644 --- a/x-pack/plugins/ml/public/application/routing/use_refresh.ts +++ b/x-pack/plugins/ml/public/application/routing/use_refresh.ts @@ -6,13 +6,12 @@ */ import useObservable from 'react-use/lib/useObservable'; -import { merge } from 'rxjs'; +import { merge, type Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { useMemo } from 'react'; +import { mlTimefilterRefresh$, useTimefilter } from '@kbn/ml-date-picker'; import { annotationsRefresh$ } from '../services/annotations_service'; -import { mlTimefilterRefresh$ } from '../services/timefilter_refresh_service'; -import { useTimefilter } from '../contexts/kibana'; export interface Refresh { lastRefresh: number; @@ -40,7 +39,7 @@ export const useRefresh = () => { }) ), annotationsRefresh$.pipe(map((d) => ({ lastRefresh: d }))) - ); + ) as Observable; // eslint-disable-next-line react-hooks/exhaustive-deps }, []); diff --git a/x-pack/plugins/ml/public/application/services/timefilter_refresh_service.tsx b/x-pack/plugins/ml/public/application/services/timefilter_refresh_service.tsx deleted file mode 100644 index 4fcedcba56b1a..0000000000000 --- a/x-pack/plugins/ml/public/application/services/timefilter_refresh_service.tsx +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { Subject } from 'rxjs'; - -import type { Refresh } from '../routing/use_refresh'; - -export const mlTimefilterRefresh$ = new Subject(); diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/models_list.tsx b/x-pack/plugins/ml/public/application/trained_models/models_management/models_list.tsx index 6c665654bc92d..9fbd05d978eae 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/models_list.tsx +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/models_list.tsx @@ -26,10 +26,11 @@ import { EuiTableSelectionType } from '@elastic/eui/src/components/basic_table/t import { FIELD_FORMAT_IDS } from '@kbn/field-formats-plugin/common'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; import { usePageUrlState } from '@kbn/ml-url-state'; +import { useTimefilter } from '@kbn/ml-date-picker'; import { useModelActions } from './model_actions'; import { ModelsTableToConfigMapping } from '.'; import { ModelsBarStats, StatsBar } from '../../components/stats_bar'; -import { useMlKibana, useTimefilter } from '../../contexts/kibana'; +import { useMlKibana } from '../../contexts/kibana'; import { useTrainedModelsApiService } from '../../services/ml_api_service/trained_models'; import { ModelPipelines, diff --git a/x-pack/plugins/ml/tsconfig.json b/x-pack/plugins/ml/tsconfig.json index 717b5aee0b62f..79a3f15e4a2a1 100644 --- a/x-pack/plugins/ml/tsconfig.json +++ b/x-pack/plugins/ml/tsconfig.json @@ -72,6 +72,8 @@ "@kbn/ml-url-state", "@kbn/ml-nested-property", "@kbn/ml-local-storage", + "@kbn/ml-date-picker", "@kbn/ml-is-defined", - ] + "@kbn/ml-query-utils", + ], } diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 5814aed565840..8a4e39be28051 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -6596,7 +6596,6 @@ "xpack.aiops.index.dataLoader.internalServerErrorMessage": "Erreur lors du chargement des données dans l'index {index}. {message}. La requête a peut-être expiré. Essayez d'utiliser un échantillon d'une taille inférieure ou de réduire la plage temporelle.", "xpack.aiops.index.dataViewNotBasedOnTimeSeriesNotificationTitle": "La vue de données \"{dataViewTitle}\" n'est pas basée sur une série temporelle.", "xpack.aiops.index.errorLoadingDataMessage": "Erreur lors du chargement des données dans l'index {index}. {message}.", - "xpack.aiops.index.pageRefreshResetButton": "Définir sur {defaultInterval}", "xpack.aiops.progressTitle": "Progression : {progress} % — {progressMessage}", "xpack.aiops.searchPanel.totalDocCountLabel": "Total des documents : {strongTotalCount}", "xpack.aiops.searchPanel.totalDocCountNumber": "{totalCount, plural, other {#}}", @@ -6616,8 +6615,6 @@ "xpack.aiops.correlations.veryLowImpactText": "Très bas", "xpack.aiops.dataGrid.field.documentCountChart.seriesLabel": "compte du document", "xpack.aiops.dataGrid.field.documentCountChartSplit.seriesLabel": "Autre compte du document", - "xpack.aiops.datePicker.shortRefreshIntervalTimeFilterWarningMessage": "L’intervalle d'actualisation défini dans les paramètres avancés est plus court que le minimum pris en charge par Machine Learning.", - "xpack.aiops.datePicker.shortRefreshIntervalURLWarningMessage": "L’intervalle d'actualisation défini dans l'URL est plus court que le minimum pris en charge par Machine Learning.", "xpack.aiops.documentCountChart.baselineBadgeLabel": "Référence de base", "xpack.aiops.documentCountChart.deviationBadgeLabel": "général", "xpack.aiops.documentCountContent.clearSelectionAriaLabel": "Effacer la sélection", @@ -6648,15 +6645,7 @@ "xpack.aiops.explainLogRateSpikesPage.noResultsPromptBody": "Essayez d'ajuster la référence de base et les plages temporelles d'écart-type, et réexécutez l'analyse. Si vous n'obtenez toujours aucun résultat, il se peut qu'il n'y ait aucune entité statistiquement significative contribuant à ce pic dans les taux de log.", "xpack.aiops.explainLogRateSpikesPage.noResultsPromptTitle": "L'analyse n'a retourné aucun résultat.", "xpack.aiops.explainLogRateSpikesPage.tryToContinueAnalysisButtonText": "Essayer de continuer l'analyse", - "xpack.aiops.fullTimeRangeSelector.useFullDataExcludingFrozenButtonTooltip": "Utilisez toute la plage de données à l'exception du niveau de données frozen.", - "xpack.aiops.fullTimeRangeSelector.useFullDataIncludingFrozenButtonTooltip": "Utilisez toute la plage de données, y compris le niveau de données frozen, qui peut inclure des résultats de recherche plus lents.", "xpack.aiops.index.dataViewNotBasedOnTimeSeriesNotificationDescription": "L'analyse des pics de taux de log ne fonctionne que sur des index temporels.", - "xpack.aiops.index.fullTimeRangeSelector.errorSettingTimeRangeNotification": "Une erreur s'est produite lors de la définition de la plage temporelle.", - "xpack.aiops.index.fullTimeRangeSelector.moreOptionsButtonAriaLabel": "Plus d'options", - "xpack.aiops.index.fullTimeRangeSelector.noResults": "Aucun résultat ne correspond à vos critères de recherche.", - "xpack.aiops.index.fullTimeRangeSelector.useFullDataButtonLabel": "Utiliser toutes les données", - "xpack.aiops.index.fullTimeRangeSelector.useFullDataExcludingFrozenMenuLabel": "Exclure le niveau de données frozen", - "xpack.aiops.index.fullTimeRangeSelector.useFullDataIncludingFrozenMenuLabel": "Inclure le niveau de données frozen", "xpack.aiops.logCategorization.categoryFieldSelect": "Champ de catégorie", "xpack.aiops.logCategorization.chartPointsSplitLabel": "Catégorie sélectionnée", "xpack.aiops.logCategorization.column.count": "Décompte", @@ -6673,7 +6662,6 @@ "xpack.aiops.logCategorization.runButton": "Exécuter la catégorisation", "xpack.aiops.logCategorization.showInDiscover": "Les afficher dans Discover", "xpack.aiops.miniHistogram.noDataLabel": "S. O.", - "xpack.aiops.pageRefreshButton": "Actualiser", "xpack.aiops.progressAriaLabel": "Progression", "xpack.aiops.rerunAnalysisButtonTitle": "Relancer l’analyse", "xpack.aiops.rerunAnalysisTooltipContent": "Les données d'analyse sont peut-être obsolètes en raison de la mise à jour de la sélection. Relancez l'analyse.", @@ -10345,7 +10333,6 @@ "xpack.dataVisualizer.index.fieldStatisticsErrorMessage": "Erreur lors de l'obtention de statistiques pour le champ {fieldName}, car {reason}", "xpack.dataVisualizer.index.lensChart.averageOfLabel": "Moyenne de {fieldName}", "xpack.dataVisualizer.index.lensChart.chartTitle": "Lens pour {fieldName}", - "xpack.dataVisualizer.index.pageRefreshResetButton": "Définir sur {defaultInterval}", "xpack.dataVisualizer.index.savedSearchErrorMessage": "Erreur lors de la récupération de la recherche enregistrée {savedSearchId}", "xpack.dataVisualizer.nameCollisionMsg": "\"{name}\" existe déjà, veuillez fournir un nom unique", "xpack.dataVisualizer.randomSamplerSettingsPopUp.probabilityLabel": "Probabilité utilisée : {samplingProbability} %", @@ -10563,8 +10550,6 @@ "xpack.dataVisualizer.fileBeatConfig.paths": "ajouter ici un chemin vers vos fichiers", "xpack.dataVisualizer.fileBeatConfigFlyout.closeButton": "Fermer", "xpack.dataVisualizer.fileBeatConfigFlyout.copyButton": "Copier dans le presse-papiers", - "xpack.dataVisualizer.fullTimeRangeSelector.useFullDataExcludingFrozenButtonTooltip": "Utilisez toute la plage de données à l'exception du niveau de données frozen.", - "xpack.dataVisualizer.fullTimeRangeSelector.useFullDataIncludingFrozenButtonTooltip": "Utilisez toute la plage de données, y compris le niveau de données frozen, qui peut inclure des résultats de recherche plus lents.", "xpack.dataVisualizer.index.actionsPanel.discoverAppTitle": "Découverte", "xpack.dataVisualizer.index.actionsPanel.exploreTitle": "Explorer vos données", "xpack.dataVisualizer.index.actionsPanel.viewIndexInDiscoverDescription": "Explorez les documents de votre index.", @@ -10585,7 +10570,6 @@ "xpack.dataVisualizer.index.dataViewManagement.addFieldButton": "Ajouter un champ à la vue de données", "xpack.dataVisualizer.index.dataViewManagement.manageFieldButton": "Gérer les champs de la vue de données", "xpack.dataVisualizer.index.dataViewNotBasedOnTimeSeriesNotificationDescription": "La détection des anomalies ne s'exécute que sur des index temporels", - "xpack.dataVisualizer.index.datePicker.shortRefreshIntervalURLWarningMessage": "L’intervalle d'actualisation défini dans l'URL est plus court que le minimum pris en charge par Machine Learning.", "xpack.dataVisualizer.index.embeddableErrorDescription": "Une erreur s'est produite lors du chargement de l'incorporable. Veuillez vérifier si toutes les entrées requises sont valides.", "xpack.dataVisualizer.index.embeddableErrorTitle": "Erreur lors du chargement de l'incorporable", "xpack.dataVisualizer.index.embeddableNoResultsMessage": "Résultat introuvable", @@ -10609,15 +10593,8 @@ "xpack.dataVisualizer.index.fieldNameDescription.viewSupportedDateFormatsLinkText": "Affichez les formats de date pris en charge.", "xpack.dataVisualizer.index.fieldNameSelect": "Nom du champ", "xpack.dataVisualizer.index.fieldTypeSelect": "Type du champ", - "xpack.dataVisualizer.index.fullTimeRangeSelector.errorSettingTimeRangeNotification": "Une erreur s'est produite lors de la définition de la plage temporelle.", - "xpack.dataVisualizer.index.fullTimeRangeSelector.moreOptionsButtonAriaLabel": "Plus d'options", - "xpack.dataVisualizer.index.fullTimeRangeSelector.noResults": "Aucun résultat ne correspond à vos critères de recherche.", - "xpack.dataVisualizer.index.fullTimeRangeSelector.useFullDataButtonLabel": "Utiliser toutes les données", - "xpack.dataVisualizer.index.fullTimeRangeSelector.useFullDataExcludingFrozenMenuLabel": "Exclure le niveau de données frozen", - "xpack.dataVisualizer.index.fullTimeRangeSelector.useFullDataIncludingFrozenMenuLabel": "Inclure le niveau de données frozen", "xpack.dataVisualizer.index.lensChart.countLabel": "Décompte", "xpack.dataVisualizer.index.lensChart.topValuesLabel": "Valeurs les plus élevées", - "xpack.dataVisualizer.index.pageRefreshButton": "Actualiser", "xpack.dataVisualizer.multiSelectPicker.NoFiltersFoundMessage": "Aucun filtre trouvé", "xpack.dataVisualizer.randomSamplerPreference.offLabel": "Désactivé", "xpack.dataVisualizer.randomSamplerPreference.onAutomaticLabel": "Activé - automatique", @@ -20518,7 +20495,6 @@ "xpack.ml.overview.analyticsList.emptyPromptHelperText": "Avant de créer une tâche d'analyse du cadre de données, utilisez des {transforms} pour créer une {sourcedata}.", "xpack.ml.overview.feedbackSectionText": "Si vous avez un avis ou des suggestions concernant votre expérience, envoyez des {feedbackLink}.", "xpack.ml.overview.gettingStartedSectionText": "Bienvenue dans Machine Learning. Commencez en passant en revue nos {docs} ou en créant une nouvelle tâche.", - "xpack.ml.pageRefreshResetButton": "Définir sur {defaultInterval}", "xpack.ml.previewAlert.otherValuesLabel": "et {count, plural, one {# autre} other {# autres}}", "xpack.ml.previewAlert.previewMessage": "Trouvé {alertsCount, plural, one {# anomalie} other {# anomalies}} dans le dernier {interval}.", "xpack.ml.privilege.pleaseContactAdministratorTooltip": "{message} Veuillez contacter votre administrateur.", @@ -21534,12 +21510,6 @@ "xpack.ml.formatters.metricChangeDescription.unusuallyHighDescription": "Inhabituellement élevé", "xpack.ml.formatters.metricChangeDescription.unusuallyLowDescription": "Inhabituellement bas", "xpack.ml.formatters.metricChangeDescription.unusualValuesDescription": "Valeurs inhabituelles", - "xpack.ml.fullTimeRangeSelector.errorSettingTimeRangeNotification": "Une erreur s'est produite lors de la définition de la plage temporelle.", - "xpack.ml.fullTimeRangeSelector.useFullDataButtonLabel": "Utiliser toutes les données", - "xpack.ml.fullTimeRangeSelector.useFullDataExcludingFrozenButtonTooltip": "Utilisez toute la plage de données à l’exception du niveau de données frozen.", - "xpack.ml.fullTimeRangeSelector.useFullDataExcludingFrozenMenuLabel": "Exclure le niveau de données frozen", - "xpack.ml.fullTimeRangeSelector.useFullDataIncludingFrozenButtonTooltip": "Utilisez toute la plage de données, y compris le niveau de données frozen, qui peut inclure des résultats de recherche plus lents.", - "xpack.ml.fullTimeRangeSelector.useFullDataIncludingFrozenMenuLabel": "Inclure le niveau de données frozen", "xpack.ml.helpPopover.ariaLabel": "Aide", "xpack.ml.importExport.exportButton": "Exporter les tâches", "xpack.ml.importExport.exportFlyout.adDeselectAllButton": "Tout désélectionner", @@ -22471,7 +22441,6 @@ "xpack.ml.overviewJobsList.statsBar.failedJobsLabel": "Tâches échouées", "xpack.ml.overviewJobsList.statsBar.openJobsLabel": "Ouvrir les tâches", "xpack.ml.overviewJobsList.statsBar.totalJobsLabel": "Total de tâches", - "xpack.ml.pageRefreshButton": "Actualiser", "xpack.ml.plugin.title": "Machine Learning", "xpack.ml.previewAlert.actualLabel": "Réel :", "xpack.ml.previewAlert.hideResultsButtonLabel": "Masquer les résultats", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 8397db5eb35f1..560b2ebe137d3 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -6592,7 +6592,6 @@ "xpack.aiops.index.dataLoader.internalServerErrorMessage": "インデックス {index} のデータの読み込み中にエラーが発生。{message}。リクエストがタイムアウトした可能性があります。小さなサンプルサイズを使うか、時間範囲を狭めてみてください。", "xpack.aiops.index.dataViewNotBasedOnTimeSeriesNotificationTitle": "データビュー\"{dataViewTitle}\"は時系列に基づいていません。", "xpack.aiops.index.errorLoadingDataMessage": "インデックス {index} のデータの読み込み中にエラーが発生。{message}。", - "xpack.aiops.index.pageRefreshResetButton": "{defaultInterval}に設定", "xpack.aiops.progressTitle": "進行状況:{progress}% — {progressMessage}", "xpack.aiops.searchPanel.totalDocCountLabel": "合計ドキュメント数:{strongTotalCount}", "xpack.aiops.searchPanel.totalDocCountNumber": "{totalCount, plural, other {#}}", @@ -6612,8 +6611,6 @@ "xpack.aiops.correlations.veryLowImpactText": "非常に低い", "xpack.aiops.dataGrid.field.documentCountChart.seriesLabel": "ドキュメントカウント", "xpack.aiops.dataGrid.field.documentCountChartSplit.seriesLabel": "他のドキュメントカウント", - "xpack.aiops.datePicker.shortRefreshIntervalTimeFilterWarningMessage": "詳細設定の更新間隔が機械学習でサポートされている最小値よりも短くなっています。", - "xpack.aiops.datePicker.shortRefreshIntervalURLWarningMessage": "URLの更新間隔が機械学習でサポートされている最小値よりも短くなっています。", "xpack.aiops.documentCountChart.baselineBadgeLabel": "ベースライン", "xpack.aiops.documentCountChart.deviationBadgeLabel": "偏差", "xpack.aiops.documentCountContent.clearSelectionAriaLabel": "選択した項目をクリア", @@ -6644,15 +6641,7 @@ "xpack.aiops.explainLogRateSpikesPage.noResultsPromptBody": "ベースラインと時間範囲のずれを調整し、分析を再実行してください。結果が得られない場合は、このログレートの上昇に寄与する統計的に有意なエンティティが存在しない可能性があります。", "xpack.aiops.explainLogRateSpikesPage.noResultsPromptTitle": "分析の結果が返されませんでした。", "xpack.aiops.explainLogRateSpikesPage.tryToContinueAnalysisButtonText": "分析を続行してください", - "xpack.aiops.fullTimeRangeSelector.useFullDataExcludingFrozenButtonTooltip": "凍結されたデータティアを除くデータの全範囲を使用します。", - "xpack.aiops.fullTimeRangeSelector.useFullDataIncludingFrozenButtonTooltip": "凍結されたデータティアを含むデータの全範囲を使用します。これにより、検索結果が低速になる場合があります。", "xpack.aiops.index.dataViewNotBasedOnTimeSeriesNotificationDescription": "ログレートスパイクは、時間ベースのインデックスに対してのみ実行されます。", - "xpack.aiops.index.fullTimeRangeSelector.errorSettingTimeRangeNotification": "時間範囲の設定中にエラーが発生しました。", - "xpack.aiops.index.fullTimeRangeSelector.moreOptionsButtonAriaLabel": "その他のオプション", - "xpack.aiops.index.fullTimeRangeSelector.noResults": "検索条件と一致する結果がありません。", - "xpack.aiops.index.fullTimeRangeSelector.useFullDataButtonLabel": "完全なデータを使用", - "xpack.aiops.index.fullTimeRangeSelector.useFullDataExcludingFrozenMenuLabel": "凍結されたデータティアを除外", - "xpack.aiops.index.fullTimeRangeSelector.useFullDataIncludingFrozenMenuLabel": "凍結されたデータティアを含める", "xpack.aiops.logCategorization.categoryFieldSelect": "カテゴリーフィールド", "xpack.aiops.logCategorization.chartPointsSplitLabel": "選択したカテゴリー", "xpack.aiops.logCategorization.column.count": "カウント", @@ -6669,7 +6658,6 @@ "xpack.aiops.logCategorization.runButton": "カテゴリー分けの実行", "xpack.aiops.logCategorization.showInDiscover": "Discoverでこれらを表示", "xpack.aiops.miniHistogram.noDataLabel": "N/A", - "xpack.aiops.pageRefreshButton": "更新", "xpack.aiops.progressAriaLabel": "進捗", "xpack.aiops.rerunAnalysisButtonTitle": "分析を再実行", "xpack.aiops.rerunAnalysisTooltipContent": "選択更新のため、分析データが古い可能性があります。分析を再実行します。", @@ -10333,7 +10321,6 @@ "xpack.dataVisualizer.index.fieldStatisticsErrorMessage": "フィールド'{fieldName}'の統計情報の取得エラー:{reason}", "xpack.dataVisualizer.index.lensChart.averageOfLabel": "{fieldName}の平均", "xpack.dataVisualizer.index.lensChart.chartTitle": "{fieldName}のLens", - "xpack.dataVisualizer.index.pageRefreshResetButton": "{defaultInterval}に設定", "xpack.dataVisualizer.index.savedSearchErrorMessage": "保存された検索{savedSearchId}の取得エラー", "xpack.dataVisualizer.nameCollisionMsg": "「{name}」はすでに存在します。一意の名前を入力してください。", "xpack.dataVisualizer.randomSamplerSettingsPopUp.probabilityLabel": "使用された確率:{samplingProbability}%", @@ -10551,8 +10538,6 @@ "xpack.dataVisualizer.fileBeatConfig.paths": "ファイルのパスをここに追加してください", "xpack.dataVisualizer.fileBeatConfigFlyout.closeButton": "閉じる", "xpack.dataVisualizer.fileBeatConfigFlyout.copyButton": "クリップボードにコピー", - "xpack.dataVisualizer.fullTimeRangeSelector.useFullDataExcludingFrozenButtonTooltip": "凍結されたデータティアを除くデータの全範囲を使用します。", - "xpack.dataVisualizer.fullTimeRangeSelector.useFullDataIncludingFrozenButtonTooltip": "凍結されたデータティアを含むデータの全範囲を使用します。これにより、検索結果が低速になる場合があります。", "xpack.dataVisualizer.index.actionsPanel.discoverAppTitle": "Discover", "xpack.dataVisualizer.index.actionsPanel.exploreTitle": "データの調査", "xpack.dataVisualizer.index.actionsPanel.viewIndexInDiscoverDescription": "インデックスのドキュメントを調査します。", @@ -10573,7 +10558,6 @@ "xpack.dataVisualizer.index.dataViewManagement.addFieldButton": "フィールドをデータビューに追加", "xpack.dataVisualizer.index.dataViewManagement.manageFieldButton": "データビューフィールドを管理", "xpack.dataVisualizer.index.dataViewNotBasedOnTimeSeriesNotificationDescription": "異常検知は時間ベースのインデックスでのみ実行されます", - "xpack.dataVisualizer.index.datePicker.shortRefreshIntervalURLWarningMessage": "URLの更新間隔が機械学習でサポートされている最小値よりも短くなっています。", "xpack.dataVisualizer.index.embeddableErrorDescription": "埋め込み可能オブジェクトの読み込みエラーが発生しました。すべての必須入力が有効であるかどうかを確認してください。", "xpack.dataVisualizer.index.embeddableErrorTitle": "埋め込み可能オブジェクトの読み込みエラー", "xpack.dataVisualizer.index.embeddableNoResultsMessage": "結果が見つかりませんでした", @@ -10597,15 +10581,8 @@ "xpack.dataVisualizer.index.fieldNameDescription.viewSupportedDateFormatsLinkText": "サポートされている日付形式を表示します。", "xpack.dataVisualizer.index.fieldNameSelect": "フィールド名", "xpack.dataVisualizer.index.fieldTypeSelect": "フィールド型", - "xpack.dataVisualizer.index.fullTimeRangeSelector.errorSettingTimeRangeNotification": "時間範囲の設定中にエラーが発生しました。", - "xpack.dataVisualizer.index.fullTimeRangeSelector.moreOptionsButtonAriaLabel": "その他のオプション", - "xpack.dataVisualizer.index.fullTimeRangeSelector.noResults": "検索条件と一致する結果がありません。", - "xpack.dataVisualizer.index.fullTimeRangeSelector.useFullDataButtonLabel": "完全なデータを使用", - "xpack.dataVisualizer.index.fullTimeRangeSelector.useFullDataExcludingFrozenMenuLabel": "凍結されたデータティアを除外", - "xpack.dataVisualizer.index.fullTimeRangeSelector.useFullDataIncludingFrozenMenuLabel": "凍結されたデータティアを含める", "xpack.dataVisualizer.index.lensChart.countLabel": "カウント", "xpack.dataVisualizer.index.lensChart.topValuesLabel": "トップの値", - "xpack.dataVisualizer.index.pageRefreshButton": "更新", "xpack.dataVisualizer.multiSelectPicker.NoFiltersFoundMessage": "フィルターが見つかりません", "xpack.dataVisualizer.randomSamplerPreference.offLabel": "オフ", "xpack.dataVisualizer.randomSamplerPreference.onAutomaticLabel": "オン - 自動", @@ -20501,7 +20478,6 @@ "xpack.ml.overview.analyticsList.emptyPromptHelperText": "データフレーム分析ジョブを構築する前に、{transforms}を使用して{sourcedata}を作成してください。", "xpack.ml.overview.feedbackSectionText": "ご利用に際し、ご意見やご提案がありましたら、{feedbackLink}までお送りください。", "xpack.ml.overview.gettingStartedSectionText": "機械学習へようこそ。はじめに{docs}をご覧になるか、新しいジョブを作成してください。", - "xpack.ml.pageRefreshResetButton": "{defaultInterval}に設定", "xpack.ml.previewAlert.otherValuesLabel": "および{count, plural, other {#その他}}", "xpack.ml.previewAlert.previewMessage": "過去{interval}に{alertsCount, plural, other {# 件の異常}}が見つかりました。", "xpack.ml.privilege.pleaseContactAdministratorTooltip": "{message} 管理者にお問い合わせください。", @@ -21515,12 +21491,6 @@ "xpack.ml.formatters.metricChangeDescription.unusuallyHighDescription": "異常に高い", "xpack.ml.formatters.metricChangeDescription.unusuallyLowDescription": "異常に低い", "xpack.ml.formatters.metricChangeDescription.unusualValuesDescription": "異常な値", - "xpack.ml.fullTimeRangeSelector.errorSettingTimeRangeNotification": "時間範囲の設定中にエラーが発生しました。", - "xpack.ml.fullTimeRangeSelector.useFullDataButtonLabel": "完全なデータを使用", - "xpack.ml.fullTimeRangeSelector.useFullDataExcludingFrozenButtonTooltip": "凍結されたデータティアを除くデータの全範囲を使用します。", - "xpack.ml.fullTimeRangeSelector.useFullDataExcludingFrozenMenuLabel": "凍結されたデータティアを除外", - "xpack.ml.fullTimeRangeSelector.useFullDataIncludingFrozenButtonTooltip": "凍結されたデータティアを含むデータの全範囲を使用します。これにより、検索結果が低速になる場合があります。", - "xpack.ml.fullTimeRangeSelector.useFullDataIncludingFrozenMenuLabel": "凍結されたデータティアを含める", "xpack.ml.helpPopover.ariaLabel": "ヘルプ", "xpack.ml.importExport.exportButton": "ジョブのエクスポート", "xpack.ml.importExport.exportFlyout.adDeselectAllButton": "すべて選択解除", @@ -22452,7 +22422,6 @@ "xpack.ml.overviewJobsList.statsBar.failedJobsLabel": "失敗したジョブ", "xpack.ml.overviewJobsList.statsBar.openJobsLabel": "ジョブを開く", "xpack.ml.overviewJobsList.statsBar.totalJobsLabel": "合計ジョブ数", - "xpack.ml.pageRefreshButton": "更新", "xpack.ml.plugin.title": "機械学習", "xpack.ml.previewAlert.actualLabel": "実際:", "xpack.ml.previewAlert.hideResultsButtonLabel": "結果を非表示", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 91306cadfb9b3..9fb0e0938b047 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -6599,7 +6599,6 @@ "xpack.aiops.index.dataLoader.internalServerErrorMessage": "加载索引 {index} 中的数据时出错。{message}。请求可能已超时。请尝试使用较小的样例大小或缩小时间范围。", "xpack.aiops.index.dataViewNotBasedOnTimeSeriesNotificationTitle": "数据视图“{dataViewTitle}”并非基于时间序列。", "xpack.aiops.index.errorLoadingDataMessage": "加载索引 {index} 中的数据时出错。{message}。", - "xpack.aiops.index.pageRefreshResetButton": "设置为 {defaultInterval}", "xpack.aiops.progressTitle": "进度:{progress}% — {progressMessage}", "xpack.aiops.searchPanel.totalDocCountLabel": "文档总数:{strongTotalCount}", "xpack.aiops.searchPanel.totalDocCountNumber": "{totalCount, plural, other {#}}", @@ -6619,8 +6618,6 @@ "xpack.aiops.correlations.veryLowImpactText": "极低", "xpack.aiops.dataGrid.field.documentCountChart.seriesLabel": "文档计数", "xpack.aiops.dataGrid.field.documentCountChartSplit.seriesLabel": "其他文档计数", - "xpack.aiops.datePicker.shortRefreshIntervalTimeFilterWarningMessage": "高级设置中的刷新时间间隔比 Machine Learning 支持的最小时间间隔更短。", - "xpack.aiops.datePicker.shortRefreshIntervalURLWarningMessage": "URL 中的刷新时间间隔比 Machine Learning 支持的最小时间间隔更短。", "xpack.aiops.documentCountChart.baselineBadgeLabel": "基线", "xpack.aiops.documentCountChart.deviationBadgeLabel": "偏差", "xpack.aiops.documentCountContent.clearSelectionAriaLabel": "清除所选内容", @@ -6651,15 +6648,7 @@ "xpack.aiops.explainLogRateSpikesPage.noResultsPromptBody": "尝试调整基线和偏差时间范围,然后重新运行分析。如果仍然没有结果,可能没有具有统计意义的实体导致了该日志速率峰值。", "xpack.aiops.explainLogRateSpikesPage.noResultsPromptTitle": "分析未返回任何结果。", "xpack.aiops.explainLogRateSpikesPage.tryToContinueAnalysisButtonText": "尝试继续分析", - "xpack.aiops.fullTimeRangeSelector.useFullDataExcludingFrozenButtonTooltip": "使用全范围数据,不包括冻结的数据层。", - "xpack.aiops.fullTimeRangeSelector.useFullDataIncludingFrozenButtonTooltip": "使用全范围数据,包括冻结的数据层,这可能会使搜索结果变慢。", "xpack.aiops.index.dataViewNotBasedOnTimeSeriesNotificationDescription": "日志速率峰值分析仅在基于时间的索引上运行。", - "xpack.aiops.index.fullTimeRangeSelector.errorSettingTimeRangeNotification": "设置时间范围时出错。", - "xpack.aiops.index.fullTimeRangeSelector.moreOptionsButtonAriaLabel": "更多选项", - "xpack.aiops.index.fullTimeRangeSelector.noResults": "没有任何结果匹配您的搜索条件", - "xpack.aiops.index.fullTimeRangeSelector.useFullDataButtonLabel": "使用完整的数据", - "xpack.aiops.index.fullTimeRangeSelector.useFullDataExcludingFrozenMenuLabel": "排除冻结的数据层", - "xpack.aiops.index.fullTimeRangeSelector.useFullDataIncludingFrozenMenuLabel": "包括冻结的数据层", "xpack.aiops.logCategorization.categoryFieldSelect": "类别字段", "xpack.aiops.logCategorization.chartPointsSplitLabel": "选定的类别", "xpack.aiops.logCategorization.column.count": "计数", @@ -6676,7 +6665,6 @@ "xpack.aiops.logCategorization.runButton": "运行归类", "xpack.aiops.logCategorization.showInDiscover": "在 Discover 中显示这些项", "xpack.aiops.miniHistogram.noDataLabel": "不可用", - "xpack.aiops.pageRefreshButton": "刷新", "xpack.aiops.progressAriaLabel": "进度", "xpack.aiops.rerunAnalysisButtonTitle": "重新运行分析", "xpack.aiops.rerunAnalysisTooltipContent": "由于选择内容更新,分析数据可能已过时。重新运行分析。", @@ -10349,7 +10337,6 @@ "xpack.dataVisualizer.index.fieldStatisticsErrorMessage": "由于 {reason},获取字段“{fieldName}”的统计信息时出错", "xpack.dataVisualizer.index.lensChart.averageOfLabel": "{fieldName} 的平均值", "xpack.dataVisualizer.index.lensChart.chartTitle": "{fieldName} 的 Lens", - "xpack.dataVisualizer.index.pageRefreshResetButton": "设置为 {defaultInterval}", "xpack.dataVisualizer.index.savedSearchErrorMessage": "检索已保存搜索 {savedSearchId} 时出错", "xpack.dataVisualizer.nameCollisionMsg": "“{name}”已存在,请提供唯一名称", "xpack.dataVisualizer.randomSamplerSettingsPopUp.probabilityLabel": "使用的概率:{samplingProbability}%", @@ -10567,8 +10554,6 @@ "xpack.dataVisualizer.fileBeatConfig.paths": "在此处将路径添加您的文件中", "xpack.dataVisualizer.fileBeatConfigFlyout.closeButton": "关闭", "xpack.dataVisualizer.fileBeatConfigFlyout.copyButton": "复制到剪贴板", - "xpack.dataVisualizer.fullTimeRangeSelector.useFullDataExcludingFrozenButtonTooltip": "使用全范围数据,不包括冻结的数据层。", - "xpack.dataVisualizer.fullTimeRangeSelector.useFullDataIncludingFrozenButtonTooltip": "使用全范围数据,包括冻结的数据层,这可能会使搜索结果变慢。", "xpack.dataVisualizer.index.actionsPanel.discoverAppTitle": "Discover", "xpack.dataVisualizer.index.actionsPanel.exploreTitle": "浏览您的数据", "xpack.dataVisualizer.index.actionsPanel.viewIndexInDiscoverDescription": "浏览您的索引中的文档。", @@ -10589,7 +10574,6 @@ "xpack.dataVisualizer.index.dataViewManagement.addFieldButton": "将字段添加到数据视图", "xpack.dataVisualizer.index.dataViewManagement.manageFieldButton": "管理数据视图字段", "xpack.dataVisualizer.index.dataViewNotBasedOnTimeSeriesNotificationDescription": "仅针对基于时间的索引运行异常检测", - "xpack.dataVisualizer.index.datePicker.shortRefreshIntervalURLWarningMessage": "URL 中的刷新时间间隔比 Machine Learning 支持的最小时间间隔更短。", "xpack.dataVisualizer.index.embeddableErrorDescription": "加载可嵌入对象时出现错误。请检查所有必需的输入是否有效。", "xpack.dataVisualizer.index.embeddableErrorTitle": "加载可嵌入对象时出错", "xpack.dataVisualizer.index.embeddableNoResultsMessage": "找不到结果", @@ -10613,15 +10597,8 @@ "xpack.dataVisualizer.index.fieldNameDescription.viewSupportedDateFormatsLinkText": "查看支持的日期格式。", "xpack.dataVisualizer.index.fieldNameSelect": "字段名称", "xpack.dataVisualizer.index.fieldTypeSelect": "字段类型", - "xpack.dataVisualizer.index.fullTimeRangeSelector.errorSettingTimeRangeNotification": "设置时间范围时出错。", - "xpack.dataVisualizer.index.fullTimeRangeSelector.moreOptionsButtonAriaLabel": "更多选项", - "xpack.dataVisualizer.index.fullTimeRangeSelector.noResults": "没有任何结果匹配您的搜索条件", - "xpack.dataVisualizer.index.fullTimeRangeSelector.useFullDataButtonLabel": "使用完整的数据", - "xpack.dataVisualizer.index.fullTimeRangeSelector.useFullDataExcludingFrozenMenuLabel": "排除冻结的数据层", - "xpack.dataVisualizer.index.fullTimeRangeSelector.useFullDataIncludingFrozenMenuLabel": "包括冻结的数据层", "xpack.dataVisualizer.index.lensChart.countLabel": "计数", "xpack.dataVisualizer.index.lensChart.topValuesLabel": "排名最前值", - "xpack.dataVisualizer.index.pageRefreshButton": "刷新", "xpack.dataVisualizer.multiSelectPicker.NoFiltersFoundMessage": "未找到任何筛选", "xpack.dataVisualizer.randomSamplerPreference.offLabel": "关闭", "xpack.dataVisualizer.randomSamplerPreference.onAutomaticLabel": "开 - 自动", @@ -20528,7 +20505,6 @@ "xpack.ml.overview.analyticsList.emptyPromptHelperText": "构建数据帧分析作业之前,请使用 {transforms} 构造一个 {sourcedata}。", "xpack.ml.overview.feedbackSectionText": "如果您在体验方面有任何意见或建议,请提交{feedbackLink}。", "xpack.ml.overview.gettingStartedSectionText": "欢迎使用 Machine Learning。首先查看我们的{docs}或创建新作业。", - "xpack.ml.pageRefreshResetButton": "设置为 {defaultInterval}", "xpack.ml.previewAlert.otherValuesLabel": "及另外 {count, plural, other {# 个}}", "xpack.ml.previewAlert.previewMessage": "在过去 {interval} 找到 {alertsCount, plural, other {# 个异常}}。", "xpack.ml.privilege.pleaseContactAdministratorTooltip": "{message}请联系您的管理员。", @@ -21544,12 +21520,6 @@ "xpack.ml.formatters.metricChangeDescription.unusuallyHighDescription": "异常高", "xpack.ml.formatters.metricChangeDescription.unusuallyLowDescription": "异常低", "xpack.ml.formatters.metricChangeDescription.unusualValuesDescription": "异常值", - "xpack.ml.fullTimeRangeSelector.errorSettingTimeRangeNotification": "设置时间范围时出错。", - "xpack.ml.fullTimeRangeSelector.useFullDataButtonLabel": "使用完整的数据", - "xpack.ml.fullTimeRangeSelector.useFullDataExcludingFrozenButtonTooltip": "使用全范围数据,不包括冻结的数据层。", - "xpack.ml.fullTimeRangeSelector.useFullDataExcludingFrozenMenuLabel": "排除冻结的数据层", - "xpack.ml.fullTimeRangeSelector.useFullDataIncludingFrozenButtonTooltip": "使用全范围数据,包括冻结的数据层,这可能会使搜索结果变慢。", - "xpack.ml.fullTimeRangeSelector.useFullDataIncludingFrozenMenuLabel": "包括冻结的数据层", "xpack.ml.helpPopover.ariaLabel": "帮助", "xpack.ml.importExport.exportButton": "导出作业", "xpack.ml.importExport.exportFlyout.adDeselectAllButton": "取消全选", @@ -22481,7 +22451,6 @@ "xpack.ml.overviewJobsList.statsBar.failedJobsLabel": "失败的作业", "xpack.ml.overviewJobsList.statsBar.openJobsLabel": "打开的作业", "xpack.ml.overviewJobsList.statsBar.totalJobsLabel": "总计作业数", - "xpack.ml.pageRefreshButton": "刷新", "xpack.ml.plugin.title": "Machine Learning", "xpack.ml.previewAlert.actualLabel": "实际:", "xpack.ml.previewAlert.hideResultsButtonLabel": "隐藏结果", diff --git a/x-pack/test/functional/services/aiops/explain_log_rate_spikes_page.ts b/x-pack/test/functional/services/aiops/explain_log_rate_spikes_page.ts index ae768dd33163a..8c46af2076db0 100644 --- a/x-pack/test/functional/services/aiops/explain_log_rate_spikes_page.ts +++ b/x-pack/test/functional/services/aiops/explain_log_rate_spikes_page.ts @@ -32,9 +32,7 @@ export function ExplainLogRateSpikesPageProvider({ getService }: FtrProviderCont async clickUseFullDataButton(expectedFormattedTotalDocCount: string) { await retry.tryForTime(30 * 1000, async () => { - await testSubjects.clickWhenNotDisabledWithoutRetry( - 'aiopsExplainLogRatesSpikeButtonUseFullData' - ); + await testSubjects.clickWhenNotDisabledWithoutRetry('mlDatePickerButtonUseFullData'); await testSubjects.clickWhenNotDisabledWithoutRetry('superDatePickerApplyTimeButton'); await this.assertTotalDocumentCount(expectedFormattedTotalDocCount); }); diff --git a/x-pack/test/functional/services/ml/common_ui.ts b/x-pack/test/functional/services/ml/common_ui.ts index 138450e56a426..b60c4fef427d6 100644 --- a/x-pack/test/functional/services/ml/common_ui.ts +++ b/x-pack/test/functional/services/ml/common_ui.ts @@ -344,7 +344,7 @@ export function MachineLearningCommonUIProvider({ }, async waitForRefreshButtonEnabled() { - await testSubjects.waitForEnabled('~mlRefreshPageButton'); + await testSubjects.waitForEnabled('~mlDatePickerRefreshPageButton'); }, async assertOneOfExists(subjectsToCheck: string[], timeout: number = 0) { diff --git a/x-pack/test/functional/services/ml/data_frame_analytics_table.ts b/x-pack/test/functional/services/ml/data_frame_analytics_table.ts index 2dcd26caac193..ab33da324207d 100644 --- a/x-pack/test/functional/services/ml/data_frame_analytics_table.ts +++ b/x-pack/test/functional/services/ml/data_frame_analytics_table.ts @@ -128,7 +128,7 @@ export function MachineLearningDataFrameAnalyticsTableProvider({ ) { const testSubjStr = tableEnvironment === 'mlDataFrameAnalytics' - ? 'mlRefreshPageButton' + ? 'mlDatePickerRefreshPageButton' : 'mlAnalyticsRefreshListButton'; await this.waitForRefreshButtonLoaded(testSubjStr); await testSubjects.click(`~${testSubjStr}`); @@ -212,7 +212,7 @@ export function MachineLearningDataFrameAnalyticsTableProvider({ public async assertAnalyticsJobDisplayedInTable( analyticsId: string, shouldBeDisplayed: boolean, - refreshButtonTestSubj = 'mlRefreshPageButton' + refreshButtonTestSubj = 'mlDatePickerRefreshPageButton' ) { await this.waitForRefreshButtonLoaded(refreshButtonTestSubj); await testSubjects.click(`~${refreshButtonTestSubj}`); diff --git a/x-pack/test/functional/services/ml/data_visualizer_index_based.ts b/x-pack/test/functional/services/ml/data_visualizer_index_based.ts index 7014d6d0f7f40..e46108373d450 100644 --- a/x-pack/test/functional/services/ml/data_visualizer_index_based.ts +++ b/x-pack/test/functional/services/ml/data_visualizer_index_based.ts @@ -44,7 +44,7 @@ export function MachineLearningDataVisualizerIndexBasedProvider({ randomSamplerOption: RandomSamplerOption = 'dvRandomSamplerOptionOff' ) { await retry.tryForTime(30 * 1000, async () => { - await testSubjects.clickWhenNotDisabledWithoutRetry('dataVisualizerButtonUseFullData'); + await testSubjects.clickWhenNotDisabledWithoutRetry('mlDatePickerButtonUseFullData'); await testSubjects.clickWhenNotDisabledWithoutRetry('superDatePickerApplyTimeButton'); await this.setRandomSamplingOption(randomSamplerOption); await await this.assertTotalDocumentCount(expectedFormattedTotalDocCount); diff --git a/x-pack/test/functional/services/ml/job_table.ts b/x-pack/test/functional/services/ml/job_table.ts index 892cf539b3afb..5257ad80dda94 100644 --- a/x-pack/test/functional/services/ml/job_table.ts +++ b/x-pack/test/functional/services/ml/job_table.ts @@ -230,7 +230,7 @@ export function MachineLearningJobTableProvider( ) { const testSubjStr = tableEnvironment === 'mlAnomalyDetection' - ? 'mlRefreshPageButton' + ? 'mlDatePickerRefreshPageButton' : 'mlRefreshJobListButton'; await this.waitForRefreshButtonLoaded(testSubjStr); diff --git a/x-pack/test/functional/services/ml/job_wizard_common.ts b/x-pack/test/functional/services/ml/job_wizard_common.ts index 86375122a4a1a..13b941633be10 100644 --- a/x-pack/test/functional/services/ml/job_wizard_common.ts +++ b/x-pack/test/functional/services/ml/job_wizard_common.ts @@ -492,7 +492,7 @@ export function MachineLearningJobWizardCommonProvider( }, async clickUseFullDataButton(expectedStartDate: string, expectedEndDate: string) { - await testSubjects.clickWhenNotDisabledWithoutRetry('mlButtonUseFullData'); + await testSubjects.clickWhenNotDisabledWithoutRetry('mlDatePickerButtonUseFullData'); await this.assertDateRangeSelection(expectedStartDate, expectedEndDate); }, diff --git a/x-pack/test/functional/services/ml/trained_models_table.ts b/x-pack/test/functional/services/ml/trained_models_table.ts index 8179dc7a5986b..c0e323df3d54d 100644 --- a/x-pack/test/functional/services/ml/trained_models_table.ts +++ b/x-pack/test/functional/services/ml/trained_models_table.ts @@ -81,13 +81,15 @@ export function TrainedModelsTableProvider( } public async waitForRefreshButtonLoaded() { - await testSubjects.existOrFail('~mlRefreshPageButton', { timeout: 10 * 1000 }); - await testSubjects.existOrFail('mlRefreshPageButton loaded', { timeout: 30 * 1000 }); + await testSubjects.existOrFail('~mlDatePickerRefreshPageButton', { timeout: 10 * 1000 }); + await testSubjects.existOrFail('mlDatePickerRefreshPageButton loaded', { + timeout: 30 * 1000, + }); } public async refreshModelsTable() { await this.waitForRefreshButtonLoaded(); - await testSubjects.click('~mlRefreshPageButton'); + await testSubjects.click('~mlDatePickerRefreshPageButton'); await this.waitForRefreshButtonLoaded(); await this.waitForModelsToLoad(); } diff --git a/yarn.lock b/yarn.lock index df194baa6095c..f15482e086ee8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3809,6 +3809,10 @@ version "0.0.0" uid "" +"@kbn/ml-date-picker@link:x-pack/packages/ml/date_picker": + version "0.0.0" + uid "" + "@kbn/ml-is-defined@link:x-pack/packages/ml/is_defined": version "0.0.0" uid "" @@ -3825,6 +3829,10 @@ version "0.0.0" uid "" +"@kbn/ml-query-utils@link:x-pack/packages/ml/query_utils": + version "0.0.0" + uid "" + "@kbn/ml-string-hash@link:x-pack/packages/ml/string_hash": version "0.0.0" uid "" From f01a61b81ab0a4756dfe40233aa61a196aa64dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Thu, 12 Jan 2023 12:04:05 +0100 Subject: [PATCH 10/39] [Logs UI] Prevent summary request from piling up (#148670) Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../logs/log_summary/log_summary.test.tsx | 37 +++++++++- .../logs/log_summary/log_summary.tsx | 72 +++++++++++-------- .../infra/public/utils/use_observable.ts | 33 ++++++++- 3 files changed, 108 insertions(+), 34 deletions(-) diff --git a/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.test.tsx b/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.test.tsx index 138d9c3d174cf..25e02101984f4 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.test.tsx +++ b/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.test.tsx @@ -19,9 +19,12 @@ import { datemathToEpochMillis } from '../../../utils/datemath'; jest.mock('./api/fetch_log_summary', () => ({ fetchLogSummary: jest.fn() })); const fetchLogSummaryMock = fetchLogSummary as jest.MockedFunction; -jest.mock('../../../hooks/use_kibana', () => ({ - useKibanaContextForPlugin: () => ({ services: mockCoreMock.createStart() }), -})); +jest.mock('../../../hooks/use_kibana', () => { + const services = mockCoreMock.createStart(); + return { + useKibanaContextForPlugin: () => ({ services }), + }; +}); describe('useLogSummary hook', () => { beforeEach(() => { @@ -161,6 +164,34 @@ describe('useLogSummary hook', () => { expect.anything() ); }); + + it("doesn't query for new summary buckets when the previous request is still in flight", async () => { + fetchLogSummaryMock.mockResolvedValueOnce(createMockResponse([])); + + const firstRange = createMockDateRange(); + const { waitForNextUpdate, rerender } = renderHook( + ({ startTimestamp, endTimestamp }) => + useLogSummary('SOURCE_ID', startTimestamp, endTimestamp, null), + { + initialProps: firstRange, + } + ); + + const secondRange = createMockDateRange('now-20s', 'now'); + + // intentionally don't wait for an update to test the throttling + rerender(secondRange); + await waitForNextUpdate(); + + expect(fetchLogSummaryMock).toHaveBeenCalledTimes(1); + expect(fetchLogSummaryMock).toHaveBeenLastCalledWith( + expect.objectContaining({ + startTimestamp: firstRange.startTimestamp, + endTimestamp: firstRange.endTimestamp, + }), + expect.anything() + ); + }); }); const createMockResponse = ( diff --git a/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.tsx b/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.tsx index cb12b2a987bef..b3e7f8235ace7 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.tsx +++ b/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.tsx @@ -5,11 +5,12 @@ * 2.0. */ -import { useState } from 'react'; - -import { useCancellableEffect } from '../../../utils/cancellable_effect'; +import { useEffect } from 'react'; +import { exhaustMap, map, Observable } from 'rxjs'; +import { HttpHandler } from '@kbn/core-http-browser'; +import { useObservableState, useReplaySubject } from '../../../utils/use_observable'; import { fetchLogSummary } from './api/fetch_log_summary'; -import { LogEntriesSummaryResponse } from '../../../../common/http_api'; +import { LogEntriesSummaryRequest, LogEntriesSummaryResponse } from '../../../../common/http_api'; import { useBucketSize } from './bucket_size'; import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; @@ -22,32 +23,35 @@ export const useLogSummary = ( filterQuery: string | null ) => { const { services } = useKibanaContextForPlugin(); - const [logSummaryBuckets, setLogSummaryBuckets] = useState([]); const bucketSize = useBucketSize(startTimestamp, endTimestamp); - useCancellableEffect( - (getIsCancelled) => { - if (startTimestamp === null || endTimestamp === null || bucketSize === null) { - return; - } - - fetchLogSummary( - { - sourceId, - startTimestamp, - endTimestamp, - bucketSize, - query: filterQuery, - }, - services.http.fetch - ).then((response) => { - if (!getIsCancelled()) { - setLogSummaryBuckets(response.data.buckets); - } - }); - }, - [sourceId, filterQuery, startTimestamp, endTimestamp, bucketSize] - ); + const [logSummaryBuckets$, pushLogSummaryBucketsArgs] = useReplaySubject(fetchLogSummary$); + const { latestValue: logSummaryBuckets } = useObservableState(logSummaryBuckets$, NO_BUCKETS); + + useEffect(() => { + if (startTimestamp === null || endTimestamp === null || bucketSize === null) { + return; + } + + pushLogSummaryBucketsArgs([ + { + sourceId, + startTimestamp, + endTimestamp, + bucketSize, + query: filterQuery, + }, + services.http.fetch, + ]); + }, [ + bucketSize, + endTimestamp, + filterQuery, + pushLogSummaryBucketsArgs, + services.http.fetch, + sourceId, + startTimestamp, + ]); return { buckets: logSummaryBuckets, @@ -55,3 +59,15 @@ export const useLogSummary = ( end: endTimestamp, }; }; + +const NO_BUCKETS: LogSummaryBuckets = []; + +type FetchLogSummaryArgs = [args: LogEntriesSummaryRequest, fetch: HttpHandler]; + +const fetchLogSummary$ = ( + fetchArguments$: Observable +): Observable => + fetchArguments$.pipe( + exhaustMap(([args, fetch]) => fetchLogSummary(args, fetch)), + map(({ data: { buckets } }) => buckets) + ); diff --git a/x-pack/plugins/infra/public/utils/use_observable.ts b/x-pack/plugins/infra/public/utils/use_observable.ts index dd89e1ce17edd..00efc4900b82f 100644 --- a/x-pack/plugins/infra/public/utils/use_observable.ts +++ b/x-pack/plugins/infra/public/utils/use_observable.ts @@ -6,7 +6,14 @@ */ import { useEffect, useRef, useState } from 'react'; -import { BehaviorSubject, Observable, OperatorFunction, PartialObserver, Subscription } from 'rxjs'; +import { + BehaviorSubject, + Observable, + OperatorFunction, + PartialObserver, + ReplaySubject, + Subscription, +} from 'rxjs'; import { switchMap } from 'rxjs/operators'; export const useLatest = (value: Value) => { @@ -42,9 +49,29 @@ export const useBehaviorSubject = < deriveObservableOnce: (input$: Observable) => OutputObservable, createInitialValue: () => InputValue ) => { - const [subject$] = useState(() => new BehaviorSubject(createInitialValue())); + const [[subject$, next], _] = useState(() => { + const newSubject$ = new BehaviorSubject(createInitialValue()); + const newNext = newSubject$.next.bind(newSubject$); + return [newSubject$, newNext] as const; + }); + const [output$] = useState(() => deriveObservableOnce(subject$)); + return [output$, next] as const; +}; + +export const useReplaySubject = < + InputValue, + OutputValue, + OutputObservable extends Observable +>( + deriveObservableOnce: (input$: Observable) => OutputObservable +) => { + const [[subject$, next], _] = useState(() => { + const newSubject$ = new ReplaySubject(); + const newNext = newSubject$.next.bind(newSubject$); + return [newSubject$, newNext] as const; + }); const [output$] = useState(() => deriveObservableOnce(subject$)); - return [output$, subject$.next.bind(subject$)] as const; + return [output$, next] as const; }; export const useObservableState = ( From 1df7a647e0eb20d137496977ae43383725348355 Mon Sep 17 00:00:00 2001 From: Sergi Massaneda Date: Thu, 12 Jan 2023 12:12:53 +0100 Subject: [PATCH 11/39] [Tines] Add story library link to the documentation (#148782) ## Summary This change comes from a suggestion by the Tines team. The link to the Elastic stories in the Tines story library has been added ![tines docs](https://user-images.githubusercontent.com/17747913/212025082-045f1754-4bb6-47c6-9a81-4857963660fe.png) --- docs/management/connectors/action-types/tines.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/management/connectors/action-types/tines.asciidoc b/docs/management/connectors/action-types/tines.asciidoc index ff98cd6c50ecb..70a36c070b041 100644 --- a/docs/management/connectors/action-types/tines.asciidoc +++ b/docs/management/connectors/action-types/tines.asciidoc @@ -87,7 +87,7 @@ image::management/connectors/images/tines-webhook-url-fallback.png[Tines Webhook === Tines story library In order to simplify the integration with Elastic, Tines offers a set of pre-defined Elastic stories in the Story library. -They can be found by searching for "Elastic" in the Tines Story library: +They can be found by searching for "Elastic" in the https://www.tines.com/story-library?s=elastic[Tines Story library]: [role="screenshot"] image::management/connectors/images/tines_elastic_stories.png[Tines Elastic stories] From 0afaa99aae021144b37556019d76bb550e62055d Mon Sep 17 00:00:00 2001 From: Vitalii Dmyterko <92328789+vitaliidm@users.noreply.github.com> Date: Thu, 12 Jan 2023 11:32:53 +0000 Subject: [PATCH 12/39] [Security Solution][Alerts] strips ECS non compliant fields from alert source (#147628) ## Summary - adresses https://github.com/elastic/kibana/issues/146848 - added validation of following types - numeric types: `float`, `long`, `scaled_float`. There was not added complex validation according to https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html. Only check for spaces in `long` type, in which case Elasticsearch fails indexing. But we can consider adding it later if we think it can be beneficial - `ip` - validates IPv4 & IPv6 using ipaddr library - `date` - validates [default date format](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html#strict-date-time) - `object`/`flattened` - if any of source fields type is not object when it should be - skipped validation of - `geo_point` - as it very complex type and we don't want to remove a valid value - any removed values will be logged by `ruleExecutionerLogger` ### Checklist Delete any items that are not applicable to this PR. - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Marshall Main <55718608+marshallmain@users.noreply.github.com> --- .../create_security_rule_type_wrapper.ts | 3 +- .../build_alert_group_from_sequence.test.ts | 12 +- .../utils/build_alert_group_from_sequence.ts | 10 +- .../factories/utils/build_bulk_body.ts | 32 +- .../is_valid_boolean_type.ts | 18 + .../is_valid_date_type.test.ts | 40 ++ .../is_valid_date_type.ts | 31 + .../is_valid_ip_type.test.ts | 24 + .../ecs_types_validators/is_valid_ip_type.ts | 20 + .../is_valid_long_type.ts | 21 + .../is_valid_numeric_type.test.ts | 45 ++ .../is_valid_numeric_type.ts | 23 + .../utils/strip_non_ecs_fields.test.ts | 554 ++++++++++++++++++ .../factories/utils/strip_non_ecs_fields.ts | 210 +++++++ .../utils/wrap_new_terms_alerts.test.ts | 7 + .../factories/utils/wrap_new_terms_alerts.ts | 6 +- .../factories/utils/wrap_suppressed_alerts.ts | 6 +- .../rule_types/factories/wrap_hits_factory.ts | 6 +- .../factories/wrap_sequences_factory.ts | 9 +- .../new_terms/create_new_terms_alert_type.ts | 1 + .../group_and_bulk_create.ts | 1 + .../signals/search_after_bulk_create.test.ts | 1 + .../rule_execution_logic/index.ts | 1 + .../rule_execution_logic/non_ecs_fields.ts | 336 +++++++++++ .../utils/data_generator/index.ts | 8 + .../utils/data_generator/index_documents.ts | 29 + .../ecs_non_compliant/mappings.json | 68 +++ 27 files changed, 1493 insertions(+), 29 deletions(-) create mode 100644 x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_boolean_type.ts create mode 100644 x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_date_type.test.ts create mode 100644 x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_date_type.ts create mode 100644 x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_ip_type.test.ts create mode 100644 x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_ip_type.ts create mode 100644 x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_long_type.ts create mode 100644 x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_numeric_type.test.ts create mode 100644 x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_numeric_type.ts create mode 100644 x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/strip_non_ecs_fields.test.ts create mode 100644 x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/strip_non_ecs_fields.ts create mode 100644 x-pack/test/detection_engine_api_integration/security_and_spaces/rule_execution_logic/non_ecs_fields.ts create mode 100644 x-pack/test/detection_engine_api_integration/utils/data_generator/index.ts create mode 100644 x-pack/test/detection_engine_api_integration/utils/data_generator/index_documents.ts create mode 100644 x-pack/test/functional/es_archives/security_solution/ecs_non_compliant/mappings.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_wrapper.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_wrapper.ts index 8ec879c1e814c..261d06b9be294 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_wrapper.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_wrapper.ts @@ -294,10 +294,11 @@ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper = spaceId, indicesToQuery: inputIndex, alertTimestampOverride, + ruleExecutionLogger, }); const wrapSequences = wrapSequencesFactory({ - logger, + ruleExecutionLogger, ignoreFields: [...ignoreFields, ...legacySignalFields], mergeStrategy, completeRule, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.test.ts index 6a10dac0637d5..150c98cbee59f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.test.ts @@ -5,8 +5,6 @@ * 2.0. */ -import type { Logger } from '@kbn/core/server'; - import { ALERT_RULE_CONSUMER } from '@kbn/rule-data-utils'; import { sampleDocNoSortId, sampleRuleGuid } from '../../../signals/__mocks__/es_results'; @@ -18,6 +16,7 @@ import { import { SERVER_APP_ID } from '../../../../../../common/constants'; import { getCompleteRuleMock, getQueryRuleParams } from '../../../rule_schema/mocks'; import type { QueryRuleParams } from '../../../rule_schema'; +import { ruleExecutionLogMock } from '../../../rule_monitoring/mocks'; import { ALERT_ANCESTORS, ALERT_DEPTH, @@ -27,12 +26,7 @@ import { const SPACE_ID = 'space'; -const loggerMock = { - debug: jest.fn(), - info: jest.fn(), - warn: jest.fn(), - error: jest.fn(), -} as unknown as Logger; +const ruleExecutionLoggerMock = ruleExecutionLogMock.forExecutors.create(); describe('buildAlert', () => { beforeEach(() => { @@ -53,7 +47,7 @@ describe('buildAlert', () => { ], }; const alertGroup = buildAlertGroupFromSequence( - loggerMock, + ruleExecutionLoggerMock, eqlSequence, completeRule, 'allFields', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.ts index 22728c8f248df..369f017426315 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.ts @@ -7,8 +7,6 @@ import { ALERT_UUID } from '@kbn/rule-data-utils'; -import type { Logger } from '@kbn/core/server'; - import type { ConfigType } from '../../../../../config'; import type { Ancestor, SignalSource, SignalSourceHit } from '../../../signals/types'; import { buildAlert, buildAncestors, generateAlertId } from './build_alert'; @@ -17,6 +15,7 @@ import type { EqlSequence } from '../../../../../../common/detection_engine/type import { generateBuildingBlockIds } from './generate_building_block_ids'; import type { BuildReasonMessage } from '../../../signals/reason_formatters'; import type { CompleteRule, RuleParams } from '../../../rule_schema'; +import type { IRuleExecutionLogForExecutors } from '../../../rule_monitoring'; import { ALERT_BUILDING_BLOCK_TYPE, ALERT_GROUP_ID, @@ -37,7 +36,7 @@ import type { * @param completeRule object representing the rule that found the sequence */ export const buildAlertGroupFromSequence = ( - logger: Logger, + ruleExecutionLogger: IRuleExecutionLogForExecutors, sequence: EqlSequence, completeRule: CompleteRule, mergeStrategy: ConfigType['alertMergeStrategy'], @@ -65,11 +64,12 @@ export const buildAlertGroupFromSequence = ( false, buildReasonMessage, indicesToQuery, - alertTimestampOverride + alertTimestampOverride, + ruleExecutionLogger ) ); } catch (error) { - logger.error(error); + ruleExecutionLogger.error(error); return []; } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_bulk_body.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_bulk_body.ts index c887d51df3ee5..5a44a4d06260a 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_bulk_body.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_bulk_body.ts @@ -8,7 +8,7 @@ import { flattenWithPrefix } from '@kbn/securitysolution-rules'; import type * as estypes from '@elastic/elasticsearch/lib/api/types'; -import type { BaseHit } from '../../../../../../common/detection_engine/types'; +import type { BaseHit, SearchTypes } from '../../../../../../common/detection_engine/types'; import type { ConfigType } from '../../../../../config'; import type { BuildReasonMessage } from '../../../signals/reason_formatters'; import { getMergeStrategy } from '../../../signals/source_fields_merging/strategies'; @@ -16,10 +16,12 @@ import type { BaseSignalHit, SignalSource, SignalSourceHit } from '../../../sign import { additionalAlertFields, buildAlert } from './build_alert'; import { filterSource } from './filter_source'; import type { CompleteRule, RuleParams } from '../../../rule_schema'; +import type { IRuleExecutionLogForExecutors } from '../../../rule_monitoring'; import { buildRuleNameFromMapping } from '../../../signals/mappings/build_rule_name_from_mapping'; import { buildSeverityFromMapping } from '../../../signals/mappings/build_severity_from_mapping'; import { buildRiskScoreFromMapping } from '../../../signals/mappings/build_risk_score_from_mapping'; import type { BaseFieldsLatest } from '../../../../../../common/detection_engine/schemas/alerts'; +import { stripNonEcsFields } from './strip_non_ecs_fields'; const isSourceDoc = ( hit: SignalSourceHit @@ -27,7 +29,7 @@ const isSourceDoc = ( return hit._source != null; }; -const buildEventTypeAlert = (doc: BaseSignalHit): object => { +const buildEventTypeAlert = (doc: BaseSignalHit): Record => { if (doc._source?.event != null && doc._source?.event instanceof Object) { return flattenWithPrefix('event', doc._source?.event ?? {}); } @@ -52,11 +54,26 @@ export const buildBulkBody = ( applyOverrides: boolean, buildReasonMessage: BuildReasonMessage, indicesToQuery: string[], - alertTimestampOverride: Date | undefined + alertTimestampOverride: Date | undefined, + ruleExecutionLogger: IRuleExecutionLogForExecutors ): BaseFieldsLatest => { const mergedDoc = getMergeStrategy(mergeStrategy)({ doc, ignoreFields }); + const eventFields = buildEventTypeAlert(mergedDoc); + const { result: validatedEventFields, removed: removedEventFields } = + stripNonEcsFields(eventFields); + const filteredSource = filterSource(mergedDoc); + const { result: validatedSource, removed: removedSourceFields } = + stripNonEcsFields(filteredSource); + + if (removedEventFields.length || removedSourceFields.length) { + ruleExecutionLogger?.debug( + 'Following fields were removed from alert source as ECS non-compliant:', + JSON.stringify(removedSourceFields), + JSON.stringify(removedEventFields) + ); + } const overrides = applyOverrides ? { @@ -86,8 +103,8 @@ export const buildBulkBody = ( if (isSourceDoc(mergedDoc)) { return { - ...filteredSource, - ...eventFields, + ...validatedSource, + ...validatedEventFields, ...buildAlert( [mergedDoc], completeRule, @@ -97,7 +114,10 @@ export const buildBulkBody = ( alertTimestampOverride, overrides ), - ...additionalAlertFields({ ...mergedDoc, _source: { ...mergedDoc._source, ...eventFields } }), + ...additionalAlertFields({ + ...mergedDoc, + _source: { ...mergedDoc._source, ...validatedEventFields }, + }), }; } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_boolean_type.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_boolean_type.ts new file mode 100644 index 0000000000000..3f849a871295b --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_boolean_type.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { SearchTypes } from '../../../../../../../common/detection_engine/types'; + +/** + * validates ES boolean type + */ +export const isValidBooleanType = (boolean: SearchTypes): boolean => { + // boolean type reference https://www.elastic.co/guide/en/elasticsearch/reference/current/boolean.html + const availableValues: SearchTypes[] = ['true', 'false', true, false, '']; + + return availableValues.includes(boolean); +}; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_date_type.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_date_type.test.ts new file mode 100644 index 0000000000000..bf0f788bef0c5 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_date_type.test.ts @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { isValidDateType } from './is_valid_date_type'; + +describe('isValidDateType', () => { + it('should validate valid string format dates', () => { + expect(isValidDateType('2015-01-01T12:10:30.666Z')).toBe(true); + expect(isValidDateType('2015-01-01T12:10:30.666')).toBe(true); + expect(isValidDateType('2015-01-01T12:10:30Z')).toBe(true); + expect(isValidDateType('2015-01-01T12:10:30')).toBe(true); + expect(isValidDateType('2015-01-01T12:10Z')).toBe(true); + expect(isValidDateType('2015-01-01T12:10')).toBe(true); + expect(isValidDateType('2015-01-01T12Z')).toBe(true); + expect(isValidDateType('2015-01-01T12')).toBe(true); + expect(isValidDateType('2015-01-01T')).toBe(true); + expect(isValidDateType('2015-01-01')).toBe(true); + expect(isValidDateType('2015-01')).toBe(true); + expect(isValidDateType('2015')).toBe(true); + }); + + it('should validate epoch ms date format', () => { + expect(isValidDateType(387497835948)).toBe(true); + }); + + it('should not validate invalid dates', () => { + expect(isValidDateType('non-valid')).toBe(false); + expect(isValidDateType(true)).toBe(false); + expect(isValidDateType([])).toBe(false); + expect(isValidDateType('2022/12/12')).toBe(false); + expect(isValidDateType('2015Z')).toBe(false); + expect(isValidDateType('2015-01-')).toBe(false); + expect(isValidDateType('2015-01-01T12: 10Z')).toBe(false); + expect(isValidDateType('2015-20-20')).toBe(false); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_date_type.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_date_type.ts new file mode 100644 index 0000000000000..03370a34ae4f7 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_date_type.ts @@ -0,0 +1,31 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import moment, { ISO_8601 } from 'moment'; +import type { SearchTypes } from '../../../../../../../common/detection_engine/types'; +import { isValidNumericType } from './is_valid_numeric_type'; + +// ECS mapping date format is default optional strict-date-time and epoch ms time: "strict_date_optional_time||epoch_millis" +// https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html#strict-date-time +const additionalFormats = [ + 'yyyy-MM-DDT', // is valid for ES but not for moment's ISO_8601 +]; + +/** + * validates ES date type + */ +export const isValidDateType = (date: SearchTypes): boolean => { + // any number or string that can be parsed as valid number is a valid date for ES + if (isValidNumericType(date)) { + return true; + } + + if (typeof date !== 'string') { + return false; + } + + return moment(date, [ISO_8601, ...additionalFormats], true).isValid(); +}; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_ip_type.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_ip_type.test.ts new file mode 100644 index 0000000000000..c1a77faff859c --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_ip_type.test.ts @@ -0,0 +1,24 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { isValidIpType } from './is_valid_ip_type'; + +describe('isValidIpType', () => { + it('should validate IPv4', () => { + expect(isValidIpType('127.0.0.1')).toBe(true); + }); + + it('should validate IPv6', () => { + expect(isValidIpType('2001:db8::')).toBe(true); + }); + + it('should not validate invalid ip', () => { + expect(isValidIpType('2001:db8:://12')).toBe(false); + expect(isValidIpType('localhost')).toBe(false); + expect(isValidIpType('127.0.0.')).toBe(false); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_ip_type.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_ip_type.ts new file mode 100644 index 0000000000000..1b43c557672ca --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_ip_type.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { isValid } from 'ipaddr.js'; +import type { SearchTypes } from '../../../../../../../common/detection_engine/types'; + +/** + * validates ES ip type + */ +export const isValidIpType = (ip: SearchTypes): boolean => { + if (typeof ip !== 'string') { + return false; + } + + return isValid(ip); +}; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_long_type.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_long_type.ts new file mode 100644 index 0000000000000..cde3ca76f21a8 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_long_type.ts @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { SearchTypes } from '../../../../../../../common/detection_engine/types'; +import { isValidNumericType } from './is_valid_numeric_type'; + +/** + * validates ES long type + */ +export const isValidLongType = (value: SearchTypes): boolean => { + // long type can't have any spaces if string + if (typeof value === 'string' && value.includes(' ')) { + return false; + } + + return isValidNumericType(value); +}; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_numeric_type.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_numeric_type.test.ts new file mode 100644 index 0000000000000..68a297878e686 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_numeric_type.test.ts @@ -0,0 +1,45 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { isValidNumericType } from './is_valid_numeric_type'; + +describe('isValidNumericType', () => { + it('should validate valid numbers', () => { + expect(isValidNumericType(6376723)).toBe(true); + expect(isValidNumericType(-6376723)).toBe(true); + expect(isValidNumericType(637672363767236376723637672363767236376723)).toBe(true); + expect(isValidNumericType(-637672363767236376723637672363767236376723)).toBe(true); + expect(isValidNumericType(0)).toBe(true); + expect(isValidNumericType(63767236376723637672363.7672363767236376723)).toBe(true); + expect(isValidNumericType(-63767236376723637672363.7672363767236376723)).toBe(true); + }); + + it('should validate strings that can be parsed as valid numbers', () => { + expect(isValidNumericType('6376723')).toBe(true); + expect(isValidNumericType('-6376723')).toBe(true); + expect(isValidNumericType('637672363767236376723637672363767236376723')).toBe(true); + expect(isValidNumericType('-637672363767236376723637672363767236376723')).toBe(true); + expect(isValidNumericType('0')).toBe(true); + expect(isValidNumericType('63767236376723637672363.7672363767236376723')).toBe(true); + expect(isValidNumericType('-63767236376723637672363.7672363767236376723')).toBe(true); + }); + + it('should validate string with space', () => { + expect(isValidNumericType('24 ')).toBe(true); + }); + + it('should not validate invalid values', () => { + expect(isValidNumericType('non-valid')).toBe(false); + expect(isValidNumericType(true)).toBe(false); + expect(isValidNumericType([])).toBe(false); + expect(isValidNumericType({})).toBe(false); + expect(isValidNumericType('2015x')).toBe(false); + expect(isValidNumericType('-2015x')).toBe(false); + expect(isValidNumericType('201.2s')).toBe(false); + expect(isValidNumericType(undefined)).toBe(false); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_numeric_type.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_numeric_type.ts new file mode 100644 index 0000000000000..6fc41965e112d --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_numeric_type.ts @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { SearchTypes } from '../../../../../../../common/detection_engine/types'; + +/** + * validates ES numeric types + */ +export const isValidNumericType = (value: SearchTypes): boolean => { + if (typeof value === 'number') { + return true; + } + + if (typeof value === 'string') { + return !Number.isNaN(Number(value)); + } + + return false; +}; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/strip_non_ecs_fields.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/strip_non_ecs_fields.test.ts new file mode 100644 index 0000000000000..1d9d349dd0b5a --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/strip_non_ecs_fields.test.ts @@ -0,0 +1,554 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { stripNonEcsFields } from './strip_non_ecs_fields'; + +describe('stripNonEcsFields', () => { + it('should not strip ECS compliant fields', () => { + const document = { + client: { + nat: { + port: '3000', + ip: '127.0.0.2', + }, + ip: ['127.0.0.1'], + }, + }; + + const { result, removed } = stripNonEcsFields(document); + + expect(result).toEqual(document); + expect(removed).toEqual([]); + }); + + it('should strip source object field if ECS mapping is not object', () => { + const { result, removed } = stripNonEcsFields({ + agent: { + name: { + first: 'test-1', + second: 'test-2', + }, + type: 'filebeat', + }, + }); + + expect(result).toEqual({ + agent: { + type: 'filebeat', + }, + }); + + expect(removed).toEqual([ + { + key: 'agent.name', + value: { + first: 'test-1', + second: 'test-2', + }, + }, + ]); + }); + + it('should strip source keyword field if ECS mapping is object', () => { + const { result, removed } = stripNonEcsFields({ + agent: 'test', + message: 'test message', + }); + + expect(result).toEqual({ + message: 'test message', + }); + + expect(removed).toEqual([ + { + key: 'agent', + value: 'test', + }, + ]); + }); + + describe('array fields', () => { + it('should not strip arrays of objects when an object is expected', () => { + const { result, removed } = stripNonEcsFields({ + agent: [{ name: 'agent-1' }, { name: 'agent-2' }], + message: 'test message', + }); + + expect(result).toEqual({ + agent: [{ name: 'agent-1' }, { name: 'agent-2' }], + message: 'test message', + }); + expect(removed).toEqual([]); + }); + + it('should strip conflicting fields in array of objects', () => { + const { result, removed } = stripNonEcsFields({ + agent: [ + { + name: 'agent-1', + type: { + conflict: 'conflict', + }, + }, + { name: 'agent-2' }, + ], + message: 'test message', + }); + + expect(result).toEqual({ + agent: [{ name: 'agent-1' }, { name: 'agent-2' }], + message: 'test message', + }); + expect(removed).toEqual([ + { + key: 'agent.type', + value: { + conflict: 'conflict', + }, + }, + ]); + }); + + it('should strip conflicting array of keyword fields', () => { + const { result, removed } = stripNonEcsFields({ + agent: ['agent-1', 'agent-2'], + message: 'test message', + }); + + expect(result).toEqual({ + agent: [], + message: 'test message', + }); + expect(removed).toEqual([ + { + key: 'agent', + value: 'agent-1', + }, + { + key: 'agent', + value: 'agent-2', + }, + ]); + }); + + it('should strip conflicting array of object fields', () => { + const { result, removed } = stripNonEcsFields({ + agent: { name: [{ conflict: 'agent-1' }, { conflict: 'agent-2' }], type: 'filebeat' }, + message: 'test message', + }); + + expect(result).toEqual({ + agent: { type: 'filebeat', name: [] }, + message: 'test message', + }); + expect(removed).toEqual([ + { + key: 'agent.name', + value: { conflict: 'agent-1' }, + }, + { + key: 'agent.name', + value: { conflict: 'agent-2' }, + }, + ]); + }); + }); + + describe('dot notation', () => { + it('should strip conflicting fields that use dot notation', () => { + const { result, removed } = stripNonEcsFields({ + 'agent.name.conflict': 'some-value', + message: 'test message', + }); + + expect(result).toEqual({ + message: 'test message', + }); + + expect(removed).toEqual([ + { + key: 'agent.name.conflict', + value: 'some-value', + }, + ]); + }); + + it('should not strip valid ECS fields that use dot notation', () => { + const { result, removed } = stripNonEcsFields({ + 'agent.name': 'some name', + 'agent.build.original': 'v10', + message: 'test message', + }); + + expect(result).toEqual({ + 'agent.name': 'some name', + 'agent.build.original': 'v10', + message: 'test message', + }); + + expect(removed).toEqual([]); + }); + }); + + describe('non-ECS fields', () => { + it('should not strip non-ECS fields that don`t conflict', () => { + expect( + stripNonEcsFields({ + non_ecs_object: { + field1: 'value1', + }, + message: 'test message', + }) + ).toEqual({ + result: { + non_ecs_object: { + field1: 'value1', + }, + message: 'test message', + }, + removed: [], + }); + }); + + it('should not strip non-ECS fields that don`t conflict even when nested inside ECS fieldsets', () => { + expect( + stripNonEcsFields({ + agent: { + non_ecs_object: { + field1: 'value1', + }, + non_ecs_field: 'value2', + }, + message: 'test message', + }) + ).toEqual({ + result: { + agent: { + non_ecs_object: { + field1: 'value1', + }, + non_ecs_field: 'value2', + }, + message: 'test message', + }, + removed: [], + }); + }); + }); + + describe('ip field', () => { + it('should not strip valid CIDR', () => { + const { result, removed } = stripNonEcsFields({ + source: { + ip: '192.168.0.0', + name: 'test source', + }, + }); + + expect(result).toEqual({ + source: { + ip: '192.168.0.0', + name: 'test source', + }, + }); + expect(removed).toEqual([]); + }); + + it('should strip invalid ip', () => { + const { result, removed } = stripNonEcsFields({ + source: { + ip: 'invalid-ip', + name: 'test source', + }, + }); + + expect(result).toEqual({ + source: { name: 'test source' }, + }); + expect(removed).toEqual([ + { + key: 'source.ip', + value: 'invalid-ip', + }, + ]); + }); + }); + + describe('nested field', () => { + it('should strip invalid nested', () => { + const { result, removed } = stripNonEcsFields({ + threat: { + enrichments: ['non-valid-threat-1', 'non-valid-threat-2'], + 'indicator.port': 443, + }, + }); + + expect(result).toEqual({ + threat: { + enrichments: [], + 'indicator.port': 443, + }, + }); + expect(removed).toEqual([ + { + key: 'threat.enrichments', + value: 'non-valid-threat-1', + }, + { + key: 'threat.enrichments', + value: 'non-valid-threat-2', + }, + ]); + }); + + it('should not strip valid values', () => { + const { result, removed } = stripNonEcsFields({ + threat: { + enrichments: [ + { + 'indicator.as.number': 5, + }, + ], + }, + }); + + expect(result).toEqual({ + threat: { + enrichments: [ + { + 'indicator.as.number': 5, + }, + ], + }, + }); + expect(removed).toEqual([]); + }); + }); + + describe('date field', () => { + it('should strip invalid date', () => { + const { result, removed } = stripNonEcsFields({ + event: { + created: true, + category: 'start', + }, + }); + + expect(result).toEqual({ + event: { + category: 'start', + }, + }); + expect(removed).toEqual([ + { + key: 'event.created', + value: true, + }, + ]); + }); + + it('should not strip string or number date field', () => { + const { result, removed } = stripNonEcsFields({ + event: { + created: '2020-12-12', + end: [2345562, '2022-10-12'], + }, + }); + + expect(result).toEqual({ + event: { + created: '2020-12-12', + end: [2345562, '2022-10-12'], + }, + }); + expect(removed).toEqual([]); + }); + }); + + describe('long field', () => { + it('should strip invalid long field', () => { + const { result, removed } = stripNonEcsFields({ + client: { + bytes: 'non-valid', + }, + }); + + expect(result).toEqual({ client: {} }); + expect(removed).toEqual([ + { + key: 'client.bytes', + value: 'non-valid', + }, + ]); + }); + + it('should strip invalid long field with space in it', () => { + const { result, removed } = stripNonEcsFields({ + client: { + bytes: '24 ', + }, + }); + + expect(result).toEqual({ client: {} }); + expect(removed).toEqual([ + { + key: 'client.bytes', + value: '24 ', + }, + ]); + }); + }); + describe('numeric field', () => { + it('should strip invalid float field', () => { + const { result, removed } = stripNonEcsFields({ + 'user.risk.calculated_score': 'non-valid', + }); + + expect(result).toEqual({}); + expect(removed).toEqual([ + { + key: 'user.risk.calculated_score', + value: 'non-valid', + }, + ]); + }); + + it('should strip invalid scaled_float field', () => { + const { result, removed } = stripNonEcsFields({ + host: { + 'cpu.usage': 'non-valid', + }, + }); + + expect(result).toEqual({ host: {} }); + expect(removed).toEqual([ + { + key: 'host.cpu.usage', + value: 'non-valid', + }, + ]); + }); + + it('should not strip string float field with space', () => { + const { result, removed } = stripNonEcsFields({ + 'user.risk.calculated_score': '24 ', + }); + + expect(result).toEqual({ + 'user.risk.calculated_score': '24 ', + }); + expect(removed).toEqual([]); + }); + + it('should not strip string scaled_float field with space', () => { + const { result, removed } = stripNonEcsFields({ + 'host.cpu.usage': '24 ', + }); + + expect(result).toEqual({ + 'host.cpu.usage': '24 ', + }); + expect(removed).toEqual([]); + }); + + it('should not strip valid number in string field', () => { + const { result, removed } = stripNonEcsFields({ + host: { + 'cpu.usage': '1234', + }, + }); + + expect(result).toEqual({ + host: { + 'cpu.usage': '1234', + }, + }); + expect(removed).toEqual([]); + }); + + it('should not strip array of valid numeric fields', () => { + const { result, removed } = stripNonEcsFields({ + 'user.risk.calculated_score': [458.3333, '45.3', 10, 0, -667.23], + }); + + expect(result).toEqual({ + 'user.risk.calculated_score': [458.3333, '45.3', 10, 0, -667.23], + }); + expect(removed).toEqual([]); + }); + }); + + describe('boolean field', () => { + it('should strip invalid boolean fields', () => { + const { result, removed } = stripNonEcsFields({ + 'dll.code_signature.trusted': ['conflict', 'true', 5, 'False', 'ee', 'True'], + }); + + expect(result).toEqual({ + 'dll.code_signature.trusted': ['true'], + }); + expect(removed).toEqual([ + { + key: 'dll.code_signature.trusted', + value: 'conflict', + }, + { + key: 'dll.code_signature.trusted', + value: 5, + }, + { + key: 'dll.code_signature.trusted', + value: 'False', + }, + { + key: 'dll.code_signature.trusted', + value: 'ee', + }, + { + key: 'dll.code_signature.trusted', + value: 'True', + }, + ]); + }); + + it('should strip invalid boolean True', () => { + const { result, removed } = stripNonEcsFields({ + 'dll.code_signature.trusted': 'True', + }); + + expect(result).toEqual({}); + expect(removed).toEqual([ + { + key: 'dll.code_signature.trusted', + value: 'True', + }, + ]); + }); + + it('should not strip valid boolean fields', () => { + const { result, removed } = stripNonEcsFields({ + 'dll.code_signature.trusted': ['true', 'false', true, false, ''], + }); + + expect(result).toEqual({ + 'dll.code_signature.trusted': ['true', 'false', true, false, ''], + }); + expect(removed).toEqual([]); + }); + + it('should not strip valid boolean fields nested in array', () => { + const { result, removed } = stripNonEcsFields({ + 'dll.code_signature.trusted': [[true, false], ''], + }); + + expect(result).toEqual({ + 'dll.code_signature.trusted': [[true, false], ''], + }); + expect(removed).toEqual([]); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/strip_non_ecs_fields.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/strip_non_ecs_fields.ts new file mode 100644 index 0000000000000..975b2b643a4e7 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/strip_non_ecs_fields.ts @@ -0,0 +1,210 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ecsFieldMap } from '@kbn/rule-registry-plugin/common/assets/field_maps/ecs_field_map'; + +import { isPlainObject, cloneDeep, isArray } from 'lodash'; + +import type { SearchTypes } from '../../../../../../common/detection_engine/types'; +import { isValidIpType } from './ecs_types_validators/is_valid_ip_type'; +import { isValidDateType } from './ecs_types_validators/is_valid_date_type'; +import { isValidNumericType } from './ecs_types_validators/is_valid_numeric_type'; +import { isValidBooleanType } from './ecs_types_validators/is_valid_boolean_type'; +import { isValidLongType } from './ecs_types_validators/is_valid_long_type'; + +type SourceFieldRecord = Record; +type SourceField = SearchTypes | SourceFieldRecord; + +/** + * type guard for object of SearchTypes + */ +const isSearchTypesRecord = (value: SourceField): value is SourceFieldRecord => { + return isPlainObject(value); +}; + +/** + * retrieve all nested object fields from ecsFieldMap + * field `agent.build.original` will be converted into + * { agent: true, agent.build: true } + */ +const getEcsObjectFields = () => { + const result: Record = {}; + + Object.entries(ecsFieldMap).forEach(([key, value]) => { + const objects = key.split('.'); + // last item can be any of type, as precedent are objects + objects.pop(); + + objects.reduce((parentPath, itemKey) => { + const fullPath = parentPath ? `${parentPath}.${itemKey}` : itemKey; + + if (!result[fullPath]) { + result[fullPath] = true; + } + + return fullPath; + }, ''); + }); + + return result; +}; + +const ecsObjectFields = getEcsObjectFields(); + +/** + * checks if path is a valid Ecs object type (object or flattened) + */ +const getIsEcsFieldObject = (path: string) => { + const ecsField = ecsFieldMap[path as keyof typeof ecsFieldMap]; + return ['object', 'flattened'].includes(ecsField?.type) || ecsObjectFields[path]; +}; + +/** + * checks if path is in Ecs mapping + */ +const getIsEcsField = (path: string) => { + const ecsField = ecsFieldMap[path as keyof typeof ecsFieldMap]; + const isEcsField = !!ecsField || ecsObjectFields[path]; + + return isEcsField; +}; + +/** + * if any of partial path in dotted notation is not an object in ECS mapping + * it means the field itself is not valid as well + * For example, 'agent.name.conflict' - if agent.name is keyword, so the whole path is invalid + */ +const validateDottedPathInEcsMappings = (path: string): boolean => { + let isValid = true; + path + .split('.') + .slice(0, -1) // exclude last path item, as we check only if all parent are objects + .reduce((acc, key) => { + const pathToValidate = [acc, key].filter(Boolean).join('.'); + const isEcsField = getIsEcsField(pathToValidate); + const isEcsFieldObject = getIsEcsFieldObject(pathToValidate); + + // if field is in Ecs mapping and not object, the whole path is invalid + if (isEcsField && !isEcsFieldObject) { + isValid = false; + } + return pathToValidate; + }, ''); + + return isValid; +}; + +/** + * check whether source field value is ECS compliant + */ +const computeIsEcsCompliant = (value: SourceField, path: string) => { + // if path consists of dot-notation, ensure each path within it is ECS compliant (object or flattened) + if (path.includes('.') && !validateDottedPathInEcsMappings(path)) { + return false; + } + + const isEcsField = getIsEcsField(path); + + // if field is not present is ECS mapping, it's valid as doesn't have any conflicts with existing mapping + if (!isEcsField) { + return true; + } + + const ecsField = ecsFieldMap[path as keyof typeof ecsFieldMap]; + const isEcsFieldObject = getIsEcsFieldObject(path); + + // validate if value is a long type + if (ecsField?.type === 'long') { + return isValidLongType(value); + } + + // validate if value is a numeric type + if (ecsField?.type === 'float' || ecsField?.type === 'scaled_float') { + return isValidNumericType(value); + } + + // validate if value is a valid ip type + if (ecsField?.type === 'ip') { + return isValidIpType(value); + } + + // validate if value is a valid date + if (ecsField?.type === 'date') { + return isValidDateType(value); + } + + // validate if value is a valid boolean + if (ecsField?.type === 'boolean') { + return isValidBooleanType(value); + } + + // if ECS mapping is JS object and source value also JS object then they are compliant + // otherwise not + return isEcsFieldObject ? isPlainObject(value) : !isPlainObject(value); +}; + +interface StripNonEcsFieldsReturn { + result: SourceFieldRecord; + removed: Array<{ key: string; value: SearchTypes }>; +} + +/** + * strips alert source object from ECS non compliant fields + */ +export const stripNonEcsFields = (doc: SourceFieldRecord): StripNonEcsFieldsReturn => { + const result = cloneDeep(doc); + const removed: Array<{ key: string; value: SearchTypes }> = []; + + /** + * traverses through object and deletes ECS non compliant fields + * @param document - document to traverse + * @param documentKey - document key in parent document, if exists + * @param parent - parent of traversing document + * @param parentPath - path of parent in initial source document + */ + const traverseAndDeleteInObj = ( + document: SourceField, + documentKey: string, + parent?: SourceFieldRecord, + parentPath?: string + ) => { + const fullPath = [parentPath, documentKey].filter(Boolean).join('.'); + // if document array, traverse through each item w/o changing documentKey, parent, parentPath + if (isArray(document)) { + document.slice().forEach((value) => { + traverseAndDeleteInObj(value, documentKey, parent, parentPath); + }); + return; + } + + if (parent && !computeIsEcsCompliant(document, fullPath)) { + const documentReference = parent[documentKey]; + // if document reference in parent is array, remove only this item from array + // e.g. a boolean mapped field with values ['not-boolean', 'true'] should strip 'not-boolean' and leave 'true' + if (isArray(documentReference)) { + const indexToDelete = documentReference.findIndex((item) => item === document); + documentReference.splice(indexToDelete, 1); + } else { + delete parent[documentKey]; + } + removed.push({ key: fullPath, value: document }); + return; + } + + if (isSearchTypesRecord(document)) { + Object.entries(document).forEach(([key, value]) => { + traverseAndDeleteInObj(value, key, document, fullPath); + }); + } + }; + + traverseAndDeleteInObj(result, ''); + return { + result, + removed, + }; +}; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_new_terms_alerts.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_new_terms_alerts.test.ts index cfa696d71c47f..3060deaf712bd 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_new_terms_alerts.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_new_terms_alerts.test.ts @@ -8,9 +8,12 @@ import { ALERT_UUID } from '@kbn/rule-data-utils'; import { ALERT_NEW_TERMS } from '../../../../../../common/field_maps/field_names'; import { getCompleteRuleMock, getNewTermsRuleParams } from '../../../rule_schema/mocks'; +import { ruleExecutionLogMock } from '../../../rule_monitoring/mocks'; import { sampleDocNoSortIdWithTimestamp } from '../../../signals/__mocks__/es_results'; import { wrapNewTermsAlerts } from './wrap_new_terms_alerts'; +const ruleExecutionLogger = ruleExecutionLogMock.forExecutors.create(); + const docId = 'd5e8eb51-a6a0-456d-8a15-4b79bfec3d71'; describe('wrapNewTermsAlerts', () => { test('should create an alert with the correct _id from a document', () => { @@ -23,6 +26,7 @@ describe('wrapNewTermsAlerts', () => { completeRule, indicesToQuery: ['auditbeat-*', 'filebeat-*', 'packetbeat-*', 'winlogbeat-*'], alertTimestampOverride: undefined, + ruleExecutionLogger, }); expect(alerts[0]._id).toEqual('a36d9fe6fe4b2f65058fb1a487733275f811af58'); @@ -40,6 +44,7 @@ describe('wrapNewTermsAlerts', () => { completeRule, indicesToQuery: ['auditbeat-*', 'filebeat-*', 'packetbeat-*', 'winlogbeat-*'], alertTimestampOverride: undefined, + ruleExecutionLogger, }); expect(alerts[0]._id).toEqual('f7877a31b1cc83373dbc9ba5939ebfab1db66545'); @@ -57,6 +62,7 @@ describe('wrapNewTermsAlerts', () => { completeRule, indicesToQuery: ['auditbeat-*', 'filebeat-*', 'packetbeat-*', 'winlogbeat-*'], alertTimestampOverride: undefined, + ruleExecutionLogger, }); expect(alerts[0]._id).toEqual('75e5a507a4bc48bcd983820c7fd2d9621ff4e2ea'); @@ -74,6 +80,7 @@ describe('wrapNewTermsAlerts', () => { completeRule, indicesToQuery: ['auditbeat-*', 'filebeat-*', 'packetbeat-*', 'winlogbeat-*'], alertTimestampOverride: undefined, + ruleExecutionLogger, }); expect(alerts[0]._id).toEqual('86a216cfa4884767d9bb26d2b8db911cb4aa85ce'); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_new_terms_alerts.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_new_terms_alerts.ts index e39bcf67909ae..d87bdceb9cecd 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_new_terms_alerts.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_new_terms_alerts.ts @@ -18,6 +18,7 @@ import type { ConfigType } from '../../../../../config'; import type { CompleteRule, RuleParams } from '../../../rule_schema'; import { buildReasonMessageForNewTermsAlert } from '../../../signals/reason_formatters'; import type { SignalSource } from '../../../signals/types'; +import type { IRuleExecutionLogForExecutors } from '../../../rule_monitoring'; import { buildBulkBody } from './build_bulk_body'; export interface EventsAndTerms { @@ -32,6 +33,7 @@ export const wrapNewTermsAlerts = ({ mergeStrategy, indicesToQuery, alertTimestampOverride, + ruleExecutionLogger, }: { eventsAndTerms: EventsAndTerms[]; spaceId: string | null | undefined; @@ -39,6 +41,7 @@ export const wrapNewTermsAlerts = ({ mergeStrategy: ConfigType['alertMergeStrategy']; indicesToQuery: string[]; alertTimestampOverride: Date | undefined; + ruleExecutionLogger: IRuleExecutionLogForExecutors; }): Array> => { return eventsAndTerms.map((eventAndTerms) => { const id = objectHash([ @@ -57,7 +60,8 @@ export const wrapNewTermsAlerts = ({ true, buildReasonMessageForNewTermsAlert, indicesToQuery, - alertTimestampOverride + alertTimestampOverride, + ruleExecutionLogger ); return { _id: id, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_suppressed_alerts.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_suppressed_alerts.ts index e708e3d906efc..91c18b2dec740 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_suppressed_alerts.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_suppressed_alerts.ts @@ -21,6 +21,7 @@ import type { } from '../../../../../../common/detection_engine/schemas/alerts'; import type { ConfigType } from '../../../../../config'; import type { CompleteRule, RuleParams } from '../../../rule_schema'; +import type { IRuleExecutionLogForExecutors } from '../../../rule_monitoring'; import type { SignalSource } from '../../../signals/types'; import { buildBulkBody } from './build_bulk_body'; import type { BuildReasonMessage } from '../../../signals/reason_formatters'; @@ -41,6 +42,7 @@ export const wrapSuppressedAlerts = ({ indicesToQuery, buildReasonMessage, alertTimestampOverride, + ruleExecutionLogger, }: { suppressionBuckets: SuppressionBuckets[]; spaceId: string | null | undefined; @@ -49,6 +51,7 @@ export const wrapSuppressedAlerts = ({ indicesToQuery: string[]; buildReasonMessage: BuildReasonMessage; alertTimestampOverride: Date | undefined; + ruleExecutionLogger: IRuleExecutionLogForExecutors; }): Array> => { return suppressionBuckets.map((bucket) => { const id = objectHash([ @@ -69,7 +72,8 @@ export const wrapSuppressedAlerts = ({ true, buildReasonMessage, indicesToQuery, - alertTimestampOverride + alertTimestampOverride, + ruleExecutionLogger ); return { _id: id, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_hits_factory.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_hits_factory.ts index 123374eeb32de..ee49980bffac9 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_hits_factory.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_hits_factory.ts @@ -18,6 +18,7 @@ import type { BaseFieldsLatest, WrappedFieldsLatest, } from '../../../../../common/detection_engine/schemas/alerts'; +import type { IRuleExecutionLogForExecutors } from '../../rule_monitoring'; export const wrapHitsFactory = ({ @@ -27,6 +28,7 @@ export const wrapHitsFactory = spaceId, indicesToQuery, alertTimestampOverride, + ruleExecutionLogger, }: { completeRule: CompleteRule; ignoreFields: ConfigType['alertIgnoreFields']; @@ -34,6 +36,7 @@ export const wrapHitsFactory = spaceId: string | null | undefined; indicesToQuery: string[]; alertTimestampOverride: Date | undefined; + ruleExecutionLogger: IRuleExecutionLogForExecutors; }) => ( events: Array>, @@ -59,7 +62,8 @@ export const wrapHitsFactory = true, buildReasonMessage, indicesToQuery, - alertTimestampOverride + alertTimestampOverride, + ruleExecutionLogger ), [ALERT_UUID]: id, }, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_sequences_factory.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_sequences_factory.ts index d4de6c1537f48..f20954cf9efbd 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_sequences_factory.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_sequences_factory.ts @@ -5,12 +5,11 @@ * 2.0. */ -import type { Logger } from '@kbn/core/server'; - import type { WrapSequences } from '../../signals/types'; import { buildAlertGroupFromSequence } from './utils/build_alert_group_from_sequence'; import type { ConfigType } from '../../../../config'; import type { CompleteRule, RuleParams } from '../../rule_schema'; +import type { IRuleExecutionLogForExecutors } from '../../rule_monitoring'; import type { BaseFieldsLatest, WrappedFieldsLatest, @@ -18,7 +17,7 @@ import type { export const wrapSequencesFactory = ({ - logger, + ruleExecutionLogger, completeRule, ignoreFields, mergeStrategy, @@ -26,7 +25,7 @@ export const wrapSequencesFactory = indicesToQuery, alertTimestampOverride, }: { - logger: Logger; + ruleExecutionLogger: IRuleExecutionLogForExecutors; completeRule: CompleteRule; ignoreFields: ConfigType['alertIgnoreFields']; mergeStrategy: ConfigType['alertMergeStrategy']; @@ -39,7 +38,7 @@ export const wrapSequencesFactory = (acc: Array>, sequence) => [ ...acc, ...buildAlertGroupFromSequence( - logger, + ruleExecutionLogger, sequence, completeRule, mergeStrategy, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/create_new_terms_alert_type.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/create_new_terms_alert_type.ts index acfb9f725d3f9..64a1f4b093d42 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/create_new_terms_alert_type.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/create_new_terms_alert_type.ts @@ -299,6 +299,7 @@ export const createNewTermsAlertType = ( mergeStrategy, indicesToQuery: inputIndex, alertTimestampOverride, + ruleExecutionLogger, }); const bulkCreateResult = await bulkCreate( diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/alert_suppression/group_and_bulk_create.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/alert_suppression/group_and_bulk_create.ts index 690b0f698f306..070c963ef750d 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/alert_suppression/group_and_bulk_create.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/alert_suppression/group_and_bulk_create.ts @@ -185,6 +185,7 @@ export const groupAndBulkCreate = async ({ indicesToQuery: runOpts.inputIndex, buildReasonMessage, alertTimestampOverride: runOpts.alertTimestampOverride, + ruleExecutionLogger: runOpts.ruleExecutionLogger, }); const bulkCreateResult = await runOpts.bulkCreate(wrappedAlerts); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.test.ts index e49c86ae2de48..8a6bfd7cb2641 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.test.ts @@ -105,6 +105,7 @@ describe('searchAfterAndBulkCreate', () => { spaceId: 'default', indicesToQuery: inputIndexPattern, alertTimestampOverride: undefined, + ruleExecutionLogger, }); }); diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/rule_execution_logic/index.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/rule_execution_logic/index.ts index 547e3a4706e3c..0af37d5d28b93 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/rule_execution_logic/index.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/rule_execution_logic/index.ts @@ -17,5 +17,6 @@ export default ({ loadTestFile }: FtrProviderContext): void => { loadTestFile(require.resolve('./saved_query')); loadTestFile(require.resolve('./threat_match')); loadTestFile(require.resolve('./threshold')); + loadTestFile(require.resolve('./non_ecs_fields')); }); }; diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/rule_execution_logic/non_ecs_fields.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/rule_execution_logic/non_ecs_fields.ts new file mode 100644 index 0000000000000..880a35082e535 --- /dev/null +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/rule_execution_logic/non_ecs_fields.ts @@ -0,0 +1,336 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from 'expect'; +import { v4 as uuidv4 } from 'uuid'; + +import { + deleteAllAlerts, + deleteSignalsIndex, + getPreviewAlerts, + getRuleForSignalTesting, + previewRule, +} from '../../utils'; +import { indexDocumentsFactory } from '../../utils/data_generator'; +import { FtrProviderContext } from '../../common/ftr_provider_context'; + +const getQueryRule = (docIdToQuery: string) => ({ + ...getRuleForSignalTesting(['ecs_non_compliant']), + query: `id: "${docIdToQuery}"`, +}); + +const getDocument = (id: string, doc: Record) => ({ + id, + '@timestamp': new Date().toISOString(), + ...doc, +}); + +// eslint-disable-next-line import/no-default-export +export default ({ getService }: FtrProviderContext) => { + const supertest = getService('supertest'); + const esArchiver = getService('esArchiver'); + const es = getService('es'); + const log = getService('log'); + + const indexDocuments = indexDocumentsFactory({ + es, + index: 'ecs_non_compliant', + }); + + /** + * test helper: + * 1. index document with auto generated ID + * 2. run preview query rule that targets document by ID + * 3. return created preview alert and errors logs + */ + const indexAndCreatePreviewAlert = async (document: Record) => { + const documentId = uuidv4(); + + const { items } = await indexDocuments([getDocument(documentId, document)]); + + // throw error if document wasn't indexed, so test will be terminated earlier and no false positives can happen + items.some(({ index } = {}) => { + if (index?.error) { + log.error( + `Failed to index document in non_ecs_fields test suits: "${index.error?.reason}"` + ); + throw Error(index.error.message); + } + }); + + const { previewId, logs } = await previewRule({ + supertest, + rule: getQueryRule(documentId), + }); + const previewAlerts = await getPreviewAlerts({ es, previewId }); + + return { + alertSource: previewAlerts?.[0]?._source, + errors: logs[0].errors, + }; + }; + + describe('Non ECS fields in alert document source', () => { + before(async () => { + await esArchiver.load( + 'x-pack/test/functional/es_archives/security_solution/ecs_non_compliant' + ); + }); + + after(async () => { + await esArchiver.unload( + 'x-pack/test/functional/es_archives/security_solution/ecs_non_compliant' + ); + await deleteSignalsIndex(supertest, log); + await deleteAllAlerts(supertest, log); + }); + + // source agent.name is object, ECS mapping for agent.name is keyword + it('should remove source object field from alert if ECS field mapping is keyword', async () => { + const document = { + agent: { + name: { + first: 'test name 1', + }, + version: 'test-1', + }, + }; + + const { errors, alertSource } = await indexAndCreatePreviewAlert(document); + + expect(errors).toEqual([]); + + // valid ECS field is not getting removed + expect(alertSource).toHaveProperty('agent.version', 'test-1'); + + // invalid ECS field 'agent.name' is getting removed + expect(alertSource).not.toHaveProperty('agent.name'); + }); + + // source container.image is keyword, ECS mapping for container.image is object + it('should remove source keyword field from alert if ECS field mapping is object', async () => { + const document = { + container: { + name: 'test-image', + image: 'test-1', + }, + }; + + const { errors, alertSource } = await indexAndCreatePreviewAlert(document); + + expect(errors).toEqual([]); + + // invalid ECS field 'container.image' is getting removed + expect(alertSource).not.toHaveProperty('container.image'); + + expect(alertSource).toHaveProperty('container.name', 'test-image'); + }); + + // source agent.type is long, ECS mapping for agent.type is keyword + it('should not remove source long field from alert if ECS field mapping is keyword', async () => { + const document = { + agent: { + type: 13, + }, + }; + + const { errors, alertSource } = await indexAndCreatePreviewAlert(document); + + expect(errors).toEqual([]); + + // long value should be indexed as keyword + expect(alertSource).toHaveProperty('agent.type', 13); + }); + + // source client.ip is keyword, ECS mapping for client.ip is ip + it('should remove source non ip field from alert if ECS field mapping is ip', async () => { + const document = { + client: { + ip: 'non-valid-ip', + name: 'test name', + }, + }; + + const { errors, alertSource } = await indexAndCreatePreviewAlert(document); + + expect(errors).toEqual([]); + + // invalid ECS field is getting removed + expect(alertSource).not.toHaveProperty('client.ip'); + + expect(alertSource).toHaveProperty('client.name', 'test name'); + }); + + it('should not remove valid ips from ECS source field', async () => { + const ip = [ + '127.0.0.1', + '::afff:4567:890a', + '::', + '::11.22.33.44', + '1111:2222:3333:4444:AAAA:BBBB:CCCC:DDDD', + ]; + const document = { client: { ip } }; + + const { errors, alertSource } = await indexAndCreatePreviewAlert(document); + + expect(errors).toEqual([]); + expect(alertSource).toHaveProperty('client.ip', ip); + }); + + // source event.created is boolean, ECS mapping for client.created is date + it('should remove source non date field from alert if ECS field mapping is date', async () => { + const document = { + event: { + end: true, + }, + }; + + const { errors, alertSource } = await indexAndCreatePreviewAlert(document); + + expect(errors).toEqual([]); + + // invalid ECS field is getting removed + // event properties getting flattened, so we make sure event.created was removed + expect(alertSource).not.toHaveProperty(['event.end']); + expect(alertSource).not.toHaveProperty('event.end'); + }); + + it('should not remove valid dates from ECS source field', async () => { + const validDates = [ + '2015-01-01T12:10:30.666Z', + '2015-01-01T12:10:30.666', + '2015-01-01T12:10:30Z', + '2015-01-01T12:10:30', + '2015-01-01T12:10Z', + '2015-01-01T12:10', + '2015-01-01T12Z', + '2015-01-01T12', + '2015-01-01', + '2015-01', + '2015-01-02T', + 123.3, + '23242', + -1, + '-1', + 0, + '0', + ]; + const document = { + event: { + created: validDates, + }, + }; + + const { errors, alertSource } = await indexAndCreatePreviewAlert(document); + + expect(errors).toEqual([]); + + // event properties getting flattened + expect(alertSource).toHaveProperty(['event.created'], validDates); + }); + + // source threat.enrichments is keyword, ECS mapping for threat.enrichments is nested + it('should remove source array of keywords field from alert if ECS field mapping is nested', async () => { + const document = { + threat: { + enrichments: ['non-valid-threat-1', 'non-valid-threat-2'], + 'indicator.port': 443, + }, + }; + + const { errors, alertSource } = await indexAndCreatePreviewAlert(document); + + expect(errors).toEqual([]); + + // invalid ECS field is getting removed + expect(alertSource).toHaveProperty('threat.enrichments', []); + + expect(alertSource).toHaveProperty('threat.indicator.port', 443); + }); + + // source client.bytes is text, ECS mapping for client.bytes is long + it('should remove source text field from alert if ECS field mapping is long', async () => { + const document = { + client: { + nat: { + port: '3000', + }, + bytes: 'conflict', + }, + }; + + const { errors, alertSource } = await indexAndCreatePreviewAlert(document); + + expect(errors).toEqual([]); + + // invalid ECS field is getting removed + expect(alertSource).not.toHaveProperty('client.bytes'); + + // ensures string numeric field is indexed + expect(alertSource).toHaveProperty('client.nat.port', '3000'); + }); + + // we don't validate it because geo_point is very complex type with many various representations: array, different object, string with few valid patterns + // more on geo_point type https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html + it('should fail creating alert when ECS field mapping is geo_point', async () => { + const document = { + client: { + geo: { + name: 'test', + location: 'test test', + }, + }, + }; + + const { errors } = await indexAndCreatePreviewAlert(document); + + expect(errors).toContain( + 'Bulk Indexing of signals failed: failed to parse field [client.geo.location] of type [geo_point]' + ); + }); + + it('should strip invalid boolean values and left valid ones', async () => { + const document = { + dll: { + code_signature: { + valid: ['non-valid', 'true', 'false', [true, false], '', 'False', 'True', 1], + }, + }, + }; + + const { errors, alertSource } = await indexAndCreatePreviewAlert(document); + + expect(errors).toEqual([]); + + // invalid ECS values is getting removed + expect(alertSource).toHaveProperty('dll.code_signature.valid', [ + 'true', + 'false', + [true, false], + '', + ]); + }); + + // dll.code_signature.valid is boolean in ECS mapping + it('should strip conflicting ECS mappings boolean field', async () => { + const document = { + dll: { + code_signature: { + valid: 'False', + }, + }, + }; + + const { errors, alertSource } = await indexAndCreatePreviewAlert(document); + + expect(errors).toEqual([]); + + // invalid ECS field is getting removed + expect(alertSource).not.toHaveProperty('dll.code_signature.valid'); + }); + }); +}; diff --git a/x-pack/test/detection_engine_api_integration/utils/data_generator/index.ts b/x-pack/test/detection_engine_api_integration/utils/data_generator/index.ts new file mode 100644 index 0000000000000..95c65cf5171eb --- /dev/null +++ b/x-pack/test/detection_engine_api_integration/utils/data_generator/index.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from './index_documents'; diff --git a/x-pack/test/detection_engine_api_integration/utils/data_generator/index_documents.ts b/x-pack/test/detection_engine_api_integration/utils/data_generator/index_documents.ts new file mode 100644 index 0000000000000..46de5d9858101 --- /dev/null +++ b/x-pack/test/detection_engine_api_integration/utils/data_generator/index_documents.ts @@ -0,0 +1,29 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { Client } from '@elastic/elasticsearch'; +import type { BulkResponse } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +interface IndexDocumentsParams { + es: Client; + documents: Array>; + index: string; +} + +type IndexDocuments = (params: IndexDocumentsParams) => Promise; + +/** + * Indexes documents into provided index + */ +export const indexDocuments: IndexDocuments = async ({ es, documents, index }) => { + const operations = documents.flatMap((doc: object) => [{ index: { _index: index } }, doc]); + + return es.bulk({ refresh: true, operations }); +}; + +export const indexDocumentsFactory = ({ es, index }: Omit) => { + return (documents: Array>) => indexDocuments({ es, index, documents }); +}; diff --git a/x-pack/test/functional/es_archives/security_solution/ecs_non_compliant/mappings.json b/x-pack/test/functional/es_archives/security_solution/ecs_non_compliant/mappings.json new file mode 100644 index 0000000000000..42d23e794ba23 --- /dev/null +++ b/x-pack/test/functional/es_archives/security_solution/ecs_non_compliant/mappings.json @@ -0,0 +1,68 @@ +{ + "type": "index", + "value": { + "index": "ecs_non_compliant", + "mappings": { + "properties": { + "id": { + "type": "keyword" + }, + "@timestamp": { + "type": "date" + }, + "agent": { + "properties": { + "name": { + "properties": { + "first": { + "type": "keyword" + } + } + }, + "type": { + "type": "long" + } + } + }, + "container": { + "properties": { + "image": { + "type": "keyword" + } + } + }, + "client": { + "properties": { + "ip": { + "type": "keyword" + } + } + }, + "event": { + "properties": { + "created": { + "type": "keyword" + } + } + }, + "dll": { + "properties": { + "code_signature": { + "properties": { + "valid": { + "type": "keyword" + } + } + } + } + } + } + }, + "settings": { + "index": { + "number_of_replicas": "1", + "number_of_shards": "1" + } + } + } + } \ No newline at end of file From 01f52af0c870c827afabe46f71e1b479ceb47684 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Thu, 12 Jan 2023 08:02:14 -0400 Subject: [PATCH 13/39] [Fleet] Generate time_serie_metrics only for time_series index (#148764) --- .../epm/elasticsearch/template/install.ts | 8 +- .../elasticsearch/template/template.test.ts | 41 ++++++- .../epm/elasticsearch/template/template.ts | 103 +++++++++++------- 3 files changed, 107 insertions(+), 45 deletions(-) diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts index d124d1bbfb643..fd1369748c867 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts @@ -491,7 +491,12 @@ export function prepareTemplate({ const { name: packageName, version: packageVersion } = pkg; const fields = loadFieldsFromYaml(pkg, dataStream.path); const validFields = processFields(fields); - const mappings = generateMappings(validFields); + + const isIndexModeTimeSeries = + dataStream.elasticsearch?.index_mode === 'time_series' || + experimentalDataStreamFeature?.features.tsdb; + + const mappings = generateMappings(validFields, { isIndexModeTimeSeries }); const templateName = generateTemplateName(dataStream); const templateIndexPattern = generateTemplateIndexPattern(dataStream); const templatePriority = getTemplatePriority(dataStream); @@ -524,6 +529,7 @@ export function prepareTemplate({ hidden: dataStream.hidden, registryElasticsearch: dataStream.elasticsearch, mappings, + isIndexModeTimeSeries, }); return { diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.test.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.test.ts index dd4eb5dc1eac9..5ed56f45e9d0e 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.test.ts @@ -738,7 +738,7 @@ describe('EPM template', () => { expect(mappings).toEqual(expectedMapping); }); - it('tests processing metric_type field', () => { + it('tests processing metric_type field with index mode time series', () => { const literalYml = ` - name: total.norm.pct type: scaled_float @@ -768,11 +768,44 @@ describe('EPM template', () => { }; const fields: Field[] = safeLoad(literalYml); const processedFields = processFields(fields); - const mappings = generateMappings(processedFields); + const mappings = generateMappings(processedFields, { isIndexModeTimeSeries: true }); expect(mappings).toEqual(expectedMapping); }); - it('tests processing metric_type field with long field ', () => { + it('tests processing metric_type field with index mode time series disabled', () => { + const literalYml = ` +- name: total.norm.pct + type: scaled_float + metric_type: gauge + unit: percent + format: percent +`; + const expectedMapping = { + properties: { + total: { + properties: { + norm: { + properties: { + pct: { + scaling_factor: 1000, + type: 'scaled_float', + meta: { + unit: 'percent', + }, + }, + }, + }, + }, + }, + }, + }; + const fields: Field[] = safeLoad(literalYml); + const processedFields = processFields(fields); + const mappings = generateMappings(processedFields, { isIndexModeTimeSeries: false }); + expect(mappings).toEqual(expectedMapping); + }); + + it('tests processing metric_type field with long field and index mode timeseries', () => { const literalYml = ` - name: total type: long @@ -795,7 +828,7 @@ describe('EPM template', () => { }; const fields: Field[] = safeLoad(literalYml); const processedFields = processFields(fields); - const mappings = generateMappings(processedFields); + const mappings = generateMappings(processedFields, { isIndexModeTimeSeries: true }); expect(mappings).toEqual(expectedMapping); }); diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts index 4df99c9eec5b9..2c9ec135c10c3 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts @@ -65,6 +65,7 @@ export function getTemplate({ hidden, registryElasticsearch, mappings, + isIndexModeTimeSeries, }: { templateIndexPattern: string; packageName: string; @@ -73,6 +74,7 @@ export function getTemplate({ mappings: IndexTemplateMappings; hidden?: boolean; registryElasticsearch?: RegistryElasticsearch | undefined; + isIndexModeTimeSeries?: boolean; }): IndexTemplate { const template = getBaseTemplate({ templateIndexPattern, @@ -82,6 +84,7 @@ export function getTemplate({ registryElasticsearch, hidden, mappings, + isIndexModeTimeSeries, }); if (template.template.settings.index.final_pipeline) { throw new Error(`Error template for ${templateIndexPattern} contains a final_pipeline`); @@ -98,6 +101,10 @@ export function getTemplate({ return template; } +interface GenerateMappingsOptions { + isIndexModeTimeSeries?: boolean; +} + /** * Generate mapping takes the given nested fields array and creates the Elasticsearch * mapping properties out of it. @@ -106,37 +113,44 @@ export function getTemplate({ * * @param fields */ -export function generateMappings(fields: Field[]): IndexTemplateMappings { +export function generateMappings( + fields: Field[], + options?: GenerateMappingsOptions +): IndexTemplateMappings { const dynamicTemplates: Array> = []; const dynamicTemplateNames = new Set(); - const { properties } = _generateMappings(fields, { - addDynamicMapping: (dynamicMapping: { - path: string; - matchingType: string; - pathMatch: string; - properties: string; - }) => { - const name = dynamicMapping.path; - if (dynamicTemplateNames.has(name)) { - return; - } + const { properties } = _generateMappings( + fields, + { + addDynamicMapping: (dynamicMapping: { + path: string; + matchingType: string; + pathMatch: string; + properties: string; + }) => { + const name = dynamicMapping.path; + if (dynamicTemplateNames.has(name)) { + return; + } - const dynamicTemplate: Properties = { - mapping: dynamicMapping.properties, - }; + const dynamicTemplate: Properties = { + mapping: dynamicMapping.properties, + }; - if (dynamicMapping.matchingType) { - dynamicTemplate.match_mapping_type = dynamicMapping.matchingType; - } + if (dynamicMapping.matchingType) { + dynamicTemplate.match_mapping_type = dynamicMapping.matchingType; + } - if (dynamicMapping.pathMatch) { - dynamicTemplate.path_match = dynamicMapping.pathMatch; - } - dynamicTemplateNames.add(name); - dynamicTemplates.push({ [dynamicMapping.path]: dynamicTemplate }); + if (dynamicMapping.pathMatch) { + dynamicTemplate.path_match = dynamicMapping.pathMatch; + } + dynamicTemplateNames.add(name); + dynamicTemplates.push({ [dynamicMapping.path]: dynamicTemplate }); + }, }, - }); + options + ); return dynamicTemplates.length ? { @@ -159,7 +173,8 @@ function _generateMappings( ctx: { addDynamicMapping: any; groupFieldName?: string; - } + }, + options?: GenerateMappingsOptions ): { properties: IndexTemplateMappings['properties']; hasNonDynamicTemplateMappings: boolean; @@ -219,12 +234,16 @@ function _generateMappings( switch (type) { case 'group': - const mappings = _generateMappings(field.fields!, { - ...ctx, - groupFieldName: ctx.groupFieldName - ? `${ctx.groupFieldName}.${field.name}` - : field.name, - }); + const mappings = _generateMappings( + field.fields!, + { + ...ctx, + groupFieldName: ctx.groupFieldName + ? `${ctx.groupFieldName}.${field.name}` + : field.name, + }, + options + ); if (!mappings.hasNonDynamicTemplateMappings) { return; } @@ -236,12 +255,16 @@ function _generateMappings( break; case 'group-nested': fieldProps = { - properties: _generateMappings(field.fields!, { - ...ctx, - groupFieldName: ctx.groupFieldName - ? `${ctx.groupFieldName}.${field.name}` - : field.name, - }).properties, + properties: _generateMappings( + field.fields!, + { + ...ctx, + groupFieldName: ctx.groupFieldName + ? `${ctx.groupFieldName}.${field.name}` + : field.name, + }, + options + ).properties, ...generateNestedProps(field), type: 'nested', }; @@ -317,7 +340,7 @@ function _generateMappings( } } - if ('metric_type' in field) { + if (options?.isIndexModeTimeSeries && 'metric_type' in field) { fieldProps.time_series_metric = field.metric_type; } @@ -488,6 +511,7 @@ function getBaseTemplate({ hidden, registryElasticsearch, mappings, + isIndexModeTimeSeries, }: { templateIndexPattern: string; packageName: string; @@ -496,11 +520,10 @@ function getBaseTemplate({ hidden?: boolean; registryElasticsearch: RegistryElasticsearch | undefined; mappings: IndexTemplateMappings; + isIndexModeTimeSeries?: boolean; }): IndexTemplate { const _meta = getESAssetMetadata({ packageName }); - const isIndexModeTimeSeries = registryElasticsearch?.index_mode === 'time_series'; - let settingsIndex = {}; if (isIndexModeTimeSeries) { settingsIndex = { From 645a9aa2d35111558e5bc561ad875fb34c3bdc7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?= Date: Thu, 12 Jan 2023 13:27:37 +0100 Subject: [PATCH 14/39] Enable Enterprise Search Cypress setup custom scripts (#148630) ## Summary Enables Enterprise Search Cypress tests via docker. Running the current ftr tests with host configured now creates and runs a Enterprise Search on Docker. `node scripts/functional_tests --config x-pack/test/functional_enterprise_search/with_host_configured.config.ts` This doesn't run on CI, reviewers adviced to try locally run the tests, to see if it is working. Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../artifact_manager.ts | 14 +++ .../base_config.ts | 6 + .../enterprise_search_server.ts | 115 ++++++++++++++++++ .../functional_enterprise_search/runner.ts | 78 ++++++++++++ .../with_host_configured.config.ts | 12 +- x-pack/test/tsconfig.json | 1 + 6 files changed, 221 insertions(+), 5 deletions(-) create mode 100644 x-pack/test/functional_enterprise_search/artifact_manager.ts create mode 100644 x-pack/test/functional_enterprise_search/enterprise_search_server.ts create mode 100644 x-pack/test/functional_enterprise_search/runner.ts diff --git a/x-pack/test/functional_enterprise_search/artifact_manager.ts b/x-pack/test/functional_enterprise_search/artifact_manager.ts new file mode 100644 index 0000000000000..4dfccf16887d9 --- /dev/null +++ b/x-pack/test/functional_enterprise_search/artifact_manager.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import axios from 'axios'; +import { last } from 'lodash'; + +export async function getLatestVersion(): Promise { + const response: any = await axios('https://artifacts-api.elastic.co/v1/versions'); + return last(response.data.versions as string[]) || '8.7.0-SNAPSHOT'; +} diff --git a/x-pack/test/functional_enterprise_search/base_config.ts b/x-pack/test/functional_enterprise_search/base_config.ts index 8f72e1ebd6503..3ef0881ec2dc3 100644 --- a/x-pack/test/functional_enterprise_search/base_config.ts +++ b/x-pack/test/functional_enterprise_search/base_config.ts @@ -14,7 +14,13 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { require.resolve('../functional/config.base.js') ); + const kibanaCommonTestsConfig = await readConfigFile( + require.resolve('../../../test/common/config.js') + ); return { + // common test config + ...kibanaCommonTestsConfig.getAll(), + // default to the xpack functional config ...xPackFunctionalConfig.getAll(), services, diff --git a/x-pack/test/functional_enterprise_search/enterprise_search_server.ts b/x-pack/test/functional_enterprise_search/enterprise_search_server.ts new file mode 100644 index 0000000000000..ae588afc7de13 --- /dev/null +++ b/x-pack/test/functional_enterprise_search/enterprise_search_server.ts @@ -0,0 +1,115 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { spawn, ChildProcess } from 'child_process'; + +import { observeLines } from '@kbn/stdio-dev-helpers'; +import { ToolingLog } from '@kbn/tooling-log'; +import * as Rx from 'rxjs'; +import { filter, take, map, tap } from 'rxjs/operators'; +import { getLatestVersion } from './artifact_manager'; + +let enterpriseSearchProcess: ChildProcess | undefined; + +const DOCKER_START_TIMEOUT = 5 * 60 * 1000; // 5 minutes +const dockerImage = `docker.elastic.co/enterprise-search/enterprise-search`; + +function firstWithTimeout(source$: Rx.Observable, errorMsg: string, ms = 30 * 1000) { + return Rx.race( + source$.pipe(take(1)), + Rx.timer(ms).pipe( + map(() => { + throw new Error(`[docker:${dockerImage}] ${errorMsg} within ${ms / 1000} seconds`); + }) + ) + ); +} + +function childProcessToLogLine(childProcess: ChildProcess, log: ToolingLog) { + const logLine$ = new Rx.Subject(); + + Rx.merge( + observeLines(childProcess.stdout!).pipe( + tap((line) => log.info(`[docker:${dockerImage}] ${line}`)) + ), + observeLines(childProcess.stderr!).pipe( + tap((line) => log.error(`[docker:${dockerImage}] ${line}`)) + ) + ).subscribe(logLine$); + + return logLine$.asObservable(); +} + +export async function setupEnterpriseSearch(logger: ToolingLog): Promise { + return new Promise(async (res, rej) => { + try { + const dockerArgs: string[] = [ + `run`, + `--name=enterprise-search-ftr`, + `--rm`, + `-p`, + `3002:3002`, + `-e`, + `elasticsearch.host='http://host.docker.internal:9220'`, + `-e`, + `elasticsearch.username=elastic`, + `-e`, + `elasticsearch.password=changeme`, + `-e`, + `allow_es_settings_modification=true`, + `-e`, + `secret_management.encryption_keys=[f8482eb76613714a62569a48f854d2390a957674d46db742c008d80745cd82d9]`, + `-e`, + `ENT_SEARCH_DEFAULT_PASSWORD=changeme`, + `-e`, + `ent_search.listen_port=3002`, + `-e`, + `ent_search.external_url='http://localhost:3002'`, + `docker.elastic.co/enterprise-search/enterprise-search:${await getLatestVersion()}`, + ]; + + logger.info('starting enterpriseSearch'); + logger.info('docker ' + dockerArgs.join(' ')); + + enterpriseSearchProcess = spawn('docker', dockerArgs, { stdio: ['ignore', 'pipe', 'pipe'] }); + enterpriseSearchProcess.on('error', rej); + + try { + await firstWithTimeout( + childProcessToLogLine(enterpriseSearchProcess, logger).pipe( + filter((line) => { + process.stdout.write(line); + return /Success! Elastic Enterprise Search is starting successfully./.test(line); + }) + ), + 'no package manifests loaded', + DOCKER_START_TIMEOUT + ).toPromise(); + } catch (err) { + enterpriseSearchProcess.kill(); + throw err; + } + setTimeout(res, 15000); + } catch (error) { + rej(error); + } + }); +} + +export function cleanupEnterpriseSearch(log: ToolingLog) { + if (enterpriseSearchProcess) { + log.info('Cleaning up Enterprise Search process'); + spawn('docker', ['stop', 'enterprise-search-ftr'], { stdio: 'inherit' }); + if (!enterpriseSearchProcess.kill(9)) { + log.info("Couldn't clean Enterprise Search process"); + } + + enterpriseSearchProcess.on('close', () => { + log.info('Enterprise Search closed '); + }); + } +} diff --git a/x-pack/test/functional_enterprise_search/runner.ts b/x-pack/test/functional_enterprise_search/runner.ts new file mode 100644 index 0000000000000..8dfee33c5b2e7 --- /dev/null +++ b/x-pack/test/functional_enterprise_search/runner.ts @@ -0,0 +1,78 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { resolve } from 'path'; +import Url from 'url'; + +import { withProcRunner } from '@kbn/dev-proc-runner'; +import { setupEnterpriseSearch, cleanupEnterpriseSearch } from './enterprise_search_server'; + +import type { FtrProviderContext } from './ftr_provider_context'; + +export async function withEnterpriseSearch( + context: FtrProviderContext, + runner: (runnerEnv: Record) => Promise +) { + const log = context.getService('log'); + await setupEnterpriseSearch(log); + + try { + await runner({}); + } finally { + cleanupEnterpriseSearch(log); + } +} + +export async function runEnterpriseSearchTests( + context: FtrProviderContext, + cypressCommand: string +) { + const log = context.getService('log'); + const config = context.getService('config'); + await withEnterpriseSearch(context, (runnerEnv) => + withProcRunner(log, async (procs) => { + await procs.run('cypress', { + cmd: 'sh', + args: [ + `${resolve(__dirname, '../../plugins/enterprise_search/cypress.sh')}`, + `${cypressCommand}`, + 'as', + ], + cwd: resolve(__dirname, '../../plugins/enterprise_search'), + env: { + FORCE_COLOR: '1', + // eslint-disable-next-line @typescript-eslint/naming-convention + CYPRESS_baseUrl: Url.format(config.get('servers.kibana')), + // eslint-disable-next-line @typescript-eslint/naming-convention + CYPRESS_protocol: config.get('servers.kibana.protocol'), + // eslint-disable-next-line @typescript-eslint/naming-convention + CYPRESS_hostname: config.get('servers.kibana.hostname'), + // eslint-disable-next-line @typescript-eslint/naming-convention + CYPRESS_configport: config.get('servers.kibana.port'), + CYPRESS_ELASTICSEARCH_URL: Url.format(config.get('servers.elasticsearch')), + CYPRESS_ELASTICSEARCH_USERNAME: config.get('servers.elasticsearch.username'), + CYPRESS_ELASTICSEARCH_PASSWORD: config.get('servers.elasticsearch.password'), + CYPRESS_KIBANA_URL: Url.format({ + protocol: config.get('servers.kibana.protocol'), + hostname: config.get('servers.kibana.hostname'), + port: config.get('servers.kibana.port'), + }), + ...runnerEnv, + ...process.env, + }, + wait: true, + }); + }) + ); +} + +export async function EnterpriseSearchCypressCliTestRunner(context: FtrProviderContext) { + await runEnterpriseSearchTests(context, 'run'); +} + +export async function EnterpriseSearchCypressVisualTestRunner(context: FtrProviderContext) { + await runEnterpriseSearchTests(context, 'open'); +} diff --git a/x-pack/test/functional_enterprise_search/with_host_configured.config.ts b/x-pack/test/functional_enterprise_search/with_host_configured.config.ts index 1da62ffe56a5b..a1584b45da092 100644 --- a/x-pack/test/functional_enterprise_search/with_host_configured.config.ts +++ b/x-pack/test/functional_enterprise_search/with_host_configured.config.ts @@ -5,22 +5,23 @@ * 2.0. */ -import { resolve } from 'path'; import { FtrConfigProviderContext } from '@kbn/test'; +import { EnterpriseSearchCypressVisualTestRunner } from './runner'; export default async function ({ readConfigFile }: FtrConfigProviderContext) { - const baseConfig = await readConfigFile(require.resolve('./base_config')); + const kibanaCommonTestsConfig = await readConfigFile( + require.resolve('../../../test/common/config.js') + ); + const baseConfig = await readConfigFile(require.resolve('./cypress.config')); return { + ...kibanaCommonTestsConfig.getAll(), // default to the xpack functional config ...baseConfig.getAll(), - testFiles: [resolve(__dirname, './apps/enterprise_search/with_host_configured')], - junit: { reportName: 'X-Pack Enterprise Search Functional Tests with Host Configured', }, - kbnTestServer: { ...baseConfig.get('kbnTestServer'), serverArgs: [ @@ -28,5 +29,6 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { '--enterpriseSearch.host=http://localhost:3002', ], }, + testRunner: EnterpriseSearchCypressVisualTestRunner, }; } diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index 74de36e856d29..4d8ffb5a8ae9d 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -112,5 +112,6 @@ "@kbn/apm-synthtrace-client", "@kbn/utils", "@kbn/journeys", + "@kbn/stdio-dev-helpers", ] } From 0f155bd2cf9387851a1b576f8e1c19d11bbdf790 Mon Sep 17 00:00:00 2001 From: Achyut Jhunjhunwala Date: Thu, 12 Jan 2023 13:57:50 +0100 Subject: [PATCH 15/39] Update README.md (#148799) ## Summary Update Readme.md as its having a small typo with the path to update api test snapshots --- x-pack/plugins/apm/dev_docs/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/apm/dev_docs/testing.md b/x-pack/plugins/apm/dev_docs/testing.md index 015995af63155..ea7d549e970d5 100644 --- a/x-pack/plugins/apm/dev_docs/testing.md +++ b/x-pack/plugins/apm/dev_docs/testing.md @@ -56,7 +56,7 @@ node x-pack/plugins/apm/scripts/test/api --runner --basic --grep-files=error_gro To update snapshots append `--updateSnapshots` to the `--runner` command: ``` -node scripts/test/api --runner --basic --updateSnapshots +node x-pack/plugins/apm/scripts/test/api --runner --basic --updateSnapshots ``` (The test server needs to be running) From 7d69a45c9053365158f6bb47e17901ebd33452b8 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 12 Jan 2023 13:01:16 +0000 Subject: [PATCH 16/39] skip flaky suites (#148468, #148469) --- x-pack/test/functional_with_es_ssl/apps/cases/list_view.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/test/functional_with_es_ssl/apps/cases/list_view.ts b/x-pack/test/functional_with_es_ssl/apps/cases/list_view.ts index 95e2740c484bb..4c6e21ad262fc 100644 --- a/x-pack/test/functional_with_es_ssl/apps/cases/list_view.ts +++ b/x-pack/test/functional_with_es_ssl/apps/cases/list_view.ts @@ -534,7 +534,9 @@ export default ({ getPageObject, getService }: FtrProviderContext) => { }); }); - describe('Severity', () => { + // FLAKY: https://github.com/elastic/kibana/issues/148468 + // FLAKY: https://github.com/elastic/kibana/issues/148469 + describe.skip('Severity', () => { before(async () => { await cases.api.createNthRandomCases(1); await header.waitUntilLoadingHasFinished(); From a3eafce7d5137fe50c90fc71b60139e17ef39cbc Mon Sep 17 00:00:00 2001 From: Yngrid Coello Date: Thu, 12 Jan 2023 15:35:26 +0100 Subject: [PATCH 17/39] [APM] Update instruction to run jest tests (#148807) --- x-pack/plugins/apm/dev_docs/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/apm/dev_docs/testing.md b/x-pack/plugins/apm/dev_docs/testing.md index ea7d549e970d5..d6fc05f286d5a 100644 --- a/x-pack/plugins/apm/dev_docs/testing.md +++ b/x-pack/plugins/apm/dev_docs/testing.md @@ -3,7 +3,7 @@ ## Unit Tests (Jest) ``` -node scripts/test/jest [--watch] [--updateSnapshot] +node x-pack/plugins/apm/scripts/test/jest [--watch] [--updateSnapshot] ``` #### Coverage From 473b7a3c418e1b941ff9999d80c0c18ce6fdaa1e Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 12 Jan 2023 08:39:40 -0600 Subject: [PATCH 18/39] [build] Add support for configurable docker namespace (#148604) Adds a build flag `--docker-namespace` that can be used to set a target namespace Testing ``` node scripts/build \ --docker-images \ --docker-namespace="kibana-test" \ --skip-docker-ubi \ --skip-docker-cloud \ --skip-docker-context ``` should produce an image `docker.elastic.co/kibana-test/kibana:8.7.0-SNAPSHOT` ``` node scripts/build \ --docker-images \ --skip-docker-ubi \ --skip-docker-cloud \ --skip-docker-context ``` should produce an image `docker.elastic.co/kibana/kibana:8.7.0-SNAPSHOT` ``` node scripts/build \ --docker-images \ --skip-docker-ubi \ --skip-docker-ubuntu \ --skip-docker-context ``` should produce an image `docker.elastic.co/kibana-ci/kibana:8.7.0-SNAPSHOT` Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tiago Costa --- src/dev/build/args.test.ts | 7 +++++++ src/dev/build/args.ts | 4 +++- src/dev/build/build_distributables.ts | 1 + src/dev/build/lib/build.test.ts | 1 + src/dev/build/lib/config.test.ts | 1 + src/dev/build/lib/config.ts | 11 +++++++++++ src/dev/build/lib/runner.test.ts | 1 + .../tasks/nodejs/download_node_builds_task.test.ts | 1 + .../tasks/nodejs/extract_node_builds_task.test.ts | 1 + .../nodejs/verify_existing_node_builds_task.test.ts | 1 + .../build/tasks/os_packages/docker_generator/run.ts | 8 +++++++- 11 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/dev/build/args.test.ts b/src/dev/build/args.test.ts index 68a2c65236ae5..535a836b0b800 100644 --- a/src/dev/build/args.test.ts +++ b/src/dev/build/args.test.ts @@ -40,6 +40,7 @@ it('build default and oss dist for current platform, without packages, by defaul "createRpmPackage": false, "dockerContextUseLocalArtifact": null, "dockerCrossCompile": false, + "dockerNamespace": null, "dockerPush": false, "dockerTag": null, "dockerTagQualifier": null, @@ -75,6 +76,7 @@ it('builds packages if --all-platforms is passed', () => { "createRpmPackage": true, "dockerContextUseLocalArtifact": null, "dockerCrossCompile": false, + "dockerNamespace": null, "dockerPush": false, "dockerTag": null, "dockerTagQualifier": null, @@ -110,6 +112,7 @@ it('limits packages if --rpm passed with --all-platforms', () => { "createRpmPackage": true, "dockerContextUseLocalArtifact": null, "dockerCrossCompile": false, + "dockerNamespace": null, "dockerPush": false, "dockerTag": null, "dockerTagQualifier": null, @@ -145,6 +148,7 @@ it('limits packages if --deb passed with --all-platforms', () => { "createRpmPackage": false, "dockerContextUseLocalArtifact": null, "dockerCrossCompile": false, + "dockerNamespace": null, "dockerPush": false, "dockerTag": null, "dockerTagQualifier": null, @@ -181,6 +185,7 @@ it('limits packages if --docker passed with --all-platforms', () => { "createRpmPackage": false, "dockerContextUseLocalArtifact": null, "dockerCrossCompile": false, + "dockerNamespace": null, "dockerPush": false, "dockerTag": null, "dockerTagQualifier": null, @@ -224,6 +229,7 @@ it('limits packages if --docker passed with --skip-docker-ubi and --all-platform "createRpmPackage": false, "dockerContextUseLocalArtifact": null, "dockerCrossCompile": false, + "dockerNamespace": null, "dockerPush": false, "dockerTag": null, "dockerTagQualifier": null, @@ -260,6 +266,7 @@ it('limits packages if --all-platforms passed with --skip-docker-ubuntu', () => "createRpmPackage": true, "dockerContextUseLocalArtifact": null, "dockerCrossCompile": false, + "dockerNamespace": null, "dockerPush": false, "dockerTag": null, "dockerTagQualifier": null, diff --git a/src/dev/build/args.ts b/src/dev/build/args.ts index 76953394797a9..0adf9c11609ce 100644 --- a/src/dev/build/args.ts +++ b/src/dev/build/args.ts @@ -44,7 +44,7 @@ export function readCliArgs(argv: string[]) { 'debug', 'help', ], - string: ['epr-registry'], + string: ['docker-namespace', 'epr-registry'], alias: { v: 'verbose', d: 'debug', @@ -60,6 +60,7 @@ export function readCliArgs(argv: string[]) { 'docker-push': false, 'docker-tag': null, 'docker-tag-qualifier': null, + 'docker-namespace': null, 'version-qualifier': '', 'epr-registry': 'snapshot', }, @@ -120,6 +121,7 @@ export function readCliArgs(argv: string[]) { versionQualifier: flags['version-qualifier'], dockerContextUseLocalArtifact: flags['docker-context-use-local-artifact'], dockerCrossCompile: Boolean(flags['docker-cross-compile']), + dockerNamespace: flags['docker-namespace'], dockerPush: Boolean(flags['docker-push']), dockerTag: flags['docker-tag'], dockerTagQualifier: flags['docker-tag-qualifier'], diff --git a/src/dev/build/build_distributables.ts b/src/dev/build/build_distributables.ts index 1e9b6cd114081..75fbbf21102e5 100644 --- a/src/dev/build/build_distributables.ts +++ b/src/dev/build/build_distributables.ts @@ -15,6 +15,7 @@ export interface BuildOptions { isRelease: boolean; dockerContextUseLocalArtifact: boolean | null; dockerCrossCompile: boolean; + dockerNamespace: string | null; dockerPush: boolean; dockerTag: string | null; dockerTagQualifier: string | null; diff --git a/src/dev/build/lib/build.test.ts b/src/dev/build/lib/build.test.ts index 083115072bafb..25248a721bd11 100644 --- a/src/dev/build/lib/build.test.ts +++ b/src/dev/build/lib/build.test.ts @@ -34,6 +34,7 @@ const config = new Config( }, false, false, + null, '', '', false, diff --git a/src/dev/build/lib/config.test.ts b/src/dev/build/lib/config.test.ts index ac58effdc31c1..7c966b7c3b751 100644 --- a/src/dev/build/lib/config.test.ts +++ b/src/dev/build/lib/config.test.ts @@ -31,6 +31,7 @@ const setup = async ({ targetAllPlatforms = true }: { targetAllPlatforms?: boole targetAllPlatforms, dockerContextUseLocalArtifact: false, dockerCrossCompile: false, + dockerNamespace: null, dockerPush: false, dockerTag: '', dockerTagQualifier: '', diff --git a/src/dev/build/lib/config.ts b/src/dev/build/lib/config.ts index 7b23465383fe0..2a28b71914e43 100644 --- a/src/dev/build/lib/config.ts +++ b/src/dev/build/lib/config.ts @@ -21,6 +21,7 @@ interface Options { versionQualifier?: string; dockerContextUseLocalArtifact: boolean | null; dockerCrossCompile: boolean; + dockerNamespace: string | null; dockerTag: string | null; dockerTagQualifier: string | null; dockerPush: boolean; @@ -36,6 +37,7 @@ export class Config { dockerTag, dockerTagQualifier, dockerPush, + dockerNamespace, }: Options) { const nodeVersion = kibanaPackageJson.engines?.node; if (!nodeVersion) { @@ -54,6 +56,7 @@ export class Config { }), dockerContextUseLocalArtifact, dockerCrossCompile, + dockerNamespace, dockerTag, dockerTagQualifier, dockerPush, @@ -69,6 +72,7 @@ export class Config { private readonly versionInfo: VersionInfo, private readonly dockerContextUseLocalArtifact: boolean | null, private readonly dockerCrossCompile: boolean, + private readonly dockerNamespace: string | null, private readonly dockerTag: string | null, private readonly dockerTagQualifier: string | null, private readonly dockerPush: boolean, @@ -110,6 +114,13 @@ export class Config { return this.dockerPush; } + /** + * Get docker repository namespace + */ + getDockerNamespace() { + return this.dockerNamespace; + } + /** * Use a local Kibana distribution when producing a docker context */ diff --git a/src/dev/build/lib/runner.test.ts b/src/dev/build/lib/runner.test.ts index a08063f1e6009..fc29e3ca33bdd 100644 --- a/src/dev/build/lib/runner.test.ts +++ b/src/dev/build/lib/runner.test.ts @@ -48,6 +48,7 @@ const setup = async () => { versionQualifier: '-SNAPSHOT', dockerContextUseLocalArtifact: false, dockerCrossCompile: false, + dockerNamespace: null, dockerPush: false, dockerTag: '', dockerTagQualifier: '', diff --git a/src/dev/build/tasks/nodejs/download_node_builds_task.test.ts b/src/dev/build/tasks/nodejs/download_node_builds_task.test.ts index ee44c8425bf92..5219499d85352 100644 --- a/src/dev/build/tasks/nodejs/download_node_builds_task.test.ts +++ b/src/dev/build/tasks/nodejs/download_node_builds_task.test.ts @@ -38,6 +38,7 @@ async function setup({ failOnUrl }: { failOnUrl?: string } = {}) { targetAllPlatforms: true, dockerContextUseLocalArtifact: false, dockerCrossCompile: false, + dockerNamespace: null, dockerPush: false, dockerTag: '', dockerTagQualifier: '', diff --git a/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts b/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts index 8e3b99678f73b..ab98ff87b6650 100644 --- a/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts +++ b/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts @@ -41,6 +41,7 @@ async function setup() { targetAllPlatforms: true, dockerContextUseLocalArtifact: false, dockerCrossCompile: false, + dockerNamespace: null, dockerPush: false, dockerTag: '', dockerTagQualifier: '', diff --git a/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts b/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts index 7c15230c2ef59..7663137f398a6 100644 --- a/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts +++ b/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts @@ -46,6 +46,7 @@ async function setup(actualShaSums?: Record) { targetAllPlatforms: true, dockerContextUseLocalArtifact: false, dockerCrossCompile: false, + dockerNamespace: null, dockerPush: false, dockerTag: '', dockerTagQualifier: '', diff --git a/src/dev/build/tasks/os_packages/docker_generator/run.ts b/src/dev/build/tasks/os_packages/docker_generator/run.ts index e141524da9a3d..a4b128f42be5c 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/run.ts +++ b/src/dev/build/tasks/os_packages/docker_generator/run.ts @@ -50,7 +50,13 @@ export async function runDockerGenerator( // General docker var config const license = 'Elastic License'; - const imageTag = `docker.elastic.co/kibana${flags.cloud ? '-ci' : ''}/kibana`; + const configuredNamespace = config.getDockerNamespace(); + const imageNamespace = configuredNamespace + ? configuredNamespace + : flags.cloud + ? 'kibana-ci' + : 'kibana'; + const imageTag = `docker.elastic.co/${imageNamespace}/kibana`; const version = config.getBuildVersion(); const artifactArchitecture = flags.architecture === 'aarch64' ? 'aarch64' : 'x86_64'; const artifactPrefix = `kibana-${version}-linux`; From a82e62f0cd29497a8dbbb5f2f7eff07ed14fbf2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Thu, 12 Jan 2023 16:13:14 +0100 Subject: [PATCH 19/39] Removes perlGuide from doc link service (#148803) --- packages/kbn-doc-links/src/get_doc_links.ts | 1 - packages/kbn-doc-links/src/types.ts | 1 - .../public/applications/shared/doc_links/doc_links.ts | 1 - 3 files changed, 3 deletions(-) diff --git a/packages/kbn-doc-links/src/get_doc_links.ts b/packages/kbn-doc-links/src/get_doc_links.ts index 12b2304bee8ad..24462ed7274e4 100644 --- a/packages/kbn-doc-links/src/get_doc_links.ts +++ b/packages/kbn-doc-links/src/get_doc_links.ts @@ -688,7 +688,6 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => { netIntroduction: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/net-api/${DOC_LINK_VERSION}/introduction.html`, netNest: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/net-api/${DOC_LINK_VERSION}/nest.html`, netSingleNode: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/net-api/${DOC_LINK_VERSION}/connecting.html#single-node`, - perlGuide: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/perl-api/${DOC_LINK_VERSION}/index.html`, phpConnecting: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/php-api/${DOC_LINK_VERSION}/connecting.html`, phpInstallation: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/php-api/${DOC_LINK_VERSION}/installation.html`, phpGuide: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/php-api/${DOC_LINK_VERSION}/index.html`, diff --git a/packages/kbn-doc-links/src/types.ts b/packages/kbn-doc-links/src/types.ts index 5d74b66f024f2..beebf4739028f 100644 --- a/packages/kbn-doc-links/src/types.ts +++ b/packages/kbn-doc-links/src/types.ts @@ -460,7 +460,6 @@ export interface DocLinks { readonly netIntroduction: string; readonly netNest: string; readonly netSingleNode: string; - readonly perlGuide: string; readonly phpGuide: string; readonly phpConnecting: string; readonly phpInstallation: string; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts b/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts index 9c773bb3cb3bd..4b391a70076ec 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts @@ -276,7 +276,6 @@ class DocLinks { this.clientsNetIntroduction = docLinks.links.clients.netIntroduction; this.clientsNetNest = docLinks.links.clients.netNest; this.clientsNetSingleNode = docLinks.links.clients.netSingleNode; - this.clientsPerlGuide = docLinks.links.clients.perlGuide; this.clientsPhpConnecting = docLinks.links.clients.phpConnecting; this.clientsPhpGuide = docLinks.links.clients.phpGuide; this.clientsPhpInstallation = docLinks.links.clients.phpInstallation; From 42cb6a26ab803da430c816f823f94e10bb04de97 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Fri, 13 Jan 2023 02:17:50 +1100 Subject: [PATCH 20/39] [main] Sync bundled packages with Package Storage (#148794) Automated by https://internal-ci.elastic.co/job/package_storage/job/sync-bundled-packages-job/job/main/1277/ Co-authored-by: apmmachine Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- fleet_packages.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fleet_packages.json b/fleet_packages.json index 8c6291cd979ee..2b938cc2e56c5 100644 --- a/fleet_packages.json +++ b/fleet_packages.json @@ -20,12 +20,12 @@ [ { "name": "apm", - "version": "8.7.0-preview-1670486478", + "version": "8.7.0-preview-1673519880", "forceAlignStackVersion": true }, { "name": "elastic_agent", - "version": "1.4.0" + "version": "1.4.1" }, { "name": "endpoint", @@ -37,10 +37,10 @@ }, { "name": "synthetics", - "version": "0.11.4" + "version": "0.11.5" }, { "name": "security_detection_engine", "version": "8.4.1" } -] +] \ No newline at end of file From a1923c5f6a8d05714c32521c940c9e74798bc61d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20C=C3=B4t=C3=A9?= Date: Thu, 12 Jan 2023 10:27:11 -0500 Subject: [PATCH 21/39] Make rule executors return state as an object property (#147891) In this PR, I'm changing the return type of rule executors from `return state;` to `return { state };`. This change had to touch all rule type executors so they return `state` as a key. In the future, the framework could accept more than `state` in the object, like warnings as an example. **Before:** ``` executor: async (...) { const state = {...}; return state; } ``` **After:** ``` executor: async (...) { const state = {...}; return { state }; } ``` **Future:** ``` executor: async (...) { return { state: {...}, warnings: [...], metrics: {...}, ... }; } ``` Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../server/alert_types/always_firing.ts | 4 +- .../server/alert_types/astros.ts | 4 +- .../alerting_authorization.test.ts | 4 +- x-pack/plugins/alerting/server/index.ts | 1 + x-pack/plugins/alerting/server/plugin.test.ts | 14 ++-- .../server/rule_type_registry.test.ts | 8 ++- .../rules_client/tests/bulk_delete.test.ts | 4 +- .../rules_client/tests/bulk_edit.test.ts | 12 +++- .../server/rules_client/tests/create.test.ts | 32 ++++++--- .../server/rules_client/tests/find.test.ts | 16 +++-- .../server/rules_client/tests/get.test.ts | 8 ++- .../alerting/server/rules_client/tests/lib.ts | 4 +- .../server/rules_client/tests/resolve.test.ts | 8 ++- .../server/rules_client/tests/update.test.ts | 16 +++-- .../rules_client_conflict_retries.test.ts | 8 ++- .../alerting/server/task_runner/fixtures.ts | 2 +- .../server/task_runner/task_runner.test.ts | 30 ++++++++- .../server/task_runner/task_runner.ts | 6 +- .../task_runner/task_runner_cancel.test.ts | 3 + x-pack/plugins/alerting/server/types.ts | 2 +- .../anomaly/register_anomaly_rule_type.ts | 6 +- .../register_error_count_rule_type.ts | 2 +- ...register_transaction_duration_rule_type.ts | 4 +- ...gister_transaction_error_rate_rule_type.ts | 4 +- .../inventory_metric_threshold_executor.ts | 4 +- .../log_threshold/log_threshold_executor.ts | 2 + .../metric_anomaly/metric_anomaly_executor.ts | 4 +- .../metric_threshold_executor.test.ts | 17 +++-- .../metric_threshold_executor.ts | 20 +++--- .../register_anomaly_detection_alert_type.ts | 2 + .../register_jobs_monitoring_rule_type.ts | 2 + .../lib/rules/slo_burn_rate/executor.ts | 17 ++++- x-pack/plugins/rule_registry/server/types.ts | 2 +- .../utils/create_lifecycle_executor.test.ts | 50 ++++++++------ .../server/utils/create_lifecycle_executor.ts | 16 +++-- .../utils/create_lifecycle_rule_type.test.ts | 5 +- .../create_persistence_rule_type_wrapper.ts | 4 +- .../server/utils/persistence_types.ts | 2 +- .../rule_preview/api/preview_rules/route.ts | 4 +- .../create_security_rule_type_wrapper.ts | 4 +- .../server/rule_types/es_query/executor.ts | 2 +- .../rule_types/es_query/rule_type.test.ts | 32 ++++++--- .../geo_containment/geo_containment.ts | 10 +-- .../tests/geo_containment.test.ts | 12 ++-- .../rule_types/index_threshold/rule_type.ts | 2 + .../status_rule/monitor_status_rule.ts | 4 +- .../lib/alerts/duration_anomaly.ts | 2 +- .../lib/alerts/status_check.test.ts | 20 +++--- .../legacy_uptime/lib/alerts/status_check.ts | 4 +- .../server/legacy_uptime/lib/alerts/tls.ts | 2 +- .../legacy_uptime/lib/alerts/tls_legacy.ts | 2 +- .../register_transform_health_rule_type.ts | 2 + .../plugins/alerts/server/alert_types.ts | 65 ++++++++++++++----- .../alerts_restricted/server/alert_types.ts | 8 ++- .../fixtures/plugins/alerts/server/plugin.ts | 1 + .../fixtures/plugins/alerts/server/plugin.ts | 10 ++- .../tests/trial/get_summarized_alerts.ts | 14 ++-- .../tests/trial/lifecycle_executor.ts | 16 +++-- 58 files changed, 388 insertions(+), 177 deletions(-) diff --git a/x-pack/examples/alerting_example/server/alert_types/always_firing.ts b/x-pack/examples/alerting_example/server/alert_types/always_firing.ts index a1fa6581f4aca..9735a640720f0 100644 --- a/x-pack/examples/alerting_example/server/alert_types/always_firing.ts +++ b/x-pack/examples/alerting_example/server/alert_types/always_firing.ts @@ -72,7 +72,9 @@ export const alertType: RuleType< }); return { - count, + state: { + count, + }, }; }, producer: ALERTING_EXAMPLE_APP_ID, diff --git a/x-pack/examples/alerting_example/server/alert_types/astros.ts b/x-pack/examples/alerting_example/server/alert_types/astros.ts index f929fbb2e0879..64accdc550298 100644 --- a/x-pack/examples/alerting_example/server/alert_types/astros.ts +++ b/x-pack/examples/alerting_example/server/alert_types/astros.ts @@ -75,7 +75,9 @@ export const alertType: RuleType< } return { - peopleInSpace, + state: { + peopleInSpace, + }, }; }, producer: ALERTING_EXAMPLE_APP_ID, diff --git a/x-pack/plugins/alerting/server/authorization/alerting_authorization.test.ts b/x-pack/plugins/alerting/server/authorization/alerting_authorization.test.ts index 1b102fa1a8f39..0857c4c18d6ae 100644 --- a/x-pack/plugins/alerting/server/authorization/alerting_authorization.test.ts +++ b/x-pack/plugins/alerting/server/authorization/alerting_authorization.test.ts @@ -192,7 +192,9 @@ beforeEach(() => { minimumLicenseRequired: 'basic', isExportable: true, recoveryActionGroup: RecoveredActionGroup, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'myApp', })); features.getKibanaFeatures.mockReturnValue([ diff --git a/x-pack/plugins/alerting/server/index.ts b/x-pack/plugins/alerting/server/index.ts index b26a50ee2a050..8d42aa47091f2 100644 --- a/x-pack/plugins/alerting/server/index.ts +++ b/x-pack/plugins/alerting/server/index.ts @@ -29,6 +29,7 @@ export type { AlertingApiRequestHandlerContext, RuleParamsAndRefs, GetSummarizedAlertsFnOpts, + ExecutorType, } from './types'; export { RuleNotifyWhen } from '../common'; export { DEFAULT_MAX_EPHEMERAL_ACTIONS_PER_ALERT } from './config'; diff --git a/x-pack/plugins/alerting/server/plugin.test.ts b/x-pack/plugins/alerting/server/plugin.test.ts index beda3850016d4..2c057cc4cfc43 100644 --- a/x-pack/plugins/alerting/server/plugin.test.ts +++ b/x-pack/plugins/alerting/server/plugin.test.ts @@ -52,7 +52,7 @@ const generateAlertingConfig = (): AlertingConfig => ({ }, }); -const sampleRuleType: RuleType = { +const sampleRuleType: RuleType = { id: 'test', name: 'test', minimumLicenseRequired: 'basic', @@ -60,7 +60,9 @@ const sampleRuleType: RuleType = { actionGroups: [], defaultActionGroupId: 'default', producer: 'test', - async executor() {}, + async executor() { + return { state: {} }; + }, }; describe('Alerting Plugin', () => { @@ -165,7 +167,7 @@ describe('Alerting Plugin', () => { const ruleType = { ...sampleRuleType, minimumLicenseRequired: 'basic', - } as RuleType; + } as RuleType; await setup.registerType(ruleType); expect(ruleType.ruleTaskTimeout).toBe('5m'); }); @@ -175,7 +177,7 @@ describe('Alerting Plugin', () => { ...sampleRuleType, minimumLicenseRequired: 'basic', ruleTaskTimeout: '20h', - } as RuleType; + } as RuleType; await setup.registerType(ruleType); expect(ruleType.ruleTaskTimeout).toBe('20h'); }); @@ -184,7 +186,7 @@ describe('Alerting Plugin', () => { const ruleType = { ...sampleRuleType, minimumLicenseRequired: 'basic', - } as RuleType; + } as RuleType; await setup.registerType(ruleType); expect(ruleType.cancelAlertsOnRuleTimeout).toBe(true); }); @@ -194,7 +196,7 @@ describe('Alerting Plugin', () => { ...sampleRuleType, minimumLicenseRequired: 'basic', cancelAlertsOnRuleTimeout: false, - } as RuleType; + } as RuleType; await setup.registerType(ruleType); expect(ruleType.cancelAlertsOnRuleTimeout).toBe(false); }); diff --git a/x-pack/plugins/alerting/server/rule_type_registry.test.ts b/x-pack/plugins/alerting/server/rule_type_registry.test.ts index 5ca22edaa9e04..8391d94576d13 100644 --- a/x-pack/plugins/alerting/server/rule_type_registry.test.ts +++ b/x-pack/plugins/alerting/server/rule_type_registry.test.ts @@ -685,15 +685,17 @@ function ruleTypeWithVariables( id: ActionGroupIds, context: string, state: string -): RuleType { - const baseAlert: RuleType = { +): RuleType { + const baseAlert: RuleType = { id, name: `${id}-name`, actionGroups: [], defaultActionGroupId: id, isExportable: true, minimumLicenseRequired: 'basic', - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', }; diff --git a/x-pack/plugins/alerting/server/rules_client/tests/bulk_delete.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/bulk_delete.test.ts index ec7d4d5ef008c..92621434dc7b9 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/bulk_delete.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/bulk_delete.test.ts @@ -119,7 +119,9 @@ describe('bulkDelete', () => { minimumLicenseRequired: 'basic', isExportable: true, recoveryActionGroup: RecoveredActionGroup, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', }); }); diff --git a/x-pack/plugins/alerting/server/rules_client/tests/bulk_edit.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/bulk_edit.test.ts index 652f243060c82..10df25fb2d997 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/bulk_edit.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/bulk_edit.test.ts @@ -156,7 +156,9 @@ describe('bulkEdit()', () => { minimumLicenseRequired: 'basic', isExportable: true, recoveryActionGroup: RecoveredActionGroup, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', }); }); @@ -1682,7 +1684,9 @@ describe('bulkEdit()', () => { param1: schema.string(), }), }, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', }); @@ -1724,7 +1728,9 @@ describe('bulkEdit()', () => { }, }, }, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', }); diff --git a/x-pack/plugins/alerting/server/rules_client/tests/create.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/create.test.ts index d01911177b2a3..050de16a68a84 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/create.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/create.test.ts @@ -1206,7 +1206,9 @@ describe('create()', () => { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', useSavedObjectReferences: { extractReferences: extractReferencesFn, @@ -1377,7 +1379,9 @@ describe('create()', () => { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', useSavedObjectReferences: { extractReferences: extractReferencesFn, @@ -2160,7 +2164,9 @@ describe('create()', () => { }, minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', }); await expect(rulesClient.create({ data })).rejects.toThrowErrorMatchingInlineSnapshot( @@ -2612,7 +2618,9 @@ describe('create()', () => { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', useSavedObjectReferences: { extractReferences: jest.fn(), @@ -2678,7 +2686,9 @@ describe('create()', () => { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', useSavedObjectReferences: { extractReferences: jest.fn(), @@ -2707,7 +2717,9 @@ describe('create()', () => { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', useSavedObjectReferences: { extractReferences: jest.fn(), @@ -2794,7 +2806,9 @@ describe('create()', () => { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', useSavedObjectReferences: { extractReferences: jest.fn(), @@ -2834,7 +2848,9 @@ describe('create()', () => { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', useSavedObjectReferences: { extractReferences: jest.fn(), diff --git a/x-pack/plugins/alerting/server/rules_client/tests/find.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/find.test.ts index 1b65d27c8e72e..200b4a291baa1 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/find.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/find.test.ts @@ -356,7 +356,9 @@ describe('find()', () => { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'myApp', })); ruleTypeRegistry.get.mockImplementationOnce(() => ({ @@ -367,7 +369,9 @@ describe('find()', () => { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', useSavedObjectReferences: { extractReferences: jest.fn(), @@ -552,7 +556,9 @@ describe('find()', () => { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'myApp', })); ruleTypeRegistry.get.mockImplementationOnce(() => ({ @@ -563,7 +569,9 @@ describe('find()', () => { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', useSavedObjectReferences: { extractReferences: jest.fn(), diff --git a/x-pack/plugins/alerting/server/rules_client/tests/get.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/get.test.ts index b7424ee467f43..4465dbffcc48a 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/get.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/get.test.ts @@ -214,7 +214,9 @@ describe('get()', () => { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', useSavedObjectReferences: { extractReferences: jest.fn(), @@ -335,7 +337,9 @@ describe('get()', () => { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', useSavedObjectReferences: { extractReferences: jest.fn(), diff --git a/x-pack/plugins/alerting/server/rules_client/tests/lib.ts b/x-pack/plugins/alerting/server/rules_client/tests/lib.ts index 6a1e84b38d039..7a17c2dc105ad 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/lib.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/lib.ts @@ -95,7 +95,9 @@ export function getBeforeSetup( defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', })); rulesClientParams.getEventLogClient.mockResolvedValue( diff --git a/x-pack/plugins/alerting/server/rules_client/tests/resolve.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/resolve.test.ts index b4a48be3a37fc..2caf948ea8753 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/resolve.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/resolve.test.ts @@ -266,7 +266,9 @@ describe('resolve()', () => { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', useSavedObjectReferences: { extractReferences: jest.fn(), @@ -397,7 +399,9 @@ describe('resolve()', () => { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', useSavedObjectReferences: { extractReferences: jest.fn(), diff --git a/x-pack/plugins/alerting/server/rules_client/tests/update.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/update.test.ts index 99a7c32004f46..8c18e887c7d03 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/update.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/update.test.ts @@ -151,7 +151,9 @@ describe('update()', () => { minimumLicenseRequired: 'basic', isExportable: true, recoveryActionGroup: RecoveredActionGroup, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', }); }); @@ -704,7 +706,9 @@ describe('update()', () => { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', useSavedObjectReferences: { extractReferences: extractReferencesFn, @@ -1201,7 +1205,9 @@ describe('update()', () => { param1: schema.string(), }), }, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', }); await expect( @@ -1575,7 +1581,9 @@ describe('update()', () => { minimumLicenseRequired: 'basic', isExportable: true, recoveryActionGroup: RecoveredActionGroup, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', }); encryptedSavedObjects.getDecryptedAsInternalUser.mockResolvedValueOnce({ diff --git a/x-pack/plugins/alerting/server/rules_client_conflict_retries.test.ts b/x-pack/plugins/alerting/server/rules_client_conflict_retries.test.ts index b71cc0276dc64..bafb7b78293be 100644 --- a/x-pack/plugins/alerting/server/rules_client_conflict_retries.test.ts +++ b/x-pack/plugins/alerting/server/rules_client_conflict_retries.test.ts @@ -353,7 +353,9 @@ beforeEach(() => { minimumLicenseRequired: 'basic', isExportable: true, recoveryActionGroup: RecoveredActionGroup, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', })); @@ -365,7 +367,9 @@ beforeEach(() => { minimumLicenseRequired: 'basic', isExportable: true, recoveryActionGroup: RecoveredActionGroup, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', }); diff --git a/x-pack/plugins/alerting/server/task_runner/fixtures.ts b/x-pack/plugins/alerting/server/task_runner/fixtures.ts index f226ac94d7f63..f841e2e1ff04f 100644 --- a/x-pack/plugins/alerting/server/task_runner/fixtures.ts +++ b/x-pack/plugins/alerting/server/task_runner/fixtures.ts @@ -284,7 +284,7 @@ export const generateRunnerResult = ({ state: { ...(state && { alertInstances }), ...(state && { alertRecoveredInstances }), - ...(state && { alertTypeState: undefined }), + ...(state && { alertTypeState: {} }), ...(state && { previousStartedAt: new Date('1970-01-01T00:00:00.000Z') }), ...(state && { summaryActions }), }, diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts index 1dbb3b4a55612..629b9ebea1eff 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts @@ -215,6 +215,8 @@ describe('Task Runner', () => { alertingEventLogger.getStartAndDuration.mockImplementation(() => ({ start: new Date() })); (AlertingEventLogger as jest.Mock).mockImplementation(() => alertingEventLogger); logger.get.mockImplementation(() => logger); + + ruleType.executor.mockResolvedValue({ state: {} }); }); test('successfully executes the task', async () => { @@ -322,6 +324,7 @@ describe('Task Runner', () => { string >) => { executorServices.alertFactory.create('1').scheduleActions('default'); + return { state: {} }; } ); const taskRunner = new TaskRunner( @@ -404,6 +407,7 @@ describe('Task Runner', () => { string >) => { executorServices.alertFactory.create('1').scheduleActions('default'); + return { state: {} }; } ); const taskRunner = new TaskRunner( @@ -529,6 +533,7 @@ describe('Task Runner', () => { string >) => { executorServices.alertFactory.create('1').scheduleActions('default'); + return { state: {} }; } ); const taskRunner = new TaskRunner( @@ -582,6 +587,7 @@ describe('Task Runner', () => { >) => { executorServices.alertFactory.create('1').scheduleActions('default'); executorServices.alertFactory.create('2').scheduleActions('default'); + return { state: {} }; } ); const taskRunner = new TaskRunner( @@ -648,6 +654,7 @@ describe('Task Runner', () => { >) => { executorServices.alertFactory.create('1').scheduleActions('default'); executorServices.alertFactory.create('2').scheduleActions('default'); + return { state: {} }; } ); const taskRunner = new TaskRunner( @@ -710,6 +717,7 @@ describe('Task Runner', () => { >) => { executorServices.alertFactory.create('1').scheduleActions('default'); executorServices.alertFactory.create('2').scheduleActions('default'); + return { state: {} }; } ); const taskRunner = new TaskRunner( @@ -750,6 +758,7 @@ describe('Task Runner', () => { string >) => { executorServices.alertFactory.create('1').scheduleActions('default'); + return { state: {} }; } ); const taskRunner = new TaskRunner( @@ -822,6 +831,7 @@ describe('Task Runner', () => { string >) => { executorServices.alertFactory.create('1').scheduleActions('default'); + return { state: {} }; } ); const taskRunner = new TaskRunner( @@ -897,6 +907,7 @@ describe('Task Runner', () => { string >) => { executorServices.alertFactory.create('1').scheduleActions('default'); + return { state: {} }; } ); const taskRunner = new TaskRunner( @@ -988,6 +999,7 @@ describe('Task Runner', () => { string >) => { executorServices.alertFactory.create('1').scheduleActions('default'); + return { state: {} }; } ); const taskRunner = new TaskRunner( @@ -1131,6 +1143,7 @@ describe('Task Runner', () => { // create an instance, but don't schedule any actions, so it doesn't go active executorServices.alertFactory.create('3'); + return { state: {} }; } ); const taskRunner = new TaskRunner( @@ -1236,6 +1249,7 @@ describe('Task Runner', () => { string >) => { executorServices.alertFactory.create('1').scheduleActions('default'); + return { state: {} }; } ); const taskRunner = new TaskRunner( @@ -1333,6 +1347,7 @@ describe('Task Runner', () => { string >) => { executorServices.alertFactory.create('1').scheduleActions('default'); + return { state: {} }; } ); @@ -1408,6 +1423,7 @@ describe('Task Runner', () => { string >) => { executorServices.alertFactory.create('1').scheduleActions('default'); + return { state: {} }; } ); @@ -1478,6 +1494,7 @@ describe('Task Runner', () => { string >) => { executorServices.alertFactory.create('1').scheduleActions('default'); + return { state: {} }; } ); const date = new Date().toISOString(); @@ -1869,6 +1886,7 @@ describe('Task Runner', () => { >) => { executorServices.alertFactory.create('1').scheduleActions('default'); executorServices.alertFactory.create('2').scheduleActions('default'); + return { state: {} }; } ); const taskRunner = new TaskRunner( @@ -1959,6 +1977,7 @@ describe('Task Runner', () => { >) => { executorServices.alertFactory.create('1').scheduleActions('default'); executorServices.alertFactory.create('2').scheduleActions('default'); + return { state: {} }; } ); const taskRunner = new TaskRunner( @@ -2042,6 +2061,7 @@ describe('Task Runner', () => { >) => { executorServices.alertFactory.create('1').scheduleActions('default'); executorServices.alertFactory.create('2').scheduleActions('default'); + return { state: {} }; } ); const taskRunner = new TaskRunner( @@ -2104,7 +2124,9 @@ describe('Task Runner', () => { test('end is logged for active alerts when alert state contains start time and alert recovers', async () => { taskRunnerFactoryInitializerParams.actionsPlugin.isActionTypeEnabled.mockReturnValue(true); taskRunnerFactoryInitializerParams.actionsPlugin.isActionExecutable.mockReturnValue(true); - ruleType.executor.mockImplementation(async () => {}); + ruleType.executor.mockImplementation(async () => { + return { state: {} }; + }); const taskRunner = new TaskRunner( ruleType, { @@ -2185,7 +2207,9 @@ describe('Task Runner', () => { AlertInstanceState, AlertInstanceContext, string - >) => {} + >) => { + return { state: {} }; + } ); const taskRunner = new TaskRunner( ruleType, @@ -2513,6 +2537,7 @@ describe('Task Runner', () => { string >) => { executorServices.alertFactory.create('1').scheduleActions('default'); + return { state: {} }; } ); @@ -2678,6 +2703,7 @@ describe('Task Runner', () => { >) => { executorServices.alertFactory.create('1').scheduleActions('default'); executorServices.alertFactory.create('2').scheduleActions('default'); + return { state: {} }; } ); diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.ts index 9f72b7a02d651..3c9aaed394971 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.ts @@ -331,7 +331,7 @@ export class TaskRunner< return reachedLimit; }; - let updatedState: void | Record; + let executorResult: { state: RuleState } | undefined; try { const ctx = { type: 'alert', @@ -351,7 +351,7 @@ export class TaskRunner< scopedClusterClient.asInternalUser ); - updatedState = await this.context.executionContext.withContext(ctx, () => + executorResult = await this.context.executionContext.withContext(ctx, () => this.ruleType.executor({ executionId: this.executionId, services: { @@ -428,7 +428,7 @@ export class TaskRunner< return { originalAlerts: alertsCopy, originalRecoveredAlerts: recoveredAlerts, - updatedRuleTypeState: updatedState || undefined, + updatedRuleTypeState: executorResult?.state || undefined, hasReachedAlertLimit: alertFactory.hasReachedAlertLimit(), }; }); diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts b/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts index e36968197bb41..6090df1230b27 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts @@ -274,6 +274,7 @@ describe('Task Runner Cancel', () => { string >) => { executorServices.alertFactory.create('1').scheduleActions('default'); + return { state: {} }; } ); // setting cancelAlertsOnRuleTimeout to false here @@ -341,6 +342,7 @@ describe('Task Runner Cancel', () => { string >) => { executorServices.alertFactory.create('1').scheduleActions('default'); + return { state: {} }; } ); // setting cancelAlertsOnRuleTimeout for ruleType to false here @@ -402,6 +404,7 @@ describe('Task Runner Cancel', () => { string >) => { executorServices.alertFactory.create('1').scheduleActions('default'); + return { state: {} }; } ); const taskRunner = new TaskRunner( diff --git a/x-pack/plugins/alerting/server/types.ts b/x-pack/plugins/alerting/server/types.ts index 30e8d864b4871..c0399779a62df 100644 --- a/x-pack/plugins/alerting/server/types.ts +++ b/x-pack/plugins/alerting/server/types.ts @@ -123,7 +123,7 @@ export type ExecutorType< ActionGroupIds extends string = never > = ( options: RuleExecutorOptions -) => Promise; +) => Promise<{ state: State }>; export interface RuleTypeParamsValidator { validate: (object: unknown) => Params; diff --git a/x-pack/plugins/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts b/x-pack/plugins/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts index 889b249ceca3b..529efb583b7dd 100644 --- a/x-pack/plugins/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts +++ b/x-pack/plugins/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts @@ -108,7 +108,7 @@ export function registerAnomalyRuleType({ isExportable: true, executor: async ({ params, services, spaceId }) => { if (!ml) { - return {}; + return { state: {} }; } const { savedObjectsClient, scopedClusterClient, getAlertUuid } = @@ -143,7 +143,7 @@ export function registerAnomalyRuleType({ const threshold = selectedOption.threshold; if (mlJobs.length === 0) { - return {}; + return { state: {} }; } // start time must be at least 30, does like this to support rules created before this change where default was 15 @@ -337,7 +337,7 @@ export function registerAnomalyRuleType({ }); } - return {}; + return { state: {} }; }, }) ); diff --git a/x-pack/plugins/apm/server/routes/alerts/rule_types/error_count/register_error_count_rule_type.ts b/x-pack/plugins/apm/server/routes/alerts/rule_types/error_count/register_error_count_rule_type.ts index 276e817093f40..54bfb00d468b0 100644 --- a/x-pack/plugins/apm/server/routes/alerts/rule_types/error_count/register_error_count_rule_type.ts +++ b/x-pack/plugins/apm/server/routes/alerts/rule_types/error_count/register_error_count_rule_type.ts @@ -223,7 +223,7 @@ export function registerErrorCountRuleType({ }); }); - return {}; + return { state: {} }; }, }) ); diff --git a/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.ts b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.ts index 56cf1fc466584..b55e2888c3c7f 100644 --- a/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.ts +++ b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.ts @@ -199,7 +199,7 @@ export function registerTransactionDurationRuleType({ }); if (!response.aggregations) { - return {}; + return { state: {} }; } // Converts threshold to microseconds because this is the unit used on transactionDuration @@ -299,7 +299,7 @@ export function registerTransactionDurationRuleType({ }); } - return {}; + return { state: {} }; }, }); diff --git a/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts index cda1c0a9f2f88..308ed32e3b5a1 100644 --- a/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts +++ b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts @@ -193,7 +193,7 @@ export function registerTransactionErrorRateRuleType({ }); if (!response.aggregations) { - return {}; + return { state: {} }; } const results = []; @@ -295,7 +295,7 @@ export function registerTransactionErrorRateRuleType({ }); }); - return {}; + return { state: {} }; }, }) ); diff --git a/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts b/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts index 57459b5939870..cb3ab0f834f96 100644 --- a/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts +++ b/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts @@ -130,7 +130,7 @@ export const createInventoryMetricThresholdExecutor = (libs: InfraBackendLibs) = }), }); - return {}; + return { state: {} }; } } const source = await libs.sources.getSourceConfiguration(savedObjectsClient, sourceId); @@ -277,6 +277,8 @@ export const createInventoryMetricThresholdExecutor = (libs: InfraBackendLibs) = const stopTime = Date.now(); logger.debug(`Scheduled ${scheduledActionsCount} actions in ${stopTime - startTime}ms`); + + return { state: {} }; }); const formatThreshold = (metric: SnapshotMetricType, value: number | number[]) => { diff --git a/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.ts b/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.ts index d4d6415ea88e7..9d0798cd0c717 100644 --- a/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.ts +++ b/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.ts @@ -206,6 +206,8 @@ export const createLogThresholdExecutor = (libs: InfraBackendLibs) => } catch (e) { throw new Error(e); } + + return { state: {} }; }); export async function executeAlert( diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_anomaly/metric_anomaly_executor.ts b/x-pack/plugins/infra/server/lib/alerting/metric_anomaly/metric_anomaly_executor.ts index bd37f25c5fd37..b6d583cb17e6b 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_anomaly/metric_anomaly_executor.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_anomaly/metric_anomaly_executor.ts @@ -41,7 +41,7 @@ export const createMetricAnomalyExecutor = MetricAnomalyAllowedActionGroups >) => { if (!ml) { - return; + return { state: {} }; } const request = {} as KibanaRequest; const mlSystem = ml.mlSystemProvider(request, services.savedObjectsClient); @@ -96,6 +96,8 @@ export const createMetricAnomalyExecutor = influencers: influencers.join(', '), }); } + + return { state: {} }; }; export const FIRED_ACTIONS_ID = 'metrics.anomaly.fired'; diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts index f9b1a79742c38..9a6daf86be040 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts @@ -428,7 +428,12 @@ describe('The metric threshold alert type', () => { }, }, ]); - const stateResult1 = await execute(Comparator.GT, [0.75], ['something'], 'test.metric.2'); + const { state: stateResult1 } = await execute( + Comparator.GT, + [0.75], + ['something'], + 'test.metric.2' + ); expect(stateResult1.missingGroups).toEqual(expect.arrayContaining([])); setEvaluationResults([ { @@ -470,7 +475,7 @@ describe('The metric threshold alert type', () => { }, }, ]); - const stateResult2 = await execute( + const { state: stateResult2 } = await execute( Comparator.GT, [0.75], ['something'], @@ -508,7 +513,7 @@ describe('The metric threshold alert type', () => { }, }, ]); - const stateResult3 = await execute( + const { state: stateResult3 } = await execute( Comparator.GT, [0.75], ['something', 'something-else'], @@ -583,7 +588,7 @@ describe('The metric threshold alert type', () => { }, }, ]); - const stateResult1 = await executeWithFilter( + const { state: stateResult1 } = await executeWithFilter( Comparator.GT, [0.75], JSON.stringify({ query: 'q' }), @@ -630,7 +635,7 @@ describe('The metric threshold alert type', () => { }, }, ]); - const stateResult2 = await executeWithFilter( + const { state: stateResult2 } = await executeWithFilter( Comparator.GT, [0.75], JSON.stringify({ query: 'q' }), @@ -668,7 +673,7 @@ describe('The metric threshold alert type', () => { }, }, ]); - const stateResult3 = await executeWithFilter( + const { state: stateResult3 } = await executeWithFilter( Comparator.GT, [0.75], JSON.stringify({ query: 'different' }), diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts index 5857373a7ba25..07af8bbcafe22 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts @@ -144,10 +144,12 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs) => }); return { - lastRunTimestamp: startedAt.valueOf(), - missingGroups: [], - groupBy: params.groupBy, - filterQuery: params.filterQuery, + state: { + lastRunTimestamp: startedAt.valueOf(), + missingGroups: [], + groupBy: params.groupBy, + filterQuery: params.filterQuery, + }, }; } } @@ -328,10 +330,12 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs) => const stopTime = Date.now(); logger.debug(`Scheduled ${scheduledActionsCount} actions in ${stopTime - startTime}ms`); return { - lastRunTimestamp: startedAt.valueOf(), - missingGroups: [...nextMissingGroups], - groupBy: params.groupBy, - filterQuery: params.filterQuery, + state: { + lastRunTimestamp: startedAt.valueOf(), + missingGroups: [...nextMissingGroups], + groupBy: params.groupBy, + filterQuery: params.filterQuery, + }, }; }); diff --git a/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts b/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts index 442267c2c98d8..7cee5917f6567 100644 --- a/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts +++ b/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts @@ -158,6 +158,8 @@ export function registerAnomalyDetectionAlertType({ recoveredAlert.setContext(executionResult.context); } } + + return { state: {} }; }, }); } diff --git a/x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts b/x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts index 5c75cec536944..81a2a1462d720 100644 --- a/x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts +++ b/x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts @@ -179,6 +179,8 @@ export function registerJobsMonitoringRuleType({ recoveredAlert.setContext(testResult.context); } } + + return { state: {} }; }, }); } diff --git a/x-pack/plugins/observability/server/lib/rules/slo_burn_rate/executor.ts b/x-pack/plugins/observability/server/lib/rules/slo_burn_rate/executor.ts index 38ac4e4eb32d6..96732747bdce7 100644 --- a/x-pack/plugins/observability/server/lib/rules/slo_burn_rate/executor.ts +++ b/x-pack/plugins/observability/server/lib/rules/slo_burn_rate/executor.ts @@ -13,6 +13,7 @@ import { ALERT_REASON, } from '@kbn/rule-data-utils'; import { LifecycleRuleExecutor } from '@kbn/rule-registry-plugin/server'; +import { ExecutorType } from '@kbn/alerting-plugin/server'; import { Duration, toDurationUnit } from '../../../domain/models'; import { DefaultSLIClient, KibanaSavedObjectsSLORepository } from '../../../services/slo'; @@ -36,7 +37,19 @@ export const getRuleExecutor = (): LifecycleRuleExecutor< BurnRateAlertContext, BurnRateAllowedActionGroups > => - async function executor({ services, params, startedAt }): Promise { + async function executor({ + services, + params, + startedAt, + }): ReturnType< + ExecutorType< + BurnRateRuleParams, + BurnRateRuleTypeState, + BurnRateAlertState, + BurnRateAlertContext, + BurnRateAllowedActionGroups + > + > { const { alertWithLifecycle, savedObjectsClient: soClient, @@ -111,6 +124,8 @@ export const getRuleExecutor = (): LifecycleRuleExecutor< recoveredAlert.setContext(context); } + + return { state: {} }; }; const FIRED_ACTION_ID = 'slo.burnRate.fired'; diff --git a/x-pack/plugins/rule_registry/server/types.ts b/x-pack/plugins/rule_registry/server/types.ts index 6a7d5b849c771..18e7226c82857 100644 --- a/x-pack/plugins/rule_registry/server/types.ts +++ b/x-pack/plugins/rule_registry/server/types.ts @@ -30,7 +30,7 @@ export type AlertTypeExecutor< options: Parameters['executor']>[0] & { services: TServices; } -) => Promise; +) => Promise<{ state: TState }>; export type AlertTypeWithExecutor< TState extends RuleTypeState = {}, diff --git a/x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.test.ts b/x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.test.ts index 5e43223480428..8e847b4c376fc 100644 --- a/x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.test.ts +++ b/x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.test.ts @@ -44,10 +44,10 @@ describe('createLifecycleExecutor', () => { aRuleStateKey: 'NEXT_RULE_STATE_VALUE', }; - return nextRuleState; + return { state: nextRuleState }; }); - const newRuleState = await executor( + const newExecutorResult = await executor( createDefaultAlertExecutorOptions({ params: {}, state: { wrapped: initialRuleState, trackedAlerts: {}, trackedAlertsRecovered: {} }, @@ -55,7 +55,7 @@ describe('createLifecycleExecutor', () => { }) ); - expect(newRuleState).toEqual({ + expect(newExecutorResult.state).toEqual({ wrapped: { aRuleStateKey: 'NEXT_RULE_STATE_VALUE', }, @@ -80,7 +80,7 @@ describe('createLifecycleExecutor', () => { fields: {}, }); - return state; + return { state }; }); await executor( @@ -181,7 +181,7 @@ describe('createLifecycleExecutor', () => { fields: {}, }); - return state; + return { state }; }); await executor( @@ -302,7 +302,7 @@ describe('createLifecycleExecutor', () => { fields: {}, }); - return state; + return { state }; }); await executor( @@ -381,7 +381,7 @@ describe('createLifecycleExecutor', () => { aRuleStateKey: 'NEXT_RULE_STATE_VALUE', }; - return nextRuleState; + return { state: nextRuleState }; }); await executor( @@ -410,7 +410,7 @@ describe('createLifecycleExecutor', () => { aRuleStateKey: 'NEXT_RULE_STATE_VALUE', }; - return nextRuleState; + return { state: nextRuleState }; }); await expect(() => @@ -442,10 +442,12 @@ describe('createLifecycleExecutor', () => { fields: {}, }); - return state; + return { state }; }); - const { trackedAlerts, trackedAlertsRecovered } = await executor( + const { + state: { trackedAlerts, trackedAlertsRecovered }, + } = await executor( createDefaultAlertExecutorOptions({ params: {}, state: { wrapped: initialRuleState, trackedAlerts: {}, trackedAlertsRecovered: {} }, @@ -530,10 +532,12 @@ describe('createLifecycleExecutor', () => { fields: {}, }); - return state; + return { state }; }); - const { trackedAlerts, trackedAlertsRecovered } = await executor( + const { + state: { trackedAlerts, trackedAlertsRecovered }, + } = await executor( createDefaultAlertExecutorOptions({ alertId: 'TEST_ALERT_0', params: {}, @@ -638,10 +642,12 @@ describe('createLifecycleExecutor', () => { fields: {}, }); - return state; + return { state }; }); - const { trackedAlerts, trackedAlertsRecovered } = await executor( + const { + state: { trackedAlerts, trackedAlertsRecovered }, + } = await executor( createDefaultAlertExecutorOptions({ alertId: 'TEST_ALERT_0', params: {}, @@ -741,10 +747,12 @@ describe('createLifecycleExecutor', () => { fields: {}, }); - return state; + return { state }; }); - const { trackedAlerts, trackedAlertsRecovered } = await executor( + const { + state: { trackedAlerts, trackedAlertsRecovered }, + } = await executor( createDefaultAlertExecutorOptions({ alertId: 'TEST_ALERT_0', params: {}, @@ -845,10 +853,12 @@ describe('createLifecycleExecutor', () => { fields: {}, }); - return state; + return { state }; }); - const { trackedAlerts, trackedAlertsRecovered } = await executor( + const { + state: { trackedAlerts, trackedAlertsRecovered }, + } = await executor( createDefaultAlertExecutorOptions({ alertId: 'TEST_ALERT_0', params: {}, @@ -990,7 +1000,7 @@ describe('createLifecycleExecutor', () => { fields: {}, }); - return state; + return { state }; }); await executor( @@ -1153,7 +1163,7 @@ describe('createLifecycleExecutor', () => { logger, ruleDataClientMock )<{}, TestRuleState, never, never, never>(async ({ services, state }) => { - return state; + return { state }; }); await executor( diff --git a/x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.ts b/x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.ts index f2b71351b1ce1..6dcafd8b2bb2c 100644 --- a/x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.ts +++ b/x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.ts @@ -92,7 +92,7 @@ export type LifecycleRuleExecutor< ActionGroupIds, LifecycleAlertServices > -) => Promise; +) => Promise<{ state: State }>; const trackedAlertStateRt = rt.type({ alertId: rt.string, @@ -126,7 +126,7 @@ const wrappedStateRt = () => * factory function. */ export type WrappedLifecycleRuleState = RuleTypeState & { - wrapped: State | void; + wrapped: State; trackedAlerts: Record; trackedAlertsRecovered: Record; }; @@ -156,7 +156,7 @@ export const createLifecycleExecutor = InstanceContext, ActionGroupIds > - ): Promise> => { + ): Promise<{ state: WrappedLifecycleRuleState }> => { const { services: { alertFactory, shouldWriteAlerts }, state: previousState, @@ -207,7 +207,7 @@ export const createLifecycleExecutor = }, }; - const nextWrappedState = await wrappedExecutor({ + const wrappedExecutorResult = await wrappedExecutor({ ...options, state: state.wrapped != null ? state.wrapped : ({} as State), services: { @@ -381,8 +381,10 @@ export const createLifecycleExecutor = ); return { - wrapped: nextWrappedState ?? ({} as State), - trackedAlerts: writeAlerts ? nextTrackedAlerts : {}, - trackedAlertsRecovered: writeAlerts ? nextTrackedAlertsRecovered : {}, + state: { + wrapped: wrappedExecutorResult?.state ?? ({} as State), + trackedAlerts: writeAlerts ? nextTrackedAlerts : {}, + trackedAlertsRecovered: writeAlerts ? nextTrackedAlertsRecovered : {}, + }, }; }; diff --git a/x-pack/plugins/rule_registry/server/utils/create_lifecycle_rule_type.test.ts b/x-pack/plugins/rule_registry/server/utils/create_lifecycle_rule_type.test.ts index 77b91efa88eed..287f09421f2ad 100644 --- a/x-pack/plugins/rule_registry/server/utils/create_lifecycle_rule_type.test.ts +++ b/x-pack/plugins/rule_registry/server/utils/create_lifecycle_rule_type.test.ts @@ -53,6 +53,7 @@ function createRule(shouldWriteAlerts: boolean = true) { services.alertWithLifecycle(alert); }); nextAlerts = []; + return { state: {} }; }, id: 'ruleTypeId', isExportable: true, @@ -96,7 +97,7 @@ function createRule(shouldWriteAlerts: boolean = true) { scheduleActions.mockClear(); - state = ((await type.executor({ + ({ state } = ((await type.executor({ executionId: 'b33f65d7-6e8b-4aae-8d20-c93613dec9f9', logger: loggerMock.create(), namespace: 'namespace', @@ -137,7 +138,7 @@ function createRule(shouldWriteAlerts: boolean = true) { spaceId: 'spaceId', startedAt, state, - })) ?? {}) as Record; + })) ?? {}) as Record); previousStartedAt = startedAt; }, diff --git a/x-pack/plugins/rule_registry/server/utils/create_persistence_rule_type_wrapper.ts b/x-pack/plugins/rule_registry/server/utils/create_persistence_rule_type_wrapper.ts index 8c5265dfedfea..3c67eb8bc8da4 100644 --- a/x-pack/plugins/rule_registry/server/utils/create_persistence_rule_type_wrapper.ts +++ b/x-pack/plugins/rule_registry/server/utils/create_persistence_rule_type_wrapper.ts @@ -19,7 +19,7 @@ export const createPersistenceRuleTypeWrapper: CreatePersistenceRuleTypeWrapper return { ...type, executor: async (options) => { - const state = await type.executor({ + const result = await type.executor({ ...options, services: { ...options.services, @@ -149,7 +149,7 @@ export const createPersistenceRuleTypeWrapper: CreatePersistenceRuleTypeWrapper }, }); - return state; + return result; }, getSummarizedAlerts: createGetSummarizedAlertsFn({ ruleDataClient, diff --git a/x-pack/plugins/rule_registry/server/utils/persistence_types.ts b/x-pack/plugins/rule_registry/server/utils/persistence_types.ts index 63d9cfdd55aea..2a1aaf331478f 100644 --- a/x-pack/plugins/rule_registry/server/utils/persistence_types.ts +++ b/x-pack/plugins/rule_registry/server/utils/persistence_types.ts @@ -69,7 +69,7 @@ export type PersistenceAlertType< > & { services: PersistenceServices; } - ) => Promise; + ) => Promise<{ state: TState }>; }; export type CreatePersistenceRuleTypeWrapper = (options: { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts index 9efb64c9582a6..57d5e67234b88 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts @@ -237,7 +237,7 @@ export const previewRulesRoute = async ( while (invocationCount > 0 && !isAborted) { invocationStartTime = moment(); - statePreview = (await executor({ + ({ state: statePreview } = (await executor({ executionId: uuid.v4(), params, previousStartedAt, @@ -263,7 +263,7 @@ export const previewRulesRoute = async ( startedAt: startedAt.toDate(), state: statePreview, logger, - })) as TState; + })) as { state: TState }); const errors = loggedStatusChanges .filter((item) => item.newStatus === RuleExecutionStatus.failed) diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_wrapper.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_wrapper.ts index 261d06b9be294..9c6b80f80fd79 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_wrapper.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_wrapper.ts @@ -190,7 +190,7 @@ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper = message: errorMessage, }); - return result.state; + return { state: result.state }; } } @@ -498,7 +498,7 @@ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper = } } - return result.state; + return { state: result.state }; }); }, }); diff --git a/x-pack/plugins/stack_alerts/server/rule_types/es_query/executor.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/executor.ts index 6a690e745bdc2..1b0f0437b74d8 100644 --- a/x-pack/plugins/stack_alerts/server/rule_types/es_query/executor.ts +++ b/x-pack/plugins/stack_alerts/server/rule_types/es_query/executor.ts @@ -161,7 +161,7 @@ export async function executor(core: CoreSetup, options: ExecutorOptions { expect(result).toMatchInlineSnapshot(` Object { - "latestTimestamp": undefined, + "state": Object { + "latestTimestamp": undefined, + }, } `); }); @@ -218,7 +220,9 @@ describe('ruleType', () => { }); expect(result).toMatchObject({ - latestTimestamp: new Date(newestDocumentTimestamp).toISOString(), + state: { + latestTimestamp: new Date(newestDocumentTimestamp).toISOString(), + }, }); }); @@ -270,7 +274,9 @@ describe('ruleType', () => { }); expect(result).toMatchObject({ - latestTimestamp: new Date(newestDocumentTimestamp).toISOString(), + state: { + latestTimestamp: new Date(newestDocumentTimestamp).toISOString(), + }, }); }); @@ -316,7 +322,9 @@ describe('ruleType', () => { }); expect(result).toMatchObject({ - latestTimestamp: new Date(oldestDocumentTimestamp).toISOString(), + state: { + latestTimestamp: new Date(oldestDocumentTimestamp).toISOString(), + }, }); }); @@ -358,7 +366,7 @@ describe('ruleType', () => { dateEnd: expect.any(String), }); - expect(result).toMatchObject({ + expect(result?.state).toMatchObject({ latestTimestamp: new Date(oldestDocumentTimestamp).toISOString(), }); @@ -379,7 +387,7 @@ describe('ruleType', () => { const secondResult = await invokeExecutor({ params, ruleServices, - state: result as EsQueryRuleState, + state: result?.state as EsQueryRuleState, }); const existingInstance: AlertInstanceMock = @@ -391,7 +399,9 @@ describe('ruleType', () => { }); expect(secondResult).toMatchObject({ - latestTimestamp: new Date(newestDocumentTimestamp).toISOString(), + state: { + latestTimestamp: new Date(newestDocumentTimestamp).toISOString(), + }, }); }); @@ -440,7 +450,9 @@ describe('ruleType', () => { }); expect(result).toMatchObject({ - latestTimestamp: new Date(oldestDocumentTimestamp).toISOString(), + state: { + latestTimestamp: new Date(oldestDocumentTimestamp).toISOString(), + }, }); }); @@ -490,7 +502,9 @@ describe('ruleType', () => { }); expect(result).toMatchObject({ - latestTimestamp: new Date(oldestDocumentTimestamp - 1000).toISOString(), + state: { + latestTimestamp: new Date(oldestDocumentTimestamp - 1000).toISOString(), + }, }); }); }); diff --git a/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/geo_containment.ts b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/geo_containment.ts index 1d6c58af8c0bf..46656feaae407 100644 --- a/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/geo_containment.ts +++ b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/geo_containment.ts @@ -146,7 +146,7 @@ export const getGeoContainmentExecutor = (): GeoContainmentAlertType['executor'] rule: { id: ruleId }, state, logger, - }): Promise { + }): Promise<{ state: GeoContainmentState }> { const { shapesFilters, shapesIdsNamesMap } = state.shapesFilters ? state : await getShapesFilters( @@ -218,8 +218,10 @@ export const getGeoContainmentExecutor = (): GeoContainmentAlertType['executor'] } return { - shapesFilters, - shapesIdsNamesMap, - prevLocationMap: Object.fromEntries(activeEntities), + state: { + shapesFilters, + shapesIdsNamesMap, + prevLocationMap: Object.fromEntries(activeEntities), + }, }; }; diff --git a/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/geo_containment.test.ts b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/geo_containment.test.ts index fe7ed6c1cf424..14ab96684ed63 100644 --- a/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/geo_containment.test.ts +++ b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/geo_containment.test.ts @@ -574,7 +574,7 @@ describe('geo_containment', () => { // @ts-ignore state: {}, }); - if (executionResult && executionResult.shapesFilters) { + if (executionResult && executionResult.state.shapesFilters) { expect(boundaryCall.mock.calls.length).toBe(1); expect(esAggCall.mock.calls.length).toBe(1); } @@ -596,7 +596,7 @@ describe('geo_containment', () => { }, state: geoContainmentState, }); - if (executionResult && executionResult.shapesFilters) { + if (executionResult && executionResult.state.shapesFilters) { expect(boundaryCall.mock.calls.length).toBe(0); expect(esAggCall.mock.calls.length).toBe(1); } @@ -618,8 +618,8 @@ describe('geo_containment', () => { }, state: geoContainmentState, }); - if (executionResult && executionResult.shapesFilters) { - expect(executionResult.shapesFilters).toEqual(geoContainmentState.shapesFilters); + if (executionResult && executionResult.state.shapesFilters) { + expect(executionResult.state.shapesFilters).toEqual(geoContainmentState.shapesFilters); } expect(testAlertActionArr).toMatchObject(expectedAlertResults); }); @@ -657,8 +657,8 @@ describe('geo_containment', () => { }, state: geoContainmentState, }); - if (executionResult && executionResult.prevLocationMap) { - expect(executionResult.prevLocationMap).toEqual(expectedPrevLocationMap); + if (executionResult && executionResult.state.prevLocationMap) { + expect(executionResult.state.prevLocationMap).toEqual(expectedPrevLocationMap); } expect(testAlertActionArr).toMatchObject(expectedAlertResults); }); diff --git a/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type.ts b/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type.ts index bd102d7ec0406..2acfdfc8d424a 100644 --- a/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type.ts +++ b/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type.ts @@ -261,5 +261,7 @@ export function getRuleType( const recoveryContext = addMessages(name, baseContext, params, true); recoveredAlert.setContext(recoveryContext); } + + return { state: {} }; } } diff --git a/x-pack/plugins/synthetics/server/alert_rules/status_rule/monitor_status_rule.ts b/x-pack/plugins/synthetics/server/alert_rules/status_rule/monitor_status_rule.ts index 82f970402b73b..7d309c1f595aa 100644 --- a/x-pack/plugins/synthetics/server/alert_rules/status_rule/monitor_status_rule.ts +++ b/x-pack/plugins/synthetics/server/alert_rules/status_rule/monitor_status_rule.ts @@ -131,7 +131,9 @@ export const registerSyntheticsStatusCheckRule = ( staleDownConfigs, }); - return updateState(ruleState, !isEmpty(downConfigs), { downConfigs }); + return { + state: updateState(ruleState, !isEmpty(downConfigs), { downConfigs }), + }; }, }); }; diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/duration_anomaly.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/duration_anomaly.ts index dc780a4d2ec3a..b959d16d5ade0 100644 --- a/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/duration_anomaly.ts +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/duration_anomaly.ts @@ -187,6 +187,6 @@ export const durationAnomalyAlertFactory: UptimeAlertTypeFactory setRecoveredAlertsContext({ alertFactory }); - return updateState(state, foundAnomalies); + return { state: updateState(state, foundAnomalies) }; }, }); diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/status_check.test.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/status_check.test.ts index 109b995b532a2..4291cb3fc4d88 100644 --- a/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/status_check.test.ts +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/status_check.test.ts @@ -206,13 +206,15 @@ describe('status check alert', () => { const alert = statusCheckAlertFactory(server, libs, plugins); // @ts-ignore the executor can return `void`, but ours never does const options = mockOptions(); - const state: Record | void = await alert.executor(options); + const executorResult: Record | void = await alert.executor(options); const { services: { alertWithLifecycle }, } = options; - expect(state).not.toBeUndefined(); - expect(state instanceof Object ? state.isTriggered : true).toBe(false); + expect(executorResult?.state).not.toBeUndefined(); + expect( + executorResult?.state instanceof Object ? executorResult.state.isTriggered : true + ).toBe(false); expect(alertWithLifecycle).not.toHaveBeenCalled(); expect(mockGetter).toHaveBeenCalledTimes(1); expect(mockGetter.mock.calls[0][0]).toEqual( @@ -416,7 +418,7 @@ describe('status check alert', () => { const { services: { alertWithLifecycle }, } = options; - const state = await alert.executor(options); + const executorResult = await alert.executor(options); const [{ value: alertInstanceMock }] = alertWithLifecycle.mock.results; mockMonitors.forEach((monitor) => { @@ -448,7 +450,7 @@ describe('status check alert', () => { }, ] `); - expect(state).toMatchInlineSnapshot(` + expect(executorResult?.state).toMatchInlineSnapshot(` Object { "currentTriggerStarted": "7.7 date", "firstCheckedAt": "7.7 date", @@ -484,7 +486,7 @@ describe('status check alert', () => { tags: ['unsecured', 'containers', 'org:google'], }, }); - const state = await alert.executor(options); + const executorResult = await alert.executor(options); const { services: { alertWithLifecycle }, } = options; @@ -665,7 +667,7 @@ describe('status check alert', () => { }, ] `); - expect(state).toMatchInlineSnapshot(` + expect(executorResult?.state).toMatchInlineSnapshot(` Object { "currentTriggerStarted": "foo date string", "firstCheckedAt": "foo date string", @@ -830,7 +832,7 @@ describe('status check alert', () => { const { services: { alertWithLifecycle }, } = options; - const state = await alert.executor(options); + const executorResult = await alert.executor(options); const [{ value: alertInstanceMock }] = alertWithLifecycle.mock.results; mockAvailabilityMonitors.forEach((monitor) => { expect(alertWithLifecycle).toBeCalledWith(mockAvailabilityAlertDocument(monitor)); @@ -944,7 +946,7 @@ describe('status check alert', () => { threshold: '99.34', }) ); - expect(state).toMatchInlineSnapshot(` + expect(executorResult?.state).toMatchInlineSnapshot(` Object { "currentTriggerStarted": undefined, "firstCheckedAt": "availability test", diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/status_check.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/status_check.ts index 49593c95727a5..66dd5afbbb9e7 100644 --- a/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/status_check.ts +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/status_check.ts @@ -450,7 +450,7 @@ export const statusCheckAlertFactory: UptimeAlertTypeFactory = ( setRecoveredAlertsContext({ alertFactory, basePath, getAlertUuid, spaceId }); - return updateState(state, downMonitorsByLocation.length > 0); + return { state: updateState(state, downMonitorsByLocation.length > 0) }; } let availabilityResults: GetMonitorAvailabilityResult[] = []; @@ -530,6 +530,6 @@ export const statusCheckAlertFactory: UptimeAlertTypeFactory = ( setRecoveredAlertsContext({ alertFactory, basePath, getAlertUuid, spaceId }); - return updateState(state, downMonitorsByLocation.length > 0); + return { state: updateState(state, downMonitorsByLocation.length > 0) }; }, }); diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/tls.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/tls.ts index 44b191e720238..85de29419b8e7 100644 --- a/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/tls.ts +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/tls.ts @@ -217,6 +217,6 @@ export const tlsAlertFactory: UptimeAlertTypeFactory = ( setRecoveredAlertsContext({ alertFactory, basePath, getAlertUuid, spaceId }); - return updateState(state, foundCerts); + return { state: updateState(state, foundCerts) }; }, }); diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/tls_legacy.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/tls_legacy.ts index 732b6ca45bc95..addb2dbbbdbe6 100644 --- a/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/tls_legacy.ts +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/tls_legacy.ts @@ -161,6 +161,6 @@ export const tlsLegacyAlertFactory: UptimeAlertTypeFactory = (_s alertInstance.scheduleActions(TLS_LEGACY.id); } - return updateState(state, foundCerts); + return { state: updateState(state, foundCerts) }; }, }); diff --git a/x-pack/plugins/transform/server/lib/alerting/transform_health_rule_type/register_transform_health_rule_type.ts b/x-pack/plugins/transform/server/lib/alerting/transform_health_rule_type/register_transform_health_rule_type.ts index 798a218b131e2..7698a11927fc1 100644 --- a/x-pack/plugins/transform/server/lib/alerting/transform_health_rule_type/register_transform_health_rule_type.ts +++ b/x-pack/plugins/transform/server/lib/alerting/transform_health_rule_type/register_transform_health_rule_type.ts @@ -133,6 +133,8 @@ export function getTransformHealthRuleType(): RuleType< recoveredAlert.setContext(testResult.context); } } + + return { state: {} }; }, }; } diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts index 93d2b200c3fde..1edcdaba548f6 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts @@ -128,8 +128,10 @@ async function alwaysFiringExecutor(alertExecutorOptions: any) { }, }); return { - globalStateValue: true, - groupInSeriesIndex: (state.groupInSeriesIndex || 0) + 1, + state: { + globalStateValue: true, + groupInSeriesIndex: (state.groupInSeriesIndex || 0) + 1, + }, }; } @@ -165,7 +167,9 @@ function getCumulativeFiringAlertType() { }); return { - runCount, + state: { + runCount, + }, }; }, }; @@ -209,7 +213,9 @@ function getNeverFiringAlertType() { }, }); return { - globalStateValue: true, + state: { + globalStateValue: true, + }, }; }, }; @@ -304,6 +310,8 @@ function getExceedsAlertLimitRuleType() { numAlerts: alertsToCreate, }, }); + + return { state: {} }; }, }; return result; @@ -396,6 +404,8 @@ function getAuthorizationAlertType(core: CoreSetup) { source: 'alert:test.authorization', }, }); + + return { state: {} }; }, }; return result; @@ -422,7 +432,9 @@ function getValidationAlertType() { validate: { params: paramsSchema, }, - async executor() {}, + async executor() { + return { state: {} }; + }, }; return result; } @@ -474,7 +486,7 @@ function getPatternFiringAlertType() { // get the pattern index, return if past it const patternIndex = state.patternIndex ?? 0; if (patternIndex >= maxPatternLength) { - return { patternIndex }; + return { state: { patternIndex } }; } // fire if pattern says to @@ -491,7 +503,9 @@ function getPatternFiringAlertType() { } return { - patternIndex: patternIndex + 1, + state: { + patternIndex: patternIndex + 1, + }, }; }, }; @@ -522,7 +536,7 @@ function getPatternSuccessOrFailureAlertType() { // get the pattern index, return if past it const patternIndex = state.patternIndex ?? 0; if (patternIndex >= pattern.length) { - return { patternIndex }; + return { state: { patternIndex } }; } if (!pattern[patternIndex]) { @@ -530,7 +544,9 @@ function getPatternSuccessOrFailureAlertType() { } return { - patternIndex: patternIndex + 1, + state: { + patternIndex: patternIndex + 1, + }, }; }, }; @@ -568,7 +584,7 @@ function getLongRunningPatternRuleType(cancelAlertsOnRuleTimeout: boolean = true // get the pattern index, return if past it if (globalPatternIndex >= pattern.length) { globalPatternIndex = 0; - return {}; + return { state: {} }; } services.alertFactory.create('alert').scheduleActions('default', {}); @@ -577,7 +593,7 @@ function getLongRunningPatternRuleType(cancelAlertsOnRuleTimeout: boolean = true if (pattern[globalPatternIndex++] === true) { await new Promise((resolve) => setTimeout(resolve, 10000)); } - return {}; + return { state: {} }; }, }; return result; @@ -636,6 +652,8 @@ function getCancellableRuleType() { if (services.shouldStopExecution()) { throw new Error('execution short circuited!'); } + + return { state: {} }; }, }; return result; @@ -707,6 +725,8 @@ function getAlwaysFiringAlertAsDataRuleType( ruleInfo, }, }); + + return { state: {} }; }, }); } @@ -724,7 +744,9 @@ export function defineAlertTypes( defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, }; const goldNoopAlertType: RuleType<{}, {}, {}, {}, {}, 'default'> = { id: 'test.gold.noop', @@ -734,7 +756,9 @@ export function defineAlertTypes( defaultActionGroupId: 'default', minimumLicenseRequired: 'gold', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, }; const onlyContextVariablesAlertType: RuleType<{}, {}, {}, {}, {}, 'default'> = { id: 'test.onlyContextVariables', @@ -747,7 +771,9 @@ export function defineAlertTypes( actionVariables: { context: [{ name: 'aContextVariable', description: 'this is a context variable' }], }, - async executor() {}, + async executor() { + return { state: {} }; + }, }; const onlyStateVariablesAlertType: RuleType<{}, {}, {}, {}, {}, 'default'> = { id: 'test.onlyStateVariables', @@ -760,7 +786,9 @@ export function defineAlertTypes( }, minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, }; const throwAlertType: RuleType<{}, {}, {}, {}, {}, 'default'> = { id: 'test.throw', @@ -801,6 +829,7 @@ export function defineAlertTypes( async executor(ruleExecutorOptions) { const { params } = ruleExecutorOptions; await new Promise((resolve) => setTimeout(resolve, params.delay ?? 5000)); + return { state: {} }; }, }; return result; @@ -816,7 +845,9 @@ export function defineAlertTypes( defaultActionGroupId: 'small', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alertsFixture', }; const multipleSearchesRuleType: RuleType< @@ -868,6 +899,8 @@ export function defineAlertTypes( for (i = 0; i < numSearches; ++i) { await services.scopedClusterClient.asCurrentUser.search(query as any); } + + return { state: {} }; }, }; diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/server/alert_types.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/server/alert_types.ts index a902d2a12a837..b4ac8a9fb259a 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/server/alert_types.ts +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/server/alert_types.ts @@ -22,7 +22,9 @@ export function defineAlertTypes( minimumLicenseRequired: 'basic', isExportable: true, recoveryActionGroup: { id: 'restrictedRecovered', name: 'Restricted Recovery' }, - async executor() {}, + async executor() { + return { state: {} }; + }, }; const noopUnrestrictedAlertType: RuleType<{}, {}, {}, {}, {}, 'default'> = { id: 'test.unrestricted-noop', @@ -32,7 +34,9 @@ export function defineAlertTypes( defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, }; alerting.registerType(noopRestrictedAlertType); alerting.registerType(noopUnrestrictedAlertType); diff --git a/x-pack/test/functional_execution_context/fixtures/plugins/alerts/server/plugin.ts b/x-pack/test/functional_execution_context/fixtures/plugins/alerts/server/plugin.ts index e6fc9c5aff6c4..3f6bece208447 100644 --- a/x-pack/test/functional_execution_context/fixtures/plugins/alerts/server/plugin.ts +++ b/x-pack/test/functional_execution_context/fixtures/plugins/alerts/server/plugin.ts @@ -80,6 +80,7 @@ export class FixturePlugin implements Plugin = { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, - async executor() {}, + async executor() { + return { state: {} }; + }, producer: 'alerts', }; @@ -58,8 +60,10 @@ export const alwaysFiringAlertType: RuleType< }); return { - globalStateValue: true, - groupInSeriesIndex: (state.groupInSeriesIndex || 0) + 1, + state: { + globalStateValue: true, + groupInSeriesIndex: (state.groupInSeriesIndex || 0) + 1, + }, }; }, }; diff --git a/x-pack/test/rule_registry/spaces_only/tests/trial/get_summarized_alerts.ts b/x-pack/test/rule_registry/spaces_only/tests/trial/get_summarized_alerts.ts index ccf57b8f6a0c1..4a8e4ddddc9c0 100644 --- a/x-pack/test/rule_registry/spaces_only/tests/trial/get_summarized_alerts.ts +++ b/x-pack/test/rule_registry/spaces_only/tests/trial/get_summarized_alerts.ts @@ -151,7 +151,7 @@ export default function createGetSummarizedAlertsTest({ getService }: FtrProvide }); } - return Promise.resolve({ shouldTriggerAlert: triggerAlert }); + return Promise.resolve({ state: { shouldTriggerAlert: triggerAlert } }); }); const getSummarizedAlerts = createGetSummarizedAlerts(); @@ -187,7 +187,7 @@ export default function createGetSummarizedAlertsTest({ getService }: FtrProvide // Execute the rule the first time - this creates a new alert const preExecution1Start = new Date(); const execution1Uuid = uuid.v4(); - const execution1Results = await executor({ + const execution1Result = await executor({ ...options, startedAt: new Date(), state: getState(true, {}), @@ -207,10 +207,10 @@ export default function createGetSummarizedAlertsTest({ getService }: FtrProvide // Execute again to update the existing alert const preExecution2Start = new Date(); const execution2Uuid = uuid.v4(); - const execution2Results = await executor({ + const execution2Result = await executor({ ...options, startedAt: new Date(), - state: getState(true, execution1Results.trackedAlerts), + state: getState(true, execution1Result.state.trackedAlerts), executionId: execution2Uuid, }); @@ -229,7 +229,7 @@ export default function createGetSummarizedAlertsTest({ getService }: FtrProvide await executor({ ...options, startedAt: new Date(), - state: getState(false, execution2Results.trackedAlerts), + state: getState(false, execution2Result.state.trackedAlerts), executionId: execution3Uuid, }); @@ -288,7 +288,7 @@ export default function createGetSummarizedAlertsTest({ getService }: FtrProvide // This creates the executor that is passed to the Alerting framework. const executor = createLifecycleRuleExecutor< MockRuleParams, - { shouldTriggerAlert: boolean }, + {}, MockAlertState, MockAlertContext, MockAllowedActionGroups @@ -308,6 +308,8 @@ export default function createGetSummarizedAlertsTest({ getService }: FtrProvide [ALERT_REASON]: 'Test alert is firing', }, }); + + return { state: {} }; }); const getSummarizedAlerts = createGetSummarizedAlerts(); diff --git a/x-pack/test/rule_registry/spaces_only/tests/trial/lifecycle_executor.ts b/x-pack/test/rule_registry/spaces_only/tests/trial/lifecycle_executor.ts index 66a6605d1d20c..2fbba4478e925 100644 --- a/x-pack/test/rule_registry/spaces_only/tests/trial/lifecycle_executor.ts +++ b/x-pack/test/rule_registry/spaces_only/tests/trial/lifecycle_executor.ts @@ -163,7 +163,7 @@ export default function createLifecycleExecutorApiTest({ getService }: FtrProvid }); // Returns the current state of the alert - return Promise.resolve(state); + return Promise.resolve({ state }); }); // Create the options with the minimal amount of values to test the lifecycle executor @@ -192,8 +192,8 @@ export default function createLifecycleExecutorApiTest({ getService }: FtrProvid >; // Execute the rule the first time - const results = await executor(options); - expect(results.wrapped).to.eql({ + const executorResult = await executor(options); + expect(executorResult.state.wrapped).to.eql({ testObject: { host: { name: 'host-01' }, id: 'host-01', @@ -205,8 +205,8 @@ export default function createLifecycleExecutorApiTest({ getService }: FtrProvid await es.indices.refresh({ index: `${ruleDataClient.indexName}*` }); // Execute again to ensure that we read the object and write it again with the updated state - const nextResults = await executor({ ...options, state: results }); - expect(nextResults.wrapped).to.eql({ + const nextExecutorResult = await executor({ ...options, state: executorResult.state }); + expect(nextExecutorResult.state.wrapped).to.eql({ testObject: { host: { name: 'host-01' }, id: 'host-01', @@ -228,7 +228,7 @@ export default function createLifecycleExecutorApiTest({ getService }: FtrProvid filter: [ { term: { - [ALERT_UUID]: nextResults.trackedAlerts['host-01'].alertUuid, + [ALERT_UUID]: nextExecutorResult.state.trackedAlerts['host-01'].alertUuid, }, }, ], @@ -239,7 +239,9 @@ export default function createLifecycleExecutorApiTest({ getService }: FtrProvid const source = response.hits.hits[0]._source as any; // The state in Elasticsearch should match the state returned from the executor - expect(source.testObject).to.eql(nextResults.wrapped && nextResults.wrapped.testObject); + expect(source.testObject).to.eql( + nextExecutorResult.state.wrapped && nextExecutorResult.state.wrapped.testObject + ); }); }); } From bc2cb5dc613c3d455a5fed9c54450fd7e46ffd92 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Thu, 12 Jan 2023 16:44:48 +0100 Subject: [PATCH 22/39] [code coverage] removing instrumentation & plugin for functional tests (#148748) ## Summary Quite awhile ago we decided to stop collecting code coverage for our functional (e2e, api integration) FTR tests. This is a cleanup PR to remove the code we no longer use. ### Checklist Delete any items that are not applicable to this PR. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### Risk Matrix Delete this section if it is not applicable to this PR. Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release. When forming the risk matrix, consider some of the following examples and how they may potentially impact the change: | Risk | Probability | Severity | Mitigation/Notes | |---------------------------|-------------|----------|-------------------------| | Multiple Spaces—unexpected behavior in non-default Kibana Space. | Low | High | Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces. | | Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. | High | Low | Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure. | | Code should gracefully handle cases when feature X or plugin Y are disabled. | Medium | High | Unit tests will verify that any feature flag or plugin combination still results in our service operational. | | [See more potential risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) | ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --- .buildkite/pipelines/code_coverage/daily.yml | 1 - .../steps/code_coverage/ftr_configs.sh | 124 ------------------ .../scripts/steps/code_coverage/ingest.sh | 9 +- .../scripts/steps/code_coverage/merge.sh | 63 --------- .../src/worker/webpack.config.ts | 4 +- test/common/config.js | 4 - .../fixtures/plugins/coverage/kibana.json | 8 -- .../fixtures/plugins/coverage/public/index.ts | 13 -- .../plugins/coverage/public/plugin.ts | 32 ----- test/functional/services/remote/remote.ts | 75 ++--------- tsconfig.base.json | 2 - 11 files changed, 11 insertions(+), 324 deletions(-) delete mode 100755 .buildkite/scripts/steps/code_coverage/ftr_configs.sh delete mode 100755 .buildkite/scripts/steps/code_coverage/merge.sh delete mode 100644 test/common/fixtures/plugins/coverage/kibana.json delete mode 100644 test/common/fixtures/plugins/coverage/public/index.ts delete mode 100644 test/common/fixtures/plugins/coverage/public/plugin.ts diff --git a/.buildkite/pipelines/code_coverage/daily.yml b/.buildkite/pipelines/code_coverage/daily.yml index dd8496bac40ca..bef3182c89690 100644 --- a/.buildkite/pipelines/code_coverage/daily.yml +++ b/.buildkite/pipelines/code_coverage/daily.yml @@ -17,7 +17,6 @@ steps: LIMIT_CONFIG_TYPE: 'unit,integration' JEST_UNIT_SCRIPT: '.buildkite/scripts/steps/code_coverage/jest.sh' JEST_INTEGRATION_SCRIPT: '.buildkite/scripts/steps/code_coverage/jest_integration.sh' - FTR_CONFIGS_SCRIPT: '.buildkite/scripts/steps/code_coverage/ftr_configs.sh' - command: .buildkite/scripts/steps/code_coverage/ingest.sh label: 'Merge and Ingest' diff --git a/.buildkite/scripts/steps/code_coverage/ftr_configs.sh b/.buildkite/scripts/steps/code_coverage/ftr_configs.sh deleted file mode 100755 index 8aa619651e71e..0000000000000 --- a/.buildkite/scripts/steps/code_coverage/ftr_configs.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -source .buildkite/scripts/common/util.sh -source .buildkite/scripts/steps/code_coverage/merge.sh -source .buildkite/scripts/steps/code_coverage/util.sh -source .buildkite/scripts/steps/code_coverage/node_scripts.sh - -export CODE_COVERAGE=1 # Kibana is bootstrapped differently for code coverage -echo "--- KIBANA_DIR: $KIBANA_DIR" -.buildkite/scripts/bootstrap.sh -buildPlatformPlugins -is_test_execution_step - -FTR_CONFIG_GROUP_KEY=${FTR_CONFIG_GROUP_KEY:-} -if [ "$FTR_CONFIG_GROUP_KEY" == "" ]; then - echo "Missing FTR_CONFIG_GROUP_KEY env var" - exit 1 -fi - -export JOB="$FTR_CONFIG_GROUP_KEY" - -functionalTarget="$KIBANA_DIR/target/kibana-coverage/functional" -FAILED_CONFIGS_KEY="${BUILDKITE_STEP_ID}${FTR_CONFIG_GROUP_KEY}" - -configs="${FTR_CONFIG:-}" - -if [[ "$configs" == "" ]]; then - echo "--- Downloading ftr test run order" - download_artifact ftr_run_order.json . - configs=$(jq -r '.[env.FTR_CONFIG_GROUP_KEY].names[]' ftr_run_order.json) -fi - -echo "--- Config(s) for this FTR Group:" -echo "${configs[@]}" - -failedConfigs="" -results=() - -while read -r config; do - if [[ ! "$config" ]]; then - continue - fi - echo "--- Begin config $config" - - start=$(date +%s) - - # prevent non-zero exit code from breaking the loop - set +e - runFTRInstrumented "$config" - lastCode=$? - set -e - dasherize() { - local withoutExtension=${1%.*} - dasherized=$(echo "$withoutExtension" | tr '\/' '\-') - } - dasherize "$config" - - if [[ -d "$functionalTarget" ]]; then - echo "--- Server and / or Client side code coverage collected" - if [[ -f "target/kibana-coverage/functional/coverage-final.json" ]]; then - # We potentially have more than one file with the same name being created, - # so we make them unique here. - mv target/kibana-coverage/functional/coverage-final.json "target/kibana-coverage/functional/${dasherized}-server-coverage.json" - fi - fi - - timeSec=$(($(date +%s) - start)) - if [[ $timeSec -gt 60 ]]; then - min=$((timeSec / 60)) - sec=$((timeSec - (min * 60))) - duration="${min}m ${sec}s" - else - duration="${timeSec}s" - fi - - results+=("- $config - duration: ${duration} - result: ${lastCode}") - - if [ $lastCode -ne 0 ]; then - echo "FTR exited with code $lastCode" - echo "^^^ +++" - - if [[ "$failedConfigs" ]]; then - failedConfigs="${failedConfigs}"$'\n'"$config" - else - failedConfigs="$config" - fi - fi - - echo "--- Config complete: $config" -done <<<"$configs" - -# Each browser unload event, creates a new coverage file. -# So, we merge them here. -if [[ -d "$functionalTarget" ]]; then - reportMergeFunctional - uniqueifyFunctional "$(date +%s)" -else - echo "--- Code coverage not found in: $functionalTarget" -fi - -# Nyc uses matching absolute paths for reporting / merging -# So, set all coverage json files to a specific prefx. -# The prefix will be changed to the kibana dir, in the final stage, -# so nyc doesnt error. -echo "--- Normalize file paths prefix" -replacePaths "$KIBANA_DIR/target/kibana-coverage/functional" "$KIBANA_DIR" "CC_REPLACEMENT_ANCHOR" - -if [[ "$failedConfigs" ]]; then - buildkite-agent meta-data set "$FAILED_CONFIGS_KEY" "$failedConfigs" -fi - -echo "--- FTR configs complete, result(s):" -printf "%s\n" "${results[@]}" -echo "" - -# So the last step "knows" this config ran -uploadRanFile "functional" - -# Force exit 0 to ensure the next build step starts. -exit 0 diff --git a/.buildkite/scripts/steps/code_coverage/ingest.sh b/.buildkite/scripts/steps/code_coverage/ingest.sh index 31a24981ce200..6940c413f0e93 100755 --- a/.buildkite/scripts/steps/code_coverage/ingest.sh +++ b/.buildkite/scripts/steps/code_coverage/ingest.sh @@ -4,7 +4,6 @@ set -euo pipefail source .buildkite/scripts/common/util.sh source .buildkite/scripts/steps/code_coverage/util.sh -source .buildkite/scripts/steps/code_coverage/merge.sh export CODE_COVERAGE=1 echo "--- Reading Kibana stats cluster creds from vault" @@ -77,13 +76,7 @@ mergeAll() { replacePaths "$KIBANA_DIR/target/kibana-coverage/jest" "CC_REPLACEMENT_ANCHOR" "$KIBANA_DIR" yarn nyc report --nycrc-path src/dev/code_coverage/nyc_config/nyc.jest.config.js elif [ "$x" == "functional" ]; then - echo "---[$x] : Reset file paths prefix, merge coverage files, and generate the final combined report" - set +e - sed -ie "s|CC_REPLACEMENT_ANCHOR|${KIBANA_DIR}|g" target/kibana-coverage/functional/*.json - echo "--- Begin Split and Merge for Functional" - splitCoverage target/kibana-coverage/functional - splitMerge - set -e + echo "--- Code coverage for functional tests is not collected" fi done } diff --git a/.buildkite/scripts/steps/code_coverage/merge.sh b/.buildkite/scripts/steps/code_coverage/merge.sh deleted file mode 100755 index ecded8ea1ff10..0000000000000 --- a/.buildkite/scripts/steps/code_coverage/merge.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -source .buildkite/scripts/common/util.sh - -export CODE_COVERAGE=1 - -base=target/kibana-coverage -target="$base/functional" -first="$target/first" -rest="$target/rest" - -filesCount() { - count=$(find "$1" -maxdepth 1 -type f | wc -l | xargs) # xargs trims whitespace -} - -_head() { - firstFile=$(find "$1" -maxdepth 1 -type f | head -1) -} - -splitCoverage() { - echo "--- Running splitCoverage:" - filesCount "$1" - echo "### total: $count" - - mkdir -p $first - mkdir -p $rest - half=$((count / 2)) - echo "### half: $half" - - echo "### Move the first half into the 'first' dir" - # the index variable is irrelevant - for x in $(seq 1 $half); do - _head "$1" - mv "$firstFile" "$first" - done - - echo "### Move the second half into the 'rest' dir" - while read -r x; do - mv "$x" "$rest" || printf "\n\t### Trouble moving %s to %s" "$x" "$rest" - done <<<"$(find "$target" -maxdepth 1 -type f -name '*.json')" -} - -splitMerge() { - echo "### Merge the 1st half of the coverage files" - yarn nyc merge target/kibana-coverage/functional/first target/kibana-coverage/functional/first.json - echo "### Merge the 2nd half of the coverage files" - yarn nyc merge target/kibana-coverage/functional/rest target/kibana-coverage/functional/rest.json - echo "### Report-Merge the 2 halves into one" - yarn nyc report --nycrc-path src/dev/code_coverage/nyc_config/nyc.functional.config.js -} - -uniqueifyFunctional() { - local unique=${1:?"Must pass first positional arg for 'unique'"} - - # Drop the json files that where report-merged. - rm -rf target/kibana-coverage/functional/* - - # Move from report-merge target dir, to: target/kibana-coverage/functional - mv target/kibana-coverage/functional-combined/coverage-final.json \ - "target/kibana-coverage/functional/$unique-coverage-final.json" -} diff --git a/packages/kbn-optimizer/src/worker/webpack.config.ts b/packages/kbn-optimizer/src/worker/webpack.config.ts index a5511c7ae0e5a..86ccf80f8bc1f 100644 --- a/packages/kbn-optimizer/src/worker/webpack.config.ts +++ b/packages/kbn-optimizer/src/worker/webpack.config.ts @@ -25,8 +25,6 @@ import { BundleMetricsPlugin } from './bundle_metrics_plugin'; import { EmitStatsPlugin } from './emit_stats_plugin'; import { PopulateBundleCachePlugin } from './populate_bundle_cache_plugin'; -const IS_CODE_COVERAGE = !!process.env.CODE_COVERAGE; -const ISTANBUL_PRESET_PATH = require.resolve('@kbn/babel-preset/istanbul_preset'); const BABEL_PRESET = [ require.resolve('@kbn/babel-preset/webpack_preset'), { @@ -232,7 +230,7 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker: options: { babelrc: false, envName: worker.dist ? 'production' : 'development', - presets: IS_CODE_COVERAGE ? [ISTANBUL_PRESET_PATH, BABEL_PRESET] : [BABEL_PRESET], + presets: [BABEL_PRESET], }, }, }, diff --git a/test/common/config.js b/test/common/config.js index f69afd4e789b5..532b517f2d69a 100644 --- a/test/common/config.js +++ b/test/common/config.js @@ -55,10 +55,6 @@ export default function () { `--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'otel_metrics')}`, `--newsfeed.service.urlRoot=${servers.kibana.protocol}://${servers.kibana.hostname}:${servers.kibana.port}`, `--newsfeed.service.pathTemplate=/api/_newsfeed-FTS-external-service-simulators/kibana/v{VERSION}.json`, - // code coverage reporting plugin - ...(!!process.env.CODE_COVERAGE - ? [`--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'coverage')}`] - : []), `--logging.appenders.deprecation=${JSON.stringify({ type: 'console', layout: { diff --git a/test/common/fixtures/plugins/coverage/kibana.json b/test/common/fixtures/plugins/coverage/kibana.json deleted file mode 100644 index 80afd40ba805f..0000000000000 --- a/test/common/fixtures/plugins/coverage/kibana.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "coverageFixtures", - "owner": { "name": "Kibana Operations", "githubTeam": "kibana-operations" }, - "version": "kibana", - "server": false, - "ui": true -} - diff --git a/test/common/fixtures/plugins/coverage/public/index.ts b/test/common/fixtures/plugins/coverage/public/index.ts deleted file mode 100644 index 647b101d2a8c7..0000000000000 --- a/test/common/fixtures/plugins/coverage/public/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { CodeCoverageReportingPlugin } from './plugin'; - -export function plugin() { - return new CodeCoverageReportingPlugin(); -} diff --git a/test/common/fixtures/plugins/coverage/public/plugin.ts b/test/common/fixtures/plugins/coverage/public/plugin.ts deleted file mode 100644 index 0c7d3f238a27d..0000000000000 --- a/test/common/fixtures/plugins/coverage/public/plugin.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { Plugin } from '@kbn/core/server'; - -declare global { - interface Window { - __coverage__: any; - flushCoverageToLog: any; - } -} - -export class CodeCoverageReportingPlugin implements Plugin { - constructor() {} - - public start() {} - - public setup() { - window.flushCoverageToLog = function () { - if (window.__coverage__) { - // eslint-disable-next-line no-console - console.log('coveragejson:' + btoa(JSON.stringify(window.__coverage__))); - } - }; - window.addEventListener('beforeunload', window.flushCoverageToLog); - } -} diff --git a/test/functional/services/remote/remote.ts b/test/functional/services/remote/remote.ts index 653058959b839..161a692ff5221 100644 --- a/test/functional/services/remote/remote.ts +++ b/test/functional/services/remote/remote.ts @@ -6,11 +6,6 @@ * Side Public License, v 1. */ -import Fs from 'fs'; -import { resolve } from 'path'; - -import { mergeMap } from 'rxjs/operators'; - import { FtrProviderContext } from '../../ftr_provider_context'; import { initWebDriver, BrowserConfig } from './webdriver'; import { Browsers } from './browsers'; @@ -20,10 +15,6 @@ export async function RemoteProvider({ getService }: FtrProviderContext) { const log = getService('log'); const config = getService('config'); const browserType: Browsers = config.get('browser.type'); - const collectCoverage: boolean = !!process.env.CODE_COVERAGE; - const coveragePrefix = 'coveragejson:'; - const coverageDir = resolve(__dirname, '../../../../target/kibana-coverage/functional'); - let coverageCounter = 1; type BrowserStorage = 'sessionStorage' | 'localStorage'; const clearBrowserStorage = async (storageType: BrowserStorage) => { @@ -36,24 +27,6 @@ export async function RemoteProvider({ getService }: FtrProviderContext) { } }; - const writeCoverage = (coverageJson: string) => { - // on CI we make hard link clone and run tests from kibana${process.env.CI_GROUP} root path - const re = new RegExp(`kibana${process.env.CI_GROUP}`, 'g'); - const dir = process.env.CI ? coverageDir.replace(re, 'kibana') : coverageDir; - - if (!Fs.existsSync(dir)) { - Fs.mkdirSync(dir, { recursive: true }); - } - - const id = coverageCounter++; - const timestamp = Date.now(); - const path = resolve(dir, `${id}.${timestamp}.coverage.json`); - log.info('writing coverage to', path); - - const jsonString = process.env.CI ? coverageJson.replace(re, 'kibana') : coverageJson; - Fs.writeFileSync(path, JSON.stringify(JSON.parse(jsonString), null, 2)); - }; - const browserConfig: BrowserConfig = { logPollingMs: config.get('browser.logPollingMs'), acceptInsecureCerts: config.get('browser.acceptInsecureCerts'), @@ -62,11 +35,7 @@ export async function RemoteProvider({ getService }: FtrProviderContext) { const { driver, consoleLog$ } = await initWebDriver(log, browserType, lifecycle, browserConfig); const caps = await driver.getCapabilities(); - log.info( - `Remote initialized: ${caps.get('browserName')} ${caps.get( - 'browserVersion' - )}, collectingCoverage=${collectCoverage}` - ); + log.info(`Remote initialized: ${caps.get('browserName')} ${caps.get('browserVersion')}}`); if ([Browsers.Chrome, Browsers.ChromiumEdge].includes(browserType)) { log.info( @@ -74,29 +43,14 @@ export async function RemoteProvider({ getService }: FtrProviderContext) { ); } - consoleLog$ - .pipe( - mergeMap((logEntry) => { - if (collectCoverage && logEntry.message.includes(coveragePrefix)) { - const [, coverageJsonBase64] = logEntry.message.split(coveragePrefix); - const coverageJson = Buffer.from(coverageJsonBase64, 'base64').toString('utf8'); - writeCoverage(coverageJson); - - // filter out this message - return []; - } - - return [logEntry]; - }) - ) - .subscribe({ - next({ message, level }) { - const msg = message.replace(/\\n/g, '\n'); - log[level === 'SEVERE' || level === 'error' ? 'warning' : 'debug']( - `browser[${level}] ${msg}` - ); - }, - }); + consoleLog$.subscribe({ + next({ message, level }) { + const msg = message.replace(/\\n/g, '\n'); + log[level === 'SEVERE' || level === 'error' ? 'warning' : 'debug']( + `browser[${level}] ${msg}` + ); + }, + }); lifecycle.beforeTests.add(async () => { // hard coded default, can be overridden per suite using `browser.setWindowSize()` @@ -121,17 +75,6 @@ export async function RemoteProvider({ getService }: FtrProviderContext) { }); lifecycle.cleanup.add(async () => { - // Getting the last piece of code coverage before closing browser - if (collectCoverage) { - const coverageJson = await driver - .executeScript('return window.__coverage__') - .catch(() => undefined) - .then((coverage) => (coverage ? JSON.stringify(coverage) : undefined)); - if (coverageJson) { - writeCoverage(coverageJson); - } - } - await driver.quit(); }); diff --git a/tsconfig.base.json b/tsconfig.base.json index 3777e1088a2a8..feb87dd99ead1 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -528,8 +528,6 @@ "@kbn/core-usage-data-server-internal/*": ["packages/core/usage-data/core-usage-data-server-internal/*"], "@kbn/core-usage-data-server-mocks": ["packages/core/usage-data/core-usage-data-server-mocks"], "@kbn/core-usage-data-server-mocks/*": ["packages/core/usage-data/core-usage-data-server-mocks/*"], - "@kbn/coverage-fixtures-plugin": ["test/common/fixtures/plugins/coverage"], - "@kbn/coverage-fixtures-plugin/*": ["test/common/fixtures/plugins/coverage/*"], "@kbn/cross-cluster-replication-plugin": ["x-pack/plugins/cross_cluster_replication"], "@kbn/cross-cluster-replication-plugin/*": ["x-pack/plugins/cross_cluster_replication/*"], "@kbn/crypto": ["packages/kbn-crypto"], From a219afb796a5dcaf05d6abc8b79264a3bb08aebb Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 12 Jan 2023 16:59:21 +0100 Subject: [PATCH 23/39] [ResponseOps] [Cases] Add fields to the Cases SO for total alerts and comments. (#148202) Fixes #147992 ## Summary - Added two new fields to the Cases' Saved Object: - `total_alerts` - `total_comment` - Both fields are of the type _integer_. - The default value for both fields is -1. - Added tests for the migrations. - Updated the `CaseAttributesRt` type with these two new fields. - **No other changes in the BE or FE, we anticipated the need for these fields and are doing the migrations in advance.** Note that the total comments field is called `total_comment`, this was discussed offline and done to keep in line with the field's name already returned when fetching cases (`totalComment`). This is a nitpick but I think I would instead change it to `total_comments`. What do you guys think? Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../migrations/check_registered_types.test.ts | 2 +- .../cases/server/saved_object_types/cases.ts | 6 + .../migrations/cases.test.ts | 42 ++++++ .../saved_object_types/migrations/cases.ts | 24 +++- .../cases/server/services/cases/index.test.ts | 126 ++++++++++++++++-- .../cases/server/services/cases/index.ts | 5 + .../cases/server/services/cases/transform.ts | 25 +++- .../cases/server/services/cases/types.ts | 2 + .../cases/server/services/test_utils.ts | 2 + .../tests/common/cases/migrations.ts | 18 +++ 10 files changed, 239 insertions(+), 13 deletions(-) diff --git a/src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts b/src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts index 106f55d2c0915..ccaf01a70f5d1 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts @@ -69,7 +69,7 @@ describe('checking migration metadata changes on all registered SO types', () => "canvas-element": "e2e312fc499c1a81e628b88baba492fb24f4e82d", "canvas-workpad": "4b05f7829bc805bbaa07eb9fc0d2a2bbbd6bbf39", "canvas-workpad-template": "d4bb65aa9c4a2b25029d3272fd9c715d8e4247d7", - "cases": "d9f9080c3200241628ae09d3614a03f1b5dacbfc", + "cases": "a27d57e75e358349a6ba835152fd4de0033a7bff", "cases-comments": "d7c4c1d24e97620cd415e27e5eb7d5b5f2c5b461", "cases-configure": "1afc414f5563a36e4612fa269193d3ed7277c7bd", "cases-connector-mappings": "4b16d440af966e5d6e0fa33368bfa15d987a4b69", diff --git a/x-pack/plugins/cases/server/saved_object_types/cases.ts b/x-pack/plugins/cases/server/saved_object_types/cases.ts index 1eccd714266d4..e32aa462d7121 100644 --- a/x-pack/plugins/cases/server/saved_object_types/cases.ts +++ b/x-pack/plugins/cases/server/saved_object_types/cases.ts @@ -179,6 +179,12 @@ export const createCaseSavedObjectType = ( severity: { type: 'short', }, + total_alerts: { + type: 'integer', + }, + total_comments: { + type: 'integer', + }, }, }, migrations: caseMigrations, diff --git a/x-pack/plugins/cases/server/saved_object_types/migrations/cases.test.ts b/x-pack/plugins/cases/server/saved_object_types/migrations/cases.test.ts index 5609d36b9b0f0..5b2eb65080682 100644 --- a/x-pack/plugins/cases/server/saved_object_types/migrations/cases.test.ts +++ b/x-pack/plugins/cases/server/saved_object_types/migrations/cases.test.ts @@ -17,6 +17,8 @@ import { addAssignees, addDuration, addSeverity, + addTotalAlerts, + addTotalComments, caseConnectorIdMigration, convertSeverity, convertStatus, @@ -674,5 +676,45 @@ describe('case migrations', () => { references: [], }); }); + + it('default value for total_alerts is -1', () => { + const doc = { + id: '123', + type: 'abc', + attributes: { + title: 'foobar', + }, + references: [], + } as unknown as SavedObjectUnsanitizedDoc; + + expect(addTotalAlerts(doc)).toEqual({ + ...doc, + attributes: { + ...doc.attributes, + total_alerts: -1, + }, + references: [], + }); + }); + + it('default value for total_comments is -1', () => { + const doc = { + id: '123', + type: 'abc', + attributes: { + title: 'foobar', + }, + references: [], + } as unknown as SavedObjectUnsanitizedDoc; + + expect(addTotalComments(doc)).toEqual({ + ...doc, + attributes: { + ...doc.attributes, + total_comments: -1, + }, + references: [], + }); + }); }); }); diff --git a/x-pack/plugins/cases/server/saved_object_types/migrations/cases.ts b/x-pack/plugins/cases/server/saved_object_types/migrations/cases.ts index 4947575c38824..38f91952f1469 100644 --- a/x-pack/plugins/cases/server/saved_object_types/migrations/cases.ts +++ b/x-pack/plugins/cases/server/saved_object_types/migrations/cases.ts @@ -157,6 +157,28 @@ export const convertStatus = ( }; }; +export const addTotalAlerts = ( + doc: SavedObjectUnsanitizedDoc +): SavedObjectSanitizedDoc => { + const total_alerts = -1; + return { + ...doc, + attributes: { ...doc.attributes, total_alerts }, + references: doc.references ?? [], + }; +}; + +export const addTotalComments = ( + doc: SavedObjectUnsanitizedDoc +): SavedObjectSanitizedDoc => { + const total_comments = -1; + return { + ...doc, + attributes: { ...doc.attributes, total_comments }, + references: doc.references ?? [], + }; +}; + export const caseMigrations = { '7.10.0': ( doc: SavedObjectUnsanitizedDoc @@ -220,5 +242,5 @@ export const caseMigrations = { '8.1.0': removeCaseType, '8.3.0': pipeMigrations(addDuration, addSeverity), '8.5.0': addAssignees, - '8.7.0': flow(convertSeverity, convertStatus), + '8.7.0': flow(convertSeverity, convertStatus, addTotalAlerts, addTotalComments), }; diff --git a/x-pack/plugins/cases/server/services/cases/index.test.ts b/x-pack/plugins/cases/server/services/cases/index.test.ts index 31fdadae36c93..c00407ec1a965 100644 --- a/x-pack/plugins/cases/server/services/cases/index.test.ts +++ b/x-pack/plugins/cases/server/services/cases/index.test.ts @@ -63,7 +63,7 @@ const createUpdateSOResponse = ({ externalService, }); - let attributes: Partial = {}; + let attributes: Partial = { total_alerts: -1, total_comments: -1 }; if (connector) { const { id, ...restConnector } = connector; @@ -77,13 +77,11 @@ const createUpdateSOResponse = ({ attributes = { ...attributes, external_service: null }; } - if (severity || severity === 0) { - attributes = { ...attributes, severity }; - } - - if (status || status === 0) { - attributes = { ...attributes, status }; - } + attributes = { + ...attributes, + ...((severity || severity === 0) && { severity }), + ...((status || status === 0) && { status }), + }; return { type: CASE_SAVED_OBJECT, @@ -739,6 +737,8 @@ describe('CasesService', () => { "defacement", ], "title": "Super Bad Security Issue", + "total_alerts": -1, + "total_comments": -1, "updated_at": "2019-11-25T21:54:48.952Z", "updated_by": Object { "email": "testemail@elastic.co", @@ -767,6 +767,23 @@ describe('CasesService', () => { `); }); + it('includes default values for total_alerts and total_comments', async () => { + unsecuredSavedObjectsClient.create.mockResolvedValue({} as SavedObject); + + await service.postNewCase({ + attributes: createCasePostParams({ + connector: getNoneCaseConnector(), + }), + id: '1', + }); + + const postAttributes = unsecuredSavedObjectsClient.create.mock + .calls[0][1] as ESCaseAttributes; + + expect(postAttributes.total_alerts).toEqual(-1); + expect(postAttributes.total_comments).toEqual(-1); + }); + it('moves the connector.id and connector_id to the references', async () => { unsecuredSavedObjectsClient.create.mockResolvedValue({} as SavedObject); @@ -996,6 +1013,33 @@ describe('CasesService', () => { expect(res.saved_objects[1].attributes.status).toEqual(CaseStatuses['in-progress']); expect(res.saved_objects[2].attributes.status).toEqual(CaseStatuses.closed); }); + + it('does not include total_alerts and total_comments fields in the response', async () => { + unsecuredSavedObjectsClient.bulkUpdate.mockResolvedValue({ + saved_objects: [ + createCaseSavedObjectResponse({}), + createCaseSavedObjectResponse({}), + createCaseSavedObjectResponse({}), + ], + }); + + const res = await service.patchCases({ + cases: [ + { + caseId: '1', + updatedAttributes: createCasePostParams({ connector: getNoneCaseConnector() }), + originalCase: {} as CaseSavedObject, + }, + ], + }); + + expect(res.saved_objects[0].attributes).not.toHaveProperty('total_alerts'); + expect(res.saved_objects[0].attributes).not.toHaveProperty('total_comments'); + expect(res.saved_objects[1].attributes).not.toHaveProperty('total_alerts'); + expect(res.saved_objects[1].attributes).not.toHaveProperty('total_comments'); + expect(res.saved_objects[2].attributes).not.toHaveProperty('total_alerts'); + expect(res.saved_objects[2].attributes).not.toHaveProperty('total_comments'); + }); }); describe('patch', () => { @@ -1272,6 +1316,19 @@ describe('CasesService', () => { expect(res.attributes.status).toEqual(expectedStatus); } ); + + it('does not include total_alerts and total_comments fields in the response', async () => { + unsecuredSavedObjectsClient.update.mockResolvedValue(createUpdateSOResponse({})); + + const res = await service.patchCase({ + caseId: '1', + updatedAttributes: createCaseUpdateParams({}), + originalCase: {} as CaseSavedObject, + }); + + expect(res.attributes).not.toHaveProperty('total_alerts'); + expect(res.attributes).not.toHaveProperty('total_comments'); + }); }); describe('post', () => { @@ -1332,6 +1389,18 @@ describe('CasesService', () => { expect(res.attributes.status).toEqual(expectedStatus); } ); + + it('does not include total_alerts and total_comments fields in the response', async () => { + unsecuredSavedObjectsClient.create.mockResolvedValue(createCaseSavedObjectResponse({})); + + const res = await service.postNewCase({ + attributes: createCasePostParams({ connector: getNoneCaseConnector() }), + id: '1', + }); + + expect(res.attributes).not.toHaveProperty('total_alerts'); + expect(res.attributes).not.toHaveProperty('total_comments'); + }); }); describe('find', () => { @@ -1409,6 +1478,16 @@ describe('CasesService', () => { expect(res.saved_objects[0].attributes.status).toEqual(expectedStatus); } ); + + it('does not include total_alerts and total_comments fields in the response', async () => { + const findMockReturn = createSOFindResponse([createFindSO(), createFindSO()]); + unsecuredSavedObjectsClient.find.mockResolvedValue(findMockReturn); + + const res = await service.findCases(); + + expect(res.saved_objects[0].attributes).not.toHaveProperty('total_alerts'); + expect(res.saved_objects[0].attributes).not.toHaveProperty('total_comments'); + }); }); describe('bulkGet', () => { @@ -1484,6 +1563,24 @@ describe('CasesService', () => { expect(res.saved_objects[1].attributes.status).toEqual(CaseStatuses['in-progress']); expect(res.saved_objects[2].attributes.status).toEqual(CaseStatuses.closed); }); + + it('does not include total_alerts and total_comments fields in the response', async () => { + unsecuredSavedObjectsClient.bulkGet.mockResolvedValue({ + saved_objects: [ + createCaseSavedObjectResponse({}), + createCaseSavedObjectResponse({}), + createCaseSavedObjectResponse({}), + ], + }); + + const res = await service.getCases({ caseIds: ['a'] }); + expect(res.saved_objects[0].attributes).not.toHaveProperty('total_alerts'); + expect(res.saved_objects[0].attributes).not.toHaveProperty('total_comments'); + expect(res.saved_objects[1].attributes).not.toHaveProperty('total_alerts'); + expect(res.saved_objects[1].attributes).not.toHaveProperty('total_comments'); + expect(res.saved_objects[2].attributes).not.toHaveProperty('total_alerts'); + expect(res.saved_objects[2].attributes).not.toHaveProperty('total_comments'); + }); }); describe('get', () => { @@ -1621,6 +1718,19 @@ describe('CasesService', () => { expect(res.attributes.status).toEqual(expectedStatus); } ); + + it('does not include total_alerts and total_comments fields in the response', async () => { + unsecuredSavedObjectsClient.get.mockResolvedValue({ + attributes: { + total_alerts: -1, + total_comments: -1, + }, + } as unknown as SavedObject); + + const res = await service.getCase({ id: 'a' }); + expect(res.attributes).not.toHaveProperty('total_alerts'); + expect(res.attributes).not.toHaveProperty('total_comments'); + }); }); }); diff --git a/x-pack/plugins/cases/server/services/cases/index.ts b/x-pack/plugins/cases/server/services/cases/index.ts index a8989bedf7143..661f4cda00d7a 100644 --- a/x-pack/plugins/cases/server/services/cases/index.ts +++ b/x-pack/plugins/cases/server/services/cases/index.ts @@ -566,11 +566,16 @@ export class CasesService { try { this.log.debug(`Attempting to POST a new case`); const transformedAttributes = transformAttributesToESModel(attributes); + + transformedAttributes.attributes.total_alerts = -1; + transformedAttributes.attributes.total_comments = -1; + const createdCase = await this.unsecuredSavedObjectsClient.create( CASE_SAVED_OBJECT, transformedAttributes.attributes, { id, references: transformedAttributes.referenceHandler.build(), refresh } ); + return transformSavedObjectToExternalModel(createdCase); } catch (error) { this.log.error(`Error on POST a new case: ${error}`); diff --git a/x-pack/plugins/cases/server/services/cases/transform.ts b/x-pack/plugins/cases/server/services/cases/transform.ts index d51b6bd981406..6adacf41f526a 100644 --- a/x-pack/plugins/cases/server/services/cases/transform.ts +++ b/x-pack/plugins/cases/server/services/cases/transform.ts @@ -51,8 +51,20 @@ export function transformUpdateResponsesToExternalModels( export function transformUpdateResponseToExternalModel( updatedCase: SavedObjectsUpdateResponse ): SavedObjectsUpdateResponse { - const { connector, external_service, severity, status, ...restUpdateAttributes } = - updatedCase.attributes ?? {}; + const { + connector, + external_service, + severity, + status, + total_alerts, + total_comments, + ...restUpdateAttributes + } = + updatedCase.attributes ?? + ({ + total_alerts: -1, + total_comments: -1, + } as ESCaseAttributes); const transformedConnector = transformESConnectorToExternalModel({ // if the saved object had an error the attributes field will not exist @@ -192,10 +204,17 @@ export function transformSavedObjectToExternalModel( const status = STATUS_ESMODEL_TO_EXTERNAL[caseSavedObject.attributes?.status] ?? CaseStatuses.open; + const { total_alerts, total_comments, ...caseSavedObjectAttributes } = + caseSavedObject.attributes ?? + ({ + total_alerts: -1, + total_comments: -1, + } as ESCaseAttributes); + return { ...caseSavedObject, attributes: { - ...caseSavedObject.attributes, + ...caseSavedObjectAttributes, severity, status, connector, diff --git a/x-pack/plugins/cases/server/services/cases/types.ts b/x-pack/plugins/cases/server/services/cases/types.ts index dc90823480794..5e831b7fd058f 100644 --- a/x-pack/plugins/cases/server/services/cases/types.ts +++ b/x-pack/plugins/cases/server/services/cases/types.ts @@ -48,4 +48,6 @@ export type ESCaseAttributes = Omit< status: ESCaseStatus; connector: ESCaseConnector; external_service: ExternalServicesWithoutConnectorId | null; + total_alerts: number; + total_comments: number; }; diff --git a/x-pack/plugins/cases/server/services/test_utils.ts b/x-pack/plugins/cases/server/services/test_utils.ts index 79e9d5435e271..d0108564d476a 100644 --- a/x-pack/plugins/cases/server/services/test_utils.ts +++ b/x-pack/plugins/cases/server/services/test_utils.ts @@ -125,6 +125,8 @@ export const basicESCaseFields: ESCaseAttributes = { }, owner: SECURITY_SOLUTION_OWNER, assignees: [], + total_alerts: -1, + total_comments: -1, }; export const basicCaseFields: CaseAttributes = { diff --git a/x-pack/test/cases_api_integration/security_and_spaces/tests/common/cases/migrations.ts b/x-pack/test/cases_api_integration/security_and_spaces/tests/common/cases/migrations.ts index 8ed6dbc98374a..177e516af7e28 100644 --- a/x-pack/test/cases_api_integration/security_and_spaces/tests/common/cases/migrations.ts +++ b/x-pack/test/cases_api_integration/security_and_spaces/tests/common/cases/migrations.ts @@ -529,6 +529,24 @@ export default function createGetTests({ getService }: FtrProviderContext) { } }); }); + + describe('total_alerts', () => { + it('total_alerts field has default value -1', async () => { + const casesFromES = await getCaseSavedObjectsFromES({ es }); + for (const hit of casesFromES.body.hits.hits) { + expect(hit._source?.cases.total_alerts).to.eql(-1); + } + }); + }); + + describe('total_comments', () => { + it('total_comments field has default value -1', async () => { + const casesFromES = await getCaseSavedObjectsFromES({ es }); + for (const hit of casesFromES.body.hits.hits) { + expect(hit._source?.cases.total_comments).to.eql(-1); + } + }); + }); }); }); } From 80521005005d89484500d8c37b30dac9da326fe6 Mon Sep 17 00:00:00 2001 From: Adam Demjen Date: Thu, 12 Jan 2023 12:00:10 -0400 Subject: [PATCH 24/39] [Bug] Fix Behavioral Analytics integration instructions for Search UI (#148592) --- ...nalytics_collection_integrate_searchui.tsx | 37 ++++++++++++++++--- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/components/analytics_collection_view/analytics_collection_integrate/analytics_collection_integrate_searchui.tsx b/x-pack/plugins/enterprise_search/public/applications/analytics/components/analytics_collection_view/analytics_collection_integrate/analytics_collection_integrate_searchui.tsx index cae8799544033..6db73c11cb7ee 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/components/analytics_collection_view/analytics_collection_integrate/analytics_collection_integrate_searchui.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/components/analytics_collection_view/analytics_collection_integrate/analytics_collection_integrate_searchui.tsx @@ -32,9 +32,9 @@ export const searchUIEmbedSteps = (setSelectedTab: (tab: TabKey) => void) => [ values={{ embedLink: ( { - setSelectedTab('javascriptClientEmbed'); + setSelectedTab('javascriptEmbed'); }} > {i18n.translate( @@ -47,9 +47,9 @@ export const searchUIEmbedSteps = (setSelectedTab: (tab: TabKey) => void) => [ ), clientLink: ( { - setSelectedTab('javascriptEmbed'); + setSelectedTab('javascriptClientEmbed'); }} > {i18n.translate( @@ -106,13 +106,13 @@ export const searchUIEmbedSteps = (setSelectedTab: (tab: TabKey) => void) => [ 'xpack.enterpriseSearch.analytics.collections.collectionsView.integrateTab.searchui.stepTwo.setupDescription', { defaultMessage: - 'Finally, add the plugin to your Search UI configuration. Depending on how you have embedded Behavioral analytics, you may need to pass in the client. The example below shows how to pass in the client when using the Javascript client.', + 'Finally, add the plugin to your Search UI configuration. Depending on how you have embedded Behavioral Analytics, you may need to pass in the client. The example below shows how to pass in the client when using the Javascript client.', } )}

{` -import { getTracker } from "@elastic/behavioral-analytics-tracker"; +import { getTracker } from "@elastic/behavioral-analytics-javascript-tracker"; const searchUIConfig = { ... @@ -124,6 +124,31 @@ plugins: [ ... }`} + +

+ + {i18n.translate( + 'xpack.enterpriseSearch.analytics.collections.collectionsView.integrateTab.searchui.stepTwo.analyticsPluginDoc', + { + defaultMessage: 'Analytics Plugin Documentation', + } + )} + + ), + }} + /> +

), From fb39c8b0ffea2c2fa5e732ca17ca8c468fae5570 Mon Sep 17 00:00:00 2001 From: Rodney Norris Date: Thu, 12 Jan 2023 10:34:01 -0600 Subject: [PATCH 25/39] [Enterprise Search][Engines] Engine overview - chrome (#148593) ## Summary Introduces the page chrome and side nav for viewing an engine. ### Screenshots image 404 image --- .../enterprise_search/common/constants.ts | 6 + .../enterprise_search/common/types/engines.ts | 20 +- .../engines/fetch_engine_api_logic.test.ts | 29 +++ .../api/engines/fetch_engine_api_logic.ts | 28 +++ .../api/index/fetch_index_api_logic.test.ts | 4 +- .../components/engine/engine_error.test.tsx | 68 +++++++ .../components/engine/engine_error.tsx | 42 ++++ .../components/engine/engine_name_logic.ts | 36 ++++ .../components/engine/engine_router.tsx | 50 +++++ .../components/engine/engine_view.tsx | 74 ++++++++ .../engine/engine_view_logic.test.ts | 34 ++++ .../components/engine/engine_view_logic.ts | 50 +++++ .../components/tables/engines_table.tsx | 28 ++- .../engines/engine_list_logic.test.ts | 13 +- .../components/engines/engines_router.tsx | 6 +- .../layout/engines_page_template.tsx | 40 ++++ .../enterprise_search_content/routes.ts | 10 + .../kibana_chrome/generate_breadcrumbs.ts | 7 + .../shared/kibana_chrome/index.ts | 1 + .../shared/kibana_chrome/set_chrome.tsx | 18 ++ .../applications/shared/layout/index.ts | 2 +- .../applications/shared/layout/nav.test.tsx | 179 +++++++++++++++++- .../public/applications/shared/layout/nav.tsx | 101 +++++++++- .../shared/not_found/not_found_prompt.tsx | 14 +- 24 files changed, 841 insertions(+), 19 deletions(-) create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/engines/fetch_engine_api_logic.test.ts create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/engines/fetch_engine_api_logic.ts create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_error.test.tsx create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_error.tsx create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_name_logic.ts create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_router.tsx create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_view.tsx create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_view_logic.test.ts create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_view_logic.ts create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/layout/engines_page_template.tsx diff --git a/x-pack/plugins/enterprise_search/common/constants.ts b/x-pack/plugins/enterprise_search/common/constants.ts index 425482890a368..39d0f51b067b8 100644 --- a/x-pack/plugins/enterprise_search/common/constants.ts +++ b/x-pack/plugins/enterprise_search/common/constants.ts @@ -117,6 +117,12 @@ export const SEARCH_EXPERIENCES_PLUGIN = { WORKPLACE_SEARCH_TUTORIAL_URL: 'https://docs.elastic.co/search-ui/tutorials/workplace-search', }; +export const ENGINES_PLUGIN = { + NAV_TITLE: i18n.translate('xpack.enterpriseSearch.engines.navTitle', { + defaultMessage: 'Engines', + }), +}; + export const LICENSED_SUPPORT_URL = 'https://support.elastic.co'; export const JSON_HEADER = { diff --git a/x-pack/plugins/enterprise_search/common/types/engines.ts b/x-pack/plugins/enterprise_search/common/types/engines.ts index 850fde871a024..9e070121f7655 100644 --- a/x-pack/plugins/enterprise_search/common/types/engines.ts +++ b/x-pack/plugins/enterprise_search/common/types/engines.ts @@ -5,6 +5,8 @@ * 2.0. */ +import { HealthStatus } from '@elastic/elasticsearch/lib/api/types'; + export interface EnterpriseSearchEnginesResponse { meta: { from: number; @@ -15,6 +17,22 @@ export interface EnterpriseSearchEnginesResponse { } export interface EnterpriseSearchEngine { - name: string; + created: string; indices: string[]; + name: string; + updated: string; +} + +export interface EnterpriseSearchEngineDetails { + created: string; + indices: EnterpriseSearchEngineIndex[]; + name: string; + updated: string; +} + +export interface EnterpriseSearchEngineIndex { + count: number; + health: HealthStatus | 'unknown'; + name: string; + source: 'api' | 'connector' | 'crawler'; } diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/engines/fetch_engine_api_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/engines/fetch_engine_api_logic.test.ts new file mode 100644 index 0000000000000..04582d4b4d585 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/engines/fetch_engine_api_logic.test.ts @@ -0,0 +1,29 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { mockHttpValues } from '../../../__mocks__/kea_logic'; + +import { nextTick } from '@kbn/test-jest-helpers'; + +import { fetchEngine } from './fetch_engine_api_logic'; + +describe('FetchEngineApiLogic', () => { + const { http } = mockHttpValues; + beforeEach(() => { + jest.clearAllMocks(); + }); + describe('fetchEngine', () => { + it('calls correct api', async () => { + const promise = Promise.resolve('result'); + http.get.mockReturnValue(promise); + const result = fetchEngine({ engineName: 'my-engine' }); + await nextTick(); + expect(http.get).toHaveBeenCalledWith('/internal/enterprise_search/engines/my-engine'); + await expect(result).resolves.toEqual('result'); + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/engines/fetch_engine_api_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/engines/fetch_engine_api_logic.ts new file mode 100644 index 0000000000000..ba3cf3d467fb6 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/engines/fetch_engine_api_logic.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EnterpriseSearchEngineDetails } from '../../../../../common/types/engines'; +import { Actions, createApiLogic } from '../../../shared/api_logic/create_api_logic'; +import { HttpLogic } from '../../../shared/http'; + +export interface FetchEngineApiParams { + engineName: string; +} + +export type FetchEngineApiResponse = EnterpriseSearchEngineDetails; + +export const fetchEngine = async ({ + engineName, +}: FetchEngineApiParams): Promise => { + const route = `/internal/enterprise_search/engines/${engineName}`; + + return await HttpLogic.values.http.get(route); +}; + +export const FetchEngineApiLogic = createApiLogic(['fetch_engine_api_logic'], fetchEngine); + +export type FetchEngineApiLogicActions = Actions; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/fetch_index_api_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/fetch_index_api_logic.test.ts index ec42da514e01c..24f2096a38d00 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/fetch_index_api_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/fetch_index_api_logic.test.ts @@ -11,12 +11,12 @@ import { nextTick } from '@kbn/test-jest-helpers'; import { fetchIndex } from './fetch_index_api_logic'; -describe('generateConnectorApiKeyApiLogic', () => { +describe('FetchIndexApiLogic', () => { const { http } = mockHttpValues; beforeEach(() => { jest.clearAllMocks(); }); - describe('generateApiKey', () => { + describe('fetchIndex', () => { it('calls correct api', async () => { const promise = Promise.resolve('result'); http.get.mockReturnValue(promise); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_error.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_error.test.tsx new file mode 100644 index 0000000000000..9c71c401fbaf0 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_error.test.tsx @@ -0,0 +1,68 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { setMockValues } from '../../../__mocks__/kea_logic'; + +import React from 'react'; + +import { HttpError } from '../../../../../common/types/api'; + +import { ErrorStatePrompt } from '../../../shared/error_state'; +import { NotFoundPrompt } from '../../../shared/not_found'; +import { SendEnterpriseSearchTelemetry } from '../../../shared/telemetry'; + +import { mountWithIntl } from '../../../test_helpers'; + +import { EngineError } from './engine_error'; + +describe('EngineError', () => { + beforeEach(() => { + jest.clearAllMocks(); + setMockValues({}); + }); + + it('renders 404 prompt for 404 error', () => { + const error = { + body: { + error: 'NOT_FOUND', + message: 'Not Found', + statusCode: 404, + }, + } as HttpError; + const wrapper = mountWithIntl(); + + expect(wrapper.find(NotFoundPrompt)).toHaveLength(1); + expect(wrapper.find(SendEnterpriseSearchTelemetry)).toHaveLength(1); + expect(wrapper.find(ErrorStatePrompt)).toHaveLength(0); + + const notFound = wrapper.find(NotFoundPrompt); + expect(notFound.prop('backToLink')).toEqual('/engines'); + expect(notFound.prop('backToContent')).toEqual('Back to Engines'); + + const telemetry = wrapper.find(SendEnterpriseSearchTelemetry); + expect(telemetry.prop('action')).toEqual('error'); + expect(telemetry.prop('metric')).toEqual('not_found'); + }); + + it('renders error prompt for api errors', () => { + const error = { + body: { + error: 'ERROR', + message: 'Internal Server Error', + statusCode: 500, + }, + } as HttpError; + const wrapper = mountWithIntl(); + + expect(wrapper.find(ErrorStatePrompt)).toHaveLength(1); + expect(wrapper.find(SendEnterpriseSearchTelemetry)).toHaveLength(1); + expect(wrapper.find(NotFoundPrompt)).toHaveLength(0); + + const telemetry = wrapper.find(SendEnterpriseSearchTelemetry); + expect(telemetry.prop('action')).toEqual('error'); + expect(telemetry.prop('metric')).toEqual('cannot_connect'); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_error.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_error.tsx new file mode 100644 index 0000000000000..4b620c7a3d505 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_error.tsx @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { i18n } from '@kbn/i18n'; + +import { ENTERPRISE_SEARCH_CONTENT_PLUGIN } from '../../../../../common/constants'; +import { HttpError } from '../../../../../common/types/api'; + +import { ErrorStatePrompt } from '../../../shared/error_state'; +import { NotFoundPrompt } from '../../../shared/not_found'; +import { SendEnterpriseSearchTelemetry } from '../../../shared/telemetry'; + +import { ENGINES_PATH } from '../../routes'; + +export const EngineError: React.FC<{ error: HttpError | undefined }> = ({ error }) => { + if (error?.body?.statusCode === 404) { + return ( + <> + + + + ); + } + return ( + <> + + + + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_name_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_name_logic.ts new file mode 100644 index 0000000000000..91fb9ffc38fe6 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_name_logic.ts @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { kea, MakeLogicType } from 'kea'; + +export interface EngineNameProps { + engineName: string; +} + +export type EngineNameValues = EngineNameProps; + +export interface EngineNameActions { + setEngineName: (engineName: string) => { engineName: string }; +} + +export const EngineNameLogic = kea< + MakeLogicType +>({ + actions: { + setEngineName: (engineName) => ({ engineName }), + }, + path: ['enterprise_search', 'content', 'engine_name'], + reducers: ({ props }) => ({ + engineName: [ + // Short-circuiting this to empty string is necessary to enable testing logics relying on this + props.engineName ?? '', + { + setEngineName: (_, { engineName }) => engineName, + }, + ], + }), +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_router.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_router.tsx new file mode 100644 index 0000000000000..a9984b1ece3ba --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_router.tsx @@ -0,0 +1,50 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useEffect } from 'react'; +import { Redirect, Route, Switch, useParams } from 'react-router-dom'; + +import { useActions } from 'kea'; + +import { generateEncodedPath } from '../../../shared/encode_path_params'; +import { ENGINE_PATH, ENGINE_TAB_PATH, EngineViewTabs } from '../../routes'; + +import { EngineNameLogic } from './engine_name_logic'; +import { EngineView } from './engine_view'; + +export const EngineRouter: React.FC = () => { + const engineName = decodeURIComponent(useParams<{ engineName: string }>().engineName); + const engineNameLogic = EngineNameLogic({ engineName }); + const { setEngineName } = useActions(engineNameLogic); + + useEffect(() => { + const unmountName = engineNameLogic.mount(); + + return () => { + unmountName(); + }; + }, []); + useEffect(() => { + setEngineName(engineName); + }, [engineName]); + + return ( + + + + + + + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_view.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_view.tsx new file mode 100644 index 0000000000000..4f8cd60d745d9 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_view.tsx @@ -0,0 +1,74 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useEffect } from 'react'; +import { useParams } from 'react-router-dom'; + +import { useActions, useValues } from 'kea'; + +import { EuiButtonEmpty } from '@elastic/eui'; + +import { Status } from '../../../../../common/types/api'; + +import { docLinks } from '../../../shared/doc_links'; +import { EngineViewTabs } from '../../routes'; + +import { EnterpriseSearchEnginesPageTemplate } from '../layout/engines_page_template'; + +import { EngineError } from './engine_error'; +import { EngineViewLogic } from './engine_view_logic'; + +export const EngineView: React.FC = () => { + const { engineName, fetchEngineApiError, fetchEngineApiStatus, isLoadingEngine } = + useValues(EngineViewLogic); + const { fetchEngine } = useActions(EngineViewLogic); + const { tabId = EngineViewTabs.OVERVIEW } = useParams<{ + tabId?: string; + }>(); + useEffect(() => { + fetchEngine({ engineName }); + }, [engineName]); + + if (fetchEngineApiStatus === Status.ERROR) { + return ( + } + /> + ); + } + + return ( + + Engine Docs + , + ], + }} + engineName={engineName} + > +
+ + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_view_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_view_logic.test.ts new file mode 100644 index 0000000000000..18ad97c54e649 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_view_logic.test.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { LogicMounter } from '../../../__mocks__/kea_logic'; + +import { Status } from '../../../../../common/types/api'; + +import { EngineViewLogic, EngineViewValues } from './engine_view_logic'; + +const DEFAULT_VALUES: EngineViewValues = { + engineData: undefined, + engineName: 'my-test-engine', + fetchEngineApiError: undefined, + fetchEngineApiStatus: Status.IDLE, + isLoadingEngine: true, +}; + +describe('EngineViewLogic', () => { + const { mount } = new LogicMounter(EngineViewLogic); + beforeEach(() => { + jest.clearAllMocks(); + jest.useRealTimers(); + + mount({ engineName: DEFAULT_VALUES.engineName }, { engineName: DEFAULT_VALUES.engineName }); + }); + + it('has expected default values', () => { + expect(EngineViewLogic.values).toEqual(DEFAULT_VALUES); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_view_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_view_logic.ts new file mode 100644 index 0000000000000..021ac6d9ea626 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_view_logic.ts @@ -0,0 +1,50 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { kea, MakeLogicType } from 'kea'; + +import { Status } from '../../../../../common/types/api'; + +import { + FetchEngineApiLogic, + FetchEngineApiLogicActions, +} from '../../api/engines/fetch_engine_api_logic'; + +import { EngineNameLogic } from './engine_name_logic'; + +export interface EngineViewActions { + fetchEngine: FetchEngineApiLogicActions['makeRequest']; +} + +export interface EngineViewValues { + engineData: typeof FetchEngineApiLogic.values.data; + engineName: typeof EngineNameLogic.values.engineName; + fetchEngineApiError?: typeof FetchEngineApiLogic.values.error; + fetchEngineApiStatus: typeof FetchEngineApiLogic.values.status; + isLoadingEngine: boolean; +} + +export const EngineViewLogic = kea>({ + connect: { + actions: [FetchEngineApiLogic, ['makeRequest as fetchEngine']], + values: [ + EngineNameLogic, + ['engineName'], + FetchEngineApiLogic, + ['data as engineData', 'status as fetchEngineApiStatus', 'error as fetchEngineApiError'], + ], + }, + path: ['enterprise_search', 'content', 'engine_view_logic'], + selectors: ({ selectors }) => ({ + isLoadingEngine: [ + () => [selectors.fetchEngineApiStatus, selectors.engineData], + (status: EngineViewValues['fetchEngineApiStatus'], data: EngineViewValues['engineData']) => { + return status === Status.IDLE || (!data && status === Status.LOADING); + }, + ], + }), +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engines/components/tables/engines_table.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engines/components/tables/engines_table.tsx index 0807b70c40076..b06264e85012a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engines/components/tables/engines_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engines/components/tables/engines_table.tsx @@ -7,6 +7,8 @@ import React from 'react'; +import { useValues } from 'kea'; + import { CriteriaWithPagination, EuiBasicTable, EuiBasicTableColumn } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -14,15 +16,19 @@ import { i18n } from '@kbn/i18n'; import { EnterpriseSearchEngine } from '../../../../../../../common/types/engines'; import { DELETE_BUTTON_LABEL, MANAGE_BUTTON_LABEL } from '../../../../../shared/constants'; +import { generateEncodedPath } from '../../../../../shared/encode_path_params'; +import { KibanaLogic } from '../../../../../shared/kibana'; +import { EuiLinkTo } from '../../../../../shared/react_router_helpers'; +import { ENGINE_PATH } from '../../../../routes'; import { convertMetaToPagination, Meta } from '../../types'; // add health status interface EnginesListTableProps { enginesList: EnterpriseSearchEngine[]; + isLoading?: boolean; loading: boolean; meta: Meta; - isLoading?: boolean; onChange: (criteria: CriteriaWithPagination) => void; } export const EnginesListTable: React.FC = ({ @@ -31,19 +37,28 @@ export const EnginesListTable: React.FC = ({ isLoading, onChange, }) => { + const { navigateToUrl } = useValues(KibanaLogic); const columns: Array> = [ { field: 'name', name: i18n.translate('xpack.enterpriseSearch.content.enginesList.table.column.name', { defaultMessage: 'Engine Name', }), - width: '30%', - truncateText: true, mobileOptions: { header: true, enlarge: true, width: '100%', }, + render: (name: string) => ( + + {name} + + ), + truncateText: true, + width: '30%', }, { field: 'last_updated', @@ -75,7 +90,12 @@ export const EnginesListTable: React.FC = ({ ), type: 'icon', icon: 'eye', - onClick: () => {}, + onClick: (engine) => + navigateToUrl( + generateEncodedPath(ENGINE_PATH, { + engineName: engine.name, + }) + ), }, { name: DELETE_BUTTON_LABEL, diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engines/engine_list_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engines/engine_list_logic.test.ts index 752dce8924e4d..3dc99d5717845 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engines/engine_list_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engines/engine_list_logic.test.ts @@ -29,21 +29,26 @@ const DEFAULT_VALUES = { const results: EnterpriseSearchEngine[] = [ { - name: 'engine-name-1', + created: '1999-12-31T23:59:59Z', indices: ['index-18', 'index-23'], + name: 'engine-name-1', + updated: '1999-12-31T23:59:59Z', // last_updated: '21 March 2021', // document_count: 18, }, { - name: 'engine-name-2', + created: '1999-12-31T23:59:59Z', indices: ['index-180', 'index-230', 'index-8', 'index-2'], + name: 'engine-name-2', + updated: '1999-12-31T23:59:59Z', // last_updated: '10 Jul 2018', // document_count: 10, }, - { - name: 'engine-name-3', + created: '1999-12-31T23:59:59Z', indices: ['index-2', 'index-3'], + name: 'engine-name-3', + updated: '1999-12-31T23:59:59Z', // last_updated: '21 December 2022', // document_count: 8, }, diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engines/engines_router.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engines/engines_router.tsx index 14b0f424839d6..10687556a1e33 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engines/engines_router.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engines/engines_router.tsx @@ -12,8 +12,9 @@ import { useValues } from 'kea'; import { enableEnginesSection } from '../../../../../common/ui_settings_keys'; import { KibanaLogic } from '../../../shared/kibana'; -import { ENGINES_PATH } from '../../routes'; +import { ENGINES_PATH, ENGINE_PATH } from '../../routes'; +import { EngineRouter } from '../engine/engine_router'; import { NotFound } from '../not_found'; import { EnginesList } from './engines_list'; @@ -35,6 +36,9 @@ export const EnginesRouter: React.FC = () => { + + + diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/layout/engines_page_template.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/layout/engines_page_template.tsx new file mode 100644 index 0000000000000..94f0d9ae56e7c --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/layout/engines_page_template.tsx @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { ENTERPRISE_SEARCH_CONTENT_PLUGIN } from '../../../../../common/constants'; +import { SetEnterpriseSearchEnginesChrome } from '../../../shared/kibana_chrome'; +import { EnterpriseSearchPageTemplateWrapper, PageTemplateProps } from '../../../shared/layout'; +import { useEnterpriseSearchEngineNav } from '../../../shared/layout'; +import { SendEnterpriseSearchTelemetry } from '../../../shared/telemetry'; + +export type EnterpriseSearchEnginesPageTemplateProps = PageTemplateProps & { + engineName?: string; +}; + +export const EnterpriseSearchEnginesPageTemplate: React.FC< + EnterpriseSearchEnginesPageTemplateProps +> = ({ children, pageChrome, pageViewTelemetry, engineName, ...pageTemplateProps }) => { + const navItems = useEnterpriseSearchEngineNav(engineName, pageTemplateProps.isEmptyState); + return ( + } + > + {pageViewTelemetry && ( + + )} + {children} + + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/routes.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/routes.ts index edd3aa3d42edb..3617c097ad401 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/routes.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/routes.ts @@ -24,5 +24,15 @@ export const SEARCH_INDEX_SELECT_CONNECTOR_PATH = `${SEARCH_INDEX_PATH}/select_c export const ENGINES_PATH = `${ROOT_PATH}engines`; export const ENGINE_CREATION_PATH = `${ENGINES_PATH}/new`; +export const ENGINE_PATH = `${ENGINES_PATH}/:engineName`; +export const ENGINE_TAB_PATH = `${ENGINE_PATH}/:tabId`; +export enum EngineViewTabs { + OVERVIEW = 'overview', + INDICES = 'indices', + DOCUMENTS = 'documents', + SCHEMA = 'schema', + PREVIEW = 'preview', + API = 'api', +} export const ML_MANAGE_TRAINED_MODELS_PATH = '/app/ml/trained_models'; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/generate_breadcrumbs.ts b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/generate_breadcrumbs.ts index 140ec10df23da..87282007f5bbd 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/generate_breadcrumbs.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/generate_breadcrumbs.ts @@ -10,6 +10,7 @@ import { useValues } from 'kea'; import { EuiBreadcrumb } from '@elastic/eui'; import { + ENGINES_PLUGIN, ENTERPRISE_SEARCH_OVERVIEW_PLUGIN, ANALYTICS_PLUGIN, APP_SEARCH_PLUGIN, @@ -136,3 +137,9 @@ export const useSearchExperiencesBreadcrumbs = (breadcrumbs: Breadcrumbs = []) = { text: SEARCH_EXPERIENCES_PLUGIN.NAV_TITLE, path: '/' }, ...breadcrumbs, ]); + +export const useEnterpriseSearchEnginesBreadcrumbs = (breadcrumbs: Breadcrumbs = []) => + useEnterpriseSearchBreadcrumbs([ + { text: ENGINES_PLUGIN.NAV_TITLE, path: '/engines' }, + ...breadcrumbs, + ]); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/index.ts b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/index.ts index 1a013bf11df35..5936e3873fe4a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/index.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/index.ts @@ -13,4 +13,5 @@ export { SetAppSearchChrome, SetWorkplaceSearchChrome, SetSearchExperiencesChrome, + SetEnterpriseSearchEnginesChrome, } from './set_chrome'; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/set_chrome.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/set_chrome.tsx index 72b68c9a5cc7f..9c22e64127326 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/set_chrome.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/set_chrome.tsx @@ -14,6 +14,7 @@ import { KibanaLogic } from '../kibana'; import { useGenerateBreadcrumbs, useEnterpriseSearchBreadcrumbs, + useEnterpriseSearchEnginesBreadcrumbs, useAnalyticsBreadcrumbs, useEnterpriseSearchContentBreadcrumbs, useElasticsearchBreadcrumbs, @@ -169,5 +170,22 @@ export const SetSearchExperiencesChrome: React.FC = ({ trail = [ return null; }; +export const SetEnterpriseSearchEnginesChrome: React.FC = ({ trail = [] }) => { + const { setBreadcrumbs, setDocTitle } = useValues(KibanaLogic); + + const title = reverseArray(trail); + const docTitle = appSearchTitle(title); + + const crumbs = useGenerateBreadcrumbs(trail); + const breadcrumbs = useEnterpriseSearchEnginesBreadcrumbs(crumbs); + + useEffect(() => { + setBreadcrumbs(breadcrumbs); + setDocTitle(docTitle); + }, [trail]); + + return null; +}; + // Small util - performantly reverses an array without mutating the original array const reverseArray = (array: string[]) => array.slice().reverse(); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/index.ts b/x-pack/plugins/enterprise_search/public/applications/shared/layout/index.ts index b137029defb34..81a4a89c5242d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/index.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/layout/index.ts @@ -8,4 +8,4 @@ export type { PageTemplateProps } from './page_template'; export { EnterpriseSearchPageTemplateWrapper } from './page_template'; export { generateNavLink } from './nav_link_helpers'; -export { useEnterpriseSearchNav } from './nav'; +export { useEnterpriseSearchNav, useEnterpriseSearchEngineNav } from './nav'; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.test.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.test.tsx index 06f31ba047dff..103d24ebbe615 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.test.tsx @@ -11,11 +11,13 @@ jest.mock('./nav_link_helpers', () => ({ import { setMockValues, mockKibanaValues } from '../../__mocks__/kea_logic'; +import { EuiSideNavItemType } from '@elastic/eui'; + import { ProductAccess } from '../../../../common/types'; import { enableEnginesSection } from '../../../../common/ui_settings_keys'; -import { useEnterpriseSearchNav } from './nav'; +import { useEnterpriseSearchNav, useEnterpriseSearchEngineNav } from './nav'; describe('useEnterpriseSearchContentNav', () => { beforeEach(() => { @@ -342,3 +344,178 @@ describe('useEnterpriseSearchContentNav Engines feature flag', () => { }); }); }); + +describe('useEnterpriseSearchEngineNav', () => { + beforeEach(() => { + jest.clearAllMocks(); + mockKibanaValues.uiSettings.get.mockReturnValue(true); + const fullProductAccess: ProductAccess = { + hasAppSearchAccess: true, + hasWorkplaceSearchAccess: true, + }; + setMockValues({ productAccess: fullProductAccess }); + }); + + it('returns an array of top-level Enterprise Search nav items', () => { + expect(useEnterpriseSearchEngineNav()).toEqual([ + { + href: '/app/enterprise_search/overview', + id: 'es_overview', + name: 'Overview', + }, + { + id: 'content', + items: [ + { + href: '/app/enterprise_search/content/search_indices', + id: 'search_indices', + name: 'Indices', + }, + { + href: '/app/enterprise_search/content/settings', + id: 'settings', + items: undefined, + name: 'Settings', + }, + ], + name: 'Content', + }, + { + id: 'enginesSearch', + name: 'Search', + items: [ + { + href: '/app/enterprise_search/elasticsearch', + id: 'elasticsearch', + name: 'Elasticsearch', + }, + { + id: 'enterpriseSearchEngines', + name: 'Engines', + href: '/app/enterprise_search/content/engines', + }, + ], + }, + { + id: 'enterpriseSearchAnalytics', + items: [ + { + href: '/app/enterprise_search/analytics', + id: 'analytics_collections', + name: 'Collections', + }, + ], + name: 'Behavioral Analytics', + }, + { + id: 'standaloneExperiences', + items: [ + { + href: '/app/enterprise_search/app_search', + id: 'app_search', + name: 'App Search', + }, + { + href: '/app/enterprise_search/workplace_search', + id: 'workplace_search', + name: 'Workplace Search', + }, + ], + name: 'Standalone Experiences', + }, + ]); + expect(mockKibanaValues.uiSettings.get).toHaveBeenCalledWith(enableEnginesSection, false); + }); + + it('returns selected engine sub nav items', () => { + const engineName = 'my-test-engine'; + const navItems = useEnterpriseSearchEngineNav(engineName); + expect(navItems.map((ni) => ni.name)).toEqual([ + 'Overview', + 'Content', + 'Search', + 'Behavioral Analytics', + 'Standalone Experiences', + ]); + const searchItem = navItems.find((ni) => ni.id === 'enginesSearch'); + expect(searchItem).not.toBeUndefined(); + expect(searchItem!.items).not.toBeUndefined(); + // @ts-ignore + const enginesItem: EuiSideNavItemType = searchItem?.items?.find( + (si: EuiSideNavItemType) => si.id === 'enterpriseSearchEngines' + ); + expect(enginesItem).not.toBeUndefined(); + expect(enginesItem!.items).not.toBeUndefined(); + expect(enginesItem!.items).toHaveLength(1); + + // @ts-ignore + const engineItem: EuiSideNavItemType = enginesItem!.items[0]; + expect(engineItem).toEqual({ + href: `/app/enterprise_search/content/engines/${engineName}`, + id: 'engineId', + items: [ + { + href: `/app/enterprise_search/content/engines/${engineName}/overview`, + id: 'enterpriseSearchEngineOverview', + name: 'Overview', + }, + { + href: `/app/enterprise_search/content/engines/${engineName}/indices`, + id: 'enterpriseSearchEngineIndices', + name: 'Indices', + }, + { + href: `/app/enterprise_search/content/engines/${engineName}/documents`, + id: 'enterpriseSearchEngineDocuments', + name: 'Documents', + }, + { + href: `/app/enterprise_search/content/engines/${engineName}/schema`, + id: 'enterpriseSearchEngineSchema', + name: 'Schema', + }, + { + href: `/app/enterprise_search/content/engines/${engineName}/preview`, + id: 'enterpriseSearchEnginePreview', + name: 'Preview', + }, + { + href: `/app/enterprise_search/content/engines/${engineName}/api`, + id: 'enterpriseSearchEngineAPI', + name: 'API', + }, + ], + name: engineName, + }); + }); + + it('returns selected engine without tabs when isEmpty', () => { + const engineName = 'my-test-engine'; + const navItems = useEnterpriseSearchEngineNav(engineName, true); + expect(navItems.map((ni) => ni.name)).toEqual([ + 'Overview', + 'Content', + 'Search', + 'Behavioral Analytics', + 'Standalone Experiences', + ]); + const searchItem = navItems.find((ni) => ni.id === 'enginesSearch'); + expect(searchItem).not.toBeUndefined(); + expect(searchItem!.items).not.toBeUndefined(); + // @ts-ignore + const enginesItem: EuiSideNavItemType = searchItem?.items?.find( + (si: EuiSideNavItemType) => si.id === 'enterpriseSearchEngines' + ); + expect(enginesItem).not.toBeUndefined(); + expect(enginesItem!.items).not.toBeUndefined(); + expect(enginesItem!.items).toHaveLength(1); + + // @ts-ignore + const engineItem: EuiSideNavItemType = enginesItem!.items[0]; + expect(engineItem).toEqual({ + href: `/app/enterprise_search/content/engines/${engineName}`, + id: 'engineId', + name: engineName, + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.tsx index 83f5cbca3ca40..8ffb822352324 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.tsx @@ -24,6 +24,7 @@ import { ENGINES_PATH, SEARCH_INDICES_PATH, SETTINGS_PATH, + EngineViewTabs, } from '../../enterprise_search_content/routes'; import { KibanaLogic } from '../kibana'; @@ -176,7 +177,6 @@ export const useEnterpriseSearchNav = () => { }), ...generateNavLink({ shouldNotCreateHref: true, - shouldShowActiveForSubroutes: true, to: ENTERPRISE_SEARCH_CONTENT_PLUGIN.URL + ENGINES_PATH, }), }, @@ -231,3 +231,102 @@ export const useEnterpriseSearchNav = () => { return navItems; }; + +export const useEnterpriseSearchEngineNav = (engineName?: string, isEmptyState?: boolean) => { + const navItems = useEnterpriseSearchNav(); + if (!engineName) return navItems; + const searchItem = navItems.find((item) => item.id === 'enginesSearch'); + if (!searchItem || !searchItem.items) return navItems; + const enginesItem = searchItem.items[1]; + if (!enginesItem || enginesItem.id !== 'enterpriseSearchEngines') return navItems; + + const enginePath = `${ENTERPRISE_SEARCH_CONTENT_PLUGIN.URL}${ENGINES_PATH}/${engineName}`; + + enginesItem.items = !isEmptyState + ? [ + { + id: 'engineId', + name: engineName, + ...generateNavLink({ + shouldNotCreateHref: true, + to: enginePath, + }), + items: [ + { + id: 'enterpriseSearchEngineOverview', + name: i18n.translate('xpack.enterpriseSearch.nav.engine.overviewTitle', { + defaultMessage: 'Overview', + }), + ...generateNavLink({ + shouldNotCreateHref: true, + to: `${enginePath}/${EngineViewTabs.OVERVIEW}`, + }), + }, + { + id: 'enterpriseSearchEngineIndices', + name: i18n.translate('xpack.enterpriseSearch.nav.engine.indicesTitle', { + defaultMessage: 'Indices', + }), + ...generateNavLink({ + shouldNotCreateHref: true, + to: `${enginePath}/${EngineViewTabs.INDICES}`, + }), + }, + + { + id: 'enterpriseSearchEngineDocuments', + name: i18n.translate('xpack.enterpriseSearch.nav.engine.documentsTitle', { + defaultMessage: 'Documents', + }), + ...generateNavLink({ + shouldNotCreateHref: true, + to: `${enginePath}/${EngineViewTabs.DOCUMENTS}`, + }), + }, + { + id: 'enterpriseSearchEngineSchema', + name: i18n.translate('xpack.enterpriseSearch.nav.engine.schemaTitle', { + defaultMessage: 'Schema', + }), + ...generateNavLink({ + shouldNotCreateHref: true, + to: `${enginePath}/${EngineViewTabs.SCHEMA}`, + }), + }, + { + id: 'enterpriseSearchEnginePreview', + name: i18n.translate('xpack.enterpriseSearch.nav.engine.previewTitle', { + defaultMessage: 'Preview', + }), + ...generateNavLink({ + shouldNotCreateHref: true, + to: `${enginePath}/${EngineViewTabs.PREVIEW}`, + }), + }, + { + id: 'enterpriseSearchEngineAPI', + name: i18n.translate('xpack.enterpriseSearch.nav.engine.apiTitle', { + defaultMessage: 'API', + }), + ...generateNavLink({ + shouldNotCreateHref: true, + to: `${enginePath}/${EngineViewTabs.API}`, + }), + }, + ], + }, + ] + : [ + { + id: 'engineId', + name: engineName, + ...generateNavLink({ + shouldNotCreateHref: true, + shouldShowActiveForSubroutes: true, + to: enginePath, + }), + }, + ]; + + return navItems; +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/not_found/not_found_prompt.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/not_found/not_found_prompt.tsx index 4eba93a942efd..eaa008b7e9780 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/not_found/not_found_prompt.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/not_found/not_found_prompt.tsx @@ -20,9 +20,14 @@ import { EuiButtonTo } from '../react_router_helpers'; interface Props { productSupportUrl: string; backToLink?: string; + backToContent?: React.ReactNode; } -export const NotFoundPrompt: React.FC = ({ productSupportUrl, backToLink = '/' }) => { +export const NotFoundPrompt: React.FC = ({ + productSupportUrl, + backToLink = '/', + backToContent, +}) => { const { hasGoldLicense } = useValues(LicensingLogic); const supportUrl = hasGoldLicense ? LICENSED_SUPPORT_URL : productSupportUrl; @@ -47,9 +52,10 @@ export const NotFoundPrompt: React.FC = ({ productSupportUrl, backToLink - {i18n.translate('xpack.enterpriseSearch.notFound.action1', { - defaultMessage: 'Back to your dashboard', - })} + {backToContent ?? + i18n.translate('xpack.enterpriseSearch.notFound.action1', { + defaultMessage: 'Back to your dashboard', + })} From 4f80b4828437fad575e0eccc1ee8a94845108441 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 12 Jan 2023 11:50:27 -0500 Subject: [PATCH 26/39] skip failing test suite (#148806) --- .../test/fleet_api_integration/apis/package_policy/update.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/fleet_api_integration/apis/package_policy/update.ts b/x-pack/test/fleet_api_integration/apis/package_policy/update.ts index 08a0681f7cde6..697b8af01ccab 100644 --- a/x-pack/test/fleet_api_integration/apis/package_policy/update.ts +++ b/x-pack/test/fleet_api_integration/apis/package_policy/update.ts @@ -28,7 +28,8 @@ export default function (providerContext: FtrProviderContext) { // because `this` has to point to the Mocha context // see https://mochajs.org/#arrow-functions - describe('Package Policy - update', async function () { + // Failing: See https://github.com/elastic/kibana/issues/148806 + describe.skip('Package Policy - update', async function () { skipIfNoDockerRegistry(providerContext); let agentPolicyId: string; let managedAgentPolicyId: string; From c8e583f672a4a1560258eeaf4f46c8f7909a0adc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 12 Jan 2023 12:07:24 -0500 Subject: [PATCH 27/39] Update dependency elastic-apm-node to ^3.41.1 (main) (#148151) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [elastic-apm-node](https://togithub.com/elastic/apm-agent-nodejs) | [`^3.41.0` -> `^3.41.1`](https://renovatebot.com/diffs/npm/elastic-apm-node/3.41.0/3.41.1) | [![age](https://badges.renovateapi.com/packages/npm/elastic-apm-node/3.41.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/elastic-apm-node/3.41.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/elastic-apm-node/3.41.1/compatibility-slim/3.41.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/elastic-apm-node/3.41.1/confidence-slim/3.41.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
elastic/apm-agent-nodejs ### [`v3.41.1`](https://togithub.com/elastic/apm-agent-nodejs/releases/tag/v3.41.1) [Compare Source](https://togithub.com/elastic/apm-agent-nodejs/compare/v3.41.0...v3.41.1) For more information, please see the [changelog](https://www.elastic.co/guide/en/apm/agent/nodejs/current/release-notes-3.x.html#release-notes-3.41.1). ##### Elastic APM Node.js agent layer ARNs |Region|ARN| |------|---| |af-south-1|arn:aws:lambda:af-south-1:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |ap-east-1|arn:aws:lambda:ap-east-1:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |ap-northeast-1|arn:aws:lambda:ap-northeast-1:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |ap-northeast-2|arn:aws:lambda:ap-northeast-2:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |ap-northeast-3|arn:aws:lambda:ap-northeast-3:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |ap-south-1|arn:aws:lambda:ap-south-1:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |ap-southeast-1|arn:aws:lambda:ap-southeast-1:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |ap-southeast-2|arn:aws:lambda:ap-southeast-2:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |ap-southeast-3|arn:aws:lambda:ap-southeast-3:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |ca-central-1|arn:aws:lambda:ca-central-1:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |eu-central-1|arn:aws:lambda:eu-central-1:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |eu-north-1|arn:aws:lambda:eu-north-1:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |eu-south-1|arn:aws:lambda:eu-south-1:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |eu-west-1|arn:aws:lambda:eu-west-1:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |eu-west-2|arn:aws:lambda:eu-west-2:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |eu-west-3|arn:aws:lambda:eu-west-3:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |me-south-1|arn:aws:lambda:me-south-1:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |sa-east-1|arn:aws:lambda:sa-east-1:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |us-east-1|arn:aws:lambda:us-east-1:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |us-east-2|arn:aws:lambda:us-east-2:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |us-west-1|arn:aws:lambda:us-west-1:267093732750:layer:elastic-apm-node-ver-3-41-1:1| |us-west-2|arn:aws:lambda:us-west-2:267093732750:layer:elastic-apm-node-ver-3-41-1:1|
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/elastic/kibana). Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 40 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 53c1023cc1e72..8215ddf2270b7 100644 --- a/package.json +++ b/package.json @@ -527,7 +527,7 @@ "deepmerge": "^4.2.2", "del": "^6.1.0", "elastic-apm-http-client": "^11.0.1", - "elastic-apm-node": "^3.41.0", + "elastic-apm-node": "^3.41.1", "email-addresses": "^5.0.0", "execa": "^4.0.2", "expiry-js": "0.1.7", diff --git a/yarn.lock b/yarn.lock index f15482e086ee8..a9e11bb7aa0e5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13035,7 +13035,7 @@ elastic-apm-http-client@11.0.4, elastic-apm-http-client@^11.0.1: semver "^6.3.0" stream-chopper "^3.0.1" -elastic-apm-node@^3.38.0, elastic-apm-node@^3.41.0: +elastic-apm-node@^3.38.0: version "3.41.0" resolved "https://registry.yarnpkg.com/elastic-apm-node/-/elastic-apm-node-3.41.0.tgz#ff0b5ecf6d126a2eb312ecc936bd55bc3f1e3ce6" integrity sha512-cX745ryAwQCFEhkYttLrdjQDO0vCHspCbKg6bCguvBURZUHkLnZcP5z5m3R20dnGfTDXGg2q6nMi65iIVMCYFA== @@ -13073,6 +13073,44 @@ elastic-apm-node@^3.38.0, elastic-apm-node@^3.41.0: traverse "^0.6.6" unicode-byte-truncate "^1.0.0" +elastic-apm-node@^3.41.1: + version "3.41.1" + resolved "https://registry.yarnpkg.com/elastic-apm-node/-/elastic-apm-node-3.41.1.tgz#e0829d69d5e8a6062ef567d0a8db0ec0e3736ea8" + integrity sha512-bLCVIyAgQC+ZfY5fd/UaAId+8dh3vusaxZF2A0YtHBAwx1YGpIA3dqOt5zc1UuYmbjCdsEAiUjaUEAHOWdjTzA== + dependencies: + "@elastic/ecs-pino-format" "^1.2.0" + "@opentelemetry/api" "^1.1.0" + after-all-results "^2.0.0" + async-cache "^1.1.0" + async-value-promise "^1.1.1" + basic-auth "^2.0.1" + cookie "^0.5.0" + core-util-is "^1.0.2" + elastic-apm-http-client "11.0.4" + end-of-stream "^1.4.4" + error-callsites "^2.0.4" + error-stack-parser "^2.0.6" + escape-string-regexp "^4.0.0" + fast-safe-stringify "^2.0.7" + http-headers "^3.0.2" + is-native "^1.0.1" + lru-cache "^6.0.0" + measured-reporting "^1.51.1" + monitor-event-loop-delay "^1.0.0" + object-filter-sequence "^1.0.0" + object-identity-map "^1.0.2" + original-url "^1.2.3" + pino "^6.11.2" + relative-microtime "^2.0.0" + require-in-the-middle "^5.2.0" + semver "^6.3.0" + set-cookie-serde "^1.0.0" + shallow-clone-shim "^2.0.0" + source-map "^0.8.0-beta.0" + sql-summary "^1.0.1" + traverse "^0.6.6" + unicode-byte-truncate "^1.0.0" + elasticsearch@^16.4.0: version "16.7.0" resolved "https://registry.yarnpkg.com/elasticsearch/-/elasticsearch-16.7.0.tgz#9055e3f586934d8de5fd407b04050e9d54173333" From c09701c31764b182ce81fd88a926e0cef2568f47 Mon Sep 17 00:00:00 2001 From: Candace Park <56409205+parkiino@users.noreply.github.com> Date: Thu, 12 Jan 2023 09:10:41 -0800 Subject: [PATCH 28/39] [Security Solution][Admin][Policy] Fixes policy form vertical misalignment (#148689) ## Summary - Fixes a vertical misalignment bug in the Endpoint management policy forms due to an EUI update # Screenshots BEFORE ![image](https://user-images.githubusercontent.com/56409205/211673420-4d850da1-c4dc-40de-b90d-c2c60ab0480d.png) AFTER ![image](https://user-images.githubusercontent.com/56409205/211673379-e08bcf8a-74ca-410e-aa32-ec836037fb1f.png) --- .../policy_forms/components/radio_buttons.tsx | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/radio_buttons.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/radio_buttons.tsx index bb07f4e28cf1e..ce4d86e037899 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/radio_buttons.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/radio_buttons.tsx @@ -8,7 +8,6 @@ import React, { useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import styled from 'styled-components'; import { EuiSpacer, EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; import type { Immutable, @@ -20,15 +19,6 @@ import type { PolicyProtection } from '../../../types'; import { ConfigFormHeading } from '../../components/config_form'; import { ProtectionRadio } from './protection_radio'; -export const RadioFlexGroup = styled(EuiFlexGroup)` - .no-right-margin-radio { - margin-right: 0; - } - .no-horizontal-margin-radio { - margin: ${(props) => props.theme.eui.euiSizeM} 0; - } -`; - export const RadioButtons = React.memo( ({ protection, @@ -68,8 +58,8 @@ export const RadioButtons = React.memo( /> - - + + - + - +
); } From aee80b781df2597bf23e48fbc7ac107ead22261f Mon Sep 17 00:00:00 2001 From: Devon Thomson Date: Thu, 12 Jan 2023 10:34:47 -0700 Subject: [PATCH 29/39] [Dashboard] Track Complete Load Time & Saved Object Load Time (#148600) Introduces two new performance metrics to the Dashboard, `total_load_time` and `saved_object_load_time`. --- .../component/grid/dashboard_grid.test.tsx | 22 +++++----- .../component/grid/dashboard_grid.tsx | 44 +++++++------------ .../component/viewport/dashboard_viewport.tsx | 9 +--- .../embeddable/dashboard_container.tsx | 43 ++++++++++++------ .../dashboard_container_factory.tsx | 10 ++++- .../public/dashboard_container/types.ts | 6 +++ 6 files changed, 71 insertions(+), 63 deletions(-) diff --git a/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.test.tsx b/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.test.tsx index dffbda8bee1e6..b6dfebe9beb14 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.test.tsx +++ b/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.test.tsx @@ -17,12 +17,12 @@ import { import { mountWithIntl } from '@kbn/test-jest-helpers'; import { pluginServices } from '../../../services/plugin_services'; -import { DashboardGrid, DashboardGridProps } from './dashboard_grid'; +import { DashboardGrid } from './dashboard_grid'; import { getSampleDashboardInput, mockDashboardReduxEmbeddableTools } from '../../../mocks'; const DashboardServicesProvider = pluginServices.getContextProvider(); -async function prepare(props?: Partial) { +async function prepare() { const embeddableFactory = new ContactCardEmbeddableFactory((() => null) as any, {} as any); pluginServices.getServices().embeddable.getEmbeddableFactory = jest .fn() @@ -43,12 +43,10 @@ async function prepare(props?: Partial) { }, }); const dashboardMock = await mockDashboardReduxEmbeddableTools({ explicitInput: initialInput }); - const defaultTestProps: DashboardGridProps = {}; return { tools: dashboardMock.tools, dashboardContainer: dashboardMock.dashboardContainer, - props: Object.assign(defaultTestProps, props), }; } @@ -64,12 +62,12 @@ afterAll(() => { // unhandled promise rejection: https://github.com/elastic/kibana/issues/112699 test.skip('renders DashboardGrid', async () => { - const { props, tools } = await prepare(); + const { tools } = await prepare(); const component = mountWithIntl( - + ); @@ -79,11 +77,11 @@ test.skip('renders DashboardGrid', async () => { // unhandled promise rejection: https://github.com/elastic/kibana/issues/112699 test.skip('renders DashboardGrid with no visualizations', async () => { - const { props, tools, dashboardContainer } = await prepare(); + const { tools, dashboardContainer } = await prepare(); const component = mountWithIntl( - + ); @@ -95,11 +93,11 @@ test.skip('renders DashboardGrid with no visualizations', async () => { // unhandled promise rejection: https://github.com/elastic/kibana/issues/112699 test.skip('DashboardGrid removes panel when removed from container', async () => { - const { props, tools, dashboardContainer } = await prepare(); + const { tools, dashboardContainer } = await prepare(); const component = mountWithIntl( - + ); @@ -115,11 +113,11 @@ test.skip('DashboardGrid removes panel when removed from container', async () => // unhandled promise rejection: https://github.com/elastic/kibana/issues/112699 test.skip('DashboardGrid renders expanded panel', async () => { - const { props, tools, dashboardContainer } = await prepare(); + const { tools, dashboardContainer } = await prepare(); const component = mountWithIntl( - + ); diff --git a/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.tsx b/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.tsx index 54a15e3c4559d..6fdb2caa2ae9b 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.tsx +++ b/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.tsx @@ -17,10 +17,9 @@ import ReactGridLayout, { Layout, ReactGridLayoutProps } from 'react-grid-layout import { ViewMode, EmbeddablePhaseEvent } from '@kbn/embeddable-plugin/public'; import { DashboardPanelState } from '../../../../common'; -import { DashboardLoadedEventStatus } from '../../types'; import { DashboardGridItem } from './dashboard_grid_item'; -import { DashboardLoadedInfo } from '../../embeddable/dashboard_container'; import { useDashboardContainerContext } from '../../dashboard_container_renderer'; +import { DashboardLoadedEventStatus, DashboardRenderPerformanceStats } from '../../types'; import { DASHBOARD_GRID_COLUMN_COUNT, DASHBOARD_GRID_HEIGHT } from '../../../dashboard_constants'; import { getPanelLayoutsAreEqual } from '../../embeddable/integrations/diff_state/dashboard_diffing_utils'; @@ -103,31 +102,28 @@ interface PanelLayout extends Layout { i: string; } -interface DashboardPerformanceTracker { +type DashboardRenderPerformanceTracker = DashboardRenderPerformanceStats & { panelIds: Record>; - loadStartTime: number; - lastTimeToData: number; status: DashboardLoadedEventStatus; doneCount: number; -} +}; -const getDefaultPerformanceTracker: () => DashboardPerformanceTracker = () => ({ - panelIds: {}, - loadStartTime: performance.now(), +const getDefaultPerformanceTracker: () => DashboardRenderPerformanceTracker = () => ({ + panelsRenderStartTime: performance.now(), + panelsRenderDoneTime: 0, lastTimeToData: 0, - status: 'done', + + panelIds: {}, doneCount: 0, + status: 'done', }); -export interface DashboardGridProps { - onDataLoaded?: (data: DashboardLoadedInfo) => void; -} - -export const DashboardGrid = ({ onDataLoaded }: DashboardGridProps) => { +export const DashboardGrid = () => { const { actions: { setPanels }, useEmbeddableDispatch, useEmbeddableSelector: select, + embeddableInstance: dashboardContainer, } = useDashboardContainerContext(); const dispatch = useEmbeddableDispatch(); @@ -143,13 +139,11 @@ export const DashboardGrid = ({ onDataLoaded }: DashboardGridProps) => { ); // reset performance tracker on each render. - const performanceRefs = useRef(getDefaultPerformanceTracker()); + const performanceRefs = useRef(getDefaultPerformanceTracker()); performanceRefs.current = getDefaultPerformanceTracker(); const onPanelStatusChange = useCallback( (info: EmbeddablePhaseEvent) => { - if (!onDataLoaded) return; - if (performanceRefs.current.panelIds[info.id] === undefined || info.status === 'loading') { performanceRefs.current.panelIds[info.id] = {}; } else if (info.status === 'error') { @@ -163,20 +157,12 @@ export const DashboardGrid = ({ onDataLoaded }: DashboardGridProps) => { if (info.status === 'error' || info.status === 'rendered') { performanceRefs.current.doneCount++; if (performanceRefs.current.doneCount === panelsInOrder.length) { - const doneTime = performance.now(); - const data: DashboardLoadedInfo = { - timeToData: - (performanceRefs.current.lastTimeToData || doneTime) - - performanceRefs.current.loadStartTime, - timeToDone: doneTime - performanceRefs.current.loadStartTime, - numOfPanels: panelsInOrder.length, - status, - }; - onDataLoaded(data); + performanceRefs.current.panelsRenderDoneTime = performance.now(); + dashboardContainer.reportPerformanceMetrics(performanceRefs.current); } } }, - [onDataLoaded, panelsInOrder] + [dashboardContainer, panelsInOrder.length] ); const onLayoutChange = useCallback( diff --git a/src/plugins/dashboard/public/dashboard_container/component/viewport/dashboard_viewport.tsx b/src/plugins/dashboard/public/dashboard_container/component/viewport/dashboard_viewport.tsx index 72a886c8223de..3e2b02f8ab761 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/viewport/dashboard_viewport.tsx +++ b/src/plugins/dashboard/public/dashboard_container/component/viewport/dashboard_viewport.tsx @@ -15,13 +15,8 @@ import { DashboardGrid } from '../grid'; import { pluginServices } from '../../../services/plugin_services'; import { DashboardEmptyScreen } from '../empty_screen/dashboard_empty_screen'; import { useDashboardContainerContext } from '../../dashboard_container_renderer'; -import { DashboardLoadedInfo } from '../../embeddable/dashboard_container'; -export const DashboardViewport = ({ - onDataLoaded, -}: { - onDataLoaded?: (data: DashboardLoadedInfo) => void; -}) => { +export const DashboardViewport = () => { const { settings: { isProjectEnabledInLabs }, } = pluginServices.getServices(); @@ -83,7 +78,7 @@ export const DashboardViewport = ({
)} - +
); diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx b/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx index 4270747fd9d11..cdad643417538 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx @@ -44,6 +44,11 @@ import { showPlaceholderUntil, addOrUpdateEmbeddable, } from './api'; +import { + DashboardReduxState, + DashboardContainerOutput, + DashboardRenderPerformanceStats, +} from '../types'; import { DashboardPanelState, DashboardContainerInput, @@ -64,20 +69,12 @@ import { createPanelState } from '../component/panel'; import { pluginServices } from '../../services/plugin_services'; import { DASHBOARD_LOADED_EVENT } from '../../dashboard_constants'; import { DashboardCreationOptions } from './dashboard_container_factory'; -import { DashboardContainerOutput, DashboardReduxState } from '../types'; import { DashboardAnalyticsService } from '../../services/analytics/types'; import { DashboardViewport } from '../component/viewport/dashboard_viewport'; import { dashboardContainerReducers } from '../state/dashboard_container_reducers'; import { DashboardSavedObjectService } from '../../services/dashboard_saved_object/types'; import { dashboardContainerInputIsByValue } from '../../../common/dashboard_container/type_guards'; -export interface DashboardLoadedInfo { - timeToData: number; - timeToDone: number; - numOfPanels: number; - status: string; -} - export interface InheritedChildInput { filters: Filter[]; query: Query; @@ -103,6 +100,9 @@ export class DashboardContainer extends Container = new BehaviorSubject(false); + private dashboardCreationStartTime?: number; + private savedObjectLoadTime?: number; + private initialSavedDashboardId?: string; private reduxEmbeddableTools?: ReduxEmbeddableTools< @@ -123,6 +123,7 @@ export class DashboardContainer extends Container - + diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container_factory.tsx b/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container_factory.tsx index 703d9e2c4a34a..7c61591d5ff27 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container_factory.tsx +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container_factory.tsx @@ -99,9 +99,17 @@ export class DashboardContainerFactoryDefinition parent?: Container, creationOptions?: DashboardCreationOptions ): Promise => { + const dashboardCreationStartTime = performance.now(); const { DashboardContainer: DashboardContainerEmbeddable } = await import( './dashboard_container' ); - return Promise.resolve(new DashboardContainerEmbeddable(initialInput, parent, creationOptions)); + return Promise.resolve( + new DashboardContainerEmbeddable( + initialInput, + dashboardCreationStartTime, + parent, + creationOptions + ) + ); }; } diff --git a/src/plugins/dashboard/public/dashboard_container/types.ts b/src/plugins/dashboard/public/dashboard_container/types.ts index 744f67daf0d50..6d09e75671db3 100644 --- a/src/plugins/dashboard/public/dashboard_container/types.ts +++ b/src/plugins/dashboard/public/dashboard_container/types.ts @@ -32,6 +32,12 @@ export interface DashboardPublicState { lastSavedId?: string; } +export interface DashboardRenderPerformanceStats { + lastTimeToData: number; + panelsRenderDoneTime: number; + panelsRenderStartTime: number; +} + export interface DashboardContainerOutput extends ContainerOutput { usedDataViewIds?: string[]; } From bba406b9b049499575d528db87bcb2f8b1e3c99d Mon Sep 17 00:00:00 2001 From: spalger Date: Thu, 12 Jan 2023 10:42:17 -0700 Subject: [PATCH 30/39] [packages] prevent and remove basename collisions for js/ts code --- packages/kbn-lint-packages-cli/rules/index.ts | 3 +- .../rules/no_basename_collisions.ts | 40 +++++++++++++++++++ packages/kbn-repo-path/repo_path.ts | 6 ++- .../plugins/ml/server/models/filter/index.js | 8 ---- .../watcher/common/lib/get_moment/index.js | 8 ---- 5 files changed, 47 insertions(+), 18 deletions(-) create mode 100644 packages/kbn-lint-packages-cli/rules/no_basename_collisions.ts delete mode 100644 x-pack/plugins/ml/server/models/filter/index.js delete mode 100644 x-pack/plugins/watcher/common/lib/get_moment/index.js diff --git a/packages/kbn-lint-packages-cli/rules/index.ts b/packages/kbn-lint-packages-cli/rules/index.ts index a75d2fb50bee1..65f16c71d74f3 100644 --- a/packages/kbn-lint-packages-cli/rules/index.ts +++ b/packages/kbn-lint-packages-cli/rules/index.ts @@ -9,5 +9,6 @@ import type { PackageRule } from '@kbn/repo-linter'; import { matchingPackageNameRule } from './matching_package_name'; +import { noBasenameCollisionsRule } from './no_basename_collisions'; -export const RULES: PackageRule[] = [matchingPackageNameRule]; +export const RULES: PackageRule[] = [matchingPackageNameRule, noBasenameCollisionsRule]; diff --git a/packages/kbn-lint-packages-cli/rules/no_basename_collisions.ts b/packages/kbn-lint-packages-cli/rules/no_basename_collisions.ts new file mode 100644 index 0000000000000..436514e9aeab8 --- /dev/null +++ b/packages/kbn-lint-packages-cli/rules/no_basename_collisions.ts @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Path from 'path'; + +import { PackageRule } from '@kbn/repo-linter'; +import { SetMap } from '@kbn/set-map'; + +export const noBasenameCollisionsRule = PackageRule.create('noBasenameCollisions', { + async check() { + const groupedByBasename = new SetMap(); + + for (const file of this.getAllFiles()) { + if (!file.isJsTsCode()) { + continue; + } + + const repoRelWithoutExt = Path.resolve( + file.repoRelDir, + Path.basename(file.repoRel, file.ext) + ); + + groupedByBasename.add(repoRelWithoutExt, file.repoRel); + } + + for (const [, paths] of groupedByBasename) { + if (paths.size > 1) { + const list = Array.from(paths, (p) => `\n - ${p}`).join(''); + this.err( + `Having two JS/TS files with the same name but different extensions is not allowed:${list}` + ); + } + } + }, +}); diff --git a/packages/kbn-repo-path/repo_path.ts b/packages/kbn-repo-path/repo_path.ts index 86991b23a533d..aad1799174153 100644 --- a/packages/kbn-repo-path/repo_path.ts +++ b/packages/kbn-repo-path/repo_path.ts @@ -36,7 +36,7 @@ export class RepoPath { private _basename: string | undefined; /** - * basename of the path + * basename of the path (including extension) * (lazy and cached getter) */ public get basename() { @@ -64,6 +64,10 @@ export class RepoPath { return this.ext === '.js' || this.ext === '.jsx' || this.ext === '.mjs'; } + isJsTsCode() { + return this.isTypeScript() || this.isJavaScript(); + } + isFixture() { const parts = this.repoRel.split('/'); if (parts.includes('__fixtures__') || this.repoRel.endsWith('.test-d.ts')) { diff --git a/x-pack/plugins/ml/server/models/filter/index.js b/x-pack/plugins/ml/server/models/filter/index.js deleted file mode 100644 index 6f3657d9c0275..0000000000000 --- a/x-pack/plugins/ml/server/models/filter/index.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { FilterManager } from './filter_manager'; diff --git a/x-pack/plugins/watcher/common/lib/get_moment/index.js b/x-pack/plugins/watcher/common/lib/get_moment/index.js deleted file mode 100644 index 5c352d754d6ed..0000000000000 --- a/x-pack/plugins/watcher/common/lib/get_moment/index.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { getMoment } from './get_moment'; From 6bdc5bfd549a1d2bae1a44175cbbd8f65c9b7152 Mon Sep 17 00:00:00 2001 From: spalger Date: Thu, 12 Jan 2023 10:46:03 -0700 Subject: [PATCH 31/39] [tsconfigs] fix typo --- .../public/applications/app_search/cypress/tsconfig.json | 2 +- .../enterprise_search_overview/cypress/tsconfig.json | 2 +- .../public/applications/workplace_search/cypress/tsconfig.json | 2 +- x-pack/plugins/fleet/cypress/tsconfig.json | 2 +- x-pack/plugins/osquery/cypress/tsconfig.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/cypress/tsconfig.json b/x-pack/plugins/enterprise_search/public/applications/app_search/cypress/tsconfig.json index 249475520f49a..4efdc9033ae2c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/cypress/tsconfig.json +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/cypress/tsconfig.json @@ -8,7 +8,7 @@ "kbn_references": [ { "path": "../../shared/cypress/tsconfig.json" }, // cypress projects that are nested inside of other ts project use code - // from the parent ts project in ways that can't be auto-matically deteceted + // from the parent ts project in ways that can't be automatically deteceted // at this time so we have to force the inclusion of this reference { "path": "../../../../tsconfig.json", diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/cypress/tsconfig.json b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/cypress/tsconfig.json index 249475520f49a..4efdc9033ae2c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/cypress/tsconfig.json +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/cypress/tsconfig.json @@ -8,7 +8,7 @@ "kbn_references": [ { "path": "../../shared/cypress/tsconfig.json" }, // cypress projects that are nested inside of other ts project use code - // from the parent ts project in ways that can't be auto-matically deteceted + // from the parent ts project in ways that can't be automatically deteceted // at this time so we have to force the inclusion of this reference { "path": "../../../../tsconfig.json", diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress/tsconfig.json b/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress/tsconfig.json index 249475520f49a..4efdc9033ae2c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress/tsconfig.json +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress/tsconfig.json @@ -8,7 +8,7 @@ "kbn_references": [ { "path": "../../shared/cypress/tsconfig.json" }, // cypress projects that are nested inside of other ts project use code - // from the parent ts project in ways that can't be auto-matically deteceted + // from the parent ts project in ways that can't be automatically deteceted // at this time so we have to force the inclusion of this reference { "path": "../../../../tsconfig.json", diff --git a/x-pack/plugins/fleet/cypress/tsconfig.json b/x-pack/plugins/fleet/cypress/tsconfig.json index 1f9f75590279f..d79de0f455b6b 100644 --- a/x-pack/plugins/fleet/cypress/tsconfig.json +++ b/x-pack/plugins/fleet/cypress/tsconfig.json @@ -21,7 +21,7 @@ "@kbn/axe-config", "@kbn/cypress-config", // cypress projects that are nested inside of other ts project use code - // from the parent ts project in ways that can't be auto-matically deteceted + // from the parent ts project in ways that can't be automatically deteceted // at this time so we have to force the inclusion of this reference { "path": "../tsconfig.json", diff --git a/x-pack/plugins/osquery/cypress/tsconfig.json b/x-pack/plugins/osquery/cypress/tsconfig.json index 2ed014bc4c7d4..d4efb7ffb42be 100644 --- a/x-pack/plugins/osquery/cypress/tsconfig.json +++ b/x-pack/plugins/osquery/cypress/tsconfig.json @@ -19,7 +19,7 @@ "kbn_references": [ "@kbn/cypress-config", // cypress projects that are nested inside of other ts project use code - // from the parent ts project in ways that can't be auto-matically deteceted + // from the parent ts project in ways that can't be automatically deteceted // at this time so we have to force the inclusion of this reference { "path": "../tsconfig.json", From 8e12174d323cfbf8ee1e182f98ee1b86382eda4a Mon Sep 17 00:00:00 2001 From: spalger Date: Thu, 12 Jan 2023 10:49:59 -0700 Subject: [PATCH 32/39] Revert "[packages] prevent and remove basename collisions for js/ts code" This reverts commit bba406b9b049499575d528db87bcb2f8b1e3c99d. --- packages/kbn-lint-packages-cli/rules/index.ts | 3 +- .../rules/no_basename_collisions.ts | 40 ------------------- packages/kbn-repo-path/repo_path.ts | 6 +-- .../plugins/ml/server/models/filter/index.js | 8 ++++ .../watcher/common/lib/get_moment/index.js | 8 ++++ 5 files changed, 18 insertions(+), 47 deletions(-) delete mode 100644 packages/kbn-lint-packages-cli/rules/no_basename_collisions.ts create mode 100644 x-pack/plugins/ml/server/models/filter/index.js create mode 100644 x-pack/plugins/watcher/common/lib/get_moment/index.js diff --git a/packages/kbn-lint-packages-cli/rules/index.ts b/packages/kbn-lint-packages-cli/rules/index.ts index 65f16c71d74f3..a75d2fb50bee1 100644 --- a/packages/kbn-lint-packages-cli/rules/index.ts +++ b/packages/kbn-lint-packages-cli/rules/index.ts @@ -9,6 +9,5 @@ import type { PackageRule } from '@kbn/repo-linter'; import { matchingPackageNameRule } from './matching_package_name'; -import { noBasenameCollisionsRule } from './no_basename_collisions'; -export const RULES: PackageRule[] = [matchingPackageNameRule, noBasenameCollisionsRule]; +export const RULES: PackageRule[] = [matchingPackageNameRule]; diff --git a/packages/kbn-lint-packages-cli/rules/no_basename_collisions.ts b/packages/kbn-lint-packages-cli/rules/no_basename_collisions.ts deleted file mode 100644 index 436514e9aeab8..0000000000000 --- a/packages/kbn-lint-packages-cli/rules/no_basename_collisions.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; - -import { PackageRule } from '@kbn/repo-linter'; -import { SetMap } from '@kbn/set-map'; - -export const noBasenameCollisionsRule = PackageRule.create('noBasenameCollisions', { - async check() { - const groupedByBasename = new SetMap(); - - for (const file of this.getAllFiles()) { - if (!file.isJsTsCode()) { - continue; - } - - const repoRelWithoutExt = Path.resolve( - file.repoRelDir, - Path.basename(file.repoRel, file.ext) - ); - - groupedByBasename.add(repoRelWithoutExt, file.repoRel); - } - - for (const [, paths] of groupedByBasename) { - if (paths.size > 1) { - const list = Array.from(paths, (p) => `\n - ${p}`).join(''); - this.err( - `Having two JS/TS files with the same name but different extensions is not allowed:${list}` - ); - } - } - }, -}); diff --git a/packages/kbn-repo-path/repo_path.ts b/packages/kbn-repo-path/repo_path.ts index aad1799174153..86991b23a533d 100644 --- a/packages/kbn-repo-path/repo_path.ts +++ b/packages/kbn-repo-path/repo_path.ts @@ -36,7 +36,7 @@ export class RepoPath { private _basename: string | undefined; /** - * basename of the path (including extension) + * basename of the path * (lazy and cached getter) */ public get basename() { @@ -64,10 +64,6 @@ export class RepoPath { return this.ext === '.js' || this.ext === '.jsx' || this.ext === '.mjs'; } - isJsTsCode() { - return this.isTypeScript() || this.isJavaScript(); - } - isFixture() { const parts = this.repoRel.split('/'); if (parts.includes('__fixtures__') || this.repoRel.endsWith('.test-d.ts')) { diff --git a/x-pack/plugins/ml/server/models/filter/index.js b/x-pack/plugins/ml/server/models/filter/index.js new file mode 100644 index 0000000000000..6f3657d9c0275 --- /dev/null +++ b/x-pack/plugins/ml/server/models/filter/index.js @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { FilterManager } from './filter_manager'; diff --git a/x-pack/plugins/watcher/common/lib/get_moment/index.js b/x-pack/plugins/watcher/common/lib/get_moment/index.js new file mode 100644 index 0000000000000..5c352d754d6ed --- /dev/null +++ b/x-pack/plugins/watcher/common/lib/get_moment/index.js @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { getMoment } from './get_moment'; From fe64602cadd2d8cf7bdba0f1955b4b6da502b00e Mon Sep 17 00:00:00 2001 From: Sloane Perrault Date: Thu, 12 Jan 2023 13:00:02 -0500 Subject: [PATCH 33/39] [Enterprise Search] Flag incomplete fields (#148731) ## Summary Consumes new API data to surface fields that are missing subfields used in precision tuning, relevance, highlighting and more for BYOI engines. ### TODO - [x] Updated copy for warning message - [x] Approval on visuals of per-field flagging approach ### Checklist Delete any items that are not applicable to this PR. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [x] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --- .../components/engine/engine_logic.test.ts | 2 + .../components/engine/engine_logic.ts | 5 ++ .../components/engine/engine_nav.tsx | 15 ++++++ .../components/schema_callouts.test.tsx | 24 ++++++++++ .../schema/components/schema_callouts.tsx | 47 ++++++++++++++++++- .../schema/components/schema_table.test.tsx | 13 +++++ .../schema/components/schema_table.tsx | 22 +++++++-- .../components/schema/schema_logic.test.ts | 5 ++ .../components/schema/schema_logic.ts | 12 +++++ .../app_search/components/schema/types.ts | 1 + 10 files changed, 140 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts index a64fe04f59c67..2dfb7945a0d46 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts @@ -57,6 +57,7 @@ describe('EngineLogic', () => { apiTokens: [], apiKey: 'some-key', adaptive_relevance_suggestions_active: true, + incompleteFields: [], }; const DEFAULT_VALUES = { @@ -74,6 +75,7 @@ describe('EngineLogic', () => { engineNotFound: false, searchKey: '', intervalId: null, + hasIncompleteFields: false, }; const DEFAULT_VALUES_WITH_ENGINE = { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.ts index c3912fa8c741e..b569546a50759 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.ts @@ -30,6 +30,7 @@ interface EngineValues { engineNotFound: boolean; searchKey: string; intervalId: number | null; + hasIncompleteFields: boolean; } interface EngineActions { @@ -128,6 +129,10 @@ export const EngineLogic = kea>({ return searchKey?.key || ''; }, ], + hasIncompleteFields: [ + () => [selectors.engine], + ({ incompleteFields }) => incompleteFields?.length > 0, + ], }), listeners: ({ actions, values }) => ({ initializeEngine: async (_, breakpoint) => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_nav.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_nav.tsx index a50fdb1c1f988..436f4bbad6c69 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_nav.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_nav.tsx @@ -73,6 +73,7 @@ export const useEngineNav = () => { hasSchemaConflicts, hasUnconfirmedSchemaFields, engine, + hasIncompleteFields, } = useValues(EngineLogic); if (!isEngineRoute) return undefined; @@ -188,6 +189,20 @@ export const useEngineNav = () => { data-test-subj="EngineNavSchemaConflicts" /> )} + {hasIncompleteFields && ( + + )} ), }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/schema_callouts.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/schema_callouts.test.tsx index 09fd2a8b5cd11..21f8662fa3a65 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/schema_callouts.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/schema_callouts.test.tsx @@ -18,6 +18,7 @@ import { UnsearchedFieldsCallout, UnconfirmedFieldsCallout, ConfirmSchemaButton, + MissingSubfieldsCallout, } from './schema_callouts'; import { SchemaCallouts } from '.'; @@ -26,6 +27,8 @@ describe('SchemaCallouts', () => { const values = { hasUnconfirmedFields: false, hasNewUnsearchedFields: false, + hasIncompleteFields: false, + incompleteFields: [], mostRecentIndexJob: { hasErrors: false, activeReindexJobId: 'some-id', @@ -81,6 +84,16 @@ describe('SchemaCallouts', () => { expect(wrapper.find(UnconfirmedFieldsCallout)).toHaveLength(1); }); + it('renders a missing subfields callout if the schema has incomplete fields', () => { + setMockValues({ + ...values, + hasIncompleteFields: true, + }); + const wrapper = shallow(); + + expect(wrapper.find(MissingSubfieldsCallout)).toHaveLength(1); + }); + describe('non-owner/admins', () => { it('does not render an unsearched fields callout if user does not have access', () => { setMockValues({ @@ -142,4 +155,15 @@ describe('SchemaCallouts', () => { expect(actions.updateSchema).toHaveBeenCalled(); }); }); + + describe('MissingSubfieldsCallout', () => { + it('renders a warning callout about incomplete fields with a link to the subfields support documentation', () => { + const wrapper = shallow(); + + expect(wrapper.prop('title')).toMatch(/^(?:A field is|\d+ fields are) missing subfields$/); + expect(wrapper.find('[data-test-subj="missingSubfieldsLearnMoreLink"]').prop('href')).toEqual( + 'https://www.elastic.co/guide/en/app-search/current/elasticsearch-engines-text-subfields-support-conventions.html' + ); + }); + }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/schema_callouts.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/schema_callouts.tsx index 853a1ed785fa4..37a46d5f764cf 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/schema_callouts.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/schema_callouts.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { useValues, useActions } from 'kea'; -import { EuiCallOut, EuiButton, EuiSpacer, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { EuiCallOut, EuiButton, EuiSpacer, EuiFlexGroup, EuiFlexItem, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { EuiButtonTo } from '../../../../shared/react_router_helpers'; @@ -28,6 +28,7 @@ export const SchemaCallouts: React.FC = () => { hasUnconfirmedFields, hasNewUnsearchedFields, mostRecentIndexJob: { hasErrors, activeReindexJobId }, + hasIncompleteFields, } = useValues(SchemaLogic); return ( @@ -48,6 +49,12 @@ export const SchemaCallouts: React.FC = () => { )} + {hasIncompleteFields && ( + <> + + + + )} ); }; @@ -129,3 +136,41 @@ export const ConfirmSchemaButton: React.FC = () => { ); }; + +export const MissingSubfieldsCallout: React.FC = () => { + const { incompleteFields } = useValues(SchemaLogic); + + return ( + +

+ {i18n.translate( + 'xpack.enterpriseSearch.appSearch.engine.schema.incompleteFields.description', + { + defaultMessage: + 'Some fields are missing one or more subfields used by App Search. Some search features may not work until those subfields are added.', + } + )}{' '} +

+ + {i18n.translate('xpack.enterpriseSearch.appSearch.engine.schema.incompleteFields.link', { + defaultMessage: 'Learn more.', + })} + +
+ ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/schema_table.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/schema_table.test.tsx index 65debc9b790e8..c5170764f792c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/schema_table.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/schema_table.test.tsx @@ -21,6 +21,7 @@ describe('SchemaTable', () => { const values = { schema: {}, unconfirmedFields: [], + incompleteFields: [], myRole: { canManageEngines: true }, }; const actions = { @@ -96,4 +97,16 @@ describe('SchemaTable', () => { expect(wrapper.find(SchemaFieldTypeSelect).at(0).prop('disabled')).toEqual(true); }); + + it('renders a missing subfields status if a field is incomplete', () => { + setMockValues({ + ...values, + schema: { some_incomplete_field: 'text' }, + incompleteFields: ['some_incomplete_field'], + }); + const wrapper = shallow(); + + expect(wrapper.find(EuiHealth)).toHaveLength(1); + expect(wrapper.find(EuiHealth).childAt(0).prop('children')).toEqual('Missing subfields'); + }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/schema_table.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/schema_table.tsx index 3ce32df8e9d97..7541cc9848cb3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/schema_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/schema_table.tsx @@ -34,7 +34,7 @@ export const SchemaTable: React.FC = () => { const { myRole: { canManageEngines }, } = useValues(AppLogic); - const { schema, unconfirmedFields } = useValues(SchemaLogic); + const { schema, unconfirmedFields, incompleteFields } = useValues(SchemaLogic); const { updateSchemaFieldType } = useActions(SchemaLogic); const { isElasticsearchEngine } = useValues(EngineLogic); @@ -58,14 +58,15 @@ export const SchemaTable: React.FC = () => { {Object.entries(schema).map(([fieldName, fieldType]) => { - const isRecentlyAdded = unconfirmedFields.length && unconfirmedFields.includes(fieldName); + const isRecentlyAdded = unconfirmedFields.includes(fieldName); + const isMissingSubfields = fieldType === 'text' && incompleteFields.includes(fieldName); return ( {fieldName} - {isRecentlyAdded ? ( + {isRecentlyAdded && ( @@ -76,9 +77,20 @@ export const SchemaTable: React.FC = () => { - ) : ( - )} + {isMissingSubfields && ( + + + + {i18n.translate( + 'xpack.enterpriseSearch.appSearch.engine.schema.missingSubfieldsLabel', + { defaultMessage: 'Missing subfields' } + )} + + + + )} + {!(isRecentlyAdded || isMissingSubfields) && } { }, unconfirmedFields: ['some_field'], unsearchedUnconfirmedFields: true, + incompleteFields: ['some_other_field'], }; const DEFAULT_VALUES = { @@ -51,6 +52,8 @@ describe('SchemaLogic', () => { hasUnconfirmedFields: false, hasNewUnsearchedFields: false, isModalOpen: false, + incompleteFields: [], + hasIncompleteFields: false, }; /* @@ -93,6 +96,8 @@ describe('SchemaLogic', () => { unconfirmedFields: MOCK_RESPONSE.unconfirmedFields, hasUnconfirmedFields: true, hasNewUnsearchedFields: MOCK_RESPONSE.unsearchedUnconfirmedFields, + incompleteFields: MOCK_RESPONSE.incompleteFields, + hasIncompleteFields: true, }); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_logic.ts index 536a63700c5cd..0a96bd3c7d969 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_logic.ts @@ -32,6 +32,8 @@ interface SchemaValues extends SchemaBaseValues { hasUnconfirmedFields: boolean; hasNewUnsearchedFields: boolean; isModalOpen: boolean; + incompleteFields: string[]; + hasIncompleteFields: boolean; } interface SchemaActions extends SchemaBaseActions { @@ -91,6 +93,12 @@ export const SchemaLogic = kea>({ onSchemaLoad: (_, { unconfirmedFields }) => unconfirmedFields, }, ], + incompleteFields: [ + [], + { + onSchemaLoad: (_, { incompleteFields }) => incompleteFields, + }, + ], hasNewUnsearchedFields: [ false, { @@ -120,6 +128,10 @@ export const SchemaLogic = kea>({ (selectors) => [selectors.unconfirmedFields], (unconfirmedFields) => unconfirmedFields.length > 0, ], + hasIncompleteFields: [ + (selectors) => [selectors.incompleteFields], + (incompleteFields: string[]) => incompleteFields.length > 0, + ], }, listeners: ({ actions, values }) => ({ addSchemaField: ({ fieldName, fieldType }) => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/types.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/types.ts index 9d79909e5549b..5f7725b211263 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/types.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/types.ts @@ -17,6 +17,7 @@ export interface SchemaApiResponse { mostRecentIndexJob: IndexJob; unconfirmedFields: string[]; unsearchedUnconfirmedFields: boolean; + incompleteFields: string[]; } export interface MetaEngineSchemaApiResponse { From 16d69653a0361d12a10a5d8be15d64eee8a12548 Mon Sep 17 00:00:00 2001 From: Melissa Alvarez Date: Thu, 12 Jan 2023 11:07:28 -0700 Subject: [PATCH 34/39] [ML] AIOps: highlight pairs unique to groups in expanded row (#148601) ## Summary Related meta issue: https://github.com/elastic/kibana/issues/146162 For grouped results, indicate in the expanded table row field / value pairs that appear in other groups. In expanded row - adds an asterisk column to highlight unique pairs among groups. image Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- x-pack/packages/ml/agg_utils/src/types.ts | 1 + .../explain_log_rate_spikes_analysis.tsx | 44 +++++++++++++---- .../spike_analysis_table.tsx | 35 +++++++++++++- .../spike_analysis_table_groups.tsx | 47 ++++++++++++------- 4 files changed, 98 insertions(+), 29 deletions(-) diff --git a/x-pack/packages/ml/agg_utils/src/types.ts b/x-pack/packages/ml/agg_utils/src/types.ts index a2c0d9f9a1569..5cebd7613765b 100644 --- a/x-pack/packages/ml/agg_utils/src/types.ts +++ b/x-pack/packages/ml/agg_utils/src/types.ts @@ -68,6 +68,7 @@ export interface ChangePoint extends FieldValuePair { pValue: number | null; normalizedScore: number; histogram?: ChangePointHistogramItem[]; + unique?: boolean; } /** diff --git a/x-pack/plugins/aiops/public/components/explain_log_rate_spikes/explain_log_rate_spikes_analysis.tsx b/x-pack/plugins/aiops/public/components/explain_log_rate_spikes/explain_log_rate_spikes_analysis.tsx index b458e1da73516..649ab73098a87 100644 --- a/x-pack/plugins/aiops/public/components/explain_log_rate_spikes/explain_log_rate_spikes_analysis.tsx +++ b/x-pack/plugins/aiops/public/components/explain_log_rate_spikes/explain_log_rate_spikes_analysis.tsx @@ -12,6 +12,8 @@ import { EuiButton, EuiCallOut, EuiEmptyPrompt, + EuiFlexItem, + EuiFlexGroup, EuiFormRow, EuiSpacer, EuiSwitch, @@ -44,6 +46,13 @@ const groupResultsMessage = i18n.translate( defaultMessage: 'Group results', } ); +const groupResultsHelpMessage = i18n.translate( + 'xpack.aiops.spikeAnalysisTable.groupedSwitchLabel.groupResultsHelpMessage', + { + defaultMessage: + 'In expanded row, field/value pairs which do not appear in other groups are marked by an asterisk (*).', + } +); /** * ExplainLogRateSpikes props require a data view. @@ -228,16 +237,31 @@ export const ExplainLogRateSpikesAnalysis: FC ) : null} {showSpikeAnalysisTable && foundGroups && ( - - - + <> + + + + + + + + {groupResults && ( + + <> + + )} + + + )} {!isRunning && !showSpikeAnalysisTable && ( diff --git a/x-pack/plugins/aiops/public/components/spike_analysis_table/spike_analysis_table.tsx b/x-pack/plugins/aiops/public/components/spike_analysis_table/spike_analysis_table.tsx index 3994bd82d9523..aaf5b8e523dca 100644 --- a/x-pack/plugins/aiops/public/components/spike_analysis_table/spike_analysis_table.tsx +++ b/x-pack/plugins/aiops/public/components/spike_analysis_table/spike_analysis_table.tsx @@ -14,6 +14,7 @@ import { EuiBasicTable, EuiBasicTableColumn, EuiIcon, + EuiIconTip, EuiTableSortingType, EuiToolTip, } from '@elastic/eui'; @@ -34,6 +35,7 @@ import { useSpikeAnalysisTableRowContext } from './spike_analysis_table_row_prov const NARROW_COLUMN_WIDTH = '120px'; const ACTIONS_COLUMN_WIDTH = '60px'; +const UNIQUE_COLUMN_WIDTH = '40px'; const NOT_AVAILABLE = '--'; const PAGINATION_SIZE_OPTIONS = [5, 10, 20, 50]; @@ -50,12 +52,14 @@ interface SpikeAnalysisTableProps { changePoints: ChangePoint[]; dataViewId?: string; loading: boolean; + isExpandedRow?: boolean; } export const SpikeAnalysisTable: FC = ({ changePoints, dataViewId, loading, + isExpandedRow, }) => { const euiTheme = useEuiTheme(); const primaryBackgroundColor = useEuiBackgroundColor('primary'); @@ -142,8 +146,9 @@ export const SpikeAnalysisTable: FC = ({ name: i18n.translate('xpack.aiops.explainLogRateSpikes.spikeAnalysisTable.fieldValueLabel', { defaultMessage: 'Field value', }), - render: (_, { fieldValue }) => String(fieldValue).slice(0, 50), + render: (_, { fieldValue }) => String(fieldValue), sortable: true, + textOnly: true, valign: 'top', }, { @@ -277,6 +282,34 @@ export const SpikeAnalysisTable: FC = ({ }, ]; + if (isExpandedRow === true) { + columns.unshift({ + 'data-test-subj': 'aiopsSpikeAnalysisTableColumnUnique', + width: UNIQUE_COLUMN_WIDTH, + field: 'unique', + name: '', + render: (_, { unique }) => { + if (unique) { + return ( + + ); + } + return ''; + }, + sortable: false, + valign: 'top', + }); + } + const onChange = useCallback((tableSettings) => { const { index, size } = tableSettings.page; const { field, direction } = tableSettings.sort; diff --git a/x-pack/plugins/aiops/public/components/spike_analysis_table/spike_analysis_table_groups.tsx b/x-pack/plugins/aiops/public/components/spike_analysis_table/spike_analysis_table_groups.tsx index 642f09c66765c..5b3946a5f4dab 100644 --- a/x-pack/plugins/aiops/public/components/spike_analysis_table/spike_analysis_table_groups.tsx +++ b/x-pack/plugins/aiops/public/components/spike_analysis_table/spike_analysis_table_groups.tsx @@ -83,37 +83,48 @@ export const SpikeAnalysisGroupsTable: FC = ({ const { pinnedGroup, selectedGroup, setPinnedGroup, setSelectedGroup } = useSpikeAnalysisTableRowContext(); + const pushExpandedTableItem = ( + expandedTableItems: ChangePoint[], + items: FieldValuePair[], + unique = false + ) => { + for (const groupItem of items) { + const { fieldName, fieldValue } = groupItem; + const itemToPush = { + ...(changePoints.find( + (changePoint) => + (changePoint.fieldName === fieldName || + changePoint.fieldName === `${fieldName}.keyword`) && + (changePoint.fieldValue === fieldValue || + changePoint.fieldValue === `${fieldValue}.keyword`) + ) ?? {}), + fieldName: `${fieldName}`, + fieldValue: `${fieldValue}`, + unique, + } as ChangePoint; + + expandedTableItems.push(itemToPush); + } + return expandedTableItems; + }; + const toggleDetails = (item: GroupTableItem) => { const itemIdToExpandedRowMapValues = { ...itemIdToExpandedRowMap }; if (itemIdToExpandedRowMapValues[item.id]) { delete itemIdToExpandedRowMapValues[item.id]; } else { const { group, repeatedValues } = item; + const expandedTableItems: ChangePoint[] = []; - const expandedTableItems = []; - const fullGroup: FieldValuePair[] = [...group, ...repeatedValues]; - - for (const fullGroupItem of fullGroup) { - const { fieldName, fieldValue } = fullGroupItem; - - expandedTableItems.push({ - ...(changePoints.find( - (changePoint) => - (changePoint.fieldName === fieldName || - changePoint.fieldName === `${fieldName}.keyword`) && - (changePoint.fieldValue === fieldValue || - changePoint.fieldValue === `${fieldValue}.keyword`) - ) ?? {}), - fieldName: `${fieldName}`, - fieldValue: `${fieldValue}`, - }); - } + pushExpandedTableItem(expandedTableItems, group, true); + pushExpandedTableItem(expandedTableItems, repeatedValues); itemIdToExpandedRowMapValues[item.id] = ( ); } From 91c05796cec8f750a81d675db2458a339e43d569 Mon Sep 17 00:00:00 2001 From: Spencer Date: Thu, 12 Jan 2023 13:29:30 -0600 Subject: [PATCH 35/39] [packages] prevent and remove basename collisions for js/ts code (#148835) It seems like these files were unintentionally committed, or left behind, so I have added a package linter rule which will verify that we don't have any JS/TS files with exactly the same path, but different extensions. --- packages/kbn-lint-packages-cli/rules/index.ts | 3 +- .../rules/no_basename_collisions.ts | 40 +++++++++++++++++++ packages/kbn-lint-packages-cli/tsconfig.json | 1 + packages/kbn-repo-path/repo_path.ts | 6 ++- .../plugins/ml/server/models/filter/index.js | 8 ---- .../watcher/common/lib/get_moment/index.js | 8 ---- 6 files changed, 48 insertions(+), 18 deletions(-) create mode 100644 packages/kbn-lint-packages-cli/rules/no_basename_collisions.ts delete mode 100644 x-pack/plugins/ml/server/models/filter/index.js delete mode 100644 x-pack/plugins/watcher/common/lib/get_moment/index.js diff --git a/packages/kbn-lint-packages-cli/rules/index.ts b/packages/kbn-lint-packages-cli/rules/index.ts index a75d2fb50bee1..65f16c71d74f3 100644 --- a/packages/kbn-lint-packages-cli/rules/index.ts +++ b/packages/kbn-lint-packages-cli/rules/index.ts @@ -9,5 +9,6 @@ import type { PackageRule } from '@kbn/repo-linter'; import { matchingPackageNameRule } from './matching_package_name'; +import { noBasenameCollisionsRule } from './no_basename_collisions'; -export const RULES: PackageRule[] = [matchingPackageNameRule]; +export const RULES: PackageRule[] = [matchingPackageNameRule, noBasenameCollisionsRule]; diff --git a/packages/kbn-lint-packages-cli/rules/no_basename_collisions.ts b/packages/kbn-lint-packages-cli/rules/no_basename_collisions.ts new file mode 100644 index 0000000000000..436514e9aeab8 --- /dev/null +++ b/packages/kbn-lint-packages-cli/rules/no_basename_collisions.ts @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Path from 'path'; + +import { PackageRule } from '@kbn/repo-linter'; +import { SetMap } from '@kbn/set-map'; + +export const noBasenameCollisionsRule = PackageRule.create('noBasenameCollisions', { + async check() { + const groupedByBasename = new SetMap(); + + for (const file of this.getAllFiles()) { + if (!file.isJsTsCode()) { + continue; + } + + const repoRelWithoutExt = Path.resolve( + file.repoRelDir, + Path.basename(file.repoRel, file.ext) + ); + + groupedByBasename.add(repoRelWithoutExt, file.repoRel); + } + + for (const [, paths] of groupedByBasename) { + if (paths.size > 1) { + const list = Array.from(paths, (p) => `\n - ${p}`).join(''); + this.err( + `Having two JS/TS files with the same name but different extensions is not allowed:${list}` + ); + } + } + }, +}); diff --git a/packages/kbn-lint-packages-cli/tsconfig.json b/packages/kbn-lint-packages-cli/tsconfig.json index 30c6aaa3e32e5..44df028e66ef5 100644 --- a/packages/kbn-lint-packages-cli/tsconfig.json +++ b/packages/kbn-lint-packages-cli/tsconfig.json @@ -23,5 +23,6 @@ "@kbn/ts-projects", "@kbn/repo-file-maps", "@kbn/json-ast", + "@kbn/set-map", ] } diff --git a/packages/kbn-repo-path/repo_path.ts b/packages/kbn-repo-path/repo_path.ts index 86991b23a533d..aad1799174153 100644 --- a/packages/kbn-repo-path/repo_path.ts +++ b/packages/kbn-repo-path/repo_path.ts @@ -36,7 +36,7 @@ export class RepoPath { private _basename: string | undefined; /** - * basename of the path + * basename of the path (including extension) * (lazy and cached getter) */ public get basename() { @@ -64,6 +64,10 @@ export class RepoPath { return this.ext === '.js' || this.ext === '.jsx' || this.ext === '.mjs'; } + isJsTsCode() { + return this.isTypeScript() || this.isJavaScript(); + } + isFixture() { const parts = this.repoRel.split('/'); if (parts.includes('__fixtures__') || this.repoRel.endsWith('.test-d.ts')) { diff --git a/x-pack/plugins/ml/server/models/filter/index.js b/x-pack/plugins/ml/server/models/filter/index.js deleted file mode 100644 index 6f3657d9c0275..0000000000000 --- a/x-pack/plugins/ml/server/models/filter/index.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { FilterManager } from './filter_manager'; diff --git a/x-pack/plugins/watcher/common/lib/get_moment/index.js b/x-pack/plugins/watcher/common/lib/get_moment/index.js deleted file mode 100644 index 5c352d754d6ed..0000000000000 --- a/x-pack/plugins/watcher/common/lib/get_moment/index.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { getMoment } from './get_moment'; From ce026d367882fd87f0ffd6dd183271ac80df6e3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Kopyci=C5=84ski?= Date: Thu, 12 Jan 2023 20:33:08 +0100 Subject: [PATCH 36/39] =?UTF-8?q?[Osquery]=20Fix=20issue=20with=20View=20i?= =?UTF-8?q?n=20Discover=20when=20checking=20results=20for=20l=E2=80=A6=20(?= =?UTF-8?q?#148260)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../public/discover/pack_view_in_discover.tsx | 3 +- .../discover/view_results_in_discover.tsx | 30 +------ .../osquery/public/lens/pack_view_in_lens.tsx | 3 +- .../public/lens/view_results_in_lens.tsx | 6 +- .../packs/pack_queries_status_table.tsx | 85 +++---------------- 5 files changed, 15 insertions(+), 112 deletions(-) diff --git a/x-pack/plugins/osquery/public/discover/pack_view_in_discover.tsx b/x-pack/plugins/osquery/public/discover/pack_view_in_discover.tsx index c6506126c83fe..8b1ab4bc9eec1 100644 --- a/x-pack/plugins/osquery/public/discover/pack_view_in_discover.tsx +++ b/x-pack/plugins/osquery/public/discover/pack_view_in_discover.tsx @@ -21,7 +21,7 @@ interface PackViewInActionProps { actionId?: string; } const PackViewInDiscoverActionComponent: React.FC = ({ item }) => { - const { action_id: actionId, agents: agentIds, interval } = item; + const { action_id: actionId, interval } = item; const { data: lastResultsData } = usePackQueryLastResults({ actionId, interval, @@ -37,7 +37,6 @@ const PackViewInDiscoverActionComponent: React.FC = ({ it return ( = ({ actionId, - agentIds, buttonType, endDate, startDate, @@ -40,15 +38,6 @@ const ViewResultsInDiscoverActionComponent: React.FC { if (!locator || !logsDataView) return; - const agentIdsQuery = agentIds?.length - ? { - bool: { - minimum_should_match: 1, - should: agentIds.map((agentId) => ({ match_phrase: { 'agent.id': agentId } })), - }, - } - : null; - const newUrl = await locator.getUrl({ indexPatternId: logsDataView.id, filters: [ @@ -65,23 +54,6 @@ const ViewResultsInDiscoverActionComponent: React.FC = ({ item }) => { - const { action_id: actionId, agents: agentIds, interval } = item; + const { action_id: actionId, interval } = item; const { data: lastResultsData } = usePackQueryLastResults({ actionId, interval, @@ -37,7 +37,6 @@ const PackViewInLensActionComponent: React.FC = ({ item } return ( = ({ actionId, - agentIds, buttonType, endDate, startDate, @@ -55,7 +53,7 @@ const ViewResultsInLensActionComponent: React.FC = to: endDate ?? 'now', mode: mode ?? (startDate || endDate) ? 'absolute' : 'relative', }, - attributes: getLensAttributes(logsDataView, actionId, agentIds), + attributes: getLensAttributes(logsDataView, actionId), }, { openInNewTab: true, @@ -64,7 +62,7 @@ const ViewResultsInLensActionComponent: React.FC = ); } }, - [actionId, agentIds, endDate, lensService, logsDataView, mode, startDate] + [actionId, endDate, lensService, logsDataView, mode, startDate] ); const isDisabled = useMemo(() => !actionId || !logsDataView, [actionId, logsDataView]); diff --git a/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx b/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx index 26ea480f26edc..32ea6fdbf1708 100644 --- a/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx +++ b/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx @@ -61,7 +61,6 @@ export enum ViewResultsActionButtonType { interface ViewResultsInDiscoverActionProps { actionId: string; - agentIds?: string[]; buttonType: ViewResultsActionButtonType; endDate?: string; startDate?: string; @@ -70,8 +69,7 @@ interface ViewResultsInDiscoverActionProps { function getLensAttributes( logsDataView: LogsDataView, - actionId: string, - agentIds?: string[] + actionId: string ): TypedLensByValueInput['attributes'] { const dataLayer: PersistedIndexPatternLayer = { columnOrder: ['8690befd-fd69-4246-af4a-dd485d2a3b38', 'ed999e9d-204c-465b-897f-fe1a125b39ed'], @@ -122,13 +120,6 @@ function getLensAttributes( ], }; - const agentIdsQuery = { - bool: { - minimum_should_match: 1, - should: agentIds?.map((agentId) => ({ match_phrase: { 'agent.id': agentId } })), - }, - }; - return { visualizationType: 'lnsPie', title: `Action ${actionId} results`, @@ -177,23 +168,6 @@ function getLensAttributes( }, }, }, - ...(agentIdsQuery - ? [ - { - $state: { store: FilterStateStore.APP_STATE }, - meta: { - alias: 'agent IDs', - disabled: false, - index: 'filter-index-pattern-0', - key: 'query', - negate: false, - type: 'custom', - value: JSON.stringify(agentIdsQuery), - }, - query: agentIdsQuery, - }, - ] - : []), ], query: { language: 'kuery', query: '' }, visualization: xyConfig, @@ -203,7 +177,6 @@ function getLensAttributes( const ViewResultsInLensActionComponent: React.FC = ({ actionId, - agentIds, buttonType, endDate, startDate, @@ -226,7 +199,7 @@ const ViewResultsInLensActionComponent: React.FC = ({ actionId, - agentIds, buttonType, endDate, startDate, @@ -282,15 +254,6 @@ const ViewResultsInDiscoverActionComponent: React.FC { if (!locator || !logsDataView) return; - const agentIdsQuery = agentIds?.length - ? { - bool: { - minimum_should_match: 1, - should: agentIds.map((agentId) => ({ match_phrase: { 'agent.id': agentId } })), - }, - } - : null; - const newUrl = await locator.getUrl({ indexPatternId: logsDataView.id, filters: [ @@ -307,23 +270,6 @@ const ViewResultsInDiscoverActionComponent: React.FC = ({ - item, - packName, - agentIds, -}) => { +const PackViewInDiscoverActionComponent: React.FC = ({ item, packName }) => { const { id, interval } = item; const actionId = getPackActionId(id, packName); const { data: lastResultsData } = usePackQueryLastResults({ @@ -588,7 +529,6 @@ const PackViewInDiscoverActionComponent: React.FC = ({ return ( = ({ const PackViewInDiscoverAction = React.memo(PackViewInDiscoverActionComponent); -const PackViewInLensActionComponent: React.FC = ({ - item, - packName, - agentIds, -}) => { +const PackViewInLensActionComponent: React.FC = ({ item, packName }) => { const { id, interval } = item; const actionId = getPackActionId(id, packName); const { data: lastResultsData } = usePackQueryLastResults({ @@ -621,7 +557,6 @@ const PackViewInLensActionComponent: React.FC = ({ return ( = ( ); const renderDiscoverResultsAction = useCallback( - (item) => , - [agentIds, packName] + (item) => , + [packName] ); const renderLensResultsAction = useCallback( - (item) => , - [agentIds, packName] + (item) => , + [packName] ); const getItemId = useCallback((item: PackQueryFormData) => item.id ?? '', []); From c8f83ed2eb18bb8e6d98ae9d01290a6fd1d193fc Mon Sep 17 00:00:00 2001 From: Spencer Date: Thu, 12 Jan 2023 13:38:49 -0600 Subject: [PATCH 37/39] Move real plugins out of 'fixtures' dirs (#148756) The location of plugins was previously somewhat irrelevant, but as we move into packages it's more important that we can find all plugins in the repository, and we would like to be able to do that without needing to maintain a manifest somewhere to accomplish this. In order to make this possible we plan to find any plugin/package by spotting all kibana.json files which are not "fixtures". This allows plugin-like code (but not actual plugin code) to exist for testing purposes, but it must be within some form of "fixtures" directory, and any plugin that isn't in a fixtures directory will be automatically pulled into the system (though test plugins, examples, etc. will still only be loaded when the plugin's path is passed via `--plugin-path`, the system will know about them and use that knowledge for other things). Since this is just a rename Operations will review and merge by EOD Jan 12th unless someone has a blocking concern. Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .github/CODEOWNERS | 2 +- .gitignore | 1 + .../run_lint_ts_projects_cli.ts | 2 +- .../src/plugin_search_paths.js | 10 +-- .../src/tools/config.test.ts | 3 +- .../src/tools/extract_collectors.test.ts | 3 +- .../src/tools/serializer.test.ts | 8 +-- .../src/tools/ts_parser.test.ts | 9 +-- test/analytics/README.md | 2 +- test/analytics/config.ts | 4 +- .../common/fetch_events.ts | 0 .../analytics_ftr_helpers/common/types.ts | 0 .../analytics_ftr_helpers/jest.config.js | 8 +-- .../plugins/analytics_ftr_helpers/kibana.json | 0 .../analytics_ftr_helpers/package.json | 1 - .../public/custom_shipper.ts | 0 .../analytics_ftr_helpers/public/index.ts | 0 .../public/plugin.test.ts | 0 .../analytics_ftr_helpers/public/plugin.ts | 0 .../analytics_ftr_helpers/public/types.ts | 0 .../server/custom_shipper.ts | 0 .../analytics_ftr_helpers/server/index.ts | 0 .../analytics_ftr_helpers/server/plugin.ts | 0 .../analytics_ftr_helpers/tsconfig.json | 4 +- .../plugins/analytics_plugin_a/kibana.json | 0 .../plugins/analytics_plugin_a/package.json | 1 - .../public/custom_shipper.ts | 0 .../analytics_plugin_a/public/index.ts | 0 .../analytics_plugin_a/public/plugin.ts | 0 .../analytics_plugin_a/public/types.ts | 0 .../server/custom_shipper.ts | 0 .../analytics_plugin_a/server/index.ts | 0 .../analytics_plugin_a/server/plugin.ts | 0 .../plugins/analytics_plugin_a/tsconfig.json | 4 +- test/common/config.js | 4 +- .../plugins/newsfeed/kibana.json | 2 +- .../plugins/newsfeed/server/index.ts | 0 .../plugins/newsfeed/server/plugin.ts | 2 +- test/common/plugins/newsfeed/tsconfig.json | 16 +++++ .../plugins/otel_metrics/kibana.json | 0 .../plugins/otel_metrics/server/index.ts | 0 .../otel_metrics/server/monitoring/metrics.ts | 0 .../plugins/otel_metrics/server/plugin.ts | 0 .../server/routes/generate_otel_metrics.ts | 0 .../otel_metrics/server/routes/index.ts | 0 .../common/plugins/otel_metrics/tsconfig.json | 16 +++++ ...l_configuration_flow_without_tls.config.ts | 2 +- .../test_endpoints/kibana.json | 0 .../test_endpoints/server/index.ts | 0 .../test_endpoints/tsconfig.json | 0 ...l_configuration_without_security.config.ts | 2 +- test/scripts/jenkins_build_plugins.sh | 6 +- test/scripts/jenkins_xpack_build_plugins.sh | 4 +- .../http/platform/config.status.ts | 13 ++-- .../plugins/status_plugin_a/kibana.json | 0 .../plugins/status_plugin_a/package.json | 1 - .../plugins/status_plugin_a/server/index.ts | 0 .../plugins/status_plugin_a/server/plugin.ts | 0 .../plugins/status_plugin_a/tsconfig.json | 4 +- .../plugins/status_plugin_b/kibana.json | 0 .../plugins/status_plugin_b/package.json | 1 - .../plugins/status_plugin_b/server/index.ts | 0 .../plugins/status_plugin_b/server/plugin.ts | 0 .../plugins/status_plugin_b/tsconfig.json | 4 +- test/tsconfig.json | 4 -- tsconfig.base.json | 36 +++++----- .../server/sub_action_framework/README.md | 2 +- x-pack/plugins/cases/common/constants.ts | 2 +- x-pack/plugins/stack_connectors/README.md | 2 +- .../actions/connector_types/cases_webhook.ts | 2 +- .../tests/actions/connector_types/jira.ts | 2 +- .../actions/connector_types/resilient.ts | 2 +- .../actions/connector_types/servicenow.ts | 2 +- .../tests/actions/connector_types/slack.ts | 2 +- .../tests/actions/connector_types/swimlane.ts | 2 +- .../tests/actions/connector_types/webhook.ts | 2 +- .../alerting_api_integration/common/config.ts | 16 ++--- .../{fixtures => }/plugins/aad/kibana.json | 0 .../{fixtures => }/plugins/aad/package.json | 0 .../plugins/aad/server/index.ts | 0 .../plugins/aad/server/plugin.ts | 0 .../plugins/actions_simulators/kibana.json | 0 .../plugins/actions_simulators/package.json | 0 .../actions_simulators/server/README.md | 0 .../actions_simulators/server/data_handler.ts | 0 .../actions_simulators/server/index.ts | 0 .../server/jira_simulation.ts | 0 .../server/ms_exchage_server_simulation.ts | 0 .../server/opsgenie_simulation.ts | 0 .../server/pagerduty_simulation.ts | 0 .../actions_simulators/server/plugin.ts | 0 .../server/resilient_simulation.ts | 0 .../server/servicenow_oauth_simulation.ts | 0 .../server/servicenow_simulation.ts | 0 .../actions_simulators/server/simulator.ts | 2 +- .../server/slack_simulation.ts | 0 .../server/swimlane_simulation.ts | 0 .../server/tines_simulation.ts | 0 .../server/unsecured_actions_simulation.ts | 0 .../server/webhook_simulation.ts | 0 .../server/xmatters_simulation.ts | 0 .../{fixtures => }/plugins/alerts/kibana.json | 0 .../plugins/alerts/package.json | 0 .../plugins/alerts/server/action_types.ts | 0 .../plugins/alerts/server/alert_types.ts | 2 +- .../plugins/alerts/server/index.ts | 0 .../alerts/server/lib/retry_if_conflicts.ts | 0 .../plugins/alerts/server/plugin.ts | 0 .../plugins/alerts/server/routes.ts | 0 .../alerts/server/sub_action_connector.ts | 0 .../plugins/alerts_restricted/kibana.json | 0 .../plugins/alerts_restricted/package.json | 0 .../alerts_restricted/server/alert_types.ts | 0 .../plugins/alerts_restricted/server/index.ts | 0 .../alerts_restricted/server/plugin.ts | 0 .../plugins/task_manager_fixture/kibana.json | 0 .../plugins/task_manager_fixture/package.json | 0 .../task_manager_fixture/server/index.ts | 0 .../task_manager_fixture/server/plugin.ts | 0 .../actions/connector_types/cases_webhook.ts | 2 +- .../tests/actions/connector_types/email.ts | 2 +- .../tests/actions/connector_types/jira.ts | 2 +- .../connector_types/oauth_access_token.ts | 2 +- .../tests/actions/connector_types/opsgenie.ts | 2 +- .../actions/connector_types/pagerduty.ts | 2 +- .../actions/connector_types/resilient.ts | 2 +- .../connector_types/servicenow_itom.ts | 2 +- .../connector_types/servicenow_itsm.ts | 2 +- .../actions/connector_types/servicenow_sir.ts | 2 +- .../tests/actions/connector_types/slack.ts | 2 +- .../tests/actions/connector_types/swimlane.ts | 2 +- .../tests/actions/connector_types/tines.ts | 2 +- .../tests/actions/connector_types/webhook.ts | 2 +- .../tests/actions/connector_types/xmatters.ts | 2 +- .../actions/sub_action_framework/index.ts | 2 +- .../tests/alerting/mustache_templates.ts | 2 +- .../actions/connector_types/stack/webhook.ts | 2 +- .../tests/alerting/mustache_templates.ts | 8 +-- .../actions/connector_types/stack/webhook.ts | 2 +- .../cases_api_integration/common/config.ts | 66 +++++-------------- .../cases_api_integration/common/lib/utils.ts | 4 +- .../{fixtures => }/plugins/cases/kibana.json | 0 .../{fixtures => }/plugins/cases/package.json | 0 .../server/attachments/external_reference.ts | 0 .../server/attachments/persistable_state.ts | 0 .../plugins/cases/server/index.ts | 0 .../plugins/cases/server/plugin.ts | 0 .../plugins/observability/kibana.json | 0 .../plugins/observability/package.json | 0 .../plugins/observability/server/index.ts | 0 .../plugins/observability/server/plugin.ts | 0 .../plugins/security_solution/kibana.json | 0 .../plugins/security_solution/package.json | 0 .../plugins/security_solution/server/index.ts | 0 .../security_solution/server/plugin.ts | 0 .../external_references.ts | 2 +- .../persistable_state.ts | 2 +- .../tests/no_public_base_url/push.ts | 2 +- .../tests/trial/cases/push_case.ts | 2 +- .../functional_execution_context/config.ts | 2 +- .../{fixtures => }/plugins/alerts/kibana.json | 0 .../plugins/alerts/package.json | 0 .../alerts/server/ensure_apm_started.ts | 1 - .../plugins/alerts/server/index.ts | 0 .../plugins/alerts/server/plugin.ts | 0 .../plugins/alerts/tsconfig.json | 23 +++++++ .../apps/cases/attachment_framework.ts | 4 +- .../apps/cases/upgrade.ts | 2 +- .../triggers_actions_ui/connectors/tines.ts | 4 +- x-pack/test/functional_with_es_ssl/config.ts | 13 ++-- .../{fixtures => }/plugins/alerts/kibana.json | 0 .../plugins/alerts/package.json | 2 +- .../plugins/alerts/public/application.tsx | 0 .../plugins/alerts/public/index.ts | 0 .../plugins/alerts/public/plugin.ts | 0 .../plugins/alerts/server/index.ts | 0 .../plugins/alerts/server/plugin.ts | 0 .../plugins/alerts/tsconfig.json | 19 ++++++ .../{fixtures => }/plugins/cases/kibana.json | 0 .../{fixtures => }/plugins/cases/package.json | 2 +- .../plugins/cases/public/application.tsx | 0 .../public/attachments/external_reference.tsx | 0 .../external_references_content.tsx | 0 .../public/attachments/persistable_state.tsx | 0 .../plugins/cases/public/index.ts | 0 .../plugins/cases/public/plugin.ts | 0 .../server/attachments/external_reference.ts | 0 .../server/attachments/persistable_state.ts | 0 .../plugins/cases/server/index.ts | 0 .../plugins/cases/server/plugin.ts | 0 .../plugins/cases/tsconfig.json | 20 ++++++ .../lists_api_integration/common/config.ts | 8 +-- x-pack/test/rule_registry/common/config.ts | 2 +- .../common/config.ts | 2 +- .../saved_object_test_plugin/kibana.json | 0 .../saved_object_test_plugin/server/index.ts | 0 .../saved_object_test_plugin/server/plugin.ts | 0 .../security_api_integration/audit.config.ts | 4 +- .../kerberos.config.ts | 5 +- .../security_api_integration/oidc.config.ts | 5 +- .../security_api_integration/pki.config.ts | 5 +- .../audit => plugins}/audit_log/kibana.json | 0 .../audit_log/server/index.ts | 0 .../audit_log/server/plugin.ts | 0 .../plugins/audit_log/tsconfig.json | 16 +++++ .../user_profiles_consumer/kibana.json | 0 .../user_profiles_consumer/server/index.ts | 0 .../server/init_routes.ts | 0 .../user_profiles_consumer/tsconfig.json | 20 ++++++ .../security_api_integration/saml.config.ts | 5 +- .../tests/audit/audit_log.ts | 2 +- .../security_api_integration/token.config.ts | 5 +- .../user_profiles.config.ts | 5 +- .../expired_session.config.ts | 2 +- .../login_selector.config.ts | 2 +- .../test/security_functional/oidc.config.ts | 2 +- .../test_endpoints/kibana.json | 0 .../test_endpoints/public/index.ts | 0 .../test_endpoints/public/plugin.tsx | 0 .../test_endpoints/server/index.ts | 0 .../test_endpoints/server/init_routes.ts | 0 .../plugins/test_endpoints/tsconfig.json | 18 +++++ .../test/security_functional/saml.config.ts | 2 +- .../user_profiles.config.ts | 2 +- .../spaces_api_integration/common/config.ts | 2 +- .../spaces_test_plugin/kibana.json | 0 .../spaces_test_plugin/server/index.ts | 0 .../spaces_test_plugin/server/plugin.ts | 0 x-pack/test/timeline/common/config.ts | 2 +- x-pack/test/tsconfig.json | 5 +- x-pack/test/ui_capabilities/common/config.ts | 2 +- .../plugins/foo_plugin/kibana.json | 0 .../plugins/foo_plugin/public/index.ts | 0 .../plugins/foo_plugin/server/index.ts | 0 234 files changed, 312 insertions(+), 246 deletions(-) rename test/analytics/{fixtures => }/plugins/analytics_ftr_helpers/common/fetch_events.ts (100%) rename test/analytics/{fixtures => }/plugins/analytics_ftr_helpers/common/types.ts (100%) rename test/analytics/{fixtures => }/plugins/analytics_ftr_helpers/jest.config.js (60%) rename test/analytics/{fixtures => }/plugins/analytics_ftr_helpers/kibana.json (100%) rename test/analytics/{fixtures => }/plugins/analytics_ftr_helpers/package.json (81%) rename test/analytics/{fixtures => }/plugins/analytics_ftr_helpers/public/custom_shipper.ts (100%) rename test/analytics/{fixtures => }/plugins/analytics_ftr_helpers/public/index.ts (100%) rename test/analytics/{fixtures => }/plugins/analytics_ftr_helpers/public/plugin.test.ts (100%) rename test/analytics/{fixtures => }/plugins/analytics_ftr_helpers/public/plugin.ts (100%) rename test/analytics/{fixtures => }/plugins/analytics_ftr_helpers/public/types.ts (100%) rename test/analytics/{fixtures => }/plugins/analytics_ftr_helpers/server/custom_shipper.ts (100%) rename test/analytics/{fixtures => }/plugins/analytics_ftr_helpers/server/index.ts (100%) rename test/analytics/{fixtures => }/plugins/analytics_ftr_helpers/server/plugin.ts (100%) rename test/analytics/{fixtures => }/plugins/analytics_ftr_helpers/tsconfig.json (78%) rename test/analytics/{fixtures => }/plugins/analytics_plugin_a/kibana.json (100%) rename test/analytics/{fixtures => }/plugins/analytics_plugin_a/package.json (81%) rename test/analytics/{fixtures => }/plugins/analytics_plugin_a/public/custom_shipper.ts (100%) rename test/analytics/{fixtures => }/plugins/analytics_plugin_a/public/index.ts (100%) rename test/analytics/{fixtures => }/plugins/analytics_plugin_a/public/plugin.ts (100%) rename test/analytics/{fixtures => }/plugins/analytics_plugin_a/public/types.ts (100%) rename test/analytics/{fixtures => }/plugins/analytics_plugin_a/server/custom_shipper.ts (100%) rename test/analytics/{fixtures => }/plugins/analytics_plugin_a/server/index.ts (100%) rename test/analytics/{fixtures => }/plugins/analytics_plugin_a/server/plugin.ts (100%) rename test/analytics/{fixtures => }/plugins/analytics_plugin_a/tsconfig.json (74%) rename test/common/{fixtures => }/plugins/newsfeed/kibana.json (81%) rename test/common/{fixtures => }/plugins/newsfeed/server/index.ts (100%) rename test/common/{fixtures => }/plugins/newsfeed/server/plugin.ts (96%) create mode 100644 test/common/plugins/newsfeed/tsconfig.json rename test/common/{fixtures => }/plugins/otel_metrics/kibana.json (100%) rename test/common/{fixtures => }/plugins/otel_metrics/server/index.ts (100%) rename test/common/{fixtures => }/plugins/otel_metrics/server/monitoring/metrics.ts (100%) rename test/common/{fixtures => }/plugins/otel_metrics/server/plugin.ts (100%) rename test/common/{fixtures => }/plugins/otel_metrics/server/routes/generate_otel_metrics.ts (100%) rename test/common/{fixtures => }/plugins/otel_metrics/server/routes/index.ts (100%) create mode 100644 test/common/plugins/otel_metrics/tsconfig.json rename test/interactive_setup_api_integration/{fixtures => plugins}/test_endpoints/kibana.json (100%) rename test/interactive_setup_api_integration/{fixtures => plugins}/test_endpoints/server/index.ts (100%) rename test/interactive_setup_api_integration/{fixtures => plugins}/test_endpoints/tsconfig.json (100%) rename test/server_integration/{__fixtures__ => }/plugins/status_plugin_a/kibana.json (100%) rename test/server_integration/{__fixtures__ => }/plugins/status_plugin_a/package.json (80%) rename test/server_integration/{__fixtures__ => }/plugins/status_plugin_a/server/index.ts (100%) rename test/server_integration/{__fixtures__ => }/plugins/status_plugin_a/server/plugin.ts (100%) rename test/server_integration/{__fixtures__ => }/plugins/status_plugin_a/tsconfig.json (72%) rename test/server_integration/{__fixtures__ => }/plugins/status_plugin_b/kibana.json (100%) rename test/server_integration/{__fixtures__ => }/plugins/status_plugin_b/package.json (80%) rename test/server_integration/{__fixtures__ => }/plugins/status_plugin_b/server/index.ts (100%) rename test/server_integration/{__fixtures__ => }/plugins/status_plugin_b/server/plugin.ts (100%) rename test/server_integration/{__fixtures__ => }/plugins/status_plugin_b/tsconfig.json (70%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/aad/kibana.json (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/aad/package.json (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/aad/server/index.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/aad/server/plugin.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/kibana.json (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/package.json (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/README.md (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/data_handler.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/index.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/jira_simulation.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/ms_exchage_server_simulation.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/opsgenie_simulation.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/pagerduty_simulation.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/plugin.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/resilient_simulation.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/servicenow_oauth_simulation.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/servicenow_simulation.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/simulator.ts (97%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/slack_simulation.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/swimlane_simulation.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/tines_simulation.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/unsecured_actions_simulation.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/webhook_simulation.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/actions_simulators/server/xmatters_simulation.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/alerts/kibana.json (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/alerts/package.json (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/alerts/server/action_types.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/alerts/server/alert_types.ts (99%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/alerts/server/index.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/alerts/server/lib/retry_if_conflicts.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/alerts/server/plugin.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/alerts/server/routes.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/alerts/server/sub_action_connector.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/alerts_restricted/kibana.json (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/alerts_restricted/package.json (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/alerts_restricted/server/alert_types.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/alerts_restricted/server/index.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/alerts_restricted/server/plugin.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/task_manager_fixture/kibana.json (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/task_manager_fixture/package.json (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/task_manager_fixture/server/index.ts (100%) rename x-pack/test/alerting_api_integration/common/{fixtures => }/plugins/task_manager_fixture/server/plugin.ts (100%) rename x-pack/test/cases_api_integration/common/{fixtures => }/plugins/cases/kibana.json (100%) rename x-pack/test/cases_api_integration/common/{fixtures => }/plugins/cases/package.json (100%) rename x-pack/test/cases_api_integration/common/{fixtures => }/plugins/cases/server/attachments/external_reference.ts (100%) rename x-pack/test/cases_api_integration/common/{fixtures => }/plugins/cases/server/attachments/persistable_state.ts (100%) rename x-pack/test/cases_api_integration/common/{fixtures => }/plugins/cases/server/index.ts (100%) rename x-pack/test/cases_api_integration/common/{fixtures => }/plugins/cases/server/plugin.ts (100%) rename x-pack/test/cases_api_integration/common/{fixtures => }/plugins/observability/kibana.json (100%) rename x-pack/test/cases_api_integration/common/{fixtures => }/plugins/observability/package.json (100%) rename x-pack/test/cases_api_integration/common/{fixtures => }/plugins/observability/server/index.ts (100%) rename x-pack/test/cases_api_integration/common/{fixtures => }/plugins/observability/server/plugin.ts (100%) rename x-pack/test/cases_api_integration/common/{fixtures => }/plugins/security_solution/kibana.json (100%) rename x-pack/test/cases_api_integration/common/{fixtures => }/plugins/security_solution/package.json (100%) rename x-pack/test/cases_api_integration/common/{fixtures => }/plugins/security_solution/server/index.ts (100%) rename x-pack/test/cases_api_integration/common/{fixtures => }/plugins/security_solution/server/plugin.ts (100%) rename x-pack/test/functional_execution_context/{fixtures => }/plugins/alerts/kibana.json (100%) rename x-pack/test/functional_execution_context/{fixtures => }/plugins/alerts/package.json (100%) rename x-pack/test/functional_execution_context/{fixtures => }/plugins/alerts/server/ensure_apm_started.ts (82%) rename x-pack/test/functional_execution_context/{fixtures => }/plugins/alerts/server/index.ts (100%) rename x-pack/test/functional_execution_context/{fixtures => }/plugins/alerts/server/plugin.ts (100%) create mode 100644 x-pack/test/functional_execution_context/plugins/alerts/tsconfig.json rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/alerts/kibana.json (100%) rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/alerts/package.json (76%) rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/alerts/public/application.tsx (100%) rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/alerts/public/index.ts (100%) rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/alerts/public/plugin.ts (100%) rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/alerts/server/index.ts (100%) rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/alerts/server/plugin.ts (100%) create mode 100644 x-pack/test/functional_with_es_ssl/plugins/alerts/tsconfig.json rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/cases/kibana.json (100%) rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/cases/package.json (77%) rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/cases/public/application.tsx (100%) rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/cases/public/attachments/external_reference.tsx (100%) rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/cases/public/attachments/external_references_content.tsx (100%) rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/cases/public/attachments/persistable_state.tsx (100%) rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/cases/public/index.ts (100%) rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/cases/public/plugin.ts (100%) rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/cases/server/attachments/external_reference.ts (100%) rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/cases/server/attachments/persistable_state.ts (100%) rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/cases/server/index.ts (100%) rename x-pack/test/functional_with_es_ssl/{fixtures => }/plugins/cases/server/plugin.ts (100%) create mode 100644 x-pack/test/functional_with_es_ssl/plugins/cases/tsconfig.json rename x-pack/test/saved_object_api_integration/common/{fixtures => plugins}/saved_object_test_plugin/kibana.json (100%) rename x-pack/test/saved_object_api_integration/common/{fixtures => plugins}/saved_object_test_plugin/server/index.ts (100%) rename x-pack/test/saved_object_api_integration/common/{fixtures => plugins}/saved_object_test_plugin/server/plugin.ts (100%) rename x-pack/test/security_api_integration/{fixtures/audit => plugins}/audit_log/kibana.json (100%) rename x-pack/test/security_api_integration/{fixtures/audit => plugins}/audit_log/server/index.ts (100%) rename x-pack/test/security_api_integration/{fixtures/audit => plugins}/audit_log/server/plugin.ts (100%) create mode 100644 x-pack/test/security_api_integration/plugins/audit_log/tsconfig.json rename x-pack/test/security_api_integration/{fixtures/user_profiles => plugins}/user_profiles_consumer/kibana.json (100%) rename x-pack/test/security_api_integration/{fixtures/user_profiles => plugins}/user_profiles_consumer/server/index.ts (100%) rename x-pack/test/security_api_integration/{fixtures/user_profiles => plugins}/user_profiles_consumer/server/init_routes.ts (100%) create mode 100644 x-pack/test/security_api_integration/plugins/user_profiles_consumer/tsconfig.json rename x-pack/test/security_functional/{fixtures/common => plugins}/test_endpoints/kibana.json (100%) rename x-pack/test/security_functional/{fixtures/common => plugins}/test_endpoints/public/index.ts (100%) rename x-pack/test/security_functional/{fixtures/common => plugins}/test_endpoints/public/plugin.tsx (100%) rename x-pack/test/security_functional/{fixtures/common => plugins}/test_endpoints/server/index.ts (100%) rename x-pack/test/security_functional/{fixtures/common => plugins}/test_endpoints/server/init_routes.ts (100%) create mode 100644 x-pack/test/security_functional/plugins/test_endpoints/tsconfig.json rename x-pack/test/spaces_api_integration/common/{fixtures => plugins}/spaces_test_plugin/kibana.json (100%) rename x-pack/test/spaces_api_integration/common/{fixtures => plugins}/spaces_test_plugin/server/index.ts (100%) rename x-pack/test/spaces_api_integration/common/{fixtures => plugins}/spaces_test_plugin/server/plugin.ts (100%) rename x-pack/test/ui_capabilities/common/{fixtures => }/plugins/foo_plugin/kibana.json (100%) rename x-pack/test/ui_capabilities/common/{fixtures => }/plugins/foo_plugin/public/index.ts (100%) rename x-pack/test/ui_capabilities/common/{fixtures => }/plugins/foo_plugin/server/index.ts (100%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 175494144b8f5..bc136320a03dc 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -381,7 +381,7 @@ /x-pack/test/plugin_api_integration/test_suites/task_manager/ @elastic/response-ops /x-pack/plugins/triggers_actions_ui/ @elastic/response-ops /x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/ @elastic/response-ops -/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/ @elastic/response-ops +/x-pack/test/functional_with_es_ssl/plugins/alerts/ @elastic/response-ops /docs/user/alerting/ @elastic/response-ops /docs/management/connectors/ @elastic/response-ops /x-pack/plugins/stack_alerts/ @elastic/response-ops diff --git a/.gitignore b/.gitignore index 911d55301b693..c417069940161 100644 --- a/.gitignore +++ b/.gitignore @@ -115,3 +115,4 @@ fleet-server.yml /packages/kbn-synthetic-package-map/ **/.synthetics/ **/.journeys/ +x-pack/test/security_api_integration/plugins/audit_log/audit.log diff --git a/packages/kbn-lint-ts-projects-cli/run_lint_ts_projects_cli.ts b/packages/kbn-lint-ts-projects-cli/run_lint_ts_projects_cli.ts index 46411c44d0e54..50ed41b7e66a3 100644 --- a/packages/kbn-lint-ts-projects-cli/run_lint_ts_projects_cli.ts +++ b/packages/kbn-lint-ts-projects-cli/run_lint_ts_projects_cli.ts @@ -98,7 +98,7 @@ function validateProjectOwnership( if (isNotInTsProject.length) { failed = true; log.error( - `The following files do not belong to a tsconfig.json file, or that tsconfig.json file is not listed in packages/kbn-ts-projects/projects.ts\n${isNotInTsProject + `The following files do not belong to a tsconfig.json file\n${isNotInTsProject .map((file) => ` - ${file.repoRel}`) .join('\n')}` ); diff --git a/packages/kbn-plugin-discovery/src/plugin_search_paths.js b/packages/kbn-plugin-discovery/src/plugin_search_paths.js index efb1a9f0751c1..ed702cf8e79c2 100644 --- a/packages/kbn-plugin-discovery/src/plugin_search_paths.js +++ b/packages/kbn-plugin-discovery/src/plugin_search_paths.js @@ -22,24 +22,24 @@ function getPluginSearchPaths({ rootDir, oss, examples, testPlugins }) { resolve(rootDir, '..', 'kibana-extra'), ...(testPlugins ? [ - resolve(rootDir, 'test/analytics/fixtures/plugins'), + resolve(rootDir, 'test/analytics/plugins'), resolve(rootDir, 'test/health_gateway/plugins'), resolve(rootDir, 'test/plugin_functional/plugins'), resolve(rootDir, 'test/interpreter_functional/plugins'), - resolve(rootDir, 'test/common/fixtures/plugins'), - resolve(rootDir, 'test/server_integration/__fixtures__/plugins'), + resolve(rootDir, 'test/common/plugins'), + resolve(rootDir, 'test/server_integration/plugins'), ] : []), ...(testPlugins && !oss ? [ resolve(rootDir, 'x-pack/test/plugin_functional/plugins'), - resolve(rootDir, 'x-pack/test/functional_with_es_ssl/fixtures/plugins'), + resolve(rootDir, 'x-pack/test/functional_with_es_ssl/plugins'), resolve(rootDir, 'x-pack/test/alerting_api_integration/plugins'), resolve(rootDir, 'x-pack/test/plugin_api_integration/plugins'), resolve(rootDir, 'x-pack/test/plugin_api_perf/plugins'), resolve(rootDir, 'x-pack/test/licensing_plugin/plugins'), resolve(rootDir, 'x-pack/test/usage_collection/plugins'), - resolve(rootDir, 'x-pack/test/security_functional/fixtures/common'), + resolve(rootDir, 'x-pack/test/security_functional/plugins'), ] : []), ]; diff --git a/packages/kbn-telemetry-tools/src/tools/config.test.ts b/packages/kbn-telemetry-tools/src/tools/config.test.ts index f3f5243fddec7..4c20a81a524b4 100644 --- a/packages/kbn-telemetry-tools/src/tools/config.test.ts +++ b/packages/kbn-telemetry-tools/src/tools/config.test.ts @@ -7,6 +7,7 @@ */ import * as path from 'path'; +import { REPO_ROOT } from '@kbn/repo-info'; import { parseTelemetryRC } from './config'; describe('parseTelemetryRC', () => { @@ -16,7 +17,7 @@ describe('parseTelemetryRC', () => { }); it('returns parsed rc file', async () => { - const configRoot = path.join(process.cwd(), 'src', 'fixtures', 'telemetry_collectors'); + const configRoot = path.resolve(REPO_ROOT, 'src/fixtures/telemetry_collectors'); const config = await parseTelemetryRC(configRoot); expect(config).toStrictEqual([ { diff --git a/packages/kbn-telemetry-tools/src/tools/extract_collectors.test.ts b/packages/kbn-telemetry-tools/src/tools/extract_collectors.test.ts index 87ca1f2e173b2..4777bf4872826 100644 --- a/packages/kbn-telemetry-tools/src/tools/extract_collectors.test.ts +++ b/packages/kbn-telemetry-tools/src/tools/extract_collectors.test.ts @@ -8,13 +8,14 @@ import * as ts from 'typescript'; import * as path from 'path'; +import { REPO_ROOT } from '@kbn/repo-info'; import { extractCollectors, getProgramPaths } from './extract_collectors'; import { parseTelemetryRC } from './config'; import { allExtractedCollectors } from './__fixture__/all_extracted_collectors'; describe('extractCollectors', () => { it('extracts collectors given rc file', async () => { - const configRoot = path.join(process.cwd(), 'src', 'fixtures', 'telemetry_collectors'); + const configRoot = path.join(REPO_ROOT, 'src/fixtures/telemetry_collectors'); const tsConfig = ts.findConfigFile('./', ts.sys.fileExists, 'tsconfig.json'); if (!tsConfig) { throw new Error('Could not find a valid tsconfig.json.'); diff --git a/packages/kbn-telemetry-tools/src/tools/serializer.test.ts b/packages/kbn-telemetry-tools/src/tools/serializer.test.ts index acb4d24cbd8ff..c83ef9ec0a81a 100644 --- a/packages/kbn-telemetry-tools/src/tools/serializer.test.ts +++ b/packages/kbn-telemetry-tools/src/tools/serializer.test.ts @@ -8,17 +8,15 @@ import * as ts from 'typescript'; import * as path from 'path'; +import { REPO_ROOT } from '@kbn/repo-info'; import { getDescriptor, TelemetryKinds } from './serializer'; import { traverseNodes } from './ts_parser'; import { compilerHost } from './compiler_host'; export function loadFixtureProgram(fixtureName: string) { const fixturePath = path.resolve( - process.cwd(), - 'src', - 'fixtures', - 'telemetry_collectors', - `${fixtureName}.ts` + REPO_ROOT, + `src/fixtures/telemetry_collectors/${fixtureName}.ts` ); const tsConfig = ts.findConfigFile('./', ts.sys.fileExists, 'tsconfig.json'); if (!tsConfig) { diff --git a/packages/kbn-telemetry-tools/src/tools/ts_parser.test.ts b/packages/kbn-telemetry-tools/src/tools/ts_parser.test.ts index 205ab6594fda6..d4696cecf2256 100644 --- a/packages/kbn-telemetry-tools/src/tools/ts_parser.test.ts +++ b/packages/kbn-telemetry-tools/src/tools/ts_parser.test.ts @@ -9,6 +9,7 @@ import { parseUsageCollection } from './ts_parser'; import * as ts from 'typescript'; import * as path from 'path'; +import { REPO_ROOT } from '@kbn/repo-info'; import { compilerHost } from './compiler_host'; import { parsedWorkingCollector } from './__fixture__/parsed_working_collector'; import { parsedNestedCollector } from './__fixture__/parsed_nested_collector'; @@ -20,13 +21,7 @@ import { parsedStatsCollector } from './__fixture__/parsed_stats_collector'; import { parsedImportedInterfaceFromExport } from './__fixture__/parsed_imported_interface_from_export'; export function loadFixtureProgram(fixtureName: string) { - const fixturePath = path.resolve( - process.cwd(), - 'src', - 'fixtures', - 'telemetry_collectors', - `${fixtureName}` - ); + const fixturePath = path.resolve(REPO_ROOT, `src/fixtures/telemetry_collectors/${fixtureName}`); const tsConfig = ts.findConfigFile('./', ts.sys.fileExists, 'tsconfig.json'); if (!tsConfig) { throw new Error('Could not find a valid tsconfig.json.'); diff --git a/test/analytics/README.md b/test/analytics/README.md index cc2bd39297059..2d9dec0cec9fc 100644 --- a/test/analytics/README.md +++ b/test/analytics/README.md @@ -20,4 +20,4 @@ expect(events).to... If you are reusing these helpers in another suite, please remember to make sure to optIn via `await getService('kibana_ebt_ui').setOptIn(true);` -Refer to [`EBTHelpersContract`](./fixtures/plugins/analytics_ftr_helpers/common/types.ts#:~:text=EBTHelpersContract) for more details about the existing APIs and all the options they accept. \ No newline at end of file +Refer to [`EBTHelpersContract`](./plugins/analytics_ftr_helpers/common/types.ts#:~:text=EBTHelpersContract) for more details about the existing APIs and all the options they accept. \ No newline at end of file diff --git a/test/analytics/config.ts b/test/analytics/config.ts index 307ed42a439a7..adf9579650546 100644 --- a/test/analytics/config.ts +++ b/test/analytics/config.ts @@ -35,8 +35,8 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { serverArgs: [ ...functionalConfig.get('kbnTestServer.serverArgs'), '--telemetry.optIn=true', - `--plugin-path=${path.resolve(__dirname, './fixtures/plugins/analytics_plugin_a')}`, - `--plugin-path=${path.resolve(__dirname, './fixtures/plugins/analytics_ftr_helpers')}`, + `--plugin-path=${path.resolve(__dirname, './plugins/analytics_plugin_a')}`, + `--plugin-path=${path.resolve(__dirname, './plugins/analytics_ftr_helpers')}`, ], }, }; diff --git a/test/analytics/fixtures/plugins/analytics_ftr_helpers/common/fetch_events.ts b/test/analytics/plugins/analytics_ftr_helpers/common/fetch_events.ts similarity index 100% rename from test/analytics/fixtures/plugins/analytics_ftr_helpers/common/fetch_events.ts rename to test/analytics/plugins/analytics_ftr_helpers/common/fetch_events.ts diff --git a/test/analytics/fixtures/plugins/analytics_ftr_helpers/common/types.ts b/test/analytics/plugins/analytics_ftr_helpers/common/types.ts similarity index 100% rename from test/analytics/fixtures/plugins/analytics_ftr_helpers/common/types.ts rename to test/analytics/plugins/analytics_ftr_helpers/common/types.ts diff --git a/test/analytics/fixtures/plugins/analytics_ftr_helpers/jest.config.js b/test/analytics/plugins/analytics_ftr_helpers/jest.config.js similarity index 60% rename from test/analytics/fixtures/plugins/analytics_ftr_helpers/jest.config.js rename to test/analytics/plugins/analytics_ftr_helpers/jest.config.js index ffbc666f750f0..b10848569dc31 100644 --- a/test/analytics/fixtures/plugins/analytics_ftr_helpers/jest.config.js +++ b/test/analytics/plugins/analytics_ftr_helpers/jest.config.js @@ -8,12 +8,12 @@ module.exports = { preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['/test/analytics/fixtures/plugins/analytics_ftr_helpers'], + rootDir: '../../../..', + roots: ['/test/analytics/plugins/analytics_ftr_helpers'], coverageDirectory: - '/target/kibana-coverage/jest/test/analytics/fixtures/plugins/analytics_ftr_helpers', + '/target/kibana-coverage/jest/test/analytics/plugins/analytics_ftr_helpers', coverageReporters: ['text', 'html'], collectCoverageFrom: [ - '/test/analytics/fixtures/plugins/analytics_ftr_helpers/{common,public,server}/**/*.{ts,tsx}', + '/test/analytics/plugins/analytics_ftr_helpers/{common,public,server}/**/*.{ts,tsx}', ], }; diff --git a/test/analytics/fixtures/plugins/analytics_ftr_helpers/kibana.json b/test/analytics/plugins/analytics_ftr_helpers/kibana.json similarity index 100% rename from test/analytics/fixtures/plugins/analytics_ftr_helpers/kibana.json rename to test/analytics/plugins/analytics_ftr_helpers/kibana.json diff --git a/test/analytics/fixtures/plugins/analytics_ftr_helpers/package.json b/test/analytics/plugins/analytics_ftr_helpers/package.json similarity index 81% rename from test/analytics/fixtures/plugins/analytics_ftr_helpers/package.json rename to test/analytics/plugins/analytics_ftr_helpers/package.json index 77535df59ff74..b6becffce86ad 100644 --- a/test/analytics/fixtures/plugins/analytics_ftr_helpers/package.json +++ b/test/analytics/plugins/analytics_ftr_helpers/package.json @@ -1,7 +1,6 @@ { "name": "analytics_ftr_helpers", "version": "1.0.0", - "main": "target/test/analytics/fixtures/plugins/analytics_ftr_helpers", "kibana": { "version": "kibana", "templateVersion": "1.0.0" diff --git a/test/analytics/fixtures/plugins/analytics_ftr_helpers/public/custom_shipper.ts b/test/analytics/plugins/analytics_ftr_helpers/public/custom_shipper.ts similarity index 100% rename from test/analytics/fixtures/plugins/analytics_ftr_helpers/public/custom_shipper.ts rename to test/analytics/plugins/analytics_ftr_helpers/public/custom_shipper.ts diff --git a/test/analytics/fixtures/plugins/analytics_ftr_helpers/public/index.ts b/test/analytics/plugins/analytics_ftr_helpers/public/index.ts similarity index 100% rename from test/analytics/fixtures/plugins/analytics_ftr_helpers/public/index.ts rename to test/analytics/plugins/analytics_ftr_helpers/public/index.ts diff --git a/test/analytics/fixtures/plugins/analytics_ftr_helpers/public/plugin.test.ts b/test/analytics/plugins/analytics_ftr_helpers/public/plugin.test.ts similarity index 100% rename from test/analytics/fixtures/plugins/analytics_ftr_helpers/public/plugin.test.ts rename to test/analytics/plugins/analytics_ftr_helpers/public/plugin.test.ts diff --git a/test/analytics/fixtures/plugins/analytics_ftr_helpers/public/plugin.ts b/test/analytics/plugins/analytics_ftr_helpers/public/plugin.ts similarity index 100% rename from test/analytics/fixtures/plugins/analytics_ftr_helpers/public/plugin.ts rename to test/analytics/plugins/analytics_ftr_helpers/public/plugin.ts diff --git a/test/analytics/fixtures/plugins/analytics_ftr_helpers/public/types.ts b/test/analytics/plugins/analytics_ftr_helpers/public/types.ts similarity index 100% rename from test/analytics/fixtures/plugins/analytics_ftr_helpers/public/types.ts rename to test/analytics/plugins/analytics_ftr_helpers/public/types.ts diff --git a/test/analytics/fixtures/plugins/analytics_ftr_helpers/server/custom_shipper.ts b/test/analytics/plugins/analytics_ftr_helpers/server/custom_shipper.ts similarity index 100% rename from test/analytics/fixtures/plugins/analytics_ftr_helpers/server/custom_shipper.ts rename to test/analytics/plugins/analytics_ftr_helpers/server/custom_shipper.ts diff --git a/test/analytics/fixtures/plugins/analytics_ftr_helpers/server/index.ts b/test/analytics/plugins/analytics_ftr_helpers/server/index.ts similarity index 100% rename from test/analytics/fixtures/plugins/analytics_ftr_helpers/server/index.ts rename to test/analytics/plugins/analytics_ftr_helpers/server/index.ts diff --git a/test/analytics/fixtures/plugins/analytics_ftr_helpers/server/plugin.ts b/test/analytics/plugins/analytics_ftr_helpers/server/plugin.ts similarity index 100% rename from test/analytics/fixtures/plugins/analytics_ftr_helpers/server/plugin.ts rename to test/analytics/plugins/analytics_ftr_helpers/server/plugin.ts diff --git a/test/analytics/fixtures/plugins/analytics_ftr_helpers/tsconfig.json b/test/analytics/plugins/analytics_ftr_helpers/tsconfig.json similarity index 78% rename from test/analytics/fixtures/plugins/analytics_ftr_helpers/tsconfig.json rename to test/analytics/plugins/analytics_ftr_helpers/tsconfig.json index f39686d7e098f..c6f087def9b01 100644 --- a/test/analytics/fixtures/plugins/analytics_ftr_helpers/tsconfig.json +++ b/test/analytics/plugins/analytics_ftr_helpers/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../../tsconfig.base.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { "outDir": "target/types", }, @@ -8,7 +8,7 @@ "common/**/*.ts", "public/**/*.ts", "server/**/*.ts", - "../../../../../typings/**/*", + "../../../../typings/**/*", ], "exclude": [ "target/**/*", diff --git a/test/analytics/fixtures/plugins/analytics_plugin_a/kibana.json b/test/analytics/plugins/analytics_plugin_a/kibana.json similarity index 100% rename from test/analytics/fixtures/plugins/analytics_plugin_a/kibana.json rename to test/analytics/plugins/analytics_plugin_a/kibana.json diff --git a/test/analytics/fixtures/plugins/analytics_plugin_a/package.json b/test/analytics/plugins/analytics_plugin_a/package.json similarity index 81% rename from test/analytics/fixtures/plugins/analytics_plugin_a/package.json rename to test/analytics/plugins/analytics_plugin_a/package.json index d49950be253e3..dc0467ed0452b 100644 --- a/test/analytics/fixtures/plugins/analytics_plugin_a/package.json +++ b/test/analytics/plugins/analytics_plugin_a/package.json @@ -1,7 +1,6 @@ { "name": "analytics_plugin_a", "version": "1.0.0", - "main": "target/test/analytics/fixtures/plugins/analytics_plugin_a", "kibana": { "version": "kibana", "templateVersion": "1.0.0" diff --git a/test/analytics/fixtures/plugins/analytics_plugin_a/public/custom_shipper.ts b/test/analytics/plugins/analytics_plugin_a/public/custom_shipper.ts similarity index 100% rename from test/analytics/fixtures/plugins/analytics_plugin_a/public/custom_shipper.ts rename to test/analytics/plugins/analytics_plugin_a/public/custom_shipper.ts diff --git a/test/analytics/fixtures/plugins/analytics_plugin_a/public/index.ts b/test/analytics/plugins/analytics_plugin_a/public/index.ts similarity index 100% rename from test/analytics/fixtures/plugins/analytics_plugin_a/public/index.ts rename to test/analytics/plugins/analytics_plugin_a/public/index.ts diff --git a/test/analytics/fixtures/plugins/analytics_plugin_a/public/plugin.ts b/test/analytics/plugins/analytics_plugin_a/public/plugin.ts similarity index 100% rename from test/analytics/fixtures/plugins/analytics_plugin_a/public/plugin.ts rename to test/analytics/plugins/analytics_plugin_a/public/plugin.ts diff --git a/test/analytics/fixtures/plugins/analytics_plugin_a/public/types.ts b/test/analytics/plugins/analytics_plugin_a/public/types.ts similarity index 100% rename from test/analytics/fixtures/plugins/analytics_plugin_a/public/types.ts rename to test/analytics/plugins/analytics_plugin_a/public/types.ts diff --git a/test/analytics/fixtures/plugins/analytics_plugin_a/server/custom_shipper.ts b/test/analytics/plugins/analytics_plugin_a/server/custom_shipper.ts similarity index 100% rename from test/analytics/fixtures/plugins/analytics_plugin_a/server/custom_shipper.ts rename to test/analytics/plugins/analytics_plugin_a/server/custom_shipper.ts diff --git a/test/analytics/fixtures/plugins/analytics_plugin_a/server/index.ts b/test/analytics/plugins/analytics_plugin_a/server/index.ts similarity index 100% rename from test/analytics/fixtures/plugins/analytics_plugin_a/server/index.ts rename to test/analytics/plugins/analytics_plugin_a/server/index.ts diff --git a/test/analytics/fixtures/plugins/analytics_plugin_a/server/plugin.ts b/test/analytics/plugins/analytics_plugin_a/server/plugin.ts similarity index 100% rename from test/analytics/fixtures/plugins/analytics_plugin_a/server/plugin.ts rename to test/analytics/plugins/analytics_plugin_a/server/plugin.ts diff --git a/test/analytics/fixtures/plugins/analytics_plugin_a/tsconfig.json b/test/analytics/plugins/analytics_plugin_a/tsconfig.json similarity index 74% rename from test/analytics/fixtures/plugins/analytics_plugin_a/tsconfig.json rename to test/analytics/plugins/analytics_plugin_a/tsconfig.json index 6a3e9e40e3890..7e66e07b40a53 100644 --- a/test/analytics/fixtures/plugins/analytics_plugin_a/tsconfig.json +++ b/test/analytics/plugins/analytics_plugin_a/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../../tsconfig.base.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { "outDir": "target/types", }, @@ -7,7 +7,7 @@ "index.ts", "public/**/*.ts", "server/**/*.ts", - "../../../../../typings/**/*", + "../../../../typings/**/*", ], "exclude": [ "target/**/*", diff --git a/test/common/config.js b/test/common/config.js index 532b517f2d69a..b0a7072930b5c 100644 --- a/test/common/config.js +++ b/test/common/config.js @@ -50,9 +50,9 @@ export default function () { '--telemetry.sendUsageTo=staging', `--server.maxPayload=1679958`, // newsfeed mock service - `--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'newsfeed')}`, + `--plugin-path=${path.join(__dirname, 'plugins', 'newsfeed')}`, // otel mock service - `--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'otel_metrics')}`, + `--plugin-path=${path.join(__dirname, 'plugins', 'otel_metrics')}`, `--newsfeed.service.urlRoot=${servers.kibana.protocol}://${servers.kibana.hostname}:${servers.kibana.port}`, `--newsfeed.service.pathTemplate=/api/_newsfeed-FTS-external-service-simulators/kibana/v{VERSION}.json`, `--logging.appenders.deprecation=${JSON.stringify({ diff --git a/test/common/fixtures/plugins/newsfeed/kibana.json b/test/common/plugins/newsfeed/kibana.json similarity index 81% rename from test/common/fixtures/plugins/newsfeed/kibana.json rename to test/common/plugins/newsfeed/kibana.json index b624f4b064995..ebd736f027ab6 100644 --- a/test/common/fixtures/plugins/newsfeed/kibana.json +++ b/test/common/plugins/newsfeed/kibana.json @@ -1,5 +1,5 @@ { - "id": "newsfeedFixtures", + "id": "newsfeedTestPlugin", "owner": { "name": "Core", "githubTeam": "kibana-core" diff --git a/test/common/fixtures/plugins/newsfeed/server/index.ts b/test/common/plugins/newsfeed/server/index.ts similarity index 100% rename from test/common/fixtures/plugins/newsfeed/server/index.ts rename to test/common/plugins/newsfeed/server/index.ts diff --git a/test/common/fixtures/plugins/newsfeed/server/plugin.ts b/test/common/plugins/newsfeed/server/plugin.ts similarity index 96% rename from test/common/fixtures/plugins/newsfeed/server/plugin.ts rename to test/common/plugins/newsfeed/server/plugin.ts index 5eb27325e535c..cdfdeb59b4ca6 100644 --- a/test/common/fixtures/plugins/newsfeed/server/plugin.ts +++ b/test/common/plugins/newsfeed/server/plugin.ts @@ -45,7 +45,7 @@ export class NewsFeedSimulatorPlugin implements Plugin { items: [ { title: { en: `You are functionally testing the newsfeed widget with fixtures!` }, - description: { en: 'See test/common/fixtures/plugins/newsfeed/newsfeed_simulation' }, + description: { en: 'See test/common/plugins/newsfeed/newsfeed_simulation' }, link_text: { en: 'Generic feed-viewer could go here' }, link_url: { en: 'https://feeds.elastic.co' }, languages: null, diff --git a/test/common/plugins/newsfeed/tsconfig.json b/test/common/plugins/newsfeed/tsconfig.json new file mode 100644 index 0000000000000..0a0ba15a4030c --- /dev/null +++ b/test/common/plugins/newsfeed/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/core", + ] +} diff --git a/test/common/fixtures/plugins/otel_metrics/kibana.json b/test/common/plugins/otel_metrics/kibana.json similarity index 100% rename from test/common/fixtures/plugins/otel_metrics/kibana.json rename to test/common/plugins/otel_metrics/kibana.json diff --git a/test/common/fixtures/plugins/otel_metrics/server/index.ts b/test/common/plugins/otel_metrics/server/index.ts similarity index 100% rename from test/common/fixtures/plugins/otel_metrics/server/index.ts rename to test/common/plugins/otel_metrics/server/index.ts diff --git a/test/common/fixtures/plugins/otel_metrics/server/monitoring/metrics.ts b/test/common/plugins/otel_metrics/server/monitoring/metrics.ts similarity index 100% rename from test/common/fixtures/plugins/otel_metrics/server/monitoring/metrics.ts rename to test/common/plugins/otel_metrics/server/monitoring/metrics.ts diff --git a/test/common/fixtures/plugins/otel_metrics/server/plugin.ts b/test/common/plugins/otel_metrics/server/plugin.ts similarity index 100% rename from test/common/fixtures/plugins/otel_metrics/server/plugin.ts rename to test/common/plugins/otel_metrics/server/plugin.ts diff --git a/test/common/fixtures/plugins/otel_metrics/server/routes/generate_otel_metrics.ts b/test/common/plugins/otel_metrics/server/routes/generate_otel_metrics.ts similarity index 100% rename from test/common/fixtures/plugins/otel_metrics/server/routes/generate_otel_metrics.ts rename to test/common/plugins/otel_metrics/server/routes/generate_otel_metrics.ts diff --git a/test/common/fixtures/plugins/otel_metrics/server/routes/index.ts b/test/common/plugins/otel_metrics/server/routes/index.ts similarity index 100% rename from test/common/fixtures/plugins/otel_metrics/server/routes/index.ts rename to test/common/plugins/otel_metrics/server/routes/index.ts diff --git a/test/common/plugins/otel_metrics/tsconfig.json b/test/common/plugins/otel_metrics/tsconfig.json new file mode 100644 index 0000000000000..0a0ba15a4030c --- /dev/null +++ b/test/common/plugins/otel_metrics/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/core", + ] +} diff --git a/test/interactive_setup_api_integration/manual_configuration_flow_without_tls.config.ts b/test/interactive_setup_api_integration/manual_configuration_flow_without_tls.config.ts index 16d98c00768c0..570caf6a6e248 100644 --- a/test/interactive_setup_api_integration/manual_configuration_flow_without_tls.config.ts +++ b/test/interactive_setup_api_integration/manual_configuration_flow_without_tls.config.ts @@ -17,7 +17,7 @@ import { services } from './services'; export default async function ({ readConfigFile }: FtrConfigProviderContext) { const xPackAPITestsConfig = await readConfigFile(require.resolve('../api_integration/config')); - const testEndpointsPlugin = resolve(__dirname, './fixtures/test_endpoints'); + const testEndpointsPlugin = resolve(__dirname, './plugins/test_endpoints'); const tempKibanaYamlFile = join(getDataPath(), `interactive_setup_kibana_${Date.now()}.yml`); await fs.writeFile(tempKibanaYamlFile, ''); diff --git a/test/interactive_setup_api_integration/fixtures/test_endpoints/kibana.json b/test/interactive_setup_api_integration/plugins/test_endpoints/kibana.json similarity index 100% rename from test/interactive_setup_api_integration/fixtures/test_endpoints/kibana.json rename to test/interactive_setup_api_integration/plugins/test_endpoints/kibana.json diff --git a/test/interactive_setup_api_integration/fixtures/test_endpoints/server/index.ts b/test/interactive_setup_api_integration/plugins/test_endpoints/server/index.ts similarity index 100% rename from test/interactive_setup_api_integration/fixtures/test_endpoints/server/index.ts rename to test/interactive_setup_api_integration/plugins/test_endpoints/server/index.ts diff --git a/test/interactive_setup_api_integration/fixtures/test_endpoints/tsconfig.json b/test/interactive_setup_api_integration/plugins/test_endpoints/tsconfig.json similarity index 100% rename from test/interactive_setup_api_integration/fixtures/test_endpoints/tsconfig.json rename to test/interactive_setup_api_integration/plugins/test_endpoints/tsconfig.json diff --git a/test/interactive_setup_functional/manual_configuration_without_security.config.ts b/test/interactive_setup_functional/manual_configuration_without_security.config.ts index 48c917e853b5a..22f7cf143cac2 100644 --- a/test/interactive_setup_functional/manual_configuration_without_security.config.ts +++ b/test/interactive_setup_functional/manual_configuration_without_security.config.ts @@ -17,7 +17,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { const testEndpointsPlugin = resolve( __dirname, - '../interactive_setup_api_integration/fixtures/test_endpoints' + '../interactive_setup_api_integration/plugins/test_endpoints' ); const tempKibanaYamlFile = join(getDataPath(), `interactive_setup_kibana_${Date.now()}.yml`); diff --git a/test/scripts/jenkins_build_plugins.sh b/test/scripts/jenkins_build_plugins.sh index 262257ebc8c87..dd1715065e799 100755 --- a/test/scripts/jenkins_build_plugins.sh +++ b/test/scripts/jenkins_build_plugins.sh @@ -7,12 +7,12 @@ node scripts/build_kibana_platform_plugins \ --scan-dir "$KIBANA_DIR/test/plugin_functional/plugins" \ --scan-dir "$KIBANA_DIR/test/health_gateway/plugins" \ --scan-dir "$KIBANA_DIR/test/interpreter_functional/plugins" \ - --scan-dir "$KIBANA_DIR/test/common/fixtures/plugins" \ + --scan-dir "$KIBANA_DIR/test/common/plugins" \ --scan-dir "$KIBANA_DIR/examples" \ --scan-dir "$KIBANA_DIR/test/plugin_functional/plugins" \ - --scan-dir "$KIBANA_DIR/test/common/fixtures/plugins" \ + --scan-dir "$KIBANA_DIR/test/common/plugins" \ --scan-dir "$XPACK_DIR/test/plugin_functional/plugins" \ - --scan-dir "$XPACK_DIR/test/functional_with_es_ssl/fixtures/plugins" \ + --scan-dir "$XPACK_DIR/test/functional_with_es_ssl/plugins" \ --scan-dir "$XPACK_DIR/test/alerting_api_integration/plugins" \ --scan-dir "$XPACK_DIR/test/plugin_api_integration/plugins" \ --scan-dir "$XPACK_DIR/test/plugin_api_perf/plugins" \ diff --git a/test/scripts/jenkins_xpack_build_plugins.sh b/test/scripts/jenkins_xpack_build_plugins.sh index 521d8c120f606..bdf6ee2455527 100755 --- a/test/scripts/jenkins_xpack_build_plugins.sh +++ b/test/scripts/jenkins_xpack_build_plugins.sh @@ -5,9 +5,9 @@ source src/dev/ci_setup/setup_env.sh echo " -> building kibana platform plugins" node scripts/build_kibana_platform_plugins \ --scan-dir "$KIBANA_DIR/test/plugin_functional/plugins" \ - --scan-dir "$KIBANA_DIR/test/common/fixtures/plugins" \ + --scan-dir "$KIBANA_DIR/test/common/plugins" \ --scan-dir "$XPACK_DIR/test/plugin_functional/plugins" \ - --scan-dir "$XPACK_DIR/test/functional_with_es_ssl/fixtures/plugins" \ + --scan-dir "$XPACK_DIR/test/functional_with_es_ssl/plugins" \ --scan-dir "$XPACK_DIR/test/alerting_api_integration/plugins" \ --scan-dir "$XPACK_DIR/test/plugin_api_integration/plugins" \ --scan-dir "$XPACK_DIR/test/plugin_api_perf/plugins" \ diff --git a/test/server_integration/http/platform/config.status.ts b/test/server_integration/http/platform/config.status.ts index 8be9b24a56817..f4d4b6a39e016 100644 --- a/test/server_integration/http/platform/config.status.ts +++ b/test/server_integration/http/platform/config.status.ts @@ -22,11 +22,9 @@ import { FtrConfigProviderContext } from '@kbn/test'; export default async function ({ readConfigFile }: FtrConfigProviderContext) { const httpConfig = await readConfigFile(require.resolve('../../config.base.js')); - // Find all folders in __fixtures__/plugins since we treat all them as plugin folder - const allFiles = fs.readdirSync(path.resolve(__dirname, '../../__fixtures__/plugins')); - const plugins = allFiles.filter((file) => - fs.statSync(path.resolve(__dirname, '../../__fixtures__/plugins', file)).isDirectory() - ); + // Find all folders in plugins since we treat all them as plugin folder + const pluginDir = path.resolve(__dirname, '../../plugins'); + const pluginsDirs = fs.readdirSync(pluginDir).map((name) => path.resolve(pluginDir, name)); return { testFiles: [ @@ -43,10 +41,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { ...httpConfig.get('kbnTestServer'), serverArgs: [ ...httpConfig.get('kbnTestServer.serverArgs'), - ...plugins.map( - (pluginDir) => - `--plugin-path=${path.resolve(__dirname, '../../__fixtures__/plugins', pluginDir)}` - ), + ...pluginsDirs.map((p) => `--plugin-path=${p}`), ], runOptions: { ...httpConfig.get('kbnTestServer.runOptions'), diff --git a/test/server_integration/__fixtures__/plugins/status_plugin_a/kibana.json b/test/server_integration/plugins/status_plugin_a/kibana.json similarity index 100% rename from test/server_integration/__fixtures__/plugins/status_plugin_a/kibana.json rename to test/server_integration/plugins/status_plugin_a/kibana.json diff --git a/test/server_integration/__fixtures__/plugins/status_plugin_a/package.json b/test/server_integration/plugins/status_plugin_a/package.json similarity index 80% rename from test/server_integration/__fixtures__/plugins/status_plugin_a/package.json rename to test/server_integration/plugins/status_plugin_a/package.json index 5c73bca024f4e..69e66bb56ecb2 100644 --- a/test/server_integration/__fixtures__/plugins/status_plugin_a/package.json +++ b/test/server_integration/plugins/status_plugin_a/package.json @@ -1,7 +1,6 @@ { "name": "status_plugin_a", "version": "1.0.0", - "main": "target/test/server_integration/__fixtures__/plugins/status_plugin_a", "kibana": { "version": "kibana", "templateVersion": "1.0.0" diff --git a/test/server_integration/__fixtures__/plugins/status_plugin_a/server/index.ts b/test/server_integration/plugins/status_plugin_a/server/index.ts similarity index 100% rename from test/server_integration/__fixtures__/plugins/status_plugin_a/server/index.ts rename to test/server_integration/plugins/status_plugin_a/server/index.ts diff --git a/test/server_integration/__fixtures__/plugins/status_plugin_a/server/plugin.ts b/test/server_integration/plugins/status_plugin_a/server/plugin.ts similarity index 100% rename from test/server_integration/__fixtures__/plugins/status_plugin_a/server/plugin.ts rename to test/server_integration/plugins/status_plugin_a/server/plugin.ts diff --git a/test/server_integration/__fixtures__/plugins/status_plugin_a/tsconfig.json b/test/server_integration/plugins/status_plugin_a/tsconfig.json similarity index 72% rename from test/server_integration/__fixtures__/plugins/status_plugin_a/tsconfig.json rename to test/server_integration/plugins/status_plugin_a/tsconfig.json index 8789ef4f3583d..6143548540d98 100644 --- a/test/server_integration/__fixtures__/plugins/status_plugin_a/tsconfig.json +++ b/test/server_integration/plugins/status_plugin_a/tsconfig.json @@ -1,12 +1,12 @@ { - "extends": "../../../../../tsconfig.base.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { "outDir": "target/types", }, "include": [ "index.ts", "server/**/*.ts", - "../../../../../../typings/**/*", + "../../../../typings/**/*", ], "exclude": [ "target/**/*", diff --git a/test/server_integration/__fixtures__/plugins/status_plugin_b/kibana.json b/test/server_integration/plugins/status_plugin_b/kibana.json similarity index 100% rename from test/server_integration/__fixtures__/plugins/status_plugin_b/kibana.json rename to test/server_integration/plugins/status_plugin_b/kibana.json diff --git a/test/server_integration/__fixtures__/plugins/status_plugin_b/package.json b/test/server_integration/plugins/status_plugin_b/package.json similarity index 80% rename from test/server_integration/__fixtures__/plugins/status_plugin_b/package.json rename to test/server_integration/plugins/status_plugin_b/package.json index 3799d5d470754..e918489464f4e 100644 --- a/test/server_integration/__fixtures__/plugins/status_plugin_b/package.json +++ b/test/server_integration/plugins/status_plugin_b/package.json @@ -1,7 +1,6 @@ { "name": "status_plugin_b", "version": "1.0.0", - "main": "target/test/server_integration/__fixtures__/plugins/status_plugin_b", "kibana": { "version": "kibana", "templateVersion": "1.0.0" diff --git a/test/server_integration/__fixtures__/plugins/status_plugin_b/server/index.ts b/test/server_integration/plugins/status_plugin_b/server/index.ts similarity index 100% rename from test/server_integration/__fixtures__/plugins/status_plugin_b/server/index.ts rename to test/server_integration/plugins/status_plugin_b/server/index.ts diff --git a/test/server_integration/__fixtures__/plugins/status_plugin_b/server/plugin.ts b/test/server_integration/plugins/status_plugin_b/server/plugin.ts similarity index 100% rename from test/server_integration/__fixtures__/plugins/status_plugin_b/server/plugin.ts rename to test/server_integration/plugins/status_plugin_b/server/plugin.ts diff --git a/test/server_integration/__fixtures__/plugins/status_plugin_b/tsconfig.json b/test/server_integration/plugins/status_plugin_b/tsconfig.json similarity index 70% rename from test/server_integration/__fixtures__/plugins/status_plugin_b/tsconfig.json rename to test/server_integration/plugins/status_plugin_b/tsconfig.json index 4b333551c1495..bf146797a42ee 100644 --- a/test/server_integration/__fixtures__/plugins/status_plugin_b/tsconfig.json +++ b/test/server_integration/plugins/status_plugin_b/tsconfig.json @@ -1,12 +1,12 @@ { - "extends": "../../../../../tsconfig.base.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { "outDir": "target/types" }, "include": [ "index.ts", "server/**/*.ts", - "../../../../../typings/**/*", + "../../../../typings/**/*", ], "exclude": [ "target/**/*", diff --git a/test/tsconfig.json b/test/tsconfig.json index 2d4e7e38b9428..4be1be2bfa62c 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -20,9 +20,6 @@ ], "exclude": [ "target/**/*", - "analytics/fixtures/plugins/**/*", - "interactive_setup_api_integration/fixtures/test_endpoints/**/*", - "server_integration/__fixtures__/plugins/**/*", "*/plugins/**/*", ], "kbn_references": [ @@ -37,7 +34,6 @@ "@kbn/visualizations-plugin", "@kbn/analytics-ftr-helpers-plugin", "@kbn/analytics-plugin-a-plugin", - { "path": "interactive_setup_api_integration/fixtures/test_endpoints/tsconfig.json" }, "@kbn/core-app-status-plugin", "@kbn/core-provider-plugin", "@kbn/test", diff --git a/tsconfig.base.json b/tsconfig.base.json index feb87dd99ead1..0b30c709b0af3 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -18,8 +18,8 @@ "@kbn/aiops-utils/*": ["x-pack/packages/ml/aiops_utils/*"], "@kbn/alerting-example-plugin": ["x-pack/examples/alerting_example"], "@kbn/alerting-example-plugin/*": ["x-pack/examples/alerting_example/*"], - "@kbn/alerting-fixture-plugin": ["x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts"], - "@kbn/alerting-fixture-plugin/*": ["x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/*"], + "@kbn/alerting-fixture-plugin": ["x-pack/test/functional_with_es_ssl/plugins/alerts"], + "@kbn/alerting-fixture-plugin/*": ["x-pack/test/functional_with_es_ssl/plugins/alerts/*"], "@kbn/alerting-plugin": ["x-pack/plugins/alerting"], "@kbn/alerting-plugin/*": ["x-pack/plugins/alerting/*"], "@kbn/alerts": ["packages/kbn-alerts"], @@ -36,10 +36,10 @@ "@kbn/analytics/*": ["packages/kbn-analytics/*"], "@kbn/analytics-client": ["packages/analytics/client"], "@kbn/analytics-client/*": ["packages/analytics/client/*"], - "@kbn/analytics-ftr-helpers-plugin": ["test/analytics/fixtures/plugins/analytics_ftr_helpers"], - "@kbn/analytics-ftr-helpers-plugin/*": ["test/analytics/fixtures/plugins/analytics_ftr_helpers/*"], - "@kbn/analytics-plugin-a-plugin": ["test/analytics/fixtures/plugins/analytics_plugin_a"], - "@kbn/analytics-plugin-a-plugin/*": ["test/analytics/fixtures/plugins/analytics_plugin_a/*"], + "@kbn/analytics-ftr-helpers-plugin": ["test/analytics/plugins/analytics_ftr_helpers"], + "@kbn/analytics-ftr-helpers-plugin/*": ["test/analytics/plugins/analytics_ftr_helpers/*"], + "@kbn/analytics-plugin-a-plugin": ["test/analytics/plugins/analytics_plugin_a"], + "@kbn/analytics-plugin-a-plugin/*": ["test/analytics/plugins/analytics_plugin_a/*"], "@kbn/analytics-shippers-elastic-v3-browser": ["packages/analytics/shippers/elastic_v3/browser"], "@kbn/analytics-shippers-elastic-v3-browser/*": ["packages/analytics/shippers/elastic_v3/browser/*"], "@kbn/analytics-shippers-elastic-v3-common": ["packages/analytics/shippers/elastic_v3/common"], @@ -86,8 +86,8 @@ "@kbn/canvas-plugin/*": ["x-pack/plugins/canvas/*"], "@kbn/cases-components": ["packages/kbn-cases-components"], "@kbn/cases-components/*": ["packages/kbn-cases-components/*"], - "@kbn/cases-fixture-plugin": ["x-pack/test/functional_with_es_ssl/fixtures/plugins/cases"], - "@kbn/cases-fixture-plugin/*": ["x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/*"], + "@kbn/cases-fixture-plugin": ["x-pack/test/functional_with_es_ssl/plugins/cases"], + "@kbn/cases-fixture-plugin/*": ["x-pack/test/functional_with_es_ssl/plugins/cases/*"], "@kbn/cases-plugin": ["x-pack/plugins/cases"], "@kbn/cases-plugin/*": ["x-pack/plugins/cases/*"], "@kbn/chart-expressions-common": ["src/plugins/chart_expressions/common"], @@ -862,16 +862,16 @@ "@kbn/monitoring-plugin/*": ["x-pack/plugins/monitoring/*"], "@kbn/navigation-plugin": ["src/plugins/navigation"], "@kbn/navigation-plugin/*": ["src/plugins/navigation/*"], - "@kbn/newsfeed-fixtures-plugin": ["test/common/fixtures/plugins/newsfeed"], - "@kbn/newsfeed-fixtures-plugin/*": ["test/common/fixtures/plugins/newsfeed/*"], "@kbn/newsfeed-plugin": ["src/plugins/newsfeed"], "@kbn/newsfeed-plugin/*": ["src/plugins/newsfeed/*"], + "@kbn/newsfeed-test-plugin": ["test/common/plugins/newsfeed"], + "@kbn/newsfeed-test-plugin/*": ["test/common/plugins/newsfeed/*"], "@kbn/notifications-plugin": ["x-pack/plugins/notifications"], "@kbn/notifications-plugin/*": ["x-pack/plugins/notifications/*"], "@kbn/observability-plugin": ["x-pack/plugins/observability"], "@kbn/observability-plugin/*": ["x-pack/plugins/observability/*"], - "@kbn/open-telemetry-instrumented-plugin": ["test/common/fixtures/plugins/otel_metrics"], - "@kbn/open-telemetry-instrumented-plugin/*": ["test/common/fixtures/plugins/otel_metrics/*"], + "@kbn/open-telemetry-instrumented-plugin": ["test/common/plugins/otel_metrics"], + "@kbn/open-telemetry-instrumented-plugin/*": ["test/common/plugins/otel_metrics/*"], "@kbn/optimizer": ["packages/kbn-optimizer"], "@kbn/optimizer/*": ["packages/kbn-optimizer/*"], "@kbn/optimizer-webpack-helpers": ["packages/kbn-optimizer-webpack-helpers"], @@ -982,8 +982,8 @@ "@kbn/security-plugin/*": ["x-pack/plugins/security/*"], "@kbn/security-solution-plugin": ["x-pack/plugins/security_solution"], "@kbn/security-solution-plugin/*": ["x-pack/plugins/security_solution/*"], - "@kbn/security-test-endpoints-plugin": ["x-pack/test/security_functional/fixtures/common/test_endpoints"], - "@kbn/security-test-endpoints-plugin/*": ["x-pack/test/security_functional/fixtures/common/test_endpoints/*"], + "@kbn/security-test-endpoints-plugin": ["x-pack/test/security_functional/plugins/test_endpoints"], + "@kbn/security-test-endpoints-plugin/*": ["x-pack/test/security_functional/plugins/test_endpoints/*"], "@kbn/securitysolution-autocomplete": ["packages/kbn-securitysolution-autocomplete"], "@kbn/securitysolution-autocomplete/*": ["packages/kbn-securitysolution-autocomplete/*"], "@kbn/securitysolution-es-utils": ["packages/kbn-securitysolution-es-utils"], @@ -1148,10 +1148,10 @@ "@kbn/stack-management-usage-test-plugin/*": ["x-pack/test/usage_collection/plugins/stack_management_usage_test/*"], "@kbn/state-containers-examples-plugin": ["examples/state_containers_examples"], "@kbn/state-containers-examples-plugin/*": ["examples/state_containers_examples/*"], - "@kbn/status-plugin-a-plugin": ["test/server_integration/__fixtures__/plugins/status_plugin_a"], - "@kbn/status-plugin-a-plugin/*": ["test/server_integration/__fixtures__/plugins/status_plugin_a/*"], - "@kbn/status-plugin-b-plugin": ["test/server_integration/__fixtures__/plugins/status_plugin_b"], - "@kbn/status-plugin-b-plugin/*": ["test/server_integration/__fixtures__/plugins/status_plugin_b/*"], + "@kbn/status-plugin-a-plugin": ["test/server_integration/plugins/status_plugin_a"], + "@kbn/status-plugin-a-plugin/*": ["test/server_integration/plugins/status_plugin_a/*"], + "@kbn/status-plugin-b-plugin": ["test/server_integration/plugins/status_plugin_b"], + "@kbn/status-plugin-b-plugin/*": ["test/server_integration/plugins/status_plugin_b/*"], "@kbn/std": ["packages/kbn-std"], "@kbn/std/*": ["packages/kbn-std/*"], "@kbn/stdio-dev-helpers": ["packages/kbn-stdio-dev-helpers"], diff --git a/x-pack/plugins/actions/server/sub_action_framework/README.md b/x-pack/plugins/actions/server/sub_action_framework/README.md index 9279a5382e1b9..4aa74f6e8362e 100644 --- a/x-pack/plugins/actions/server/sub_action_framework/README.md +++ b/x-pack/plugins/actions/server/sub_action_framework/README.md @@ -355,7 +355,7 @@ plugins.actions.registerSubActionConnectorType({ }); ``` -You can see a full example in [x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/sub_action_connector.ts](../../../../test/alerting_api_integration/common/fixtures/plugins/alerts/server/sub_action_connector.ts) +You can see a full example in [x-pack/test/alerting_api_integration/common/plugins/alerts/server/sub_action_connector.ts](../../../../test/alerting_api_integration/common/plugins/alerts/server/sub_action_connector.ts) ### Example: Register sub action connector with custom validators diff --git a/x-pack/plugins/cases/common/constants.ts b/x-pack/plugins/cases/common/constants.ts index d4dd55f5dbec7..ff82b9c97ff19 100644 --- a/x-pack/plugins/cases/common/constants.ts +++ b/x-pack/plugins/cases/common/constants.ts @@ -44,7 +44,7 @@ export const CASE_COMMENT_SAVED_OBJECT = 'cases-comments' as const; export const CASE_CONFIGURE_SAVED_OBJECT = 'cases-configure' as const; /** - * If more values are added here please also add them here: x-pack/test/cases_api_integration/common/fixtures/plugins + * If more values are added here please also add them here: x-pack/test/cases_api_integration/common/plugins */ export const SAVED_OBJECT_TYPES = [ CASE_SAVED_OBJECT, diff --git a/x-pack/plugins/stack_connectors/README.md b/x-pack/plugins/stack_connectors/README.md index d92225a641e3d..dc4265e92e042 100644 --- a/x-pack/plugins/stack_connectors/README.md +++ b/x-pack/plugins/stack_connectors/README.md @@ -384,7 +384,7 @@ We suggest following the template provided in `docs/action-type-template.asciido ## Tests -The connector type should have both unit tests and functional tests. For functional tests, if your connector interacts with a 3rd party service via HTTP, you may be able to create a simulator for your service to test with. See the existing functional test servers in the directory [`x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server`](../../test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server) +The connector type should have both unit tests and functional tests. For functional tests, if your connector interacts with a 3rd party service via HTTP, you may be able to create a simulator for your service to test with. See the existing functional test servers in the directory [`x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server`](../../test/alerting_api_integration/common/plugins/actions_simulators/server) ## Connector type config and secrets diff --git a/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/cases_webhook.ts b/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/cases_webhook.ts index fed6273d28d52..e4d4820c0b727 100644 --- a/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/cases_webhook.ts +++ b/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/cases_webhook.ts @@ -10,7 +10,7 @@ import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { ExternalServiceSimulator, getExternalServiceSimulatorPath, -} from '../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function casesWebhookTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/jira.ts b/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/jira.ts index 94a6a0784feef..8c94a1977240c 100644 --- a/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/jira.ts +++ b/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/jira.ts @@ -10,7 +10,7 @@ import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function jiraTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/resilient.ts b/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/resilient.ts index 93688e96e8417..a6a3bc9047971 100644 --- a/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/resilient.ts +++ b/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/resilient.ts @@ -10,7 +10,7 @@ import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function resilientTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/servicenow.ts b/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/servicenow.ts index 4cd018a2647dc..195131a36de8b 100644 --- a/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/servicenow.ts +++ b/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/servicenow.ts @@ -10,7 +10,7 @@ import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function servicenowTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/slack.ts b/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/slack.ts index ee9ce7131b07b..1cb5d64b35fb7 100644 --- a/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/slack.ts +++ b/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/slack.ts @@ -9,7 +9,7 @@ import http from 'http'; import getPort from 'get-port'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; -import { getSlackServer } from '../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +import { getSlackServer } from '../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function slackTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/swimlane.ts b/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/swimlane.ts index 95e041bbeb03a..eebc23dd683cd 100644 --- a/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/swimlane.ts +++ b/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/swimlane.ts @@ -9,7 +9,7 @@ import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { ExternalServiceSimulator, getExternalServiceSimulatorPath, -} from '../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function swimlaneTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/webhook.ts b/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/webhook.ts index 0019c274774e6..7de7375474a2f 100644 --- a/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/webhook.ts +++ b/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/webhook.ts @@ -8,7 +8,7 @@ import http from 'http'; import getPort from 'get-port'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; -import { getWebhookServer } from '../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +import { getWebhookServer } from '../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function webhookTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/common/config.ts b/x-pack/test/alerting_api_integration/common/config.ts index 81784f9fa9e5b..2f70ad5902483 100644 --- a/x-pack/test/alerting_api_integration/common/config.ts +++ b/x-pack/test/alerting_api_integration/common/config.ts @@ -11,7 +11,7 @@ import fs from 'fs'; import { CA_CERT_PATH } from '@kbn/dev-utils'; import { FtrConfigProviderContext } from '@kbn/test'; import { services } from './services'; -import { getAllExternalServiceSimulatorPaths } from './fixtures/plugins/actions_simulators/server/plugin'; +import { getAllExternalServiceSimulatorPaths } from './plugins/actions_simulators/server/plugin'; import { getTlsWebhookServerUrls } from './lib/get_tls_webhook_servers'; interface CreateTestConfigOptions { @@ -87,10 +87,11 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) }, }; // Find all folders in ./plugins since we treat all them as plugin folder - const allFiles = fs.readdirSync(path.resolve(__dirname, 'fixtures', 'plugins')); - const plugins = allFiles.filter((file) => - fs.statSync(path.resolve(__dirname, 'fixtures', 'plugins', file)).isDirectory() - ); + const pluginDir = path.resolve(__dirname, 'plugins'); + const pluginPaths = fs + .readdirSync(pluginDir) + .map((n) => path.resolve(pluginDir, n)) + .filter((p) => fs.statSync(p)); const proxyPort = process.env.ALERTING_PROXY_PORT ?? (await getPort({ port: getPort.makeRange(6200, 6299) })); @@ -304,10 +305,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) ...disabledPlugins .filter((k) => k !== 'security') .map((key) => `--xpack.${key}.enabled=false`), - ...plugins.map( - (pluginDir) => - `--plugin-path=${path.resolve(__dirname, 'fixtures', 'plugins', pluginDir)}` - ), + ...pluginPaths.map((p) => `--plugin-path=${p}`), `--server.xsrf.allowlist=${JSON.stringify(getAllExternalServiceSimulatorPaths())}`, ...(ssl ? [ diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/kibana.json b/x-pack/test/alerting_api_integration/common/plugins/aad/kibana.json similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/kibana.json rename to x-pack/test/alerting_api_integration/common/plugins/aad/kibana.json diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json b/x-pack/test/alerting_api_integration/common/plugins/aad/package.json similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json rename to x-pack/test/alerting_api_integration/common/plugins/aad/package.json diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/server/index.ts b/x-pack/test/alerting_api_integration/common/plugins/aad/server/index.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/server/index.ts rename to x-pack/test/alerting_api_integration/common/plugins/aad/server/index.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/server/plugin.ts b/x-pack/test/alerting_api_integration/common/plugins/aad/server/plugin.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/server/plugin.ts rename to x-pack/test/alerting_api_integration/common/plugins/aad/server/plugin.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/kibana.json b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/kibana.json similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/kibana.json rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/kibana.json diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/package.json similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/package.json diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/README.md b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/README.md similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/README.md rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/README.md diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/data_handler.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/data_handler.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/data_handler.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/data_handler.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/index.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/index.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/index.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/index.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/jira_simulation.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/jira_simulation.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/jira_simulation.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/jira_simulation.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/ms_exchage_server_simulation.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/ms_exchage_server_simulation.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/ms_exchage_server_simulation.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/ms_exchage_server_simulation.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/opsgenie_simulation.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/opsgenie_simulation.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/opsgenie_simulation.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/opsgenie_simulation.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/pagerduty_simulation.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/pagerduty_simulation.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/pagerduty_simulation.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/pagerduty_simulation.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/plugin.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/plugin.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/plugin.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/plugin.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/resilient_simulation.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/resilient_simulation.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/resilient_simulation.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/resilient_simulation.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/servicenow_oauth_simulation.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/servicenow_oauth_simulation.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/servicenow_oauth_simulation.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/servicenow_oauth_simulation.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/servicenow_simulation.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/servicenow_simulation.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/servicenow_simulation.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/servicenow_simulation.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/simulator.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/simulator.ts similarity index 97% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/simulator.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/simulator.ts index d226859e25659..8ff962bdb8927 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/simulator.ts +++ b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/simulator.ts @@ -8,7 +8,7 @@ import getPort from 'get-port'; import http from 'http'; import httpProxy from 'http-proxy'; -import { getProxyPort } from '../../../../lib/get_proxy_server'; +import { getProxyPort } from '../../../lib/get_proxy_server'; import { getDataFromRequest } from './data_handler'; export interface ProxyArgs { diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/slack_simulation.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/slack_simulation.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/slack_simulation.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/slack_simulation.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/swimlane_simulation.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/swimlane_simulation.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/swimlane_simulation.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/swimlane_simulation.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/tines_simulation.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/tines_simulation.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/tines_simulation.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/tines_simulation.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/unsecured_actions_simulation.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/unsecured_actions_simulation.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/unsecured_actions_simulation.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/unsecured_actions_simulation.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/webhook_simulation.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/webhook_simulation.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/webhook_simulation.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/webhook_simulation.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/xmatters_simulation.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/xmatters_simulation.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/xmatters_simulation.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/xmatters_simulation.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/kibana.json b/x-pack/test/alerting_api_integration/common/plugins/alerts/kibana.json similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/kibana.json rename to x-pack/test/alerting_api_integration/common/plugins/alerts/kibana.json diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json b/x-pack/test/alerting_api_integration/common/plugins/alerts/package.json similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json rename to x-pack/test/alerting_api_integration/common/plugins/alerts/package.json diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/action_types.ts b/x-pack/test/alerting_api_integration/common/plugins/alerts/server/action_types.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/action_types.ts rename to x-pack/test/alerting_api_integration/common/plugins/alerts/server/action_types.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts b/x-pack/test/alerting_api_integration/common/plugins/alerts/server/alert_types.ts similarity index 99% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts rename to x-pack/test/alerting_api_integration/common/plugins/alerts/server/alert_types.ts index 1edcdaba548f6..a3739ca1c990b 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts +++ b/x-pack/test/alerting_api_integration/common/plugins/alerts/server/alert_types.ts @@ -19,7 +19,7 @@ import { } from '@kbn/alerting-plugin/server'; import { AlertConsumers } from '@kbn/rule-data-utils'; import { FixtureStartDeps, FixtureSetupDeps } from './plugin'; -import { ES_TEST_INDEX_NAME } from '../../../../lib'; +import { ES_TEST_INDEX_NAME } from '../../../lib'; export const EscapableStrings = { escapableBold: '*bold*', diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/index.ts b/x-pack/test/alerting_api_integration/common/plugins/alerts/server/index.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/index.ts rename to x-pack/test/alerting_api_integration/common/plugins/alerts/server/index.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/lib/retry_if_conflicts.ts b/x-pack/test/alerting_api_integration/common/plugins/alerts/server/lib/retry_if_conflicts.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/lib/retry_if_conflicts.ts rename to x-pack/test/alerting_api_integration/common/plugins/alerts/server/lib/retry_if_conflicts.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/plugin.ts b/x-pack/test/alerting_api_integration/common/plugins/alerts/server/plugin.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/plugin.ts rename to x-pack/test/alerting_api_integration/common/plugins/alerts/server/plugin.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/routes.ts b/x-pack/test/alerting_api_integration/common/plugins/alerts/server/routes.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/routes.ts rename to x-pack/test/alerting_api_integration/common/plugins/alerts/server/routes.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/sub_action_connector.ts b/x-pack/test/alerting_api_integration/common/plugins/alerts/server/sub_action_connector.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/sub_action_connector.ts rename to x-pack/test/alerting_api_integration/common/plugins/alerts/server/sub_action_connector.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/kibana.json b/x-pack/test/alerting_api_integration/common/plugins/alerts_restricted/kibana.json similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/kibana.json rename to x-pack/test/alerting_api_integration/common/plugins/alerts_restricted/kibana.json diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/package.json b/x-pack/test/alerting_api_integration/common/plugins/alerts_restricted/package.json similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/package.json rename to x-pack/test/alerting_api_integration/common/plugins/alerts_restricted/package.json diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/server/alert_types.ts b/x-pack/test/alerting_api_integration/common/plugins/alerts_restricted/server/alert_types.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/server/alert_types.ts rename to x-pack/test/alerting_api_integration/common/plugins/alerts_restricted/server/alert_types.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/server/index.ts b/x-pack/test/alerting_api_integration/common/plugins/alerts_restricted/server/index.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/server/index.ts rename to x-pack/test/alerting_api_integration/common/plugins/alerts_restricted/server/index.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/server/plugin.ts b/x-pack/test/alerting_api_integration/common/plugins/alerts_restricted/server/plugin.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/server/plugin.ts rename to x-pack/test/alerting_api_integration/common/plugins/alerts_restricted/server/plugin.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/kibana.json b/x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture/kibana.json similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/kibana.json rename to x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture/kibana.json diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json b/x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture/package.json similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json rename to x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture/package.json diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/server/index.ts b/x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture/server/index.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/server/index.ts rename to x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture/server/index.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/server/plugin.ts b/x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture/server/plugin.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/server/plugin.ts rename to x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture/server/plugin.ts diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/cases_webhook.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/cases_webhook.ts index 524ceaf5fd2c1..b89fa5bd03981 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/cases_webhook.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/cases_webhook.ts @@ -14,7 +14,7 @@ import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function casesWebhookTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/email.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/email.ts index b74214ab02f3f..dfed7ab6d1eee 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/email.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/email.ts @@ -11,7 +11,7 @@ import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { ExternalServiceSimulator, getExternalServiceSimulatorPath, -} from '../../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function emailTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/jira.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/jira.ts index 5a6e0967736a2..c4bad232e8ae2 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/jira.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/jira.ts @@ -14,7 +14,7 @@ import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function jiraTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/oauth_access_token.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/oauth_access_token.ts index 6053f78ea76a4..4a5bc0a35eaf5 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/oauth_access_token.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/oauth_access_token.ts @@ -15,7 +15,7 @@ import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; import { ExternalServiceSimulator, getExternalServiceSimulatorPath, -} from '../../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function oAuthAccessTokenTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/opsgenie.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/opsgenie.ts index 8a4b9e77c9c52..f4bcf83ef594a 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/opsgenie.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/opsgenie.ts @@ -11,7 +11,7 @@ import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { OpsgenieSimulator, opsgenieSuccessResponse, -} from '../../../../../common/fixtures/plugins/actions_simulators/server/opsgenie_simulation'; +} from '../../../../../common/plugins/actions_simulators/server/opsgenie_simulation'; // eslint-disable-next-line import/no-default-export export default function opsgenieTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/pagerduty.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/pagerduty.ts index 731eab7dad0f3..501fd1a7c241d 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/pagerduty.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/pagerduty.ts @@ -14,7 +14,7 @@ import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function pagerdutyTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/resilient.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/resilient.ts index fec22ab72e1ef..d5fa5cf0837b7 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/resilient.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/resilient.ts @@ -14,7 +14,7 @@ import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function resilientTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itom.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itom.ts index 0771e4e293726..c4657dfd35cd8 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itom.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itom.ts @@ -13,7 +13,7 @@ import http from 'http'; import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { getServiceNowServer } from '../../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +import { getServiceNowServer } from '../../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function serviceNowITOMTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itsm.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itsm.ts index 368e1b104a87e..fbd731ebb1e26 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itsm.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itsm.ts @@ -13,7 +13,7 @@ import http from 'http'; import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { getServiceNowServer } from '../../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +import { getServiceNowServer } from '../../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function serviceNowITSMTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_sir.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_sir.ts index f08ca542e4617..01ac361b457a8 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_sir.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_sir.ts @@ -13,7 +13,7 @@ import http from 'http'; import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { getServiceNowServer } from '../../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +import { getServiceNowServer } from '../../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function serviceNowSIRTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/slack.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/slack.ts index a05c622d8a1cf..70e833bf27e82 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/slack.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/slack.ts @@ -12,7 +12,7 @@ import getPort from 'get-port'; import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { getSlackServer } from '../../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +import { getSlackServer } from '../../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function slackTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/swimlane.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/swimlane.ts index 4119a409d7a4b..4b47ca1860527 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/swimlane.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/swimlane.ts @@ -12,7 +12,7 @@ import http from 'http'; import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { getSwimlaneServer } from '../../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +import { getSwimlaneServer } from '../../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function swimlaneTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/tines.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/tines.ts index e1657ac6fe4d7..e61bd475f0989 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/tines.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/tines.ts @@ -14,7 +14,7 @@ import { tinesStory2, tinesAgentWebhook, tinesWebhookSuccessResponse, -} from '../../../../../common/fixtures/plugins/actions_simulators/server/tines_simulation'; +} from '../../../../../common/plugins/actions_simulators/server/tines_simulation'; const connectorTypeId = '.tines'; const name = 'A tines action'; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/webhook.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/webhook.ts index c484dfad69539..84fd37bb71944 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/webhook.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/webhook.ts @@ -16,7 +16,7 @@ import { getExternalServiceSimulatorPath, ExternalServiceSimulator, getWebhookServer, -} from '../../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../../../common/plugins/actions_simulators/server/plugin'; const defaultValues: Record = { headers: null, diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/xmatters.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/xmatters.ts index e33597057cfe1..751726adfb248 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/xmatters.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/xmatters.ts @@ -14,7 +14,7 @@ import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function xmattersTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/sub_action_framework/index.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/sub_action_framework/index.ts index 97681837bf45e..8b79bd2227f8d 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/sub_action_framework/index.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/sub_action_framework/index.ts @@ -12,7 +12,7 @@ import { getUrlPrefix, ObjectRemover } from '../../../../../common/lib'; /** * The sub action connector is defined here - * x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/sub_action_connector.ts + * x-pack/test/alerting_api_integration/common/plugins/alerts/server/sub_action_connector.ts */ const createSubActionConnector = async ({ supertest, diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/mustache_templates.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/mustache_templates.ts index 2426c154aa443..f04ac5614f8a6 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/mustache_templates.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/mustache_templates.ts @@ -21,7 +21,7 @@ import expect from '@kbn/expect'; import { Spaces } from '../../../scenarios'; import { getUrlPrefix, getTestRuleData, ObjectRemover } from '../../../../common/lib'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; -import { getSlackServer } from '../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +import { getSlackServer } from '../../../../common/plugins/actions_simulators/server/plugin'; import { getHttpProxyServer } from '../../../../common/lib/get_proxy_server'; // eslint-disable-next-line import/no-default-export diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/actions/connector_types/stack/webhook.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/connector_types/stack/webhook.ts index ef5912dc0f8f3..7faf49c3ffe8e 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/actions/connector_types/stack/webhook.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/connector_types/stack/webhook.ts @@ -14,7 +14,7 @@ import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { getWebhookServer, getHttpsWebhookServer, -} from '../../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../../../common/plugins/actions_simulators/server/plugin'; import { createTlsWebhookServer } from '../../../../../common/lib/get_tls_webhook_servers'; // eslint-disable-next-line import/no-default-export diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/mustache_templates.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/mustache_templates.ts index ff596db062b75..64076aeafd14b 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/mustache_templates.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/mustache_templates.ts @@ -24,7 +24,7 @@ import { FtrProviderContext } from '../../../common/ftr_provider_context'; import { getWebhookServer, getSlackServer, -} from '../../../common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../common/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function executionStatusAlertTests({ getService }: FtrProviderContext) { @@ -80,7 +80,7 @@ export default function executionStatusAlertTests({ getService }: FtrProviderCon const createdAction = actionResponse.body; objectRemover.add(Spaces.space1.id, createdAction.id, 'connector', 'actions'); - // from x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts, + // from x-pack/test/alerting_api_integration/common/plugins/alerts/server/alert_types.ts, // const EscapableStrings const varsTemplate = '{{context.escapableDoubleQuote}} -- {{context.escapableLineFeed}}'; @@ -130,7 +130,7 @@ export default function executionStatusAlertTests({ getService }: FtrProviderCon const createdAction = actionResponse.body; objectRemover.add(Spaces.space1.id, createdAction.id, 'connector', 'actions'); - // from x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts, + // from x-pack/test/alerting_api_integration/common/plugins/alerts/server/alert_types.ts, // const EscapableStrings const varsTemplate = '{{context.escapableBacktic}} -- {{context.escapableBold}} -- {{context.escapableBackticBold}} -- {{context.escapableHtml}}'; @@ -181,7 +181,7 @@ export default function executionStatusAlertTests({ getService }: FtrProviderCon const createdAction = actionResponse.body; objectRemover.add(Spaces.space1.id, createdAction.id, 'connector', 'actions'); - // from x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts, + // from x-pack/test/alerting_api_integration/common/plugins/alerts/server/alert_types.ts, // const DeepContextVariables const varsTemplate = '{{context.deep}}'; diff --git a/x-pack/test/alerting_api_integration/spaces_only_legacy/tests/actions/connector_types/stack/webhook.ts b/x-pack/test/alerting_api_integration/spaces_only_legacy/tests/actions/connector_types/stack/webhook.ts index ef5912dc0f8f3..7faf49c3ffe8e 100644 --- a/x-pack/test/alerting_api_integration/spaces_only_legacy/tests/actions/connector_types/stack/webhook.ts +++ b/x-pack/test/alerting_api_integration/spaces_only_legacy/tests/actions/connector_types/stack/webhook.ts @@ -14,7 +14,7 @@ import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { getWebhookServer, getHttpsWebhookServer, -} from '../../../../../common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../../../common/plugins/actions_simulators/server/plugin'; import { createTlsWebhookServer } from '../../../../../common/lib/get_tls_webhook_servers'; // eslint-disable-next-line import/no-default-export diff --git a/x-pack/test/cases_api_integration/common/config.ts b/x-pack/test/cases_api_integration/common/config.ts index 535fcca87183f..f93b79f2e7546 100644 --- a/x-pack/test/cases_api_integration/common/config.ts +++ b/x-pack/test/cases_api_integration/common/config.ts @@ -11,7 +11,7 @@ import { FtrConfigProviderContext } from '@kbn/test'; import path from 'path'; import fs from 'fs'; import { services } from './services'; -import { getAllExternalServiceSimulatorPaths } from '../../alerting_api_integration/common/fixtures/plugins/actions_simulators/server/plugin'; +import { getAllExternalServiceSimulatorPaths } from '../../alerting_api_integration/common/plugins/actions_simulators/server/plugin'; interface CreateTestConfigOptions { license: string; @@ -58,41 +58,22 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) }, }; - // Find all folders in ./fixtures/plugins - const allFiles = fs.readdirSync(path.resolve(__dirname, 'fixtures', 'plugins')); - const plugins = allFiles.filter((file) => - fs.statSync(path.resolve(__dirname, 'fixtures', 'plugins', file)).isDirectory() - ); + // Find all folders in ./plugins since we treat all them as plugin folder + const pluginDir = path.resolve(__dirname, 'plugins'); + const pluginPaths = fs + .readdirSync(pluginDir) + .map((n) => path.resolve(pluginDir, n)) + .filter((p) => fs.statSync(p)); // This is needed so that we can correctly use the alerting test frameworks mock implementation for the connectors. - const alertingAllFiles = fs.readdirSync( - path.resolve( - __dirname, - '..', - '..', - 'alerting_api_integration', - 'common', - 'fixtures', - 'plugins' - ) - ); - - const alertingPlugins = alertingAllFiles.filter((file) => - fs - .statSync( - path.resolve( - __dirname, - '..', - '..', - 'alerting_api_integration', - 'common', - 'fixtures', - 'plugins', - file - ) - ) - .isDirectory() + const alertingPluginDir = path.resolve( + __dirname, + '../../alerting_api_integration/common/plugins' ); + const alertingPluginsPaths = fs + .readdirSync(alertingPluginDir) + .map((n) => path.resolve(alertingPluginDir, n)) + .filter((p) => fs.statSync(p)); return { testFiles, @@ -123,24 +104,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) ...disabledPlugins .filter((k) => k !== 'security') .map((key) => `--xpack.${key}.enabled=false`), - // Actions simulators plugin. Needed for testing push to external services. - ...alertingPlugins.map( - (pluginDir) => - `--plugin-path=${path.resolve( - __dirname, - '..', - '..', - 'alerting_api_integration', - 'common', - 'fixtures', - 'plugins', - pluginDir - )}` - ), - ...plugins.map( - (pluginDir) => - `--plugin-path=${path.resolve(__dirname, 'fixtures', 'plugins', pluginDir)}` - ), + ...pluginPaths.concat(alertingPluginsPaths).map((p) => `--plugin-path=${p}`), `--xpack.actions.preconfigured=${JSON.stringify({ 'preconfigured-servicenow': { name: 'preconfigured-servicenow', diff --git a/x-pack/test/cases_api_integration/common/lib/utils.ts b/x-pack/test/cases_api_integration/common/lib/utils.ts index d4934eb4e4d66..1af320a5d5c97 100644 --- a/x-pack/test/cases_api_integration/common/lib/utils.ts +++ b/x-pack/test/cases_api_integration/common/lib/utils.ts @@ -65,8 +65,8 @@ import { User } from './authentication/types'; import { superUser } from './authentication/users'; import { getPostCaseRequest, postCaseReq } from './mock'; import { ObjectRemover as ActionsRemover } from '../../../alerting_api_integration/common/lib'; -import { getServiceNowServer } from '../../../alerting_api_integration/common/fixtures/plugins/actions_simulators/server/plugin'; -import { RecordingServiceNowSimulator } from '../../../alerting_api_integration/common/fixtures/plugins/actions_simulators/server/servicenow_simulation'; +import { getServiceNowServer } from '../../../alerting_api_integration/common/plugins/actions_simulators/server/plugin'; +import { RecordingServiceNowSimulator } from '../../../alerting_api_integration/common/plugins/actions_simulators/server/servicenow_simulation'; function toArray(input: T | T[]): T[] { if (Array.isArray(input)) { diff --git a/x-pack/test/cases_api_integration/common/fixtures/plugins/cases/kibana.json b/x-pack/test/cases_api_integration/common/plugins/cases/kibana.json similarity index 100% rename from x-pack/test/cases_api_integration/common/fixtures/plugins/cases/kibana.json rename to x-pack/test/cases_api_integration/common/plugins/cases/kibana.json diff --git a/x-pack/test/cases_api_integration/common/fixtures/plugins/cases/package.json b/x-pack/test/cases_api_integration/common/plugins/cases/package.json similarity index 100% rename from x-pack/test/cases_api_integration/common/fixtures/plugins/cases/package.json rename to x-pack/test/cases_api_integration/common/plugins/cases/package.json diff --git a/x-pack/test/cases_api_integration/common/fixtures/plugins/cases/server/attachments/external_reference.ts b/x-pack/test/cases_api_integration/common/plugins/cases/server/attachments/external_reference.ts similarity index 100% rename from x-pack/test/cases_api_integration/common/fixtures/plugins/cases/server/attachments/external_reference.ts rename to x-pack/test/cases_api_integration/common/plugins/cases/server/attachments/external_reference.ts diff --git a/x-pack/test/cases_api_integration/common/fixtures/plugins/cases/server/attachments/persistable_state.ts b/x-pack/test/cases_api_integration/common/plugins/cases/server/attachments/persistable_state.ts similarity index 100% rename from x-pack/test/cases_api_integration/common/fixtures/plugins/cases/server/attachments/persistable_state.ts rename to x-pack/test/cases_api_integration/common/plugins/cases/server/attachments/persistable_state.ts diff --git a/x-pack/test/cases_api_integration/common/fixtures/plugins/cases/server/index.ts b/x-pack/test/cases_api_integration/common/plugins/cases/server/index.ts similarity index 100% rename from x-pack/test/cases_api_integration/common/fixtures/plugins/cases/server/index.ts rename to x-pack/test/cases_api_integration/common/plugins/cases/server/index.ts diff --git a/x-pack/test/cases_api_integration/common/fixtures/plugins/cases/server/plugin.ts b/x-pack/test/cases_api_integration/common/plugins/cases/server/plugin.ts similarity index 100% rename from x-pack/test/cases_api_integration/common/fixtures/plugins/cases/server/plugin.ts rename to x-pack/test/cases_api_integration/common/plugins/cases/server/plugin.ts diff --git a/x-pack/test/cases_api_integration/common/fixtures/plugins/observability/kibana.json b/x-pack/test/cases_api_integration/common/plugins/observability/kibana.json similarity index 100% rename from x-pack/test/cases_api_integration/common/fixtures/plugins/observability/kibana.json rename to x-pack/test/cases_api_integration/common/plugins/observability/kibana.json diff --git a/x-pack/test/cases_api_integration/common/fixtures/plugins/observability/package.json b/x-pack/test/cases_api_integration/common/plugins/observability/package.json similarity index 100% rename from x-pack/test/cases_api_integration/common/fixtures/plugins/observability/package.json rename to x-pack/test/cases_api_integration/common/plugins/observability/package.json diff --git a/x-pack/test/cases_api_integration/common/fixtures/plugins/observability/server/index.ts b/x-pack/test/cases_api_integration/common/plugins/observability/server/index.ts similarity index 100% rename from x-pack/test/cases_api_integration/common/fixtures/plugins/observability/server/index.ts rename to x-pack/test/cases_api_integration/common/plugins/observability/server/index.ts diff --git a/x-pack/test/cases_api_integration/common/fixtures/plugins/observability/server/plugin.ts b/x-pack/test/cases_api_integration/common/plugins/observability/server/plugin.ts similarity index 100% rename from x-pack/test/cases_api_integration/common/fixtures/plugins/observability/server/plugin.ts rename to x-pack/test/cases_api_integration/common/plugins/observability/server/plugin.ts diff --git a/x-pack/test/cases_api_integration/common/fixtures/plugins/security_solution/kibana.json b/x-pack/test/cases_api_integration/common/plugins/security_solution/kibana.json similarity index 100% rename from x-pack/test/cases_api_integration/common/fixtures/plugins/security_solution/kibana.json rename to x-pack/test/cases_api_integration/common/plugins/security_solution/kibana.json diff --git a/x-pack/test/cases_api_integration/common/fixtures/plugins/security_solution/package.json b/x-pack/test/cases_api_integration/common/plugins/security_solution/package.json similarity index 100% rename from x-pack/test/cases_api_integration/common/fixtures/plugins/security_solution/package.json rename to x-pack/test/cases_api_integration/common/plugins/security_solution/package.json diff --git a/x-pack/test/cases_api_integration/common/fixtures/plugins/security_solution/server/index.ts b/x-pack/test/cases_api_integration/common/plugins/security_solution/server/index.ts similarity index 100% rename from x-pack/test/cases_api_integration/common/fixtures/plugins/security_solution/server/index.ts rename to x-pack/test/cases_api_integration/common/plugins/security_solution/server/index.ts diff --git a/x-pack/test/cases_api_integration/common/fixtures/plugins/security_solution/server/plugin.ts b/x-pack/test/cases_api_integration/common/plugins/security_solution/server/plugin.ts similarity index 100% rename from x-pack/test/cases_api_integration/common/fixtures/plugins/security_solution/server/plugin.ts rename to x-pack/test/cases_api_integration/common/plugins/security_solution/server/plugin.ts diff --git a/x-pack/test/cases_api_integration/security_and_spaces/tests/common/attachments_framework/external_references.ts b/x-pack/test/cases_api_integration/security_and_spaces/tests/common/attachments_framework/external_references.ts index 9490504e09d00..48f050cd96016 100644 --- a/x-pack/test/cases_api_integration/security_and_spaces/tests/common/attachments_framework/external_references.ts +++ b/x-pack/test/cases_api_integration/security_and_spaces/tests/common/attachments_framework/external_references.ts @@ -40,7 +40,7 @@ export default ({ getService }: FtrProviderContext): void => { /** * Attachment types are being registered in - * x-pack/test/cases_api_integration/common/fixtures/plugins/cases/server/plugin.ts + * x-pack/test/cases_api_integration/common/plugins/cases/server/plugin.ts */ describe('External references', () => { afterEach(async () => { diff --git a/x-pack/test/cases_api_integration/security_and_spaces/tests/common/attachments_framework/persistable_state.ts b/x-pack/test/cases_api_integration/security_and_spaces/tests/common/attachments_framework/persistable_state.ts index ce2cffac13cb3..e1c5ff7216051 100644 --- a/x-pack/test/cases_api_integration/security_and_spaces/tests/common/attachments_framework/persistable_state.ts +++ b/x-pack/test/cases_api_integration/security_and_spaces/tests/common/attachments_framework/persistable_state.ts @@ -41,7 +41,7 @@ export default ({ getService }: FtrProviderContext): void => { /** * Attachment types are being registered in - * x-pack/test/cases_api_integration/common/fixtures/plugins/cases/server/plugin.ts + * x-pack/test/cases_api_integration/common/plugins/cases/server/plugin.ts */ describe('Persistable state attachments', () => { describe('references', () => { diff --git a/x-pack/test/cases_api_integration/security_and_spaces/tests/no_public_base_url/push.ts b/x-pack/test/cases_api_integration/security_and_spaces/tests/no_public_base_url/push.ts index 0f3e521988c55..fe039eed5a023 100644 --- a/x-pack/test/cases_api_integration/security_and_spaces/tests/no_public_base_url/push.ts +++ b/x-pack/test/cases_api_integration/security_and_spaces/tests/no_public_base_url/push.ts @@ -25,7 +25,7 @@ import { getRecordingServiceNowSimulatorServer, bulkCreateAttachments, } from '../../../common/lib/utils'; -import { RecordingServiceNowSimulator } from '../../../../alerting_api_integration/common/fixtures/plugins/actions_simulators/server/servicenow_simulation'; +import { RecordingServiceNowSimulator } from '../../../../alerting_api_integration/common/plugins/actions_simulators/server/servicenow_simulation'; // eslint-disable-next-line import/no-default-export export default ({ getService }: FtrProviderContext): void => { diff --git a/x-pack/test/cases_api_integration/security_and_spaces/tests/trial/cases/push_case.ts b/x-pack/test/cases_api_integration/security_and_spaces/tests/trial/cases/push_case.ts index 4b330386fbdd1..e1051a3b5de12 100644 --- a/x-pack/test/cases_api_integration/security_and_spaces/tests/trial/cases/push_case.ts +++ b/x-pack/test/cases_api_integration/security_and_spaces/tests/trial/cases/push_case.ts @@ -57,7 +57,7 @@ import { secOnlyRead, superUser, } from '../../../../common/lib/authentication/users'; -import { RecordingServiceNowSimulator } from '../../../../../alerting_api_integration/common/fixtures/plugins/actions_simulators/server/servicenow_simulation'; +import { RecordingServiceNowSimulator } from '../../../../../alerting_api_integration/common/plugins/actions_simulators/server/servicenow_simulation'; import { loginUsers, setupSuperUserProfile } from '../../../../common/lib/user_profiles'; // eslint-disable-next-line import/no-default-export diff --git a/x-pack/test/functional_execution_context/config.ts b/x-pack/test/functional_execution_context/config.ts index 767ae9d18d7d3..a31cbb4ba4e34 100644 --- a/x-pack/test/functional_execution_context/config.ts +++ b/x-pack/test/functional_execution_context/config.ts @@ -9,7 +9,7 @@ import { CA_CERT_PATH } from '@kbn/dev-utils'; import { FtrConfigProviderContext, getKibanaCliLoggers } from '@kbn/test'; import { logFilePath } from './test_utils'; -const alertTestPlugin = Path.resolve(__dirname, './fixtures/plugins/alerts'); +const alertTestPlugin = Path.resolve(__dirname, './plugins/alerts'); export default async function ({ readConfigFile }: FtrConfigProviderContext) { const functionalConfig = await readConfigFile(require.resolve('../functional/config.base.js')); diff --git a/x-pack/test/functional_execution_context/fixtures/plugins/alerts/kibana.json b/x-pack/test/functional_execution_context/plugins/alerts/kibana.json similarity index 100% rename from x-pack/test/functional_execution_context/fixtures/plugins/alerts/kibana.json rename to x-pack/test/functional_execution_context/plugins/alerts/kibana.json diff --git a/x-pack/test/functional_execution_context/fixtures/plugins/alerts/package.json b/x-pack/test/functional_execution_context/plugins/alerts/package.json similarity index 100% rename from x-pack/test/functional_execution_context/fixtures/plugins/alerts/package.json rename to x-pack/test/functional_execution_context/plugins/alerts/package.json diff --git a/x-pack/test/functional_execution_context/fixtures/plugins/alerts/server/ensure_apm_started.ts b/x-pack/test/functional_execution_context/plugins/alerts/server/ensure_apm_started.ts similarity index 82% rename from x-pack/test/functional_execution_context/fixtures/plugins/alerts/server/ensure_apm_started.ts rename to x-pack/test/functional_execution_context/plugins/alerts/server/ensure_apm_started.ts index d0e989f662cff..69e54df56ef94 100644 --- a/x-pack/test/functional_execution_context/fixtures/plugins/alerts/server/ensure_apm_started.ts +++ b/x-pack/test/functional_execution_context/plugins/alerts/server/ensure_apm_started.ts @@ -6,7 +6,6 @@ */ import apmAgent from 'elastic-apm-node'; import { initApm } from '@kbn/apm-config-loader'; -// @ts-expect-error we have to check types with "allowJs: false" for now, causing this import to fail import { REPO_ROOT } from '@kbn/repo-info'; if (!apmAgent.isStarted()) { diff --git a/x-pack/test/functional_execution_context/fixtures/plugins/alerts/server/index.ts b/x-pack/test/functional_execution_context/plugins/alerts/server/index.ts similarity index 100% rename from x-pack/test/functional_execution_context/fixtures/plugins/alerts/server/index.ts rename to x-pack/test/functional_execution_context/plugins/alerts/server/index.ts diff --git a/x-pack/test/functional_execution_context/fixtures/plugins/alerts/server/plugin.ts b/x-pack/test/functional_execution_context/plugins/alerts/server/plugin.ts similarity index 100% rename from x-pack/test/functional_execution_context/fixtures/plugins/alerts/server/plugin.ts rename to x-pack/test/functional_execution_context/plugins/alerts/server/plugin.ts diff --git a/x-pack/test/functional_execution_context/plugins/alerts/tsconfig.json b/x-pack/test/functional_execution_context/plugins/alerts/tsconfig.json new file mode 100644 index 0000000000000..b8e7b9c2d2e80 --- /dev/null +++ b/x-pack/test/functional_execution_context/plugins/alerts/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/apm-config-loader", + "@kbn/repo-info", + "@kbn/core", + "@kbn/alerting-plugin", + "@kbn/encrypted-saved-objects-plugin", + "@kbn/features-plugin", + "@kbn/spaces-plugin", + "@kbn/security-plugin", + ] +} diff --git a/x-pack/test/functional_with_es_ssl/apps/cases/attachment_framework.ts b/x-pack/test/functional_with_es_ssl/apps/cases/attachment_framework.ts index 2d16926b47660..193b305d707ad 100644 --- a/x-pack/test/functional_with_es_ssl/apps/cases/attachment_framework.ts +++ b/x-pack/test/functional_with_es_ssl/apps/cases/attachment_framework.ts @@ -80,7 +80,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => { /** * Attachment types are being registered in - * x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/plugin.ts + * x-pack/test/functional_with_es_ssl/plugins/cases/public/plugin.ts */ describe('Attachment framework', () => { describe('External reference attachments', () => { @@ -213,7 +213,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => { }); /** - * The UI of the cases fixture plugin is in x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/application.tsx + * The UI of the cases fixture plugin is in x-pack/test/functional_with_es_ssl/plugins/cases/public/application.tsx */ describe('Attachment hooks', () => { const TOTAL_OWNERS = ['cases', 'securitySolution', 'observability']; diff --git a/x-pack/test/functional_with_es_ssl/apps/cases/upgrade.ts b/x-pack/test/functional_with_es_ssl/apps/cases/upgrade.ts index c1e2979d313bb..6186d949905e7 100644 --- a/x-pack/test/functional_with_es_ssl/apps/cases/upgrade.ts +++ b/x-pack/test/functional_with_es_ssl/apps/cases/upgrade.ts @@ -9,7 +9,7 @@ import expect from '@kbn/expect'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../alerting_api_integration/common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../alerting_api_integration/common/plugins/actions_simulators/server/plugin'; import { FtrProviderContext } from '../../ftr_provider_context'; export default ({ getPageObject, getService }: FtrProviderContext) => { diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/connectors/tines.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/connectors/tines.ts index c6e9f4aec0fc1..bbef8273bc1f6 100644 --- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/connectors/tines.ts +++ b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/connectors/tines.ts @@ -13,11 +13,11 @@ import { getConnectorByName } from './utils'; import { tinesAgentWebhook, tinesStory1, -} from '../../../../alerting_api_integration/common/fixtures/plugins/actions_simulators/server/tines_simulation'; +} from '../../../../alerting_api_integration/common/plugins/actions_simulators/server/tines_simulation'; import { ExternalServiceSimulator, getExternalServiceSimulatorPath, -} from '../../../../alerting_api_integration/common/fixtures/plugins/actions_simulators/server/plugin'; +} from '../../../../alerting_api_integration/common/plugins/actions_simulators/server/plugin'; export default ({ getPageObjects, getService }: FtrProviderContext) => { const testSubjects = getService('testSubjects'); diff --git a/x-pack/test/functional_with_es_ssl/config.ts b/x-pack/test/functional_with_es_ssl/config.ts index 6ca556876d0e7..92d96a7a4ced5 100644 --- a/x-pack/test/functional_with_es_ssl/config.ts +++ b/x-pack/test/functional_with_es_ssl/config.ts @@ -10,7 +10,7 @@ import { resolve, join } from 'path'; import { CA_CERT_PATH } from '@kbn/dev-utils'; import { FtrConfigProviderContext } from '@kbn/test'; import { pageObjects } from './page_objects'; -import { getAllExternalServiceSimulatorPaths } from '../alerting_api_integration/common/fixtures/plugins/actions_simulators/server/plugin'; +import { getAllExternalServiceSimulatorPaths } from '../alerting_api_integration/common/plugins/actions_simulators/server/plugin'; // .server-log is specifically not enabled const enabledActionTypes = [ @@ -78,16 +78,11 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { ...xpackFunctionalConfig.get('kbnTestServer.serverArgs'), `--elasticsearch.hosts=https://${servers.elasticsearch.hostname}:${servers.elasticsearch.port}`, `--elasticsearch.ssl.certificateAuthorities=${CA_CERT_PATH}`, - `--plugin-path=${join(__dirname, 'fixtures', 'plugins', 'alerts')}`, - `--plugin-path=${join(__dirname, 'fixtures', 'plugins', 'cases')}`, + `--plugin-path=${join(__dirname, 'plugins/alerts')}`, + `--plugin-path=${join(__dirname, 'plugins/cases')}`, `--plugin-path=${join( __dirname, - '..', - 'alerting_api_integration', - 'common', - 'fixtures', - 'plugins', - 'actions_simulators' + '../alerting_api_integration/common/plugins/actions_simulators' )}`, `--xpack.trigger_actions_ui.enableExperimental=${JSON.stringify([ 'internalAlertsTable', diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/kibana.json b/x-pack/test/functional_with_es_ssl/plugins/alerts/kibana.json similarity index 100% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/kibana.json rename to x-pack/test/functional_with_es_ssl/plugins/alerts/kibana.json diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/package.json b/x-pack/test/functional_with_es_ssl/plugins/alerts/package.json similarity index 76% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/package.json rename to x-pack/test/functional_with_es_ssl/plugins/alerts/package.json index b439938c01204..cf8da32ab8c69 100644 --- a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/package.json +++ b/x-pack/test/functional_with_es_ssl/plugins/alerts/package.json @@ -4,7 +4,7 @@ "kibana": { "version": "kibana" }, - "main": "target/test/functional_with_es_ssl/fixtures/plugins/alerts", + "main": "target/test/functional_with_es_ssl/plugins/alerts", "scripts": { "kbn": "node ../../../../../../scripts/kbn.js", "build": "rm -rf './target' && ../../../../../../node_modules/.bin/tsc" diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/public/application.tsx b/x-pack/test/functional_with_es_ssl/plugins/alerts/public/application.tsx similarity index 100% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/public/application.tsx rename to x-pack/test/functional_with_es_ssl/plugins/alerts/public/application.tsx diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/public/index.ts b/x-pack/test/functional_with_es_ssl/plugins/alerts/public/index.ts similarity index 100% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/public/index.ts rename to x-pack/test/functional_with_es_ssl/plugins/alerts/public/index.ts diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/public/plugin.ts b/x-pack/test/functional_with_es_ssl/plugins/alerts/public/plugin.ts similarity index 100% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/public/plugin.ts rename to x-pack/test/functional_with_es_ssl/plugins/alerts/public/plugin.ts diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/server/index.ts b/x-pack/test/functional_with_es_ssl/plugins/alerts/server/index.ts similarity index 100% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/server/index.ts rename to x-pack/test/functional_with_es_ssl/plugins/alerts/server/index.ts diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/server/plugin.ts b/x-pack/test/functional_with_es_ssl/plugins/alerts/server/plugin.ts similarity index 100% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/server/plugin.ts rename to x-pack/test/functional_with_es_ssl/plugins/alerts/server/plugin.ts diff --git a/x-pack/test/functional_with_es_ssl/plugins/alerts/tsconfig.json b/x-pack/test/functional_with_es_ssl/plugins/alerts/tsconfig.json new file mode 100644 index 0000000000000..629e7fe41b762 --- /dev/null +++ b/x-pack/test/functional_with_es_ssl/plugins/alerts/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/core", + "@kbn/features-plugin", + "@kbn/alerting-plugin", + "@kbn/triggers-actions-ui-plugin", + ] +} diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/kibana.json b/x-pack/test/functional_with_es_ssl/plugins/cases/kibana.json similarity index 100% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/kibana.json rename to x-pack/test/functional_with_es_ssl/plugins/cases/kibana.json diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/package.json b/x-pack/test/functional_with_es_ssl/plugins/cases/package.json similarity index 77% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/package.json rename to x-pack/test/functional_with_es_ssl/plugins/cases/package.json index ce48f2735277c..c5e2cae923615 100644 --- a/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/package.json +++ b/x-pack/test/functional_with_es_ssl/plugins/cases/package.json @@ -4,7 +4,7 @@ "kibana": { "version": "kibana" }, - "main": "target/test/functional_with_es_ssl/fixtures/plugins/cases", + "main": "target/test/functional_with_es_ssl/plugins/cases", "scripts": { "kbn": "node ../../../../../../scripts/kbn.js", "build": "rm -rf './target' && ../../../../../../node_modules/.bin/tsc" diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/application.tsx b/x-pack/test/functional_with_es_ssl/plugins/cases/public/application.tsx similarity index 100% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/application.tsx rename to x-pack/test/functional_with_es_ssl/plugins/cases/public/application.tsx diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/attachments/external_reference.tsx b/x-pack/test/functional_with_es_ssl/plugins/cases/public/attachments/external_reference.tsx similarity index 100% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/attachments/external_reference.tsx rename to x-pack/test/functional_with_es_ssl/plugins/cases/public/attachments/external_reference.tsx diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/attachments/external_references_content.tsx b/x-pack/test/functional_with_es_ssl/plugins/cases/public/attachments/external_references_content.tsx similarity index 100% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/attachments/external_references_content.tsx rename to x-pack/test/functional_with_es_ssl/plugins/cases/public/attachments/external_references_content.tsx diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/attachments/persistable_state.tsx b/x-pack/test/functional_with_es_ssl/plugins/cases/public/attachments/persistable_state.tsx similarity index 100% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/attachments/persistable_state.tsx rename to x-pack/test/functional_with_es_ssl/plugins/cases/public/attachments/persistable_state.tsx diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/index.ts b/x-pack/test/functional_with_es_ssl/plugins/cases/public/index.ts similarity index 100% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/index.ts rename to x-pack/test/functional_with_es_ssl/plugins/cases/public/index.ts diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/plugin.ts b/x-pack/test/functional_with_es_ssl/plugins/cases/public/plugin.ts similarity index 100% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/plugin.ts rename to x-pack/test/functional_with_es_ssl/plugins/cases/public/plugin.ts diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/server/attachments/external_reference.ts b/x-pack/test/functional_with_es_ssl/plugins/cases/server/attachments/external_reference.ts similarity index 100% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/server/attachments/external_reference.ts rename to x-pack/test/functional_with_es_ssl/plugins/cases/server/attachments/external_reference.ts diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/server/attachments/persistable_state.ts b/x-pack/test/functional_with_es_ssl/plugins/cases/server/attachments/persistable_state.ts similarity index 100% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/server/attachments/persistable_state.ts rename to x-pack/test/functional_with_es_ssl/plugins/cases/server/attachments/persistable_state.ts diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/server/index.ts b/x-pack/test/functional_with_es_ssl/plugins/cases/server/index.ts similarity index 100% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/server/index.ts rename to x-pack/test/functional_with_es_ssl/plugins/cases/server/index.ts diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/server/plugin.ts b/x-pack/test/functional_with_es_ssl/plugins/cases/server/plugin.ts similarity index 100% rename from x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/server/plugin.ts rename to x-pack/test/functional_with_es_ssl/plugins/cases/server/plugin.ts diff --git a/x-pack/test/functional_with_es_ssl/plugins/cases/tsconfig.json b/x-pack/test/functional_with_es_ssl/plugins/cases/tsconfig.json new file mode 100644 index 0000000000000..5f9daf4c7157f --- /dev/null +++ b/x-pack/test/functional_with_es_ssl/plugins/cases/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/core", + "@kbn/cases-plugin", + "@kbn/lens-plugin", + "@kbn/kibana-react-plugin", + "@kbn/i18n-react", + ] +} diff --git a/x-pack/test/lists_api_integration/common/config.ts b/x-pack/test/lists_api_integration/common/config.ts index 214f03b632658..7903e1d261967 100644 --- a/x-pack/test/lists_api_integration/common/config.ts +++ b/x-pack/test/lists_api_integration/common/config.ts @@ -54,10 +54,10 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) ...disabledPlugins .filter((k) => k !== 'security') .map((key) => `--xpack.${key}.enabled=false`), - `--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'alerts')}`, - `--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'actions')}`, - `--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'task_manager')}`, - `--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'aad')}`, + `--plugin-path=${path.join(__dirname, 'plugins/alerts')}`, + `--plugin-path=${path.join(__dirname, 'plugins/actions')}`, + `--plugin-path=${path.join(__dirname, 'plugins/task_manager')}`, + `--plugin-path=${path.join(__dirname, 'plugins/aad')}`, ...(ssl ? [ `--elasticsearch.hosts=${servers.elasticsearch.protocol}://${servers.elasticsearch.hostname}:${servers.elasticsearch.port}`, diff --git a/x-pack/test/rule_registry/common/config.ts b/x-pack/test/rule_registry/common/config.ts index d6ad262ca2c62..ffd35b2cde829 100644 --- a/x-pack/test/rule_registry/common/config.ts +++ b/x-pack/test/rule_registry/common/config.ts @@ -9,7 +9,7 @@ import { CA_CERT_PATH } from '@kbn/dev-utils'; import { FtrConfigProviderContext } from '@kbn/test'; import { services } from './services'; -import { getAllExternalServiceSimulatorPaths } from '../../alerting_api_integration/common/fixtures/plugins/actions_simulators/server/plugin'; +import { getAllExternalServiceSimulatorPaths } from '../../alerting_api_integration/common/plugins/actions_simulators/server/plugin'; interface CreateTestConfigOptions { license: string; diff --git a/x-pack/test/saved_object_api_integration/common/config.ts b/x-pack/test/saved_object_api_integration/common/config.ts index 5878134050027..59832a5249b72 100644 --- a/x-pack/test/saved_object_api_integration/common/config.ts +++ b/x-pack/test/saved_object_api_integration/common/config.ts @@ -56,7 +56,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) serverArgs: [ ...config.xpack.api.get('kbnTestServer.serverArgs'), '--server.xsrf.disableProtection=true', - `--plugin-path=${path.join(__dirname, 'fixtures', 'saved_object_test_plugin')}`, + `--plugin-path=${path.resolve(__dirname, 'plugins/saved_object_test_plugin')}`, ...disabledPlugins .filter((k) => k !== 'security') .map((key) => `--xpack.${key}.enabled=false`), diff --git a/x-pack/test/saved_object_api_integration/common/fixtures/saved_object_test_plugin/kibana.json b/x-pack/test/saved_object_api_integration/common/plugins/saved_object_test_plugin/kibana.json similarity index 100% rename from x-pack/test/saved_object_api_integration/common/fixtures/saved_object_test_plugin/kibana.json rename to x-pack/test/saved_object_api_integration/common/plugins/saved_object_test_plugin/kibana.json diff --git a/x-pack/test/saved_object_api_integration/common/fixtures/saved_object_test_plugin/server/index.ts b/x-pack/test/saved_object_api_integration/common/plugins/saved_object_test_plugin/server/index.ts similarity index 100% rename from x-pack/test/saved_object_api_integration/common/fixtures/saved_object_test_plugin/server/index.ts rename to x-pack/test/saved_object_api_integration/common/plugins/saved_object_test_plugin/server/index.ts diff --git a/x-pack/test/saved_object_api_integration/common/fixtures/saved_object_test_plugin/server/plugin.ts b/x-pack/test/saved_object_api_integration/common/plugins/saved_object_test_plugin/server/plugin.ts similarity index 100% rename from x-pack/test/saved_object_api_integration/common/fixtures/saved_object_test_plugin/server/plugin.ts rename to x-pack/test/saved_object_api_integration/common/plugins/saved_object_test_plugin/server/plugin.ts diff --git a/x-pack/test/security_api_integration/audit.config.ts b/x-pack/test/security_api_integration/audit.config.ts index 02b3870c18f89..052f241470bee 100644 --- a/x-pack/test/security_api_integration/audit.config.ts +++ b/x-pack/test/security_api_integration/audit.config.ts @@ -11,8 +11,8 @@ import { FtrConfigProviderContext } from '@kbn/test'; export default async function ({ readConfigFile }: FtrConfigProviderContext) { const xPackAPITestsConfig = await readConfigFile(require.resolve('../api_integration/config.ts')); - const auditLogPlugin = resolve(__dirname, './fixtures/audit/audit_log'); - const auditLogPath = resolve(__dirname, './fixtures/audit/audit.log'); + const auditLogPlugin = resolve(__dirname, './plugins/audit_log'); + const auditLogPath = resolve(__dirname, './plugins/audit_log/audit.log'); return { testFiles: [require.resolve('./tests/audit')], diff --git a/x-pack/test/security_api_integration/kerberos.config.ts b/x-pack/test/security_api_integration/kerberos.config.ts index 3e2bbf769103d..c91fa31270799 100644 --- a/x-pack/test/security_api_integration/kerberos.config.ts +++ b/x-pack/test/security_api_integration/kerberos.config.ts @@ -15,10 +15,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { const kerberosKeytabPath = resolve(__dirname, './fixtures/kerberos/krb5.keytab'); const kerberosConfigPath = resolve(__dirname, './fixtures/kerberos/krb5.conf'); - const testEndpointsPlugin = resolve( - __dirname, - '../security_functional/fixtures/common/test_endpoints' - ); + const testEndpointsPlugin = resolve(__dirname, '../security_functional/plugins/test_endpoints'); const auditLogPath = resolve(__dirname, './fixtures/audit/kerberos.log'); diff --git a/x-pack/test/security_api_integration/oidc.config.ts b/x-pack/test/security_api_integration/oidc.config.ts index 82d1608543ebf..5f1d701cf01fe 100644 --- a/x-pack/test/security_api_integration/oidc.config.ts +++ b/x-pack/test/security_api_integration/oidc.config.ts @@ -15,10 +15,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { const kibanaPort = xPackAPITestsConfig.get('servers.kibana.port'); const jwksPath = resolve(__dirname, './fixtures/oidc/jwks.json'); - const testEndpointsPlugin = resolve( - __dirname, - '../security_functional/fixtures/common/test_endpoints' - ); + const testEndpointsPlugin = resolve(__dirname, '../security_functional/plugins/test_endpoints'); const auditLogPath = resolve(__dirname, './fixtures/audit/oidc.log'); diff --git a/x-pack/test/security_api_integration/pki.config.ts b/x-pack/test/security_api_integration/pki.config.ts index dae79f8c5fa00..2cefefd9425ba 100644 --- a/x-pack/test/security_api_integration/pki.config.ts +++ b/x-pack/test/security_api_integration/pki.config.ts @@ -13,10 +13,7 @@ import { services } from './services'; export default async function ({ readConfigFile }: FtrConfigProviderContext) { const xPackAPITestsConfig = await readConfigFile(require.resolve('../api_integration/config.ts')); - const testEndpointsPlugin = resolve( - __dirname, - '../security_functional/fixtures/common/test_endpoints' - ); + const testEndpointsPlugin = resolve(__dirname, '../security_functional/plugins/test_endpoints'); const servers = { ...xPackAPITestsConfig.get('servers'), diff --git a/x-pack/test/security_api_integration/fixtures/audit/audit_log/kibana.json b/x-pack/test/security_api_integration/plugins/audit_log/kibana.json similarity index 100% rename from x-pack/test/security_api_integration/fixtures/audit/audit_log/kibana.json rename to x-pack/test/security_api_integration/plugins/audit_log/kibana.json diff --git a/x-pack/test/security_api_integration/fixtures/audit/audit_log/server/index.ts b/x-pack/test/security_api_integration/plugins/audit_log/server/index.ts similarity index 100% rename from x-pack/test/security_api_integration/fixtures/audit/audit_log/server/index.ts rename to x-pack/test/security_api_integration/plugins/audit_log/server/index.ts diff --git a/x-pack/test/security_api_integration/fixtures/audit/audit_log/server/plugin.ts b/x-pack/test/security_api_integration/plugins/audit_log/server/plugin.ts similarity index 100% rename from x-pack/test/security_api_integration/fixtures/audit/audit_log/server/plugin.ts rename to x-pack/test/security_api_integration/plugins/audit_log/server/plugin.ts diff --git a/x-pack/test/security_api_integration/plugins/audit_log/tsconfig.json b/x-pack/test/security_api_integration/plugins/audit_log/tsconfig.json new file mode 100644 index 0000000000000..822bc52c6fdec --- /dev/null +++ b/x-pack/test/security_api_integration/plugins/audit_log/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/core", + ] +} diff --git a/x-pack/test/security_api_integration/fixtures/user_profiles/user_profiles_consumer/kibana.json b/x-pack/test/security_api_integration/plugins/user_profiles_consumer/kibana.json similarity index 100% rename from x-pack/test/security_api_integration/fixtures/user_profiles/user_profiles_consumer/kibana.json rename to x-pack/test/security_api_integration/plugins/user_profiles_consumer/kibana.json diff --git a/x-pack/test/security_api_integration/fixtures/user_profiles/user_profiles_consumer/server/index.ts b/x-pack/test/security_api_integration/plugins/user_profiles_consumer/server/index.ts similarity index 100% rename from x-pack/test/security_api_integration/fixtures/user_profiles/user_profiles_consumer/server/index.ts rename to x-pack/test/security_api_integration/plugins/user_profiles_consumer/server/index.ts diff --git a/x-pack/test/security_api_integration/fixtures/user_profiles/user_profiles_consumer/server/init_routes.ts b/x-pack/test/security_api_integration/plugins/user_profiles_consumer/server/init_routes.ts similarity index 100% rename from x-pack/test/security_api_integration/fixtures/user_profiles/user_profiles_consumer/server/init_routes.ts rename to x-pack/test/security_api_integration/plugins/user_profiles_consumer/server/init_routes.ts diff --git a/x-pack/test/security_api_integration/plugins/user_profiles_consumer/tsconfig.json b/x-pack/test/security_api_integration/plugins/user_profiles_consumer/tsconfig.json new file mode 100644 index 0000000000000..2806ceb646148 --- /dev/null +++ b/x-pack/test/security_api_integration/plugins/user_profiles_consumer/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/core", + "@kbn/features-plugin", + "@kbn/security-plugin", + "@kbn/spaces-plugin", + "@kbn/config-schema", + ] +} diff --git a/x-pack/test/security_api_integration/saml.config.ts b/x-pack/test/security_api_integration/saml.config.ts index 9f696912958f4..493d247ccb5a6 100644 --- a/x-pack/test/security_api_integration/saml.config.ts +++ b/x-pack/test/security_api_integration/saml.config.ts @@ -15,10 +15,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { const kibanaPort = xPackAPITestsConfig.get('servers.kibana.port'); const idpPath = resolve(__dirname, './fixtures/saml/idp_metadata.xml'); - const testEndpointsPlugin = resolve( - __dirname, - '../security_functional/fixtures/common/test_endpoints' - ); + const testEndpointsPlugin = resolve(__dirname, '../security_functional/plugins/test_endpoints'); const auditLogPath = resolve(__dirname, './fixtures/audit/saml.log'); diff --git a/x-pack/test/security_api_integration/tests/audit/audit_log.ts b/x-pack/test/security_api_integration/tests/audit/audit_log.ts index df4dd45be0e10..016dcdd4f9b96 100644 --- a/x-pack/test/security_api_integration/tests/audit/audit_log.ts +++ b/x-pack/test/security_api_integration/tests/audit/audit_log.ts @@ -16,7 +16,7 @@ export default function ({ getService }: FtrProviderContext) { const { username, password } = getService('config').get('servers.kibana'); describe('Audit Log', function () { - const logFilePath = Path.resolve(__dirname, '../../fixtures/audit/audit.log'); + const logFilePath = Path.resolve(__dirname, '../../plugins/audit_log/audit.log'); const logFile = new FileWrapper(logFilePath, retry); beforeEach(async () => { diff --git a/x-pack/test/security_api_integration/token.config.ts b/x-pack/test/security_api_integration/token.config.ts index d2e208d8f56d9..a421b2c79be74 100644 --- a/x-pack/test/security_api_integration/token.config.ts +++ b/x-pack/test/security_api_integration/token.config.ts @@ -12,10 +12,7 @@ import { services } from './services'; export default async function ({ readConfigFile }: FtrConfigProviderContext) { const xPackAPITestsConfig = await readConfigFile(require.resolve('../api_integration/config.ts')); - const testEndpointsPlugin = resolve( - __dirname, - '../security_functional/fixtures/common/test_endpoints' - ); + const testEndpointsPlugin = resolve(__dirname, '../security_functional/plugins/test_endpoints'); const auditLogPath = resolve(__dirname, './fixtures/audit/token.log'); diff --git a/x-pack/test/security_api_integration/user_profiles.config.ts b/x-pack/test/security_api_integration/user_profiles.config.ts index 30dddc8a1a72d..43d25920b2fd9 100644 --- a/x-pack/test/security_api_integration/user_profiles.config.ts +++ b/x-pack/test/security_api_integration/user_profiles.config.ts @@ -12,10 +12,7 @@ import { services } from './services'; export default async function ({ readConfigFile }: FtrConfigProviderContext) { const xPackAPITestsConfig = await readConfigFile(require.resolve('../api_integration/config.ts')); - const userProfilesConsumerPlugin = resolve( - __dirname, - './fixtures/user_profiles/user_profiles_consumer' - ); + const userProfilesConsumerPlugin = resolve(__dirname, './plugins/user_profiles_consumer'); return { testFiles: [require.resolve('./tests/user_profiles')], diff --git a/x-pack/test/security_functional/expired_session.config.ts b/x-pack/test/security_functional/expired_session.config.ts index b5e728c7ae0a1..82dd1cb36caf2 100644 --- a/x-pack/test/security_functional/expired_session.config.ts +++ b/x-pack/test/security_functional/expired_session.config.ts @@ -17,7 +17,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { require.resolve('../functional/config.base.js') ); - const testEndpointsPlugin = resolve(__dirname, './fixtures/common/test_endpoints'); + const testEndpointsPlugin = resolve(__dirname, './plugins/test_endpoints'); return { testFiles: [resolve(__dirname, './tests/expired_session')], diff --git a/x-pack/test/security_functional/login_selector.config.ts b/x-pack/test/security_functional/login_selector.config.ts index d2035a9b228e8..03dd3ae71ebd2 100644 --- a/x-pack/test/security_functional/login_selector.config.ts +++ b/x-pack/test/security_functional/login_selector.config.ts @@ -34,7 +34,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { '../security_api_integration/fixtures/saml/saml_provider' ); - const testEndpointsPlugin = resolve(__dirname, './fixtures/common/test_endpoints'); + const testEndpointsPlugin = resolve(__dirname, './plugins/test_endpoints'); return { testFiles: [resolve(__dirname, './tests/login_selector')], diff --git a/x-pack/test/security_functional/oidc.config.ts b/x-pack/test/security_functional/oidc.config.ts index 6476bbb501b77..7efd373052f69 100644 --- a/x-pack/test/security_functional/oidc.config.ts +++ b/x-pack/test/security_functional/oidc.config.ts @@ -27,7 +27,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { '../security_api_integration/fixtures/oidc/oidc_provider' ); - const testEndpointsPlugin = resolve(__dirname, './fixtures/common/test_endpoints'); + const testEndpointsPlugin = resolve(__dirname, './plugins/test_endpoints'); return { testFiles: [resolve(__dirname, './tests/oidc')], diff --git a/x-pack/test/security_functional/fixtures/common/test_endpoints/kibana.json b/x-pack/test/security_functional/plugins/test_endpoints/kibana.json similarity index 100% rename from x-pack/test/security_functional/fixtures/common/test_endpoints/kibana.json rename to x-pack/test/security_functional/plugins/test_endpoints/kibana.json diff --git a/x-pack/test/security_functional/fixtures/common/test_endpoints/public/index.ts b/x-pack/test/security_functional/plugins/test_endpoints/public/index.ts similarity index 100% rename from x-pack/test/security_functional/fixtures/common/test_endpoints/public/index.ts rename to x-pack/test/security_functional/plugins/test_endpoints/public/index.ts diff --git a/x-pack/test/security_functional/fixtures/common/test_endpoints/public/plugin.tsx b/x-pack/test/security_functional/plugins/test_endpoints/public/plugin.tsx similarity index 100% rename from x-pack/test/security_functional/fixtures/common/test_endpoints/public/plugin.tsx rename to x-pack/test/security_functional/plugins/test_endpoints/public/plugin.tsx diff --git a/x-pack/test/security_functional/fixtures/common/test_endpoints/server/index.ts b/x-pack/test/security_functional/plugins/test_endpoints/server/index.ts similarity index 100% rename from x-pack/test/security_functional/fixtures/common/test_endpoints/server/index.ts rename to x-pack/test/security_functional/plugins/test_endpoints/server/index.ts diff --git a/x-pack/test/security_functional/fixtures/common/test_endpoints/server/init_routes.ts b/x-pack/test/security_functional/plugins/test_endpoints/server/init_routes.ts similarity index 100% rename from x-pack/test/security_functional/fixtures/common/test_endpoints/server/init_routes.ts rename to x-pack/test/security_functional/plugins/test_endpoints/server/init_routes.ts diff --git a/x-pack/test/security_functional/plugins/test_endpoints/tsconfig.json b/x-pack/test/security_functional/plugins/test_endpoints/tsconfig.json new file mode 100644 index 0000000000000..2802334020ecb --- /dev/null +++ b/x-pack/test/security_functional/plugins/test_endpoints/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/core", + "@kbn/security-plugin", + "@kbn/config-schema", + ] +} diff --git a/x-pack/test/security_functional/saml.config.ts b/x-pack/test/security_functional/saml.config.ts index 60a934a712bbf..337db1ceeae75 100644 --- a/x-pack/test/security_functional/saml.config.ts +++ b/x-pack/test/security_functional/saml.config.ts @@ -30,7 +30,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { '../security_api_integration/fixtures/saml/saml_provider' ); - const testEndpointsPlugin = resolve(__dirname, './fixtures/common/test_endpoints'); + const testEndpointsPlugin = resolve(__dirname, './plugins/test_endpoints'); return { testFiles: [resolve(__dirname, './tests/saml')], diff --git a/x-pack/test/security_functional/user_profiles.config.ts b/x-pack/test/security_functional/user_profiles.config.ts index f9bed9ce380df..e5b65db64c383 100644 --- a/x-pack/test/security_functional/user_profiles.config.ts +++ b/x-pack/test/security_functional/user_profiles.config.ts @@ -17,7 +17,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { require.resolve('../functional/config.base.js') ); - const testEndpointsPlugin = resolve(__dirname, './fixtures/common/test_endpoints'); + const testEndpointsPlugin = resolve(__dirname, './plugins/test_endpoints'); return { testFiles: [resolve(__dirname, './tests/user_profiles')], diff --git a/x-pack/test/spaces_api_integration/common/config.ts b/x-pack/test/spaces_api_integration/common/config.ts index d4cf6851b481b..da29de4033eb8 100644 --- a/x-pack/test/spaces_api_integration/common/config.ts +++ b/x-pack/test/spaces_api_integration/common/config.ts @@ -64,7 +64,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) // disable anonymouse access so that we're testing both on and off in different suites '--status.allowAnonymous=false', '--server.xsrf.disableProtection=true', - `--plugin-path=${path.join(__dirname, 'fixtures', 'spaces_test_plugin')}`, + `--plugin-path=${path.resolve(__dirname, 'plugins/spaces_test_plugin')}`, ...disabledPlugins .filter((k) => k !== 'security') .map((key) => `--xpack.${key}.enabled=false`), diff --git a/x-pack/test/spaces_api_integration/common/fixtures/spaces_test_plugin/kibana.json b/x-pack/test/spaces_api_integration/common/plugins/spaces_test_plugin/kibana.json similarity index 100% rename from x-pack/test/spaces_api_integration/common/fixtures/spaces_test_plugin/kibana.json rename to x-pack/test/spaces_api_integration/common/plugins/spaces_test_plugin/kibana.json diff --git a/x-pack/test/spaces_api_integration/common/fixtures/spaces_test_plugin/server/index.ts b/x-pack/test/spaces_api_integration/common/plugins/spaces_test_plugin/server/index.ts similarity index 100% rename from x-pack/test/spaces_api_integration/common/fixtures/spaces_test_plugin/server/index.ts rename to x-pack/test/spaces_api_integration/common/plugins/spaces_test_plugin/server/index.ts diff --git a/x-pack/test/spaces_api_integration/common/fixtures/spaces_test_plugin/server/plugin.ts b/x-pack/test/spaces_api_integration/common/plugins/spaces_test_plugin/server/plugin.ts similarity index 100% rename from x-pack/test/spaces_api_integration/common/fixtures/spaces_test_plugin/server/plugin.ts rename to x-pack/test/spaces_api_integration/common/plugins/spaces_test_plugin/server/plugin.ts diff --git a/x-pack/test/timeline/common/config.ts b/x-pack/test/timeline/common/config.ts index d4349eb7f0dc7..5d335a5fc603f 100644 --- a/x-pack/test/timeline/common/config.ts +++ b/x-pack/test/timeline/common/config.ts @@ -10,7 +10,7 @@ import { FtrConfigProviderContext } from '@kbn/test'; import { resolve } from 'path'; import { services } from './services'; -import { getAllExternalServiceSimulatorPaths } from '../../alerting_api_integration/common/fixtures/plugins/actions_simulators/server/plugin'; +import { getAllExternalServiceSimulatorPaths } from '../../alerting_api_integration/common/plugins/actions_simulators/server/plugin'; interface CreateTestConfigOptions { license: string; diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index 4d8ffb5a8ae9d..133cf885de977 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -26,7 +26,6 @@ { "path": "../../test/tsconfig.json" }, "@kbn/core", "@kbn/data-plugin", - "@kbn/kibana-react-plugin", "@kbn/kibana-usage-collection-plugin", "@kbn/share-plugin", "@kbn/telemetry-collection-manager-plugin", @@ -44,7 +43,6 @@ "@kbn/global-search-plugin", "@kbn/index-management-plugin", "@kbn/infra-plugin", - "@kbn/lens-plugin", "@kbn/licensing-plugin", "@kbn/lists-plugin", "@kbn/ml-plugin", @@ -103,8 +101,6 @@ "@kbn/visualizations-plugin", "@kbn/rule-registry-plugin", "@kbn/controls-plugin", - "@kbn/i18n-react", - "@kbn/apm-config-loader", "@kbn/core-saved-objects-server", "@kbn/core-provider-plugin", "@kbn/core-saved-objects-common", @@ -112,6 +108,7 @@ "@kbn/apm-synthtrace-client", "@kbn/utils", "@kbn/journeys", + "@kbn/alerting-fixture-plugin", "@kbn/stdio-dev-helpers", ] } diff --git a/x-pack/test/ui_capabilities/common/config.ts b/x-pack/test/ui_capabilities/common/config.ts index 32e7538ecbbe7..ba40e613c0d69 100644 --- a/x-pack/test/ui_capabilities/common/config.ts +++ b/x-pack/test/ui_capabilities/common/config.ts @@ -45,7 +45,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) ...disabledPlugins .filter((k) => k !== 'security') .map((key) => `--xpack.${key}.enabled=false`), - `--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'foo_plugin')}`, + `--plugin-path=${path.resolve(__dirname, 'plugins/foo_plugin')}`, ], }, }; diff --git a/x-pack/test/ui_capabilities/common/fixtures/plugins/foo_plugin/kibana.json b/x-pack/test/ui_capabilities/common/plugins/foo_plugin/kibana.json similarity index 100% rename from x-pack/test/ui_capabilities/common/fixtures/plugins/foo_plugin/kibana.json rename to x-pack/test/ui_capabilities/common/plugins/foo_plugin/kibana.json diff --git a/x-pack/test/ui_capabilities/common/fixtures/plugins/foo_plugin/public/index.ts b/x-pack/test/ui_capabilities/common/plugins/foo_plugin/public/index.ts similarity index 100% rename from x-pack/test/ui_capabilities/common/fixtures/plugins/foo_plugin/public/index.ts rename to x-pack/test/ui_capabilities/common/plugins/foo_plugin/public/index.ts diff --git a/x-pack/test/ui_capabilities/common/fixtures/plugins/foo_plugin/server/index.ts b/x-pack/test/ui_capabilities/common/plugins/foo_plugin/server/index.ts similarity index 100% rename from x-pack/test/ui_capabilities/common/fixtures/plugins/foo_plugin/server/index.ts rename to x-pack/test/ui_capabilities/common/plugins/foo_plugin/server/index.ts From 4da8f563547cbbd3cdf37b5eb8829096b25196ad Mon Sep 17 00:00:00 2001 From: Luke Gmys Date: Thu, 12 Jan 2023 21:13:32 +0100 Subject: [PATCH 38/39] [TIP] Refactor to react-query in useIndicatorById hook --- .../cases/hooks/use_indicator_by_id.test.tsx | 56 ++++++++++++ .../cases/hooks/use_indicator_by_id.ts | 72 ++++++---------- .../services/fetch_indicator_by_id.test.ts | 83 ++++++++++++++++++ .../cases/services/fetch_indicator_by_id.ts | 85 +++++++++++++++++++ .../services/fetch_aggregated_indicators.ts | 2 +- .../indicators/services/fetch_indicators.ts | 2 +- .../public/modules/indicators/utils/index.ts | 1 - .../{modules/indicators => }/utils/search.ts | 68 ++++++++++++--- 8 files changed, 304 insertions(+), 65 deletions(-) create mode 100644 x-pack/plugins/threat_intelligence/public/modules/cases/hooks/use_indicator_by_id.test.tsx create mode 100644 x-pack/plugins/threat_intelligence/public/modules/cases/services/fetch_indicator_by_id.test.ts create mode 100644 x-pack/plugins/threat_intelligence/public/modules/cases/services/fetch_indicator_by_id.ts rename x-pack/plugins/threat_intelligence/public/{modules/indicators => }/utils/search.ts (52%) diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/hooks/use_indicator_by_id.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/cases/hooks/use_indicator_by_id.test.tsx new file mode 100644 index 0000000000000..8f4dbd3fa4431 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/cases/hooks/use_indicator_by_id.test.tsx @@ -0,0 +1,56 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { renderHook } from '@testing-library/react-hooks'; +import { useIndicatorById, UseIndicatorByIdValue } from './use_indicator_by_id'; +import { TestProvidersComponent } from '../../../common/mocks/test_providers'; +import { createFetchIndicatorById } from '../services/fetch_indicator_by_id'; +import { Indicator } from '../../../../common/types/indicator'; + +jest.mock('../services/fetch_indicator_by_id'); + +const indicatorByIdQueryResult = { _id: 'testId' } as unknown as Indicator; + +const renderUseIndicatorById = (initialProps = { indicatorId: 'testId' }) => + renderHook<{ indicatorId: string }, UseIndicatorByIdValue>( + (props) => useIndicatorById(props.indicatorId), + { + initialProps, + wrapper: TestProvidersComponent, + } + ); + +describe('useIndicatorById()', () => { + type MockedCreateFetchIndicators = jest.MockedFunction; + let indicatorsQuery: jest.MockedFunction>; + + beforeEach(jest.clearAllMocks); + + beforeEach(() => { + indicatorsQuery = jest.fn(); + (createFetchIndicatorById as MockedCreateFetchIndicators).mockReturnValue(indicatorsQuery); + }); + + describe('when mounted', () => { + it('should create and call the indicatorsQuery', async () => { + indicatorsQuery.mockResolvedValue(indicatorByIdQueryResult); + + const hookResult = renderUseIndicatorById(); + + // isLoading should be true + expect(hookResult.result.current.isLoading).toEqual(true); + + // indicators service and the query should be called just once + expect(createFetchIndicatorById as MockedCreateFetchIndicators).toHaveBeenCalledTimes(1); + expect(indicatorsQuery).toHaveBeenCalledTimes(1); + + // isLoading should turn to false eventually + await hookResult.waitFor(() => !hookResult.result.current.isLoading); + expect(hookResult.result.current.isLoading).toEqual(false); + }); + }); +}); diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/hooks/use_indicator_by_id.ts b/x-pack/plugins/threat_intelligence/public/modules/cases/hooks/use_indicator_by_id.ts index 379618b998f92..8c648fc91afb8 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/cases/hooks/use_indicator_by_id.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/cases/hooks/use_indicator_by_id.ts @@ -5,70 +5,46 @@ * 2.0. */ -import { useEffect, useState } from 'react'; -import { - IEsSearchRequest, - IKibanaSearchResponse, - isCompleteResponse, -} from '@kbn/data-plugin/common'; +import { useMemo } from 'react'; +import { useQuery } from '@tanstack/react-query'; import { Indicator } from '../../../../common/types/indicator'; import { useKibana } from '../../../hooks'; -import type { RawIndicatorsResponse } from '../../indicators/services/fetch_indicators'; +import { createFetchIndicatorById, FetchParams } from '../services/fetch_indicator_by_id'; + +const QUERY_ID = 'indicatorById'; + +export interface UseIndicatorByIdValue { + indicator: Indicator | undefined; + isLoading: boolean; +} /** * Retrieve document from ES by id * @param indicatorId id of the indicator saved within the cases attachment * @return an object with the indicator and the loading status */ -export const useIndicatorById = (indicatorId: string) => { +export const useIndicatorById = (indicatorId: string): UseIndicatorByIdValue => { const { services: { data: { search: searchService }, }, } = useKibana(); - const [indicator, setIndicator] = useState(); - const [isLoading, setIsLoading] = useState(true); - useEffect(() => { - const query = { - bool: { - must: [ - { - ids: { - values: [indicatorId], - }, - }, - ], - }, - }; - const fields = [ + const fetchIndicatorById = useMemo( + () => createFetchIndicatorById({ searchService }), + [searchService] + ); + + const { isLoading, data: indicator } = useQuery( + [ + QUERY_ID, { - field: '*', - include_unmapped: true, + indicatorId, }, - ]; - const req = { - params: { - body: { - query, - fields, - }, - }, - }; - - searchService - .search>(req) - .subscribe({ - next: (res) => { - if (isCompleteResponse(res)) { - const result = res.rawResponse.hits; - - setIndicator(result.hits[0]); - setIsLoading(false); - } - }, - }); - }, [indicatorId, searchService, setIndicator]); + ], + ({ signal, queryKey: [_key, queryParams] }) => + fetchIndicatorById(queryParams as FetchParams, signal) + ); return { indicator, isLoading }; }; diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/services/fetch_indicator_by_id.test.ts b/x-pack/plugins/threat_intelligence/public/modules/cases/services/fetch_indicator_by_id.test.ts new file mode 100644 index 0000000000000..036b50a248d5a --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/cases/services/fetch_indicator_by_id.test.ts @@ -0,0 +1,83 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { mockedSearchService } from '../../../common/mocks/test_providers'; +import { BehaviorSubject, throwError } from 'rxjs'; +import { createFetchIndicatorById } from './fetch_indicator_by_id'; +import { RequestAdapter } from '@kbn/inspector-plugin/common'; + +const indicatorsResponse = { + rawResponse: { hits: { hits: [{ _id: 'testId' }], total: 0 } }, +}; + +describe('FetchIndicatorByIdService', () => { + beforeEach(jest.clearAllMocks); + + describe('fetchIndicatorById()', () => { + describe('when query is successful', () => { + beforeEach(() => { + mockedSearchService.search.mockReturnValue(new BehaviorSubject(indicatorsResponse)); + }); + + it('should pass the query down to searchService', async () => { + const fetchIndicatorById = createFetchIndicatorById({ + searchService: mockedSearchService, + inspectorAdapter: new RequestAdapter(), + }); + + const result = await fetchIndicatorById({ + indicatorId: 'testId', + }); + + expect(mockedSearchService.search).toHaveBeenCalled(); + expect(mockedSearchService.search).toHaveBeenCalledWith( + expect.objectContaining({ + params: { + body: { + fields: [{ field: '*', include_unmapped: true }], + query: expect.objectContaining({ bool: expect.anything() }), + size: 1, + }, + }, + }), + expect.anything() + ); + + expect(result).toMatchInlineSnapshot(` + Object { + "_id": "testId", + } + `); + }); + }); + + describe('when query fails', () => { + beforeEach(() => { + mockedSearchService.search.mockReturnValue( + throwError(() => new Error('some random exception')) + ); + }); + + it('should throw an error', async () => { + const fetchIndicatorById = createFetchIndicatorById({ + searchService: mockedSearchService, + inspectorAdapter: new RequestAdapter(), + }); + + try { + await fetchIndicatorById({ + indicatorId: 'testId', + }); + } catch (error) { + expect(error).toMatchInlineSnapshot(`[Error: some random exception]`); + } + + expect.assertions(1); + }); + }); + }); +}); diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/services/fetch_indicator_by_id.ts b/x-pack/plugins/threat_intelligence/public/modules/cases/services/fetch_indicator_by_id.ts new file mode 100644 index 0000000000000..7e26c41f0ad58 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/cases/services/fetch_indicator_by_id.ts @@ -0,0 +1,85 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ISearchStart } from '@kbn/data-plugin/public'; +import { RequestAdapter } from '@kbn/inspector-plugin/common'; +import { search } from '../../../utils/search'; +import { Indicator } from '../../../../common/types/indicator'; + +interface FetchIndicatorsDependencies { + searchService: ISearchStart; + + /** + * Optional dependency, can be passed when available in upper scope + */ + inspectorAdapter?: RequestAdapter; +} + +export interface RawIndicatorsResponse { + hits: { + hits: any[]; + total: number; + }; +} + +export interface FetchParams { + indicatorId: string; +} + +type ReactQueryKey = [string, FetchParams]; + +export interface IndicatorsQueryParams { + signal?: AbortSignal; + queryKey: ReactQueryKey; +} + +export const createFetchIndicatorById = + ({ searchService, inspectorAdapter }: FetchIndicatorsDependencies) => + async ({ indicatorId }: FetchParams, signal?: AbortSignal): Promise => { + const query = { + bool: { + must: [ + { + ids: { + values: [indicatorId], + }, + }, + ], + }, + }; + const fields = [ + { + field: '*', + include_unmapped: true, + }, + ]; + + const { + hits: { + hits: [firstResult], + }, + } = await search( + searchService, + { + params: { + body: { + query, + fields, + size: 1, + }, + }, + }, + { + inspectorAdapter, + requestName: `Fetch indicator by Id (${indicatorId})`, + signal, + skipDefaultStrategy: true, + } + ); + + return firstResult; + }; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.ts index 88f880122e426..f8f235bb758a9 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.ts @@ -11,7 +11,7 @@ import type { Filter, Query, TimeRange } from '@kbn/es-query'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; import { BARCHART_AGGREGATION_NAME, FactoryQueryType } from '../../../../common/constants'; import { RawIndicatorFieldId } from '../../../../common/types/indicator'; -import { search } from '../utils/search'; +import { search } from '../../../utils/search'; import { getIndicatorQueryParams } from '../utils/get_indicator_query_params'; const TIMESTAMP_FIELD = RawIndicatorFieldId.TimeStamp; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.ts index c8dfd374920c5..d92e2788abdc2 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.ts @@ -11,7 +11,7 @@ import { RequestAdapter } from '@kbn/inspector-plugin/common'; import { FactoryQueryType } from '../../../../common/constants'; import { Indicator } from '../../../../common/types/indicator'; import { getIndicatorQueryParams } from '../utils/get_indicator_query_params'; -import { search } from '../utils/search'; +import { search } from '../../../utils/search'; export interface RawIndicatorsResponse { hits: { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/index.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/index.ts index 04ca3df2a509e..a10e2746043b0 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/index.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/index.ts @@ -8,5 +8,4 @@ export * from './field_value'; export * from './get_field_schema'; export * from './get_indicator_query_params'; -export * from './search'; export * from './unwrap_value'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/search.ts b/x-pack/plugins/threat_intelligence/public/utils/search.ts similarity index 52% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/utils/search.ts rename to x-pack/plugins/threat_intelligence/public/utils/search.ts index 92ede2d4f3d92..e54bd6ecef885 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/search.ts +++ b/x-pack/plugins/threat_intelligence/public/utils/search.ts @@ -13,13 +13,13 @@ import { } from '@kbn/data-plugin/common'; import { ISearchStart } from '@kbn/data-plugin/public'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; -import { THREAT_INTELLIGENCE_SEARCH_STRATEGY_NAME } from '../../../../common/constants'; +import { THREAT_INTELLIGENCE_SEARCH_STRATEGY_NAME } from '../../common/constants'; interface SearchOptions { /** - * Inspector adapter, available in the context + * Inspector adapter. Pass this when available in the upper scope to display request diagnostics. */ - inspectorAdapter: RequestAdapter; + inspectorAdapter?: RequestAdapter; /** * Request name registered in the inspector panel @@ -30,43 +30,83 @@ interface SearchOptions { * Abort signal */ signal?: AbortSignal; + + /** + * Do not use default plugin search strategy + */ + skipDefaultStrategy?: boolean; } +/** + * Handles optional access to RequestAdapter + */ +const requestInspector = ( + inspectorAdapter: RequestAdapter | undefined, + { requestName }: { requestName: string } +) => { + const requestId = `${Date.now()}`; + + const inspectorRequest = inspectorAdapter?.start(requestName, { id: requestId }); + + return { + recordRequestError(error: any) { + if (!inspectorRequest) { + return; + } + inspectorRequest.error({ json: error }); + }, + + recordRequestCompletion(searchRequest: IEsSearchRequest, response: IKibanaSearchResponse) { + if (!inspectorRequest) { + return; + } + + inspectorRequest.stats({}).ok({ json: response }); + inspectorRequest.json(searchRequest.params?.body || {}); + }, + + resetRequest() { + if (!inspectorAdapter) { + return; + } + + inspectorAdapter.resetRequest(requestId); + }, + }; +}; + /** * This is a searchService wrapper that will instrument your query with `inspector` and turn it into a Promise, * resolved when complete result set is returned or rejected on any error, other than Abort. */ export const search = async ( searchService: ISearchStart, - searchRequest: IEsSearchRequest & { factoryQueryType: string } & T, - { inspectorAdapter, requestName, signal }: SearchOptions + searchRequest: IEsSearchRequest & { factoryQueryType?: string } & T, + { inspectorAdapter, requestName, signal, skipDefaultStrategy = false }: SearchOptions ): Promise => { - const requestId = `${Date.now()}`; - const request = inspectorAdapter.start(requestName, { id: requestId }); + const inspect = requestInspector(inspectorAdapter, { requestName }); return new Promise((resolve, reject) => { searchService .search>(searchRequest, { abortSignal: signal, - strategy: THREAT_INTELLIGENCE_SEARCH_STRATEGY_NAME, + ...(skipDefaultStrategy ? {} : { strategy: THREAT_INTELLIGENCE_SEARCH_STRATEGY_NAME }), }) .subscribe({ next: (response) => { if (isCompleteResponse(response)) { - request.stats({}).ok({ json: response }); - request.json(searchRequest.params?.body || {}); - + inspect.recordRequestCompletion(searchRequest, response); resolve(response.rawResponse); } else if (isErrorResponse(response)) { - request.error({ json: response }); + inspect.recordRequestError(response); reject(response); } }, error: (requestError) => { if (requestError instanceof Error && requestError.name.includes('Abort')) { - inspectorAdapter.resetRequest(requestId); + inspect.resetRequest(); } else { - request.error({ json: requestError }); + inspect.recordRequestError(requestError); } searchService.showError(requestError); From 1880e8b3489a609825c8e19683c65ad12b1c35d9 Mon Sep 17 00:00:00 2001 From: Spencer Date: Thu, 12 Jan 2023 15:32:28 -0600 Subject: [PATCH 39/39] move code shared with alerting api-integration plugins into a package (#148846) We're working on converting all plugins into packages, which turns almost all code in the repository into a package except for things like the `test` and `x-pack/test` directories. The problem we ran into is that the alerting api-integration test plugins are being migrated to packages but they are currently consuming a handful of helpers from the parent `../lib` directory. This doesn't work, as packages can only import other packages and the `../lib` directory isn't in a package, it's just free-floating `x-pack/test` code. To fix this I've moved the necessary components out of `common/lib` and into `packages/helpers` which is importable via `@kbn/alerting-api-integration-helpers` and updated all the uses to access this new package. --- .github/CODEOWNERS | 1 + package.json | 1 + tsconfig.base.json | 2 ++ .../common/lib/alert_utils.ts | 2 +- .../common/lib/index.ts | 1 - .../actions_simulators/server/simulator.ts | 2 +- .../common/plugins/alerts/server/alert_types.ts | 2 +- .../packages/helpers/README.md | 3 +++ .../helpers}/es_test_index_tool.ts | 1 + .../helpers}/get_proxy_server.ts | 0 .../packages/helpers/index.ts | 9 +++++++++ .../packages/helpers/jest.config.js | 12 ++++++++++++ .../packages/helpers/kibana.jsonc | 6 ++++++ .../packages/helpers/package.json | 6 ++++++ .../packages/helpers/tsconfig.json | 17 +++++++++++++++++ .../actions/connector_types/cases_webhook.ts | 2 +- .../tests/actions/connector_types/jira.ts | 2 +- .../connector_types/oauth_access_token.ts | 2 +- .../tests/actions/connector_types/pagerduty.ts | 2 +- .../tests/actions/connector_types/resilient.ts | 2 +- .../actions/connector_types/servicenow_itom.ts | 2 +- .../actions/connector_types/servicenow_itsm.ts | 2 +- .../actions/connector_types/servicenow_sir.ts | 2 +- .../tests/actions/connector_types/slack.ts | 2 +- .../tests/actions/connector_types/swimlane.ts | 2 +- .../tests/actions/connector_types/webhook.ts | 2 +- .../tests/actions/connector_types/xmatters.ts | 2 +- .../group2/tests/actions/execute.ts | 9 ++------- .../group2/tests/alerting/alerts.ts | 3 +-- .../group2/tests/alerting/excluded.ts | 2 +- .../tests/alerting/get_action_error_log.ts | 9 ++------- .../group2/tests/alerting/health.ts | 10 ++-------- .../group2/tests/alerting/mustache_templates.ts | 2 +- .../group2/tests/alerting/rbac_legacy.ts | 3 ++- .../telemetry/alerting_and_actions_telemetry.ts | 9 ++------- .../security_and_spaces/scenarios.ts | 2 +- .../spaces_only/tests/actions/enqueue.ts | 8 ++------ .../spaces_only/tests/actions/execute.ts | 9 ++------- .../spaces_only/tests/alerting/alerts_base.ts | 3 +-- .../builtin_alert_types/cancellable/rule.ts | 8 ++------ .../circuit_breaker/alert_limit_services.ts | 9 ++------- .../index_threshold_max_alerts.ts | 9 ++------- .../builtin_alert_types/es_query/common.ts | 8 ++------ .../es_query/query_dsl_only.ts | 4 +++- .../builtin_alert_types/es_query/rule.ts | 4 +++- .../index_threshold/alert.ts | 10 +++------- .../index_threshold/fields_endpoint.ts | 4 +++- .../index_threshold/indices_endpoint.ts | 4 +++- .../time_series_query_endpoint.ts | 4 +++- .../builtin_alert_types/lib/create_test_data.ts | 2 +- .../spaces_only/tests/alerting/ephemeral.ts | 10 ++-------- .../spaces_only/tests/alerting/event_log.ts | 9 ++------- .../tests/alerting/get_action_error_log.ts | 9 ++------- .../tests/alerting/get_execution_log.ts | 9 ++------- .../ml_rule_types/anomaly_detection/alert.ts | 8 ++------ .../tests/alerting/monitoring_collection.ts | 2 +- .../transform_health/alert.ts | 8 ++------ x-pack/test/tsconfig.json | 3 +++ yarn.lock | 4 ++++ 59 files changed, 139 insertions(+), 147 deletions(-) create mode 100644 x-pack/test/alerting_api_integration/packages/helpers/README.md rename x-pack/test/alerting_api_integration/{common/lib => packages/helpers}/es_test_index_tool.ts (99%) rename x-pack/test/alerting_api_integration/{common/lib => packages/helpers}/get_proxy_server.ts (100%) create mode 100644 x-pack/test/alerting_api_integration/packages/helpers/index.ts create mode 100644 x-pack/test/alerting_api_integration/packages/helpers/jest.config.js create mode 100644 x-pack/test/alerting_api_integration/packages/helpers/kibana.jsonc create mode 100644 x-pack/test/alerting_api_integration/packages/helpers/package.json create mode 100644 x-pack/test/alerting_api_integration/packages/helpers/tsconfig.json diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index bc136320a03dc..1556638fb5b8a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1086,3 +1086,4 @@ x-pack/packages/ml/nested_property @elastic/ml-ui x-pack/packages/ml/query_utils @elastic/ml-ui x-pack/packages/ml/string_hash @elastic/ml-ui x-pack/packages/ml/url_state @elastic/ml-ui +x-pack/test/alerting_api_integration/packages/helpers @elastic/response-ops diff --git a/package.json b/package.json index 8215ddf2270b7..efcf7bf619968 100644 --- a/package.json +++ b/package.json @@ -748,6 +748,7 @@ "@jest/reporters": "^29.3.1", "@jest/transform": "^29.3.1", "@jest/types": "^29.3.1", + "@kbn/alerting-api-integration-helpers": "link:x-pack/test/alerting_api_integration/packages/helpers", "@kbn/ambient-common-types": "link:packages/kbn-ambient-common-types", "@kbn/ambient-ftr-types": "link:packages/kbn-ambient-ftr-types", "@kbn/ambient-storybook-types": "link:packages/kbn-ambient-storybook-types", diff --git a/tsconfig.base.json b/tsconfig.base.json index 0b30c709b0af3..a9d78e4329626 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -16,6 +16,8 @@ "@kbn/aiops-plugin/*": ["x-pack/plugins/aiops/*"], "@kbn/aiops-utils": ["x-pack/packages/ml/aiops_utils"], "@kbn/aiops-utils/*": ["x-pack/packages/ml/aiops_utils/*"], + "@kbn/alerting-api-integration-helpers": ["x-pack/test/alerting_api_integration/packages/helpers"], + "@kbn/alerting-api-integration-helpers/*": ["x-pack/test/alerting_api_integration/packages/helpers/*"], "@kbn/alerting-example-plugin": ["x-pack/examples/alerting_example"], "@kbn/alerting-example-plugin/*": ["x-pack/examples/alerting_example/*"], "@kbn/alerting-fixture-plugin": ["x-pack/test/functional_with_es_ssl/plugins/alerts"], diff --git a/x-pack/test/alerting_api_integration/common/lib/alert_utils.ts b/x-pack/test/alerting_api_integration/common/lib/alert_utils.ts index 44e2a4c50208e..0a72feee2b9ec 100644 --- a/x-pack/test/alerting_api_integration/common/lib/alert_utils.ts +++ b/x-pack/test/alerting_api_integration/common/lib/alert_utils.ts @@ -5,10 +5,10 @@ * 2.0. */ +import { ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { Space, User } from '../types'; import { ObjectRemover } from './object_remover'; import { getUrlPrefix } from './space_test_utils'; -import { ES_TEST_INDEX_NAME } from './es_test_index_tool'; import { getTestRuleData } from './get_test_rule_data'; export interface AlertUtilsOpts { diff --git a/x-pack/test/alerting_api_integration/common/lib/index.ts b/x-pack/test/alerting_api_integration/common/lib/index.ts index 31cd5991b5e05..2d393f1f7cdb8 100644 --- a/x-pack/test/alerting_api_integration/common/lib/index.ts +++ b/x-pack/test/alerting_api_integration/common/lib/index.ts @@ -7,7 +7,6 @@ export { ObjectRemover } from './object_remover'; export { getUrlPrefix } from './space_test_utils'; -export { ES_TEST_INDEX_NAME, ESTestIndexTool } from './es_test_index_tool'; export { getTestRuleData } from './get_test_rule_data'; export { AlertUtils, diff --git a/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/simulator.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/simulator.ts index 8ff962bdb8927..09afefdaae305 100644 --- a/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/simulator.ts +++ b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/simulator.ts @@ -8,7 +8,7 @@ import getPort from 'get-port'; import http from 'http'; import httpProxy from 'http-proxy'; -import { getProxyPort } from '../../../lib/get_proxy_server'; +import { getProxyPort } from '@kbn/alerting-api-integration-helpers'; import { getDataFromRequest } from './data_handler'; export interface ProxyArgs { diff --git a/x-pack/test/alerting_api_integration/common/plugins/alerts/server/alert_types.ts b/x-pack/test/alerting_api_integration/common/plugins/alerts/server/alert_types.ts index a3739ca1c990b..b13499e72dbe7 100644 --- a/x-pack/test/alerting_api_integration/common/plugins/alerts/server/alert_types.ts +++ b/x-pack/test/alerting_api_integration/common/plugins/alerts/server/alert_types.ts @@ -18,8 +18,8 @@ import { RuleTypeParams, } from '@kbn/alerting-plugin/server'; import { AlertConsumers } from '@kbn/rule-data-utils'; +import { ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { FixtureStartDeps, FixtureSetupDeps } from './plugin'; -import { ES_TEST_INDEX_NAME } from '../../../lib'; export const EscapableStrings = { escapableBold: '*bold*', diff --git a/x-pack/test/alerting_api_integration/packages/helpers/README.md b/x-pack/test/alerting_api_integration/packages/helpers/README.md new file mode 100644 index 0000000000000..57be9b7bc8b54 --- /dev/null +++ b/x-pack/test/alerting_api_integration/packages/helpers/README.md @@ -0,0 +1,3 @@ +# @kbn/alerting-api-integration-helpers + +A package to hold alerting api-integration test helpers that are shared with the the alerting api-integration plugins. \ No newline at end of file diff --git a/x-pack/test/alerting_api_integration/common/lib/es_test_index_tool.ts b/x-pack/test/alerting_api_integration/packages/helpers/es_test_index_tool.ts similarity index 99% rename from x-pack/test/alerting_api_integration/common/lib/es_test_index_tool.ts rename to x-pack/test/alerting_api_integration/packages/helpers/es_test_index_tool.ts index 2af943785e612..98d69309365e2 100644 --- a/x-pack/test/alerting_api_integration/common/lib/es_test_index_tool.ts +++ b/x-pack/test/alerting_api_integration/packages/helpers/es_test_index_tool.ts @@ -5,6 +5,7 @@ * 2.0. */ import type { Client } from '@elastic/elasticsearch'; + export const ES_TEST_INDEX_NAME = '.kibana-alerting-test-data'; export class ESTestIndexTool { diff --git a/x-pack/test/alerting_api_integration/common/lib/get_proxy_server.ts b/x-pack/test/alerting_api_integration/packages/helpers/get_proxy_server.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/lib/get_proxy_server.ts rename to x-pack/test/alerting_api_integration/packages/helpers/get_proxy_server.ts diff --git a/x-pack/test/alerting_api_integration/packages/helpers/index.ts b/x-pack/test/alerting_api_integration/packages/helpers/index.ts new file mode 100644 index 0000000000000..9f3523c922306 --- /dev/null +++ b/x-pack/test/alerting_api_integration/packages/helpers/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from './es_test_index_tool'; +export * from './get_proxy_server'; diff --git a/x-pack/test/alerting_api_integration/packages/helpers/jest.config.js b/x-pack/test/alerting_api_integration/packages/helpers/jest.config.js new file mode 100644 index 0000000000000..752cdf8538093 --- /dev/null +++ b/x-pack/test/alerting_api_integration/packages/helpers/jest.config.js @@ -0,0 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../../..', + roots: ['/x-pack/test/alerting_api_integration/packages/helpers'], +}; diff --git a/x-pack/test/alerting_api_integration/packages/helpers/kibana.jsonc b/x-pack/test/alerting_api_integration/packages/helpers/kibana.jsonc new file mode 100644 index 0000000000000..0995f28c9c5d6 --- /dev/null +++ b/x-pack/test/alerting_api_integration/packages/helpers/kibana.jsonc @@ -0,0 +1,6 @@ +{ + "type": "test-helper", + "id": "@kbn/alerting-api-integration-helpers", + "owner": "@elastic/response-ops", + "devOnly": true +} diff --git a/x-pack/test/alerting_api_integration/packages/helpers/package.json b/x-pack/test/alerting_api_integration/packages/helpers/package.json new file mode 100644 index 0000000000000..ab6881a816fb4 --- /dev/null +++ b/x-pack/test/alerting_api_integration/packages/helpers/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/alerting-api-integration-helpers", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/x-pack/test/alerting_api_integration/packages/helpers/tsconfig.json b/x-pack/test/alerting_api_integration/packages/helpers/tsconfig.json new file mode 100644 index 0000000000000..7aba1b1a9378a --- /dev/null +++ b/x-pack/test/alerting_api_integration/packages/helpers/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [] +} diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/cases_webhook.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/cases_webhook.ts index b89fa5bd03981..f31d365b76c15 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/cases_webhook.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/cases_webhook.ts @@ -8,7 +8,7 @@ import httpProxy from 'http-proxy'; import expect from '@kbn/expect'; -import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; +import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/jira.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/jira.ts index c4bad232e8ae2..bab622826e0ed 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/jira.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/jira.ts @@ -8,7 +8,7 @@ import httpProxy from 'http-proxy'; import expect from '@kbn/expect'; -import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; +import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/oauth_access_token.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/oauth_access_token.ts index 4a5bc0a35eaf5..9ed8f220b614d 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/oauth_access_token.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/oauth_access_token.ts @@ -10,8 +10,8 @@ import expect from '@kbn/expect'; import { promisify } from 'util'; import httpProxy from 'http-proxy'; import { KBN_KEY_PATH } from '@kbn/dev-utils'; +import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; import { ExternalServiceSimulator, getExternalServiceSimulatorPath, diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/pagerduty.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/pagerduty.ts index 501fd1a7c241d..0b7b99bd9396f 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/pagerduty.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/pagerduty.ts @@ -8,7 +8,7 @@ import httpProxy from 'http-proxy'; import expect from '@kbn/expect'; -import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; +import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/resilient.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/resilient.ts index d5fa5cf0837b7..0d94903c9a91e 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/resilient.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/resilient.ts @@ -8,7 +8,7 @@ import httpProxy from 'http-proxy'; import expect from '@kbn/expect'; -import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; +import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itom.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itom.ts index c4657dfd35cd8..b715eba2af799 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itom.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itom.ts @@ -11,7 +11,7 @@ import { asyncForEach } from '@kbn/std'; import getPort from 'get-port'; import http from 'http'; -import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; +import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { getServiceNowServer } from '../../../../../common/plugins/actions_simulators/server/plugin'; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itsm.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itsm.ts index fbd731ebb1e26..132f432de3ae6 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itsm.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itsm.ts @@ -11,7 +11,7 @@ import { asyncForEach } from '@kbn/std'; import getPort from 'get-port'; import http from 'http'; -import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; +import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { getServiceNowServer } from '../../../../../common/plugins/actions_simulators/server/plugin'; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_sir.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_sir.ts index 01ac361b457a8..f10af6a9e76f3 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_sir.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_sir.ts @@ -11,7 +11,7 @@ import { asyncForEach } from '@kbn/std'; import getPort from 'get-port'; import http from 'http'; -import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; +import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { getServiceNowServer } from '../../../../../common/plugins/actions_simulators/server/plugin'; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/slack.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/slack.ts index 70e833bf27e82..190be31f811aa 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/slack.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/slack.ts @@ -9,7 +9,7 @@ import httpProxy from 'http-proxy'; import expect from '@kbn/expect'; import http from 'http'; import getPort from 'get-port'; -import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; +import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { getSlackServer } from '../../../../../common/plugins/actions_simulators/server/plugin'; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/swimlane.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/swimlane.ts index 4b47ca1860527..0249ff7217101 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/swimlane.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/swimlane.ts @@ -10,7 +10,7 @@ import expect from '@kbn/expect'; import getPort from 'get-port'; import http from 'http'; -import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; +import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { getSwimlaneServer } from '../../../../../common/plugins/actions_simulators/server/plugin'; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/webhook.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/webhook.ts index 84fd37bb71944..2566e801404ea 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/webhook.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/webhook.ts @@ -10,7 +10,7 @@ import http from 'http'; import expect from '@kbn/expect'; import { URL, format as formatUrl } from 'url'; import getPort from 'get-port'; -import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; +import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/xmatters.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/xmatters.ts index 751726adfb248..62c1b935c5289 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/xmatters.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/xmatters.ts @@ -8,7 +8,7 @@ import httpProxy from 'http-proxy'; import expect from '@kbn/expect'; -import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server'; +import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/execute.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/execute.ts index 35361920cc729..6ee116d3052e2 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/execute.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/execute.ts @@ -7,14 +7,9 @@ import expect from '@kbn/expect'; import { IValidatedEvent, nanosToMillis } from '@kbn/event-log-plugin/server'; +import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { UserAtSpaceScenarios } from '../../../scenarios'; -import { - ESTestIndexTool, - ES_TEST_INDEX_NAME, - getUrlPrefix, - ObjectRemover, - getEventLog, -} from '../../../../common/lib'; +import { getUrlPrefix, ObjectRemover, getEventLog } from '../../../../common/lib'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; // eslint-disable-next-line import/no-default-export diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/alerts.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/alerts.ts index 1cc8ecf22ab1a..9ddaf8c660d40 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/alerts.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/alerts.ts @@ -11,11 +11,10 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { IValidatedEvent, nanosToMillis } from '@kbn/event-log-plugin/server'; import { TaskRunning, TaskRunningStage } from '@kbn/task-manager-plugin/server/task_running'; import { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; +import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { UserAtSpaceScenarios, Superuser } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { - ESTestIndexTool, - ES_TEST_INDEX_NAME, getUrlPrefix, getTestRuleData, ObjectRemover, diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/excluded.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/excluded.ts index d09edae045e6f..6c6b9a2ae6795 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/excluded.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/excluded.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { UserAtSpaceScenarios } from '../../../scenarios'; import { getTestRuleData, @@ -13,7 +14,6 @@ import { ObjectRemover, getEventLog, AlertUtils, - ES_TEST_INDEX_NAME, } from '../../../../common/lib'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/get_action_error_log.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/get_action_error_log.ts index ade54c089eaa2..c2e4084fd195c 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/get_action_error_log.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/get_action_error_log.ts @@ -7,14 +7,9 @@ import expect from '@kbn/expect'; +import { ESTestIndexTool } from '@kbn/alerting-api-integration-helpers'; import { Spaces } from '../../../scenarios'; -import { - getUrlPrefix, - ObjectRemover, - getTestRuleData, - getEventLog, - ESTestIndexTool, -} from '../../../../common/lib'; +import { getUrlPrefix, ObjectRemover, getTestRuleData, getEventLog } from '../../../../common/lib'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; // eslint-disable-next-line import/no-default-export diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/health.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/health.ts index 0663696dbee14..240ca53cb091e 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/health.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/health.ts @@ -6,16 +6,10 @@ */ import expect from '@kbn/expect'; +import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { UserAtSpaceScenarios } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; -import { - getUrlPrefix, - getTestRuleData, - ObjectRemover, - AlertUtils, - ESTestIndexTool, - ES_TEST_INDEX_NAME, -} from '../../../../common/lib'; +import { getUrlPrefix, getTestRuleData, ObjectRemover, AlertUtils } from '../../../../common/lib'; // eslint-disable-next-line import/no-default-export export default function createFindTests({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/mustache_templates.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/mustache_templates.ts index f04ac5614f8a6..d012e7d0172e5 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/mustache_templates.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/mustache_templates.ts @@ -18,11 +18,11 @@ import axios from 'axios'; import httpProxy from 'http-proxy'; import expect from '@kbn/expect'; +import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers'; import { Spaces } from '../../../scenarios'; import { getUrlPrefix, getTestRuleData, ObjectRemover } from '../../../../common/lib'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { getSlackServer } from '../../../../common/plugins/actions_simulators/server/plugin'; -import { getHttpProxyServer } from '../../../../common/lib/get_proxy_server'; // eslint-disable-next-line import/no-default-export export default function executionStatusAlertTests({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/rbac_legacy.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/rbac_legacy.ts index 30b8fc600e15a..8ce682ac0099e 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/rbac_legacy.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/rbac_legacy.ts @@ -7,9 +7,10 @@ import expect from '@kbn/expect'; import { SavedObjectsUtils } from '@kbn/core/server'; +import { ESTestIndexTool } from '@kbn/alerting-api-integration-helpers'; import { UserAtSpaceScenarios, Superuser } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; -import { ESTestIndexTool, getUrlPrefix, ObjectRemover, AlertUtils } from '../../../../common/lib'; +import { getUrlPrefix, ObjectRemover, AlertUtils } from '../../../../common/lib'; import { setupSpacesAndUsers } from '../../../setup'; // eslint-disable-next-line import/no-default-export diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/alerting_and_actions_telemetry.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/alerting_and_actions_telemetry.ts index 707f15534e663..324459823d943 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/alerting_and_actions_telemetry.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/alerting_and_actions_telemetry.ts @@ -6,14 +6,9 @@ */ import expect from '@kbn/expect'; +import { ESTestIndexTool } from '@kbn/alerting-api-integration-helpers'; import { Spaces, Superuser } from '../../../scenarios'; -import { - getUrlPrefix, - getEventLog, - getTestRuleData, - ESTestIndexTool, - TaskManagerDoc, -} from '../../../../common/lib'; +import { getUrlPrefix, getEventLog, getTestRuleData, TaskManagerDoc } from '../../../../common/lib'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; // eslint-disable-next-line import/no-default-export diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/scenarios.ts b/x-pack/test/alerting_api_integration/security_and_spaces/scenarios.ts index 91d809bff04ca..bfa4968e2e4b5 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/scenarios.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/scenarios.ts @@ -5,8 +5,8 @@ * 2.0. */ +import { ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { Space, User } from '../common/types'; -import { ES_TEST_INDEX_NAME } from '../common/lib'; const NoKibanaPrivileges: User = { username: 'no_kibana_privileges', diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/actions/enqueue.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/enqueue.ts index 9f0eea9d91929..5934543886b16 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/actions/enqueue.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/enqueue.ts @@ -7,13 +7,9 @@ import expect from '@kbn/expect'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { Spaces } from '../../scenarios'; -import { - ESTestIndexTool, - ES_TEST_INDEX_NAME, - getUrlPrefix, - ObjectRemover, -} from '../../../common/lib'; +import { getUrlPrefix, ObjectRemover } from '../../../common/lib'; import { FtrProviderContext } from '../../../common/ftr_provider_context'; // eslint-disable-next-line import/no-default-export diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/actions/execute.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/execute.ts index 40b574063fbe5..f66570fc2655f 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/actions/execute.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/execute.ts @@ -7,14 +7,9 @@ import type { Client } from '@elastic/elasticsearch'; import expect from '@kbn/expect'; import { IValidatedEvent, nanosToMillis } from '@kbn/event-log-plugin/server'; +import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { Spaces } from '../../scenarios'; -import { - ESTestIndexTool, - ES_TEST_INDEX_NAME, - getUrlPrefix, - ObjectRemover, - getEventLog, -} from '../../../common/lib'; +import { getUrlPrefix, ObjectRemover, getEventLog } from '../../../common/lib'; import { FtrProviderContext } from '../../../common/ftr_provider_context'; // eslint-disable-next-line import/no-default-export diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/alerts_base.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/alerts_base.ts index a0f3e48ed9c0e..b1e6ec2b2d458 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/alerts_base.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/alerts_base.ts @@ -12,11 +12,10 @@ import { Response as SupertestResponse } from 'supertest'; import { RecoveredActionGroup } from '@kbn/alerting-plugin/common'; import { TaskRunning, TaskRunningStage } from '@kbn/task-manager-plugin/server/task_running'; import { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; +import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { Space } from '../../../common/types'; import { FtrProviderContext } from '../../../common/ftr_provider_context'; import { - ESTestIndexTool, - ES_TEST_INDEX_NAME, getUrlPrefix, getTestRuleData, ObjectRemover, diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/cancellable/rule.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/cancellable/rule.ts index 836e115352624..f8a84727348fb 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/cancellable/rule.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/cancellable/rule.ts @@ -6,15 +6,11 @@ */ import expect from '@kbn/expect'; +import { ESTestIndexTool } from '@kbn/alerting-api-integration-helpers'; import { Spaces } from '../../../../scenarios'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { - ESTestIndexTool, - getUrlPrefix, - ObjectRemover, - getEventLog, -} from '../../../../../common/lib'; +import { getUrlPrefix, ObjectRemover, getEventLog } from '../../../../../common/lib'; import { createEsDocuments } from '../lib/create_test_data'; const RULE_INTERVAL_SECONDS = 6; diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/circuit_breaker/alert_limit_services.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/circuit_breaker/alert_limit_services.ts index 586331503aca9..00b607c102a3a 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/circuit_breaker/alert_limit_services.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/circuit_breaker/alert_limit_services.ts @@ -7,15 +7,10 @@ import expect from '@kbn/expect'; +import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { Spaces } from '../../../../scenarios'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { - ESTestIndexTool, - ES_TEST_INDEX_NAME, - getUrlPrefix, - ObjectRemover, - getEventLog, -} from '../../../../../common/lib'; +import { getUrlPrefix, ObjectRemover, getEventLog } from '../../../../../common/lib'; // eslint-disable-next-line import/no-default-export export default function maxAlertsRuleTests({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/circuit_breaker/index_threshold_max_alerts.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/circuit_breaker/index_threshold_max_alerts.ts index 49935bbcaf24a..63a5e5283a10b 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/circuit_breaker/index_threshold_max_alerts.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/circuit_breaker/index_threshold_max_alerts.ts @@ -7,15 +7,10 @@ import expect from '@kbn/expect'; +import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { Spaces } from '../../../../scenarios'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { - ESTestIndexTool, - ES_TEST_INDEX_NAME, - getUrlPrefix, - ObjectRemover, - getEventLog, -} from '../../../../../common/lib'; +import { getUrlPrefix, ObjectRemover, getEventLog } from '../../../../../common/lib'; import { createEsDocumentsWithGroups } from '../lib/create_test_data'; const RULE_INTERVAL_SECONDS = 6; diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/common.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/common.ts index d5bd4efeb963b..faca906abc586 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/common.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/common.ts @@ -5,14 +5,10 @@ * 2.0. */ +import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { Spaces } from '../../../../scenarios'; -import { - ESTestIndexTool, - ES_TEST_INDEX_NAME, - getUrlPrefix, - ObjectRemover, -} from '../../../../../common/lib'; +import { getUrlPrefix, ObjectRemover } from '../../../../../common/lib'; import { createEsDocuments, createEsDocumentsWithGroups } from '../lib/create_test_data'; export const RULE_TYPE_ID = '.es-query'; diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/query_dsl_only.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/query_dsl_only.ts index c30e7bfa9f356..6024d07bccec0 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/query_dsl_only.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/query_dsl_only.ts @@ -7,9 +7,11 @@ import expect from '@kbn/expect'; +import { ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; + import { Spaces } from '../../../../scenarios'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { ES_TEST_INDEX_NAME, getUrlPrefix, ObjectRemover } from '../../../../../common/lib'; +import { getUrlPrefix, ObjectRemover } from '../../../../../common/lib'; import { createDataStream, deleteDataStream } from '../lib/create_test_data'; import { createConnector, diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/rule.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/rule.ts index f43dd10a9f140..6fd81745f770e 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/rule.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/rule.ts @@ -7,9 +7,11 @@ import expect from '@kbn/expect'; +import { ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; + import { Spaces } from '../../../../scenarios'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { ES_TEST_INDEX_NAME, getUrlPrefix, ObjectRemover } from '../../../../../common/lib'; +import { getUrlPrefix, ObjectRemover } from '../../../../../common/lib'; import { createConnector, ES_GROUPS_TO_WRITE, diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/index_threshold/alert.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/index_threshold/alert.ts index 43a63508e3ca4..945e9f5cd7380 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/index_threshold/alert.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/index_threshold/alert.ts @@ -7,15 +7,11 @@ import expect from '@kbn/expect'; +import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; + import { Spaces } from '../../../../scenarios'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { - ESTestIndexTool, - ES_TEST_INDEX_NAME, - getUrlPrefix, - ObjectRemover, - getEventLog, -} from '../../../../../common/lib'; +import { getUrlPrefix, ObjectRemover, getEventLog } from '../../../../../common/lib'; import { createEsDocumentsWithGroups } from '../lib/create_test_data'; import { createDataStream, deleteDataStream } from '../lib/create_test_data'; diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/index_threshold/fields_endpoint.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/index_threshold/fields_endpoint.ts index 37e71ac0e1a16..48ba628fd788e 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/index_threshold/fields_endpoint.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/index_threshold/fields_endpoint.ts @@ -7,9 +7,11 @@ import expect from '@kbn/expect'; +import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; + import { Spaces } from '../../../../scenarios'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { ESTestIndexTool, ES_TEST_INDEX_NAME, getUrlPrefix } from '../../../../../common/lib'; +import { getUrlPrefix } from '../../../../../common/lib'; const API_URI = 'internal/triggers_actions_ui/data/_fields'; diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/index_threshold/indices_endpoint.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/index_threshold/indices_endpoint.ts index fb70420d5f452..5c6c11d6efd7b 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/index_threshold/indices_endpoint.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/index_threshold/indices_endpoint.ts @@ -7,9 +7,11 @@ import expect from '@kbn/expect'; +import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; + import { Spaces } from '../../../../scenarios'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { ESTestIndexTool, ES_TEST_INDEX_NAME, getUrlPrefix } from '../../../../../common/lib'; +import { getUrlPrefix } from '../../../../../common/lib'; import { createEsDocumentsWithGroups } from '../lib/create_test_data'; import { createDataStream, deleteDataStream } from '../lib/create_test_data'; diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/index_threshold/time_series_query_endpoint.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/index_threshold/time_series_query_endpoint.ts index 61fec5cf7e481..ec342baf3ad66 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/index_threshold/time_series_query_endpoint.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/index_threshold/time_series_query_endpoint.ts @@ -8,9 +8,11 @@ import expect from '@kbn/expect'; import { TimeSeriesQuery } from '@kbn/triggers-actions-ui-plugin/server'; +import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; + import { Spaces } from '../../../../scenarios'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { ESTestIndexTool, ES_TEST_INDEX_NAME, getUrlPrefix } from '../../../../../common/lib'; +import { getUrlPrefix } from '../../../../../common/lib'; import { createEsDocumentsWithGroups } from '../lib/create_test_data'; diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/lib/create_test_data.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/lib/create_test_data.ts index 58df573fa629e..589b70cc2edc5 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/lib/create_test_data.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/lib/create_test_data.ts @@ -7,7 +7,7 @@ import type { Client } from '@elastic/elasticsearch'; import { times } from 'lodash'; import { v4 as uuid } from 'uuid'; -import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '../../../../../common/lib'; +import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; // default end date export const END_DATE = '2020-01-01T00:00:00Z'; diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/ephemeral.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/ephemeral.ts index 008761b3a5d62..26c9829c9ef35 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/ephemeral.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/ephemeral.ts @@ -9,15 +9,9 @@ import expect from '@kbn/expect'; import { flatten } from 'lodash'; import { IValidatedEvent } from '@kbn/event-log-plugin/server'; import { DEFAULT_MAX_EPHEMERAL_ACTIONS_PER_ALERT } from '@kbn/alerting-plugin/server/config'; +import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { Spaces } from '../../scenarios'; -import { - getUrlPrefix, - ObjectRemover, - getTestRuleData, - getEventLog, - ESTestIndexTool, - ES_TEST_INDEX_NAME, -} from '../../../common/lib'; +import { getUrlPrefix, ObjectRemover, getTestRuleData, getEventLog } from '../../../common/lib'; import { FtrProviderContext } from '../../../common/ftr_provider_context'; // eslint-disable-next-line import/no-default-export diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/event_log.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/event_log.ts index 6de49d3d44915..6f1c816feeffd 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/event_log.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/event_log.ts @@ -7,14 +7,9 @@ import expect from '@kbn/expect'; import { IValidatedEvent, nanosToMillis } from '@kbn/event-log-plugin/server'; +import { ESTestIndexTool } from '@kbn/alerting-api-integration-helpers'; import { Spaces } from '../../scenarios'; -import { - getUrlPrefix, - getTestRuleData, - ObjectRemover, - getEventLog, - ESTestIndexTool, -} from '../../../common/lib'; +import { getUrlPrefix, getTestRuleData, ObjectRemover, getEventLog } from '../../../common/lib'; import { FtrProviderContext } from '../../../common/ftr_provider_context'; // eslint-disable-next-line import/no-default-export diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/get_action_error_log.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/get_action_error_log.ts index 78d6a09ac41e3..0f2e67b1187fc 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/get_action_error_log.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/get_action_error_log.ts @@ -6,15 +6,10 @@ */ import expect from '@kbn/expect'; +import { ESTestIndexTool } from '@kbn/alerting-api-integration-helpers'; import { Spaces } from '../../scenarios'; -import { - getUrlPrefix, - ObjectRemover, - getTestRuleData, - getEventLog, - ESTestIndexTool, -} from '../../../common/lib'; +import { getUrlPrefix, ObjectRemover, getTestRuleData, getEventLog } from '../../../common/lib'; import { FtrProviderContext } from '../../../common/ftr_provider_context'; // eslint-disable-next-line import/no-default-export diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/get_execution_log.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/get_execution_log.ts index 984b6bbb832f9..0d2607ad0602b 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/get_execution_log.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/get_execution_log.ts @@ -6,15 +6,10 @@ */ import expect from '@kbn/expect'; +import { ESTestIndexTool } from '@kbn/alerting-api-integration-helpers'; import { Spaces } from '../../scenarios'; -import { - getUrlPrefix, - ObjectRemover, - getTestRuleData, - getEventLog, - ESTestIndexTool, -} from '../../../common/lib'; +import { getUrlPrefix, ObjectRemover, getTestRuleData, getEventLog } from '../../../common/lib'; import { FtrProviderContext } from '../../../common/ftr_provider_context'; // eslint-disable-next-line import/no-default-export diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/ml_rule_types/anomaly_detection/alert.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/ml_rule_types/anomaly_detection/alert.ts index 1bc267f86f073..51db0e9055faf 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/ml_rule_types/anomaly_detection/alert.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/ml_rule_types/anomaly_detection/alert.ts @@ -12,13 +12,9 @@ import { Datafeed, Job } from '@kbn/ml-plugin/common/types/anomaly_detection_job import { MlAnomalyDetectionAlertParams } from '@kbn/ml-plugin/common/types/alerts'; import { ANOMALY_SCORE_MATCH_GROUP_ID } from '@kbn/ml-plugin/server/lib/alerts/register_anomaly_detection_alert_type'; import { ML_ALERT_TYPES } from '@kbn/ml-plugin/common/constants/alerts'; +import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { Spaces } from '../../../../scenarios'; -import { - ES_TEST_INDEX_NAME, - ESTestIndexTool, - getUrlPrefix, - ObjectRemover, -} from '../../../../../common/lib'; +import { getUrlPrefix, ObjectRemover } from '../../../../../common/lib'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; const ACTION_TYPE_ID = '.index'; diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/monitoring_collection.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/monitoring_collection.ts index 381607361ec42..c6f240b8bb6bd 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/monitoring_collection.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/monitoring_collection.ts @@ -6,13 +6,13 @@ */ import expect from '@kbn/expect'; +import { ESTestIndexTool } from '@kbn/alerting-api-integration-helpers'; import { Spaces } from '../../scenarios'; import { getUrlPrefix, getTestRuleData, ObjectRemover, createWaitForExecutionCount, - ESTestIndexTool, getEventLog, } from '../../../common/lib'; import { FtrProviderContext } from '../../../common/ftr_provider_context'; diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/transform_rule_types/transform_health/alert.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/transform_rule_types/transform_health/alert.ts index c289be244ed3a..ee432431b7c83 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/transform_rule_types/transform_health/alert.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/transform_rule_types/transform_health/alert.ts @@ -7,13 +7,9 @@ import expect from '@kbn/expect'; import { PutTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; +import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { - ES_TEST_INDEX_NAME, - ESTestIndexTool, - getUrlPrefix, - ObjectRemover, -} from '../../../../../common/lib'; +import { getUrlPrefix, ObjectRemover } from '../../../../../common/lib'; import { Spaces } from '../../../../scenarios'; const ACTION_TYPE_ID = '.index'; diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index 133cf885de977..8c353849ed089 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -21,6 +21,8 @@ "exclude": [ "target/**/*", "*/plugins/**/*", + "*/packages/**/*", + "*/*/packages/**/*", ], "kbn_references": [ { "path": "../../test/tsconfig.json" }, @@ -110,5 +112,6 @@ "@kbn/journeys", "@kbn/alerting-fixture-plugin", "@kbn/stdio-dev-helpers", + "@kbn/alerting-api-integration-helpers", ] } diff --git a/yarn.lock b/yarn.lock index a9e11bb7aa0e5..bac27a2bb1ce4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2729,6 +2729,10 @@ version "0.0.0" uid "" +"@kbn/alerting-api-integration-helpers@link:x-pack/test/alerting_api_integration/packages/helpers": + version "0.0.0" + uid "" + "@kbn/alerts@link:packages/kbn-alerts": version "0.0.0" uid ""