From 8819edf4767ca1eef30abb52c04026c00c4988f5 Mon Sep 17 00:00:00 2001 From: David Hadka Date: Tue, 20 Oct 2020 13:33:34 -0500 Subject: [PATCH] Update to @actions/cache 1.0.3 (#438) Update to version 1.0.3 of the `@actions/cache` module. This pulls in the following changes: * Add a small delay between retry attempts * Do not retry on HTTP responses that are not retryable, such as 409 Conflicts --- .licenses/npm/@actions/cache.dep.yml | Bin 1337 -> 1306 bytes .licenses/npm/@actions/http-client.dep.yml | Bin 1386 -> 1386 bytes .licenses/npm/@azure/core-http.dep.yml | Bin 1476 -> 1476 bytes .licenses/npm/@azure/core-paging.dep.yml | Bin 1405 -> 1415 bytes ...l => core-tracing-1.0.0-preview.8.dep.yml} | Bin .../core-tracing-1.0.0-preview.9.dep.yml | Bin 0 -> 1454 bytes .licenses/npm/@azure/ms-rest-js.dep.yml | Bin 1517 -> 1517 bytes .licenses/npm/@azure/storage-blob.dep.yml | Bin 1384 -> 1384 bytes .../npm/@opentelemetry/api-0.10.2.dep.yml | Bin 0 -> 14306 bytes .../{api.dep.yml => api-0.6.1.dep.yml} | Bin .../context-base-0.10.2.dep.yml | Bin 0 -> 13589 bytes ...ase.dep.yml => context-base-0.6.1.dep.yml} | Bin .licenses/npm/node-fetch.dep.yml | Bin 2489 -> 2796 bytes .licenses/npm/tslib-1.14.1.dep.yml | Bin 0 -> 1849 bytes ...slib-2.0.0.dep.yml => tslib-2.0.3.dep.yml} | Bin 1848 -> 1848 bytes ...{uuid-8.3.0.dep.yml => uuid-8.3.1.dep.yml} | Bin 1324 -> 1324 bytes dist/restore/index.js | 12136 ++++++++++++---- dist/save/index.js | 12136 ++++++++++++---- package-lock.json | 140 +- package.json | 4 +- 20 files changed, 19253 insertions(+), 5163 deletions(-) rename .licenses/npm/@azure/{core-tracing.dep.yml => core-tracing-1.0.0-preview.8.dep.yml} (100%) create mode 100644 .licenses/npm/@azure/core-tracing-1.0.0-preview.9.dep.yml create mode 100644 .licenses/npm/@opentelemetry/api-0.10.2.dep.yml rename .licenses/npm/@opentelemetry/{api.dep.yml => api-0.6.1.dep.yml} (100%) create mode 100644 .licenses/npm/@opentelemetry/context-base-0.10.2.dep.yml rename .licenses/npm/@opentelemetry/{context-base.dep.yml => context-base-0.6.1.dep.yml} (100%) create mode 100644 .licenses/npm/tslib-1.14.1.dep.yml rename .licenses/npm/{tslib-2.0.0.dep.yml => tslib-2.0.3.dep.yml} (99%) rename .licenses/npm/{uuid-8.3.0.dep.yml => uuid-8.3.1.dep.yml} (98%) diff --git a/.licenses/npm/@actions/cache.dep.yml b/.licenses/npm/@actions/cache.dep.yml index 37b565e34128a1d010a0e83195ef89ecd5c47068..53954a1d6791880b6de0c61c113478a7d30b27b3 100644 GIT binary patch delta 157 zcmdnVHH&M42BYyr%|0(5PiI%ZU{}4|6fOmYlGKV4D}@?eAX7mhBqLS9*E2-HCo?%U zuQ*jf1IW?j0!umP7gQEyre~BW7#SE^D!6Bsc$6kh{17zRjnQxN3`XC{FB!cin=`ph zZe;46EX3R}c^b3l;tpY?vp@~p%Hk&twl~<{EhOAA$W@OkFTVt6f3cN9bSxJDgb^~# diff --git a/.licenses/npm/@actions/http-client.dep.yml b/.licenses/npm/@actions/http-client.dep.yml index d18a24ff96c5b636388ec3743aacd15d45d64961..2e3a424310e1f81f8949f970617ddf96742d976c 100644 GIT binary patch delta 12 TcmaFG^@?kP9;4+(eQQ<#AE5*R delta 12 TcmaFG^@?kP9;3xZeQQ<#ADjdL diff --git a/.licenses/npm/@azure/core-http.dep.yml b/.licenses/npm/@azure/core-http.dep.yml index a83956aedb54a95d7a73973faa2e22c19118a521..449a1144b30fd9e93e5ccd903ebce9df7999bc6d 100644 GIT binary patch delta 12 TcmX@YeS~|07Ng}x?U}3q9R&mp delta 12 TcmX@YeS~|07NhA#?U}3q9PtDR diff --git a/.licenses/npm/@azure/core-paging.dep.yml b/.licenses/npm/@azure/core-paging.dep.yml index 9ac34d25f05c40ac5c31dc94a5d194308988a2b2..97cc7d33d1f5bc5e29e6378bb226dffebf641cbf 100644 GIT binary patch delta 26 icmey%)y_RZhtYVV?sP8wAXi5hUst`{l#NGrvH$>d3kdfB delta 15 XcmZqY{>wE%htY7N?(~i4cCr8fE%*i* diff --git a/.licenses/npm/@azure/core-tracing.dep.yml b/.licenses/npm/@azure/core-tracing-1.0.0-preview.8.dep.yml similarity index 100% rename from .licenses/npm/@azure/core-tracing.dep.yml rename to .licenses/npm/@azure/core-tracing-1.0.0-preview.8.dep.yml diff --git a/.licenses/npm/@azure/core-tracing-1.0.0-preview.9.dep.yml b/.licenses/npm/@azure/core-tracing-1.0.0-preview.9.dep.yml new file mode 100644 index 0000000000000000000000000000000000000000..105125583985e0349385cfe97217d3af14579bb9 GIT binary patch literal 1454 zcmZ8hU60~66n)RHxZ-I>3NYQb^3)8N!P=0ZBt?cA%{K<9qDDR9guN ze0}fvx)#&vH0aAtENJpu`D4&xUMVf6R+p9RPm|yxw2`V`&@Z!>*~|2-#YKwi?AO5F z&KT;?U0{Z;EA?$bJFPCV7KU1Nownj4T9UmL`dC&dmVHf)XwO1ZCv2l?Lr10Q&V){i z96#l&uR)_aaV}3FXskV(#e9B}wiynyN_BJJHuqwurv7URl<9XfKeXyF?@9y0Im+J0 zPiE#Bi&k4U>*}DDmFNxNJ82&Wvk0bS)Sw}DK`~#lBxeDU6@S|W{exdbMI&g-3yQ~i zdcxs3@K;N9zG-=CEIn1v^yTHt3vFekl~G4KcI<@iq;YAIG>Afr!;Mb5L_~E+M=b=Y zBUMeQPa-6%kl2k7m%)HK*i!b`2$fWU$y1`+Hh^*z*AmgWh)ZKsB}-sZt*W6Dy)CWd zJjxbZc(SlC$?p@BXHQg%vh|2qg1diQ(-o|px*R4d3Ba0jN zF&GaB7lVNtr#Ylf)$-`Rg|~Pf4y`mzNVRnEhry!LxT4=q=={v_M2u)hc|eiy;C=t6 z()YQ%kQH>?BQvgY#Y6hpksNg$2i=1jA)%{Qh|n{C7nOAt=i;bZyklpxQhhC*cRUgA zs=#%5P#58Sja%=Pg>1h9zZ5TK-1hy-G-cb;LEHlbH{wRgLq4p*?Qk#_k3yC$ot5^y z|F=B5>)0^L({=G4WsG=EyDa_2S8PR-D93pc(mO9U>AoOzWKmLlP`ail`Jk^nS%t)Y z-(@V%Db2hFzTL%~q0WC&twFV|`)%=Q;lTihq|v*Sz-od}+;Jy-Ez&n415LiUwLR&!0W} z?z0OiKBV96c5^SrysXyeK{R)M(k_0yzW?dLT;5!nm$x@pi^s+7&4YP$dvD%6Tu;sY z_1*pL)ti_6dMZy{Egl~47eBn=Hyx30=jO_;(ju*4J2&sXhb|^T%87BCD9cQ4qr%i1 z3zb#5Gf|P4xGWOCQViNSJ2jQvR%Oz}Bsgt(1vx&Sq^_>gWy9Z0W!&UI+%f*j>VUzx-0rJ%y{S#PD{N(eH7ri+y@{H7Q&#EU zWlzN%#Tu`wH&Jb{`MQd*xLAwqK_??d>^jQKwQO;~OjA%;k;Iw^LV{Au4O9ZnDn3du z5|~Y`!;WA9O0KIio0_O1lky=G0j89U-!?^pWpI?dEEKiyu-Uyeohc;MetQ z1stA+<^HaTH$gK~v)fov1&|?oLvf(52#Kb4DG`T#Pg8It#&(-@OKPih1$%ET{2k;^ z|M2V^Jb*1rsLLBe6KiT$1E91Gz+PF`QU%$iEufS*g^33{D1L`<__=H*<`kPv@K-fC z)BXb&qK=-@q#?b^yjIvz9NCZHJauFUGUTaaYzTYQL*>T!%R&k{wyBaGK1tHS;E6h z<9$B2Ng5d@&5;`3meq%Ypt8f4gt3oj#C-2EY0-)_a2T)7AZ8vV2u4p)nnla3jUU8E z02EB*1gO9R#DNz^N*R5mgj$daeQZIf^xDG$@Bmdub-+}`y zM%sW|_{Dtsa*L#&q#xmcS-CqK`q-7N(kB@4$r>ui4KzfAaIfP!Fh z4}2eJ0tB=NDuT?Y)*+0ERU&L!W^giS58JHM0y|OKAs!B6yrL)p5GwDiJyvH38$^Au zscaE4Qf2cf)rrQTa;pSM)RV-{+*UT*BUBV0M3GB`J>rNJBotXvX`qc-Vilnz1M}KV z_+zK&1Lp8+Wy{qN5igk;Lv3*s4MY7XS67PRzMWEolXBgFAHr)8Ed}dIsDv~%N{I|E zk^n8A5~Rl-6@oINgiW)(qU4$-LT-q;-fEyn1d4eGGWuM{CKS!TdqL3L8 zsexsd5h@}`v8$+;0;1+QN-dwi4828B3vlZcN4?cfN>y3$mZ0i6mcBysdr zWtUbe<7__K+-$(q(gJU&a;;o{u(SBe&F1-Xa_Kx`c@sN5Q{zI8uwCV1>k}IJdS&fvO>j z6q6-8BGgMyH8h=*hKFaF-Y*kr&N>OM&l`#{8QcE9{GT%ls8?;>` zRw3CTo7lr>IZP2-874rp0Q5GC;1u0A;NPcoSRm}dbgBB!aa+>m8Y$`z;xud(szfMF z6;i$7{zVz?4)}%%|9@HS6b83jIHNOYm6(YHz<`%STt@ymGg~jWvMO2&7<3b%N@K;T z;Uu$ya)o9@+6bE=oICk%n!`<4>%d@L4Dn^VJl%#V1u1lkY(dySw!25$ZN?V5EC3Pl z7xcL;i*XjE7-9HlNAQF{2q6_%`WRfm>z#|LR6KfBA$ma*K7OUTJ?&OQGpFthZGKs> zwBWM{qo{_u4g_H`t$Mfg3$$>)dk+N>MDa!Ekjb#kj^=4=g}GU*3_M!VN(+ZMNK<#3 z$Pj_oo|R~gqRzp>2$n2D&_18`32{*WSEX|^Q6fc(%Z7EF{|r<_CX05iNo$IoSyZS@ zE~tar45Jvr@?m)YY@lQc4FaHukV(Uk7Jm0dV2Mdvz++l?J8{k+i4q(_#35Rpq9frD zW`(L55B+dOx7$*9^_86;k1-h2syfuc8liYh@IwpGPUCPM_Pt3TM!uVyd-M(cq%}bDpiT`rK*z-OhvHsY*4hzlnD0V|I0xIFerAtV}2?kGJJZXM^=5Ggw&ft zoS1n;2>pE9VYRYKV|MXVxDSnJT7us0LUNjhNvE zW5Ev^&Vtnw-4^b|Vvb-k728<#$fJ50q3kiO+NwjHNgQwp*8yKSUxFW(AD}Bfm~B1GeQyb5}B|$ z{2wz+3B%l^0MyLN+CV1%msC0zU=D-cXl2?=u_T4PC&+fn<0|T@9Ky6(d z_NBEPi1^}z2Nr59KQa*sg>*}TE&EUp)}U5qPHOAnW4)r%1+j5>e8=jpb4tWLCLA&L zfGdt8Mx+?FMXLvfrs3KNW>+c*O>VEqv>hRP3rR)?oV3POT>?sLU-lDciWnd5D~)jn z(}KDy0{$Sab~tsR&@bU=ZR&G#^QORQg%e}ikJvCy+2TuI)H9=np*}PXBqBBF>r3`e zkMxu<2rYyW5JIs$^DvYzLjlmXU`3OA?4)*(Np)H4OF)!P$N92QcEA+ z{tb5tFkEDBjZB6o-=aRoFl*mAOvf@HEDgHMhS)9+Lx@;d8ZfXPri9bpkRfjHG$OE! zqol-eyrm@T?CaIbvn8BRp=s!TKx9E{ju26CTaS$F+0Y^44qz;T2Y+xjjuy6_!)!yUe zNLA7@V;zpKyy~Q}(|)JqgMuFykFT$%NP9Q4#m%ex#m%3uf4aVToSL7m?_d51ZZCgW zyk0#1ED(FOc)YoO@K;1G6`i}wdlbTNUSHmuyEpfDw-47oyZck!jHft|WeZ)UgcmbK zV(Fo{H6oq8PS3DvRc>+m1+<6)RzM&h!zy64Z9rOBb$E*~{LZDxQ=C<)`+#)eT#3_n zj-14wC0T^?aXHIJH0ch=+t}ATZI91?p94ZTM)BhgsPAcM> zaq0^co||OpQjVB~$u;LNgL9&GYX}k7#5O7=M#}?V@{xFumhkLSn=*rTU~gZDc(X@2 z?rR`m^|F#ed*!3Q{Nc7}(TC$>EP(@}f$_&Sh$mq-&V$m#6K2dHK~9swKl})jHh)q9 z7-(R~$-fU;y`@FN$X=krz`%G6nJ|;_MpiLekrD(d;~lx<&~iuQXV5q|SeGS+;TT#f zQac{PBJOT^jg6Mix5!60ro)j?gZU(uql8~Ig})mm#$lob+)&voLVnD_(-vL=(faWW zSO;Jct869&8(l~n1f1@$B1&)&4G;v);K~ntS&+}KghCLq_m)4-&1KAyFMYL*w5yKeP085+peGYztz^k=a@v48a%CkRA!G`t z5nRp-wDlw85Jhn|0BqVEx7-Fk3|_pd3H6{392od{C>xCA9FNFNGDk;t2ww~k5{6hg zDFH)?FgHKqP82#hZW-930!7DVPrR2^ZZ@I)QnZkfB*?L)3Wu!}yZzeX_`eUy!Z#0L z*o242H7)N_UQPuQUsB6-93WynDS?7I54u_nbcG{Zv|4@@?jQJU+ow|K2}a4KET*5( zjXSL>b`S;{xqcK*F~cMtF&;A?AT$i2Q6ddWG*Cpz;ENnZ4d6uyh}}A%a$i~6nqIuD zM{LJa5AeH)V&7JW*)4r+mD((EnBT{URM021w&aPjMcp%b_g){dqr~Gx zCS+A%nt+oiov!voEk@_np!!WP99-K8M-LRCZ`!>Pgk4nOsU6gO%z53t zI*A;jf_}ggRq+P%ZPkIi><)h4?eXuuc_%V}=YCJQ&+)#)XNW#+-9r9`xSX25_Lq^( zDIe(W_n!T!l^7t9=>&s`Z)d_01xJZI{R8hzYw#k5+7JiZ9@KVC;m?6ixs*Asp1XGs z1Lht3oXmaU+H<(EEmyi*c0(KfnaYWg=y?4T?k%>Yy2=!0ZfnS%RcJv!0GNETWB5O| z3nnxPohl!Y;%Ke51!ZvMXDP98UlYw!v2FlNlq5(yQj+U}7>T2mvF|b5p^S5VJ^uds z^6IDSdCsNbg8WRV1W@5ZyP4t2wl(j9UEaUT{9*pAsj~Ot3v$&~M-XrBcevJ%s%Vz7 zmVDpe_FqN`YRkF*b)J6l&i~v!t%awSAUE#GeI=a&_f@}d>ilp1qRtE9;`jW*AB(9k zV%$`WaC_y&wwm>ip)6oc;GgsSXiW?l`pUN%&X-xaJkK#!x7B(7rh+k@j>o!7^Yt8; zKpFbyX?ZT(wQmf}yv_awo6YD71r_(btM{3Gu|g8@JSUcyEfJ>CaUPf^iO@XHl3ZRy z_`<6g=bVByPBy`z(&h!;nD_uoJ9&qrdxc|$cServJhb6IvhVkU&Axg5YWR+b+V1J< zSCcidPqTkq-XR0OrO3bMec~73(yJOTogcp5)2|2Al$Qz8 z=BuXK6L-J3^KZU;Hc&ha0o9AIdK$dnW@-Hyj$)i5HN+L;0Nn*t2lVi=&$;Av07^)a z`lil(`}B_QBc-wXb?66T!yP!@K#|HS;@8z9k>+BMUbvt-t?CermAgCM( z{!8y$LG{+Q5$Y2T4%)rNQB3}38xaPeA0Uc&{+sQ@WZ}07(D==E3iLz9l;&*~Q)9Qt!7|Q*84S*W`Ir?Jvw7mOr-3%}-cnt~?F%Ix3>Itxh&& zZnyaB!ffh#>n_gE*J-_Jmh-sG&$<1q-+#c(>{s{Cm5q|zo@8lk3kMR>Hi|cP_I&=V z{mxyS%#16WDz@&zyjon{+&xyU#0;c)$4REx+lAd_OnWc9j-s4GX$?_dRqm2~tjs+eBGr zavK$<-dL!t%AJXd!~h40UujllWg2Ivrn1|rOq!Skr!B7_$LEvO)m6G|_?wBGNw~F5 z%yMrYtgLY6d+bq_&3a@0WXcsjq zN}yTAM+rs(v#E915iHQzsxq6Js3Mc{Ark?nl#JgtMS^8;l)NkyweYan!I3;Izwz9> z#6rrvZK`eQuv4e$4h-6MlR#-AAaLe1J@d=Uovo%YYX$3(nG|^7-&0eUCXN6IKBrjn zKZ`~xlZ)%qu-xA@@g`_yYIYkdssJ)%ZzvA*6(P~oE+yiy?`aB-#Mo|=Zb@yGu3+!2 zg};OR>F=I>hX=4_33Yj6Xktz6Y57RlqTGZond`m9 z;FVq3ssai5m0p`iAGu9lCMm>>BoJuhr$wAKq8d1^DazVpX`a>~0UNt=RqqHvA6j9o z1Qu!iRfs96{6j#pj~%OY-Bj`n%$3EPPy<$ar-L$tjGZgjJl6#D=SF!Es_rVKRul22vmoz8)w*D>FzQ zQYJjSG~VZPo1~Fp>Kv)zU0HoR2r4^#Nf`ThM$GpvlNPN=1BdbI3}WU{f?)I%rCGGh z+W0|y1VF(=PJjwLKpc2sq?FM|N~i^?(8m^pO0PXE01r@gRM$+y0u&M_*NV(3oWXvI z@+~;PVx$eYg5l1X2p~#X-18vk2s|Y0- znAdK?A3H@KFo$0&TdszPxMF4uwZ&014E3X2T`7k9c1jIS%5?*N2(Ll36s#wq64KNt zB{H~30Mvy@T`V!u3k&p%rA0lsf?5>4BfA|U&}$O7le$j|$ElfgvP~2{7MrXwL#T%d&^^Sc zgAm}S29{YysE8oNuA*KFh??gpwS4|E^cF=ez^zjp^;SD6RmHI+kiZoO(SMZc6uIGE z&`8f4vS|v;uK|2lgQ7}{U{Pu}I5Z1Xqr&x(EzBy;|Apfc$8gpiM#m3=ZMs)L7rFA+D~mt9Ln9sONiyRY21{J zgTtfW`^fN#sv86=R%nV=VqLl}B&Ptbv>o|4j#j3i$t@yKB)wwm+w;kwN$K2v)CY7b zppeATH2RbLLBR@%QE_f< zjRI9e6e%W4c1X}uI7TrOR5)mWA7`k%sx|(s%6*j8``N0p_>`j1d@5rm2BnrhC}qBl zW;STMMyx`zLpHI8(Q=p~w#^djp;-WWn?-Pn?i=v$Q#vdV_F%eH{pYwX>2i$}^#^ep zwhC1ul%@))-f;h-4EF~3h6(?FS?v@Cw_7-)Gia5Vi3GramqT1e{y8&SFSoKPS_>F- z6QN3D#i`*Wvx0JkW<=Tun<1P#`EQ!TO<3!|U|kIHWxG7xhA9Opbc<|3*g&?sN84@2 z7P>3|5%CxFxh;!v7Nrg#SdQ~BMK@&cHrMf-sRzowV z?hI{yS+KO=vk0T8hPn;}VKS|HxAY6NaK3vF1rbE?Mdy&ou+5IiLcWC{%epoox3!;lt!_eEfdNn5~UT6jBg&LD{r974n) zTAiXJ;Sgqpsu>Uca7DM1oga@e7}Kgc)WI5|cuep^3(!vEa31!(Ngqajn45d_ z5B-#EE-d8HzK@XONQQVSK$j|2iSf0nlMYNpu=8wCw9AwT_Tc}^K?N`HXn?mFQ6Q~(K^Wj2C~BD;-91=s979Yva)y##h66L{qbjMsm!v9XBCGRN&6i1NpQgXo-0 z_zeehCSCRMiYa>C&dQHrtE|Rg?nD9StU*mb0rWM&0YafQ`s`RfDPYjm`V@g&QzbJ( z5%Ut6usQr6GfWHxaJ03xQ8hP@5S55v96YXig#|e!@Z$nj#**+cHtNU!tdb7d3jQeZ z-%k`m%Na1BU|!n`1=S4d4gwf`}4Z)IEln?gZEVa+>z#jtx zv-v=6T^#nMwH%1};)4ekYAio85ebEKOM)%?P!HCiR%T9W>)~U)qS6Jiad>>k>aKH2 z#62b)G4_Bfjw42-7`8>L2ZpBM+6iV?DhN$(ugJ6=A$to+MhBd<##LPcN^4*C6K9GT zAMGoRaR<|ax+?;HC#`lkb)nE#aI`k{xw&~;;IzVtG3_U87^iIUr7!B4(ZWz4ng$Y) z8uaxg`{ze`N*II|!UzbVSe|(p%9o)4Xj`zN$vt*bJIJKEto0=zN3o$v$|KbeK3Yi_zKW&`P#?1ywj|tNa-sJ4I~|b>{MWgx0nQf~g;Q{u}^;?19pO z6^gV7>ST__2#1}%gi-==;*CjQS6Oi?Xsailo3PNrM`#wVz%z3hk9TElYg&z@z74N1 zTS5yYCwVL)9Hz!R%wgY*3140E>V@Z>wx#~5bqJBR65285+Sm)Q{8#bF2$3rhnA*29!=+8Z*& z4W32>mT{Dn7>>7;WSxDzdU>{l6Dl+f-4BQ?Xw4DUkV+<(4`%T&F+W{CEFQGN-z^@0 zzI*#<-d*0`U*0}0ZXOKoSg0!(cQ0|h;urJpi`#3ITtFOzM^wO(4GgIRBL*87NhB)X?QC)T@_upqmz&o&w~tfv`sV)X zXK;J@)8f_Q@fU&E%f;jE&4a%pa;fONxx7aq{Pxx5y?OKY{>|OPjnD4>R5#-(4rJLv zS1IAeOp#c6C~l2NXRp&UtXh>@oPGfSZy1S7FHeJA`HKCY4Q|jRq8$> zT{u_b^qnIo@n=aE;e1@q@)1qC1M)WZ^-kO4^N({t2*)UX+yV8yN~0yF^#tgmfL|N? z#FR-ac{=zC^9xi2Fe)Yr8W!yZ1ppMMeYj!J8Pybaou#M*V|zB05)C7LOdgf>EM3YGvoN{l9AsjC=ur7XWWTGC&w)VTU4Ovxa^7dvdYaSv|oxAGLi&2wp8J;m14JFI~@P_ zAzAq5Aq<=F@VKVsUCPU;VB$+^nT`WQtS2QeZ_qo@JAC;_os2UPAW zOIy>6m-UG4cToD@gEm7FLlJ~#dpNRE1~>NSYj~f_dw_O z_>GI8V!1XWF|3=OD4~}nJgvgG0VT0-tHbP;KDJ72mN?AsV?-+G6IxsHMA@S5nY{m? zkJwS-aUv74sxVE!Nt8}kd!iPj^LAP=H>cNS@!Re`h+>HQwwwIZ86?GL8R|I9k%1Jn zBpp9Ym-tzg35t+JJouN}BTsw^Q+7Wih=Bge%P)HA4l6ATB}cEZsEMd+J$ZvZW#s$WIDlM;@g>UM8Q!aPyfI>(;B>pp*F<9wgMB#1xve34R-py` z0ATXjj^Q6{7ffgpI#oU(#nD=A3(DZi&r)LHz9yQdV%-3kC`piZq$Jk`F%m~BW8Y)A zLmB7#di?#(<@M{EdCsNbg8WRV1W@5ZyP4t2wl(jAT|T_e{9*pAsj?5^3v$&~M-XrB z_qf)Ns%Vz7mi*A)_FqN`YRkF*b)J6p&i~v!t%awSAUE#GeIuO$_f>yv>ilp1qRtE9 z;y3)lAB(9kV%$`WaC_y&w!(`KU{)SOS-_gWKj-<;niw$jjc+rYFSBxao@1p3ogGW5^W@?5xU-x!#AoBa(oo6!{tD(**D?=$;ig(Tv6PAo55B21&> zJTOfXp?RJqxx9$*l~*y&IR$H+Y=T3j%?rFS@e!7G@(xG$3dclH2%U_HFTi1R~`7c!rYyqc5o6tCP2Z0=@Guyp`mIAtCsNl0aNzzG|vH d9pzVd{@oAH1^@wIG(;rI_ymvFhTeZT`8%oYal!xq literal 0 HcmV?d00001 diff --git a/.licenses/npm/@opentelemetry/context-base.dep.yml b/.licenses/npm/@opentelemetry/context-base-0.6.1.dep.yml similarity index 100% rename from .licenses/npm/@opentelemetry/context-base.dep.yml rename to .licenses/npm/@opentelemetry/context-base-0.6.1.dep.yml diff --git a/.licenses/npm/node-fetch.dep.yml b/.licenses/npm/node-fetch.dep.yml index 109c6d07ba8c1f0dc04fb7b56d253090019e3cd2..0139d5fe0012a35c1dd691dcc054682d8f6fd26f 100644 GIT binary patch delta 311 zcmZvW!43g26h*^EVk`DSNGzt!6k|p*5s9xL7M=F#G&)n-5*FeY{EArlCm(?zA-v^% zH|N|-NeJHS|G0@+l8;ucAbUo{-~QRMf+ZkGgM zhXhfN44GEi#7)xalQ0^OT8bv1;_;K)vTmm!o-67+yINBN<=XwGZ|z}i)Q9yIBO&l) zo8+8j&$?bhe)lL~PHy05?Drcno#9+_@aEuHiWABfU@Wp5@k47qaNisLz|O}~yLba^ CR%?U+ delta 17 YcmaDOx>I<95~IOJZ@>%oaty{C!b^s|$D3>&LKV1ai^iMZ{PEt1~Q|$H*KCi#Pv{;+k z)>{WjZJOHT-bTDM%gTRd+LVR$GlHw3wYm#yly{-5H^uhUMJhmEZTdLXrm)TwtJZ07 z`@*7&tvlvMhmrH@tY`^qz7B za^hL99NtkpA##^e7@=Rn9|BU&Xu?R^#Q_9ORM#^Ze_8+*CK;aT_c{sL76B@#oTtjqGZNX`%jQOt6ZE zo@g^FaAT$<@JE*?6nCPkb{K)n8-KpsJp6ch^ZPfS;N~M=e&ln5dLdFG9EVpf79= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __exportStar = function(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); + }; + + __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + }) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }; + + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + __classPrivateFieldGet = function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); + }; + + __classPrivateFieldSet = function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); +}); + + +/***/ }), +/* 145 */, +/* 146 */, +/* 147 */ /***/ (function(__unusedmodule, exports) { "use strict"; @@ -3560,14 +4026,16 @@ exports.fromPromise = function (fn) { /***/ }), - -/***/ 151: +/* 148 */, +/* 149 */, +/* 150 */, +/* 151 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; -/*! - * Copyright 2020, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -3582,32 +4050,35 @@ exports.fromPromise = function (fn) { * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const NoopSpan_1 = __webpack_require__(767); +exports.NOOP_TRACER = exports.NoopTracer = void 0; +var NoopSpan_1 = __webpack_require__(767); /** * No-op implementations of {@link Tracer}. */ -class NoopTracer { - getCurrentSpan() { - return NoopSpan_1.NOOP_SPAN; +var NoopTracer = /** @class */ (function () { + function NoopTracer() { } + NoopTracer.prototype.getCurrentSpan = function () { + return NoopSpan_1.NOOP_SPAN; + }; // startSpan starts a noop span. - startSpan(name, options) { + NoopTracer.prototype.startSpan = function (name, options) { return NoopSpan_1.NOOP_SPAN; - } - withSpan(span, fn) { + }; + NoopTracer.prototype.withSpan = function (span, fn) { return fn(); - } - bind(target, span) { + }; + NoopTracer.prototype.bind = function (target, span) { return target; - } -} + }; + return NoopTracer; +}()); exports.NoopTracer = NoopTracer; exports.NOOP_TRACER = new NoopTracer(); //# sourceMappingURL=NoopTracer.js.map /***/ }), - -/***/ 152: +/* 152 */ /***/ (function(module, __unusedexports, __webpack_require__) { var Stream = __webpack_require__(794).Stream; @@ -3720,8 +4191,11 @@ DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { /***/ }), - -/***/ 157: +/* 153 */, +/* 154 */, +/* 155 */, +/* 156 */, +/* 157 */ /***/ (function(module, __unusedexports, __webpack_require__) { var async = __webpack_require__(751) @@ -3802,14 +4276,25 @@ function runJob(iterator, key, item, callback) /***/ }), +/* 158 */ +/***/ (function(__unusedmodule, exports) { -/***/ 162: +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=Time.js.map + +/***/ }), +/* 159 */, +/* 160 */, +/* 161 */, +/* 162 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; -/*! - * Copyright 2019, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -3824,23 +4309,61 @@ function runJob(iterator, key, item, callback) * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const NoopTracer_1 = __webpack_require__(151); +exports.NOOP_TRACER_PROVIDER = exports.NoopTracerProvider = void 0; +var NoopTracer_1 = __webpack_require__(151); /** - * An implementation of the {@link TracerProvider} which returns an impotent Tracer - * for all calls to `getTracer` + * An implementation of the {@link TracerProvider} which returns an impotent + * Tracer for all calls to `getTracer`. + * + * All operations are no-op. */ -class NoopTracerProvider { - getTracer(_name, _version) { - return NoopTracer_1.NOOP_TRACER; +var NoopTracerProvider = /** @class */ (function () { + function NoopTracerProvider() { } -} + NoopTracerProvider.prototype.getTracer = function (_name, _version) { + return NoopTracer_1.NOOP_TRACER; + }; + return NoopTracerProvider; +}()); exports.NoopTracerProvider = NoopTracerProvider; exports.NOOP_TRACER_PROVIDER = new NoopTracerProvider(); //# sourceMappingURL=NoopTracerProvider.js.map /***/ }), +/* 163 */, +/* 164 */, +/* 165 */ +/***/ (function(__unusedmodule, exports) { -/***/ 173: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=Plugin.js.map + +/***/ }), +/* 166 */, +/* 167 */, +/* 168 */, +/* 169 */, +/* 170 */, +/* 171 */, +/* 172 */, +/* 173 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -3953,8 +4476,85 @@ var _default = v1; exports.default = _default; /***/ }), +/* 174 */, +/* 175 */, +/* 176 */, +/* 177 */, +/* 178 */, +/* 179 */, +/* 180 */, +/* 181 */, +/* 182 */, +/* 183 */, +/* 184 */, +/* 185 */, +/* 186 */, +/* 187 */, +/* 188 */, +/* 189 */ +/***/ (function(__unusedmodule, exports) { -/***/ 197: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=ObserverResult.js.map + +/***/ }), +/* 190 */, +/* 191 */, +/* 192 */, +/* 193 */, +/* 194 */, +/* 195 */, +/* 196 */ +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RefKey = exports.Events = exports.State = exports.Outputs = exports.Inputs = void 0; +var Inputs; +(function (Inputs) { + Inputs["Key"] = "key"; + Inputs["Path"] = "path"; + Inputs["RestoreKeys"] = "restore-keys"; + Inputs["UploadChunkSize"] = "upload-chunk-size"; +})(Inputs = exports.Inputs || (exports.Inputs = {})); +var Outputs; +(function (Outputs) { + Outputs["CacheHit"] = "cache-hit"; +})(Outputs = exports.Outputs || (exports.Outputs = {})); +var State; +(function (State) { + State["CachePrimaryKey"] = "CACHE_KEY"; + State["CacheMatchedKey"] = "CACHE_RESULT"; +})(State = exports.State || (exports.State = {})); +var Events; +(function (Events) { + Events["Key"] = "GITHUB_EVENT_NAME"; + Events["Push"] = "push"; + Events["PullRequest"] = "pull_request"; +})(Events = exports.Events || (exports.Events = {})); +exports.RefKey = "GITHUB_REF"; + + +/***/ }), +/* 197 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -4005,8 +4605,19 @@ var _default = parse; exports.default = _default; /***/ }), - -/***/ 210: +/* 198 */, +/* 199 */, +/* 200 */, +/* 201 */, +/* 202 */, +/* 203 */, +/* 204 */, +/* 205 */, +/* 206 */, +/* 207 */, +/* 208 */, +/* 209 */, +/* 210 */ /***/ (function(__unusedmodule, exports) { // Generated by CoffeeScript 1.12.7 @@ -4024,22 +4635,55 @@ exports.default = _default; /***/ }), - -/***/ 211: +/* 211 */ /***/ (function(module) { module.exports = require("https"); /***/ }), - -/***/ 213: +/* 212 */, +/* 213 */ /***/ (function(module) { module.exports = require("punycode"); /***/ }), +/* 214 */, +/* 215 */, +/* 216 */, +/* 217 */, +/* 218 */, +/* 219 */, +/* 220 */ +/***/ (function(__unusedmodule, exports) { -/***/ 226: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=SpanOptions.js.map + +/***/ }), +/* 221 */, +/* 222 */, +/* 223 */, +/* 224 */, +/* 225 */, +/* 226 */ /***/ (function(__unusedmodule, exports) { "use strict"; @@ -4104,8 +4748,9 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ }), - -/***/ 229: +/* 227 */, +/* 228 */, +/* 229 */ /***/ (function(__unusedmodule, exports) { "use strict"; @@ -4180,8 +4825,51 @@ exports.isTokenCredential = isTokenCredential; /***/ }), +/* 230 */, +/* 231 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { -/***/ 238: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(__webpack_require__(328), exports); +__exportStar(__webpack_require__(715), exports); +__exportStar(__webpack_require__(924), exports); +//# sourceMappingURL=index.js.map + +/***/ }), +/* 232 */, +/* 233 */, +/* 234 */, +/* 235 */, +/* 236 */, +/* 237 */, +/* 238 */ /***/ (function(__unusedmodule, exports) { "use strict"; @@ -4195,8 +4883,9 @@ var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[ exports.default = _default; /***/ }), - -/***/ 241: +/* 239 */, +/* 240 */, +/* 241 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -4280,19 +4969,10 @@ function _default(name, version, hashfunc) { } /***/ }), - -/***/ 242: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -__webpack_require__(71); - - -/***/ }), - -/***/ 245: +/* 242 */, +/* 243 */, +/* 244 */, +/* 245 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -4321,8 +5001,12 @@ var _default = md5; exports.default = _default; /***/ }), - -/***/ 251: +/* 246 */, +/* 247 */, +/* 248 */, +/* 249 */, +/* 250 */, +/* 251 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -4558,8 +5242,12 @@ exports.downloadCacheStorageSDK = downloadCacheStorageSDK; //# sourceMappingURL=downloadUtils.js.map /***/ }), - -/***/ 257: +/* 252 */, +/* 253 */, +/* 254 */, +/* 255 */, +/* 256 */, +/* 257 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -5350,8 +6038,12 @@ exports.downloadCacheStorageSDK = downloadCacheStorageSDK; /***/ }), - -/***/ 263: +/* 258 */, +/* 259 */, +/* 260 */, +/* 261 */, +/* 262 */, +/* 263 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -5360,9 +6052,9 @@ exports.downloadCacheStorageSDK = downloadCacheStorageSDK; Object.defineProperty(exports, '__esModule', { value: true }); var api = __webpack_require__(440); -var tslib = __webpack_require__(422); +var tslib = __webpack_require__(144); -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. /** * A no-op implementation of Span that can safely be used without side-effects. */ @@ -5433,7 +6125,7 @@ var NoOpSpan = /** @class */ (function () { return NoOpSpan; }()); -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. /** * A no-op implementation of Tracer that can be used when tracing * is disabled. @@ -5474,13 +6166,13 @@ var NoOpTracer = /** @class */ (function () { return NoOpTracer; }()); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. function getGlobalObject() { return global; } -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // V1 = OpenTelemetry 0.1 // V2 = OpenTelemetry 0.2 // V3 = OpenTelemetry 0.6.1 @@ -5521,7 +6213,7 @@ function getCache() { return cache; } -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. var defaultTracer; function getDefaultTracer() { if (!defaultTracer) { @@ -5549,8 +6241,8 @@ function getTracer() { return cache.tracer; } -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. /** * @ignore * @internal @@ -5574,6 +6266,7 @@ var OpenCensusTraceStateWrapper = /** @class */ (function () { return OpenCensusTraceStateWrapper; }()); +// Copyright (c) Microsoft Corporation. function isWrappedSpan(span) { return !!span && span.getWrappedSpan !== undefined; } @@ -5683,6 +6376,7 @@ var OpenCensusSpanWrapper = /** @class */ (function () { return OpenCensusSpanWrapper; }()); +// Copyright (c) Microsoft Corporation. /** * An implementation of OpenTelemetry Tracer that wraps an OpenCensus Tracer. */ @@ -5733,6 +6427,7 @@ var OpenCensusTracerWrapper = /** @class */ (function () { return OpenCensusTracerWrapper; }()); +// Copyright (c) Microsoft Corporation. /** * A mock span useful for testing. */ @@ -5820,6 +6515,7 @@ var TestSpan = /** @class */ (function (_super) { return TestSpan; }(NoOpSpan)); +// Copyright (c) Microsoft Corporation. /** * A mock tracer useful for testing */ @@ -5940,8 +6636,8 @@ var TestTracer = /** @class */ (function (_super) { return TestTracer; }(NoOpTracer)); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. var VERSION = "00"; /** * Generates a `SpanContext` given a `traceparent` header value. @@ -6002,8 +6698,8 @@ exports.setTracer = setTracer; /***/ }), - -/***/ 265: +/* 264 */, +/* 265 */ /***/ (function(module) { // Generated by CoffeeScript 1.12.7 @@ -6037,8 +6733,67 @@ exports.setTracer = setTracer; /***/ }), +/* 266 */, +/* 267 */, +/* 268 */, +/* 269 */, +/* 270 */, +/* 271 */, +/* 272 */, +/* 273 */, +/* 274 */, +/* 275 */, +/* 276 */ +/***/ (function(__unusedmodule, exports) { -/***/ 280: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=Logger.js.map + +/***/ }), +/* 277 */, +/* 278 */ +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=CorrelationContext.js.map + +/***/ }), +/* 279 */, +/* 280 */ /***/ (function(module, exports) { exports = module.exports = SemVer @@ -7640,8 +8395,7 @@ function coerce (version, options) { /***/ }), - -/***/ 281: +/* 281 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -7672,15 +8426,27 @@ exports.create = create; //# sourceMappingURL=glob.js.map /***/ }), - -/***/ 293: +/* 282 */, +/* 283 */, +/* 284 */, +/* 285 */, +/* 286 */, +/* 287 */, +/* 288 */, +/* 289 */, +/* 290 */, +/* 291 */, +/* 292 */, +/* 293 */ /***/ (function(module) { module.exports = require("buffer"); /***/ }), - -/***/ 297: +/* 294 */, +/* 295 */, +/* 296 */, +/* 297 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -7901,8 +8667,7 @@ exports.DefaultGlobber = DefaultGlobber; //# sourceMappingURL=internal-globber.js.map /***/ }), - -/***/ 298: +/* 298 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -7924,15 +8689,19 @@ var _default = v3; exports.default = _default; /***/ }), - -/***/ 304: +/* 299 */, +/* 300 */, +/* 301 */, +/* 302 */, +/* 303 */, +/* 304 */ /***/ (function(module) { module.exports = require("string_decoder"); /***/ }), - -/***/ 306: +/* 305 */, +/* 306 */ /***/ (function(module, __unusedexports, __webpack_require__) { var concatMap = __webpack_require__(896); @@ -8139,8 +8908,12 @@ function expand(str, isTop) { /***/ }), - -/***/ 312: +/* 307 */, +/* 308 */, +/* 309 */, +/* 310 */, +/* 311 */, +/* 312 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -8211,8 +8984,44 @@ function expand(str, isTop) { /***/ }), +/* 313 */, +/* 314 */, +/* 315 */, +/* 316 */, +/* 317 */, +/* 318 */ +/***/ (function(__unusedmodule, exports) { -/***/ 327: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=BatchObserverResult.js.map + +/***/ }), +/* 319 */, +/* 320 */, +/* 321 */, +/* 322 */, +/* 323 */, +/* 324 */, +/* 325 */, +/* 326 */, +/* 327 */ /***/ (function(__unusedmodule, exports) { "use strict"; @@ -8235,8 +9044,34 @@ var MatchKind; //# sourceMappingURL=internal-match-kind.js.map /***/ }), +/* 328 */ +/***/ (function(__unusedmodule, exports) { -/***/ 332: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map + +/***/ }), +/* 329 */, +/* 330 */, +/* 331 */, +/* 332 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -8433,8 +9268,8 @@ exports.MemoryCookieStore = MemoryCookieStore; /***/ }), - -/***/ 334: +/* 333 */, +/* 334 */ /***/ (function(module, __unusedexports, __webpack_require__) { module.exports = @@ -8446,8 +9281,10 @@ module.exports = /***/ }), - -/***/ 338: +/* 335 */, +/* 336 */, +/* 337 */, +/* 338 */ /***/ (function(__unusedmodule, exports) { "use strict"; @@ -8530,15 +9367,66 @@ exports.Store = Store; /***/ }), +/* 339 */, +/* 340 */ +/***/ (function(__unusedmodule, exports) { -/***/ 343: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SamplingDecision = void 0; +/** + * A sampling decision that determines how a {@link Span} will be recorded + * and collected. + */ +var SamplingDecision; +(function (SamplingDecision) { + /** + * `Span.isRecording() === false`, span will not be recorded and all events + * and attributes will be dropped. + */ + SamplingDecision[SamplingDecision["NOT_RECORD"] = 0] = "NOT_RECORD"; + /** + * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags} + * MUST NOT be set. + */ + SamplingDecision[SamplingDecision["RECORD"] = 1] = "RECORD"; + /** + * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags} + * MUST be set. + */ + SamplingDecision[SamplingDecision["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; +})(SamplingDecision = exports.SamplingDecision || (exports.SamplingDecision = {})); +//# sourceMappingURL=SamplingResult.js.map + +/***/ }), +/* 341 */, +/* 342 */, +/* 343 */ /***/ (function(module) { module.exports = require("timers"); /***/ }), - -/***/ 347: +/* 344 */, +/* 345 */, +/* 346 */, +/* 347 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -8579,8 +9467,7 @@ module.exports = require("timers"); /***/ }), - -/***/ 348: +/* 348 */ /***/ (function(__unusedmodule, exports) { "use strict"; @@ -8648,8 +9535,8 @@ exports.pathMatch = pathMatch; /***/ }), - -/***/ 350: +/* 349 */, +/* 350 */ /***/ (function(__unusedmodule, exports) { // Generated by CoffeeScript 1.12.7 @@ -8689,15 +9576,34 @@ exports.pathMatch = pathMatch; /***/ }), - -/***/ 357: +/* 351 */, +/* 352 */, +/* 353 */, +/* 354 */, +/* 355 */, +/* 356 */, +/* 357 */ /***/ (function(module) { module.exports = require("assert"); /***/ }), - -/***/ 373: +/* 358 */, +/* 359 */, +/* 360 */, +/* 361 */, +/* 362 */, +/* 363 */, +/* 364 */, +/* 365 */, +/* 366 */, +/* 367 */, +/* 368 */, +/* 369 */, +/* 370 */, +/* 371 */, +/* 372 */, +/* 373 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -8706,19 +9612,19 @@ module.exports = require("assert"); Object.defineProperty(exports, '__esModule', { value: true }); var coreHttp = __webpack_require__(999); -var tslib = __webpack_require__(422); +var tslib = __webpack_require__(815); var api = __webpack_require__(440); var logger$1 = __webpack_require__(928); var abortController = __webpack_require__(106); var os = __webpack_require__(87); var stream = __webpack_require__(794); -var fs = __webpack_require__(747); -var util = __webpack_require__(669); +__webpack_require__(510); var crypto = __webpack_require__(417); +var coreLro = __webpack_require__(889); var events = __webpack_require__(614); var coreTracing = __webpack_require__(263); -var coreLro = __webpack_require__(889); -__webpack_require__(242); +var fs = __webpack_require__(747); +var util = __webpack_require__(669); /* * Copyright (c) Microsoft Corporation. All rights reserved. @@ -8862,7 +9768,7 @@ var DataLakeStorageError = { name: "Composite", className: "DataLakeStorageError", modelProperties: { - error: { + dataLakeStorageErrorDetails: { xmlName: "error", serializedName: "error", type: { @@ -8903,12 +9809,12 @@ var AccessPolicy = { } } }; -var BlobProperties = { +var BlobPropertiesInternal = { xmlName: "Properties", - serializedName: "BlobProperties", + serializedName: "BlobPropertiesInternal", type: { name: "Composite", - className: "BlobProperties", + className: "BlobPropertiesInternal", modelProperties: { createdOn: { xmlName: "Creation-Time", @@ -9161,16 +10067,96 @@ var BlobProperties = { type: { name: "DateTimeRfc1123" } + }, + tagCount: { + xmlName: "TagCount", + serializedName: "TagCount", + type: { + name: "Number" + } + }, + expiresOn: { + xmlName: "Expiry-Time", + serializedName: "Expiry-Time", + type: { + name: "DateTimeRfc1123" + } + }, + isSealed: { + xmlName: "Sealed", + serializedName: "Sealed", + type: { + name: "Boolean" + } + }, + rehydratePriority: { + xmlName: "RehydratePriority", + serializedName: "RehydratePriority", + type: { + name: "String" + } } } } }; -var BlobItem = { - xmlName: "Blob", - serializedName: "BlobItem", +var BlobTag = { + xmlName: "Tag", + serializedName: "BlobTag", type: { name: "Composite", - className: "BlobItem", + className: "BlobTag", + modelProperties: { + key: { + xmlName: "Key", + required: true, + serializedName: "Key", + type: { + name: "String" + } + }, + value: { + xmlName: "Value", + required: true, + serializedName: "Value", + type: { + name: "String" + } + } + } + } +}; +var BlobTags = { + xmlName: "Tags", + serializedName: "BlobTags", + type: { + name: "Composite", + className: "BlobTags", + modelProperties: { + blobTagSet: { + xmlIsWrapped: true, + xmlName: "TagSet", + xmlElementName: "Tag", + required: true, + serializedName: "BlobTagSet", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BlobTag" + } + } + } + } + } + } +}; +var BlobItemInternal = { + xmlName: "Blob", + serializedName: "BlobItemInternal", + type: { + name: "Composite", + className: "BlobItemInternal", modelProperties: { name: { xmlName: "Name", @@ -9196,13 +10182,27 @@ var BlobItem = { name: "String" } }, + versionId: { + xmlName: "VersionId", + serializedName: "VersionId", + type: { + name: "String" + } + }, + isCurrentVersion: { + xmlName: "IsCurrentVersion", + serializedName: "IsCurrentVersion", + type: { + name: "Boolean" + } + }, properties: { xmlName: "Properties", required: true, serializedName: "Properties", type: { name: "Composite", - className: "BlobProperties" + className: "BlobPropertiesInternal" } }, metadata: { @@ -9216,6 +10216,26 @@ var BlobItem = { } } } + }, + blobTags: { + xmlName: "Tags", + serializedName: "BlobTags", + type: { + name: "Composite", + className: "BlobTags" + } + }, + objectReplicationMetadata: { + xmlName: "OrMetadata", + serializedName: "ObjectReplicationMetadata", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } } } } @@ -9237,7 +10257,7 @@ var BlobFlatListSegment = { element: { type: { name: "Composite", - className: "BlobItem" + className: "BlobItemInternal" } } } @@ -9358,7 +10378,7 @@ var BlobHierarchyListSegment = { element: { type: { name: "Composite", - className: "BlobItem" + className: "BlobItemInternal" } } } @@ -9643,6 +10663,20 @@ var ContainerProperties = { type: { name: "Boolean" } + }, + deletedOn: { + xmlName: "DeletedTime", + serializedName: "DeletedTime", + type: { + name: "DateTimeRfc1123" + } + }, + remainingRetentionDays: { + xmlName: "RemainingRetentionDays", + serializedName: "RemainingRetentionDays", + type: { + name: "Number" + } } } } @@ -9662,6 +10696,20 @@ var ContainerItem = { name: "String" } }, + deleted: { + xmlName: "Deleted", + serializedName: "Deleted", + type: { + name: "Boolean" + } + }, + version: { + xmlName: "Version", + serializedName: "Version", + type: { + name: "String" + } + }, properties: { xmlName: "Properties", required: true, @@ -9686,6 +10734,72 @@ var ContainerItem = { } } }; +var DelimitedTextConfiguration = { + serializedName: "DelimitedTextConfiguration", + type: { + name: "Composite", + className: "DelimitedTextConfiguration", + modelProperties: { + columnSeparator: { + xmlName: "ColumnSeparator", + required: true, + serializedName: "ColumnSeparator", + type: { + name: "String" + } + }, + fieldQuote: { + xmlName: "FieldQuote", + required: true, + serializedName: "FieldQuote", + type: { + name: "String" + } + }, + recordSeparator: { + xmlName: "RecordSeparator", + required: true, + serializedName: "RecordSeparator", + type: { + name: "String" + } + }, + escapeChar: { + xmlName: "EscapeChar", + required: true, + serializedName: "EscapeChar", + type: { + name: "String" + } + }, + headersPresent: { + xmlName: "HasHeaders", + required: true, + serializedName: "HeadersPresent", + type: { + name: "Boolean" + } + } + } + } +}; +var JsonTextConfiguration = { + serializedName: "JsonTextConfiguration", + type: { + name: "Composite", + className: "JsonTextConfiguration", + modelProperties: { + recordSeparator: { + xmlName: "RecordSeparator", + required: true, + serializedName: "RecordSeparator", + type: { + name: "String" + } + } + } + } +}; var ListContainersSegmentResponse = { xmlName: "EnumerationResults", serializedName: "ListContainersSegmentResponse", @@ -9801,6 +10915,90 @@ var CorsRule = { } } }; +var FilterBlobItem = { + xmlName: "Blob", + serializedName: "FilterBlobItem", + type: { + name: "Composite", + className: "FilterBlobItem", + modelProperties: { + name: { + xmlName: "Name", + required: true, + serializedName: "Name", + type: { + name: "String" + } + }, + containerName: { + xmlName: "ContainerName", + required: true, + serializedName: "ContainerName", + type: { + name: "String" + } + }, + tagValue: { + xmlName: "TagValue", + required: true, + serializedName: "TagValue", + type: { + name: "String" + } + } + } + } +}; +var FilterBlobSegment = { + xmlName: "EnumerationResults", + serializedName: "FilterBlobSegment", + type: { + name: "Composite", + className: "FilterBlobSegment", + modelProperties: { + serviceEndpoint: { + xmlIsAttribute: true, + xmlName: "ServiceEndpoint", + required: true, + serializedName: "ServiceEndpoint", + type: { + name: "String" + } + }, + where: { + xmlName: "Where", + required: true, + serializedName: "Where", + type: { + name: "String" + } + }, + blobs: { + xmlIsWrapped: true, + xmlName: "Blobs", + xmlElementName: "Blob", + required: true, + serializedName: "Blobs", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FilterBlobItem" + } + } + } + }, + continuationToken: { + xmlName: "NextMarker", + serializedName: "NextMarker", + type: { + name: "String" + } + } + } + } +}; var GeoReplication = { serializedName: "GeoReplication", type: { @@ -10029,6 +11227,103 @@ var PageList = { } } }; +var QueryFormat = { + serializedName: "QueryFormat", + type: { + name: "Composite", + className: "QueryFormat", + modelProperties: { + type: { + xmlName: "Type", + serializedName: "Type", + type: { + name: "Enum", + allowedValues: [ + "delimited", + "json" + ] + } + }, + delimitedTextConfiguration: { + xmlName: "DelimitedTextConfiguration", + serializedName: "DelimitedTextConfiguration", + type: { + name: "Composite", + className: "DelimitedTextConfiguration" + } + }, + jsonTextConfiguration: { + xmlName: "JsonTextConfiguration", + serializedName: "JsonTextConfiguration", + type: { + name: "Composite", + className: "JsonTextConfiguration" + } + } + } + } +}; +var QuerySerialization = { + serializedName: "QuerySerialization", + type: { + name: "Composite", + className: "QuerySerialization", + modelProperties: { + format: { + xmlName: "Format", + required: true, + serializedName: "Format", + type: { + name: "Composite", + className: "QueryFormat" + } + } + } + } +}; +var QueryRequest = { + serializedName: "QueryRequest", + type: { + name: "Composite", + className: "QueryRequest", + modelProperties: { + queryType: { + xmlName: "QueryType", + required: true, + isConstant: true, + serializedName: "QueryType", + defaultValue: 'SQL', + type: { + name: "String" + } + }, + expression: { + xmlName: "Expression", + required: true, + serializedName: "Expression", + type: { + name: "String" + } + }, + inputSerialization: { + xmlName: "InputSerialization", + serializedName: "InputSerialization", + type: { + name: "Composite", + className: "QuerySerialization" + } + }, + outputSerialization: { + xmlName: "OutputSerialization", + serializedName: "OutputSerialization", + type: { + name: "Composite", + className: "QuerySerialization" + } + } + } + } +}; var SignedIdentifier = { serializedName: "SignedIdentifier", type: { @@ -10082,6 +11377,13 @@ var StaticWebsite = { type: { name: "String" } + }, + defaultIndexDocumentPath: { + xmlName: "DefaultIndexDocumentPath", + serializedName: "DefaultIndexDocumentPath", + type: { + name: "String" + } } } } @@ -10403,7 +11705,9 @@ var ServiceGetAccountInfoHeaders = { allowedValues: [ "Storage", "BlobStorage", - "StorageV2" + "StorageV2", + "FileStorage", + "BlockBlobStorage" ] } }, @@ -10455,6 +11759,45 @@ var ServiceSubmitBatchHeaders = { } } }; +var ServiceFilterBlobsHeaders = { + serializedName: "service-filterblobs-headers", + type: { + name: "Composite", + className: "ServiceFilterBlobsHeaders", + modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; var ContainerCreateHeaders = { serializedName: "container-create-headers", type: { @@ -10830,6 +12173,45 @@ var ContainerSetAccessPolicyHeaders = { } } }; +var ContainerRestoreHeaders = { + serializedName: "container-restore-headers", + type: { + name: "Composite", + className: "ContainerRestoreHeaders", + modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; var ContainerAcquireLeaseHeaders = { serializedName: "container-acquirelease-headers", type: { @@ -11249,7 +12631,9 @@ var ContainerGetAccountInfoHeaders = { allowedValues: [ "Storage", "BlobStorage", - "StorageV2" + "StorageV2", + "FileStorage", + "BlockBlobStorage" ] } }, @@ -11286,6 +12670,24 @@ var BlobDownloadHeaders = { }, headerCollectionPrefix: "x-ms-meta-" }, + objectReplicationPolicyId: { + serializedName: "x-ms-or-policy-id", + type: { + name: "String" + } + }, + objectReplicationRules: { + serializedName: "x-ms-or", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + }, + headerCollectionPrefix: "x-ms-or-" + }, contentLength: { serializedName: "content-length", type: { @@ -11450,6 +12852,12 @@ var BlobDownloadHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, acceptRanges: { serializedName: "accept-ranges", type: { @@ -11492,6 +12900,18 @@ var BlobDownloadHeaders = { name: "ByteArray" } }, + tagCount: { + serializedName: "x-ms-tag-count", + type: { + name: "Number" + } + }, + isSealed: { + serializedName: "x-ms-blob-sealed", + type: { + name: "Boolean" + } + }, contentCrc64: { serializedName: "x-ms-content-crc64", type: { @@ -11537,6 +12957,24 @@ var BlobGetPropertiesHeaders = { }, headerCollectionPrefix: "x-ms-meta-" }, + objectReplicationPolicyId: { + serializedName: "x-ms-or-policy-id", + type: { + name: "String" + } + }, + objectReplicationRules: { + serializedName: "x-ms-or", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + }, + headerCollectionPrefix: "x-ms-or-" + }, blobType: { serializedName: "x-ms-blob-type", type: { @@ -11767,6 +13205,42 @@ var BlobGetPropertiesHeaders = { name: "DateTimeRfc1123" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, + isCurrentVersion: { + serializedName: "x-ms-is-current-version", + type: { + name: "Boolean" + } + }, + tagCount: { + serializedName: "x-ms-tag-count", + type: { + name: "Number" + } + }, + expiresOn: { + serializedName: "x-ms-expiry-time", + type: { + name: "DateTimeRfc1123" + } + }, + isSealed: { + serializedName: "x-ms-blob-sealed", + type: { + name: "Boolean" + } + }, + rehydratePriority: { + serializedName: "x-ms-rehydrate-priority", + type: { + name: "String" + } + }, errorCode: { serializedName: "x-ms-error-code", type: { @@ -12022,6 +13496,12 @@ var PageBlobCreateHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", type: { @@ -12097,6 +13577,12 @@ var AppendBlobCreateHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", type: { @@ -12172,6 +13658,12 @@ var BlockBlobUploadHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", type: { @@ -12244,6 +13736,57 @@ var BlobUndeleteHeaders = { } } }; +var BlobSetExpiryHeaders = { + serializedName: "blob-setexpiry-headers", + type: { + name: "Composite", + className: "BlobSetExpiryHeaders", + modelProperties: { + etag: { + serializedName: "etag", + type: { + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; var BlobSetHTTPHeadersHeaders = { serializedName: "blob-sethttpheaders-headers", type: { @@ -12337,6 +13880,12 @@ var BlobSetMetadataHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", type: { @@ -12691,6 +14240,12 @@ var BlobCreateSnapshotHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", type: { @@ -12748,6 +14303,12 @@ var BlobStartCopyFromURLHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", type: { @@ -12817,6 +14378,12 @@ var BlobCopyFromURLHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", type: { @@ -12981,7 +14548,9 @@ var BlobGetAccountInfoHeaders = { allowedValues: [ "Storage", "BlobStorage", - "StorageV2" + "StorageV2", + "FileStorage", + "BlockBlobStorage" ] } }, @@ -13180,6 +14749,12 @@ var BlockBlobCommitBlockListHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", type: { @@ -13990,6 +15565,386 @@ var AppendBlobAppendBlockFromUrlHeaders = { } } }; +var AppendBlobSealHeaders = { + serializedName: "appendblob-seal-headers", + type: { + name: "Composite", + className: "AppendBlobSealHeaders", + modelProperties: { + etag: { + serializedName: "etag", + type: { + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + isSealed: { + serializedName: "x-ms-blob-sealed", + type: { + name: "Boolean" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobQueryHeaders = { + serializedName: "blob-query-headers", + type: { + name: "Composite", + className: "BlobQueryHeaders", + modelProperties: { + lastModified: { + serializedName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + metadata: { + serializedName: "x-ms-meta", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + }, + headerCollectionPrefix: "x-ms-meta-" + }, + contentLength: { + serializedName: "content-length", + type: { + name: "Number" + } + }, + contentType: { + serializedName: "content-type", + type: { + name: "String" + } + }, + contentRange: { + serializedName: "content-range", + type: { + name: "String" + } + }, + etag: { + serializedName: "etag", + type: { + name: "String" + } + }, + contentMD5: { + serializedName: "content-md5", + type: { + name: "ByteArray" + } + }, + contentEncoding: { + serializedName: "content-encoding", + type: { + name: "String" + } + }, + cacheControl: { + serializedName: "cache-control", + type: { + name: "String" + } + }, + contentDisposition: { + serializedName: "content-disposition", + type: { + name: "String" + } + }, + contentLanguage: { + serializedName: "content-language", + type: { + name: "String" + } + }, + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + type: { + name: "Number" + } + }, + blobType: { + serializedName: "x-ms-blob-type", + type: { + name: "Enum", + allowedValues: [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ] + } + }, + copyCompletionTime: { + serializedName: "x-ms-copy-completion-time", + type: { + name: "DateTimeRfc1123" + } + }, + copyStatusDescription: { + serializedName: "x-ms-copy-status-description", + type: { + name: "String" + } + }, + copyId: { + serializedName: "x-ms-copy-id", + type: { + name: "String" + } + }, + copyProgress: { + serializedName: "x-ms-copy-progress", + type: { + name: "String" + } + }, + copySource: { + serializedName: "x-ms-copy-source", + type: { + name: "String" + } + }, + copyStatus: { + serializedName: "x-ms-copy-status", + type: { + name: "Enum", + allowedValues: [ + "pending", + "success", + "aborted", + "failed" + ] + } + }, + leaseDuration: { + serializedName: "x-ms-lease-duration", + type: { + name: "Enum", + allowedValues: [ + "infinite", + "fixed" + ] + } + }, + leaseState: { + serializedName: "x-ms-lease-state", + type: { + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] + } + }, + leaseStatus: { + serializedName: "x-ms-lease-status", + type: { + name: "Enum", + allowedValues: [ + "locked", + "unlocked" + ] + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + type: { + name: "String" + } + }, + acceptRanges: { + serializedName: "accept-ranges", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + type: { + name: "Number" + } + }, + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + type: { + name: "Boolean" + } + }, + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + type: { + name: "String" + } + }, + encryptionScope: { + serializedName: "x-ms-encryption-scope", + type: { + name: "String" + } + }, + blobContentMD5: { + serializedName: "x-ms-blob-content-md5", + type: { + name: "ByteArray" + } + }, + contentCrc64: { + serializedName: "x-ms-content-crc64", + type: { + name: "ByteArray" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobGetTagsHeaders = { + serializedName: "blob-gettags-headers", + type: { + name: "Composite", + className: "BlobGetTagsHeaders", + modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobSetTagsHeaders = { + serializedName: "blob-settags-headers", + type: { + name: "Composite", + className: "BlobSetTagsHeaders", + modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; /* * Copyright (c) Microsoft Corporation. All rights reserved. @@ -14006,12 +15961,15 @@ var Mappers = /*#__PURE__*/Object.freeze({ ContainerItem: ContainerItem, ContainerProperties: ContainerProperties, CorsRule: CorsRule, + FilterBlobItem: FilterBlobItem, + FilterBlobSegment: FilterBlobSegment, GeoReplication: GeoReplication, KeyInfo: KeyInfo, ListContainersSegmentResponse: ListContainersSegmentResponse, Logging: Logging, Metrics: Metrics, RetentionPolicy: RetentionPolicy, + ServiceFilterBlobsHeaders: ServiceFilterBlobsHeaders, ServiceGetAccountInfoHeaders: ServiceGetAccountInfoHeaders, ServiceGetPropertiesHeaders: ServiceGetPropertiesHeaders, ServiceGetStatisticsHeaders: ServiceGetStatisticsHeaders, @@ -14243,6 +16201,18 @@ var blobSequenceNumber = { } } }; +var blobTagsString = { + parameterPath: [ + "options", + "blobTagsString" + ], + mapper: { + serializedName: "x-ms-tags", + type: { + name: "String" + } + } +}; var blobType0 = { parameterPath: "blobType", mapper: { @@ -14344,7 +16314,7 @@ var comp10 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'copy', + defaultValue: 'expiry', type: { name: "String" } @@ -14356,7 +16326,7 @@ var comp11 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'tier', + defaultValue: 'snapshot', type: { name: "String" } @@ -14368,7 +16338,7 @@ var comp12 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'page', + defaultValue: 'copy', type: { name: "String" } @@ -14380,7 +16350,7 @@ var comp13 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'pagelist', + defaultValue: 'tier', type: { name: "String" } @@ -14392,7 +16362,7 @@ var comp14 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'incrementalcopy', + defaultValue: 'query', type: { name: "String" } @@ -14404,7 +16374,7 @@ var comp15 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'appendblock', + defaultValue: 'tags', type: { name: "String" } @@ -14416,7 +16386,7 @@ var comp16 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'block', + defaultValue: 'page', type: { name: "String" } @@ -14428,7 +16398,31 @@ var comp17 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'blocklist', + defaultValue: 'pagelist', + type: { + name: "String" + } + } +}; +var comp18 = { + parameterPath: "comp", + mapper: { + required: true, + isConstant: true, + serializedName: "comp", + defaultValue: 'incrementalcopy', + type: { + name: "String" + } + } +}; +var comp19 = { + parameterPath: "comp", + mapper: { + required: true, + isConstant: true, + serializedName: "comp", + defaultValue: 'appendblock', type: { name: "String" } @@ -14446,6 +16440,42 @@ var comp2 = { } } }; +var comp20 = { + parameterPath: "comp", + mapper: { + required: true, + isConstant: true, + serializedName: "comp", + defaultValue: 'seal', + type: { + name: "String" + } + } +}; +var comp21 = { + parameterPath: "comp", + mapper: { + required: true, + isConstant: true, + serializedName: "comp", + defaultValue: 'block', + type: { + name: "String" + } + } +}; +var comp22 = { + parameterPath: "comp", + mapper: { + required: true, + isConstant: true, + serializedName: "comp", + defaultValue: 'blocklist', + type: { + name: "String" + } + } +}; var comp3 = { parameterPath: "comp", mapper: { @@ -14476,7 +16506,7 @@ var comp5 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'metadata', + defaultValue: 'blobs', type: { name: "String" } @@ -14488,7 +16518,7 @@ var comp6 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'acl', + defaultValue: 'metadata', type: { name: "String" } @@ -14500,7 +16530,7 @@ var comp7 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'lease', + defaultValue: 'acl', type: { name: "String" } @@ -14524,7 +16554,7 @@ var comp9 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'snapshot', + defaultValue: 'lease', type: { name: "String" } @@ -14637,6 +16667,30 @@ var defaultEncryptionScope = { } } }; +var deletedContainerName = { + parameterPath: [ + "options", + "deletedContainerName" + ], + mapper: { + serializedName: "x-ms-deleted-container-name", + type: { + name: "String" + } + } +}; +var deletedContainerVersion = { + parameterPath: [ + "options", + "deletedContainerVersion" + ], + mapper: { + serializedName: "x-ms-deleted-container-version", + type: { + name: "String" + } + } +}; var deleteSnapshots = { parameterPath: [ "options", @@ -14741,6 +16795,28 @@ var encryptionScope = { } } }; +var expiresOn = { + parameterPath: [ + "options", + "expiresOn" + ], + mapper: { + serializedName: "x-ms-expiry-time", + type: { + name: "String" + } + } +}; +var expiryOptions = { + parameterPath: "expiryOptions", + mapper: { + required: true, + serializedName: "x-ms-expiry-option", + type: { + name: "String" + } + } +}; var group = { parameterPath: [ "options", @@ -14831,6 +16907,19 @@ var ifSequenceNumberLessThanOrEqualTo = { } } }; +var ifTags = { + parameterPath: [ + "options", + "modifiedAccessConditions", + "ifTags" + ], + mapper: { + serializedName: "x-ms-if-tags", + type: { + name: "String" + } + } +}; var ifUnmodifiedSince = { parameterPath: [ "options", @@ -14852,12 +16941,19 @@ var include0 = { mapper: { serializedName: "include", type: { - name: "Enum", - allowedValues: [ - "metadata" - ] + name: "Sequence", + element: { + type: { + name: "Enum", + allowedValues: [ + "metadata", + "deleted" + ] + } + } } - } + }, + collectionFormat: coreHttp.QueryCollectionFormat.Csv }; var include1 = { parameterPath: [ @@ -14876,7 +16972,9 @@ var include1 = { "deleted", "metadata", "snapshots", - "uncommittedblobs" + "uncommittedblobs", + "versions", + "tags" ] } } @@ -15266,6 +17364,18 @@ var restype2 = { } } }; +var sealBlob = { + parameterPath: [ + "options", + "sealBlob" + ], + mapper: { + serializedName: "x-ms-seal-blob", + type: { + name: "Boolean" + } + } +}; var sequenceNumberAction = { parameterPath: "sequenceNumberAction", mapper: { @@ -15356,6 +17466,19 @@ var sourceIfNoneMatch = { } } }; +var sourceIfTags = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfTags" + ], + mapper: { + serializedName: "x-ms-source-if-tags", + type: { + name: "String" + } + } +}; var sourceIfUnmodifiedSince = { parameterPath: [ "options", @@ -15504,7 +17627,31 @@ var version = { required: true, isConstant: true, serializedName: "x-ms-version", - defaultValue: '2019-07-07', + defaultValue: '2019-12-12', + type: { + name: "String" + } + } +}; +var versionId = { + parameterPath: [ + "options", + "versionId" + ], + mapper: { + serializedName: "versionid", + type: { + name: "String" + } + } +}; +var where = { + parameterPath: [ + "options", + "where" + ], + mapper: { + serializedName: "where", type: { name: "String" } @@ -15581,6 +17728,11 @@ var Service = /** @class */ (function () { options: options }, submitBatchOperationSpec, callback); }; + Service.prototype.filterBlobs = function (options, callback) { + return this.client.sendOperationRequest({ + options: options + }, filterBlobsOperationSpec, callback); + }; return Service; }()); // Operation Specifications @@ -15800,6 +17952,35 @@ var submitBatchOperationSpec = { isXML: true, serializer: serializer }; +var filterBlobsOperationSpec = { + httpMethod: "GET", + urlParameters: [ + url + ], + queryParameters: [ + timeoutInSeconds, + where, + marker0, + maxPageSize, + comp5 + ], + headerParameters: [ + version, + requestId + ], + responses: { + 200: { + bodyMapper: FilterBlobSegment, + headersMapper: ServiceFilterBlobsHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ServiceFilterBlobsHeaders + } + }, + isXML: true, + serializer: serializer +}; /* * Copyright (c) Microsoft Corporation. All rights reserved. @@ -15814,9 +17995,11 @@ var Mappers$1 = /*#__PURE__*/Object.freeze({ AccessPolicy: AccessPolicy, BlobFlatListSegment: BlobFlatListSegment, BlobHierarchyListSegment: BlobHierarchyListSegment, - BlobItem: BlobItem, + BlobItemInternal: BlobItemInternal, BlobPrefix: BlobPrefix, - BlobProperties: BlobProperties, + BlobPropertiesInternal: BlobPropertiesInternal, + BlobTag: BlobTag, + BlobTags: BlobTags, ContainerAcquireLeaseHeaders: ContainerAcquireLeaseHeaders, ContainerBreakLeaseHeaders: ContainerBreakLeaseHeaders, ContainerChangeLeaseHeaders: ContainerChangeLeaseHeaders, @@ -15829,6 +18012,7 @@ var Mappers$1 = /*#__PURE__*/Object.freeze({ ContainerListBlobHierarchySegmentHeaders: ContainerListBlobHierarchySegmentHeaders, ContainerReleaseLeaseHeaders: ContainerReleaseLeaseHeaders, ContainerRenewLeaseHeaders: ContainerRenewLeaseHeaders, + ContainerRestoreHeaders: ContainerRestoreHeaders, ContainerSetAccessPolicyHeaders: ContainerSetAccessPolicyHeaders, ContainerSetMetadataHeaders: ContainerSetMetadataHeaders, ListBlobsFlatSegmentResponse: ListBlobsFlatSegmentResponse, @@ -15885,6 +18069,11 @@ var Container = /** @class */ (function () { options: options }, setAccessPolicyOperationSpec, callback); }; + Container.prototype.restore = function (options, callback) { + return this.client.sendOperationRequest({ + options: options + }, restoreOperationSpec, callback); + }; Container.prototype.acquireLease = function (options, callback) { return this.client.sendOperationRequest({ options: options @@ -16029,7 +18218,7 @@ var setMetadataOperationSpec = { queryParameters: [ timeoutInSeconds, restype2, - comp5 + comp6 ], headerParameters: [ metadata, @@ -16059,7 +18248,7 @@ var getAccessPolicyOperationSpec = { queryParameters: [ timeoutInSeconds, restype2, - comp6 + comp7 ], headerParameters: [ version, @@ -16100,7 +18289,7 @@ var setAccessPolicyOperationSpec = { queryParameters: [ timeoutInSeconds, restype2, - comp6 + comp7 ], headerParameters: [ access, @@ -16143,6 +18332,35 @@ var setAccessPolicyOperationSpec = { isXML: true, serializer: serializer$1 }; +var restoreOperationSpec = { + httpMethod: "PUT", + path: "{containerName}", + urlParameters: [ + url + ], + queryParameters: [ + timeoutInSeconds, + restype2, + comp8 + ], + headerParameters: [ + version, + requestId, + deletedContainerName, + deletedContainerVersion + ], + responses: { + 201: { + headersMapper: ContainerRestoreHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerRestoreHeaders + } + }, + isXML: true, + serializer: serializer$1 +}; var acquireLeaseOperationSpec = { httpMethod: "PUT", path: "{containerName}", @@ -16151,7 +18369,7 @@ var acquireLeaseOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp7, + comp9, restype2 ], headerParameters: [ @@ -16183,7 +18401,7 @@ var releaseLeaseOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp7, + comp9, restype2 ], headerParameters: [ @@ -16214,7 +18432,7 @@ var renewLeaseOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp7, + comp9, restype2 ], headerParameters: [ @@ -16245,7 +18463,7 @@ var breakLeaseOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp7, + comp9, restype2 ], headerParameters: [ @@ -16276,7 +18494,7 @@ var changeLeaseOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp7, + comp9, restype2 ], headerParameters: [ @@ -16412,17 +18630,28 @@ var Mappers$2 = /*#__PURE__*/Object.freeze({ BlobGetAccessControlHeaders: BlobGetAccessControlHeaders, BlobGetAccountInfoHeaders: BlobGetAccountInfoHeaders, BlobGetPropertiesHeaders: BlobGetPropertiesHeaders, + BlobGetTagsHeaders: BlobGetTagsHeaders, + BlobQueryHeaders: BlobQueryHeaders, BlobReleaseLeaseHeaders: BlobReleaseLeaseHeaders, BlobRenameHeaders: BlobRenameHeaders, BlobRenewLeaseHeaders: BlobRenewLeaseHeaders, BlobSetAccessControlHeaders: BlobSetAccessControlHeaders, + BlobSetExpiryHeaders: BlobSetExpiryHeaders, BlobSetHTTPHeadersHeaders: BlobSetHTTPHeadersHeaders, BlobSetMetadataHeaders: BlobSetMetadataHeaders, + BlobSetTagsHeaders: BlobSetTagsHeaders, BlobSetTierHeaders: BlobSetTierHeaders, BlobStartCopyFromURLHeaders: BlobStartCopyFromURLHeaders, + BlobTag: BlobTag, + BlobTags: BlobTags, BlobUndeleteHeaders: BlobUndeleteHeaders, DataLakeStorageError: DataLakeStorageError, DataLakeStorageErrorError: DataLakeStorageErrorError, + DelimitedTextConfiguration: DelimitedTextConfiguration, + JsonTextConfiguration: JsonTextConfiguration, + QueryFormat: QueryFormat, + QueryRequest: QueryRequest, + QuerySerialization: QuerySerialization, StorageError: StorageError }); @@ -16480,6 +18709,12 @@ var Blob$1 = /** @class */ (function () { options: options }, undeleteOperationSpec, callback); }; + Blob.prototype.setExpiry = function (expiryOptions, options, callback) { + return this.client.sendOperationRequest({ + expiryOptions: expiryOptions, + options: options + }, setExpiryOperationSpec, callback); + }; Blob.prototype.setHTTPHeaders = function (options, callback) { return this.client.sendOperationRequest({ options: options @@ -16553,6 +18788,21 @@ var Blob$1 = /** @class */ (function () { options: options }, getAccountInfoOperationSpec$2, callback); }; + Blob.prototype.query = function (options, callback) { + return this.client.sendOperationRequest({ + options: options + }, queryOperationSpec, callback); + }; + Blob.prototype.getTags = function (options, callback) { + return this.client.sendOperationRequest({ + options: options + }, getTagsOperationSpec, callback); + }; + Blob.prototype.setTags = function (options, callback) { + return this.client.sendOperationRequest({ + options: options + }, setTagsOperationSpec, callback); + }; return Blob; }()); // Operation Specifications @@ -16565,6 +18815,7 @@ var downloadOperationSpec = { ], queryParameters: [ snapshot, + versionId, timeoutInSeconds ], headerParameters: [ @@ -16580,7 +18831,8 @@ var downloadOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -16617,6 +18869,7 @@ var getPropertiesOperationSpec$2 = { ], queryParameters: [ snapshot, + versionId, timeoutInSeconds ], headerParameters: [ @@ -16629,7 +18882,8 @@ var getPropertiesOperationSpec$2 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -16651,6 +18905,7 @@ var deleteMethodOperationSpec$1 = { ], queryParameters: [ snapshot, + versionId, timeoutInSeconds ], headerParameters: [ @@ -16661,7 +18916,8 @@ var deleteMethodOperationSpec$1 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 202: { @@ -16813,6 +19069,34 @@ var undeleteOperationSpec = { isXML: true, serializer: serializer$2 }; +var setExpiryOperationSpec = { + httpMethod: "PUT", + path: "{containerName}/{blob}", + urlParameters: [ + url + ], + queryParameters: [ + timeoutInSeconds, + comp10 + ], + headerParameters: [ + version, + requestId, + expiryOptions, + expiresOn + ], + responses: { + 200: { + headersMapper: BlobSetExpiryHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlobSetExpiryHeaders + } + }, + isXML: true, + serializer: serializer$2 +}; var setHTTPHeadersOperationSpec = { httpMethod: "PUT", path: "{containerName}/{blob}", @@ -16836,7 +19120,8 @@ var setHTTPHeadersOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -16858,7 +19143,7 @@ var setMetadataOperationSpec$1 = { ], queryParameters: [ timeoutInSeconds, - comp5 + comp6 ], headerParameters: [ metadata, @@ -16872,7 +19157,8 @@ var setMetadataOperationSpec$1 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -16894,7 +19180,7 @@ var acquireLeaseOperationSpec$1 = { ], queryParameters: [ timeoutInSeconds, - comp7 + comp9 ], headerParameters: [ duration, @@ -16905,7 +19191,8 @@ var acquireLeaseOperationSpec$1 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 201: { @@ -16927,7 +19214,7 @@ var releaseLeaseOperationSpec$1 = { ], queryParameters: [ timeoutInSeconds, - comp7 + comp9 ], headerParameters: [ leaseId1, @@ -16937,7 +19224,8 @@ var releaseLeaseOperationSpec$1 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -16959,7 +19247,7 @@ var renewLeaseOperationSpec$1 = { ], queryParameters: [ timeoutInSeconds, - comp7 + comp9 ], headerParameters: [ leaseId1, @@ -16969,7 +19257,8 @@ var renewLeaseOperationSpec$1 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -16991,7 +19280,7 @@ var changeLeaseOperationSpec$1 = { ], queryParameters: [ timeoutInSeconds, - comp7 + comp9 ], headerParameters: [ leaseId1, @@ -17002,7 +19291,8 @@ var changeLeaseOperationSpec$1 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -17024,7 +19314,7 @@ var breakLeaseOperationSpec$1 = { ], queryParameters: [ timeoutInSeconds, - comp7 + comp9 ], headerParameters: [ breakPeriod, @@ -17034,7 +19324,8 @@ var breakLeaseOperationSpec$1 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 202: { @@ -17056,7 +19347,7 @@ var createSnapshotOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp9 + comp11 ], headerParameters: [ metadata, @@ -17070,6 +19361,7 @@ var createSnapshotOperationSpec = { ifUnmodifiedSince, ifMatch, ifNoneMatch, + ifTags, leaseId0 ], responses: { @@ -17100,14 +19392,18 @@ var startCopyFromURLOperationSpec = { copySource, version, requestId, + blobTagsString, + sealBlob, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, + sourceIfTags, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, + ifTags, leaseId0 ], responses: { @@ -17138,6 +19434,7 @@ var copyFromURLOperationSpec = { version, requestId, sourceContentMD5, + blobTagsString, xMsRequiresSync, sourceIfModifiedSince, sourceIfUnmodifiedSince, @@ -17147,6 +19444,7 @@ var copyFromURLOperationSpec = { ifUnmodifiedSince, ifMatch, ifNoneMatch, + ifTags, leaseId0 ], responses: { @@ -17170,7 +19468,7 @@ var abortCopyFromURLOperationSpec = { queryParameters: [ copyId, timeoutInSeconds, - comp10 + comp12 ], headerParameters: [ version, @@ -17197,15 +19495,18 @@ var setTierOperationSpec = { url ], queryParameters: [ + snapshot, + versionId, timeoutInSeconds, - comp11 + comp13 ], headerParameters: [ tier1, rehydratePriority, version, requestId, - leaseId0 + leaseId0, + ifTags ], responses: { 200: { @@ -17247,6 +19548,133 @@ var getAccountInfoOperationSpec$2 = { isXML: true, serializer: serializer$2 }; +var queryOperationSpec = { + httpMethod: "POST", + path: "{containerName}/{blob}", + urlParameters: [ + url + ], + queryParameters: [ + snapshot, + timeoutInSeconds, + comp14 + ], + headerParameters: [ + version, + requestId, + leaseId0, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + ifTags + ], + requestBody: { + parameterPath: [ + "options", + "queryRequest" + ], + mapper: QueryRequest + }, + contentType: "application/xml; charset=utf-8", + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Stream" + } + }, + headersMapper: BlobQueryHeaders + }, + 206: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Stream" + } + }, + headersMapper: BlobQueryHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlobQueryHeaders + } + }, + isXML: true, + serializer: serializer$2 +}; +var getTagsOperationSpec = { + httpMethod: "GET", + path: "{containerName}/{blob}", + urlParameters: [ + url + ], + queryParameters: [ + timeoutInSeconds, + snapshot, + versionId, + comp15 + ], + headerParameters: [ + version, + requestId, + ifTags + ], + responses: { + 200: { + bodyMapper: BlobTags, + headersMapper: BlobGetTagsHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlobGetTagsHeaders + } + }, + isXML: true, + serializer: serializer$2 +}; +var setTagsOperationSpec = { + httpMethod: "PUT", + path: "{containerName}/{blob}", + urlParameters: [ + url + ], + queryParameters: [ + timeoutInSeconds, + versionId, + comp15 + ], + headerParameters: [ + version, + transactionalContentMD5, + transactionalContentCrc64, + requestId, + ifTags + ], + requestBody: { + parameterPath: [ + "options", + "tags" + ], + mapper: BlobTags + }, + contentType: "application/xml; charset=utf-8", + responses: { + 204: { + headersMapper: BlobSetTagsHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlobSetTagsHeaders + } + }, + isXML: true, + serializer: serializer$2 +}; /* * Copyright (c) Microsoft Corporation. All rights reserved. @@ -17370,6 +19798,7 @@ var createOperationSpec$1 = { blobSequenceNumber, version, requestId, + blobTagsString, blobType0, blobContentType, blobContentEncoding, @@ -17384,7 +19813,8 @@ var createOperationSpec$1 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 201: { @@ -17406,7 +19836,7 @@ var uploadPagesOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp12 + comp16 ], headerParameters: [ contentLength, @@ -17427,7 +19857,8 @@ var uploadPagesOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], requestBody: { parameterPath: "body", @@ -17460,7 +19891,7 @@ var clearPagesOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp12 + comp16 ], headerParameters: [ contentLength, @@ -17479,7 +19910,8 @@ var clearPagesOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 201: { @@ -17501,7 +19933,7 @@ var uploadPagesFromURLOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp12 + comp16 ], headerParameters: [ sourceUrl, @@ -17525,6 +19957,7 @@ var uploadPagesFromURLOperationSpec = { ifUnmodifiedSince, ifMatch, ifNoneMatch, + ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, @@ -17551,7 +19984,7 @@ var getPageRangesOperationSpec = { queryParameters: [ snapshot, timeoutInSeconds, - comp13 + comp17 ], headerParameters: [ range0, @@ -17561,7 +19994,8 @@ var getPageRangesOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -17586,7 +20020,7 @@ var getPageRangesDiffOperationSpec = { snapshot, timeoutInSeconds, prevsnapshot, - comp13 + comp17 ], headerParameters: [ prevSnapshotUrl, @@ -17597,7 +20031,8 @@ var getPageRangesDiffOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -17634,7 +20069,8 @@ var resizeOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -17667,7 +20103,8 @@ var updateSequenceNumberOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -17689,7 +20126,7 @@ var copyIncrementalOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp14 + comp18 ], headerParameters: [ copySource, @@ -17698,7 +20135,8 @@ var copyIncrementalOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 202: { @@ -17726,6 +20164,7 @@ var Mappers$4 = /*#__PURE__*/Object.freeze({ AppendBlobAppendBlockFromUrlHeaders: AppendBlobAppendBlockFromUrlHeaders, AppendBlobAppendBlockHeaders: AppendBlobAppendBlockHeaders, AppendBlobCreateHeaders: AppendBlobCreateHeaders, + AppendBlobSealHeaders: AppendBlobSealHeaders, StorageError: StorageError }); @@ -17767,6 +20206,11 @@ var AppendBlob = /** @class */ (function () { options: options }, appendBlockFromUrlOperationSpec, callback); }; + AppendBlob.prototype.seal = function (options, callback) { + return this.client.sendOperationRequest({ + options: options + }, sealOperationSpec, callback); + }; return AppendBlob; }()); // Operation Specifications @@ -17786,6 +20230,7 @@ var createOperationSpec$2 = { encryptionScope, version, requestId, + blobTagsString, blobType1, blobContentType, blobContentEncoding, @@ -17800,7 +20245,8 @@ var createOperationSpec$2 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 201: { @@ -17822,7 +20268,7 @@ var appendBlockOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp15 + comp19 ], headerParameters: [ contentLength, @@ -17840,7 +20286,8 @@ var appendBlockOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], requestBody: { parameterPath: "body", @@ -17873,7 +20320,7 @@ var appendBlockFromUrlOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp15 + comp19 ], headerParameters: [ sourceUrl, @@ -17895,6 +20342,7 @@ var appendBlockFromUrlOperationSpec = { ifUnmodifiedSince, ifMatch, ifNoneMatch, + ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, @@ -17912,6 +20360,38 @@ var appendBlockFromUrlOperationSpec = { isXML: true, serializer: serializer$4 }; +var sealOperationSpec = { + httpMethod: "PUT", + path: "{containerName}/{blob}", + urlParameters: [ + url + ], + queryParameters: [ + timeoutInSeconds, + comp20 + ], + headerParameters: [ + version, + requestId, + leaseId0, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + appendPosition + ], + responses: { + 200: { + headersMapper: AppendBlobSealHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: AppendBlobSealHeaders + } + }, + isXML: true, + serializer: serializer$4 +}; /* * Copyright (c) Microsoft Corporation. All rights reserved. @@ -18008,6 +20488,7 @@ var uploadOperationSpec = { tier0, version, requestId, + blobTagsString, blobType2, blobContentType, blobContentEncoding, @@ -18022,7 +20503,8 @@ var uploadOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], requestBody: { parameterPath: "body", @@ -18056,7 +20538,7 @@ var stageBlockOperationSpec = { queryParameters: [ blockId, timeoutInSeconds, - comp16 + comp21 ], headerParameters: [ contentLength, @@ -18102,7 +20584,7 @@ var stageBlockFromURLOperationSpec = { queryParameters: [ blockId, timeoutInSeconds, - comp16 + comp21 ], headerParameters: [ contentLength, @@ -18142,7 +20624,7 @@ var commitBlockListOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp17 + comp22 ], headerParameters: [ transactionalContentMD5, @@ -18152,6 +20634,7 @@ var commitBlockListOperationSpec = { tier0, version, requestId, + blobTagsString, blobCacheControl, blobContentType, blobContentEncoding, @@ -18165,7 +20648,8 @@ var commitBlockListOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], requestBody: { parameterPath: "blocks", @@ -18194,12 +20678,13 @@ var getBlockListOperationSpec = { snapshot, listType, timeoutInSeconds, - comp17 + comp22 ], headerParameters: [ version, requestId, - leaseId0 + leaseId0, + ifTags ], responses: { 200: { @@ -18223,10 +20708,10 @@ var logger = logger$1.createClientLogger("storage-blob"); // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -var SDK_VERSION = "12.1.2"; -var SERVICE_VERSION = "2019-07-07"; +var SDK_VERSION = "12.2.1"; +var SERVICE_VERSION = "2019-12-12"; var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB -var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 100 * 1024 * 1024; // 100MB +var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB var BLOCK_BLOB_MAX_BLOCKS = 50000; var DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; // 8MB var DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; // 4MB @@ -18240,6 +20725,7 @@ var URLConstants = { FORCE_BROWSER_NO_CACHE: "_", SIGNATURE: "sig", SNAPSHOT: "snapshot", + VERSIONID: "versionid", TIMEOUT: "timeout" } }; @@ -18276,6 +20762,7 @@ var HeaderConstants = { X_MS_VERSION: "x-ms-version" }; var ETagNone = ""; +var ETagAny = "*"; var SIZE_1_MB = 1 * 1024 * 1024; var BATCH_MAX_REQUEST = 256; var BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; @@ -18375,7 +20862,9 @@ var StorageBlobLoggingAllowedHeaderNames = [ "x-ms-source-if-none-match", "x-ms-source-if-unmodified-since", "x-ms-tag-count", - "x-ms-encryption-key-sha256" + "x-ms-encryption-key-sha256", + "x-ms-if-tags", + "x-ms-source-if-tags" ]; var StorageBlobLoggingAllowedQueryParameters = [ "comp", @@ -18419,7 +20908,7 @@ var StorageBlobLoggingAllowedQueryParameters = [ * * ## URL encode and escape strategy for JS SDKs * - * When customers pass a URL string into XxxClient classes constrcutor, the URL string may already be URL encoded or not. + * When customers pass a URL string into XxxClient classes constructor, the URL string may already be URL encoded or not. * But before sending to Azure Storage server, the URL must be encoded. However, it's hard for a SDK to guess whether the URL * string has been encoded or not. We have 2 potential strategies, and chose strategy two for the XxxClient constructors. * @@ -18449,7 +20938,7 @@ var StorageBlobLoggingAllowedQueryParameters = [ * * This strategy gives us flexibility to create with any special characters. But "%" will be treated as a special characters, if the URL string * is not encoded, there shouldn't a "%" in the URL string, otherwise the URL is not a valid URL. - * If customer needs to create a blob with "%" in it's blob name, use "%25" insead of "%". Just like above 3rd sample. + * If customer needs to create a blob with "%" in it's blob name, use "%25" instead of "%". Just like above 3rd sample. * And following URL strings are invalid: * - "http://account.blob.core.windows.net/con/b%" * - "http://account.blob.core.windows.net/con/b%2" @@ -18569,14 +21058,11 @@ function extractConnectionStringParts(connectionString) { else if (!accountSas) { throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String"); } - else if (!accountName) { - throw new Error("Invalid AccountName in the provided SAS Connection String"); - } return { kind: "SASConnString", url: blobEndpoint, accountName: accountName, accountSas: accountSas }; } } /** - * Internal escape method implmented Strategy Two mentioned in escapeURL() description. + * Internal escape method implemented Strategy Two mentioned in escapeURL() description. * * @param {string} text * @returns {string} @@ -18795,6 +21281,8 @@ function delay(timeInMs, aborter, abortError) { */ function padStart(currentString, targetLength, padString) { if (padString === void 0) { padString = " "; } + // TS doesn't know this code needs to run downlevel sometimes. + // @ts-expect-error if (String.prototype.padStart) { return currentString.padStart(targetLength, padString); } @@ -18834,14 +21322,15 @@ function getAccountNameFromUrl(url) { // `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`; accountName = parsedUrl.getHost().split(".")[0]; } - else { + else if (isIpEndpointStyle(parsedUrl)) { // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/ // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/ // .getPath() -> /devstoreaccount1/ accountName = parsedUrl.getPath().split("/")[1]; } - if (!accountName) { - throw new Error("Provided accountName is invalid."); + else { + // Custom domain case: "https://customdomain.com/containername/blob". + accountName = ""; } return accountName; } @@ -18849,6 +21338,154 @@ function getAccountNameFromUrl(url) { throw new Error("Unable to extract accountName with provided information."); } } +function isIpEndpointStyle(parsedUrl) { + if (parsedUrl.getHost() == undefined) { + return false; + } + var host = parsedUrl.getHost() + (parsedUrl.getPort() == undefined ? "" : ":" + parsedUrl.getPort()); + // Case 1: Ipv6, use a broad regex to find out candidates whose host contains two ':'. + // Case 2: localhost(:port), use broad regex to match port part. + // Case 3: Ipv4, use broad regex which just check if host contains Ipv4. + // For valid host please refer to https://man7.org/linux/man-pages/man7/hostname.7.html. + return /^.*:.*:.*$|^localhost(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(host); +} +/** + * Convert Tags to encoded string. + * + * @export + * @param {Tags} tags + * @returns {string | undefined} + */ +function toBlobTagsString(tags) { + if (tags === undefined) { + return undefined; + } + var tagPairs = []; + for (var key in tags) { + if (tags.hasOwnProperty(key)) { + var value = tags[key]; + tagPairs.push(encodeURIComponent(key) + "=" + encodeURIComponent(value)); + } + } + return tagPairs.join("&"); +} +/** + * Convert Tags type to BlobTags. + * + * @export + * @param {Tags} [tags] + * @returns {(BlobTags | undefined)} + */ +function toBlobTags(tags) { + if (tags === undefined) { + return undefined; + } + var res = { + blobTagSet: [] + }; + for (var key in tags) { + if (tags.hasOwnProperty(key)) { + var value = tags[key]; + res.blobTagSet.push({ + key: key, + value: value + }); + } + } + return res; +} +/** + * Covert BlobTags to Tags type. + * + * @export + * @param {BlobTags} [tags] + * @returns {(Tags | undefined)} + */ +function toTags(tags) { + if (tags === undefined) { + return undefined; + } + var res = {}; + for (var _i = 0, _a = tags.blobTagSet; _i < _a.length; _i++) { + var blobTag = _a[_i]; + res[blobTag.key] = blobTag.value; + } + return res; +} +/** + * Convert BlobQueryTextConfiguration to QuerySerialization type. + * + * @export + * @param {(BlobQueryJsonTextConfiguration | BlobQueryCsvTextConfiguration)} [textConfiguration] + * @returns {(QuerySerialization | undefined)} + */ +function toQuerySerialization(textConfiguration) { + if (textConfiguration === undefined) { + return undefined; + } + switch (textConfiguration.kind) { + case "csv": + return { + format: { + type: "delimited", + delimitedTextConfiguration: { + columnSeparator: textConfiguration.columnSeparator || ",", + fieldQuote: textConfiguration.fieldQuote || "", + recordSeparator: textConfiguration.recordSeparator, + escapeChar: textConfiguration.escapeCharacter || "", + headersPresent: textConfiguration.hasHeaders || false + } + } + }; + case "json": + return { + format: { + type: "json", + jsonTextConfiguration: { + recordSeparator: textConfiguration.recordSeparator + } + } + }; + default: + throw Error("Invalid BlobQueryTextConfiguration."); + } +} +function parseObjectReplicationRecord(objectReplicationRecord) { + if (!objectReplicationRecord) { + return undefined; + } + if ("policy-id" in objectReplicationRecord) { + // If the dictionary contains a key with policy id, we are not required to do any parsing since + // the policy id should already be stored in the ObjectReplicationDestinationPolicyId. + return undefined; + } + var orProperties = []; + var _loop_1 = function (key) { + var ids = key.split("_"); + var policyPrefix = "or-"; + if (ids[0].startsWith(policyPrefix)) { + ids[0] = ids[0].substring(policyPrefix.length); + } + var rule = { + ruleId: ids[1], + replicationStatus: objectReplicationRecord[key] + }; + var policyIndex = orProperties.findIndex(function (policy) { return policy.policyId === ids[0]; }); + if (policyIndex > -1) { + orProperties[policyIndex].rules.push(rule); + } + else { + orProperties.push({ + policyId: ids[0], + rules: [rule] + }); + } + }; + for (var key in objectReplicationRecord) { + _loop_1(key); + } + return orProperties; +} // Copyright (c) Microsoft Corporation. All rights reserved. /** @@ -19186,6 +21823,133 @@ var StorageRetryPolicyFactory = /** @class */ (function () { return StorageRetryPolicyFactory; }()); +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * Credential policy used to sign HTTP(S) requests before sending. This is an + * abstract class. + * + * @export + * @abstract + * @class CredentialPolicy + * @extends {BaseRequestPolicy} + */ +var CredentialPolicy = /** @class */ (function (_super) { + tslib.__extends(CredentialPolicy, _super); + function CredentialPolicy() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Sends out request. + * + * @param {WebResource} request + * @returns {Promise} + * @memberof CredentialPolicy + */ + CredentialPolicy.prototype.sendRequest = function (request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + }; + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @protected + * @abstract + * @param {WebResource} request + * @returns {WebResource} + * @memberof CredentialPolicy + */ + CredentialPolicy.prototype.signRequest = function (request) { + // Child classes must override this method with request signing. This method + // will be executed in sendRequest(). + return request; + }; + return CredentialPolicy; +}(coreHttp.BaseRequestPolicy)); + +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * AnonymousCredentialPolicy is used with HTTP(S) requests that read public resources + * or for use with Shared Access Signatures (SAS). + * + * @export + * @class AnonymousCredentialPolicy + * @extends {CredentialPolicy} + */ +var AnonymousCredentialPolicy = /** @class */ (function (_super) { + tslib.__extends(AnonymousCredentialPolicy, _super); + /** + * Creates an instance of AnonymousCredentialPolicy. + * @param {RequestPolicy} nextPolicy + * @param {RequestPolicyOptions} options + * @memberof AnonymousCredentialPolicy + */ + function AnonymousCredentialPolicy(nextPolicy, options) { + return _super.call(this, nextPolicy, options) || this; + } + return AnonymousCredentialPolicy; +}(CredentialPolicy)); + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +/** + * Credential is an abstract class for Azure Storage HTTP requests signing. This + * class will host an credentialPolicyCreator factory which generates CredentialPolicy. + * + * @export + * @abstract + * @class Credential + */ +var Credential = /** @class */ (function () { + function Credential() { + } + /** + * Creates a RequestPolicy object. + * + * @param {RequestPolicy} _nextPolicy + * @param {RequestPolicyOptions} _options + * @returns {RequestPolicy} + * @memberof Credential + */ + Credential.prototype.create = function ( + // tslint:disable-next-line:variable-name + _nextPolicy, + // tslint:disable-next-line:variable-name + _options) { + throw new Error("Method should be implemented in children classes."); + }; + return Credential; +}()); + +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * AnonymousCredential provides a credentialPolicyCreator member used to create + * AnonymousCredentialPolicy objects. AnonymousCredentialPolicy is used with + * HTTP(S) requests that read public resources or for use with Shared Access + * Signatures (SAS). + * + * @export + * @class AnonymousCredential + * @extends {Credential} + */ +var AnonymousCredential = /** @class */ (function (_super) { + tslib.__extends(AnonymousCredential, _super); + function AnonymousCredential() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Creates an {@link AnonymousCredentialPolicy} object. + * + * @param {RequestPolicy} nextPolicy + * @param {RequestPolicyOptions} options + * @returns {AnonymousCredentialPolicy} + * @memberof AnonymousCredential + */ + AnonymousCredential.prototype.create = function (nextPolicy, options) { + return new AnonymousCredentialPolicy(nextPolicy, options); + }; + return AnonymousCredential; +}(Credential)); + // Copyright (c) Microsoft Corporation. All rights reserved. /** * TelemetryPolicy is a policy used to tag user-agent header for every requests. @@ -19250,6 +22014,8 @@ var TelemetryPolicyFactory = /** @class */ (function () { var userAgentInfo = []; { if (telemetry) { + // FIXME: replace() only replaces the first space. And we have no idea why we need to replace spaces in the first place. + // But fixing this would be a breaking change. Logged an issue here: https://github.com/Azure/azure-sdk-for-js/issues/10793 var telemetryString = (telemetry.userAgentPrefix || "").replace(" ", ""); if (telemetryString.length > 0 && userAgentInfo.indexOf(telemetryString) === -1) { userAgentInfo.push(telemetryString); @@ -19339,10 +22105,13 @@ var Pipeline = /** @class */ (function () { * @returns {Pipeline} A new Pipeline object. */ function newPipeline(credential, pipelineOptions) { + if (pipelineOptions === void 0) { pipelineOptions = {}; } + if (credential === undefined) { + credential = new AnonymousCredential(); + } // Order is important. Closer to the API at the top & closer to the network at the bottom. // The credential's policy factory must appear close to the wire so it can sign any // changes made by other factories (like UniqueRequestIDPolicyFactory) - if (pipelineOptions === void 0) { pipelineOptions = {}; } var telemetryPolicy = new TelemetryPolicyFactory(pipelineOptions.userAgentOptions); var factories = [ coreHttp.tracingPolicy({ userAgent: telemetryPolicy.telemetryString }), @@ -19359,7 +22128,7 @@ function newPipeline(credential, pipelineOptions) { }) ]; { - // policies only avaiable in Node.js runtime, not in browsers + // policies only available in Node.js runtime, not in browsers factories.push(coreHttp.proxyPolicy(pipelineOptions.proxyOptions)); factories.push(coreHttp.disableResponseDecompressionPolicy()); } @@ -19497,7 +22266,7 @@ var RetriableReadableStream = /** @class */ (function (_super) { /** * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * BlobDownloadResponse implements BlobDownloadResponseModel interface, and in Node.js runtime it will + * BlobDownloadResponse implements BlobDownloadResponseParsed interface, and in Node.js runtime it will * automatically retry when internal read stream unexpected ends. (This kind of unexpected ends cannot * trigger retries defined in pipeline retry policy.) * @@ -19506,13 +22275,13 @@ var RetriableReadableStream = /** @class */ (function (_super) { * * @export * @class BlobDownloadResponse - * @implements {BlobDownloadResponseModel} + * @implements {BlobDownloadResponseParsed} */ var BlobDownloadResponse = /** @class */ (function () { /** * Creates an instance of BlobDownloadResponse. * - * @param {BlobDownloadResponseModel} originalResponse + * @param {BlobDownloadResponseParsed} originalResponse * @param {ReadableStreamGetter} getter * @param {number} offset * @param {number} count @@ -19536,7 +22305,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.acceptRanges; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "cacheControl", { @@ -19551,7 +22320,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.cacheControl; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentDisposition", { @@ -19567,7 +22336,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.contentDisposition; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentEncoding", { @@ -19582,7 +22351,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.contentEncoding; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentLanguage", { @@ -19597,7 +22366,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.contentLanguage; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "blobSequenceNumber", { @@ -19612,7 +22381,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.blobSequenceNumber; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "blobType", { @@ -19627,7 +22396,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.blobType; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentLength", { @@ -19642,7 +22411,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.contentLength; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentMD5", { @@ -19663,7 +22432,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.contentMD5; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentRange", { @@ -19679,7 +22448,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.contentRange; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentType", { @@ -19694,7 +22463,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.contentType; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "copyCompletedOn", { @@ -19710,7 +22479,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.copyCompletedOn; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "copyId", { @@ -19725,7 +22494,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.copyId; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "copyProgress", { @@ -19742,7 +22511,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.copyProgress; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "copySource", { @@ -19758,7 +22527,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.copySource; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "copyStatus", { @@ -19774,7 +22543,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.copyStatus; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "copyStatusDescription", { @@ -19790,7 +22559,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.copyStatusDescription; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "leaseDuration", { @@ -19806,7 +22575,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.leaseDuration; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "leaseState", { @@ -19821,7 +22590,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.leaseState; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "leaseStatus", { @@ -19836,7 +22605,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.leaseStatus; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "date", { @@ -19851,7 +22620,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.date; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "blobCommittedBlockCount", { @@ -19866,7 +22635,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.blobCommittedBlockCount; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "etag", { @@ -19881,7 +22650,21 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.etag; }, - enumerable: true, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobDownloadResponse.prototype, "tagCount", { + /** + * The number of tags associated with the blob + * + * @readonly + * @type {(number | undefined)} + * @memberof BlobDownloadResponse + */ + get: function () { + return this.originalResponse.tagCount; + }, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "errorCode", { @@ -19895,7 +22678,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.errorCode; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "isServerEncrypted", { @@ -19913,7 +22696,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.isServerEncrypted; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "blobContentMD5", { @@ -19931,7 +22714,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.blobContentMD5; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "lastModified", { @@ -19947,7 +22730,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.lastModified; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "metadata", { @@ -19962,7 +22745,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.metadata; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "requestId", { @@ -19977,7 +22760,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.requestId; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "clientRequestId", { @@ -19992,12 +22775,12 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.clientRequestId; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "version", { /** - * Indicates the version of the File service used + * Indicates the version of the Blob service used * to execute the request. * * @readonly @@ -20007,7 +22790,21 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.version; }, - enumerable: true, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobDownloadResponse.prototype, "versionId", { + /** + * Indicates the versionId of the downloaded blob version. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobDownloadResponse + */ + get: function () { + return this.originalResponse.versionId; + }, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "encryptionKeySha256", { @@ -20022,7 +22819,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.encryptionKeySha256; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentCrc64", { @@ -20038,7 +22835,49 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.contentCrc64; }, - enumerable: true, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobDownloadResponse.prototype, "objectReplicationDestinationPolicyId", { + /** + * Object Replication Policy Id of the destination blob. + * + * @readonly + * @type {(string| undefined)} + * @memberof BlobDownloadResponse + */ + get: function () { + return this.originalResponse.objectReplicationDestinationPolicyId; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobDownloadResponse.prototype, "objectReplicationSourceProperties", { + /** + * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. + * + * @readonly + * @type {(ObjectReplicationPolicy[] | undefined)} + * @memberof BlobDownloadResponse + */ + get: function () { + return this.originalResponse.objectReplicationSourceProperties; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobDownloadResponse.prototype, "isSealed", { + /** + * If this blob has been sealed. + * + * @readonly + * @type {(boolean | undefined)} + * @memberof BlobDownloadResponse + */ + get: function () { + return this.originalResponse.isSealed; + }, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentAsBlob", { @@ -20053,7 +22892,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.blobBody; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "readableStreamBody", { @@ -20070,7 +22909,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return coreHttp.isNode ? this.blobDownloadStream : undefined; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "_response", { @@ -20083,275 +22922,1605 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse._response; }, - enumerable: true, + enumerable: false, configurable: true }); return BlobDownloadResponse; }()); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -/** - * Generate a range string. For example: - * - * "bytes=255-" or "bytes=0-511" - * - * @export - * @param {Range} iRange - * @returns {string} - */ -function rangeToString(iRange) { - if (iRange.offset < 0) { - throw new RangeError("Range.offset cannot be smaller than 0."); +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +var AVRO_SYNC_MARKER_SIZE = 16; +var AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); +var AVRO_CODEC_KEY = "avro.codec"; +var AVRO_SCHEMA_KEY = "avro.schema"; + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +function arraysEqual(a, b) { + if (a === b) + return true; + if (a == null || b == null) + return false; + if (a.length != b.length) + return false; + for (var i = 0; i < a.length; ++i) { + if (a[i] !== b[i]) + return false; } - if (iRange.count && iRange.count <= 0) { - throw new RangeError("Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end."); - } - return iRange.count - ? "bytes=" + iRange.offset + "-" + (iRange.offset + iRange.count - 1) - : "bytes=" + iRange.offset + "-"; + return true; } -// Copyright (c) Microsoft Corporation. All rights reserved. -(function (BlockBlobTier) { - /** - * Optmized for storing data that is accessed frequently. - */ - BlockBlobTier["Hot"] = "Hot"; - /** - * Optimized for storing data that is infrequently accessed and stored for at least 30 days. - */ - BlockBlobTier["Cool"] = "Cool"; - /** - * Optimized for storing data that is rarely accessed and stored for at least 180 days - * with flexible latency requirements (on the order of hours). - */ - BlockBlobTier["Archive"] = "Archive"; -})(exports.BlockBlobTier || (exports.BlockBlobTier = {})); -(function (PremiumPageBlobTier) { - /** - * P4 Tier. - */ - PremiumPageBlobTier["P4"] = "P4"; - /** - * P6 Tier. - */ - PremiumPageBlobTier["P6"] = "P6"; - /** - * P10 Tier. - */ - PremiumPageBlobTier["P10"] = "P10"; - /** - * P15 Tier. - */ - PremiumPageBlobTier["P15"] = "P15"; - /** - * P20 Tier. - */ - PremiumPageBlobTier["P20"] = "P20"; - /** - * P30 Tier. - */ - PremiumPageBlobTier["P30"] = "P30"; - /** - * P40 Tier. - */ - PremiumPageBlobTier["P40"] = "P40"; - /** - * P50 Tier. - */ - PremiumPageBlobTier["P50"] = "P50"; - /** - * P60 Tier. - */ - PremiumPageBlobTier["P60"] = "P60"; - /** - * P70 Tier. - */ - PremiumPageBlobTier["P70"] = "P70"; - /** - * P80 Tier. - */ - PremiumPageBlobTier["P80"] = "P80"; -})(exports.PremiumPageBlobTier || (exports.PremiumPageBlobTier = {})); -function toAccessTier(tier) { - if (tier == undefined) { - return undefined; +// Copyright (c) Microsoft Corporation. +var AvroParser = /** @class */ (function () { + function AvroParser() { } - return tier; // No more check if string is a valid AccessTier, and left this to underlay logic to decide(service). -} -function ensureCpkIfSpecified(cpk, isHttps) { - if (cpk && !isHttps) { - throw new RangeError("Customer-provided encryption key must be used over HTTPS."); + /** + * Reads a fixed number of bytes from the stream. + * + * @static + * @param {AvroReadable} [stream] + * @param {number} [length] + * @param {AvroParserReadOptions} [options={}] + * @returns {Promise} + * @memberof AvroParser + */ + AvroParser.readFixedBytes = function (stream, length, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var bytes; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, stream.read(length, { abortSignal: options.abortSignal })]; + case 1: + bytes = _a.sent(); + if (bytes.length != length) { + throw new Error("Hit stream end."); + } + return [2 /*return*/, bytes]; + } + }); + }); + }; + /** + * Reads a single byte from the stream. + * + * @static + * @param {AvroReadable} [stream] + * @param {AvroParserReadOptions} [options={}] + * @returns {Promise} + * @memberof AvroParser + */ + AvroParser.readByte = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var buf; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readFixedBytes(stream, 1, options)]; + case 1: + buf = _a.sent(); + return [2 /*return*/, buf[0]]; + } + }); + }); + }; + // int and long are stored in variable-length zig-zag coding. + // variable-length: https://lucene.apache.org/core/3_5_0/fileformats.html#VInt + // zig-zag: https://developers.google.com/protocol-buffers/docs/encoding?csw=1#types + AvroParser.readZigZagLong = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var zigZagEncoded, significanceInBit, byte, haveMoreByte, significanceInFloat, res; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + zigZagEncoded = 0; + significanceInBit = 0; + _a.label = 1; + case 1: return [4 /*yield*/, AvroParser.readByte(stream, options)]; + case 2: + byte = _a.sent(); + haveMoreByte = byte & 0x80; + zigZagEncoded |= (byte & 0x7f) << significanceInBit; + significanceInBit += 7; + _a.label = 3; + case 3: + if (haveMoreByte && significanceInBit < 28) return [3 /*break*/, 1]; + _a.label = 4; + case 4: + if (!haveMoreByte) return [3 /*break*/, 9]; + // Switch to float arithmetic + zigZagEncoded = zigZagEncoded; + significanceInFloat = 268435456; // 2 ** 28. + _a.label = 5; + case 5: return [4 /*yield*/, AvroParser.readByte(stream, options)]; + case 6: + byte = _a.sent(); + zigZagEncoded += (byte & 0x7f) * significanceInFloat; + significanceInFloat *= 128; // 2 ** 7 + _a.label = 7; + case 7: + if (byte & 0x80) return [3 /*break*/, 5]; + _a.label = 8; + case 8: + res = (zigZagEncoded % 2 ? -(zigZagEncoded + 1) : zigZagEncoded) / 2; + if (res < Number.MIN_SAFE_INTEGER || res > Number.MAX_SAFE_INTEGER) { + throw new Error("Integer overflow."); + } + return [2 /*return*/, res]; + case 9: return [2 /*return*/, (zigZagEncoded >> 1) ^ -(zigZagEncoded & 1)]; + } + }); + }); + }; + AvroParser.readLong = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + return [2 /*return*/, AvroParser.readZigZagLong(stream, options)]; + }); + }); + }; + AvroParser.readInt = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + return [2 /*return*/, AvroParser.readZigZagLong(stream, options)]; + }); + }); + }; + AvroParser.readNull = function () { + return tslib.__awaiter(this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + return [2 /*return*/, null]; + }); + }); + }; + AvroParser.readBoolean = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var b; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readByte(stream, options)]; + case 1: + b = _a.sent(); + if (b == 1) { + return [2 /*return*/, true]; + } + else if (b == 0) { + return [2 /*return*/, false]; + } + else { + throw new Error("Byte was not a boolean."); + } + } + }); + }); + }; + AvroParser.readFloat = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var u8arr, view; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readFixedBytes(stream, 4, options)]; + case 1: + u8arr = _a.sent(); + view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return [2 /*return*/, view.getFloat32(0, true)]; // littleEndian = true + } + }); + }); + }; + AvroParser.readDouble = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var u8arr, view; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readFixedBytes(stream, 8, options)]; + case 1: + u8arr = _a.sent(); + view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return [2 /*return*/, view.getFloat64(0, true)]; // littleEndian = true + } + }); + }); + }; + AvroParser.readBytes = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var size; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readLong(stream, options)]; + case 1: + size = _a.sent(); + if (size < 0) { + throw new Error("Bytes size was negative."); + } + return [4 /*yield*/, stream.read(size, { abortSignal: options.abortSignal })]; + case 2: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + AvroParser.readString = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var u8arr, utf8decoder; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readBytes(stream, options)]; + case 1: + u8arr = _a.sent(); + // polyfill TextDecoder to be backward compatible with older + // nodejs that doesn't expose TextDecoder as a global variable + if (typeof TextDecoder === "undefined" && "function" !== "undefined") { + global.TextDecoder = __webpack_require__(669).TextDecoder; + } + utf8decoder = new TextDecoder(); + return [2 /*return*/, utf8decoder.decode(u8arr)]; + } + }); + }); + }; + AvroParser.readMapPair = function (stream, readItemMethod, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var key, value; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readString(stream, options)]; + case 1: + key = _a.sent(); + return [4 /*yield*/, readItemMethod(stream, options)]; + case 2: + value = _a.sent(); + return [2 /*return*/, { key: key, value: value }]; + } + }); + }); + }; + AvroParser.readMap = function (stream, readItemMethod, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var readPairMethod, pairs, dict, _i, pairs_1, pair; + var _this = this; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + readPairMethod = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(_this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readMapPair(stream, readItemMethod, options)]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + return [4 /*yield*/, AvroParser.readArray(stream, readPairMethod, options)]; + case 1: + pairs = _a.sent(); + dict = {}; + for (_i = 0, pairs_1 = pairs; _i < pairs_1.length; _i++) { + pair = pairs_1[_i]; + dict[pair.key] = pair.value; + } + return [2 /*return*/, dict]; + } + }); + }); + }; + AvroParser.readArray = function (stream, readItemMethod, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var items, count, item; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + items = []; + return [4 /*yield*/, AvroParser.readLong(stream, options)]; + case 1: + count = _a.sent(); + _a.label = 2; + case 2: + if (!(count != 0)) return [3 /*break*/, 8]; + if (!(count < 0)) return [3 /*break*/, 4]; + // Ignore block sizes + return [4 /*yield*/, AvroParser.readLong(stream, options)]; + case 3: + // Ignore block sizes + _a.sent(); + count = -count; + _a.label = 4; + case 4: + if (!count--) return [3 /*break*/, 6]; + return [4 /*yield*/, readItemMethod(stream, options)]; + case 5: + item = _a.sent(); + items.push(item); + return [3 /*break*/, 4]; + case 6: return [4 /*yield*/, AvroParser.readLong(stream, options)]; + case 7: + count = _a.sent(); + return [3 /*break*/, 2]; + case 8: return [2 /*return*/, items]; + } + }); + }); + }; + return AvroParser; +}()); +var AvroComplex; +(function (AvroComplex) { + AvroComplex["RECORD"] = "record"; + AvroComplex["ENUM"] = "enum"; + AvroComplex["ARRAY"] = "array"; + AvroComplex["MAP"] = "map"; + AvroComplex["UNION"] = "union"; + AvroComplex["FIXED"] = "fixed"; +})(AvroComplex || (AvroComplex = {})); +var AvroType = /** @class */ (function () { + function AvroType() { } - if (cpk && !cpk.encryptionAlgorithm) { - cpk.encryptionAlgorithm = EncryptionAlgorithmAES25; + /** + * Determines the AvroType from the Avro Schema. + */ + AvroType.fromSchema = function (schema) { + if (typeof schema == "string") { + return AvroType.fromStringSchema(schema); + } + else if (Array.isArray(schema)) { + return AvroType.fromArraySchema(schema); + } + else { + return AvroType.fromObjectSchema(schema); + } + }; + AvroType.fromStringSchema = function (schema) { + switch (schema) { + case AvroPrimitive.NULL: + case AvroPrimitive.BOOLEAN: + case AvroPrimitive.INT: + case AvroPrimitive.LONG: + case AvroPrimitive.FLOAT: + case AvroPrimitive.DOUBLE: + case AvroPrimitive.BYTES: + case AvroPrimitive.STRING: + return new AvroPrimitiveType(schema); + default: + throw new Error("Unexpected Avro type " + schema); + } + }; + AvroType.fromArraySchema = function (schema) { + return new AvroUnionType(schema.map(AvroType.fromSchema)); + }; + AvroType.fromObjectSchema = function (schema) { + var type = schema.type; + // Primitives can be defined as strings or objects + try { + return AvroType.fromStringSchema(type); + } + catch (err) { } + switch (type) { + case AvroComplex.RECORD: + if (schema.aliases) { + throw new Error("aliases currently is not supported, schema: " + schema); + } + if (!schema.name) { + throw new Error("Required attribute 'name' doesn't exist on schema: " + schema); + } + var fields = {}; + if (!schema.fields) { + throw new Error("Required attribute 'fields' doesn't exist on schema: " + schema); + } + for (var _i = 0, _a = schema.fields; _i < _a.length; _i++) { + var field = _a[_i]; + fields[field.name] = AvroType.fromSchema(field.type); + } + return new AvroRecordType(fields, schema.name); + case AvroComplex.ENUM: + if (schema.aliases) { + throw new Error("aliases currently is not supported, schema: " + schema); + } + if (!schema.symbols) { + throw new Error("Required attribute 'symbols' doesn't exist on schema: " + schema); + } + return new AvroEnumType(schema.symbols); + case AvroComplex.MAP: + if (!schema.values) { + throw new Error("Required attribute 'values' doesn't exist on schema: " + schema); + } + return new AvroMapType(AvroType.fromSchema(schema.values)); + case AvroComplex.ARRAY: // Unused today + case AvroComplex.FIXED: // Unused today + default: + throw new Error("Unexpected Avro type " + type + " in " + schema); + } + }; + return AvroType; +}()); +var AvroPrimitive; +(function (AvroPrimitive) { + AvroPrimitive["NULL"] = "null"; + AvroPrimitive["BOOLEAN"] = "boolean"; + AvroPrimitive["INT"] = "int"; + AvroPrimitive["LONG"] = "long"; + AvroPrimitive["FLOAT"] = "float"; + AvroPrimitive["DOUBLE"] = "double"; + AvroPrimitive["BYTES"] = "bytes"; + AvroPrimitive["STRING"] = "string"; +})(AvroPrimitive || (AvroPrimitive = {})); +var AvroPrimitiveType = /** @class */ (function (_super) { + tslib.__extends(AvroPrimitiveType, _super); + function AvroPrimitiveType(primitive) { + var _this = _super.call(this) || this; + _this._primitive = primitive; + return _this; } -} + AvroPrimitiveType.prototype.read = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _a; + return tslib.__generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = this._primitive; + switch (_a) { + case AvroPrimitive.NULL: return [3 /*break*/, 1]; + case AvroPrimitive.BOOLEAN: return [3 /*break*/, 3]; + case AvroPrimitive.INT: return [3 /*break*/, 5]; + case AvroPrimitive.LONG: return [3 /*break*/, 7]; + case AvroPrimitive.FLOAT: return [3 /*break*/, 9]; + case AvroPrimitive.DOUBLE: return [3 /*break*/, 11]; + case AvroPrimitive.BYTES: return [3 /*break*/, 13]; + case AvroPrimitive.STRING: return [3 /*break*/, 15]; + } + return [3 /*break*/, 17]; + case 1: return [4 /*yield*/, AvroParser.readNull()]; + case 2: return [2 /*return*/, _b.sent()]; + case 3: return [4 /*yield*/, AvroParser.readBoolean(stream, options)]; + case 4: return [2 /*return*/, _b.sent()]; + case 5: return [4 /*yield*/, AvroParser.readInt(stream, options)]; + case 6: return [2 /*return*/, _b.sent()]; + case 7: return [4 /*yield*/, AvroParser.readLong(stream, options)]; + case 8: return [2 /*return*/, _b.sent()]; + case 9: return [4 /*yield*/, AvroParser.readFloat(stream, options)]; + case 10: return [2 /*return*/, _b.sent()]; + case 11: return [4 /*yield*/, AvroParser.readDouble(stream, options)]; + case 12: return [2 /*return*/, _b.sent()]; + case 13: return [4 /*yield*/, AvroParser.readBytes(stream, options)]; + case 14: return [2 /*return*/, _b.sent()]; + case 15: return [4 /*yield*/, AvroParser.readString(stream, options)]; + case 16: return [2 /*return*/, _b.sent()]; + case 17: throw new Error("Unknown Avro Primitive"); + } + }); + }); + }; + return AvroPrimitiveType; +}(AvroType)); +var AvroEnumType = /** @class */ (function (_super) { + tslib.__extends(AvroEnumType, _super); + function AvroEnumType(symbols) { + var _this = _super.call(this) || this; + _this._symbols = symbols; + return _this; + } + AvroEnumType.prototype.read = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var value; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readInt(stream, options)]; + case 1: + value = _a.sent(); + return [2 /*return*/, this._symbols[value]]; + } + }); + }); + }; + return AvroEnumType; +}(AvroType)); +var AvroUnionType = /** @class */ (function (_super) { + tslib.__extends(AvroUnionType, _super); + function AvroUnionType(types) { + var _this = _super.call(this) || this; + _this._types = types; + return _this; + } + AvroUnionType.prototype.read = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var typeIndex; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readInt(stream, options)]; + case 1: + typeIndex = _a.sent(); + return [4 /*yield*/, this._types[typeIndex].read(stream, options)]; + case 2: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + return AvroUnionType; +}(AvroType)); +var AvroMapType = /** @class */ (function (_super) { + tslib.__extends(AvroMapType, _super); + function AvroMapType(itemType) { + var _this = _super.call(this) || this; + _this._itemType = itemType; + return _this; + } + AvroMapType.prototype.read = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var readItemMethod; + var _this = this; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + readItemMethod = function (s, options) { return tslib.__awaiter(_this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this._itemType.read(s, options)]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); }; + return [4 /*yield*/, AvroParser.readMap(stream, readItemMethod, options)]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + return AvroMapType; +}(AvroType)); +var AvroRecordType = /** @class */ (function (_super) { + tslib.__extends(AvroRecordType, _super); + function AvroRecordType(fields, name) { + var _this = _super.call(this) || this; + _this._fields = fields; + _this._name = name; + return _this; + } + AvroRecordType.prototype.read = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var record, _a, _b, _i, key, _c, _d; + return tslib.__generator(this, function (_e) { + switch (_e.label) { + case 0: + record = {}; + record["$schema"] = this._name; + _a = []; + for (_b in this._fields) + _a.push(_b); + _i = 0; + _e.label = 1; + case 1: + if (!(_i < _a.length)) return [3 /*break*/, 4]; + key = _a[_i]; + if (!this._fields.hasOwnProperty(key)) return [3 /*break*/, 3]; + _c = record; + _d = key; + return [4 /*yield*/, this._fields[key].read(stream, options)]; + case 2: + _c[_d] = _e.sent(); + _e.label = 3; + case 3: + _i++; + return [3 /*break*/, 1]; + case 4: return [2 /*return*/, record]; + } + }); + }); + }; + return AvroRecordType; +}(AvroType)); + +// Copyright (c) Microsoft Corporation. +var AvroReader = /** @class */ (function () { + function AvroReader(dataStream, headerStream, currentBlockOffset, indexWithinCurrentBlock) { + this._dataStream = dataStream; + this._headerStream = headerStream || dataStream; + this._initialized = false; + this._blockOffset = currentBlockOffset || 0; + this._objectIndex = indexWithinCurrentBlock || 0; + this._initialBlockOffset = currentBlockOffset || 0; + } + Object.defineProperty(AvroReader.prototype, "blockOffset", { + get: function () { + return this._blockOffset; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(AvroReader.prototype, "objectIndex", { + get: function () { + return this._objectIndex; + }, + enumerable: false, + configurable: true + }); + AvroReader.prototype.initialize = function (options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var header, _a, codec, _b, schema, _c, i; + return tslib.__generator(this, function (_d) { + switch (_d.label) { + case 0: return [4 /*yield*/, AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { + abortSignal: options.abortSignal + })]; + case 1: + header = _d.sent(); + if (!arraysEqual(header, AVRO_INIT_BYTES)) { + throw new Error("Stream is not an Avro file."); + } + // File metadata is written as if defined by the following map schema: + // { "type": "map", "values": "bytes"} + _a = this; + return [4 /*yield*/, AvroParser.readMap(this._headerStream, AvroParser.readString, { + abortSignal: options.abortSignal + })]; + case 2: + // File metadata is written as if defined by the following map schema: + // { "type": "map", "values": "bytes"} + _a._metadata = _d.sent(); + codec = this._metadata[AVRO_CODEC_KEY]; + if (!(codec == undefined || codec == "null")) { + throw new Error("Codecs are not supported"); + } + // The 16-byte, randomly-generated sync marker for this file. + _b = this; + return [4 /*yield*/, AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, { + abortSignal: options.abortSignal + })]; + case 3: + // The 16-byte, randomly-generated sync marker for this file. + _b._syncMarker = _d.sent(); + schema = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); + this._itemType = AvroType.fromSchema(schema); + if (this._blockOffset == 0) { + this._blockOffset = this._initialBlockOffset + this._dataStream.position; + } + _c = this; + return [4 /*yield*/, AvroParser.readLong(this._dataStream, { + abortSignal: options.abortSignal + })]; + case 4: + _c._itemsRemainingInBlock = _d.sent(); + // skip block length + return [4 /*yield*/, AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })]; + case 5: + // skip block length + _d.sent(); + this._initialized = true; + if (!(this._objectIndex && this._objectIndex > 0)) return [3 /*break*/, 9]; + i = 0; + _d.label = 6; + case 6: + if (!(i < this._objectIndex)) return [3 /*break*/, 9]; + return [4 /*yield*/, this._itemType.read(this._dataStream, { abortSignal: options.abortSignal })]; + case 7: + _d.sent(); + this._itemsRemainingInBlock--; + _d.label = 8; + case 8: + i++; + return [3 /*break*/, 6]; + case 9: return [2 /*return*/]; + } + }); + }); + }; + AvroReader.prototype.hasNext = function () { + return !this._initialized || this._itemsRemainingInBlock > 0; + }; + AvroReader.prototype.parseObjects = function (options) { + if (options === void 0) { options = {}; } + return tslib.__asyncGenerator(this, arguments, function parseObjects_1() { + var result, marker, _a, err_1; + return tslib.__generator(this, function (_b) { + switch (_b.label) { + case 0: + if (!!this._initialized) return [3 /*break*/, 2]; + return [4 /*yield*/, tslib.__await(this.initialize(options))]; + case 1: + _b.sent(); + _b.label = 2; + case 2: + if (!this.hasNext()) return [3 /*break*/, 13]; + return [4 /*yield*/, tslib.__await(this._itemType.read(this._dataStream, { + abortSignal: options.abortSignal + }))]; + case 3: + result = _b.sent(); + this._itemsRemainingInBlock--; + this._objectIndex++; + if (!(this._itemsRemainingInBlock == 0)) return [3 /*break*/, 10]; + return [4 /*yield*/, tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, { + abortSignal: options.abortSignal + }))]; + case 4: + marker = _b.sent(); + this._blockOffset = this._initialBlockOffset + this._dataStream.position; + this._objectIndex = 0; + if (!arraysEqual(this._syncMarker, marker)) { + throw new Error("Stream is not a valid Avro file."); + } + _b.label = 5; + case 5: + _b.trys.push([5, 7, , 8]); + _a = this; + return [4 /*yield*/, tslib.__await(AvroParser.readLong(this._dataStream, { + abortSignal: options.abortSignal + }))]; + case 6: + _a._itemsRemainingInBlock = _b.sent(); + return [3 /*break*/, 8]; + case 7: + err_1 = _b.sent(); + // We hit the end of the stream. + this._itemsRemainingInBlock = 0; + return [3 /*break*/, 8]; + case 8: + if (!(this._itemsRemainingInBlock > 0)) return [3 /*break*/, 10]; + // Ignore block size + return [4 /*yield*/, tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal }))]; + case 9: + // Ignore block size + _b.sent(); + _b.label = 10; + case 10: return [4 /*yield*/, tslib.__await(result)]; + case 11: return [4 /*yield*/, _b.sent()]; + case 12: + _b.sent(); + return [3 /*break*/, 2]; + case 13: return [2 /*return*/]; + } + }); + }); + }; + return AvroReader; +}()); + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +var AvroReadable = /** @class */ (function () { + function AvroReadable() { + } + return AvroReadable; +}()); + +// Copyright (c) Microsoft Corporation. +var ABORT_ERROR$1 = new abortController.AbortError("Reading from the avro stream was aborted."); +var AvroReadableFromStream = /** @class */ (function (_super) { + tslib.__extends(AvroReadableFromStream, _super); + function AvroReadableFromStream(readable) { + var _this = _super.call(this) || this; + _this._readable = readable; + _this._position = 0; + return _this; + } + AvroReadableFromStream.prototype.toUint8Array = function (data) { + if (typeof data === "string") { + return Buffer.from(data); + } + return data; + }; + Object.defineProperty(AvroReadableFromStream.prototype, "position", { + get: function () { + return this._position; + }, + enumerable: false, + configurable: true + }); + AvroReadableFromStream.prototype.read = function (size, options) { + var _a; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var chunk; + var _this = this; + return tslib.__generator(this, function (_b) { + if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { + throw ABORT_ERROR$1; + } + if (size < 0) { + throw new Error("size parameter should be positive: " + size); + } + if (size === 0) { + return [2 /*return*/, new Uint8Array()]; + } + if (!this._readable.readable) { + throw new Error("Stream no longer readable."); + } + chunk = this._readable.read(size); + if (chunk) { + this._position += chunk.length; + // chunk.length maybe less than desired size if the stream ends. + return [2 /*return*/, this.toUint8Array(chunk)]; + } + else { + // register callback to wait for enough data to read + return [2 /*return*/, new Promise(function (resolve, reject) { + var cleanUp = function () { + _this._readable.removeListener("readable", readableCallback); + _this._readable.removeListener("error", rejectCallback); + _this._readable.removeListener("end", rejectCallback); + _this._readable.removeListener("close", rejectCallback); + if (options.abortSignal) { + options.abortSignal.removeEventListener("abort", abortHandler); + } + }; + var readableCallback = function () { + var chunk = _this._readable.read(size); + if (chunk) { + _this._position += chunk.length; + cleanUp(); + // chunk.length maybe less than desired size if the stream ends. + resolve(_this.toUint8Array(chunk)); + } + }; + var rejectCallback = function () { + cleanUp(); + reject(); + }; + var abortHandler = function () { + cleanUp(); + reject(ABORT_ERROR$1); + }; + _this._readable.on("readable", readableCallback); + _this._readable.once("error", rejectCallback); + _this._readable.once("end", rejectCallback); + _this._readable.once("close", rejectCallback); + if (options.abortSignal) { + options.abortSignal.addEventListener("abort", abortHandler); + } + })]; + } + }); + }); + }; + return AvroReadableFromStream; +}(AvroReadable)); // Copyright (c) Microsoft Corporation. All rights reserved. -/** - * Reads a readable stream into buffer. Fill the buffer from offset to end. - * - * @export - * @param {NodeJS.ReadableStream} stream A Node.js Readable stream - * @param {Buffer} buffer Buffer to be filled, length must >= offset - * @param {number} offset From which position in the buffer to be filled, inclusive - * @param {number} end To which position in the buffer to be filled, exclusive - * @param {string} [encoding] Encoding of the Readable stream - * @returns {Promise} - */ -function streamToBuffer(stream, buffer, offset, end, encoding) { - return tslib.__awaiter(this, void 0, void 0, function () { - var pos, count; - return tslib.__generator(this, function (_a) { - pos = 0; - count = end - offset; - return [2 /*return*/, new Promise(function (resolve, reject) { - stream.on("readable", function () { - if (pos >= count) { - resolve(); - return; - } - var chunk = stream.read(); - if (!chunk) { - return; - } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, encoding); - } - // How much data needed in this chunk - var chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); - pos += chunkLength; - }); - stream.on("end", function () { - if (pos < count) { - reject(new Error("Stream drains before getting enough data needed. Data read: " + pos + ", data need: " + count)); - } - resolve(); - }); - stream.on("error", reject); - })]; - }); - }); -} -/** - * Reads a readable stream into buffer entirely. - * - * @export - * @param {NodeJS.ReadableStream} stream A Node.js Readable stream - * @param {Buffer} buffer Buffer to be filled, length must >= offset - * @param {string} [encoding] Encoding of the Readable stream - * @returns {Promise} with the count of bytes read. - * @throws {RangeError} If buffer size is not big enough. - */ -function streamToBuffer2(stream, buffer, encoding) { - return tslib.__awaiter(this, void 0, void 0, function () { - var pos, bufferSize; - return tslib.__generator(this, function (_a) { - pos = 0; - bufferSize = buffer.length; - return [2 /*return*/, new Promise(function (resolve, reject) { - stream.on("readable", function () { - var chunk = stream.read(); - if (!chunk) { - return; - } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, encoding); - } - if (pos + chunk.length > bufferSize) { - reject(new Error("Stream exceeds buffer size. Buffer size: " + bufferSize)); - return; - } - buffer.fill(chunk, pos, pos + chunk.length); - pos += chunk.length; - }); - stream.on("end", function () { - resolve(pos); - }); - stream.on("error", reject); - })]; - }); - }); -} /** * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * Writes the content of a readstream to a local file. Returns a Promise which is completed after the file handle is closed. + * A Node.js BlobQuickQueryStream will internally parse avro data stream for blob query. * - * @export - * @param {NodeJS.ReadableStream} rs The read stream. - * @param {string} file Destination file path. - * @returns {Promise} + * @class BlobQuickQueryStream + * @extends {Readable} */ -function readStreamToLocalFile(rs, file) { - return tslib.__awaiter(this, void 0, void 0, function () { - return tslib.__generator(this, function (_a) { - return [2 /*return*/, new Promise(function (resolve, reject) { - var ws = fs.createWriteStream(file); - rs.on("error", function (err) { - reject(err); - }); - ws.on("error", function (err) { - reject(err); - }); - ws.on("close", resolve); - rs.pipe(ws); - })]; +var BlobQuickQueryStream = /** @class */ (function (_super) { + tslib.__extends(BlobQuickQueryStream, _super); + /** + * Creates an instance of BlobQuickQueryStream. + * + * @param {NodeJS.ReadableStream} source The current ReadableStream returned from getter + * @param {BlobQuickQueryStreamOptions} [options={}] + * @memberof BlobQuickQueryStream + */ + function BlobQuickQueryStream(source, options) { + if (options === void 0) { options = {}; } + var _this = _super.call(this) || this; + _this.source = source; + _this.onProgress = options.onProgress; + _this.onError = options.onError; + _this.avroReader = new AvroReader(new AvroReadableFromStream(_this.source)); + _this.avroIter = _this.avroReader.parseObjects({ abortSignal: options.abortSignal }); + return _this; + } + BlobQuickQueryStream.prototype._read = function () { + var _this = this; + this.readInternal().catch(function (err) { + _this.emit("error", err); }); - }); -} -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Promisified version of fs.stat(). - */ -var fsStat = util.promisify(fs.stat); + }; + BlobQuickQueryStream.prototype.readInternal = function () { + var e_1, _a; + return tslib.__awaiter(this, void 0, void 0, function () { + var _b, _c, obj, schema, exit, data, bytesScanned, totalBytes, fatal, name_1, description, position, e_1_1; + return tslib.__generator(this, function (_d) { + switch (_d.label) { + case 0: + _d.trys.push([0, 5, 6, 11]); + _b = tslib.__asyncValues(this.avroIter); + _d.label = 1; + case 1: return [4 /*yield*/, _b.next()]; + case 2: + if (!(_c = _d.sent(), !_c.done)) return [3 /*break*/, 4]; + obj = _c.value; + schema = obj.$schema; + if (typeof schema !== "string") { + throw Error("Missing schema in avro record."); + } + exit = false; + switch (schema) { + case "com.microsoft.azure.storage.queryBlobContents.resultData": + data = obj.data; + if (data instanceof Uint8Array === false) { + throw Error("Invalid data in avro result record."); + } + if (!this.push(Buffer.from(data))) { + exit = true; + } + break; + case "com.microsoft.azure.storage.queryBlobContents.progress": + bytesScanned = obj.bytesScanned; + if (typeof bytesScanned !== "number") { + throw Error("Invalid bytesScanned in avro progress record."); + } + if (this.onProgress) { + this.onProgress({ loadedBytes: bytesScanned }); + } + break; + case "com.microsoft.azure.storage.queryBlobContents.end": + if (this.onProgress) { + totalBytes = obj.totalBytes; + if (typeof totalBytes !== "number") { + throw Error("Invalid totalBytes in avro end record."); + } + this.onProgress({ loadedBytes: totalBytes }); + } + this.push(null); + break; + case "com.microsoft.azure.storage.queryBlobContents.error": + if (this.onError) { + fatal = obj.fatal; + if (typeof fatal !== "boolean") { + throw Error("Invalid fatal in avro error record."); + } + name_1 = obj.name; + if (typeof name_1 !== "string") { + throw Error("Invalid name in avro error record."); + } + description = obj.description; + if (typeof description !== "string") { + throw Error("Invalid description in avro error record."); + } + position = obj.position; + if (typeof position !== "number") { + throw Error("Invalid position in avro error record."); + } + this.onError({ + position: position, + name: name_1, + isFatal: fatal, + description: description + }); + } + break; + default: + throw Error("Unknown schema " + schema + " in avro progress record."); + } + if (exit) { + return [3 /*break*/, 4]; + } + _d.label = 3; + case 3: return [3 /*break*/, 1]; + case 4: return [3 /*break*/, 11]; + case 5: + e_1_1 = _d.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 11]; + case 6: + _d.trys.push([6, , 9, 10]); + if (!(_c && !_c.done && (_a = _b.return))) return [3 /*break*/, 8]; + return [4 /*yield*/, _a.call(_b)]; + case 7: + _d.sent(); + _d.label = 8; + case 8: return [3 /*break*/, 10]; + case 9: + if (e_1) throw e_1.error; + return [7 /*endfinally*/]; + case 10: return [7 /*endfinally*/]; + case 11: return [2 /*return*/]; + } + }); + }); + }; + return BlobQuickQueryStream; +}(stream.Readable)); // Copyright (c) Microsoft Corporation. All rights reserved. /** - * Credential policy used to sign HTTP(S) requests before sending. This is an - * abstract class. + * ONLY AVAILABLE IN NODE.JS RUNTIME. + * + * BlobQueryResponse implements BlobDownloadResponseModel interface, and in Node.js runtime it will + * parse avor data returned by blob query. * * @export - * @abstract - * @class CredentialPolicy - * @extends {BaseRequestPolicy} + * @class BlobQueryResponse + * @implements {BlobDownloadResponseModel} */ -var CredentialPolicy = /** @class */ (function (_super) { - tslib.__extends(CredentialPolicy, _super); - function CredentialPolicy() { - return _super !== null && _super.apply(this, arguments) || this; +var BlobQueryResponse = /** @class */ (function () { + /** + * Creates an instance of BlobQueryResponse. + * + * @param {BlobQueryResponseModel} originalResponse + * @param {BlobQuickQueryStreamOptions} [options={}] + * @memberof BlobQueryResponse + */ + function BlobQueryResponse(originalResponse, options) { + if (options === void 0) { options = {}; } + this.originalResponse = originalResponse; + this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); } - /** - * Sends out request. - * - * @param {WebResource} request - * @returns {Promise} - * @memberof CredentialPolicy - */ - CredentialPolicy.prototype.sendRequest = function (request) { - return this._nextPolicy.sendRequest(this.signRequest(request)); - }; - /** - * Child classes must implement this method with request signing. This method - * will be executed in {@link sendRequest}. - * - * @protected - * @abstract - * @param {WebResource} request - * @returns {WebResource} - * @memberof CredentialPolicy - */ - CredentialPolicy.prototype.signRequest = function (request) { - // Child classes must override this method with request signing. This method - // will be executed in sendRequest(). - return request; - }; - return CredentialPolicy; -}(coreHttp.BaseRequestPolicy)); + Object.defineProperty(BlobQueryResponse.prototype, "acceptRanges", { + /** + * Indicates that the service supports + * requests for partial file content. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.acceptRanges; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "cacheControl", { + /** + * Returns if it was previously specified + * for the file. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.cacheControl; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "contentDisposition", { + /** + * Returns the value that was specified + * for the 'x-ms-content-disposition' header and specifies how to process the + * response. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.contentDisposition; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "contentEncoding", { + /** + * Returns the value that was specified + * for the Content-Encoding request header. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.contentEncoding; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "contentLanguage", { + /** + * Returns the value that was specified + * for the Content-Language request header. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.contentLanguage; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "blobSequenceNumber", { + /** + * The current sequence number for a + * page blob. This header is not returned for block blobs or append blobs. + * + * @readonly + * @type {(number | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.blobSequenceNumber; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "blobType", { + /** + * The blob's type. Possible values include: + * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * + * @readonly + * @type {(BlobType | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.blobType; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "contentLength", { + /** + * The number of bytes present in the + * response body. + * + * @readonly + * @type {(number | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.contentLength; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "contentMD5", { + /** + * If the file has an MD5 hash and the + * request is to read the full file, this response header is returned so that + * the client can check for message content integrity. If the request is to + * read a specified range and the 'x-ms-range-get-content-md5' is set to + * true, then the request returns an MD5 hash for the range, as long as the + * range size is less than or equal to 4 MB. If neither of these sets of + * conditions is true, then no value is returned for the 'Content-MD5' + * header. + * + * @readonly + * @type {(Uint8Array | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.contentMD5; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "contentRange", { + /** + * Indicates the range of bytes returned if + * the client requested a subset of the file by setting the Range request + * header. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.contentRange; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "contentType", { + /** + * The content type specified for the file. + * The default content type is 'application/octet-stream' + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.contentType; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "copyCompletedOn", { + /** + * Conclusion time of the last attempted + * Copy File operation where this file was the destination file. This value + * can specify the time of a completed, aborted, or failed copy attempt. + * + * @readonly + * @type {(Date | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return undefined; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "copyId", { + /** + * String identifier for the last attempted Copy + * File operation where this file was the destination file. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.copyId; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "copyProgress", { + /** + * Contains the number of bytes copied and + * the total bytes in the source in the last attempted Copy File operation + * where this file was the destination file. Can show between 0 and + * Content-Length bytes copied. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.copyProgress; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "copySource", { + /** + * URL up to 2KB in length that specifies the + * source file used in the last attempted Copy File operation where this file + * was the destination file. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.copySource; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "copyStatus", { + /** + * State of the copy operation + * identified by 'x-ms-copy-id'. Possible values include: 'pending', + * 'success', 'aborted', 'failed' + * + * @readonly + * @type {(CopyStatusType | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.copyStatus; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "copyStatusDescription", { + /** + * Only appears when + * x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.copyStatusDescription; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "leaseDuration", { + /** + * When a blob is leased, + * specifies whether the lease is of infinite or fixed duration. Possible + * values include: 'infinite', 'fixed'. + * + * @readonly + * @type {(LeaseDurationType | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.leaseDuration; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "leaseState", { + /** + * Lease state of the blob. Possible + * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * + * @readonly + * @type {(LeaseStateType | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.leaseState; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "leaseStatus", { + /** + * The current lease status of the + * blob. Possible values include: 'locked', 'unlocked'. + * + * @readonly + * @type {(LeaseStatusType | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.leaseStatus; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "date", { + /** + * A UTC date/time value generated by the service that + * indicates the time at which the response was initiated. + * + * @readonly + * @type {(Date | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.date; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "blobCommittedBlockCount", { + /** + * The number of committed blocks + * present in the blob. This header is returned only for append blobs. + * + * @readonly + * @type {(number | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.blobCommittedBlockCount; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "etag", { + /** + * The ETag contains a value that you can use to + * perform operations conditionally, in quotes. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.etag; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "errorCode", { + /** + * The error code. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.errorCode; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "isServerEncrypted", { + /** + * The value of this header is set to + * true if the file data and application metadata are completely encrypted + * using the specified algorithm. Otherwise, the value is set to false (when + * the file is unencrypted, or if only parts of the file/application metadata + * are encrypted). + * + * @readonly + * @type {(boolean | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.isServerEncrypted; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "blobContentMD5", { + /** + * If the blob has a MD5 hash, and if + * request contains range header (Range or x-ms-range), this response header + * is returned with the value of the whole blob's MD5 value. This value may + * or may not be equal to the value returned in Content-MD5 header, with the + * latter calculated from the requested range. + * + * @readonly + * @type {(Uint8Array | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.blobContentMD5; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "lastModified", { + /** + * Returns the date and time the file was last + * modified. Any operation that modifies the file or its properties updates + * the last modified time. + * + * @readonly + * @type {(Date | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.lastModified; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "metadata", { + /** + * A name-value pair + * to associate with a file storage object. + * + * @readonly + * @type {(Metadata | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.metadata; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "requestId", { + /** + * This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.requestId; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "clientRequestId", { + /** + * If a client request id header is sent in the request, this header will be present in the + * response with the same value. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.clientRequestId; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "version", { + /** + * Indicates the version of the File service used + * to execute the request. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.version; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "encryptionKeySha256", { + /** + * The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned + * when the blob was encrypted with a customer-provided key. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.encryptionKeySha256; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "contentCrc64", { + /** + * If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to + * true, then the request returns a crc64 for the range, as long as the range size is less than + * or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is + * specified in the same request, it will fail with 400(Bad Request) + * + * @type {(Uint8Array | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.contentCrc64; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "blobBody", { + /** + * The response body as a browser Blob. + * Always undefined in node.js. + * + * @readonly + * @type {(Promise | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return undefined; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "readableStreamBody", { + /** + * The response body as a node.js Readable stream. + * Always undefined in the browser. + * + * It will parse avor data returned by blob query. + * + * @readonly + * @type {(NodeJS.ReadableStream | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return coreHttp.isNode ? this.blobDownloadStream : undefined; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "_response", { + /** + * The HTTP response. + * + * @type {HttpResponse} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse._response; + }, + enumerable: false, + configurable: true + }); + return BlobQueryResponse; +}()); // Copyright (c) Microsoft Corporation. All rights reserved. /** @@ -20407,12 +24576,6 @@ var StorageSharedKeyCredentialPolicy = /** @class */ (function (_super) { this.getCanonicalizedResourceString(request); var signature = this.factory.computeHMACSHA256(stringToSign); request.headers.set(HeaderConstants.AUTHORIZATION, "SharedKey " + this.factory.accountName + ":" + signature); - // Workaround for https://github.com/axios/axios/issues/2107 - // We should always keep the 'content-length' header once the issue is solved - // For a better explanation about this workaround, look here: https://github.com/Azure/azure-sdk-for-js/pull/3273 - if (typeof request.body !== "function" && !(request.body && request.onUploadProgress)) { - request.headers.remove(HeaderConstants.CONTENT_LENGTH); - } // console.log(`[URL]:${request.url}`); // console.log(`[HEADERS]:${request.headers.toString()}`); // console.log(`[STRING TO SIGN]:${JSON.stringify(stringToSign)}`); @@ -20514,37 +24677,6 @@ var StorageSharedKeyCredentialPolicy = /** @class */ (function (_super) { return StorageSharedKeyCredentialPolicy; }(CredentialPolicy)); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -/** - * Credential is an abstract class for Azure Storage HTTP requests signing. This - * class will host an credentialPolicyCreator factory which generates CredentialPolicy. - * - * @export - * @abstract - * @class Credential - */ -var Credential = /** @class */ (function () { - function Credential() { - } - /** - * Creates a RequestPolicy object. - * - * @param {RequestPolicy} _nextPolicy - * @param {RequestPolicyOptions} _options - * @returns {RequestPolicy} - * @memberof Credential - */ - Credential.prototype.create = function ( - // tslint:disable-next-line:variable-name - _nextPolicy, - // tslint:disable-next-line:variable-name - _options) { - throw new Error("Method should be implemented in children classes."); - }; - return Credential; -}()); - // Copyright (c) Microsoft Corporation. All rights reserved. /** * ONLY AVAILABLE IN NODE.JS RUNTIME. @@ -20595,252 +24727,6 @@ var StorageSharedKeyCredential = /** @class */ (function (_super) { return StorageSharedKeyCredential; }(Credential)); -// Copyright (c) Microsoft Corporation. All rights reserved. -/** - * AnonymousCredentialPolicy is used with HTTP(S) requests that read public resources - * or for use with Shared Access Signatures (SAS). - * - * @export - * @class AnonymousCredentialPolicy - * @extends {CredentialPolicy} - */ -var AnonymousCredentialPolicy = /** @class */ (function (_super) { - tslib.__extends(AnonymousCredentialPolicy, _super); - /** - * Creates an instance of AnonymousCredentialPolicy. - * @param {RequestPolicy} nextPolicy - * @param {RequestPolicyOptions} options - * @memberof AnonymousCredentialPolicy - */ - function AnonymousCredentialPolicy(nextPolicy, options) { - return _super.call(this, nextPolicy, options) || this; - } - return AnonymousCredentialPolicy; -}(CredentialPolicy)); - -// Copyright (c) Microsoft Corporation. All rights reserved. -/** - * AnonymousCredential provides a credentialPolicyCreator member used to create - * AnonymousCredentialPolicy objects. AnonymousCredentialPolicy is used with - * HTTP(S) requests that read public resources or for use with Shared Access - * Signatures (SAS). - * - * @export - * @class AnonymousCredential - * @extends {Credential} - */ -var AnonymousCredential = /** @class */ (function (_super) { - tslib.__extends(AnonymousCredential, _super); - function AnonymousCredential() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Creates an {@link AnonymousCredentialPolicy} object. - * - * @param {RequestPolicy} nextPolicy - * @param {RequestPolicyOptions} options - * @returns {AnonymousCredentialPolicy} - * @memberof AnonymousCredential - */ - AnonymousCredential.prototype.create = function (nextPolicy, options) { - return new AnonymousCredentialPolicy(nextPolicy, options); - }; - return AnonymousCredential; -}(Credential)); - -// Copyright (c) Microsoft Corporation. All rights reserved. -/** - * States for Batch. - * - * @enum {number} - */ -var BatchStates; -(function (BatchStates) { - BatchStates[BatchStates["Good"] = 0] = "Good"; - BatchStates[BatchStates["Error"] = 1] = "Error"; -})(BatchStates || (BatchStates = {})); -/** - * Batch provides basic parallel execution with concurrency limits. - * Will stop execute left operations when one of the executed operation throws an error. - * But Batch cannot cancel ongoing operations, you need to cancel them by yourself. - * - * @export - * @class Batch - */ -var Batch = /** @class */ (function () { - /** - * Creates an instance of Batch. - * @param {number} [concurrency=5] - * @memberof Batch - */ - function Batch(concurrency) { - if (concurrency === void 0) { concurrency = 5; } - /** - * Number of active operations under execution. - * - * @private - * @type {number} - * @memberof Batch - */ - this.actives = 0; - /** - * Number of completed operations under execution. - * - * @private - * @type {number} - * @memberof Batch - */ - this.completed = 0; - /** - * Offset of next operation to be executed. - * - * @private - * @type {number} - * @memberof Batch - */ - this.offset = 0; - /** - * Operation array to be executed. - * - * @private - * @type {Operation[]} - * @memberof Batch - */ - this.operations = []; - /** - * States of Batch. When an error happens, state will turn into error. - * Batch will stop execute left operations. - * - * @private - * @type {BatchStates} - * @memberof Batch - */ - this.state = BatchStates.Good; - if (concurrency < 1) { - throw new RangeError("concurrency must be larger than 0"); - } - this.concurrency = concurrency; - this.emitter = new events.EventEmitter(); - } - /** - * Add a operation into queue. - * - * @param {Operation} operation - * @memberof Batch - */ - Batch.prototype.addOperation = function (operation) { - var _this = this; - this.operations.push(function () { return tslib.__awaiter(_this, void 0, void 0, function () { - var error_1; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - this.actives++; - return [4 /*yield*/, operation()]; - case 1: - _a.sent(); - this.actives--; - this.completed++; - this.parallelExecute(); - return [3 /*break*/, 3]; - case 2: - error_1 = _a.sent(); - this.emitter.emit("error", error_1); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); - }); }); - }; - /** - * Start execute operations in the queue. - * - * @returns {Promise} - * @memberof Batch - */ - Batch.prototype.do = function () { - return tslib.__awaiter(this, void 0, void 0, function () { - var _this = this; - return tslib.__generator(this, function (_a) { - if (this.operations.length === 0) { - return [2 /*return*/, Promise.resolve()]; - } - this.parallelExecute(); - return [2 /*return*/, new Promise(function (resolve, reject) { - _this.emitter.on("finish", resolve); - _this.emitter.on("error", function (error) { - _this.state = BatchStates.Error; - reject(error); - }); - })]; - }); - }); - }; - /** - * Get next operation to be executed. Return null when reaching ends. - * - * @private - * @returns {(Operation | null)} - * @memberof Batch - */ - Batch.prototype.nextOperation = function () { - if (this.offset < this.operations.length) { - return this.operations[this.offset++]; - } - return null; - }; - /** - * Start execute operations. One one the most important difference between - * this method with do() is that do() wraps as an sync method. - * - * @private - * @returns {void} - * @memberof Batch - */ - Batch.prototype.parallelExecute = function () { - if (this.state === BatchStates.Error) { - return; - } - if (this.completed >= this.operations.length) { - this.emitter.emit("finish"); - return; - } - while (this.actives < this.concurrency) { - var operation = this.nextOperation(); - if (operation) { - operation(); - } - else { - return; - } - } - }; - return Batch; -}()); - -// Copyright (c) Microsoft Corporation. -/** - * Creates a span using the global tracer. - * @param name The name of the operation being performed. - * @param tracingOptions The options for the underlying http request. - */ -function createSpan(operationName, tracingOptions) { - if (tracingOptions === void 0) { tracingOptions = {}; } - var tracer = coreTracing.getTracer(); - var spanOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { kind: api.SpanKind.INTERNAL }); - var span = tracer.startSpan("Azure.Storage.Blob." + operationName, spanOptions); - span.setAttribute("az.namespace", "Microsoft.Storage"); - var newOptions = tracingOptions.spanOptions || {}; - if (span.isRecording()) { - newOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { parent: span.context(), attributes: tslib.__assign(tslib.__assign({}, spanOptions.attributes), { "az.namespace": "Microsoft.Storage" }) }); - } - return { - span: span, - spanOptions: newOptions - }; -} - /* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for @@ -20851,7 +24737,7 @@ function createSpan(operationName, tracingOptions) { * regenerated. */ var packageName = "azure-storage-blob"; -var packageVersion = "12.1.2"; +var packageVersion = "12.2.1"; var StorageClientContext = /** @class */ (function (_super) { tslib.__extends(StorageClientContext, _super); /** @@ -20873,7 +24759,7 @@ var StorageClientContext = /** @class */ (function (_super) { options.userAgent = packageName + "/" + packageVersion + " " + defaultUserAgent; } _this = _super.call(this, undefined, options) || this; - _this.version = '2019-07-07'; + _this.version = "2019-12-12"; _this.baseUri = "{url}"; _this.requestContentType = "application/json; charset=utf-8"; _this.url = url; @@ -20883,389 +24769,81 @@ var StorageClientContext = /** @class */ (function (_super) { }(coreHttp.ServiceClient)); // Copyright (c) Microsoft Corporation. All rights reserved. -/** - * A StorageClient represents a based URL class for {@link BlobServiceClient}, {@link ContainerClient} - * and etc. - * - * @export - * @class StorageClient - */ -var StorageClient = /** @class */ (function () { +(function (BlockBlobTier) { /** - * Creates an instance of StorageClient. - * @param {string} url url to resource - * @param {Pipeline} pipeline request policy pipeline. - * @memberof StorageClient + * Optimized for storing data that is accessed frequently. */ - function StorageClient(url, pipeline) { - // URL should be encoded and only once, protocol layer shouldn't encode URL again - this.url = escapeURLPath(url); - this.accountName = getAccountNameFromUrl(url); - this.pipeline = pipeline; - this.storageClientContext = new StorageClientContext(this.url, pipeline.toServiceClientOptions()); - this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); - this.credential = new AnonymousCredential(); - for (var _i = 0, _a = this.pipeline.factories; _i < _a.length; _i++) { - var factory = _a[_i]; - if ((coreHttp.isNode && factory instanceof StorageSharedKeyCredential) || - factory instanceof AnonymousCredential || - coreHttp.isTokenCredential(factory)) { - this.credential = factory; - } - } - // Override protocol layer's default content-type - var storageClientContext = this.storageClientContext; - storageClientContext.requestContentType = undefined; + BlockBlobTier["Hot"] = "Hot"; + /** + * Optimized for storing data that is infrequently accessed and stored for at least 30 days. + */ + BlockBlobTier["Cool"] = "Cool"; + /** + * Optimized for storing data that is rarely accessed and stored for at least 180 days + * with flexible latency requirements (on the order of hours). + */ + BlockBlobTier["Archive"] = "Archive"; +})(exports.BlockBlobTier || (exports.BlockBlobTier = {})); +(function (PremiumPageBlobTier) { + /** + * P4 Tier. + */ + PremiumPageBlobTier["P4"] = "P4"; + /** + * P6 Tier. + */ + PremiumPageBlobTier["P6"] = "P6"; + /** + * P10 Tier. + */ + PremiumPageBlobTier["P10"] = "P10"; + /** + * P15 Tier. + */ + PremiumPageBlobTier["P15"] = "P15"; + /** + * P20 Tier. + */ + PremiumPageBlobTier["P20"] = "P20"; + /** + * P30 Tier. + */ + PremiumPageBlobTier["P30"] = "P30"; + /** + * P40 Tier. + */ + PremiumPageBlobTier["P40"] = "P40"; + /** + * P50 Tier. + */ + PremiumPageBlobTier["P50"] = "P50"; + /** + * P60 Tier. + */ + PremiumPageBlobTier["P60"] = "P60"; + /** + * P70 Tier. + */ + PremiumPageBlobTier["P70"] = "P70"; + /** + * P80 Tier. + */ + PremiumPageBlobTier["P80"] = "P80"; +})(exports.PremiumPageBlobTier || (exports.PremiumPageBlobTier = {})); +function toAccessTier(tier) { + if (tier == undefined) { + return undefined; } - return StorageClient; -}()); - -// Copyright (c) Microsoft Corporation. All rights reserved. -/** - * This class accepts a Node.js Readable stream as input, and keeps reading data - * from the stream into the internal buffer structure, until it reaches maxBuffers. - * Every available buffer will try to trigger outgoingHandler. - * - * The internal buffer structure includes an incoming buffer array, and a outgoing - * buffer array. The incoming buffer array includes the "empty" buffers can be filled - * with new incoming data. The outgoing array includes the filled buffers to be - * handled by outgoingHandler. Every above buffer size is defined by parameter bufferSize. - * - * NUM_OF_ALL_BUFFERS = BUFFERS_IN_INCOMING + BUFFERS_IN_OUTGOING + BUFFERS_UNDER_HANDLING - * - * NUM_OF_ALL_BUFFERS <= maxBuffers - * - * PERFORMANCE IMPROVEMENT TIPS: - * 1. Input stream highWaterMark is better to set a same value with bufferSize - * parameter, which will avoid Buffer.concat() operations. - * 2. concurrency should set a smaller value than maxBuffers, which is helpful to - * reduce the possibility when a outgoing handler waits for the stream data. - * in this situation, outgoing handlers are blocked. - * Outgoing queue shouldn't be empty. - * @export - * @class BufferScheduler - */ -var BufferScheduler = /** @class */ (function () { - /** - * Creates an instance of BufferScheduler. - * - * @param {Readable} readable A Node.js Readable stream - * @param {number} bufferSize Buffer size of every maintained buffer - * @param {number} maxBuffers How many buffers can be allocated - * @param {OutgoingHandler} outgoingHandler An async function scheduled to be - * triggered when a buffer fully filled - * with stream data - * @param {number} concurrency Concurrency of executing outgoingHandlers (>0) - * @param {string} [encoding] [Optional] Encoding of Readable stream when it's a string stream - * @memberof BufferScheduler - */ - function BufferScheduler(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) { - /** - * An internal event emitter. - * - * @private - * @type {EventEmitter} - * @memberof BufferScheduler - */ - this.emitter = new events.EventEmitter(); - /** - * An internal offset marker to track data offset in bytes of next outgoingHandler. - * - * @private - * @type {number} - * @memberof BufferScheduler - */ - this.offset = 0; - /** - * An internal marker to track whether stream is end. - * - * @private - * @type {boolean} - * @memberof BufferScheduler - */ - this.isStreamEnd = false; - /** - * An internal marker to track whether stream or outgoingHandler returns error. - * - * @private - * @type {boolean} - * @memberof BufferScheduler - */ - this.isError = false; - /** - * How many handlers are executing. - * - * @private - * @type {number} - * @memberof BufferScheduler - */ - this.executingOutgoingHandlers = 0; - /** - * How many buffers have been allocated. - * - * @private - * @type {number} - * @memberof BufferScheduler - */ - this.numBuffers = 0; - /** - * Because this class doesn't know how much data every time stream pops, which - * is defined by highWaterMarker of the stream. So BufferScheduler will cache - * data received from the stream, when data in unresolvedDataArray exceeds the - * blockSize defined, it will try to concat a blockSize of buffer, fill into available - * buffers from incoming and push to outgoing array. - * - * @private - * @type {Buffer[]} - * @memberof BufferScheduler - */ - this.unresolvedDataArray = []; - /** - * How much data consisted in unresolvedDataArray. - * - * @private - * @type {number} - * @memberof BufferScheduler - */ - this.unresolvedLength = 0; - /** - * The array includes all the available buffers can be used to fill data from stream. - * - * @private - * @type {Buffer[]} - * @memberof BufferScheduler - */ - this.incoming = []; - /** - * The array (queue) includes all the buffers filled from stream data. - * - * @private - * @type {Buffer[]} - * @memberof BufferScheduler - */ - this.outgoing = []; - if (bufferSize <= 0) { - throw new RangeError("bufferSize must be larger than 0, current is " + bufferSize); - } - if (maxBuffers <= 0) { - throw new RangeError("maxBuffers must be larger than 0, current is " + maxBuffers); - } - if (concurrency <= 0) { - throw new RangeError("concurrency must be larger than 0, current is " + concurrency); - } - this.bufferSize = bufferSize; - this.maxBuffers = maxBuffers; - this.readable = readable; - this.outgoingHandler = outgoingHandler; - this.concurrency = concurrency; - this.encoding = encoding; + return tier; // No more check if string is a valid AccessTier, and left this to underlay logic to decide(service). +} +function ensureCpkIfSpecified(cpk, isHttps) { + if (cpk && !isHttps) { + throw new RangeError("Customer-provided encryption key must be used over HTTPS."); } - /** - * Start the scheduler, will return error when stream of any of the outgoingHandlers - * returns error. - * - * @returns {Promise} - * @memberof BufferScheduler - */ - BufferScheduler.prototype.do = function () { - return tslib.__awaiter(this, void 0, void 0, function () { - var _this = this; - return tslib.__generator(this, function (_a) { - return [2 /*return*/, new Promise(function (resolve, reject) { - _this.readable.on("data", function (data) { - data = typeof data === "string" ? Buffer.from(data, _this.encoding) : data; - _this.appendUnresolvedData(data); - if (!_this.resolveData()) { - _this.readable.pause(); - } - }); - _this.readable.on("error", function (err) { - _this.emitter.emit("error", err); - }); - _this.readable.on("end", function () { - _this.isStreamEnd = true; - _this.emitter.emit("checkEnd"); - }); - _this.emitter.on("error", function (err) { - _this.isError = true; - _this.readable.pause(); - reject(err); - }); - _this.emitter.on("checkEnd", function () { - if (_this.outgoing.length > 0) { - _this.triggerOutgoingHandlers(); - return; - } - if (_this.isStreamEnd && _this.executingOutgoingHandlers === 0) { - if (_this.unresolvedLength > 0 && _this.unresolvedLength < _this.bufferSize) { - _this.outgoingHandler(_this.shiftBufferFromUnresolvedDataArray(), _this.offset) - .then(resolve) - .catch(reject); - } - else if (_this.unresolvedLength >= _this.bufferSize) { - return; - } - else { - resolve(); - } - } - }); - })]; - }); - }); - }; - /** - * Insert a new data into unresolved array. - * - * @private - * @param {Buffer} data - * @memberof BufferScheduler - */ - BufferScheduler.prototype.appendUnresolvedData = function (data) { - this.unresolvedDataArray.push(data); - this.unresolvedLength += data.length; - }; - /** - * Try to shift a buffer with size in blockSize. The buffer returned may be less - * than blockSize when data in unresolvedDataArray is less than bufferSize. - * - * @private - * @returns {Buffer} - * @memberof BufferScheduler - */ - BufferScheduler.prototype.shiftBufferFromUnresolvedDataArray = function () { - if (this.unresolvedLength >= this.bufferSize) { - if (this.bufferSize === this.unresolvedDataArray[0].length) { - this.unresolvedLength -= this.bufferSize; - return this.unresolvedDataArray.shift(); - } - // Lazy concat because Buffer.concat highly drops performance - var merged = Buffer.concat(this.unresolvedDataArray, this.unresolvedLength); - var buffer = merged.slice(0, this.bufferSize); - merged = merged.slice(this.bufferSize); - this.unresolvedDataArray = [merged]; - this.unresolvedLength -= buffer.length; - return buffer; - } - else if (this.unresolvedLength > 0) { - var merged = Buffer.concat(this.unresolvedDataArray, this.unresolvedLength); - this.unresolvedDataArray = []; - this.unresolvedLength = 0; - return merged; - } - else { - return Buffer.allocUnsafe(0); - } - }; - /** - * Resolve data in unresolvedDataArray. For every buffer with size in blockSize - * shifted, it will try to get (or allocate a buffer) from incoming, and fill it, - * then push it into outgoing to be handled by outgoing handler. - * - * Return false when available buffers in incoming are not enough, else true. - * - * @private - * @returns {boolean} Return false when buffers in incoming are not enough, else true. - * @memberof BufferScheduler - */ - BufferScheduler.prototype.resolveData = function () { - while (this.unresolvedLength >= this.bufferSize) { - var buffer = void 0; - if (this.incoming.length > 0) { - buffer = this.incoming.shift(); - } - else { - if (this.numBuffers < this.maxBuffers) { - buffer = Buffer.allocUnsafe(this.bufferSize); - this.numBuffers++; - } - else { - // No available buffer, wait for buffer returned - return false; - } - } - buffer.fill(this.shiftBufferFromUnresolvedDataArray()); - this.outgoing.push(buffer); - this.triggerOutgoingHandlers(); - } - return true; - }; - /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. - * - * @private - * @memberof BufferScheduler - */ - BufferScheduler.prototype.triggerOutgoingHandlers = function () { - return tslib.__awaiter(this, void 0, void 0, function () { - var buffer; - return tslib.__generator(this, function (_a) { - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return [2 /*return*/]; - } - buffer = this.outgoing.shift(); - if (buffer) { - this.triggerOutgoingHandler(buffer); - } - } while (buffer); - return [2 /*return*/]; - }); - }); - }; - /** - * Trigger a outgoing handler for a buffer shifted from outgoing. - * - * @private - * @param {Buffer} buffer - * @returns {Promise} - * @memberof BufferScheduler - */ - BufferScheduler.prototype.triggerOutgoingHandler = function (buffer) { - return tslib.__awaiter(this, void 0, void 0, function () { - var bufferLength, err_1; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: - bufferLength = buffer.length; - this.executingOutgoingHandlers++; - this.offset += bufferLength; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.outgoingHandler(buffer, this.offset - bufferLength)]; - case 2: - _a.sent(); - return [3 /*break*/, 4]; - case 3: - err_1 = _a.sent(); - this.emitter.emit("error", err_1); - return [2 /*return*/]; - case 4: - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer); - this.emitter.emit("checkEnd"); - return [2 /*return*/]; - } - }); - }); - }; - /** - * Return buffer used by outgoing handler into incoming. - * - * @private - * @param {Buffer} buffer - * @memberof BufferScheduler - */ - BufferScheduler.prototype.reuseBuffer = function (buffer) { - this.incoming.push(buffer); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); - } - }; - return BufferScheduler; -}()); + if (cpk && !cpk.encryptionAlgorithm) { + cpk.encryptionAlgorithm = EncryptionAlgorithmAES25; + } +} /** * Function that converts PageRange and ClearRange to a common Range object. @@ -21449,6 +25027,906 @@ function makeBlobBeginCopyFromURLPollOperation(state) { } // Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +/** + * Generate a range string. For example: + * + * "bytes=255-" or "bytes=0-511" + * + * @export + * @param {Range} iRange + * @returns {string} + */ +function rangeToString(iRange) { + if (iRange.offset < 0) { + throw new RangeError("Range.offset cannot be smaller than 0."); + } + if (iRange.count && iRange.count <= 0) { + throw new RangeError("Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end."); + } + return iRange.count + ? "bytes=" + iRange.offset + "-" + (iRange.offset + iRange.count - 1) + : "bytes=" + iRange.offset + "-"; +} + +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * A StorageClient represents a based URL class for {@link BlobServiceClient}, {@link ContainerClient} + * and etc. + * + * @export + * @class StorageClient + */ +var StorageClient = /** @class */ (function () { + /** + * Creates an instance of StorageClient. + * @param {string} url url to resource + * @param {Pipeline} pipeline request policy pipeline. + * @memberof StorageClient + */ + function StorageClient(url, pipeline) { + // URL should be encoded and only once, protocol layer shouldn't encode URL again + this.url = escapeURLPath(url); + this.accountName = getAccountNameFromUrl(url); + this.pipeline = pipeline; + this.storageClientContext = new StorageClientContext(this.url, pipeline.toServiceClientOptions()); + this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); + this.credential = new AnonymousCredential(); + for (var _i = 0, _a = this.pipeline.factories; _i < _a.length; _i++) { + var factory = _a[_i]; + if ((coreHttp.isNode && factory instanceof StorageSharedKeyCredential) || + factory instanceof AnonymousCredential || + coreHttp.isTokenCredential(factory)) { + this.credential = factory; + } + } + // Override protocol layer's default content-type + var storageClientContext = this.storageClientContext; + storageClientContext.requestContentType = undefined; + } + return StorageClient; +}()); + +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * States for Batch. + * + * @enum {number} + */ +var BatchStates; +(function (BatchStates) { + BatchStates[BatchStates["Good"] = 0] = "Good"; + BatchStates[BatchStates["Error"] = 1] = "Error"; +})(BatchStates || (BatchStates = {})); +/** + * Batch provides basic parallel execution with concurrency limits. + * Will stop execute left operations when one of the executed operation throws an error. + * But Batch cannot cancel ongoing operations, you need to cancel them by yourself. + * + * @export + * @class Batch + */ +var Batch = /** @class */ (function () { + /** + * Creates an instance of Batch. + * @param {number} [concurrency=5] + * @memberof Batch + */ + function Batch(concurrency) { + if (concurrency === void 0) { concurrency = 5; } + /** + * Number of active operations under execution. + * + * @private + * @type {number} + * @memberof Batch + */ + this.actives = 0; + /** + * Number of completed operations under execution. + * + * @private + * @type {number} + * @memberof Batch + */ + this.completed = 0; + /** + * Offset of next operation to be executed. + * + * @private + * @type {number} + * @memberof Batch + */ + this.offset = 0; + /** + * Operation array to be executed. + * + * @private + * @type {Operation[]} + * @memberof Batch + */ + this.operations = []; + /** + * States of Batch. When an error happens, state will turn into error. + * Batch will stop execute left operations. + * + * @private + * @type {BatchStates} + * @memberof Batch + */ + this.state = BatchStates.Good; + if (concurrency < 1) { + throw new RangeError("concurrency must be larger than 0"); + } + this.concurrency = concurrency; + this.emitter = new events.EventEmitter(); + } + /** + * Add a operation into queue. + * + * @param {Operation} operation + * @memberof Batch + */ + Batch.prototype.addOperation = function (operation) { + var _this = this; + this.operations.push(function () { return tslib.__awaiter(_this, void 0, void 0, function () { + var error_1; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + this.actives++; + return [4 /*yield*/, operation()]; + case 1: + _a.sent(); + this.actives--; + this.completed++; + this.parallelExecute(); + return [3 /*break*/, 3]; + case 2: + error_1 = _a.sent(); + this.emitter.emit("error", error_1); + return [3 /*break*/, 3]; + case 3: return [2 /*return*/]; + } + }); + }); }); + }; + /** + * Start execute operations in the queue. + * + * @returns {Promise} + * @memberof Batch + */ + Batch.prototype.do = function () { + return tslib.__awaiter(this, void 0, void 0, function () { + var _this = this; + return tslib.__generator(this, function (_a) { + if (this.operations.length === 0) { + return [2 /*return*/, Promise.resolve()]; + } + this.parallelExecute(); + return [2 /*return*/, new Promise(function (resolve, reject) { + _this.emitter.on("finish", resolve); + _this.emitter.on("error", function (error) { + _this.state = BatchStates.Error; + reject(error); + }); + })]; + }); + }); + }; + /** + * Get next operation to be executed. Return null when reaching ends. + * + * @private + * @returns {(Operation | null)} + * @memberof Batch + */ + Batch.prototype.nextOperation = function () { + if (this.offset < this.operations.length) { + return this.operations[this.offset++]; + } + return null; + }; + /** + * Start execute operations. One one the most important difference between + * this method with do() is that do() wraps as an sync method. + * + * @private + * @returns {void} + * @memberof Batch + */ + Batch.prototype.parallelExecute = function () { + if (this.state === BatchStates.Error) { + return; + } + if (this.completed >= this.operations.length) { + this.emitter.emit("finish"); + return; + } + while (this.actives < this.concurrency) { + var operation = this.nextOperation(); + if (operation) { + operation(); + } + else { + return; + } + } + }; + return Batch; +}()); + +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * This class generates a readable stream from the data in an array of buffers. + * + * @export + * @class BuffersStream + */ +var BuffersStream = /** @class */ (function (_super) { + tslib.__extends(BuffersStream, _super); + /** + * Creates an instance of BuffersStream that will emit the data + * contained in the array of buffers. + * + * @param {Buffer[]} buffers Array of buffers containing the data + * @param {number} byteLength The total length of data contained in the buffers + * @memberof BuffersStream + */ + function BuffersStream(buffers, byteLength, options) { + var _this = _super.call(this, options) || this; + _this.buffers = buffers; + _this.byteLength = byteLength; + _this.byteOffsetInCurrentBuffer = 0; + _this.bufferIndex = 0; + _this.pushedBytesLength = 0; + // check byteLength is no larger than buffers[] total length + var buffersLength = 0; + for (var _i = 0, _a = _this.buffers; _i < _a.length; _i++) { + var buf = _a[_i]; + buffersLength += buf.byteLength; + } + if (buffersLength < _this.byteLength) { + throw new Error("Data size shouldn't be larger than the total length of buffers."); + } + return _this; + } + /** + * Internal _read() that will be called when the stream wants to pull more data in. + * + * @param {number} size Optional. The size of data to be read + * @memberof BuffersStream + */ + BuffersStream.prototype._read = function (size) { + if (this.pushedBytesLength >= this.byteLength) { + this.push(null); + } + if (!size) { + size = this.readableHighWaterMark; + } + var outBuffers = []; + var i = 0; + while (i < size && this.pushedBytesLength < this.byteLength) { + // The last buffer may be longer than the data it contains. + var remainingDataInAllBuffers = this.byteLength - this.pushedBytesLength; + var remainingCapacityInThisBuffer = this.buffers[this.bufferIndex].byteLength - this.byteOffsetInCurrentBuffer; + var remaining = Math.min(remainingCapacityInThisBuffer, remainingDataInAllBuffers); + if (remaining > size - i) { + // chunkSize = size - i + var end = this.byteOffsetInCurrentBuffer + size - i; + outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end)); + this.pushedBytesLength += size - i; + this.byteOffsetInCurrentBuffer = end; + i = size; + break; + } + else { + // chunkSize = remaining + var end = this.byteOffsetInCurrentBuffer + remaining; + outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end)); + if (remaining === remainingCapacityInThisBuffer) { + // this.buffers[this.bufferIndex] used up, shift to next one + this.byteOffsetInCurrentBuffer = 0; + this.bufferIndex++; + } + else { + this.byteOffsetInCurrentBuffer = end; + } + this.pushedBytesLength += remaining; + i += remaining; + } + } + if (outBuffers.length > 1) { + this.push(Buffer.concat(outBuffers)); + } + else if (outBuffers.length === 1) { + this.push(outBuffers[0]); + } + }; + return BuffersStream; +}(stream.Readable)); + +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * maxBufferLength is max size of each buffer in the pooled buffers. + */ +// Can't use import as Typescript doesn't recognize "buffer". +var maxBufferLength = __webpack_require__(293).constants.MAX_LENGTH; +/** + * This class provides a buffer container which conceptually has no hard size limit. + * It accepts a capacity, an array of input buffers and the total length of input data. + * It will allocate an internal "buffer" of the capacity and fill the data in the input buffers + * into the internal "buffer" serially with respect to the total length. + * Then by calling PooledBuffer.getReadableStream(), you can get a readable stream + * assembled from all the data in the internal "buffer". + * + * @export + * @class BufferScheduler + */ +var PooledBuffer = /** @class */ (function () { + function PooledBuffer(capacity, buffers, totalLength) { + /** + * Internal buffers used to keep the data. + * Each buffer has a length of the maxBufferLength except last one. + * + * @private + * @type {Buffer[]} + * @memberof PooledBuffer + */ + this.buffers = []; + this.capacity = capacity; + this._size = 0; + // allocate + var bufferNum = Math.ceil(capacity / maxBufferLength); + for (var i = 0; i < bufferNum; i++) { + var len = i === bufferNum - 1 ? capacity % maxBufferLength : maxBufferLength; + if (len === 0) { + len = maxBufferLength; + } + this.buffers.push(Buffer.allocUnsafe(len)); + } + if (buffers) { + this.fill(buffers, totalLength); + } + } + Object.defineProperty(PooledBuffer.prototype, "size", { + /** + * The size of the data contained in the pooled buffers. + */ + get: function () { + return this._size; + }, + enumerable: false, + configurable: true + }); + /** + * Fill the internal buffers with data in the input buffers serially + * with respect to the total length and the total capacity of the internal buffers. + * Data copied will be shift out of the input buffers. + * + * @param {Buffer[]} buffers Input buffers containing the data to be filled in the pooled buffer + * @param {number} totalLength Total length of the data to be filled in. + * + * @returns {void} + * @memberof PooledBuffer + */ + PooledBuffer.prototype.fill = function (buffers, totalLength) { + this._size = Math.min(this.capacity, totalLength); + var i = 0, j = 0, targetOffset = 0, sourceOffset = 0, totalCopiedNum = 0; + while (totalCopiedNum < this._size) { + var source = buffers[i]; + var target = this.buffers[j]; + var copiedNum = source.copy(target, targetOffset, sourceOffset); + totalCopiedNum += copiedNum; + sourceOffset += copiedNum; + targetOffset += copiedNum; + if (sourceOffset === source.length) { + i++; + sourceOffset = 0; + } + if (targetOffset === target.length) { + j++; + targetOffset = 0; + } + } + // clear copied from source buffers + buffers.splice(0, i); + if (buffers.length > 0) { + buffers[0] = buffers[0].slice(sourceOffset); + } + }; + /** + * Get the readable stream assembled from all the data in the internal buffers. + * + * @returns {Readable} + * @memberof PooledBuffer + */ + PooledBuffer.prototype.getReadableStream = function () { + return new BuffersStream(this.buffers, this.size); + }; + return PooledBuffer; +}()); + +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * This class accepts a Node.js Readable stream as input, and keeps reading data + * from the stream into the internal buffer structure, until it reaches maxBuffers. + * Every available buffer will try to trigger outgoingHandler. + * + * The internal buffer structure includes an incoming buffer array, and a outgoing + * buffer array. The incoming buffer array includes the "empty" buffers can be filled + * with new incoming data. The outgoing array includes the filled buffers to be + * handled by outgoingHandler. Every above buffer size is defined by parameter bufferSize. + * + * NUM_OF_ALL_BUFFERS = BUFFERS_IN_INCOMING + BUFFERS_IN_OUTGOING + BUFFERS_UNDER_HANDLING + * + * NUM_OF_ALL_BUFFERS <= maxBuffers + * + * PERFORMANCE IMPROVEMENT TIPS: + * 1. Input stream highWaterMark is better to set a same value with bufferSize + * parameter, which will avoid Buffer.concat() operations. + * 2. concurrency should set a smaller value than maxBuffers, which is helpful to + * reduce the possibility when a outgoing handler waits for the stream data. + * in this situation, outgoing handlers are blocked. + * Outgoing queue shouldn't be empty. + * @export + * @class BufferScheduler + */ +var BufferScheduler = /** @class */ (function () { + /** + * Creates an instance of BufferScheduler. + * + * @param {Readable} readable A Node.js Readable stream + * @param {number} bufferSize Buffer size of every maintained buffer + * @param {number} maxBuffers How many buffers can be allocated + * @param {OutgoingHandler} outgoingHandler An async function scheduled to be + * triggered when a buffer fully filled + * with stream data + * @param {number} concurrency Concurrency of executing outgoingHandlers (>0) + * @param {string} [encoding] [Optional] Encoding of Readable stream when it's a string stream + * @memberof BufferScheduler + */ + function BufferScheduler(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) { + /** + * An internal event emitter. + * + * @private + * @type {EventEmitter} + * @memberof BufferScheduler + */ + this.emitter = new events.EventEmitter(); + /** + * An internal offset marker to track data offset in bytes of next outgoingHandler. + * + * @private + * @type {number} + * @memberof BufferScheduler + */ + this.offset = 0; + /** + * An internal marker to track whether stream is end. + * + * @private + * @type {boolean} + * @memberof BufferScheduler + */ + this.isStreamEnd = false; + /** + * An internal marker to track whether stream or outgoingHandler returns error. + * + * @private + * @type {boolean} + * @memberof BufferScheduler + */ + this.isError = false; + /** + * How many handlers are executing. + * + * @private + * @type {number} + * @memberof BufferScheduler + */ + this.executingOutgoingHandlers = 0; + /** + * How many buffers have been allocated. + * + * @private + * @type {number} + * @memberof BufferScheduler + */ + this.numBuffers = 0; + /** + * Because this class doesn't know how much data every time stream pops, which + * is defined by highWaterMarker of the stream. So BufferScheduler will cache + * data received from the stream, when data in unresolvedDataArray exceeds the + * blockSize defined, it will try to concat a blockSize of buffer, fill into available + * buffers from incoming and push to outgoing array. + * + * @private + * @type {Buffer[]} + * @memberof BufferScheduler + */ + this.unresolvedDataArray = []; + /** + * How much data consisted in unresolvedDataArray. + * + * @private + * @type {number} + * @memberof BufferScheduler + */ + this.unresolvedLength = 0; + /** + * The array includes all the available buffers can be used to fill data from stream. + * + * @private + * @type {PooledBuffer[]} + * @memberof BufferScheduler + */ + this.incoming = []; + /** + * The array (queue) includes all the buffers filled from stream data. + * + * @private + * @type {PooledBuffer[]} + * @memberof BufferScheduler + */ + this.outgoing = []; + if (bufferSize <= 0) { + throw new RangeError("bufferSize must be larger than 0, current is " + bufferSize); + } + if (maxBuffers <= 0) { + throw new RangeError("maxBuffers must be larger than 0, current is " + maxBuffers); + } + if (concurrency <= 0) { + throw new RangeError("concurrency must be larger than 0, current is " + concurrency); + } + this.bufferSize = bufferSize; + this.maxBuffers = maxBuffers; + this.readable = readable; + this.outgoingHandler = outgoingHandler; + this.concurrency = concurrency; + this.encoding = encoding; + } + /** + * Start the scheduler, will return error when stream of any of the outgoingHandlers + * returns error. + * + * @returns {Promise} + * @memberof BufferScheduler + */ + BufferScheduler.prototype.do = function () { + return tslib.__awaiter(this, void 0, void 0, function () { + var _this = this; + return tslib.__generator(this, function (_a) { + return [2 /*return*/, new Promise(function (resolve, reject) { + _this.readable.on("data", function (data) { + data = typeof data === "string" ? Buffer.from(data, _this.encoding) : data; + _this.appendUnresolvedData(data); + if (!_this.resolveData()) { + _this.readable.pause(); + } + }); + _this.readable.on("error", function (err) { + _this.emitter.emit("error", err); + }); + _this.readable.on("end", function () { + _this.isStreamEnd = true; + _this.emitter.emit("checkEnd"); + }); + _this.emitter.on("error", function (err) { + _this.isError = true; + _this.readable.pause(); + reject(err); + }); + _this.emitter.on("checkEnd", function () { + if (_this.outgoing.length > 0) { + _this.triggerOutgoingHandlers(); + return; + } + if (_this.isStreamEnd && _this.executingOutgoingHandlers === 0) { + if (_this.unresolvedLength > 0 && _this.unresolvedLength < _this.bufferSize) { + var buffer_1 = _this.shiftBufferFromUnresolvedDataArray(); + _this.outgoingHandler(function () { return buffer_1.getReadableStream(); }, buffer_1.size, _this.offset) + .then(resolve) + .catch(reject); + } + else if (_this.unresolvedLength >= _this.bufferSize) { + return; + } + else { + resolve(); + } + } + }); + })]; + }); + }); + }; + /** + * Insert a new data into unresolved array. + * + * @private + * @param {Buffer} data + * @memberof BufferScheduler + */ + BufferScheduler.prototype.appendUnresolvedData = function (data) { + this.unresolvedDataArray.push(data); + this.unresolvedLength += data.length; + }; + /** + * Try to shift a buffer with size in blockSize. The buffer returned may be less + * than blockSize when data in unresolvedDataArray is less than bufferSize. + * + * @private + * @returns {PooledBuffer} + * @memberof BufferScheduler + */ + BufferScheduler.prototype.shiftBufferFromUnresolvedDataArray = function (buffer) { + if (!buffer) { + buffer = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); + } + else { + buffer.fill(this.unresolvedDataArray, this.unresolvedLength); + } + this.unresolvedLength -= buffer.size; + return buffer; + }; + /** + * Resolve data in unresolvedDataArray. For every buffer with size in blockSize + * shifted, it will try to get (or allocate a buffer) from incoming, and fill it, + * then push it into outgoing to be handled by outgoing handler. + * + * Return false when available buffers in incoming are not enough, else true. + * + * @private + * @returns {boolean} Return false when buffers in incoming are not enough, else true. + * @memberof BufferScheduler + */ + BufferScheduler.prototype.resolveData = function () { + while (this.unresolvedLength >= this.bufferSize) { + var buffer = void 0; + if (this.incoming.length > 0) { + buffer = this.incoming.shift(); + this.shiftBufferFromUnresolvedDataArray(buffer); + } + else { + if (this.numBuffers < this.maxBuffers) { + buffer = this.shiftBufferFromUnresolvedDataArray(); + this.numBuffers++; + } + else { + // No available buffer, wait for buffer returned + return false; + } + } + this.outgoing.push(buffer); + this.triggerOutgoingHandlers(); + } + return true; + }; + /** + * Try to trigger a outgoing handler for every buffer in outgoing. Stop when + * concurrency reaches. + * + * @private + * @memberof BufferScheduler + */ + BufferScheduler.prototype.triggerOutgoingHandlers = function () { + return tslib.__awaiter(this, void 0, void 0, function () { + var buffer; + return tslib.__generator(this, function (_a) { + do { + if (this.executingOutgoingHandlers >= this.concurrency) { + return [2 /*return*/]; + } + buffer = this.outgoing.shift(); + if (buffer) { + this.triggerOutgoingHandler(buffer); + } + } while (buffer); + return [2 /*return*/]; + }); + }); + }; + /** + * Trigger a outgoing handler for a buffer shifted from outgoing. + * + * @private + * @param {Buffer} buffer + * @returns {Promise} + * @memberof BufferScheduler + */ + BufferScheduler.prototype.triggerOutgoingHandler = function (buffer) { + return tslib.__awaiter(this, void 0, void 0, function () { + var bufferLength, err_1; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + bufferLength = buffer.size; + this.executingOutgoingHandlers++; + this.offset += bufferLength; + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4 /*yield*/, this.outgoingHandler(function () { return buffer.getReadableStream(); }, bufferLength, this.offset - bufferLength)]; + case 2: + _a.sent(); + return [3 /*break*/, 4]; + case 3: + err_1 = _a.sent(); + this.emitter.emit("error", err_1); + return [2 /*return*/]; + case 4: + this.executingOutgoingHandlers--; + this.reuseBuffer(buffer); + this.emitter.emit("checkEnd"); + return [2 /*return*/]; + } + }); + }); + }; + /** + * Return buffer used by outgoing handler into incoming. + * + * @private + * @param {Buffer} buffer + * @memberof BufferScheduler + */ + BufferScheduler.prototype.reuseBuffer = function (buffer) { + this.incoming.push(buffer); + if (!this.isError && this.resolveData() && !this.isStreamEnd) { + this.readable.resume(); + } + }; + return BufferScheduler; +}()); + +// Copyright (c) Microsoft Corporation. +/** + * Creates a span using the global tracer. + * @param name The name of the operation being performed. + * @param tracingOptions The options for the underlying http request. + */ +function createSpan(operationName, tracingOptions) { + if (tracingOptions === void 0) { tracingOptions = {}; } + var tracer = coreTracing.getTracer(); + var spanOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { kind: api.SpanKind.INTERNAL }); + var span = tracer.startSpan("Azure.Storage.Blob." + operationName, spanOptions); + span.setAttribute("az.namespace", "Microsoft.Storage"); + var newOptions = tracingOptions.spanOptions || {}; + if (span.isRecording()) { + newOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { parent: span.context(), attributes: tslib.__assign(tslib.__assign({}, spanOptions.attributes), { "az.namespace": "Microsoft.Storage" }) }); + } + return { + span: span, + spanOptions: newOptions + }; +} + +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * Reads a readable stream into buffer. Fill the buffer from offset to end. + * + * @export + * @param {NodeJS.ReadableStream} stream A Node.js Readable stream + * @param {Buffer} buffer Buffer to be filled, length must >= offset + * @param {number} offset From which position in the buffer to be filled, inclusive + * @param {number} end To which position in the buffer to be filled, exclusive + * @param {string} [encoding] Encoding of the Readable stream + * @returns {Promise} + */ +function streamToBuffer(stream, buffer, offset, end, encoding) { + return tslib.__awaiter(this, void 0, void 0, function () { + var pos, count; + return tslib.__generator(this, function (_a) { + pos = 0; + count = end - offset; + return [2 /*return*/, new Promise(function (resolve, reject) { + stream.on("readable", function () { + if (pos >= count) { + resolve(); + return; + } + var chunk = stream.read(); + if (!chunk) { + return; + } + if (typeof chunk === "string") { + chunk = Buffer.from(chunk, encoding); + } + // How much data needed in this chunk + var chunkLength = pos + chunk.length > count ? count - pos : chunk.length; + buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); + pos += chunkLength; + }); + stream.on("end", function () { + if (pos < count) { + reject(new Error("Stream drains before getting enough data needed. Data read: " + pos + ", data need: " + count)); + } + resolve(); + }); + stream.on("error", reject); + })]; + }); + }); +} +/** + * Reads a readable stream into buffer entirely. + * + * @export + * @param {NodeJS.ReadableStream} stream A Node.js Readable stream + * @param {Buffer} buffer Buffer to be filled, length must >= offset + * @param {string} [encoding] Encoding of the Readable stream + * @returns {Promise} with the count of bytes read. + * @throws {RangeError} If buffer size is not big enough. + */ +function streamToBuffer2(stream, buffer, encoding) { + return tslib.__awaiter(this, void 0, void 0, function () { + var pos, bufferSize; + return tslib.__generator(this, function (_a) { + pos = 0; + bufferSize = buffer.length; + return [2 /*return*/, new Promise(function (resolve, reject) { + stream.on("readable", function () { + var chunk = stream.read(); + if (!chunk) { + return; + } + if (typeof chunk === "string") { + chunk = Buffer.from(chunk, encoding); + } + if (pos + chunk.length > bufferSize) { + reject(new Error("Stream exceeds buffer size. Buffer size: " + bufferSize)); + return; + } + buffer.fill(chunk, pos, pos + chunk.length); + pos += chunk.length; + }); + stream.on("end", function () { + resolve(pos); + }); + stream.on("error", reject); + })]; + }); + }); +} +/** + * ONLY AVAILABLE IN NODE.JS RUNTIME. + * + * Writes the content of a readstream to a local file. Returns a Promise which is completed after the file handle is closed. + * + * @export + * @param {NodeJS.ReadableStream} rs The read stream. + * @param {string} file Destination file path. + * @returns {Promise} + */ +function readStreamToLocalFile(rs, file) { + return tslib.__awaiter(this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + return [2 /*return*/, new Promise(function (resolve, reject) { + var ws = fs.createWriteStream(file); + rs.on("error", function (err) { + reject(err); + }); + ws.on("error", function (err) { + reject(err); + }); + ws.on("close", resolve); + rs.pipe(ws); + })]; + }); + }); +} +/** + * ONLY AVAILABLE IN NODE.JS RUNTIME. + * + * Promisified version of fs.stat(). + */ +var fsStat = util.promisify(fs.stat); +var fsCreateReadStream = fs.createReadStream; + /** * A BlobClient represents a URL to an Azure Storage blob; the blob may be a block blob, * append blob, or page blob. @@ -21526,7 +26004,7 @@ var BlobClient = /** @class */ (function (_super) { get: function () { return this._name; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobClient.prototype, "containerName", { @@ -21536,7 +26014,7 @@ var BlobClient = /** @class */ (function (_super) { get: function () { return this._containerName; }, - enumerable: true, + enumerable: false, configurable: true }); /** @@ -21550,6 +26028,17 @@ var BlobClient = /** @class */ (function (_super) { BlobClient.prototype.withSnapshot = function (snapshot) { return new BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline); }; + /** + * Creates a new BlobClient object pointing to a version of this blob. + * Provide "" will remove the versionId and return a Client to the base blob. + * + * @param {string} versionId The versionId. + * @returns {BlobClient} A new BlobClient object pointing to the version of this blob. + * @memberof BlobClient + */ + BlobClient.prototype.withVersion = function (versionId) { + return new BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId.length === 0 ? undefined : versionId), this.pipeline); + }; /** * Creates a AppendBlobClient object. * @@ -21589,7 +26078,7 @@ var BlobClient = /** @class */ (function (_super) { * @param {number} [offset] From which position of the blob to download, >= 0 * @param {number} [count] How much data to be downloaded, > 0. Will download to the end when undefined * @param {BlobDownloadOptions} [options] Optional options to Blob Download operation. - * @returns {Promise} + * @returns {Promise} * @memberof BlobClient * * Example usage (Node.js): @@ -21597,20 +26086,20 @@ var BlobClient = /** @class */ (function (_super) { * ```js * // Download and convert a blob to a string * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await streamToString(downloadBlockBlobResponse.readableStreamBody); - * console.log("Downloaded blob content:", downloaded); + * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody); + * console.log("Downloaded blob content:", downloaded.toString()); * - * async function streamToString(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data.toString()); - * }); - * readableStream.on("end", () => { - * resolve(chunks.join("")); - * }); - * readableStream.on("error", reject); - * }); + * async function streamToBuffer(readableStream) { + * return new Promise((resolve, reject) => { + * const chunks = []; + * readableStream.on("data", (data) => { + * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); + * }); + * readableStream.on("end", () => { + * resolve(Buffer.concat(chunks)); + * }); + * readableStream.on("error", reject); + * }); * } * ``` * @@ -21638,25 +26127,26 @@ var BlobClient = /** @class */ (function (_super) { * ``` */ BlobClient.prototype.download = function (offset, count, options) { + var _a; if (offset === void 0) { offset = 0; } if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, res_1, e_1; + var _b, span, spanOptions, res_1, wrappedRes, e_1; var _this = this; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; options.conditions = options.conditions || {}; ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - _a = createSpan("BlobClient-download", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("BlobClient-download", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.blobContext.download({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), onDownloadProgress: coreHttp.isNode ? undefined : options.onProgress, range: offset === 0 && !count ? undefined : rangeToString({ offset: offset, count: count }), rangeGetContentMD5: options.rangeGetContentMD5, @@ -21666,7 +26156,8 @@ var BlobClient = /** @class */ (function (_super) { spanOptions: spanOptions })]; case 2: - res_1 = _b.sent(); + res_1 = _c.sent(); + wrappedRes = tslib.__assign(tslib.__assign({}, res_1), { _response: res_1._response, objectReplicationDestinationPolicyId: res_1.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res_1.objectReplicationRules) }); // We support retrying when download stream unexpected ends in Node.js runtime // Following code shouldn't be bundled into browser build, however some // bundlers may try to bundle following code and "FileReadResponse.ts". @@ -21682,10 +26173,11 @@ var BlobClient = /** @class */ (function (_super) { if (!res_1.etag) { throw new RangeError("File download response doesn't contain valid etag header"); } - return [2 /*return*/, new BlobDownloadResponse(res_1, function (start) { return tslib.__awaiter(_this, void 0, void 0, function () { + return [2 /*return*/, new BlobDownloadResponse(wrappedRes, function (start) { return tslib.__awaiter(_this, void 0, void 0, function () { var updatedOptions; - return tslib.__generator(this, function (_a) { - switch (_a.label) { + var _a; + return tslib.__generator(this, function (_b) { + switch (_b.label) { case 0: updatedOptions = { leaseAccessConditions: options.conditions, @@ -21693,7 +26185,8 @@ var BlobClient = /** @class */ (function (_super) { ifMatch: options.conditions.ifMatch || res_1.etag, ifModifiedSince: options.conditions.ifModifiedSince, ifNoneMatch: options.conditions.ifNoneMatch, - ifUnmodifiedSince: options.conditions.ifUnmodifiedSince + ifUnmodifiedSince: options.conditions.ifUnmodifiedSince, + ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }, range: rangeToString({ count: offset + res_1.contentLength - start, @@ -21712,7 +26205,7 @@ var BlobClient = /** @class */ (function (_super) { // updatedOptions.range // }, options: ${JSON.stringify(updatedOptions)}` // ); - return [2 /*return*/, (_a.sent()).readableStreamBody]; + return [2 /*return*/, (_b.sent()).readableStreamBody]; } }); }); }, offset, res_1.contentLength, { @@ -21721,7 +26214,7 @@ var BlobClient = /** @class */ (function (_super) { onProgress: options.onProgress })]; case 3: - e_1 = _b.sent(); + e_1 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, message: e_1.message @@ -21736,7 +26229,7 @@ var BlobClient = /** @class */ (function (_super) { }); }; /** - * Returns true if the Azrue blob resource represented by this client exists; false otherwise. + * Returns true if the Azure blob resource represented by this client exists; false otherwise. * * NOTE: use this function with care since an existing blob might be deleted by other clients or * applications. Vice versa new blobs might be added by other clients or applications after this @@ -21761,6 +26254,7 @@ var BlobClient = /** @class */ (function (_super) { return [4 /*yield*/, this.getProperties({ abortSignal: options.abortSignal, customerProvidedKey: options.customerProvidedKey, + conditions: options.conditions, tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) })]; case 2: @@ -21803,28 +26297,31 @@ var BlobClient = /** @class */ (function (_super) { * @memberof BlobClient */ BlobClient.prototype.getProperties = function (options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_3; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, res, e_3; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlobClient-getProperties", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("BlobClient-getProperties", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); options.conditions = options.conditions || {}; ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.blobContext.getProperties({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: + res = _c.sent(); + return [2 /*return*/, tslib.__assign(tslib.__assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) })]; case 3: - e_3 = _b.sent(); + e_3 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, message: e_3.message @@ -21850,27 +26347,28 @@ var BlobClient = /** @class */ (function (_super) { * @memberof BlobClient */ BlobClient.prototype.delete = function (options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_4; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_4; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlobClient-delete", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("BlobClient-delete", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.blobContext.deleteMethod({ abortSignal: options.abortSignal, deleteSnapshots: options.deleteSnapshots, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_4 = _b.sent(); + e_4 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, message: e_4.message @@ -21884,6 +26382,56 @@ var BlobClient = /** @class */ (function (_super) { }); }); }; + /** + * Marks the specified blob or snapshot for deletion if it exists. The blob is later deleted + * during garbage collection. Note that in order to delete a blob, you must delete + * all of its snapshots. You can delete both at the same time with the Delete + * Blob operation. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * + * @param {BlobDeleteOptions} [options] Optional options to Blob Delete operation. + * @returns {Promise} + * @memberof BlobClient + */ + BlobClient.prototype.deleteIfExists = function (options) { + var _a, _b; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _c, span, spanOptions, res, e_5; + return tslib.__generator(this, function (_d) { + switch (_d.label) { + case 0: + _c = createSpan("BlobClient-deleteIfExists", options.tracingOptions), span = _c.span, spanOptions = _c.spanOptions; + _d.label = 1; + case 1: + _d.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this.delete(tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; + case 2: + res = _d.sent(); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable + })]; + case 3: + e_5 = _d.sent(); + if (((_a = e_5.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { + span.setStatus({ + code: api.CanonicalCode.NOT_FOUND, + message: "Expected exception when deleting a blob or snapshot only if it exists." + }); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_5.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_5.response })]; + } + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_5.message + }); + throw e_5; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; /** * Restores the contents and metadata of soft deleted blob and any associated * soft deleted snapshots. Undelete Blob is supported only on version 2017-07-29 @@ -21897,7 +26445,7 @@ var BlobClient = /** @class */ (function (_super) { BlobClient.prototype.undelete = function (options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_5; + var _a, span, spanOptions, e_6; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -21911,12 +26459,12 @@ var BlobClient = /** @class */ (function (_super) { })]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_5 = _b.sent(); + e_6 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_5.message + message: e_6.message }); - throw e_5; + throw e_6; case 4: span.end(); return [7 /*endfinally*/]; @@ -21928,46 +26476,47 @@ var BlobClient = /** @class */ (function (_super) { /** * Sets system properties on the blob. * - * If no value provided, or no value provided for the specificed blob HTTP headers, + * If no value provided, or no value provided for the specified blob HTTP headers, * these blob HTTP headers without a value will be cleared. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties * * @param {BlobHTTPHeaders} [blobHTTPHeaders] If no value provided, or no value provided for - * the specificed blob HTTP headers, these blob HTTP + * the specified blob HTTP headers, these blob HTTP * headers without a value will be cleared. * @param {BlobSetHTTPHeadersOptions} [options] Optional options to Blob Set HTTP Headers operation. * @returns {Promise} * @memberof BlobClient */ BlobClient.prototype.setHTTPHeaders = function (blobHTTPHeaders, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_6; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_7; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlobClient-setHTTPHeaders", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("BlobClient-setHTTPHeaders", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.blobContext.setHTTPHeaders({ abortSignal: options.abortSignal, blobHTTPHeaders: blobHTTPHeaders, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_6 = _b.sent(); + e_7 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_6.message + message: e_7.message }); - throw e_6; + throw e_7; case 4: span.end(); return [7 /*endfinally*/]; @@ -21990,35 +26539,124 @@ var BlobClient = /** @class */ (function (_super) { * @memberof BlobClient */ BlobClient.prototype.setMetadata = function (metadata, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_7; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_8; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlobClient-setMetadata", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("BlobClient-setMetadata", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.blobContext.setMetadata({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: metadata, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_7 = _b.sent(); + e_8 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_7.message + message: e_8.message }); - throw e_7; + throw e_8; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + /** + * Sets tags on the underlying blob. + * A blob can have up to 10 tags. Tag keys must be between 1 and 128 characters. Tag values must be between 0 and 256 characters. + * Valid tag key and value characters include lower and upper case letters, digits (0-9), + * space (' '), plus ('+'), minus ('-'), period ('.'), foward slash ('/'), colon (':'), equals ('='), and underscore ('_'). + * + * @param {Tags} tags + * @param {BlobSetTagsOptions} [options={}] + * @returns {Promise} + * @memberof BlobClient + */ + BlobClient.prototype.setTags = function (tags, options) { + var _a; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _b, span, spanOptions, e_9; + return tslib.__generator(this, function (_c) { + switch (_c.label) { + case 0: + _b = createSpan("BlobClient-setTags", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; + case 1: + _c.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this.blobContext.setTags({ + abortSignal: options.abortSignal, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + spanOptions: spanOptions, + tags: toBlobTags(tags) + })]; + case 2: return [2 /*return*/, _c.sent()]; + case 3: + e_9 = _c.sent(); + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_9.message + }); + throw e_9; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + /** + * Gets the tags associated with the underlying blob. + * + * @param {BlobGetTagsOptions} [options={}] + * @returns {Promise} + * @memberof BlobClient + */ + BlobClient.prototype.getTags = function (options) { + var _a; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _b, span, spanOptions, response, wrappedResponse, e_10; + return tslib.__generator(this, function (_c) { + switch (_c.label) { + case 0: + _b = createSpan("BlobClient-getTags", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; + case 1: + _c.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this.blobContext.getTags({ + abortSignal: options.abortSignal, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + spanOptions: spanOptions + })]; + case 2: + response = _c.sent(); + wrappedResponse = tslib.__assign(tslib.__assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); + return [2 /*return*/, wrappedResponse]; + case 3: + e_10 = _c.sent(); + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_10.message + }); + throw e_10; case 4: span.end(); return [7 /*endfinally*/]; @@ -22046,35 +26684,36 @@ var BlobClient = /** @class */ (function (_super) { * @memberof BlobClient */ BlobClient.prototype.createSnapshot = function (options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_8; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_11; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlobClient-createSnapshot", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("BlobClient-createSnapshot", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.blobContext.createSnapshot({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_8 = _b.sent(); + e_11 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_8.message + message: e_11.message }); - throw e_8; + throw e_11; case 4: span.end(); return [7 /*endfinally*/]; @@ -22219,7 +26858,7 @@ var BlobClient = /** @class */ (function (_super) { BlobClient.prototype.abortCopyFromURL = function (copyId, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_9; + var _a, span, spanOptions, e_12; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -22234,12 +26873,12 @@ var BlobClient = /** @class */ (function (_super) { })]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_9 = _b.sent(); + e_12 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_9.message + message: e_12.message }); - throw e_9; + throw e_12; case 4: span.end(); return [7 /*endfinally*/]; @@ -22259,23 +26898,24 @@ var BlobClient = /** @class */ (function (_super) { * @memberof BlobClient */ BlobClient.prototype.syncCopyFromURL = function (copySource, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_10; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_13; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlobClient-syncCopyFromURL", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("BlobClient-syncCopyFromURL", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.blobContext.copyFromURL(copySource, { abortSignal: options.abortSignal, metadata: options.metadata, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, @@ -22283,16 +26923,17 @@ var BlobClient = /** @class */ (function (_super) { sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince }, sourceContentMD5: options.sourceContentMD5, + blobTagsString: toBlobTagsString(options.tags), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_10 = _b.sent(); + e_13 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_10.message + message: e_13.message }); - throw e_10; + throw e_13; case 4: span.end(); return [7 /*endfinally*/]; @@ -22315,30 +26956,32 @@ var BlobClient = /** @class */ (function (_super) { * @memberof BlobClient */ BlobClient.prototype.setAccessTier = function (tier, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_11; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_14; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlobClient-setAccessTier", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("BlobClient-setAccessTier", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.blobContext.setTier(toAccessTier(tier), { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), rehydratePriority: options.rehydratePriority, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_11 = _b.sent(); + e_14 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_11.message + message: e_14.message }); - throw e_11; + throw e_14; case 4: span.end(); return [7 /*endfinally*/]; @@ -22350,7 +26993,7 @@ var BlobClient = /** @class */ (function (_super) { BlobClient.prototype.downloadToBuffer = function (param1, param2, param3, param4) { if (param4 === void 0) { param4 = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var buffer, offset, count, options, _a, span, spanOptions, response, transferProgress_1, batch, _loop_1, off, e_12; + var buffer, offset, count, options, _a, span, spanOptions, response, transferProgress_1, batch, _loop_1, off, e_15; var _this = this; return tslib.__generator(this, function (_b) { switch (_b.label) { @@ -22428,6 +27071,7 @@ var BlobClient = /** @class */ (function (_super) { abortSignal: options.abortSignal, conditions: options.conditions, maxRetryRequests: options.maxRetryRequestsPerBlock, + customerProvidedKey: options.customerProvidedKey, tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) })]; case 1: @@ -22456,12 +27100,12 @@ var BlobClient = /** @class */ (function (_super) { _b.sent(); return [2 /*return*/, buffer]; case 5: - e_12 = _b.sent(); + e_15 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_12.message + message: e_15.message }); - throw e_12; + throw e_15; case 6: span.end(); return [7 /*endfinally*/]; @@ -22481,7 +27125,7 @@ var BlobClient = /** @class */ (function (_super) { * @param {number} [offset] From which position of the block blob to download. * @param {number} [count] How much data to be downloaded. Will download to the end when passing undefined. * @param {BlobDownloadOptions} [options] Options to Blob download options. - * @returns {Promise} The response data for blob download operation, + * @returns {Promise} The response data for blob download operation, * but with readableStreamBody set to undefined since its * content is already read and written into a local file * at the specified path. @@ -22491,7 +27135,7 @@ var BlobClient = /** @class */ (function (_super) { if (offset === void 0) { offset = 0; } if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, response, e_13; + var _a, span, spanOptions, response, e_16; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -22512,12 +27156,12 @@ var BlobClient = /** @class */ (function (_super) { response.blobDownloadStream = undefined; return [2 /*return*/, response]; case 5: - e_13 = _b.sent(); + e_16 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_13.message + message: e_16.message }); - throw e_13; + throw e_16; case 6: span.end(); return [7 /*endfinally*/]; @@ -22545,7 +27189,7 @@ var BlobClient = /** @class */ (function (_super) { containerName = pathComponents[1]; blobName = pathComponents[3]; } - else { + else if (isIpEndpointStyle(parsedUrl)) { // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/containername/blob // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/containername/blob // .getPath() -> /devstoreaccount1/containername/blob @@ -22553,6 +27197,13 @@ var BlobClient = /** @class */ (function (_super) { containerName = pathComponents[2]; blobName = pathComponents[4]; } + else { + // "https://customdomain.com/containername/blob". + // .getPath() -> /containername/blob + var pathComponents = parsedUrl.getPath().match("/([^/]*)(/(.*))?"); + containerName = pathComponents[1]; + blobName = pathComponents[3]; + } // decode the encoded blobName, containerName - to get all the special characters that might be present in them containerName = decodeURIComponent(containerName); blobName = decodeURIComponent(blobName); @@ -22587,41 +27238,45 @@ var BlobClient = /** @class */ (function (_super) { * @memberof BlobClient */ BlobClient.prototype.startCopyFromURL = function (copySource, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_14; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_17; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlobClient-startCopyFromURL", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("BlobClient-startCopyFromURL", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.blobContext.startCopyFromURL(copySource, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince + sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, + sourceIfTags: options.sourceConditions.tagConditions }, rehydratePriority: options.rehydratePriority, tier: toAccessTier(options.tier), + blobTagsString: toBlobTagsString(options.tags), + sealBlob: options.sealBlob, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_14 = _b.sent(); + e_17 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_14.message + message: e_17.message }); - throw e_14; + throw e_17; case 4: span.end(); return [7 /*endfinally*/]; @@ -22730,36 +27385,130 @@ var AppendBlobClient = /** @class */ (function (_super) { * ``` */ AppendBlobClient.prototype.create = function (options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_15; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_18; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("AppendBlobClient-create", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("AppendBlobClient-create", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.appendBlobContext.create(0, { abortSignal: options.abortSignal, blobHTTPHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, + blobTagsString: toBlobTagsString(options.tags), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_15 = _b.sent(); + e_18 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_15.message + message: e_18.message }); - throw e_15; + throw e_18; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + /** + * Creates a 0-length append blob. Call AppendBlock to append data to an append blob. + * If the blob with the same name already exists, the content of the existing blob will remain unchanged. + * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * + * @param {AppendBlobCreateIfNotExistsOptions} [options] + * @returns {Promise} + * @memberof AppendBlobClient + */ + AppendBlobClient.prototype.createIfNotExists = function (options) { + var _a, _b; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _c, span, spanOptions, conditions, res, e_19; + return tslib.__generator(this, function (_d) { + switch (_d.label) { + case 0: + _c = createSpan("AppendBlobClient-createIfNotExists", options.tracingOptions), span = _c.span, spanOptions = _c.spanOptions; + conditions = { ifNoneMatch: ETagAny }; + _d.label = 1; + case 1: + _d.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this.create(tslib.__assign(tslib.__assign({}, options), { conditions: conditions, tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; + case 2: + res = _d.sent(); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable + })]; + case 3: + e_19 = _d.sent(); + if (((_a = e_19.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { + span.setStatus({ + code: api.CanonicalCode.ALREADY_EXISTS, + message: "Expected exception when creating a blob only if it does not already exist." + }); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_19.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_19.response })]; + } + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_19.message + }); + throw e_19; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + /** + * Seals the append blob, making it read only. + * + * @param {AppendBlobSealOptions} [options={}] + * @returns {Promise} + * @memberof AppendBlobClient + */ + AppendBlobClient.prototype.seal = function (options) { + var _a; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _b, span, spanOptions, e_20; + return tslib.__generator(this, function (_c) { + switch (_c.label) { + case 0: + _b = createSpan("AppendBlobClient-seal", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + options.conditions = options.conditions || {}; + _c.label = 1; + case 1: + _c.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this.appendBlobContext.seal({ + abortSignal: options.abortSignal, + appendPositionAccessConditions: options.conditions, + leaseAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + spanOptions: spanOptions + })]; + case 2: return [2 /*return*/, _c.sent()]; + case 3: + e_20 = _c.sent(); + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_20.message + }); + throw e_20; case 4: span.end(); return [7 /*endfinally*/]; @@ -22794,23 +27543,24 @@ var AppendBlobClient = /** @class */ (function (_super) { * ``` */ AppendBlobClient.prototype.appendBlock = function (body, contentLength, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_16; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_21; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("AppendBlobClient-appendBlock", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("AppendBlobClient-appendBlock", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.appendBlobContext.appendBlock(body, contentLength, { abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), onUploadProgress: options.onProgress, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, @@ -22818,14 +27568,14 @@ var AppendBlobClient = /** @class */ (function (_super) { encryptionScope: options.encryptionScope, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_16 = _b.sent(); + e_21 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_16.message + message: e_21.message }); - throw e_16; + throw e_21; case 4: span.end(); return [7 /*endfinally*/]; @@ -22851,18 +27601,19 @@ var AppendBlobClient = /** @class */ (function (_super) { * @memberof AppendBlobClient */ AppendBlobClient.prototype.appendBlockFromURL = function (sourceURL, sourceOffset, count, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_17; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_22; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("AppendBlobClient-appendBlockFromURL", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("AppendBlobClient-appendBlockFromURL", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { abortSignal: options.abortSignal, @@ -22871,7 +27622,7 @@ var AppendBlobClient = /** @class */ (function (_super) { sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, appendPositionAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, @@ -22882,14 +27633,14 @@ var AppendBlobClient = /** @class */ (function (_super) { encryptionScope: options.encryptionScope, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_17 = _b.sent(); + e_22 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_17.message + message: e_22.message }); - throw e_17; + throw e_22; case 4: span.end(); return [7 /*endfinally*/]; @@ -22968,6 +27719,7 @@ var BlockBlobClient = /** @class */ (function (_super) { } _this = _super.call(this, url, pipeline) || this; _this.blockBlobContext = new BlockBlob(_this.storageClientContext); + _this._blobContext = new Blob$1(_this.storageClientContext); return _this; } /** @@ -22982,6 +27734,84 @@ var BlockBlobClient = /** @class */ (function (_super) { BlockBlobClient.prototype.withSnapshot = function (snapshot) { return new BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline); }; + /** + * ONLY AVAILABLE IN NODE.JS RUNTIME. + * + * Quick query for a JSON or CSV formatted blob. + * + * Example usage (Node.js): + * + * ```js + * // Query and convert a blob to a string + * const queryBlockBlobResponse = await blockBlobClient.query("select * from BlobStorage"); + * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString(); + * console.log("Query blob content:", downloaded); + * + * async function streamToBuffer(readableStream) { + * return new Promise((resolve, reject) => { + * const chunks = []; + * readableStream.on("data", (data) => { + * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); + * }); + * readableStream.on("end", () => { + * resolve(Buffer.concat(chunks)); + * }); + * readableStream.on("error", reject); + * }); + * } + * ``` + * + * @param {string} query + * @param {BlockBlobQueryOptions} [options={}] + * @returns {Promise} + * @memberof BlockBlobClient + */ + BlockBlobClient.prototype.query = function (query, options) { + var _a; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _b, span, spanOptions, response, e_23; + return tslib.__generator(this, function (_c) { + switch (_c.label) { + case 0: + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + _b = createSpan("BlockBlobClient-query", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; + case 1: + _c.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this._blobContext.query({ + abortSignal: options.abortSignal, + queryRequest: { + expression: query, + inputSerialization: toQuerySerialization(options.inputTextConfiguration), + outputSerialization: toQuerySerialization(options.outputTextConfiguration) + }, + leaseAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + spanOptions: spanOptions + })]; + case 2: + response = _c.sent(); + return [2 /*return*/, new BlobQueryResponse(response, { + abortSignal: options.abortSignal, + onProgress: options.onProgress, + onError: options.onError + })]; + case 3: + e_23 = _c.sent(); + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_23.message + }); + throw e_23; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; /** * Creates a new block blob, or updates the content of an existing block blob. * Updating an existing block blob overwrites any existing metadata on the blob. @@ -23011,38 +27841,40 @@ var BlockBlobClient = /** @class */ (function (_super) { * ``` */ BlockBlobClient.prototype.upload = function (body, contentLength, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_18; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_24; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("BlockBlobClient-upload", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("BlockBlobClient-upload", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.blockBlobContext.upload(body, contentLength, { abortSignal: options.abortSignal, blobHTTPHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), onUploadProgress: options.onProgress, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), + blobTagsString: toBlobTagsString(options.tags), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_18 = _b.sent(); + e_24 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_18.message + message: e_24.message }); - throw e_18; + throw e_24; case 4: span.end(); return [7 /*endfinally*/]; @@ -23066,7 +27898,7 @@ var BlockBlobClient = /** @class */ (function (_super) { BlockBlobClient.prototype.stageBlock = function (blockId, body, contentLength, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_19; + var _a, span, spanOptions, e_25; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -23087,12 +27919,12 @@ var BlockBlobClient = /** @class */ (function (_super) { })]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_19 = _b.sent(); + e_25 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_19.message + message: e_25.message }); - throw e_19; + throw e_25; case 4: span.end(); return [7 /*endfinally*/]; @@ -23127,7 +27959,7 @@ var BlockBlobClient = /** @class */ (function (_super) { if (offset === void 0) { offset = 0; } if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_20; + var _a, span, spanOptions, e_26; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -23148,12 +27980,12 @@ var BlockBlobClient = /** @class */ (function (_super) { })]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_20 = _b.sent(); + e_26 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_20.message + message: e_26.message }); - throw e_20; + throw e_26; case 4: span.end(); return [7 /*endfinally*/]; @@ -23176,37 +28008,39 @@ var BlockBlobClient = /** @class */ (function (_super) { * @memberof BlockBlobClient */ BlockBlobClient.prototype.commitBlockList = function (blocks, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_21; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_27; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("BlockBlobClient-commitBlockList", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("BlockBlobClient-commitBlockList", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.blockBlobContext.commitBlockList({ latest: blocks }, { abortSignal: options.abortSignal, blobHTTPHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), + blobTagsString: toBlobTagsString(options.tags), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_21 = _b.sent(); + e_27 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_21.message + message: e_27.message }); - throw e_21; + throw e_27; case 4: span.end(); return [7 /*endfinally*/]; @@ -23227,23 +28061,25 @@ var BlockBlobClient = /** @class */ (function (_super) { * @memberof BlockBlobClient */ BlockBlobClient.prototype.getBlockList = function (listType, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, res, e_22; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, res, e_28; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlockBlobClient-getBlockList", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("BlockBlobClient-getBlockList", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.blockBlobContext.getBlockList(listType, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), spanOptions: spanOptions })]; case 2: - res = _b.sent(); + res = _c.sent(); if (!res.committedBlocks) { res.committedBlocks = []; } @@ -23252,12 +28088,12 @@ var BlockBlobClient = /** @class */ (function (_super) { } return [2 /*return*/, res]; case 3: - e_22 = _b.sent(); + e_28 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_22.message + message: e_28.message }); - throw e_22; + throw e_28; case 4: span.end(); return [7 /*endfinally*/]; @@ -23285,7 +28121,7 @@ var BlockBlobClient = /** @class */ (function (_super) { BlockBlobClient.prototype.uploadBrowserData = function (browserData, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, browserBlob_1, e_23; + var _a, span, spanOptions, browserBlob_1, e_29; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -23299,12 +28135,12 @@ var BlockBlobClient = /** @class */ (function (_super) { }, browserBlob_1.size, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_23 = _b.sent(); + e_29 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_23.message + message: e_29.message }); - throw e_23; + throw e_29; case 4: span.end(); return [7 /*endfinally*/]; @@ -23332,7 +28168,7 @@ var BlockBlobClient = /** @class */ (function (_super) { BlockBlobClient.prototype.uploadSeekableBlob = function (blobFactory, size, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, numBlocks_1, blockList_1, blockIDPrefix_1, transferProgress_2, batch, _loop_2, i, e_24; + var _a, span, spanOptions, numBlocks_1, blockList_1, blockIDPrefix_1, transferProgress_2, batch, _loop_2, i, e_30; var _this = this; return tslib.__generator(this, function (_b) { switch (_b.label) { @@ -23424,12 +28260,12 @@ var BlockBlobClient = /** @class */ (function (_super) { _b.sent(); return [2 /*return*/, this.commitBlockList(blockList_1, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; case 5: - e_24 = _b.sent(); + e_30 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_24.message + message: e_30.message }); - throw e_24; + throw e_30; case 6: span.end(); return [7 /*endfinally*/]; @@ -23455,7 +28291,7 @@ var BlockBlobClient = /** @class */ (function (_super) { BlockBlobClient.prototype.uploadFile = function (filePath, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, size, e_25; + var _a, span, spanOptions, size, e_31; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -23467,7 +28303,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 2: size = (_b.sent()).size; return [4 /*yield*/, this.uploadResetableStream(function (offset, count) { - return fs.createReadStream(filePath, { + return fsCreateReadStream(filePath, { autoClose: true, end: count ? offset + count - 1 : Infinity, start: offset @@ -23475,12 +28311,12 @@ var BlockBlobClient = /** @class */ (function (_super) { }, size, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; case 3: return [2 /*return*/, _b.sent()]; case 4: - e_25 = _b.sent(); + e_31 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_25.message + message: e_31.message }); - throw e_25; + throw e_31; case 5: span.end(); return [7 /*endfinally*/]; @@ -23511,7 +28347,7 @@ var BlockBlobClient = /** @class */ (function (_super) { if (maxConcurrency === void 0) { maxConcurrency = 5; } if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, blockNum_1, blockIDPrefix_2, transferProgress_3, blockList_2, scheduler, e_26; + var _a, span, spanOptions, blockNum_1, blockIDPrefix_2, transferProgress_3, blockList_2, scheduler, e_32; var _this = this; return tslib.__generator(this, function (_b) { switch (_b.label) { @@ -23530,7 +28366,7 @@ var BlockBlobClient = /** @class */ (function (_super) { blockIDPrefix_2 = coreHttp.generateUuid(); transferProgress_3 = 0; blockList_2 = []; - scheduler = new BufferScheduler(stream, bufferSize, maxConcurrency, function (buffer) { return tslib.__awaiter(_this, void 0, void 0, function () { + scheduler = new BufferScheduler(stream, bufferSize, maxConcurrency, function (body, length) { return tslib.__awaiter(_this, void 0, void 0, function () { var blockID; return tslib.__generator(this, function (_a) { switch (_a.label) { @@ -23538,7 +28374,7 @@ var BlockBlobClient = /** @class */ (function (_super) { blockID = generateBlockID(blockIDPrefix_2, blockNum_1); blockList_2.push(blockID); blockNum_1++; - return [4 /*yield*/, this.stageBlock(blockID, buffer, buffer.length, { + return [4 /*yield*/, this.stageBlock(blockID, body, length, { conditions: options.conditions, encryptionScope: options.encryptionScope, tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) @@ -23546,7 +28382,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 1: _a.sent(); // Update progress after block is successfully uploaded to server, in case of block trying - transferProgress_3 += buffer.length; + transferProgress_3 += length; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress_3 }); } @@ -23565,12 +28401,12 @@ var BlockBlobClient = /** @class */ (function (_super) { return [4 /*yield*/, this.commitBlockList(blockList_2, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; case 3: return [2 /*return*/, _b.sent()]; case 4: - e_26 = _b.sent(); + e_32 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_26.message + message: e_32.message }); - throw e_26; + throw e_32; case 5: span.end(); return [7 /*endfinally*/]; @@ -23601,7 +28437,7 @@ var BlockBlobClient = /** @class */ (function (_super) { BlockBlobClient.prototype.uploadResetableStream = function (streamFactory, size, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, numBlocks_2, blockList_3, blockIDPrefix_3, transferProgress_4, batch, _loop_3, i, e_27; + var _a, span, spanOptions, numBlocks_2, blockList_3, blockIDPrefix_3, transferProgress_4, batch, _loop_3, i, e_33; var _this = this; return tslib.__generator(this, function (_b) { switch (_b.label) { @@ -23691,12 +28527,12 @@ var BlockBlobClient = /** @class */ (function (_super) { return [4 /*yield*/, this.commitBlockList(blockList_3, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; case 5: return [2 /*return*/, _b.sent()]; case 6: - e_27 = _b.sent(); + e_33 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_27.message + message: e_33.message }); - throw e_27; + throw e_33; case 7: span.end(); return [7 /*endfinally*/]; @@ -23800,17 +28636,18 @@ var PageBlobClient = /** @class */ (function (_super) { * @memberof PageBlobClient */ PageBlobClient.prototype.create = function (size, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_28; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_34; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("PageBlobClient-create", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-create", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.pageBlobContext.create(0, size, { abortSignal: options.abortSignal, @@ -23818,20 +28655,72 @@ var PageBlobClient = /** @class */ (function (_super) { blobSequenceNumber: options.blobSequenceNumber, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), + blobTagsString: toBlobTagsString(options.tags), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_28 = _b.sent(); + e_34 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_28.message + message: e_34.message }); - throw e_28; + throw e_34; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + /** + * Creates a page blob of the specified length. Call uploadPages to upload data + * data to a page blob. If the blob with the same name already exists, the content + * of the existing blob will remain unchanged. + * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * + * @param {number} size size of the page blob. + * @param {PageBlobCreateIfNotExistsOptions} [options] + * @returns {Promise} + * @memberof PageBlobClient + */ + PageBlobClient.prototype.createIfNotExists = function (size, options) { + var _a, _b; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _c, span, spanOptions, conditions, res, e_35; + return tslib.__generator(this, function (_d) { + switch (_d.label) { + case 0: + _c = createSpan("PageBlobClient-createIfNotExists", options.tracingOptions), span = _c.span, spanOptions = _c.spanOptions; + _d.label = 1; + case 1: + _d.trys.push([1, 3, 4, 5]); + conditions = { ifNoneMatch: ETagAny }; + return [4 /*yield*/, this.create(size, tslib.__assign(tslib.__assign({}, options), { conditions: conditions, tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; + case 2: + res = _d.sent(); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable + })]; + case 3: + e_35 = _d.sent(); + if (((_a = e_35.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { + span.setStatus({ + code: api.CanonicalCode.ALREADY_EXISTS, + message: "Expected exception when creating a blob only if it does not already exist." + }); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_35.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_35.response })]; + } + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_35.message + }); + throw e_35; case 4: span.end(); return [7 /*endfinally*/]; @@ -23852,22 +28741,23 @@ var PageBlobClient = /** @class */ (function (_super) { * @memberof PageBlobClient */ PageBlobClient.prototype.uploadPages = function (body, offset, count, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_29; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_36; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("PageBlobClient-uploadPages", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-uploadPages", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.pageBlobContext.uploadPages(body, count, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), onUploadProgress: options.onProgress, range: rangeToString({ offset: offset, count: count }), sequenceNumberAccessConditions: options.conditions, @@ -23877,14 +28767,14 @@ var PageBlobClient = /** @class */ (function (_super) { encryptionScope: options.encryptionScope, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_29 = _b.sent(); + e_36 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_29.message + message: e_36.message }); - throw e_29; + throw e_36; case 4: span.end(); return [7 /*endfinally*/]; @@ -23907,18 +28797,19 @@ var PageBlobClient = /** @class */ (function (_super) { * @memberof PageBlobClient */ PageBlobClient.prototype.uploadPagesFromURL = function (sourceURL, sourceOffset, destOffset, count, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_30; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_37; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - _a = createSpan("PageBlobClient-uploadPagesFromURL", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-uploadPagesFromURL", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count: count }), 0, rangeToString({ offset: destOffset, count: count }), { abortSignal: options.abortSignal, @@ -23926,7 +28817,7 @@ var PageBlobClient = /** @class */ (function (_super) { sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, sequenceNumberAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, @@ -23937,14 +28828,14 @@ var PageBlobClient = /** @class */ (function (_super) { encryptionScope: options.encryptionScope, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_30 = _b.sent(); + e_37 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_30.message + message: e_37.message }); - throw e_30; + throw e_37; case 4: span.end(); return [7 /*endfinally*/]; @@ -23964,36 +28855,37 @@ var PageBlobClient = /** @class */ (function (_super) { * @memberof PageBlobClient */ PageBlobClient.prototype.clearPages = function (offset, count, options) { + var _a; if (offset === void 0) { offset = 0; } if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_31; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_38; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("PageBlobClient-clearPages", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-clearPages", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.pageBlobContext.clearPages(0, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), range: rangeToString({ offset: offset, count: count }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_31 = _b.sent(); + e_38 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_31.message + message: e_38.message }); - throw e_31; + throw e_38; case 4: span.end(); return [7 /*endfinally*/]; @@ -24013,35 +28905,36 @@ var PageBlobClient = /** @class */ (function (_super) { * @memberof PageBlobClient */ PageBlobClient.prototype.getPageRanges = function (offset, count, options) { + var _a; if (offset === void 0) { offset = 0; } if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_32; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_39; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("PageBlobClient-getPageRanges", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-getPageRanges", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.pageBlobContext .getPageRanges({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), range: rangeToString({ offset: offset, count: count }), spanOptions: spanOptions }) .then(rangeResponseFromModel)]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_32 = _b.sent(); + e_39 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_32.message + message: e_39.message }); - throw e_32; + throw e_39; case 4: span.end(); return [7 /*endfinally*/]; @@ -24056,41 +28949,42 @@ var PageBlobClient = /** @class */ (function (_super) { * * @param {number} offset Starting byte position of the page blob * @param {number} count Number of bytes to get ranges diff. - * @param {string} prevSnapshot Timestamp of snapshot to retrive the difference. + * @param {string} prevSnapshot Timestamp of snapshot to retrieve the difference. * @param {PageBlobGetPageRangesDiffOptions} [options] Options to the Page Blob Get Page Ranges Diff operation. * @returns {Promise} Response data for the Page Blob Get Page Range Diff operation. * @memberof PageBlobClient */ PageBlobClient.prototype.getPageRangesDiff = function (offset, count, prevSnapshot, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_33; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_40; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("PageBlobClient-getPageRangesDiff", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-getPageRangesDiff", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.pageBlobContext .getPageRangesDiff({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), prevsnapshot: prevSnapshot, range: rangeToString({ offset: offset, count: count }), spanOptions: spanOptions }) .then(rangeResponseFromModel)]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_33 = _b.sent(); + e_40 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_33.message + message: e_40.message }); - throw e_33; + throw e_40; case 4: span.end(); return [7 /*endfinally*/]; @@ -24105,41 +28999,42 @@ var PageBlobClient = /** @class */ (function (_super) { * * @param {number} offset Starting byte position of the page blob * @param {number} count Number of bytes to get ranges diff. - * @param {string} prevSnapshotUrl URL of snapshot to retrive the difference. + * @param {string} prevSnapshotUrl URL of snapshot to retrieve the difference. * @param {PageBlobGetPageRangesDiffOptions} [options] Options to the Page Blob Get Page Ranges Diff operation. * @returns {Promise} Response data for the Page Blob Get Page Range Diff operation. * @memberof PageBlobClient */ PageBlobClient.prototype.getPageRangesDiffForManagedDisks = function (offset, count, prevSnapshotUrl, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_34; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_41; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.pageBlobContext .getPageRangesDiff({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), prevSnapshotUrl: prevSnapshotUrl, range: rangeToString({ offset: offset, count: count }), spanOptions: spanOptions }) .then(rangeResponseFromModel)]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_34 = _b.sent(); + e_41 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_34.message + message: e_41.message }); - throw e_34; + throw e_41; case 4: span.end(); return [7 /*endfinally*/]; @@ -24158,32 +29053,33 @@ var PageBlobClient = /** @class */ (function (_super) { * @memberof PageBlobClient */ PageBlobClient.prototype.resize = function (size, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_35; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_42; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("PageBlobClient-resize", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-resize", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.pageBlobContext.resize(size, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), encryptionScope: options.encryptionScope, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_35 = _b.sent(); + e_42 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_35.message + message: e_42.message }); - throw e_35; + throw e_42; case 4: span.end(); return [7 /*endfinally*/]; @@ -24203,32 +29099,33 @@ var PageBlobClient = /** @class */ (function (_super) { * @memberof PageBlobClient */ PageBlobClient.prototype.updateSequenceNumber = function (sequenceNumberAction, sequenceNumber, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_36; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_43; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("PageBlobClient-updateSequenceNumber", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-updateSequenceNumber", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.pageBlobContext.updateSequenceNumber(sequenceNumberAction, { abortSignal: options.abortSignal, blobSequenceNumber: sequenceNumber, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_36 = _b.sent(); + e_43 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_36.message + message: e_43.message }); - throw e_36; + throw e_43; case 4: span.end(); return [7 /*endfinally*/]; @@ -24252,29 +29149,30 @@ var PageBlobClient = /** @class */ (function (_super) { * @memberof PageBlobClient */ PageBlobClient.prototype.startCopyIncremental = function (copySource, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_37; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_44; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("PageBlobClient-startCopyIncremental", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-startCopyIncremental", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.pageBlobContext.copyIncremental(copySource, { abortSignal: options.abortSignal, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_37 = _b.sent(); + e_44 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_37.message + message: e_44.message }); - throw e_37; + throw e_44; case 4: span.end(); return [7 /*endfinally*/]; @@ -24302,9 +29200,11 @@ var BlobLeaseClient = /** @class */ (function () { var clientContext = new StorageClientContext(client.url, client.pipeline.toServiceClientOptions()); this._url = client.url; if (client instanceof ContainerClient) { + this._isContainer = true; this._containerOrBlobOperation = new Container(clientContext); } else { + this._isContainer = false; this._containerOrBlobOperation = new Blob$1(clientContext); } if (!leaseId) { @@ -24323,7 +29223,7 @@ var BlobLeaseClient = /** @class */ (function () { get: function () { return this._leaseId; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobLeaseClient.prototype, "url", { @@ -24337,7 +29237,7 @@ var BlobLeaseClient = /** @class */ (function () { get: function () { return this._url; }, - enumerable: true, + enumerable: false, configurable: true }); /** @@ -24354,31 +29254,37 @@ var BlobLeaseClient = /** @class */ (function () { * @memberof BlobLeaseClient */ BlobLeaseClient.prototype.acquireLease = function (duration, options) { + var _a, _b, _c, _d, _e, _f; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_38; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _g, span, spanOptions, e_45; + return tslib.__generator(this, function (_h) { + switch (_h.label) { case 0: - _a = createSpan("BlobLeaseClient-acquireLease", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _g = createSpan("BlobLeaseClient-acquireLease", options.tracingOptions), span = _g.span, spanOptions = _g.spanOptions; + if (this._isContainer && + ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) || + (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { + throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + } + _h.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _h.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this._containerOrBlobOperation.acquireLease({ abortSignal: options.abortSignal, duration: duration, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }), proposedLeaseId: this._leaseId, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _h.sent()]; case 3: - e_38 = _b.sent(); + e_45 = _h.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_38.message + message: e_45.message }); - throw e_38; + throw e_45; case 4: span.end(); return [7 /*endfinally*/]; @@ -24399,32 +29305,38 @@ var BlobLeaseClient = /** @class */ (function () { * @memberof BlobLeaseClient */ BlobLeaseClient.prototype.changeLease = function (proposedLeaseId, options) { + var _a, _b, _c, _d, _e, _f; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, response, e_39; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _g, span, spanOptions, response, e_46; + return tslib.__generator(this, function (_h) { + switch (_h.label) { case 0: - _a = createSpan("BlobLeaseClient-changeLease", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _g = createSpan("BlobLeaseClient-changeLease", options.tracingOptions), span = _g.span, spanOptions = _g.spanOptions; + if (this._isContainer && + ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) || + (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { + throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + } + _h.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _h.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId, { abortSignal: options.abortSignal, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }), spanOptions: spanOptions })]; case 2: - response = _b.sent(); + response = _h.sent(); this._leaseId = proposedLeaseId; return [2 /*return*/, response]; case 3: - e_39 = _b.sent(); + e_46 = _h.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_39.message + message: e_46.message }); - throw e_39; + throw e_46; case 4: span.end(); return [7 /*endfinally*/]; @@ -24445,29 +29357,35 @@ var BlobLeaseClient = /** @class */ (function () { * @memberof BlobLeaseClient */ BlobLeaseClient.prototype.releaseLease = function (options) { + var _a, _b, _c, _d, _e, _f; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_40; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _g, span, spanOptions, e_47; + return tslib.__generator(this, function (_h) { + switch (_h.label) { case 0: - _a = createSpan("BlobLeaseClient-releaseLease", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _g = createSpan("BlobLeaseClient-releaseLease", options.tracingOptions), span = _g.span, spanOptions = _g.spanOptions; + if (this._isContainer && + ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) || + (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { + throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + } + _h.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _h.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this._containerOrBlobOperation.releaseLease(this._leaseId, { abortSignal: options.abortSignal, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _h.sent()]; case 3: - e_40 = _b.sent(); + e_47 = _h.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_40.message + message: e_47.message }); - throw e_40; + throw e_47; case 4: span.end(); return [7 /*endfinally*/]; @@ -24487,29 +29405,35 @@ var BlobLeaseClient = /** @class */ (function () { * @memberof BlobLeaseClient */ BlobLeaseClient.prototype.renewLease = function (options) { + var _a, _b, _c, _d, _e, _f; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_41; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _g, span, spanOptions, e_48; + return tslib.__generator(this, function (_h) { + switch (_h.label) { case 0: - _a = createSpan("BlobLeaseClient-renewLease", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _g = createSpan("BlobLeaseClient-renewLease", options.tracingOptions), span = _g.span, spanOptions = _g.spanOptions; + if (this._isContainer && + ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) || + (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { + throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + } + _h.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _h.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this._containerOrBlobOperation.renewLease(this._leaseId, { abortSignal: options.abortSignal, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _h.sent()]; case 3: - e_41 = _b.sent(); + e_48 = _h.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_41.message + message: e_48.message }); - throw e_41; + throw e_48; case 4: span.end(); return [7 /*endfinally*/]; @@ -24532,31 +29456,37 @@ var BlobLeaseClient = /** @class */ (function () { * @memberof BlobLeaseClient */ BlobLeaseClient.prototype.breakLease = function (breakPeriod, options) { + var _a, _b, _c, _d, _e, _f; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, operationOptions, e_42; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _g, span, spanOptions, operationOptions, e_49; + return tslib.__generator(this, function (_h) { + switch (_h.label) { case 0: - _a = createSpan("BlobLeaseClient-breakLease", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _g = createSpan("BlobLeaseClient-breakLease", options.tracingOptions), span = _g.span, spanOptions = _g.spanOptions; + if (this._isContainer && + ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) || + (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { + throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + } + _h.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _h.trys.push([1, 3, 4, 5]); operationOptions = { abortSignal: options.abortSignal, breakPeriod: breakPeriod, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }), spanOptions: spanOptions }; return [4 /*yield*/, this._containerOrBlobOperation.breakLease(operationOptions)]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _h.sent()]; case 3: - e_42 = _b.sent(); + e_49 = _h.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_42.message + message: e_49.message }); - throw e_42; + throw e_49; case 4: span.end(); return [7 /*endfinally*/]; @@ -24638,7 +29568,7 @@ var ContainerClient = /** @class */ (function (_super) { get: function () { return this._containerName; }, - enumerable: true, + enumerable: false, configurable: true }); /** @@ -24661,7 +29591,7 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.create = function (options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_43; + var _a, span, spanOptions, e_50; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -24675,12 +29605,12 @@ var ContainerClient = /** @class */ (function (_super) { // this will filter out unwanted properties from the response object into result object return [2 /*return*/, _b.sent()]; case 3: - e_43 = _b.sent(); + e_50 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_43.message + message: e_50.message }); - throw e_43; + throw e_50; case 4: span.end(); return [7 /*endfinally*/]; @@ -24690,7 +29620,55 @@ var ContainerClient = /** @class */ (function (_super) { }); }; /** - * Returns true if the Azrue container resource represented by this client exists; false otherwise. + * Creates a new container under the specified account. If the container with + * the same name already exists, it is not changed. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * + * @param {ContainerCreateOptions} [options] + * @returns {Promise} + * @memberof ContainerClient + */ + ContainerClient.prototype.createIfNotExists = function (options) { + var _a, _b; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _c, span, spanOptions, res, e_51; + return tslib.__generator(this, function (_d) { + switch (_d.label) { + case 0: + _c = createSpan("ContainerClient-createIfNotExists", options.tracingOptions), span = _c.span, spanOptions = _c.spanOptions; + _d.label = 1; + case 1: + _d.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this.create(tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; + case 2: + res = _d.sent(); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable + })]; + case 3: + e_51 = _d.sent(); + if (((_a = e_51.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { + span.setStatus({ + code: api.CanonicalCode.ALREADY_EXISTS, + message: "Expected exception when creating a container only if it does not already exist." + }); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_51.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_51.response })]; + } + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_51.message + }); + throw e_51; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + /** + * Returns true if the Azure container resource represented by this client exists; false otherwise. * * NOTE: use this function with care since an existing container might be deleted by other clients or * applications. Vice versa new containers with the same name might be added by other clients or @@ -24703,7 +29681,7 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.exists = function (options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_44; + var _a, span, spanOptions, e_52; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -24719,8 +29697,8 @@ var ContainerClient = /** @class */ (function (_super) { _b.sent(); return [2 /*return*/, true]; case 3: - e_44 = _b.sent(); - if (e_44.statusCode === 404) { + e_52 = _b.sent(); + if (e_52.statusCode === 404) { span.setStatus({ code: api.CanonicalCode.NOT_FOUND, message: "Expected exception when checking container existence" @@ -24729,9 +29707,9 @@ var ContainerClient = /** @class */ (function (_super) { } span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_44.message + message: e_52.message }); - throw e_44; + throw e_52; case 4: span.end(); return [7 /*endfinally*/]; @@ -24806,7 +29784,7 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.getProperties = function (options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_45; + var _a, span, spanOptions, e_53; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -24820,12 +29798,12 @@ var ContainerClient = /** @class */ (function (_super) { return [4 /*yield*/, this.containerContext.getProperties(tslib.__assign(tslib.__assign({ abortSignal: options.abortSignal }, options.conditions), { spanOptions: spanOptions }))]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_45 = _b.sent(); + e_53 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_45.message + message: e_53.message }); - throw e_45; + throw e_53; case 4: span.end(); return [7 /*endfinally*/]; @@ -24846,18 +29824,13 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.delete = function (options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_46; + var _a, span, spanOptions, e_54; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: if (!options.conditions) { options.conditions = {}; } - if ((options.conditions.ifMatch && options.conditions.ifMatch !== ETagNone) || - (options.conditions.ifNoneMatch && options.conditions.ifNoneMatch !== ETagNone)) { - throw new RangeError("the IfMatch and IfNoneMatch access conditions must have their default\ - values because they are ignored by the service"); - } _a = createSpan("ContainerClient-delete", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; _b.label = 1; case 1: @@ -24870,12 +29843,60 @@ var ContainerClient = /** @class */ (function (_super) { })]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_46 = _b.sent(); + e_54 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_46.message + message: e_54.message }); - throw e_46; + throw e_54; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + /** + * Marks the specified container for deletion if it exists. The container and any blobs + * contained within it are later deleted during garbage collection. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * + * @param {ContainerDeleteMethodOptions} [options] Options to Container Delete operation. + * @returns {Promise} + * @memberof ContainerClient + */ + ContainerClient.prototype.deleteIfExists = function (options) { + var _a, _b; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _c, span, spanOptions, res, e_55; + return tslib.__generator(this, function (_d) { + switch (_d.label) { + case 0: + _c = createSpan("ContainerClient-deleteIfExists", options.tracingOptions), span = _c.span, spanOptions = _c.spanOptions; + _d.label = 1; + case 1: + _d.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this.delete(tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; + case 2: + res = _d.sent(); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable + })]; + case 3: + e_55 = _d.sent(); + if (((_a = e_55.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { + span.setStatus({ + code: api.CanonicalCode.NOT_FOUND, + message: "Expected exception when deleting a container only if it exists." + }); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_55.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_55.response })]; + } + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_55.message + }); + throw e_55; case 4: span.end(); return [7 /*endfinally*/]; @@ -24901,18 +29922,15 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.setMetadata = function (metadata, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_47; + var _a, span, spanOptions, e_56; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: if (!options.conditions) { options.conditions = {}; } - if (options.conditions.ifUnmodifiedSince || - (options.conditions.ifMatch && options.conditions.ifMatch !== ETagNone) || - (options.conditions.ifNoneMatch && options.conditions.ifNoneMatch !== ETagNone)) { - throw new RangeError("the IfUnmodifiedSince, IfMatch, and IfNoneMatch must have their default values\ - because they are ignored by the blob service"); + if (options.conditions.ifUnmodifiedSince) { + throw new RangeError("the IfUnmodifiedSince must have their default values because they are ignored by the blob service"); } _a = createSpan("ContainerClient-setMetadata", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; _b.label = 1; @@ -24927,12 +29945,12 @@ var ContainerClient = /** @class */ (function (_super) { })]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_47 = _b.sent(); + e_56 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_47.message + message: e_56.message }); - throw e_47; + throw e_56; case 4: span.end(); return [7 /*endfinally*/]; @@ -24957,7 +29975,7 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.getAccessPolicy = function (options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, response, res, _i, response_1, identifier, accessPolicy, e_48; + var _a, span, spanOptions, response, res, _i, response_1, identifier, accessPolicy, e_57; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -25008,12 +30026,12 @@ var ContainerClient = /** @class */ (function (_super) { } return [2 /*return*/, res]; case 3: - e_48 = _b.sent(); + e_57 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_48.message + message: e_57.message }); - throw e_48; + throw e_57; case 4: span.end(); return [7 /*endfinally*/]; @@ -25044,7 +30062,7 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.setAccessPolicy = function (access, containerAcl, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, acl, _i, _b, identifier, e_49; + var _a, span, spanOptions, acl, _i, _b, identifier, e_58; return tslib.__generator(this, function (_c) { switch (_c.label) { case 0: @@ -25079,12 +30097,12 @@ var ContainerClient = /** @class */ (function (_super) { })]; case 2: return [2 /*return*/, _c.sent()]; case 3: - e_49 = _c.sent(); + e_58 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_49.message + message: e_58.message }); - throw e_49; + throw e_58; case 4: span.end(); return [7 /*endfinally*/]; @@ -25129,7 +30147,7 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.uploadBlockBlob = function (blobName, body, contentLength, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, blockBlobClient, response, e_50; + var _a, span, spanOptions, blockBlobClient, response, e_59; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -25146,12 +30164,12 @@ var ContainerClient = /** @class */ (function (_super) { response: response }]; case 3: - e_50 = _b.sent(); + e_59 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_50.message + message: e_59.message }); - throw e_50; + throw e_59; case 4: span.end(); return [7 /*endfinally*/]; @@ -25168,14 +30186,14 @@ var ContainerClient = /** @class */ (function (_super) { * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob * * @param {string} blobName - * @param {BlobDeleteOptions} [options] Options to Blob Delete operation. + * @param {ContainerDeleteBlobOptions} [options] Options to Blob Delete operation. * @returns {Promise} Block blob deletion response data. * @memberof ContainerClient */ ContainerClient.prototype.deleteBlob = function (blobName, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, blobClient, e_51; + var _a, span, spanOptions, blobClient, e_60; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -25184,15 +30202,18 @@ var ContainerClient = /** @class */ (function (_super) { case 1: _b.trys.push([1, 3, 4, 5]); blobClient = this.getBlobClient(blobName); + if (options.versionId) { + blobClient = blobClient.withVersion(options.versionId); + } return [4 /*yield*/, blobClient.delete(tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_51 = _b.sent(); + e_60 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_51.message + message: e_60.message }); - throw e_51; + throw e_60; case 4: span.end(); return [7 /*endfinally*/]; @@ -25216,7 +30237,7 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.listBlobFlatSegment = function (marker, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_52; + var _a, span, spanOptions, response, wrappedResponse, e_61; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -25225,14 +30246,20 @@ var ContainerClient = /** @class */ (function (_super) { case 1: _b.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.containerContext.listBlobFlatSegment(tslib.__assign(tslib.__assign({ marker: marker }, options), { spanOptions: spanOptions }))]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: + response = _b.sent(); + wrappedResponse = tslib.__assign(tslib.__assign({}, response), { _response: response._response, segment: tslib.__assign(tslib.__assign({}, response.segment), { blobItems: response.segment.blobItems.map(function (blobItemInteral) { + var blobItem = tslib.__assign(tslib.__assign({}, blobItemInteral), { tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) }); + return blobItem; + }) }) }); + return [2 /*return*/, wrappedResponse]; case 3: - e_52 = _b.sent(); + e_61 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_52.message + message: e_61.message }); - throw e_52; + throw e_61; case 4: span.end(); return [7 /*endfinally*/]; @@ -25248,7 +30275,7 @@ var ContainerClient = /** @class */ (function (_super) { * again (passing the the previously-returned Marker) to get the next segment. * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs * - * @param {string} delimiter The charactor or string used to define the virtual hierarchy + * @param {string} delimiter The character or string used to define the virtual hierarchy * @param {string} [marker] A string value that identifies the portion of the list to be returned with the next list operation. * @param {ContainerListBlobsSegmentOptions} [options] Options to Container List Blob Hierarchy Segment operation. * @returns {Promise} @@ -25257,7 +30284,7 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.listBlobHierarchySegment = function (delimiter, marker, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_53; + var _a, span, spanOptions, response, wrappedResponse, e_62; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -25266,14 +30293,20 @@ var ContainerClient = /** @class */ (function (_super) { case 1: _b.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.containerContext.listBlobHierarchySegment(delimiter, tslib.__assign(tslib.__assign({ marker: marker }, options), { spanOptions: spanOptions }))]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: + response = _b.sent(); + wrappedResponse = tslib.__assign(tslib.__assign({}, response), { _response: response._response, segment: tslib.__assign(tslib.__assign({}, response.segment), { blobItems: response.segment.blobItems.map(function (blobItemInteral) { + var blobItem = tslib.__assign(tslib.__assign({}, blobItemInteral), { tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) }); + return blobItem; + }) }) }); + return [2 /*return*/, wrappedResponse]; case 3: - e_53 = _b.sent(); + e_62 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_53.message + message: e_62.message }); - throw e_53; + throw e_62; case 4: span.end(); return [7 /*endfinally*/]; @@ -25335,8 +30368,8 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.listItems = function (options) { if (options === void 0) { options = {}; } return tslib.__asyncGenerator(this, arguments, function listItems_1() { - var marker, _a, _b, listBlobsFlatSegmentResponse, e_54_1; - var e_54, _c; + var marker, _a, _b, listBlobsFlatSegmentResponse, e_63_1; + var e_63, _c; return tslib.__generator(this, function (_d) { switch (_d.label) { case 0: @@ -25355,8 +30388,8 @@ var ContainerClient = /** @class */ (function (_super) { case 5: return [3 /*break*/, 1]; case 6: return [3 /*break*/, 13]; case 7: - e_54_1 = _d.sent(); - e_54 = { error: e_54_1 }; + e_63_1 = _d.sent(); + e_63 = { error: e_63_1 }; return [3 /*break*/, 13]; case 8: _d.trys.push([8, , 11, 12]); @@ -25367,7 +30400,7 @@ var ContainerClient = /** @class */ (function (_super) { _d.label = 10; case 10: return [3 /*break*/, 12]; case 11: - if (e_54) throw e_54.error; + if (e_63) throw e_63.error; return [7 /*endfinally*/]; case 12: return [7 /*endfinally*/]; case 13: return [2 /*return*/]; @@ -25463,9 +30496,15 @@ var ContainerClient = /** @class */ (function (_super) { if (options.includeSnapshots) { include.push("snapshots"); } + if (options.includeVersions) { + include.push("versions"); + } if (options.includeUncommitedBlobs) { include.push("uncommittedblobs"); } + if (options.includeTags) { + include.push("tags"); + } if (options.prefix === "") { options.prefix = undefined; } @@ -25499,7 +30538,7 @@ var ContainerClient = /** @class */ (function (_super) { * Returns an AsyncIterableIterator for ContainerListBlobHierarchySegmentResponse * * @private - * @param {string} delimiter The charactor or string used to define the virtual hierarchy + * @param {string} delimiter The character or string used to define the virtual hierarchy * @param {string} [marker] A string value that identifies the portion of * the list of blobs to be returned with the next listing operation. The * operation returns the ContinuationToken value within the response body if the @@ -25510,7 +30549,8 @@ var ContainerClient = /** @class */ (function (_super) { * @param {ContainerListBlobsSegmentOptions} [options] Options to list blobs operation. * @returns {AsyncIterableIterator} * @memberof ContainerClient - */ ContainerClient.prototype.listHierarchySegments = function (delimiter, marker, options) { + */ + ContainerClient.prototype.listHierarchySegments = function (delimiter, marker, options) { if (options === void 0) { options = {}; } return tslib.__asyncGenerator(this, arguments, function listHierarchySegments_1() { var listBlobsHierarchySegmentResponse; @@ -25541,7 +30581,7 @@ var ContainerClient = /** @class */ (function (_super) { * Returns an AsyncIterableIterator for {@link BlobPrefix} and {@link BlobItem} objects. * * @private - * @param {string} delimiter The charactor or string used to define the virtual hierarchy + * @param {string} delimiter The character or string used to define the virtual hierarchy * @param {ContainerListBlobsSegmentOptions} [options] Options to list blobs operation. * @returns {AsyncIterableIterator<{ kind: "prefix" } & BlobPrefix | { kind: "blob" } & BlobItem>} * @memberof ContainerClient @@ -25549,8 +30589,8 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.listItemsByHierarchy = function (delimiter, options) { if (options === void 0) { options = {}; } return tslib.__asyncGenerator(this, arguments, function listItemsByHierarchy_1() { - var marker, _a, _b, listBlobsHierarchySegmentResponse, segment, _i, _c, prefix, _d, _e, blob, e_55_1; - var e_55, _f; + var marker, _a, _b, listBlobsHierarchySegmentResponse, segment, _i, _c, prefix, _d, _e, blob, e_64_1; + var e_64, _f; return tslib.__generator(this, function (_g) { switch (_g.label) { case 0: @@ -25593,8 +30633,8 @@ var ContainerClient = /** @class */ (function (_super) { case 12: return [3 /*break*/, 1]; case 13: return [3 /*break*/, 20]; case 14: - e_55_1 = _g.sent(); - e_55 = { error: e_55_1 }; + e_64_1 = _g.sent(); + e_64 = { error: e_64_1 }; return [3 /*break*/, 20]; case 15: _g.trys.push([15, , 18, 19]); @@ -25605,7 +30645,7 @@ var ContainerClient = /** @class */ (function (_super) { _g.label = 17; case 17: return [3 /*break*/, 19]; case 18: - if (e_55) throw e_55.error; + if (e_64) throw e_64.error; return [7 /*endfinally*/]; case 19: return [7 /*endfinally*/]; case 20: return [2 /*return*/]; @@ -25634,7 +30674,7 @@ var ContainerClient = /** @class */ (function (_super) { * Example using `iter.next()`: * * ```js - * let iter = await containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); + * let iter = containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); * let entity = await iter.next(); * while (!entity.done) { * let item = entity.value; @@ -25686,7 +30726,7 @@ var ContainerClient = /** @class */ (function (_super) { * } * ``` * - * @param {string} delimiter The charactor or string used to define the virtual hierarchy + * @param {string} delimiter The character or string used to define the virtual hierarchy * @param {ContainerListBlobsOptions} [options={}] Options to list blobs operation. * @returns {(PagedAsyncIterableIterator< * { kind: "prefix" } & BlobPrefix | { kind: "blob" } & BlobItem, @@ -25698,6 +30738,9 @@ var ContainerClient = /** @class */ (function (_super) { var _a; var _this = this; if (options === void 0) { options = {}; } + if (delimiter === "") { + throw new RangeError("delimiter should contain one or more characters"); + } var include = []; if (options.includeCopy) { include.push("copy"); @@ -25711,9 +30754,15 @@ var ContainerClient = /** @class */ (function (_super) { if (options.includeSnapshots) { include.push("snapshots"); } + if (options.includeVersions) { + include.push("versions"); + } if (options.includeUncommitedBlobs) { include.push("uncommittedblobs"); } + if (options.includeTags) { + include.push("tags"); + } if (options.prefix === "") { options.prefix = undefined; } @@ -25758,15 +30807,21 @@ var ContainerClient = /** @class */ (function (_super) { var parsedUrl = coreHttp.URLBuilder.parse(this.url); if (parsedUrl.getHost().split(".")[1] === "blob") { // "https://myaccount.blob.core.windows.net/containername". + // "https://customdomain.com/containername". // .getPath() -> /containername containerName = parsedUrl.getPath().split("/")[1]; } - else { + else if (isIpEndpointStyle(parsedUrl)) { // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/containername // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/containername // .getPath() -> /devstoreaccount1/containername containerName = parsedUrl.getPath().split("/")[2]; } + else { + // "https://customdomain.com/containername". + // .getPath() -> /containername + containerName = parsedUrl.getPath().split("/")[1]; + } // decode the encoded containerName - to get all the special characters that might be present in it containerName = decodeURIComponent(containerName); if (!containerName) { @@ -26235,7 +31290,7 @@ var InnerBatchRequest = /** @class */ (function () { this.subRequests = new Map(); } /** - * Create pipeline to assemble sub requests. The idea here is to use exising + * Create pipeline to assemble sub requests. The idea here is to use existing * credential and serialization/deserialization components, with additional policies to * filter unnecessary headers, assemble sub requests into request's body * and intercept request from going to wire. @@ -26243,7 +31298,7 @@ var InnerBatchRequest = /** @class */ (function () { */ InnerBatchRequest.prototype.createPipeline = function (credential) { var isAnonymousCreds = credential instanceof AnonymousCredential; - var policyFactoryLength = 3 + (isAnonymousCreds ? 0 : 1); // [deserilizationPolicy, BatchHeaderFilterPolicyFactory, (Optional)Credential, BatchRequestAssemblePolicyFactory] + var policyFactoryLength = 3 + (isAnonymousCreds ? 0 : 1); // [deserializationPolicy, BatchHeaderFilterPolicyFactory, (Optional)Credential, BatchRequestAssemblePolicyFactory] var factories = new Array(policyFactoryLength); factories[0] = coreHttp.deserializationPolicy(); // Default deserializationPolicy is provided by protocol layer factories[1] = new BatchHeaderFilterPolicyFactory(); // Use batch header filter policy to exclude unnecessary headers @@ -26887,7 +31942,7 @@ var BlobServiceClient = /** @class */ (function (_super) { _b.label = 1; case 1: _b.trys.push([1, 3, 4, 5]); - return [4 /*yield*/, this.serviceContext.listContainersSegment(tslib.__assign(tslib.__assign({ abortSignal: options.abortSignal, marker: marker }, options), { spanOptions: spanOptions }))]; + return [4 /*yield*/, this.serviceContext.listContainersSegment(tslib.__assign(tslib.__assign({ abortSignal: options.abortSignal, marker: marker }, options), { include: typeof options.include === "string" ? [options.include] : options.include, spanOptions: spanOptions }))]; case 2: return [2 /*return*/, _b.sent()]; case 3: e_7 = _b.sent(); @@ -26904,6 +31959,273 @@ var BlobServiceClient = /** @class */ (function (_super) { }); }); }; + /** + * The Filter Blobs operation enables callers to list blobs across all containers whose tags + * match a given search expression. Filter blobs searches across all containers within a + * storage account but can be scoped within the expression to a single container. + * + * @private + * @param {string} tagFilterSqlExpression The where parameter enables the caller to query blobs whose tags match a given expression. + * The given expression must evaluate to true for a blob to be returned in the results. + * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; + * however, only a subset of the OData filter syntax is supported in the Blob service. + * @param {string} [marker] A string value that identifies the portion of + * the list of blobs to be returned with the next listing operation. The + * operation returns the NextMarker value within the response body if the + * listing operation did not return all blobs remaining to be listed + * with the current page. The NextMarker value can be used as the value for + * the marker parameter in a subsequent call to request the next page of list + * items. The marker value is opaque to the client. + * @param {ServiceFindBlobsByTagsSegmentOptions} [options={}] Options to find blobs by tags. + * @returns {Promise} + * @memberof BlobServiceClient + */ + BlobServiceClient.prototype.findBlobsByTagsSegment = function (tagFilterSqlExpression, marker, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _a, span, spanOptions, e_8; + return tslib.__generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = createSpan("BlobServiceClient-findBlobsByTagsSegment", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b.label = 1; + case 1: + _b.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this.serviceContext.filterBlobs({ + abortSignal: options.abortSignal, + where: tagFilterSqlExpression, + marker: marker, + maxPageSize: options.maxPageSize, + spanOptions: spanOptions + })]; + case 2: return [2 /*return*/, _b.sent()]; + case 3: + e_8 = _b.sent(); + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_8.message + }); + throw e_8; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + /** + * Returns an AsyncIterableIterator for ServiceFindBlobsByTagsSegmentResponse. + * + * @private + * @param {string} tagFilterSqlExpression The where parameter enables the caller to query blobs whose tags match a given expression. + * The given expression must evaluate to true for a blob to be returned in the results. + * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; + * however, only a subset of the OData filter syntax is supported in the Blob service. + * @param {string} [marker] A string value that identifies the portion of + * the list of blobs to be returned with the next listing operation. The + * operation returns the NextMarker value within the response body if the + * listing operation did not return all blobs remaining to be listed + * with the current page. The NextMarker value can be used as the value for + * the marker parameter in a subsequent call to request the next page of list + * items. The marker value is opaque to the client. + * @param {ServiceFindBlobsByTagsSegmentOptions} [options={}] Options to find blobs by tags. + * @returns {AsyncIterableIterator} + * @memberof BlobServiceClient + */ + BlobServiceClient.prototype.findBlobsByTagsSegments = function (tagFilterSqlExpression, marker, options) { + if (options === void 0) { options = {}; } + return tslib.__asyncGenerator(this, arguments, function findBlobsByTagsSegments_1() { + var response; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(!!marker || marker === undefined)) return [3 /*break*/, 6]; + _a.label = 1; + case 1: return [4 /*yield*/, tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options))]; + case 2: + response = _a.sent(); + response.blobs = response.blobs || []; + marker = response.continuationToken; + return [4 /*yield*/, tslib.__await(response)]; + case 3: return [4 /*yield*/, _a.sent()]; + case 4: + _a.sent(); + _a.label = 5; + case 5: + if (marker) return [3 /*break*/, 1]; + _a.label = 6; + case 6: return [2 /*return*/]; + } + }); + }); + }; + /** + * Returns an AsyncIterableIterator for blobs. + * + * @private + * @param {string} tagFilterSqlExpression The where parameter enables the caller to query blobs whose tags match a given expression. + * The given expression must evaluate to true for a blob to be returned in the results. + * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; + * however, only a subset of the OData filter syntax is supported in the Blob service. + * @param {ServiceFindBlobsByTagsSegmentOptions} [options={}] Options to findBlobsByTagsItems. + * @returns {AsyncIterableIterator} + * @memberof BlobServiceClient + */ + BlobServiceClient.prototype.findBlobsByTagsItems = function (tagFilterSqlExpression, options) { + if (options === void 0) { options = {}; } + return tslib.__asyncGenerator(this, arguments, function findBlobsByTagsItems_1() { + var marker, _a, _b, segment, e_9_1; + var e_9, _c; + return tslib.__generator(this, function (_d) { + switch (_d.label) { + case 0: + _d.trys.push([0, 7, 8, 13]); + _a = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)); + _d.label = 1; + case 1: return [4 /*yield*/, tslib.__await(_a.next())]; + case 2: + if (!(_b = _d.sent(), !_b.done)) return [3 /*break*/, 6]; + segment = _b.value; + return [5 /*yield**/, tslib.__values(tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs)))]; + case 3: return [4 /*yield*/, tslib.__await.apply(void 0, [_d.sent()])]; + case 4: + _d.sent(); + _d.label = 5; + case 5: return [3 /*break*/, 1]; + case 6: return [3 /*break*/, 13]; + case 7: + e_9_1 = _d.sent(); + e_9 = { error: e_9_1 }; + return [3 /*break*/, 13]; + case 8: + _d.trys.push([8, , 11, 12]); + if (!(_b && !_b.done && (_c = _a.return))) return [3 /*break*/, 10]; + return [4 /*yield*/, tslib.__await(_c.call(_a))]; + case 9: + _d.sent(); + _d.label = 10; + case 10: return [3 /*break*/, 12]; + case 11: + if (e_9) throw e_9.error; + return [7 /*endfinally*/]; + case 12: return [7 /*endfinally*/]; + case 13: return [2 /*return*/]; + } + }); + }); + }; + /** + * Returns an async iterable iterator to find all blobs with specified tag + * under the specified account. + * + * .byPage() returns an async iterable iterator to list the blobs in pages. + * + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * + * Example using `for await` syntax: + * + * ```js + * let i = 1; + * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) { + * console.log(`Blob ${i++}: ${container.name}`); + * } + * ``` + * + * Example using `iter.next()`: + * + * ```js + * let i = 1; + * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); + * let blobItem = await iter.next(); + * while (!blobItem.done) { + * console.log(`Blob ${i++}: ${blobItem.value.name}`); + * blobItem = await iter.next(); + * } + * ``` + * + * Example using `byPage()`: + * + * ```js + * // passing optional maxPageSize in the page settings + * let i = 1; + * for await (const response of blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { + * if (response.blobs) { + * for (const blob of response.blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } + * } + * } + * ``` + * + * Example using paging with a marker: + * + * ```js + * let i = 1; + * let iterator = blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 }); + * let response = (await iterator.next()).value; + * + * // Prints 2 blob names + * if (response.blobs) { + * for (const blob of response.blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } + * } + * + * // Gets next marker + * let marker = response.continuationToken; + * // Passing next marker as continuationToken + * iterator = blobServiceClient + * .findBlobsByTags("tagkey='tagvalue'") + * .byPage({ continuationToken: marker, maxPageSize: 10 }); + * response = (await iterator.next()).value; + * + * // Prints blob names + * if (response.blobs) { + * for (const blob of response.blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } + * } + * ``` + * + * @param {string} tagFilterSqlExpression The where parameter enables the caller to query blobs whose tags match a given expression. + * The given expression must evaluate to true for a blob to be returned in the results. + * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; + * however, only a subset of the OData filter syntax is supported in the Blob service. + * @param {ServiceFindBlobByTagsOptions} [options={}] Options to find blobs by tags. + * @returns {PagedAsyncIterableIterator} + * @memberof BlobServiceClient + */ + BlobServiceClient.prototype.findBlobsByTags = function (tagFilterSqlExpression, options) { + var _a; + var _this = this; + if (options === void 0) { options = {}; } + // AsyncIterableIterator to iterate over blobs + var listSegmentOptions = tslib.__assign({}, options); + var iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); + return _a = { + /** + * @member {Promise} [next] The next method, part of the iteration protocol + */ + next: function () { + return iter.next(); + } + }, + /** + * @member {Symbol} [asyncIterator] The connection to the async iterator, part of the iteration protocol + */ + _a[Symbol.asyncIterator] = function () { + return this; + }, + /** + * @member {Function} [byPage] Return an AsyncIterableIterator that works a page at a time + */ + _a.byPage = function (settings) { + if (settings === void 0) { settings = {}; } + return _this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, tslib.__assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + }, + _a; + }; /** * Returns an AsyncIterableIterator for ServiceListContainersSegmentResponses * @@ -26959,8 +32281,8 @@ var BlobServiceClient = /** @class */ (function (_super) { BlobServiceClient.prototype.listItems = function (options) { if (options === void 0) { options = {}; } return tslib.__asyncGenerator(this, arguments, function listItems_1() { - var marker, _a, _b, segment, e_8_1; - var e_8, _c; + var marker, _a, _b, segment, e_10_1; + var e_10, _c; return tslib.__generator(this, function (_d) { switch (_d.label) { case 0: @@ -26979,8 +32301,8 @@ var BlobServiceClient = /** @class */ (function (_super) { case 5: return [3 /*break*/, 1]; case 6: return [3 /*break*/, 13]; case 7: - e_8_1 = _d.sent(); - e_8 = { error: e_8_1 }; + e_10_1 = _d.sent(); + e_10 = { error: e_10_1 }; return [3 /*break*/, 13]; case 8: _d.trys.push([8, , 11, 12]); @@ -26991,7 +32313,7 @@ var BlobServiceClient = /** @class */ (function (_super) { _d.label = 10; case 10: return [3 /*break*/, 12]; case 11: - if (e_8) throw e_8.error; + if (e_10) throw e_10.error; return [7 /*endfinally*/]; case 12: return [7 /*endfinally*/]; case 13: return [2 /*return*/]; @@ -27123,7 +32445,7 @@ var BlobServiceClient = /** @class */ (function (_super) { BlobServiceClient.prototype.getUserDelegationKey = function (startsOn, expiresOn, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, response, userDelegationKey, res, e_9; + var _a, span, spanOptions, response, userDelegationKey, res, e_11; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -27152,12 +32474,12 @@ var BlobServiceClient = /** @class */ (function (_super) { res = tslib.__assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey); return [2 /*return*/, res]; case 3: - e_9 = _b.sent(); + e_11 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_9.message + message: e_11.message }); - throw e_9; + throw e_11; case 4: span.end(); return [7 /*endfinally*/]; @@ -27217,6 +32539,13 @@ var AccountSASPermissions = /** @class */ (function () { * @memberof AccountSASPermissions */ this.delete = false; + /** + * Permission to delete versions granted. + * + * @type {boolean} + * @memberof AccountSASPermissions + */ + this.deleteVersion = false; /** * Permission to list blob containers, blobs, shares, directories, and files granted. * @@ -27252,6 +32581,20 @@ var AccountSASPermissions = /** @class */ (function () { * @memberof AccountSASPermissions */ this.process = false; + /** + * Specfies Tag access granted. + * + * @type {boolean} + * @memberof AccountSASPermissions + */ + this.tag = false; + /** + * Permission to filter blobs. + * + * @type {boolean} + * @memberof AccountSASPermissions + */ + this.filter = false; } /** * Parse initializes the AccountSASPermissions fields from a string. @@ -27275,6 +32618,9 @@ var AccountSASPermissions = /** @class */ (function () { case "d": accountSASPermissions.delete = true; break; + case "x": + accountSASPermissions.deleteVersion = true; + break; case "l": accountSASPermissions.list = true; break; @@ -27290,6 +32636,12 @@ var AccountSASPermissions = /** @class */ (function () { case "p": accountSASPermissions.process = true; break; + case "t": + accountSASPermissions.tag = true; + break; + case "f": + accountSASPermissions.filter = true; + break; default: throw new RangeError("Invalid permission character: " + c); } @@ -27322,6 +32674,15 @@ var AccountSASPermissions = /** @class */ (function () { if (this.delete) { permissions.push("d"); } + if (this.deleteVersion) { + permissions.push("x"); + } + if (this.filter) { + permissions.push("f"); + } + if (this.tag) { + permissions.push("t"); + } if (this.list) { permissions.push("l"); } @@ -27615,7 +32976,7 @@ var SASQueryParameters = /** @class */ (function () { this.contentType = contentType; if (userDelegationKey) { this.signedOid = userDelegationKey.signedObjectId; - this.signedTenentId = userDelegationKey.signedTenantId; + this.signedTenantId = userDelegationKey.signedTenantId; this.signedStartsOn = userDelegationKey.signedStartsOn; this.signedExpiresOn = userDelegationKey.signedExpiresOn; this.signedService = userDelegationKey.signedService; @@ -27639,7 +33000,7 @@ var SASQueryParameters = /** @class */ (function () { } return undefined; }, - enumerable: true, + enumerable: false, configurable: true }); /** @@ -27705,7 +33066,7 @@ var SASQueryParameters = /** @class */ (function () { this.tryAppendQueryParameter(queries, param, this.signedOid); break; case "sktid": // Signed tenant ID - this.tryAppendQueryParameter(queries, param, this.signedTenentId); + this.tryAppendQueryParameter(queries, param, this.signedTenantId); break; case "skt": // Signed key start time this.tryAppendQueryParameter(queries, param, this.signedStartsOn ? truncatedISO8061Date(this.signedStartsOn, false) : undefined); @@ -27788,6 +33149,21 @@ function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyC var version = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; + if (accountSASSignatureValues.permissions && + accountSASSignatureValues.permissions.deleteVersion && + version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission."); + } + if (accountSASSignatureValues.permissions && + accountSASSignatureValues.permissions.tag && + version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission."); + } + if (accountSASSignatureValues.permissions && + accountSASSignatureValues.permissions.filter && + version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission."); + } var parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); var parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); var parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); @@ -27860,6 +33236,20 @@ var BlobSASPermissions = /** @class */ (function () { * @memberof BlobSASPermissions */ this.delete = false; + /** + * Specifies Delete version access granted. + * + * @type {boolean} + * @memberof BlobSASPermissions + */ + this.deleteVersion = false; + /** + * Specfies Tag access granted. + * + * @type {boolean} + * @memberof BlobSASPermissions + */ + this.tag = false; } /** * Creates a {@link BlobSASPermissions} from the specified permissions string. This method will throw an @@ -27890,6 +33280,12 @@ var BlobSASPermissions = /** @class */ (function () { case "d": blobSASPermissions.delete = true; break; + case "x": + blobSASPermissions.deleteVersion = true; + break; + case "t": + blobSASPermissions.tag = true; + break; default: throw new RangeError("Invalid permission: " + char); } @@ -27920,6 +33316,12 @@ var BlobSASPermissions = /** @class */ (function () { if (this.delete) { permissions.push("d"); } + if (this.deleteVersion) { + permissions.push("x"); + } + if (this.tag) { + permissions.push("t"); + } return permissions.join(""); }; return BlobSASPermissions; @@ -27974,6 +33376,13 @@ var ContainerSASPermissions = /** @class */ (function () { * @memberof ContainerSASPermissions */ this.delete = false; + /** + * Specifies Delete version access granted. + * + * @type {boolean} + * @memberof ContainerSASPermissions + */ + this.deleteVersion = false; /** * Specifies List access granted. * @@ -27981,6 +33390,13 @@ var ContainerSASPermissions = /** @class */ (function () { * @memberof ContainerSASPermissions */ this.list = false; + /** + * Specfies Tag access granted. + * + * @type {boolean} + * @memberof ContainerSASPermissions + */ + this.tag = false; } /** * Creates an {@link ContainerSASPermissions} from the specified permissions string. This method will throw an @@ -28014,6 +33430,12 @@ var ContainerSASPermissions = /** @class */ (function () { case "l": containerSASPermissions.list = true; break; + case "t": + containerSASPermissions.tag = true; + break; + case "x": + containerSASPermissions.deleteVersion = true; + break; default: throw new RangeError("Invalid permission " + char); } @@ -28047,9 +33469,15 @@ var ContainerSASPermissions = /** @class */ (function () { if (this.delete) { permissions.push("d"); } + if (this.deleteVersion) { + permissions.push("x"); + } if (this.list) { permissions.push("l"); } + if (this.tag) { + permissions.push("t"); + } return permissions.join(""); }; return ContainerSASPermissions; @@ -28105,6 +33533,7 @@ function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredent if (sharedKeyCredential === undefined && userDelegationKeyCredential === undefined) { throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); } + // Version 2019-12-12 adds support for the blob tags permission. // Version 2018-11-09 adds support for the signed resource and signed blob snapshot time fields. // https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas#constructing-the-signature-string if (version >= "2018-11-09") { @@ -28144,7 +33573,8 @@ function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredent */ function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential) { if (!blobSASSignatureValues.identifier && - !blobSASSignatureValues.permissions && !blobSASSignatureValues.expiresOn) { + !blobSASSignatureValues.permissions && + !blobSASSignatureValues.expiresOn) { throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); } var version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; @@ -28153,6 +33583,19 @@ function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKe if (blobSASSignatureValues.snapshotTime) { throw RangeError("'version' must be >= '2018-11-09' when provided 'snapshotTime'."); } + if (blobSASSignatureValues.versionId) { + throw RangeError("'version' must be >= '2019-10-10' when provided 'versionId'."); + } + if (blobSASSignatureValues.permissions && + blobSASSignatureValues.permissions.deleteVersion && + version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission."); + } + if (blobSASSignatureValues.permissions && + blobSASSignatureValues.permissions.tag && + version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission."); + } if (blobSASSignatureValues.blobName) { resource = "b"; } @@ -28207,20 +33650,42 @@ function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKe */ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential) { if (!blobSASSignatureValues.identifier && - !blobSASSignatureValues.permissions && !blobSASSignatureValues.expiresOn) { + !blobSASSignatureValues.permissions && + !blobSASSignatureValues.expiresOn) { throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); } var version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; var resource = "c"; var verifiedPermissions; + if (blobSASSignatureValues.versionId && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when provided 'versionId'."); + } + if (blobSASSignatureValues.permissions && + blobSASSignatureValues.permissions.deleteVersion && + version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission."); + } + if (blobSASSignatureValues.permissions && + blobSASSignatureValues.permissions.tag && + version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission."); + } if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.snapshotTime) { throw RangeError("Must provide 'blobName' when provided 'snapshotTime'."); } + if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.versionId) { + throw RangeError("Must provide 'blobName' when provided 'versionId'."); + } + var timestamp = blobSASSignatureValues.snapshotTime; if (blobSASSignatureValues.blobName) { resource = "b"; if (blobSASSignatureValues.snapshotTime) { resource = "bs"; } + else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp = blobSASSignatureValues.versionId; + } } // Calling parse and toString guarantees the proper ordering and throws on invalid characters. if (blobSASSignatureValues.permissions) { @@ -28246,7 +33711,7 @@ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKe blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", version, resource, - blobSASSignatureValues.snapshotTime, + timestamp, blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "", blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "", blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "", @@ -28276,16 +33741,37 @@ function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userD throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS."); } var version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; + if (blobSASSignatureValues.versionId && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when provided 'versionId'."); + } + if (blobSASSignatureValues.permissions && + blobSASSignatureValues.permissions.deleteVersion && + version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission."); + } + if (blobSASSignatureValues.permissions && + blobSASSignatureValues.permissions.tag && + version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission."); + } var resource = "c"; var verifiedPermissions; if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.snapshotTime) { throw RangeError("Must provide 'blobName' when provided 'snapshotTime'."); } + if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.versionId) { + throw RangeError("Must provide 'blobName' when provided 'versionId'."); + } + var timestamp = blobSASSignatureValues.snapshotTime; if (blobSASSignatureValues.blobName) { resource = "b"; if (blobSASSignatureValues.snapshotTime) { resource = "bs"; } + else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp = blobSASSignatureValues.versionId; + } } // Calling parse and toString guarantees the proper ordering and throws on invalid characters. if (blobSASSignatureValues.permissions) { @@ -28320,7 +33806,7 @@ function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userD blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", version, resource, - blobSASSignatureValues.snapshotTime, + timestamp, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, @@ -28411,8 +33897,16 @@ exports.newPipeline = newPipeline; /***/ }), - -/***/ 383: +/* 374 */, +/* 375 */, +/* 376 */, +/* 377 */, +/* 378 */, +/* 379 */, +/* 380 */, +/* 381 */, +/* 382 */, +/* 383 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -28508,8 +34002,16 @@ exports.Path = Path; //# sourceMappingURL=internal-path.js.map /***/ }), - -/***/ 393: +/* 384 */, +/* 385 */, +/* 386 */, +/* 387 */, +/* 388 */, +/* 389 */, +/* 390 */, +/* 391 */, +/* 392 */, +/* 393 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -30187,23 +35689,46 @@ exports.PrefixSecurityEnum = PrefixSecurityEnum; /***/ }), - -/***/ 413: +/* 394 */, +/* 395 */, +/* 396 */, +/* 397 */, +/* 398 */, +/* 399 */, +/* 400 */, +/* 401 */, +/* 402 */, +/* 403 */, +/* 404 */, +/* 405 */, +/* 406 */, +/* 407 */, +/* 408 */, +/* 409 */, +/* 410 */, +/* 411 */, +/* 412 */, +/* 413 */ /***/ (function(module, __unusedexports, __webpack_require__) { module.exports = __webpack_require__(141); /***/ }), - -/***/ 417: +/* 414 */, +/* 415 */, +/* 416 */, +/* 417 */ /***/ (function(module) { module.exports = require("crypto"); /***/ }), - -/***/ 422: +/* 418 */, +/* 419 */, +/* 420 */, +/* 421 */, +/* 422 */ /***/ (function(module) { /*! ***************************************************************************** @@ -30493,8 +36018,7 @@ var __createBinding; /***/ }), - -/***/ 423: +/* 423 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -30928,8 +36452,7 @@ var __createBinding; /***/ }), - -/***/ 424: +/* 424 */ /***/ (function(module, __unusedexports, __webpack_require__) { var iterate = __webpack_require__(157) @@ -30978,8 +36501,13 @@ function parallel(list, iterator, callback) /***/ }), - -/***/ 431: +/* 425 */, +/* 426 */, +/* 427 */, +/* 428 */, +/* 429 */, +/* 430 */, +/* 431 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -31077,8 +36605,9 @@ function escapeProperty(s) { //# sourceMappingURL=command.js.map /***/ }), - -/***/ 434: +/* 432 */, +/* 433 */, +/* 434 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -31209,14 +36738,18 @@ exports.createTar = createTar; //# sourceMappingURL=tar.js.map /***/ }), - -/***/ 440: +/* 435 */, +/* 436 */, +/* 437 */, +/* 438 */, +/* 439 */, +/* 440 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; -/*! - * Copyright 2019, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31230,35 +36763,67 @@ exports.createTar = createTar; * See the License for the specific language governing permissions and * limitations under the License. */ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; Object.defineProperty(exports, "__esModule", { value: true }); -__export(__webpack_require__(2)); -__export(__webpack_require__(744)); -__export(__webpack_require__(753)); -__export(__webpack_require__(40)); -__export(__webpack_require__(43)); -__export(__webpack_require__(625)); -__export(__webpack_require__(450)); -__export(__webpack_require__(767)); -__export(__webpack_require__(151)); -__export(__webpack_require__(162)); -__export(__webpack_require__(670)); -__export(__webpack_require__(932)); -__export(__webpack_require__(975)); -var context_base_1 = __webpack_require__(459); -exports.Context = context_base_1.Context; -const context_1 = __webpack_require__(492); +exports.propagation = exports.metrics = exports.trace = exports.context = void 0; +__exportStar(__webpack_require__(276), exports); +__exportStar(__webpack_require__(158), exports); +__exportStar(__webpack_require__(2), exports); +__exportStar(__webpack_require__(33), exports); +__exportStar(__webpack_require__(744), exports); +__exportStar(__webpack_require__(753), exports); +__exportStar(__webpack_require__(278), exports); +__exportStar(__webpack_require__(40), exports); +__exportStar(__webpack_require__(318), exports); +__exportStar(__webpack_require__(551), exports); +__exportStar(__webpack_require__(659), exports); +__exportStar(__webpack_require__(702), exports); +__exportStar(__webpack_require__(43), exports); +__exportStar(__webpack_require__(625), exports); +__exportStar(__webpack_require__(450), exports); +__exportStar(__webpack_require__(107), exports); +__exportStar(__webpack_require__(189), exports); +__exportStar(__webpack_require__(906), exports); +__exportStar(__webpack_require__(727), exports); +__exportStar(__webpack_require__(165), exports); +__exportStar(__webpack_require__(851), exports); +__exportStar(__webpack_require__(95), exports); +__exportStar(__webpack_require__(767), exports); +__exportStar(__webpack_require__(151), exports); +__exportStar(__webpack_require__(162), exports); +__exportStar(__webpack_require__(781), exports); +__exportStar(__webpack_require__(340), exports); +__exportStar(__webpack_require__(607), exports); +__exportStar(__webpack_require__(670), exports); +__exportStar(__webpack_require__(586), exports); +__exportStar(__webpack_require__(220), exports); +__exportStar(__webpack_require__(932), exports); +__exportStar(__webpack_require__(839), exports); +__exportStar(__webpack_require__(975), exports); +__exportStar(__webpack_require__(70), exports); +__exportStar(__webpack_require__(694), exports); +__exportStar(__webpack_require__(695), exports); +var context_base_1 = __webpack_require__(231); +Object.defineProperty(exports, "Context", { enumerable: true, get: function () { return context_base_1.Context; } }); +var context_1 = __webpack_require__(492); /** Entrypoint for context API */ exports.context = context_1.ContextAPI.getInstance(); -const trace_1 = __webpack_require__(875); +var trace_1 = __webpack_require__(875); /** Entrypoint for trace API */ exports.trace = trace_1.TraceAPI.getInstance(); -const metrics_1 = __webpack_require__(136); +var metrics_1 = __webpack_require__(136); /** Entrypoint for metrics API */ exports.metrics = metrics_1.MetricsAPI.getInstance(); -const propagation_1 = __webpack_require__(22); +var propagation_1 = __webpack_require__(22); /** Entrypoint for propagation API */ exports.propagation = propagation_1.PropagationAPI.getInstance(); exports.default = { @@ -31270,8 +36835,9 @@ exports.default = { //# sourceMappingURL=index.js.map /***/ }), - -/***/ 443: +/* 441 */, +/* 442 */, +/* 443 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -31298,7 +36864,7 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getInputAsInt = exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.getCacheState = exports.setOutputAndState = exports.setCacheHitOutput = exports.setCacheState = exports.isExactKeyMatch = exports.isGhes = void 0; const core = __importStar(__webpack_require__(470)); -const constants_1 = __webpack_require__(694); +const constants_1 = __webpack_require__(196); function isGhes() { const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); return ghUrl.hostname.toUpperCase() !== "GITHUB.COM"; @@ -31364,14 +36930,19 @@ exports.getInputAsInt = getInputAsInt; /***/ }), - -/***/ 450: +/* 444 */, +/* 445 */, +/* 446 */, +/* 447 */, +/* 448 */, +/* 449 */, +/* 450 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; -/*! - * Copyright 2019, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31386,23 +36957,26 @@ exports.getInputAsInt = getInputAsInt; * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const NoopMeter_1 = __webpack_require__(625); +exports.NOOP_METER_PROVIDER = exports.NoopMeterProvider = void 0; +var NoopMeter_1 = __webpack_require__(625); /** * An implementation of the {@link MeterProvider} which returns an impotent Meter * for all calls to `getMeter` */ -class NoopMeterProvider { - getMeter(_name, _version) { - return NoopMeter_1.NOOP_METER; +var NoopMeterProvider = /** @class */ (function () { + function NoopMeterProvider() { } -} + NoopMeterProvider.prototype.getMeter = function (_name, _version) { + return NoopMeter_1.NOOP_METER; + }; + return NoopMeterProvider; +}()); exports.NoopMeterProvider = NoopMeterProvider; exports.NOOP_METER_PROVIDER = new NoopMeterProvider(); //# sourceMappingURL=NoopMeterProvider.js.map /***/ }), - -/***/ 451: +/* 451 */ /***/ (function(module) { // Generated by CoffeeScript 1.12.7 @@ -31466,8 +37040,9 @@ exports.NOOP_METER_PROVIDER = new NoopMeterProvider(); /***/ }), - -/***/ 454: +/* 452 */, +/* 453 */, +/* 454 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31938,6 +37513,12 @@ function convertBody(buffer, headers) { // html4 if (!res && str) { res = / rnds8Pool.length - 16) { + _crypto.default.randomFillSync(rnds8Pool); + + poolPtr = 0; + } + + return rnds8Pool.slice(poolPtr, poolPtr += 16); } /***/ }), - -/***/ 735: +/* 734 */, +/* 735 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -38879,8 +44870,9 @@ function rng() { /***/ }), - -/***/ 738: +/* 736 */, +/* 737 */, +/* 738 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -38929,14 +44921,18 @@ function rng() { /***/ }), - -/***/ 744: +/* 739 */, +/* 740 */, +/* 741 */, +/* 742 */, +/* 743 */, +/* 744 */ /***/ (function(__unusedmodule, exports) { "use strict"; -/*! - * Copyright 2019, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38951,31 +44947,37 @@ function rng() { * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.NOOP_HTTP_TEXT_PROPAGATOR = exports.NoopHttpTextPropagator = void 0; /** * No-op implementations of {@link HttpTextPropagator}. */ -class NoopHttpTextPropagator { - /** Noop inject function does nothing */ - inject(context, carrier, setter) { } - /** Noop extract function does nothing and returns the input context */ - extract(context, carrier, getter) { - return context; +var NoopHttpTextPropagator = /** @class */ (function () { + function NoopHttpTextPropagator() { } -} + /** Noop inject function does nothing */ + NoopHttpTextPropagator.prototype.inject = function (context, carrier, setter) { }; + /** Noop extract function does nothing and returns the input context */ + NoopHttpTextPropagator.prototype.extract = function (context, carrier, getter) { + return context; + }; + return NoopHttpTextPropagator; +}()); exports.NoopHttpTextPropagator = NoopHttpTextPropagator; exports.NOOP_HTTP_TEXT_PROPAGATOR = new NoopHttpTextPropagator(); //# sourceMappingURL=NoopHttpTextPropagator.js.map /***/ }), - -/***/ 747: +/* 745 */, +/* 746 */, +/* 747 */ /***/ (function(module) { module.exports = require("fs"); /***/ }), - -/***/ 750: +/* 748 */, +/* 749 */, +/* 750 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -39251,8 +45253,7 @@ exports.isValid = function (domain) { /***/ }), - -/***/ 751: +/* 751 */ /***/ (function(module, __unusedexports, __webpack_require__) { var defer = __webpack_require__(500); @@ -39292,14 +45293,14 @@ function async(callback) /***/ }), - -/***/ 753: +/* 752 */, +/* 753 */ /***/ (function(__unusedmodule, exports) { "use strict"; -/*! - * Copyright 2020, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39314,6 +45315,7 @@ function async(callback) * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultSetter = void 0; /** * Default setter which sets value via direct property access * @@ -39327,15 +45329,58 @@ exports.defaultSetter = defaultSetter; //# sourceMappingURL=setter.js.map /***/ }), - -/***/ 761: +/* 754 */, +/* 755 */, +/* 756 */, +/* 757 */, +/* 758 */, +/* 759 */, +/* 760 */, +/* 761 */ /***/ (function(module) { module.exports = require("zlib"); /***/ }), +/* 762 */, +/* 763 */, +/* 764 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { -/***/ 766: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(__webpack_require__(102), exports); +//# sourceMappingURL=index.js.map + +/***/ }), +/* 765 */, +/* 766 */ /***/ (function(module) { // populates missing values @@ -39351,14 +45396,13 @@ module.exports = function(dst, src) { /***/ }), - -/***/ 767: +/* 767 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; -/*! - * Copyright 2019, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39373,10 +45417,11 @@ module.exports = function(dst, src) { * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const trace_flags_1 = __webpack_require__(975); +exports.NOOP_SPAN = exports.NoopSpan = exports.INVALID_SPAN_ID = exports.INVALID_TRACE_ID = void 0; +var trace_flags_1 = __webpack_require__(975); exports.INVALID_TRACE_ID = '0'; exports.INVALID_SPAN_ID = '0'; -const INVALID_SPAN_CONTEXT = { +var INVALID_SPAN_CONTEXT = { traceId: exports.INVALID_TRACE_ID, spanId: exports.INVALID_SPAN_ID, traceFlags: trace_flags_1.TraceFlags.NONE, @@ -39386,48 +45431,49 @@ const INVALID_SPAN_CONTEXT = { * implementation is available. All operations are no-op including context * propagation. */ -class NoopSpan { - constructor(_spanContext = INVALID_SPAN_CONTEXT) { +var NoopSpan = /** @class */ (function () { + function NoopSpan(_spanContext) { + if (_spanContext === void 0) { _spanContext = INVALID_SPAN_CONTEXT; } this._spanContext = _spanContext; } // Returns a SpanContext. - context() { + NoopSpan.prototype.context = function () { return this._spanContext; - } + }; // By default does nothing - setAttribute(key, value) { + NoopSpan.prototype.setAttribute = function (key, value) { return this; - } + }; // By default does nothing - setAttributes(attributes) { + NoopSpan.prototype.setAttributes = function (attributes) { return this; - } + }; // By default does nothing - addEvent(name, attributes) { + NoopSpan.prototype.addEvent = function (name, attributes) { return this; - } + }; // By default does nothing - setStatus(status) { + NoopSpan.prototype.setStatus = function (status) { return this; - } + }; // By default does nothing - updateName(name) { + NoopSpan.prototype.updateName = function (name) { return this; - } + }; // By default does nothing - end(endTime) { } + NoopSpan.prototype.end = function (endTime) { }; // isRecording always returns false for noopSpan. - isRecording() { + NoopSpan.prototype.isRecording = function () { return false; - } -} + }; + return NoopSpan; +}()); exports.NoopSpan = NoopSpan; exports.NOOP_SPAN = new NoopSpan(); //# sourceMappingURL=NoopSpan.js.map /***/ }), - -/***/ 768: +/* 768 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -39961,8 +46007,16 @@ exports.NOOP_SPAN = new NoopSpan(); /***/ }), - -/***/ 778: +/* 769 */, +/* 770 */, +/* 771 */, +/* 772 */, +/* 773 */, +/* 774 */, +/* 775 */, +/* 776 */, +/* 777 */, +/* 778 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -39998,7 +46052,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", { value: true }); const cache = __importStar(__webpack_require__(692)); const core = __importStar(__webpack_require__(470)); -const constants_1 = __webpack_require__(694); +const constants_1 = __webpack_require__(196); const utils = __importStar(__webpack_require__(443)); function run() { return __awaiter(this, void 0, void 0, function* () { @@ -40054,8 +46108,7 @@ exports.default = run; /***/ }), - -/***/ 779: +/* 779 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -40250,8 +46303,40 @@ function populateMaps (extensions, types) { /***/ }), +/* 780 */, +/* 781 */ +/***/ (function(__unusedmodule, exports) { -/***/ 790: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=Sampler.js.map + +/***/ }), +/* 782 */, +/* 783 */, +/* 784 */, +/* 785 */, +/* 786 */, +/* 787 */, +/* 788 */, +/* 789 */, +/* 790 */ /***/ (function(module, __unusedexports, __webpack_require__) { var CombinedStream = __webpack_require__(547); @@ -40751,8 +46836,7 @@ FormData.prototype.toString = function () { /***/ }), - -/***/ 791: +/* 791 */ /***/ (function(__unusedmodule, exports) { // Generated by CoffeeScript 1.12.7 @@ -40830,15 +46914,16 @@ FormData.prototype.toString = function () { /***/ }), - -/***/ 794: +/* 792 */, +/* 793 */, +/* 794 */ /***/ (function(module) { module.exports = require("stream"); /***/ }), - -/***/ 796: +/* 795 */, +/* 796 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -41142,8 +47227,11 @@ module.exports = require("stream"); /***/ }), - -/***/ 801: +/* 797 */, +/* 798 */, +/* 799 */, +/* 800 */, +/* 801 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -41204,115 +47292,20 @@ module.exports = require("stream"); /***/ }), - -/***/ 826: -/***/ (function(module, __unusedexports, __webpack_require__) { - -var rng = __webpack_require__(139); -var bytesToUuid = __webpack_require__(722); - -function v4(options, buf, offset) { - var i = buf && offset || 0; - - if (typeof(options) == 'string') { - buf = options === 'binary' ? new Array(16) : null; - options = null; - } - options = options || {}; - - var rnds = options.random || (options.rng || rng)(); - - // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - rnds[6] = (rnds[6] & 0x0f) | 0x40; - rnds[8] = (rnds[8] & 0x3f) | 0x80; - - // Copy bytes to buffer, if provided - if (buf) { - for (var ii = 0; ii < 16; ++ii) { - buf[i + ii] = rnds[ii]; - } - } - - return buf || bytesToUuid(rnds); -} - -module.exports = v4; - - -/***/ }), - -/***/ 835: -/***/ (function(module) { - -module.exports = require("url"); - -/***/ }), - -/***/ 852: -/***/ (function(module, __unusedexports, __webpack_require__) { - -/*! - * mime-db - * Copyright(c) 2014 Jonathan Ong - * MIT Licensed - */ - -/** - * Module exports. - */ - -module.exports = __webpack_require__(512) - - -/***/ }), - -/***/ 855: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _validate = _interopRequireDefault(__webpack_require__(676)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ -const byteToHex = []; - -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).substr(1)); -} - -function stringify(arr, offset = 0) { - // Note: Be careful editing this code! It's been tuned for performance - // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 - const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one - // of the following: - // - One or more input array values don't map to a hex octet (leading to - // "undefined" in the uuid) - // - Invalid input values for the RFC `version` or `variant` fields - - if (!(0, _validate.default)(uuid)) { - throw TypeError('Stringified UUID is invalid'); - } - - return uuid; -} - -var _default = stringify; -exports.default = _default; - -/***/ }), - -/***/ 865: +/* 802 */, +/* 803 */, +/* 804 */, +/* 805 */, +/* 806 */, +/* 807 */, +/* 808 */, +/* 809 */, +/* 810 */, +/* 811 */, +/* 812 */, +/* 813 */, +/* 814 */, +/* 815 */ /***/ (function(module) { /*! ***************************************************************************** @@ -41379,7 +47372,7 @@ var __createBinding; (function (exporter) { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; __extends = function (d, b) { extendStatics(d, b); @@ -41460,8 +47453,8 @@ var __createBinding; } }; - __exportStar = function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); + __exportStar = function(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); }; __createBinding = Object.create ? (function(o, m, k, k2) { @@ -41559,7 +47552,7 @@ var __createBinding; __importStar = function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -41610,14 +47603,75 @@ var __createBinding; /***/ }), +/* 816 */, +/* 817 */, +/* 818 */, +/* 819 */, +/* 820 */, +/* 821 */, +/* 822 */, +/* 823 */, +/* 824 */, +/* 825 */, +/* 826 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -/***/ 875: -/***/ (function(__unusedmodule, exports, __webpack_require__) { +var rng = __webpack_require__(139); +var bytesToUuid = __webpack_require__(722); + +function v4(options, buf, offset) { + var i = buf && offset || 0; + + if (typeof(options) == 'string') { + buf = options === 'binary' ? new Array(16) : null; + options = null; + } + options = options || {}; + + var rnds = options.random || (options.rng || rng)(); + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + + // Copy bytes to buffer, if provided + if (buf) { + for (var ii = 0; ii < 16; ++ii) { + buf[i + ii] = rnds[ii]; + } + } + + return buf || bytesToUuid(rnds); +} + +module.exports = v4; + + +/***/ }), +/* 827 */, +/* 828 */, +/* 829 */, +/* 830 */, +/* 831 */, +/* 832 */, +/* 833 */, +/* 834 */, +/* 835 */ +/***/ (function(module) { + +module.exports = require("url"); + +/***/ }), +/* 836 */, +/* 837 */, +/* 838 */, +/* 839 */ +/***/ (function(__unusedmodule, exports) { "use strict"; -/*! - * Copyright 2020, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41632,48 +47686,505 @@ var __createBinding; * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const NoopTracerProvider_1 = __webpack_require__(162); +//# sourceMappingURL=TimedEvent.js.map + +/***/ }), +/* 840 */, +/* 841 */, +/* 842 */, +/* 843 */, +/* 844 */, +/* 845 */, +/* 846 */, +/* 847 */, +/* 848 */, +/* 849 */, +/* 850 */, +/* 851 */ +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=link_context.js.map + +/***/ }), +/* 852 */ +/***/ (function(module, __unusedexports, __webpack_require__) { + +/*! + * mime-db + * Copyright(c) 2014 Jonathan Ong + * MIT Licensed + */ + +/** + * Module exports. + */ + +module.exports = __webpack_require__(512) + + +/***/ }), +/* 853 */, +/* 854 */, +/* 855 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _validate = _interopRequireDefault(__webpack_require__(676)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ +const byteToHex = []; + +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); +} + +function stringify(arr, offset = 0) { + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!(0, _validate.default)(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +var _default = stringify; +exports.default = _default; + +/***/ }), +/* 856 */, +/* 857 */, +/* 858 */, +/* 859 */, +/* 860 */, +/* 861 */, +/* 862 */, +/* 863 */, +/* 864 */, +/* 865 */ +/***/ (function(module) { + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global global, define, System, Reflect, Promise */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +var __classPrivateFieldGet; +var __classPrivateFieldSet; +var __createBinding; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if ( true && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + + __extends = function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __exportStar = function(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); + }; + + __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + }) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }; + + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + __classPrivateFieldGet = function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); + }; + + __classPrivateFieldSet = function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); +}); + + +/***/ }), +/* 866 */, +/* 867 */, +/* 868 */, +/* 869 */, +/* 870 */, +/* 871 */, +/* 872 */, +/* 873 */, +/* 874 */, +/* 875 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TraceAPI = void 0; +var NoopTracerProvider_1 = __webpack_require__(162); +var global_utils_1 = __webpack_require__(976); /** * Singleton object which represents the entry point to the OpenTelemetry Tracing API */ -class TraceAPI { +var TraceAPI = /** @class */ (function () { /** Empty private constructor prevents end users from constructing a new instance of the API */ - constructor() { - this._tracerProvider = NoopTracerProvider_1.NOOP_TRACER_PROVIDER; + function TraceAPI() { } /** Get the singleton instance of the Trace API */ - static getInstance() { + TraceAPI.getInstance = function () { if (!this._instance) { this._instance = new TraceAPI(); } return this._instance; - } + }; /** * Set the current global tracer. Returns the initialized global tracer provider */ - setGlobalTracerProvider(provider) { - this._tracerProvider = provider; - return provider; - } + TraceAPI.prototype.setGlobalTracerProvider = function (provider) { + if (global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY]) { + // global tracer provider has already been set + return this.getTracerProvider(); + } + global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY] = global_utils_1.makeGetter(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, provider, NoopTracerProvider_1.NOOP_TRACER_PROVIDER); + return this.getTracerProvider(); + }; /** * Returns the global tracer provider. */ - getTracerProvider() { - return this._tracerProvider; - } + TraceAPI.prototype.getTracerProvider = function () { + var _a, _b; + return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NoopTracerProvider_1.NOOP_TRACER_PROVIDER); + }; /** * Returns a tracer from the global tracer provider. */ - getTracer(name, version) { + TraceAPI.prototype.getTracer = function (name, version) { return this.getTracerProvider().getTracer(name, version); - } -} + }; + /** Remove the global tracer provider */ + TraceAPI.prototype.disable = function () { + delete global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY]; + }; + return TraceAPI; +}()); exports.TraceAPI = TraceAPI; //# sourceMappingURL=trace.js.map /***/ }), - -/***/ 884: +/* 876 */, +/* 877 */, +/* 878 */, +/* 879 */, +/* 880 */, +/* 881 */, +/* 882 */, +/* 883 */, +/* 884 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -41787,8 +48298,7 @@ exports.TraceAPI = TraceAPI; /***/ }), - -/***/ 885: +/* 885 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -42175,8 +48685,10 @@ exports.TraceAPI = TraceAPI; /***/ }), - -/***/ 889: +/* 886 */, +/* 887 */, +/* 888 */, +/* 889 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -42649,8 +49161,9 @@ exports.PollerStoppedError = PollerStoppedError; /***/ }), - -/***/ 892: +/* 890 */, +/* 891 */, +/* 892 */ /***/ (function(module, __unusedexports, __webpack_require__) { var iterate = __webpack_require__(157) @@ -42731,8 +49244,10 @@ function descending(a, b) /***/ }), - -/***/ 896: +/* 893 */, +/* 894 */, +/* 895 */, +/* 896 */ /***/ (function(module) { module.exports = function (xs, fn) { @@ -42751,8 +49266,8 @@ var isArray = Array.isArray || function (xs) { /***/ }), - -/***/ 898: +/* 897 */, +/* 898 */ /***/ (function(module, __unusedexports, __webpack_require__) { var v1 = __webpack_require__(86); @@ -42766,8 +49281,7 @@ module.exports = uuid; /***/ }), - -/***/ 899: +/* 899 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -42791,6 +49305,7 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(__webpack_require__(470)); const http_client_1 = __webpack_require__(539); +const constants_1 = __webpack_require__(931); function isSuccessStatusCode(statusCode) { if (!statusCode) { return false; @@ -42817,55 +49332,84 @@ function isRetryableStatusCode(statusCode) { return retryableStatusCodes.includes(statusCode); } exports.isRetryableStatusCode = isRetryableStatusCode; -function retry(name, method, getStatusCode, maxAttempts = 2) { +function sleep(milliseconds) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise(resolve => setTimeout(resolve, milliseconds)); + }); +} +function retry(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay, onError = undefined) { return __awaiter(this, void 0, void 0, function* () { - let response = undefined; - let statusCode = undefined; - let isRetryable = false; let errorMessage = ''; let attempt = 1; while (attempt <= maxAttempts) { + let response = undefined; + let statusCode = undefined; + let isRetryable = false; try { response = yield method(); + } + catch (error) { + if (onError) { + response = onError(error); + } + isRetryable = true; + errorMessage = error.message; + } + if (response) { statusCode = getStatusCode(response); if (!isServerErrorStatusCode(statusCode)) { return response; } + } + if (statusCode) { isRetryable = isRetryableStatusCode(statusCode); errorMessage = `Cache service responded with ${statusCode}`; } - catch (error) { - isRetryable = true; - errorMessage = error.message; - } core.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); if (!isRetryable) { core.debug(`${name} - Error is not retryable`); break; } + yield sleep(delay); attempt++; } throw Error(`${name} failed: ${errorMessage}`); }); } exports.retry = retry; -function retryTypedResponse(name, method, maxAttempts = 2) { +function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { return __awaiter(this, void 0, void 0, function* () { - return yield retry(name, method, (response) => response.statusCode, maxAttempts); + return yield retry(name, method, (response) => response.statusCode, maxAttempts, delay, + // If the error object contains the statusCode property, extract it and return + // an ITypedResponse so it can be processed by the retry logic. + (error) => { + if (error instanceof http_client_1.HttpClientError) { + return { + statusCode: error.statusCode, + result: null, + headers: {} + }; + } + else { + return undefined; + } + }); }); } exports.retryTypedResponse = retryTypedResponse; -function retryHttpClientResponse(name, method, maxAttempts = 2) { +function retryHttpClientResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { return __awaiter(this, void 0, void 0, function* () { - return yield retry(name, method, (response) => response.message.statusCode, maxAttempts); + return yield retry(name, method, (response) => response.message.statusCode, maxAttempts, delay); }); } exports.retryHttpClientResponse = retryHttpClientResponse; //# sourceMappingURL=requestUtils.js.map /***/ }), - -/***/ 903: +/* 900 */, +/* 901 */, +/* 902 */, +/* 903 */ /***/ (function(module) { // API @@ -42908,8 +49452,64 @@ function state(list, sortMethod) /***/ }), +/* 904 */, +/* 905 */, +/* 906 */ +/***/ (function(__unusedmodule, exports) { -/***/ 919: +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=attributes.js.map + +/***/ }), +/* 907 */, +/* 908 */, +/* 909 */, +/* 910 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(__webpack_require__(764), exports); +//# sourceMappingURL=index.js.map + +/***/ }), +/* 911 */, +/* 912 */, +/* 913 */, +/* 914 */, +/* 915 */, +/* 916 */, +/* 917 */, +/* 918 */, +/* 919 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -42951,8 +49551,10 @@ function state(list, sortMethod) /***/ }), - -/***/ 923: +/* 920 */, +/* 921 */, +/* 922 */, +/* 923 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -43189,8 +49791,57 @@ exports.Pattern = Pattern; //# sourceMappingURL=internal-pattern.js.map /***/ }), +/* 924 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { -/***/ 928: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NoopContextManager = void 0; +var context_1 = __webpack_require__(715); +var NoopContextManager = /** @class */ (function () { + function NoopContextManager() { + } + NoopContextManager.prototype.active = function () { + return context_1.Context.ROOT_CONTEXT; + }; + NoopContextManager.prototype.with = function (context, fn) { + return fn(); + }; + NoopContextManager.prototype.bind = function (target, context) { + return target; + }; + NoopContextManager.prototype.enable = function () { + return this; + }; + NoopContextManager.prototype.disable = function () { + return this; + }; + return NoopContextManager; +}()); +exports.NoopContextManager = NoopContextManager; +//# sourceMappingURL=NoopContextManager.js.map + +/***/ }), +/* 925 */, +/* 926 */, +/* 927 */, +/* 928 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -43477,8 +50128,9 @@ exports.setLogLevel = setLogLevel; /***/ }), - -/***/ 931: +/* 929 */, +/* 930 */, +/* 931 */ /***/ (function(__unusedmodule, exports) { "use strict"; @@ -43497,6 +50149,10 @@ var CompressionMethod; CompressionMethod["ZstdWithoutLong"] = "zstd-without-long"; CompressionMethod["Zstd"] = "zstd"; })(CompressionMethod = exports.CompressionMethod || (exports.CompressionMethod = {})); +// The default number of retry attempts. +exports.DefaultRetryAttempts = 2; +// The default delay in milliseconds between retry attempts. +exports.DefaultRetryDelay = 5000; // Socket timeout in milliseconds during download. If no traffic is received // over the socket during this period, the socket is destroyed and the download // is aborted. @@ -43504,28 +50160,13 @@ exports.SocketTimeout = 5000; //# sourceMappingURL=constants.js.map /***/ }), - -/***/ 932: +/* 932 */ /***/ (function(__unusedmodule, exports) { "use strict"; -/*! - * Copyright 2019, OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.CanonicalCode = void 0; /** * An enumeration of canonical status codes. */ @@ -43666,8 +50307,13 @@ var CanonicalCode; //# sourceMappingURL=status.js.map /***/ }), - -/***/ 939: +/* 933 */, +/* 934 */, +/* 935 */, +/* 936 */, +/* 937 */, +/* 938 */, +/* 939 */ /***/ (function(module, __unusedexports, __webpack_require__) { var abort = __webpack_require__(566) @@ -43702,14 +50348,22 @@ function terminator(callback) /***/ }), - -/***/ 950: -/***/ (function(__unusedmodule, exports, __webpack_require__) { +/* 940 */, +/* 941 */, +/* 942 */, +/* 943 */, +/* 944 */, +/* 945 */, +/* 946 */, +/* 947 */, +/* 948 */, +/* 949 */, +/* 950 */ +/***/ (function(__unusedmodule, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const url = __webpack_require__(835); function getProxyUrl(reqUrl) { let usingSsl = reqUrl.protocol === 'https:'; let proxyUrl; @@ -43724,7 +50378,7 @@ function getProxyUrl(reqUrl) { proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY']; } if (proxyVar) { - proxyUrl = url.parse(proxyVar); + proxyUrl = new URL(proxyVar); } return proxyUrl; } @@ -43768,8 +50422,12 @@ exports.checkBypass = checkBypass; /***/ }), - -/***/ 956: +/* 951 */, +/* 952 */, +/* 953 */, +/* 954 */, +/* 955 */, +/* 956 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -43806,8 +50464,22 @@ exports.checkBypass = checkBypass; /***/ }), - -/***/ 972: +/* 957 */, +/* 958 */, +/* 959 */, +/* 960 */, +/* 961 */, +/* 962 */, +/* 963 */, +/* 964 */, +/* 965 */, +/* 966 */, +/* 967 */, +/* 968 */, +/* 969 */, +/* 970 */, +/* 971 */, +/* 972 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -43988,14 +50660,47 @@ exports.safeTrimTrailingSeparator = safeTrimTrailingSeparator; //# sourceMappingURL=internal-path-helper.js.map /***/ }), - -/***/ 975: +/* 973 */, +/* 974 */, +/* 975 */ /***/ (function(__unusedmodule, exports) { "use strict"; -/*! - * Copyright 2019, OpenTelemetry Authors +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TraceFlags = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var TraceFlags; +(function (TraceFlags) { + /** Represents no flag set. */ + TraceFlags[TraceFlags["NONE"] = 0] = "NONE"; + /** Bit to represent whether trace is sampled in trace flags. */ + TraceFlags[TraceFlags["SAMPLED"] = 1] = "SAMPLED"; +})(TraceFlags = exports.TraceFlags || (exports.TraceFlags = {})); +//# sourceMappingURL=trace_flags.js.map + +/***/ }), +/* 976 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44010,23 +50715,48 @@ exports.safeTrimTrailingSeparator = safeTrimTrailingSeparator; * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.API_BACKWARDS_COMPATIBILITY_VERSION = exports.makeGetter = exports._global = exports.GLOBAL_TRACE_API_KEY = exports.GLOBAL_PROPAGATION_API_KEY = exports.GLOBAL_METRICS_API_KEY = exports.GLOBAL_CONTEXT_MANAGER_API_KEY = void 0; +var platform_1 = __webpack_require__(910); +exports.GLOBAL_CONTEXT_MANAGER_API_KEY = Symbol.for('io.opentelemetry.js.api.context'); +exports.GLOBAL_METRICS_API_KEY = Symbol.for('io.opentelemetry.js.api.metrics'); +exports.GLOBAL_PROPAGATION_API_KEY = Symbol.for('io.opentelemetry.js.api.propagation'); +exports.GLOBAL_TRACE_API_KEY = Symbol.for('io.opentelemetry.js.api.trace'); +exports._global = platform_1._globalThis; /** - * An enumeration that represents global trace flags. These flags are - * propagated to all child {@link Span}. These determine features such as - * whether a Span should be traced. It is implemented as a bitmask. + * Make a function which accepts a version integer and returns the instance of an API if the version + * is compatible, or a fallback version (usually NOOP) if it is not. + * + * @param requiredVersion Backwards compatibility version which is required to return the instance + * @param instance Instance which should be returned if the required version is compatible + * @param fallback Fallback instance, usually NOOP, which will be returned if the required version is not compatible */ -var TraceFlags; -(function (TraceFlags) { - /** Represents no flag set. */ - TraceFlags[TraceFlags["NONE"] = 0] = "NONE"; - /** Bit to represent whether trace is sampled in trace flags. */ - TraceFlags[TraceFlags["SAMPLED"] = 1] = "SAMPLED"; -})(TraceFlags = exports.TraceFlags || (exports.TraceFlags = {})); -//# sourceMappingURL=trace_flags.js.map +function makeGetter(requiredVersion, instance, fallback) { + return function (version) { + return version === requiredVersion ? instance : fallback; + }; +} +exports.makeGetter = makeGetter; +/** + * A number which should be incremented each time a backwards incompatible + * change is made to the API. This number is used when an API package + * attempts to access the global API to ensure it is getting a compatible + * version. If the global API is not compatible with the API package + * attempting to get it, a NOOP API implementation will be returned. + */ +exports.API_BACKWARDS_COMPATIBILITY_VERSION = 0; +//# sourceMappingURL=global-utils.js.map /***/ }), - -/***/ 986: +/* 977 */, +/* 978 */, +/* 979 */, +/* 980 */, +/* 981 */, +/* 982 */, +/* 983 */, +/* 984 */, +/* 985 */, +/* 986 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -44076,8 +50806,12 @@ exports.exec = exec; //# sourceMappingURL=exec.js.map /***/ }), - -/***/ 992: +/* 987 */, +/* 988 */, +/* 989 */, +/* 990 */, +/* 991 */, +/* 992 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -44122,8 +50856,13 @@ exports.exec = exec; /***/ }), - -/***/ 999: +/* 993 */, +/* 994 */, +/* 995 */, +/* 996 */, +/* 997 */, +/* 998 */, +/* 999 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -44133,8 +50872,8 @@ Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var uuid = __webpack_require__(585); var tslib = __webpack_require__(865); +var uuid = __webpack_require__(585); var tough = __webpack_require__(393); var http = __webpack_require__(605); var https = __webpack_require__(211); @@ -44325,7 +51064,7 @@ var Constants = { * @const * @type {string} */ - coreHttpVersion: "1.1.5", + coreHttpVersion: "1.1.9", /** * Specifies HTTP. * @@ -44354,6 +51093,20 @@ var Constants = { * @type {string} */ HTTPS_PROXY: "HTTPS_PROXY", + /** + * Specifies NO Proxy. + * + * @const + * @type {string} + */ + NO_PROXY: "NO_PROXY", + /** + * Specifies ALL Proxy. + * + * @const + * @type {string} + */ + ALL_PROXY: "ALL_PROXY", HttpConstants: { /** * Http Verbs @@ -44544,12 +51297,15 @@ function promiseToServiceCallback(promise) { }); }; } -function prepareXMLRootList(obj, elementName) { - var _a; +function prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { + var _a, _b, _c; if (!Array.isArray(obj)) { obj = [obj]; } - return _a = {}, _a[elementName] = obj, _a; + if (!xmlNamespaceKey || !xmlNamespace) { + return _a = {}, _a[elementName] = obj, _a; + } + return _b = {}, _b[elementName] = obj, _b.$ = (_c = {}, _c[xmlNamespaceKey] = xmlNamespace, _c), _b; } /** * Applies the properties on the prototype of sourceCtors to the prototype of targetCtor @@ -44591,6 +51347,15 @@ function replaceAll(value, searchValue, replaceValue) { function isPrimitiveType(value) { return (typeof value !== "object" && typeof value !== "function") || value === null; } +function getEnvironmentValue(name) { + if (process.env[name]) { + return process.env[name]; + } + else if (process.env[name.toLowerCase()]) { + return process.env[name.toLowerCase()]; + } + return undefined; +} // Copyright (c) Microsoft Corporation. var Serializer = /** @class */ (function () { @@ -44712,13 +51477,13 @@ var Serializer = /** @class */ (function () { payload = serializeBase64UrlType(objectName, object); } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName); + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML)); } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName); + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML)); } else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, objectName); + payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML)); } } return payload; @@ -44992,7 +51757,8 @@ function serializeDateTypes(typeName, value, objectName) { } return value; } -function serializeSequenceType(serializer, mapper, object, objectName) { +function serializeSequenceType(serializer, mapper, object, objectName, isXml) { + var _a, _b; if (!Array.isArray(object)) { throw new Error(objectName + " must be of type Array."); } @@ -45003,11 +51769,26 @@ function serializeSequenceType(serializer, mapper, object, objectName) { } var tempArray = []; for (var i = 0; i < object.length; i++) { - tempArray[i] = serializer.serialize(elementType, object[i], objectName); + var serializedValue = serializer.serialize(elementType, object[i], objectName); + if (isXml && elementType.xmlNamespace) { + var xmlnsKey = elementType.xmlNamespacePrefix + ? "xmlns:" + elementType.xmlNamespacePrefix + : "xmlns"; + if (elementType.type.name === "Composite") { + tempArray[i] = tslib.__assign(tslib.__assign({}, serializedValue), { $: (_a = {}, _a[xmlnsKey] = elementType.xmlNamespace, _a) }); + } + else { + tempArray[i] = { _: serializedValue, $: (_b = {}, _b[xmlnsKey] = elementType.xmlNamespace, _b) }; + } + } + else { + tempArray[i] = serializedValue; + } } return tempArray; } -function serializeDictionaryType(serializer, mapper, object, objectName) { +function serializeDictionaryType(serializer, mapper, object, objectName, isXml) { + var _a; if (typeof object !== "object") { throw new Error(objectName + " must be of type object."); } @@ -45017,12 +51798,46 @@ function serializeDictionaryType(serializer, mapper, object, objectName) { ("mapper and it must of type \"object\" in " + objectName + ".")); } var tempDictionary = {}; - for (var _i = 0, _a = Object.keys(object); _i < _a.length; _i++) { - var key = _a[_i]; - tempDictionary[key] = serializer.serialize(valueType, object[key], objectName + "." + key); + for (var _i = 0, _b = Object.keys(object); _i < _b.length; _i++) { + var key = _b[_i]; + var serializedValue = serializer.serialize(valueType, object[key], objectName); + // If the element needs an XML namespace we need to add it within the $ property + tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml); + } + // Add the namespace to the root element if needed + if (isXml && mapper.xmlNamespace) { + var xmlnsKey = mapper.xmlNamespacePrefix ? "xmlns:" + mapper.xmlNamespacePrefix : "xmlns"; + return tslib.__assign(tslib.__assign({}, tempDictionary), { $: (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a) }); } return tempDictionary; } +/** + * Resolves the additionalProperties property from a referenced mapper + * @param serializer the serializer containing the entire set of mappers + * @param mapper the composite mapper to resolve + * @param objectName name of the object being serialized + */ +function resolveAdditionalProperties(serializer, mapper, objectName) { + var additionalProperties = mapper.type.additionalProperties; + if (!additionalProperties && mapper.type.className) { + var modelMapper = resolveReferencedMapper(serializer, mapper, objectName); + return modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; + } + return additionalProperties; +} +/** + * Finds the mapper referenced by className + * @param serializer the serializer containing the entire set of mappers + * @param mapper the composite mapper to resolve + * @param objectName name of the object being serialized + */ +function resolveReferencedMapper(serializer, mapper, objectName) { + var className = mapper.type.className; + if (!className) { + throw new Error("Class name for model \"" + objectName + "\" is not provided in the mapper \"" + JSON.stringify(mapper, undefined, 2) + "\"."); + } + return serializer.modelMappers[className]; +} /** * Resolves a composite mapper's modelProperties. * @param serializer the serializer containing the entire set of mappers @@ -45031,32 +51846,28 @@ function serializeDictionaryType(serializer, mapper, object, objectName) { function resolveModelProperties(serializer, mapper, objectName) { var modelProps = mapper.type.modelProperties; if (!modelProps) { - var className = mapper.type.className; - if (!className) { - throw new Error("Class name for model \"" + objectName + "\" is not provided in the mapper \"" + JSON.stringify(mapper, undefined, 2) + "\"."); - } - var modelMapper = serializer.modelMappers[className]; + var modelMapper = resolveReferencedMapper(serializer, mapper, objectName); if (!modelMapper) { - throw new Error("mapper() cannot be null or undefined for model \"" + className + "\"."); + throw new Error("mapper() cannot be null or undefined for model \"" + mapper.type.className + "\"."); } - modelProps = modelMapper.type.modelProperties; + modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.modelProperties; if (!modelProps) { throw new Error("modelProperties cannot be null or undefined in the " + - ("mapper \"" + JSON.stringify(modelMapper) + "\" of type \"" + className + "\" for object \"" + objectName + "\".")); + ("mapper \"" + JSON.stringify(modelMapper) + "\" of type \"" + mapper.type.className + "\" for object \"" + objectName + "\".")); } } return modelProps; } -function serializeCompositeType(serializer, mapper, object, objectName) { - var _a; +function serializeCompositeType(serializer, mapper, object, objectName, isXml) { + var _a, _b; if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); } if (object != undefined) { var payload = {}; var modelProps = resolveModelProperties(serializer, mapper, objectName); - for (var _i = 0, _b = Object.keys(modelProps); _i < _b.length; _i++) { - var key = _b[_i]; + for (var _i = 0, _c = Object.keys(modelProps); _i < _c.length; _i++) { + var key = _c[_i]; var propertyMapper = modelProps[key]; if (propertyMapper.readOnly) { continue; @@ -45074,8 +51885,8 @@ function serializeCompositeType(serializer, mapper, object, objectName) { else { var paths = splitSerializeName(propertyMapper.serializedName); propName = paths.pop(); - for (var _c = 0, paths_1 = paths; _c < paths_1.length; _c++) { - var pathName = paths_1[_c]; + for (var _d = 0, paths_1 = paths; _d < paths_1.length; _d++) { + var pathName = paths_1[_d]; var childObject = parentObject[pathName]; if (childObject == undefined && (object[key] != undefined || propertyMapper.defaultValue !== undefined)) { @@ -45085,6 +51896,12 @@ function serializeCompositeType(serializer, mapper, object, objectName) { } } if (parentObject != undefined) { + if (isXml && mapper.xmlNamespace) { + var xmlnsKey = mapper.xmlNamespacePrefix + ? "xmlns:" + mapper.xmlNamespacePrefix + : "xmlns"; + parentObject.$ = tslib.__assign(tslib.__assign({}, parentObject.$), (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a)); + } var propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; @@ -45097,23 +51914,24 @@ function serializeCompositeType(serializer, mapper, object, objectName) { } var serializedValue = serializer.serialize(propertyMapper, toSerialize, propertyObjectName); if (serializedValue !== undefined && propName != undefined) { - if (propertyMapper.xmlIsAttribute) { + var value = getXmlObjectValue(propertyMapper, serializedValue, isXml); + if (isXml && propertyMapper.xmlIsAttribute) { // $ is the key attributes are kept under in xml2js. // This keeps things simple while preventing name collision // with names in user documents. parentObject.$ = parentObject.$ || {}; parentObject.$[propName] = serializedValue; } - else if (propertyMapper.xmlIsWrapped) { - parentObject[propName] = (_a = {}, _a[propertyMapper.xmlElementName] = serializedValue, _a); + else if (isXml && propertyMapper.xmlIsWrapped) { + parentObject[propName] = (_b = {}, _b[propertyMapper.xmlElementName] = value, _b); } else { - parentObject[propName] = serializedValue; + parentObject[propName] = value; } } } } - var additionalPropertiesMapper = mapper.type.additionalProperties; + var additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); if (additionalPropertiesMapper) { var propNames = Object.keys(modelProps); var _loop_1 = function (clientPropName) { @@ -45130,18 +51948,33 @@ function serializeCompositeType(serializer, mapper, object, objectName) { } return object; } +function getXmlObjectValue(propertyMapper, serializedValue, isXml) { + var _a; + if (!isXml || !propertyMapper.xmlNamespace) { + return serializedValue; + } + var xmlnsKey = propertyMapper.xmlNamespacePrefix + ? "xmlns:" + propertyMapper.xmlNamespacePrefix + : "xmlns"; + var xmlNamespace = (_a = {}, _a[xmlnsKey] = propertyMapper.xmlNamespace, _a); + if (["Composite"].includes(propertyMapper.type.name)) { + return tslib.__assign({ $: xmlNamespace }, serializedValue); + } + return { _: serializedValue, $: xmlNamespace }; +} function isSpecialXmlProperty(propertyName) { return ["$", "_"].includes(propertyName); } function deserializeCompositeType(serializer, mapper, responseBody, objectName) { + var _a; if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); } var modelProps = resolveModelProperties(serializer, mapper, objectName); var instance = {}; var handledPropertyNames = []; - for (var _i = 0, _a = Object.keys(modelProps); _i < _a.length; _i++) { - var key = _a[_i]; + for (var _i = 0, _b = Object.keys(modelProps); _i < _b.length; _i++) { + var key = _b[_i]; var propertyMapper = modelProps[key]; var paths = splitSerializeName(modelProps[key].serializedName); handledPropertyNames.push(paths[0]); @@ -45153,8 +51986,8 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName) var headerCollectionPrefix = propertyMapper.headerCollectionPrefix; if (headerCollectionPrefix) { var dictionary = {}; - for (var _b = 0, _c = Object.keys(responseBody); _b < _c.length; _b++) { - var headerKey = _c[_b]; + for (var _c = 0, _d = Object.keys(responseBody); _c < _d.length; _c++) { + var headerKey = _d[_c]; if (headerKey.startsWith(headerCollectionPrefix)) { dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer.deserialize(propertyMapper.type.value, responseBody[headerKey], propertyObjectName); } @@ -45168,16 +52001,29 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName) } else { var propertyName = xmlElementName || xmlName || serializedName; - var unwrappedProperty = responseBody[propertyName]; if (propertyMapper.xmlIsWrapped) { - unwrappedProperty = responseBody[xmlName]; - unwrappedProperty = unwrappedProperty && unwrappedProperty[xmlElementName]; - var isEmptyWrappedList = unwrappedProperty === undefined; - if (isEmptyWrappedList) { - unwrappedProperty = []; - } + /* a list of wrapped by + For the xml example below + + ... + ... + + the responseBody has + { + Cors: { + CorsRule: [{...}, {...}] + } + } + xmlName is "Cors" and xmlElementName is"CorsRule". + */ + var wrapped = responseBody[xmlName]; + var elementList = (_a = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _a !== void 0 ? _a : []; + instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName); + } + else { + var property = responseBody[propertyName]; + instance[key] = serializer.deserialize(propertyMapper, property, propertyObjectName); } - instance[key] = serializer.deserialize(propertyMapper, unwrappedProperty, propertyObjectName); } } else { @@ -45185,8 +52031,8 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName) var propertyInstance = void 0; var res = responseBody; // traversing the object step by step. - for (var _d = 0, paths_2 = paths; _d < paths_2.length; _d++) { - var item = paths_2[_d]; + for (var _e = 0, paths_2 = paths; _e < paths_2.length; _e++) { + var item = paths_2[_e]; if (!res) break; res = res[item]; @@ -45237,8 +52083,8 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName) } } else if (responseBody) { - for (var _e = 0, _f = Object.keys(responseBody); _e < _f.length; _e++) { - var key = _f[_e]; + for (var _f = 0, _g = Object.keys(responseBody); _f < _g.length; _f++) { + var key = _g[_f]; if (instance[key] === undefined && !handledPropertyNames.includes(key) && !isSpecialXmlProperty(key)) { @@ -45731,11 +52577,6 @@ var URLQuery = /** @class */ (function () { break; case "ParameterValue": switch (currentCharacter) { - case "=": - parameterName = ""; - parameterValue = ""; - currentState = "Invalid"; - break; case "&": result.set(parameterName, parameterValue); parameterName = ""; @@ -45747,11 +52588,6 @@ var URLQuery = /** @class */ (function () { break; } break; - case "Invalid": - if (currentCharacter === "&") { - currentState = "ParameterName"; - } - break; default: throw new Error("Unrecognized URLQuery parse state: " + currentState); } @@ -47759,6 +54595,65 @@ var ExpiringAccessTokenCache = /** @class */ (function () { return ExpiringAccessTokenCache; }()); +// Copyright (c) Microsoft Corporation. +/** + * Helps the core-http token authentication policies with requesting a new token if we're not currently waiting for a new token. + */ +var AccessTokenRefresher = /** @class */ (function () { + function AccessTokenRefresher(credential, scopes, requiredMillisecondsBeforeNewRefresh) { + if (requiredMillisecondsBeforeNewRefresh === void 0) { requiredMillisecondsBeforeNewRefresh = 30000; } + this.credential = credential; + this.scopes = scopes; + this.requiredMillisecondsBeforeNewRefresh = requiredMillisecondsBeforeNewRefresh; + this.lastCalled = 0; + } + /** + * Returns true if the required milliseconds(defaulted to 30000) have been passed signifying + * that we are ready for a new refresh. + * + * @returns {boolean} + */ + AccessTokenRefresher.prototype.isReady = function () { + // We're only ready for a new refresh if the required milliseconds have passed. + return (!this.lastCalled || Date.now() - this.lastCalled > this.requiredMillisecondsBeforeNewRefresh); + }; + /** + * Stores the time in which it is called, + * then requests a new token, + * then sets this.promise to undefined, + * then returns the token. + * @param options getToken options + */ + AccessTokenRefresher.prototype.getToken = function (options) { + return tslib.__awaiter(this, void 0, void 0, function () { + var token; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + this.lastCalled = Date.now(); + return [4 /*yield*/, this.credential.getToken(this.scopes, options)]; + case 1: + token = _a.sent(); + this.promise = undefined; + return [2 /*return*/, token || undefined]; + } + }); + }); + }; + /** + * Requests a new token if we're not currently waiting for a new token. + * Returns null if the required time between each call hasn't been reached. + * @param options getToken options + */ + AccessTokenRefresher.prototype.refresh = function (options) { + if (!this.promise) { + this.promise = this.getToken(options); + } + return this.promise; + }; + return AccessTokenRefresher; +}()); + // Copyright (c) Microsoft Corporation. /** * Creates a new BearerTokenAuthenticationPolicy factory. @@ -47768,12 +54663,19 @@ var ExpiringAccessTokenCache = /** @class */ (function () { */ function bearerTokenAuthenticationPolicy(credential, scopes) { var tokenCache = new ExpiringAccessTokenCache(); + var tokenRefresher = new AccessTokenRefresher(credential, scopes, timeBetweenRefreshAttemptsInMs); return { create: function (nextPolicy, options) { - return new BearerTokenAuthenticationPolicy(nextPolicy, options, credential, scopes, tokenCache); + return new BearerTokenAuthenticationPolicy(nextPolicy, options, tokenCache, tokenRefresher); } }; } +/** + * The automated token refresh will only start to happen at the + * expiration date minus the value of timeBetweenRefreshAttemptsInMs, + * which is by default 30 seconds. + */ +var timeBetweenRefreshAttemptsInMs = 30000; /** * * Provides a RequestPolicy that can request a token from a TokenCredential @@ -47792,11 +54694,10 @@ var BearerTokenAuthenticationPolicy = /** @class */ (function (_super) { * @param scopes The scopes for which the bearer token applies. * @param tokenCache The cache for the most recent AccessToken returned from the TokenCredential. */ - function BearerTokenAuthenticationPolicy(nextPolicy, options, credential, scopes, tokenCache) { + function BearerTokenAuthenticationPolicy(nextPolicy, options, tokenCache, tokenRefresher) { var _this = _super.call(this, nextPolicy, options) || this; - _this.credential = credential; - _this.scopes = scopes; _this.tokenCache = tokenCache; + _this.tokenRefresher = tokenRefresher; return _this; } /** @@ -47825,6 +54726,26 @@ var BearerTokenAuthenticationPolicy = /** @class */ (function (_super) { }); }); }; + /** + * Attempts a token update if any other time related conditionals have been reached based on the tokenRefresher class. + */ + BearerTokenAuthenticationPolicy.prototype.updateTokenIfNeeded = function (options) { + return tslib.__awaiter(this, void 0, void 0, function () { + var accessToken; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!this.tokenRefresher.isReady()) return [3 /*break*/, 2]; + return [4 /*yield*/, this.tokenRefresher.refresh(options)]; + case 1: + accessToken = _a.sent(); + this.tokenCache.setCachedToken(accessToken); + _a.label = 2; + case 2: return [2 /*return*/]; + } + }); + }); + }; BearerTokenAuthenticationPolicy.prototype.getToken = function (options) { return tslib.__awaiter(this, void 0, void 0, function () { var accessToken; @@ -47833,12 +54754,20 @@ var BearerTokenAuthenticationPolicy = /** @class */ (function (_super) { case 0: accessToken = this.tokenCache.getCachedToken(); if (!(accessToken === undefined)) return [3 /*break*/, 2]; - return [4 /*yield*/, this.credential.getToken(this.scopes, options)]; + return [4 /*yield*/, this.tokenRefresher.refresh(options)]; case 1: - accessToken = (_a.sent()) || undefined; + // Waiting for the next refresh only if the cache is unable to retrieve the access token, + // which means that it has expired, or it has never been set. + accessToken = _a.sent(); this.tokenCache.setCachedToken(accessToken); - _a.label = 2; - case 2: return [2 /*return*/, accessToken ? accessToken.token : undefined]; + return [3 /*break*/, 3]; + case 2: + // If we still have a cached access token, + // And any other time related conditionals have been reached based on the tokenRefresher class, + // then attempt to refresh without waiting. + this.updateTokenIfNeeded(options); + _a.label = 3; + case 3: return [2 /*return*/, accessToken ? accessToken.token : undefined]; } }); }); @@ -47939,23 +54868,57 @@ function retry$1(policy, request, operationResponse, err, retryData) { })(exports.QueryCollectionFormat || (exports.QueryCollectionFormat = {})); // Copyright (c) Microsoft Corporation. +var noProxyList = []; +var isNoProxyInitalized = false; +var byPassedList = new Map(); function loadEnvironmentProxyValue() { if (!process) { return undefined; } - if (process.env[Constants.HTTPS_PROXY]) { - return process.env[Constants.HTTPS_PROXY]; + var httpsProxy = getEnvironmentValue(Constants.HTTPS_PROXY); + var allProxy = getEnvironmentValue(Constants.ALL_PROXY); + var httpProxy = getEnvironmentValue(Constants.HTTP_PROXY); + return httpsProxy || allProxy || httpProxy; +} +// Check whether the given `uri` matches the noProxyList. If it matches, any request sent to that same `uri` won't set the proxy settings. +function isBypassed(uri) { + if (byPassedList.has(uri)) { + return byPassedList.get(uri); } - else if (process.env[Constants.HTTPS_PROXY.toLowerCase()]) { - return process.env[Constants.HTTPS_PROXY.toLowerCase()]; + loadNoProxy(); + var isBypassed = false; + var host = URLBuilder.parse(uri).getHost(); + for (var _i = 0, noProxyList_1 = noProxyList; _i < noProxyList_1.length; _i++) { + var proxyString = noProxyList_1[_i]; + if (proxyString[0] === ".") { + if (uri.endsWith(proxyString)) { + isBypassed = true; + } + else { + if (host === proxyString.slice(1) && host.length === proxyString.length - 1) { + isBypassed = true; + } + } + } + else { + if (host === proxyString) { + isBypassed = true; + } + } } - else if (process.env[Constants.HTTP_PROXY]) { - return process.env[Constants.HTTP_PROXY]; + byPassedList.set(uri, isBypassed); + return isBypassed; +} +function loadNoProxy() { + if (isNoProxyInitalized) { + return; } - else if (process.env[Constants.HTTP_PROXY.toLowerCase()]) { - return process.env[Constants.HTTP_PROXY.toLowerCase()]; + var noProxy = getEnvironmentValue(Constants.NO_PROXY); + if (noProxy) { + var list = noProxy.split(","); + noProxyList = list.map(function (item) { return item.trim(); }).filter(function (item) { return item.length; }); } - return undefined; + isNoProxyInitalized = true; } function getDefaultProxySettings(proxyUrl) { if (!proxyUrl) { @@ -48011,7 +54974,7 @@ var ProxyPolicy = /** @class */ (function (_super) { return _this; } ProxyPolicy.prototype.sendRequest = function (request) { - if (!request.proxySettings) { + if (!request.proxySettings && !isBypassed(request.url)) { request.proxySettings = this.proxySettings; } return this._nextPolicy.sendRequest(request); @@ -48286,6 +55249,51 @@ var DisableResponseDecompressionPolicy = /** @class */ (function (_super) { return DisableResponseDecompressionPolicy; }(BaseRequestPolicy)); +// Copyright (c) Microsoft Corporation. +function ndJsonPolicy() { + return { + create: function (nextPolicy, options) { + return new NdJsonPolicy(nextPolicy, options); + } + }; +} +/** + * NdJsonPolicy that formats a JSON array as newline-delimited JSON + */ +var NdJsonPolicy = /** @class */ (function (_super) { + tslib.__extends(NdJsonPolicy, _super); + /** + * Creates an instance of KeepAlivePolicy. + * + * @param nextPolicy + * @param options + */ + function NdJsonPolicy(nextPolicy, options) { + return _super.call(this, nextPolicy, options) || this; + } + /** + * Sends a request. + * + * @param request + */ + NdJsonPolicy.prototype.sendRequest = function (request) { + return tslib.__awaiter(this, void 0, void 0, function () { + var body; + return tslib.__generator(this, function (_a) { + // There currently isn't a good way to bypass the serializer + if (typeof request.body === "string" && request.body.startsWith("[")) { + body = JSON.parse(request.body); + if (Array.isArray(body)) { + request.body = body.map(function (item) { return JSON.stringify(item) + "\n"; }).join(""); + } + } + return [2 /*return*/, this._nextPolicy.sendRequest(request)]; + }); + }); + }; + return NdJsonPolicy; +}(BaseRequestPolicy)); + // Copyright (c) Microsoft Corporation. /** * @class @@ -48583,7 +55591,7 @@ function serializeRequestBody(serviceClient, httpRequest, operationArguments, op if (operationSpec.requestBody && operationSpec.requestBody.mapper) { httpRequest.body = getOperationArgumentValueFromParameter(serviceClient, operationArguments, operationSpec.requestBody, operationSpec.serializer); var bodyMapper = operationSpec.requestBody.mapper; - var required = bodyMapper.required, xmlName = bodyMapper.xmlName, xmlElementName = bodyMapper.xmlElementName, serializedName = bodyMapper.serializedName; + var required = bodyMapper.required, xmlName = bodyMapper.xmlName, xmlElementName = bodyMapper.xmlElementName, serializedName = bodyMapper.serializedName, xmlNamespace = bodyMapper.xmlNamespace, xmlNamespacePrefix = bodyMapper.xmlNamespacePrefix; var typeName = bodyMapper.type.name; try { if ((httpRequest.body !== undefined && httpRequest.body !== null) || required) { @@ -48591,11 +55599,13 @@ function serializeRequestBody(serviceClient, httpRequest, operationArguments, op httpRequest.body = operationSpec.serializer.serialize(bodyMapper, httpRequest.body, requestBodyParameterPathString); var isStream = typeName === MapperType.Stream; if (operationSpec.isXML) { + var xmlnsKey = xmlNamespacePrefix ? "xmlns:" + xmlNamespacePrefix : "xmlns"; + var value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, httpRequest.body); if (typeName === MapperType.Sequence) { - httpRequest.body = stringifyXML(prepareXMLRootList(httpRequest.body, xmlElementName || xmlName || serializedName), { rootName: xmlName || serializedName }); + httpRequest.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName }); } else if (!isStream) { - httpRequest.body = stringifyXML(httpRequest.body, { + httpRequest.body = stringifyXML(value, { rootName: xmlName || serializedName }); } @@ -48627,6 +55637,18 @@ function serializeRequestBody(serviceClient, httpRequest, operationArguments, op } } } +/** + * Adds an xml namespace to the xml serialized object if needed, otherwise it just returns the value itself + */ +function getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue) { + var _a; + // Composite and Sequence schemas already got their root namespace set during serialization + // We just need to add xmlns to the other schema types + if (xmlNamespace && !["Composite", "Sequence", "Dictionary"].includes(typeName)) { + return { _: serializedValue, $: (_a = {}, _a[xmlnsKey] = xmlNamespace, _a) }; + } + return serializedValue; +} function getValueOrFunctionResult(value, defaultValueCreator) { var result; if (typeof value === "string") { @@ -48669,6 +55691,9 @@ function createDefaultRequestPolicyFactories(authPolicyFactory, options) { } function createPipelineFromOptions(pipelineOptions, authPolicyFactory) { var requestPolicyFactories = []; + if (pipelineOptions.sendStreamingJson) { + requestPolicyFactories.push(ndJsonPolicy()); + } var userAgentValue = undefined; if (pipelineOptions.userAgentOptions && pipelineOptions.userAgentOptions.userAgentPrefix) { var userAgentInfo = []; @@ -48947,16 +55972,14 @@ Object.defineProperty(exports, 'isTokenCredential', { return coreAuth.isTokenCredential; } }); +exports.AccessTokenRefresher = AccessTokenRefresher; exports.ApiKeyCredentials = ApiKeyCredentials; exports.BaseRequestPolicy = BaseRequestPolicy; exports.BasicAuthenticationCredentials = BasicAuthenticationCredentials; -exports.BearerTokenAuthenticationPolicy = BearerTokenAuthenticationPolicy; exports.Constants = Constants; exports.DefaultHttpClient = NodeFetchHttpClient; -exports.DisableResponseDecompressionPolicy = DisableResponseDecompressionPolicy; exports.ExpiringAccessTokenCache = ExpiringAccessTokenCache; exports.HttpHeaders = HttpHeaders; -exports.KeepAlivePolicy = KeepAlivePolicy; exports.MapperType = MapperType; exports.RequestPolicyOptions = RequestPolicyOptions; exports.RestError = RestError; @@ -49005,5 +56028,4 @@ exports.userAgentPolicy = userAgentPolicy; /***/ }) - -/******/ }); \ No newline at end of file +/******/ ]); \ No newline at end of file diff --git a/dist/save/index.js b/dist/save/index.js index dda81de..71a8dcd 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -41,9 +41,9 @@ module.exports = /******/ return startup(); /******/ }) /************************************************************************/ -/******/ ({ - -/***/ 1: +/******/ ([ +/* 0 */, +/* 1 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -339,14 +339,13 @@ function copyFile(srcFile, destFile, force) { //# sourceMappingURL=io.js.map /***/ }), - -/***/ 2: +/* 2 */ /***/ (function(__unusedmodule, exports) { "use strict"; -/*! - * Copyright 2020, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -361,6 +360,7 @@ function copyFile(srcFile, destFile, force) { * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultGetter = void 0; /** * Default getter which just does a simple property access. Returns * undefined if the key is not set. @@ -375,8 +375,13 @@ exports.defaultGetter = defaultGetter; //# sourceMappingURL=getter.js.map /***/ }), - -/***/ 9: +/* 3 */, +/* 4 */, +/* 5 */, +/* 6 */, +/* 7 */, +/* 8 */, +/* 9 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -982,8 +987,12 @@ class ExecState extends events.EventEmitter { //# sourceMappingURL=toolrunner.js.map /***/ }), - -/***/ 15: +/* 10 */, +/* 11 */, +/* 12 */, +/* 13 */, +/* 14 */, +/* 15 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -1157,23 +1166,21 @@ exports.assertDefined = assertDefined; //# sourceMappingURL=cacheUtils.js.map /***/ }), - -/***/ 16: +/* 16 */ /***/ (function(module) { module.exports = require("tls"); /***/ }), - -/***/ 18: +/* 17 */, +/* 18 */ /***/ (function() { eval("require")("encoding"); /***/ }), - -/***/ 19: +/* 19 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -1231,14 +1238,15 @@ eval("require")("encoding"); /***/ }), - -/***/ 22: +/* 20 */, +/* 21 */, +/* 22 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; -/*! - * Copyright 2020, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1253,33 +1261,38 @@ eval("require")("encoding"); * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const getter_1 = __webpack_require__(2); -const NoopHttpTextPropagator_1 = __webpack_require__(744); -const setter_1 = __webpack_require__(753); -const context_1 = __webpack_require__(492); -const contextApi = context_1.ContextAPI.getInstance(); +exports.PropagationAPI = void 0; +var getter_1 = __webpack_require__(2); +var NoopHttpTextPropagator_1 = __webpack_require__(744); +var setter_1 = __webpack_require__(753); +var context_1 = __webpack_require__(492); +var global_utils_1 = __webpack_require__(976); +var contextApi = context_1.ContextAPI.getInstance(); /** * Singleton object which represents the entry point to the OpenTelemetry Propagation API */ -class PropagationAPI { +var PropagationAPI = /** @class */ (function () { /** Empty private constructor prevents end users from constructing a new instance of the API */ - constructor() { - this._propagator = NoopHttpTextPropagator_1.NOOP_HTTP_TEXT_PROPAGATOR; + function PropagationAPI() { } /** Get the singleton instance of the Propagator API */ - static getInstance() { + PropagationAPI.getInstance = function () { if (!this._instance) { this._instance = new PropagationAPI(); } return this._instance; - } + }; /** * Set the current propagator. Returns the initialized propagator */ - setGlobalPropagator(propagator) { - this._propagator = propagator; + PropagationAPI.prototype.setGlobalPropagator = function (propagator) { + if (global_utils_1._global[global_utils_1.GLOBAL_PROPAGATION_API_KEY]) { + // global propagator has already been set + return this._getGlobalPropagator(); + } + global_utils_1._global[global_utils_1.GLOBAL_PROPAGATION_API_KEY] = global_utils_1.makeGetter(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, propagator, NoopHttpTextPropagator_1.NOOP_HTTP_TEXT_PROPAGATOR); return propagator; - } + }; /** * Inject context into a carrier to be propagated inter-process * @@ -1287,9 +1300,11 @@ class PropagationAPI { * @param setter Function used to set values on the carrier * @param context Context carrying tracing data to inject. Defaults to the currently active context. */ - inject(carrier, setter = setter_1.defaultSetter, context = contextApi.active()) { - return this._propagator.inject(context, carrier, setter); - } + PropagationAPI.prototype.inject = function (carrier, setter, context) { + if (setter === void 0) { setter = setter_1.defaultSetter; } + if (context === void 0) { context = contextApi.active(); } + return this._getGlobalPropagator().inject(context, carrier, setter); + }; /** * Extract context from a carrier * @@ -1297,16 +1312,27 @@ class PropagationAPI { * @param getter Function used to extract keys from a carrier * @param context Context which the newly created context will inherit from. Defaults to the currently active context. */ - extract(carrier, getter = getter_1.defaultGetter, context = contextApi.active()) { - return this._propagator.extract(context, carrier, getter); - } -} + PropagationAPI.prototype.extract = function (carrier, getter, context) { + if (getter === void 0) { getter = getter_1.defaultGetter; } + if (context === void 0) { context = contextApi.active(); } + return this._getGlobalPropagator().extract(context, carrier, getter); + }; + /** Remove the global propagator */ + PropagationAPI.prototype.disable = function () { + delete global_utils_1._global[global_utils_1.GLOBAL_PROPAGATION_API_KEY]; + }; + PropagationAPI.prototype._getGlobalPropagator = function () { + var _a, _b; + return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_PROPAGATION_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NoopHttpTextPropagator_1.NOOP_HTTP_TEXT_PROPAGATOR); + }; + return PropagationAPI; +}()); exports.PropagationAPI = PropagationAPI; //# sourceMappingURL=propagation.js.map /***/ }), - -/***/ 24: +/* 23 */, +/* 24 */ /***/ (function(__unusedmodule, exports) { "use strict"; @@ -1320,14 +1346,21 @@ var _default = '00000000-0000-0000-0000-000000000000'; exports.default = _default; /***/ }), - -/***/ 40: +/* 25 */, +/* 26 */, +/* 27 */, +/* 28 */, +/* 29 */, +/* 30 */, +/* 31 */, +/* 32 */, +/* 33 */ /***/ (function(__unusedmodule, exports) { "use strict"; -/*! - * Copyright 2019, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1342,6 +1375,22 @@ exports.default = _default; * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=HttpTextPropagator.js.map + +/***/ }), +/* 34 */, +/* 35 */, +/* 36 */, +/* 37 */, +/* 38 */, +/* 39 */, +/* 40 */ +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EntryTtl = void 0; /** * EntryTtl is an integer that represents number of hops an entry can propagate. * @@ -1360,14 +1409,15 @@ var EntryTtl; //# sourceMappingURL=EntryValue.js.map /***/ }), - -/***/ 43: +/* 41 */, +/* 42 */, +/* 43 */ /***/ (function(__unusedmodule, exports) { "use strict"; -/*! - * Copyright 2019, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1382,6 +1432,7 @@ var EntryTtl; * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValueType = void 0; /** The Type of value. It describes how the data is reported. */ var ValueType; (function (ValueType) { @@ -1391,59 +1442,33 @@ var ValueType; //# sourceMappingURL=Metric.js.map /***/ }), - -/***/ 50: +/* 44 */, +/* 45 */, +/* 46 */, +/* 47 */, +/* 48 */, +/* 49 */, +/* 50 */ /***/ (function(module) { module.exports = ["ac","com.ac","edu.ac","gov.ac","net.ac","mil.ac","org.ac","ad","nom.ad","ae","co.ae","net.ae","org.ae","sch.ae","ac.ae","gov.ae","mil.ae","aero","accident-investigation.aero","accident-prevention.aero","aerobatic.aero","aeroclub.aero","aerodrome.aero","agents.aero","aircraft.aero","airline.aero","airport.aero","air-surveillance.aero","airtraffic.aero","air-traffic-control.aero","ambulance.aero","amusement.aero","association.aero","author.aero","ballooning.aero","broker.aero","caa.aero","cargo.aero","catering.aero","certification.aero","championship.aero","charter.aero","civilaviation.aero","club.aero","conference.aero","consultant.aero","consulting.aero","control.aero","council.aero","crew.aero","design.aero","dgca.aero","educator.aero","emergency.aero","engine.aero","engineer.aero","entertainment.aero","equipment.aero","exchange.aero","express.aero","federation.aero","flight.aero","freight.aero","fuel.aero","gliding.aero","government.aero","groundhandling.aero","group.aero","hanggliding.aero","homebuilt.aero","insurance.aero","journal.aero","journalist.aero","leasing.aero","logistics.aero","magazine.aero","maintenance.aero","media.aero","microlight.aero","modelling.aero","navigation.aero","parachuting.aero","paragliding.aero","passenger-association.aero","pilot.aero","press.aero","production.aero","recreation.aero","repbody.aero","res.aero","research.aero","rotorcraft.aero","safety.aero","scientist.aero","services.aero","show.aero","skydiving.aero","software.aero","student.aero","trader.aero","trading.aero","trainer.aero","union.aero","workinggroup.aero","works.aero","af","gov.af","com.af","org.af","net.af","edu.af","ag","com.ag","org.ag","net.ag","co.ag","nom.ag","ai","off.ai","com.ai","net.ai","org.ai","al","com.al","edu.al","gov.al","mil.al","net.al","org.al","am","co.am","com.am","commune.am","net.am","org.am","ao","ed.ao","gv.ao","og.ao","co.ao","pb.ao","it.ao","aq","ar","com.ar","edu.ar","gob.ar","gov.ar","int.ar","mil.ar","musica.ar","net.ar","org.ar","tur.ar","arpa","e164.arpa","in-addr.arpa","ip6.arpa","iris.arpa","uri.arpa","urn.arpa","as","gov.as","asia","at","ac.at","co.at","gv.at","or.at","au","com.au","net.au","org.au","edu.au","gov.au","asn.au","id.au","info.au","conf.au","oz.au","act.au","nsw.au","nt.au","qld.au","sa.au","tas.au","vic.au","wa.au","act.edu.au","catholic.edu.au","nsw.edu.au","nt.edu.au","qld.edu.au","sa.edu.au","tas.edu.au","vic.edu.au","wa.edu.au","qld.gov.au","sa.gov.au","tas.gov.au","vic.gov.au","wa.gov.au","education.tas.edu.au","schools.nsw.edu.au","aw","com.aw","ax","az","com.az","net.az","int.az","gov.az","org.az","edu.az","info.az","pp.az","mil.az","name.az","pro.az","biz.az","ba","com.ba","edu.ba","gov.ba","mil.ba","net.ba","org.ba","bb","biz.bb","co.bb","com.bb","edu.bb","gov.bb","info.bb","net.bb","org.bb","store.bb","tv.bb","*.bd","be","ac.be","bf","gov.bf","bg","a.bg","b.bg","c.bg","d.bg","e.bg","f.bg","g.bg","h.bg","i.bg","j.bg","k.bg","l.bg","m.bg","n.bg","o.bg","p.bg","q.bg","r.bg","s.bg","t.bg","u.bg","v.bg","w.bg","x.bg","y.bg","z.bg","0.bg","1.bg","2.bg","3.bg","4.bg","5.bg","6.bg","7.bg","8.bg","9.bg","bh","com.bh","edu.bh","net.bh","org.bh","gov.bh","bi","co.bi","com.bi","edu.bi","or.bi","org.bi","biz","bj","asso.bj","barreau.bj","gouv.bj","bm","com.bm","edu.bm","gov.bm","net.bm","org.bm","bn","com.bn","edu.bn","gov.bn","net.bn","org.bn","bo","com.bo","edu.bo","gob.bo","int.bo","org.bo","net.bo","mil.bo","tv.bo","web.bo","academia.bo","agro.bo","arte.bo","blog.bo","bolivia.bo","ciencia.bo","cooperativa.bo","democracia.bo","deporte.bo","ecologia.bo","economia.bo","empresa.bo","indigena.bo","industria.bo","info.bo","medicina.bo","movimiento.bo","musica.bo","natural.bo","nombre.bo","noticias.bo","patria.bo","politica.bo","profesional.bo","plurinacional.bo","pueblo.bo","revista.bo","salud.bo","tecnologia.bo","tksat.bo","transporte.bo","wiki.bo","br","9guacu.br","abc.br","adm.br","adv.br","agr.br","aju.br","am.br","anani.br","aparecida.br","arq.br","art.br","ato.br","b.br","barueri.br","belem.br","bhz.br","bio.br","blog.br","bmd.br","boavista.br","bsb.br","campinagrande.br","campinas.br","caxias.br","cim.br","cng.br","cnt.br","com.br","contagem.br","coop.br","cri.br","cuiaba.br","curitiba.br","def.br","ecn.br","eco.br","edu.br","emp.br","eng.br","esp.br","etc.br","eti.br","far.br","feira.br","flog.br","floripa.br","fm.br","fnd.br","fortal.br","fot.br","foz.br","fst.br","g12.br","ggf.br","goiania.br","gov.br","ac.gov.br","al.gov.br","am.gov.br","ap.gov.br","ba.gov.br","ce.gov.br","df.gov.br","es.gov.br","go.gov.br","ma.gov.br","mg.gov.br","ms.gov.br","mt.gov.br","pa.gov.br","pb.gov.br","pe.gov.br","pi.gov.br","pr.gov.br","rj.gov.br","rn.gov.br","ro.gov.br","rr.gov.br","rs.gov.br","sc.gov.br","se.gov.br","sp.gov.br","to.gov.br","gru.br","imb.br","ind.br","inf.br","jab.br","jampa.br","jdf.br","joinville.br","jor.br","jus.br","leg.br","lel.br","londrina.br","macapa.br","maceio.br","manaus.br","maringa.br","mat.br","med.br","mil.br","morena.br","mp.br","mus.br","natal.br","net.br","niteroi.br","*.nom.br","not.br","ntr.br","odo.br","ong.br","org.br","osasco.br","palmas.br","poa.br","ppg.br","pro.br","psc.br","psi.br","pvh.br","qsl.br","radio.br","rec.br","recife.br","ribeirao.br","rio.br","riobranco.br","riopreto.br","salvador.br","sampa.br","santamaria.br","santoandre.br","saobernardo.br","saogonca.br","sjc.br","slg.br","slz.br","sorocaba.br","srv.br","taxi.br","tc.br","teo.br","the.br","tmp.br","trd.br","tur.br","tv.br","udi.br","vet.br","vix.br","vlog.br","wiki.br","zlg.br","bs","com.bs","net.bs","org.bs","edu.bs","gov.bs","bt","com.bt","edu.bt","gov.bt","net.bt","org.bt","bv","bw","co.bw","org.bw","by","gov.by","mil.by","com.by","of.by","bz","com.bz","net.bz","org.bz","edu.bz","gov.bz","ca","ab.ca","bc.ca","mb.ca","nb.ca","nf.ca","nl.ca","ns.ca","nt.ca","nu.ca","on.ca","pe.ca","qc.ca","sk.ca","yk.ca","gc.ca","cat","cc","cd","gov.cd","cf","cg","ch","ci","org.ci","or.ci","com.ci","co.ci","edu.ci","ed.ci","ac.ci","net.ci","go.ci","asso.ci","aéroport.ci","int.ci","presse.ci","md.ci","gouv.ci","*.ck","!www.ck","cl","aprendemas.cl","co.cl","gob.cl","gov.cl","mil.cl","cm","co.cm","com.cm","gov.cm","net.cm","cn","ac.cn","com.cn","edu.cn","gov.cn","net.cn","org.cn","mil.cn","公司.cn","网络.cn","網絡.cn","ah.cn","bj.cn","cq.cn","fj.cn","gd.cn","gs.cn","gz.cn","gx.cn","ha.cn","hb.cn","he.cn","hi.cn","hl.cn","hn.cn","jl.cn","js.cn","jx.cn","ln.cn","nm.cn","nx.cn","qh.cn","sc.cn","sd.cn","sh.cn","sn.cn","sx.cn","tj.cn","xj.cn","xz.cn","yn.cn","zj.cn","hk.cn","mo.cn","tw.cn","co","arts.co","com.co","edu.co","firm.co","gov.co","info.co","int.co","mil.co","net.co","nom.co","org.co","rec.co","web.co","com","coop","cr","ac.cr","co.cr","ed.cr","fi.cr","go.cr","or.cr","sa.cr","cu","com.cu","edu.cu","org.cu","net.cu","gov.cu","inf.cu","cv","cw","com.cw","edu.cw","net.cw","org.cw","cx","gov.cx","cy","ac.cy","biz.cy","com.cy","ekloges.cy","gov.cy","ltd.cy","name.cy","net.cy","org.cy","parliament.cy","press.cy","pro.cy","tm.cy","cz","de","dj","dk","dm","com.dm","net.dm","org.dm","edu.dm","gov.dm","do","art.do","com.do","edu.do","gob.do","gov.do","mil.do","net.do","org.do","sld.do","web.do","dz","com.dz","org.dz","net.dz","gov.dz","edu.dz","asso.dz","pol.dz","art.dz","ec","com.ec","info.ec","net.ec","fin.ec","k12.ec","med.ec","pro.ec","org.ec","edu.ec","gov.ec","gob.ec","mil.ec","edu","ee","edu.ee","gov.ee","riik.ee","lib.ee","med.ee","com.ee","pri.ee","aip.ee","org.ee","fie.ee","eg","com.eg","edu.eg","eun.eg","gov.eg","mil.eg","name.eg","net.eg","org.eg","sci.eg","*.er","es","com.es","nom.es","org.es","gob.es","edu.es","et","com.et","gov.et","org.et","edu.et","biz.et","name.et","info.et","net.et","eu","fi","aland.fi","fj","ac.fj","biz.fj","com.fj","gov.fj","info.fj","mil.fj","name.fj","net.fj","org.fj","pro.fj","*.fk","fm","fo","fr","asso.fr","com.fr","gouv.fr","nom.fr","prd.fr","tm.fr","aeroport.fr","avocat.fr","avoues.fr","cci.fr","chambagri.fr","chirurgiens-dentistes.fr","experts-comptables.fr","geometre-expert.fr","greta.fr","huissier-justice.fr","medecin.fr","notaires.fr","pharmacien.fr","port.fr","veterinaire.fr","ga","gb","gd","ge","com.ge","edu.ge","gov.ge","org.ge","mil.ge","net.ge","pvt.ge","gf","gg","co.gg","net.gg","org.gg","gh","com.gh","edu.gh","gov.gh","org.gh","mil.gh","gi","com.gi","ltd.gi","gov.gi","mod.gi","edu.gi","org.gi","gl","co.gl","com.gl","edu.gl","net.gl","org.gl","gm","gn","ac.gn","com.gn","edu.gn","gov.gn","org.gn","net.gn","gov","gp","com.gp","net.gp","mobi.gp","edu.gp","org.gp","asso.gp","gq","gr","com.gr","edu.gr","net.gr","org.gr","gov.gr","gs","gt","com.gt","edu.gt","gob.gt","ind.gt","mil.gt","net.gt","org.gt","gu","com.gu","edu.gu","gov.gu","guam.gu","info.gu","net.gu","org.gu","web.gu","gw","gy","co.gy","com.gy","edu.gy","gov.gy","net.gy","org.gy","hk","com.hk","edu.hk","gov.hk","idv.hk","net.hk","org.hk","公司.hk","教育.hk","敎育.hk","政府.hk","個人.hk","个人.hk","箇人.hk","網络.hk","网络.hk","组織.hk","網絡.hk","网絡.hk","组织.hk","組織.hk","組织.hk","hm","hn","com.hn","edu.hn","org.hn","net.hn","mil.hn","gob.hn","hr","iz.hr","from.hr","name.hr","com.hr","ht","com.ht","shop.ht","firm.ht","info.ht","adult.ht","net.ht","pro.ht","org.ht","med.ht","art.ht","coop.ht","pol.ht","asso.ht","edu.ht","rel.ht","gouv.ht","perso.ht","hu","co.hu","info.hu","org.hu","priv.hu","sport.hu","tm.hu","2000.hu","agrar.hu","bolt.hu","casino.hu","city.hu","erotica.hu","erotika.hu","film.hu","forum.hu","games.hu","hotel.hu","ingatlan.hu","jogasz.hu","konyvelo.hu","lakas.hu","media.hu","news.hu","reklam.hu","sex.hu","shop.hu","suli.hu","szex.hu","tozsde.hu","utazas.hu","video.hu","id","ac.id","biz.id","co.id","desa.id","go.id","mil.id","my.id","net.id","or.id","ponpes.id","sch.id","web.id","ie","gov.ie","il","ac.il","co.il","gov.il","idf.il","k12.il","muni.il","net.il","org.il","im","ac.im","co.im","com.im","ltd.co.im","net.im","org.im","plc.co.im","tt.im","tv.im","in","co.in","firm.in","net.in","org.in","gen.in","ind.in","nic.in","ac.in","edu.in","res.in","gov.in","mil.in","info","int","eu.int","io","com.io","iq","gov.iq","edu.iq","mil.iq","com.iq","org.iq","net.iq","ir","ac.ir","co.ir","gov.ir","id.ir","net.ir","org.ir","sch.ir","ایران.ir","ايران.ir","is","net.is","com.is","edu.is","gov.is","org.is","int.is","it","gov.it","edu.it","abr.it","abruzzo.it","aosta-valley.it","aostavalley.it","bas.it","basilicata.it","cal.it","calabria.it","cam.it","campania.it","emilia-romagna.it","emiliaromagna.it","emr.it","friuli-v-giulia.it","friuli-ve-giulia.it","friuli-vegiulia.it","friuli-venezia-giulia.it","friuli-veneziagiulia.it","friuli-vgiulia.it","friuliv-giulia.it","friulive-giulia.it","friulivegiulia.it","friulivenezia-giulia.it","friuliveneziagiulia.it","friulivgiulia.it","fvg.it","laz.it","lazio.it","lig.it","liguria.it","lom.it","lombardia.it","lombardy.it","lucania.it","mar.it","marche.it","mol.it","molise.it","piedmont.it","piemonte.it","pmn.it","pug.it","puglia.it","sar.it","sardegna.it","sardinia.it","sic.it","sicilia.it","sicily.it","taa.it","tos.it","toscana.it","trentin-sud-tirol.it","trentin-süd-tirol.it","trentin-sudtirol.it","trentin-südtirol.it","trentin-sued-tirol.it","trentin-suedtirol.it","trentino-a-adige.it","trentino-aadige.it","trentino-alto-adige.it","trentino-altoadige.it","trentino-s-tirol.it","trentino-stirol.it","trentino-sud-tirol.it","trentino-süd-tirol.it","trentino-sudtirol.it","trentino-südtirol.it","trentino-sued-tirol.it","trentino-suedtirol.it","trentino.it","trentinoa-adige.it","trentinoaadige.it","trentinoalto-adige.it","trentinoaltoadige.it","trentinos-tirol.it","trentinostirol.it","trentinosud-tirol.it","trentinosüd-tirol.it","trentinosudtirol.it","trentinosüdtirol.it","trentinosued-tirol.it","trentinosuedtirol.it","trentinsud-tirol.it","trentinsüd-tirol.it","trentinsudtirol.it","trentinsüdtirol.it","trentinsued-tirol.it","trentinsuedtirol.it","tuscany.it","umb.it","umbria.it","val-d-aosta.it","val-daosta.it","vald-aosta.it","valdaosta.it","valle-aosta.it","valle-d-aosta.it","valle-daosta.it","valleaosta.it","valled-aosta.it","valledaosta.it","vallee-aoste.it","vallée-aoste.it","vallee-d-aoste.it","vallée-d-aoste.it","valleeaoste.it","valléeaoste.it","valleedaoste.it","valléedaoste.it","vao.it","vda.it","ven.it","veneto.it","ag.it","agrigento.it","al.it","alessandria.it","alto-adige.it","altoadige.it","an.it","ancona.it","andria-barletta-trani.it","andria-trani-barletta.it","andriabarlettatrani.it","andriatranibarletta.it","ao.it","aosta.it","aoste.it","ap.it","aq.it","aquila.it","ar.it","arezzo.it","ascoli-piceno.it","ascolipiceno.it","asti.it","at.it","av.it","avellino.it","ba.it","balsan-sudtirol.it","balsan-südtirol.it","balsan-suedtirol.it","balsan.it","bari.it","barletta-trani-andria.it","barlettatraniandria.it","belluno.it","benevento.it","bergamo.it","bg.it","bi.it","biella.it","bl.it","bn.it","bo.it","bologna.it","bolzano-altoadige.it","bolzano.it","bozen-sudtirol.it","bozen-südtirol.it","bozen-suedtirol.it","bozen.it","br.it","brescia.it","brindisi.it","bs.it","bt.it","bulsan-sudtirol.it","bulsan-südtirol.it","bulsan-suedtirol.it","bulsan.it","bz.it","ca.it","cagliari.it","caltanissetta.it","campidano-medio.it","campidanomedio.it","campobasso.it","carbonia-iglesias.it","carboniaiglesias.it","carrara-massa.it","carraramassa.it","caserta.it","catania.it","catanzaro.it","cb.it","ce.it","cesena-forli.it","cesena-forlì.it","cesenaforli.it","cesenaforlì.it","ch.it","chieti.it","ci.it","cl.it","cn.it","co.it","como.it","cosenza.it","cr.it","cremona.it","crotone.it","cs.it","ct.it","cuneo.it","cz.it","dell-ogliastra.it","dellogliastra.it","en.it","enna.it","fc.it","fe.it","fermo.it","ferrara.it","fg.it","fi.it","firenze.it","florence.it","fm.it","foggia.it","forli-cesena.it","forlì-cesena.it","forlicesena.it","forlìcesena.it","fr.it","frosinone.it","ge.it","genoa.it","genova.it","go.it","gorizia.it","gr.it","grosseto.it","iglesias-carbonia.it","iglesiascarbonia.it","im.it","imperia.it","is.it","isernia.it","kr.it","la-spezia.it","laquila.it","laspezia.it","latina.it","lc.it","le.it","lecce.it","lecco.it","li.it","livorno.it","lo.it","lodi.it","lt.it","lu.it","lucca.it","macerata.it","mantova.it","massa-carrara.it","massacarrara.it","matera.it","mb.it","mc.it","me.it","medio-campidano.it","mediocampidano.it","messina.it","mi.it","milan.it","milano.it","mn.it","mo.it","modena.it","monza-brianza.it","monza-e-della-brianza.it","monza.it","monzabrianza.it","monzaebrianza.it","monzaedellabrianza.it","ms.it","mt.it","na.it","naples.it","napoli.it","no.it","novara.it","nu.it","nuoro.it","og.it","ogliastra.it","olbia-tempio.it","olbiatempio.it","or.it","oristano.it","ot.it","pa.it","padova.it","padua.it","palermo.it","parma.it","pavia.it","pc.it","pd.it","pe.it","perugia.it","pesaro-urbino.it","pesarourbino.it","pescara.it","pg.it","pi.it","piacenza.it","pisa.it","pistoia.it","pn.it","po.it","pordenone.it","potenza.it","pr.it","prato.it","pt.it","pu.it","pv.it","pz.it","ra.it","ragusa.it","ravenna.it","rc.it","re.it","reggio-calabria.it","reggio-emilia.it","reggiocalabria.it","reggioemilia.it","rg.it","ri.it","rieti.it","rimini.it","rm.it","rn.it","ro.it","roma.it","rome.it","rovigo.it","sa.it","salerno.it","sassari.it","savona.it","si.it","siena.it","siracusa.it","so.it","sondrio.it","sp.it","sr.it","ss.it","suedtirol.it","südtirol.it","sv.it","ta.it","taranto.it","te.it","tempio-olbia.it","tempioolbia.it","teramo.it","terni.it","tn.it","to.it","torino.it","tp.it","tr.it","trani-andria-barletta.it","trani-barletta-andria.it","traniandriabarletta.it","tranibarlettaandria.it","trapani.it","trento.it","treviso.it","trieste.it","ts.it","turin.it","tv.it","ud.it","udine.it","urbino-pesaro.it","urbinopesaro.it","va.it","varese.it","vb.it","vc.it","ve.it","venezia.it","venice.it","verbania.it","vercelli.it","verona.it","vi.it","vibo-valentia.it","vibovalentia.it","vicenza.it","viterbo.it","vr.it","vs.it","vt.it","vv.it","je","co.je","net.je","org.je","*.jm","jo","com.jo","org.jo","net.jo","edu.jo","sch.jo","gov.jo","mil.jo","name.jo","jobs","jp","ac.jp","ad.jp","co.jp","ed.jp","go.jp","gr.jp","lg.jp","ne.jp","or.jp","aichi.jp","akita.jp","aomori.jp","chiba.jp","ehime.jp","fukui.jp","fukuoka.jp","fukushima.jp","gifu.jp","gunma.jp","hiroshima.jp","hokkaido.jp","hyogo.jp","ibaraki.jp","ishikawa.jp","iwate.jp","kagawa.jp","kagoshima.jp","kanagawa.jp","kochi.jp","kumamoto.jp","kyoto.jp","mie.jp","miyagi.jp","miyazaki.jp","nagano.jp","nagasaki.jp","nara.jp","niigata.jp","oita.jp","okayama.jp","okinawa.jp","osaka.jp","saga.jp","saitama.jp","shiga.jp","shimane.jp","shizuoka.jp","tochigi.jp","tokushima.jp","tokyo.jp","tottori.jp","toyama.jp","wakayama.jp","yamagata.jp","yamaguchi.jp","yamanashi.jp","栃木.jp","愛知.jp","愛媛.jp","兵庫.jp","熊本.jp","茨城.jp","北海道.jp","千葉.jp","和歌山.jp","長崎.jp","長野.jp","新潟.jp","青森.jp","静岡.jp","東京.jp","石川.jp","埼玉.jp","三重.jp","京都.jp","佐賀.jp","大分.jp","大阪.jp","奈良.jp","宮城.jp","宮崎.jp","富山.jp","山口.jp","山形.jp","山梨.jp","岩手.jp","岐阜.jp","岡山.jp","島根.jp","広島.jp","徳島.jp","沖縄.jp","滋賀.jp","神奈川.jp","福井.jp","福岡.jp","福島.jp","秋田.jp","群馬.jp","香川.jp","高知.jp","鳥取.jp","鹿児島.jp","*.kawasaki.jp","*.kitakyushu.jp","*.kobe.jp","*.nagoya.jp","*.sapporo.jp","*.sendai.jp","*.yokohama.jp","!city.kawasaki.jp","!city.kitakyushu.jp","!city.kobe.jp","!city.nagoya.jp","!city.sapporo.jp","!city.sendai.jp","!city.yokohama.jp","aisai.aichi.jp","ama.aichi.jp","anjo.aichi.jp","asuke.aichi.jp","chiryu.aichi.jp","chita.aichi.jp","fuso.aichi.jp","gamagori.aichi.jp","handa.aichi.jp","hazu.aichi.jp","hekinan.aichi.jp","higashiura.aichi.jp","ichinomiya.aichi.jp","inazawa.aichi.jp","inuyama.aichi.jp","isshiki.aichi.jp","iwakura.aichi.jp","kanie.aichi.jp","kariya.aichi.jp","kasugai.aichi.jp","kira.aichi.jp","kiyosu.aichi.jp","komaki.aichi.jp","konan.aichi.jp","kota.aichi.jp","mihama.aichi.jp","miyoshi.aichi.jp","nishio.aichi.jp","nisshin.aichi.jp","obu.aichi.jp","oguchi.aichi.jp","oharu.aichi.jp","okazaki.aichi.jp","owariasahi.aichi.jp","seto.aichi.jp","shikatsu.aichi.jp","shinshiro.aichi.jp","shitara.aichi.jp","tahara.aichi.jp","takahama.aichi.jp","tobishima.aichi.jp","toei.aichi.jp","togo.aichi.jp","tokai.aichi.jp","tokoname.aichi.jp","toyoake.aichi.jp","toyohashi.aichi.jp","toyokawa.aichi.jp","toyone.aichi.jp","toyota.aichi.jp","tsushima.aichi.jp","yatomi.aichi.jp","akita.akita.jp","daisen.akita.jp","fujisato.akita.jp","gojome.akita.jp","hachirogata.akita.jp","happou.akita.jp","higashinaruse.akita.jp","honjo.akita.jp","honjyo.akita.jp","ikawa.akita.jp","kamikoani.akita.jp","kamioka.akita.jp","katagami.akita.jp","kazuno.akita.jp","kitaakita.akita.jp","kosaka.akita.jp","kyowa.akita.jp","misato.akita.jp","mitane.akita.jp","moriyoshi.akita.jp","nikaho.akita.jp","noshiro.akita.jp","odate.akita.jp","oga.akita.jp","ogata.akita.jp","semboku.akita.jp","yokote.akita.jp","yurihonjo.akita.jp","aomori.aomori.jp","gonohe.aomori.jp","hachinohe.aomori.jp","hashikami.aomori.jp","hiranai.aomori.jp","hirosaki.aomori.jp","itayanagi.aomori.jp","kuroishi.aomori.jp","misawa.aomori.jp","mutsu.aomori.jp","nakadomari.aomori.jp","noheji.aomori.jp","oirase.aomori.jp","owani.aomori.jp","rokunohe.aomori.jp","sannohe.aomori.jp","shichinohe.aomori.jp","shingo.aomori.jp","takko.aomori.jp","towada.aomori.jp","tsugaru.aomori.jp","tsuruta.aomori.jp","abiko.chiba.jp","asahi.chiba.jp","chonan.chiba.jp","chosei.chiba.jp","choshi.chiba.jp","chuo.chiba.jp","funabashi.chiba.jp","futtsu.chiba.jp","hanamigawa.chiba.jp","ichihara.chiba.jp","ichikawa.chiba.jp","ichinomiya.chiba.jp","inzai.chiba.jp","isumi.chiba.jp","kamagaya.chiba.jp","kamogawa.chiba.jp","kashiwa.chiba.jp","katori.chiba.jp","katsuura.chiba.jp","kimitsu.chiba.jp","kisarazu.chiba.jp","kozaki.chiba.jp","kujukuri.chiba.jp","kyonan.chiba.jp","matsudo.chiba.jp","midori.chiba.jp","mihama.chiba.jp","minamiboso.chiba.jp","mobara.chiba.jp","mutsuzawa.chiba.jp","nagara.chiba.jp","nagareyama.chiba.jp","narashino.chiba.jp","narita.chiba.jp","noda.chiba.jp","oamishirasato.chiba.jp","omigawa.chiba.jp","onjuku.chiba.jp","otaki.chiba.jp","sakae.chiba.jp","sakura.chiba.jp","shimofusa.chiba.jp","shirako.chiba.jp","shiroi.chiba.jp","shisui.chiba.jp","sodegaura.chiba.jp","sosa.chiba.jp","tako.chiba.jp","tateyama.chiba.jp","togane.chiba.jp","tohnosho.chiba.jp","tomisato.chiba.jp","urayasu.chiba.jp","yachimata.chiba.jp","yachiyo.chiba.jp","yokaichiba.chiba.jp","yokoshibahikari.chiba.jp","yotsukaido.chiba.jp","ainan.ehime.jp","honai.ehime.jp","ikata.ehime.jp","imabari.ehime.jp","iyo.ehime.jp","kamijima.ehime.jp","kihoku.ehime.jp","kumakogen.ehime.jp","masaki.ehime.jp","matsuno.ehime.jp","matsuyama.ehime.jp","namikata.ehime.jp","niihama.ehime.jp","ozu.ehime.jp","saijo.ehime.jp","seiyo.ehime.jp","shikokuchuo.ehime.jp","tobe.ehime.jp","toon.ehime.jp","uchiko.ehime.jp","uwajima.ehime.jp","yawatahama.ehime.jp","echizen.fukui.jp","eiheiji.fukui.jp","fukui.fukui.jp","ikeda.fukui.jp","katsuyama.fukui.jp","mihama.fukui.jp","minamiechizen.fukui.jp","obama.fukui.jp","ohi.fukui.jp","ono.fukui.jp","sabae.fukui.jp","sakai.fukui.jp","takahama.fukui.jp","tsuruga.fukui.jp","wakasa.fukui.jp","ashiya.fukuoka.jp","buzen.fukuoka.jp","chikugo.fukuoka.jp","chikuho.fukuoka.jp","chikujo.fukuoka.jp","chikushino.fukuoka.jp","chikuzen.fukuoka.jp","chuo.fukuoka.jp","dazaifu.fukuoka.jp","fukuchi.fukuoka.jp","hakata.fukuoka.jp","higashi.fukuoka.jp","hirokawa.fukuoka.jp","hisayama.fukuoka.jp","iizuka.fukuoka.jp","inatsuki.fukuoka.jp","kaho.fukuoka.jp","kasuga.fukuoka.jp","kasuya.fukuoka.jp","kawara.fukuoka.jp","keisen.fukuoka.jp","koga.fukuoka.jp","kurate.fukuoka.jp","kurogi.fukuoka.jp","kurume.fukuoka.jp","minami.fukuoka.jp","miyako.fukuoka.jp","miyama.fukuoka.jp","miyawaka.fukuoka.jp","mizumaki.fukuoka.jp","munakata.fukuoka.jp","nakagawa.fukuoka.jp","nakama.fukuoka.jp","nishi.fukuoka.jp","nogata.fukuoka.jp","ogori.fukuoka.jp","okagaki.fukuoka.jp","okawa.fukuoka.jp","oki.fukuoka.jp","omuta.fukuoka.jp","onga.fukuoka.jp","onojo.fukuoka.jp","oto.fukuoka.jp","saigawa.fukuoka.jp","sasaguri.fukuoka.jp","shingu.fukuoka.jp","shinyoshitomi.fukuoka.jp","shonai.fukuoka.jp","soeda.fukuoka.jp","sue.fukuoka.jp","tachiarai.fukuoka.jp","tagawa.fukuoka.jp","takata.fukuoka.jp","toho.fukuoka.jp","toyotsu.fukuoka.jp","tsuiki.fukuoka.jp","ukiha.fukuoka.jp","umi.fukuoka.jp","usui.fukuoka.jp","yamada.fukuoka.jp","yame.fukuoka.jp","yanagawa.fukuoka.jp","yukuhashi.fukuoka.jp","aizubange.fukushima.jp","aizumisato.fukushima.jp","aizuwakamatsu.fukushima.jp","asakawa.fukushima.jp","bandai.fukushima.jp","date.fukushima.jp","fukushima.fukushima.jp","furudono.fukushima.jp","futaba.fukushima.jp","hanawa.fukushima.jp","higashi.fukushima.jp","hirata.fukushima.jp","hirono.fukushima.jp","iitate.fukushima.jp","inawashiro.fukushima.jp","ishikawa.fukushima.jp","iwaki.fukushima.jp","izumizaki.fukushima.jp","kagamiishi.fukushima.jp","kaneyama.fukushima.jp","kawamata.fukushima.jp","kitakata.fukushima.jp","kitashiobara.fukushima.jp","koori.fukushima.jp","koriyama.fukushima.jp","kunimi.fukushima.jp","miharu.fukushima.jp","mishima.fukushima.jp","namie.fukushima.jp","nango.fukushima.jp","nishiaizu.fukushima.jp","nishigo.fukushima.jp","okuma.fukushima.jp","omotego.fukushima.jp","ono.fukushima.jp","otama.fukushima.jp","samegawa.fukushima.jp","shimogo.fukushima.jp","shirakawa.fukushima.jp","showa.fukushima.jp","soma.fukushima.jp","sukagawa.fukushima.jp","taishin.fukushima.jp","tamakawa.fukushima.jp","tanagura.fukushima.jp","tenei.fukushima.jp","yabuki.fukushima.jp","yamato.fukushima.jp","yamatsuri.fukushima.jp","yanaizu.fukushima.jp","yugawa.fukushima.jp","anpachi.gifu.jp","ena.gifu.jp","gifu.gifu.jp","ginan.gifu.jp","godo.gifu.jp","gujo.gifu.jp","hashima.gifu.jp","hichiso.gifu.jp","hida.gifu.jp","higashishirakawa.gifu.jp","ibigawa.gifu.jp","ikeda.gifu.jp","kakamigahara.gifu.jp","kani.gifu.jp","kasahara.gifu.jp","kasamatsu.gifu.jp","kawaue.gifu.jp","kitagata.gifu.jp","mino.gifu.jp","minokamo.gifu.jp","mitake.gifu.jp","mizunami.gifu.jp","motosu.gifu.jp","nakatsugawa.gifu.jp","ogaki.gifu.jp","sakahogi.gifu.jp","seki.gifu.jp","sekigahara.gifu.jp","shirakawa.gifu.jp","tajimi.gifu.jp","takayama.gifu.jp","tarui.gifu.jp","toki.gifu.jp","tomika.gifu.jp","wanouchi.gifu.jp","yamagata.gifu.jp","yaotsu.gifu.jp","yoro.gifu.jp","annaka.gunma.jp","chiyoda.gunma.jp","fujioka.gunma.jp","higashiagatsuma.gunma.jp","isesaki.gunma.jp","itakura.gunma.jp","kanna.gunma.jp","kanra.gunma.jp","katashina.gunma.jp","kawaba.gunma.jp","kiryu.gunma.jp","kusatsu.gunma.jp","maebashi.gunma.jp","meiwa.gunma.jp","midori.gunma.jp","minakami.gunma.jp","naganohara.gunma.jp","nakanojo.gunma.jp","nanmoku.gunma.jp","numata.gunma.jp","oizumi.gunma.jp","ora.gunma.jp","ota.gunma.jp","shibukawa.gunma.jp","shimonita.gunma.jp","shinto.gunma.jp","showa.gunma.jp","takasaki.gunma.jp","takayama.gunma.jp","tamamura.gunma.jp","tatebayashi.gunma.jp","tomioka.gunma.jp","tsukiyono.gunma.jp","tsumagoi.gunma.jp","ueno.gunma.jp","yoshioka.gunma.jp","asaminami.hiroshima.jp","daiwa.hiroshima.jp","etajima.hiroshima.jp","fuchu.hiroshima.jp","fukuyama.hiroshima.jp","hatsukaichi.hiroshima.jp","higashihiroshima.hiroshima.jp","hongo.hiroshima.jp","jinsekikogen.hiroshima.jp","kaita.hiroshima.jp","kui.hiroshima.jp","kumano.hiroshima.jp","kure.hiroshima.jp","mihara.hiroshima.jp","miyoshi.hiroshima.jp","naka.hiroshima.jp","onomichi.hiroshima.jp","osakikamijima.hiroshima.jp","otake.hiroshima.jp","saka.hiroshima.jp","sera.hiroshima.jp","seranishi.hiroshima.jp","shinichi.hiroshima.jp","shobara.hiroshima.jp","takehara.hiroshima.jp","abashiri.hokkaido.jp","abira.hokkaido.jp","aibetsu.hokkaido.jp","akabira.hokkaido.jp","akkeshi.hokkaido.jp","asahikawa.hokkaido.jp","ashibetsu.hokkaido.jp","ashoro.hokkaido.jp","assabu.hokkaido.jp","atsuma.hokkaido.jp","bibai.hokkaido.jp","biei.hokkaido.jp","bifuka.hokkaido.jp","bihoro.hokkaido.jp","biratori.hokkaido.jp","chippubetsu.hokkaido.jp","chitose.hokkaido.jp","date.hokkaido.jp","ebetsu.hokkaido.jp","embetsu.hokkaido.jp","eniwa.hokkaido.jp","erimo.hokkaido.jp","esan.hokkaido.jp","esashi.hokkaido.jp","fukagawa.hokkaido.jp","fukushima.hokkaido.jp","furano.hokkaido.jp","furubira.hokkaido.jp","haboro.hokkaido.jp","hakodate.hokkaido.jp","hamatonbetsu.hokkaido.jp","hidaka.hokkaido.jp","higashikagura.hokkaido.jp","higashikawa.hokkaido.jp","hiroo.hokkaido.jp","hokuryu.hokkaido.jp","hokuto.hokkaido.jp","honbetsu.hokkaido.jp","horokanai.hokkaido.jp","horonobe.hokkaido.jp","ikeda.hokkaido.jp","imakane.hokkaido.jp","ishikari.hokkaido.jp","iwamizawa.hokkaido.jp","iwanai.hokkaido.jp","kamifurano.hokkaido.jp","kamikawa.hokkaido.jp","kamishihoro.hokkaido.jp","kamisunagawa.hokkaido.jp","kamoenai.hokkaido.jp","kayabe.hokkaido.jp","kembuchi.hokkaido.jp","kikonai.hokkaido.jp","kimobetsu.hokkaido.jp","kitahiroshima.hokkaido.jp","kitami.hokkaido.jp","kiyosato.hokkaido.jp","koshimizu.hokkaido.jp","kunneppu.hokkaido.jp","kuriyama.hokkaido.jp","kuromatsunai.hokkaido.jp","kushiro.hokkaido.jp","kutchan.hokkaido.jp","kyowa.hokkaido.jp","mashike.hokkaido.jp","matsumae.hokkaido.jp","mikasa.hokkaido.jp","minamifurano.hokkaido.jp","mombetsu.hokkaido.jp","moseushi.hokkaido.jp","mukawa.hokkaido.jp","muroran.hokkaido.jp","naie.hokkaido.jp","nakagawa.hokkaido.jp","nakasatsunai.hokkaido.jp","nakatombetsu.hokkaido.jp","nanae.hokkaido.jp","nanporo.hokkaido.jp","nayoro.hokkaido.jp","nemuro.hokkaido.jp","niikappu.hokkaido.jp","niki.hokkaido.jp","nishiokoppe.hokkaido.jp","noboribetsu.hokkaido.jp","numata.hokkaido.jp","obihiro.hokkaido.jp","obira.hokkaido.jp","oketo.hokkaido.jp","okoppe.hokkaido.jp","otaru.hokkaido.jp","otobe.hokkaido.jp","otofuke.hokkaido.jp","otoineppu.hokkaido.jp","oumu.hokkaido.jp","ozora.hokkaido.jp","pippu.hokkaido.jp","rankoshi.hokkaido.jp","rebun.hokkaido.jp","rikubetsu.hokkaido.jp","rishiri.hokkaido.jp","rishirifuji.hokkaido.jp","saroma.hokkaido.jp","sarufutsu.hokkaido.jp","shakotan.hokkaido.jp","shari.hokkaido.jp","shibecha.hokkaido.jp","shibetsu.hokkaido.jp","shikabe.hokkaido.jp","shikaoi.hokkaido.jp","shimamaki.hokkaido.jp","shimizu.hokkaido.jp","shimokawa.hokkaido.jp","shinshinotsu.hokkaido.jp","shintoku.hokkaido.jp","shiranuka.hokkaido.jp","shiraoi.hokkaido.jp","shiriuchi.hokkaido.jp","sobetsu.hokkaido.jp","sunagawa.hokkaido.jp","taiki.hokkaido.jp","takasu.hokkaido.jp","takikawa.hokkaido.jp","takinoue.hokkaido.jp","teshikaga.hokkaido.jp","tobetsu.hokkaido.jp","tohma.hokkaido.jp","tomakomai.hokkaido.jp","tomari.hokkaido.jp","toya.hokkaido.jp","toyako.hokkaido.jp","toyotomi.hokkaido.jp","toyoura.hokkaido.jp","tsubetsu.hokkaido.jp","tsukigata.hokkaido.jp","urakawa.hokkaido.jp","urausu.hokkaido.jp","uryu.hokkaido.jp","utashinai.hokkaido.jp","wakkanai.hokkaido.jp","wassamu.hokkaido.jp","yakumo.hokkaido.jp","yoichi.hokkaido.jp","aioi.hyogo.jp","akashi.hyogo.jp","ako.hyogo.jp","amagasaki.hyogo.jp","aogaki.hyogo.jp","asago.hyogo.jp","ashiya.hyogo.jp","awaji.hyogo.jp","fukusaki.hyogo.jp","goshiki.hyogo.jp","harima.hyogo.jp","himeji.hyogo.jp","ichikawa.hyogo.jp","inagawa.hyogo.jp","itami.hyogo.jp","kakogawa.hyogo.jp","kamigori.hyogo.jp","kamikawa.hyogo.jp","kasai.hyogo.jp","kasuga.hyogo.jp","kawanishi.hyogo.jp","miki.hyogo.jp","minamiawaji.hyogo.jp","nishinomiya.hyogo.jp","nishiwaki.hyogo.jp","ono.hyogo.jp","sanda.hyogo.jp","sannan.hyogo.jp","sasayama.hyogo.jp","sayo.hyogo.jp","shingu.hyogo.jp","shinonsen.hyogo.jp","shiso.hyogo.jp","sumoto.hyogo.jp","taishi.hyogo.jp","taka.hyogo.jp","takarazuka.hyogo.jp","takasago.hyogo.jp","takino.hyogo.jp","tamba.hyogo.jp","tatsuno.hyogo.jp","toyooka.hyogo.jp","yabu.hyogo.jp","yashiro.hyogo.jp","yoka.hyogo.jp","yokawa.hyogo.jp","ami.ibaraki.jp","asahi.ibaraki.jp","bando.ibaraki.jp","chikusei.ibaraki.jp","daigo.ibaraki.jp","fujishiro.ibaraki.jp","hitachi.ibaraki.jp","hitachinaka.ibaraki.jp","hitachiomiya.ibaraki.jp","hitachiota.ibaraki.jp","ibaraki.ibaraki.jp","ina.ibaraki.jp","inashiki.ibaraki.jp","itako.ibaraki.jp","iwama.ibaraki.jp","joso.ibaraki.jp","kamisu.ibaraki.jp","kasama.ibaraki.jp","kashima.ibaraki.jp","kasumigaura.ibaraki.jp","koga.ibaraki.jp","miho.ibaraki.jp","mito.ibaraki.jp","moriya.ibaraki.jp","naka.ibaraki.jp","namegata.ibaraki.jp","oarai.ibaraki.jp","ogawa.ibaraki.jp","omitama.ibaraki.jp","ryugasaki.ibaraki.jp","sakai.ibaraki.jp","sakuragawa.ibaraki.jp","shimodate.ibaraki.jp","shimotsuma.ibaraki.jp","shirosato.ibaraki.jp","sowa.ibaraki.jp","suifu.ibaraki.jp","takahagi.ibaraki.jp","tamatsukuri.ibaraki.jp","tokai.ibaraki.jp","tomobe.ibaraki.jp","tone.ibaraki.jp","toride.ibaraki.jp","tsuchiura.ibaraki.jp","tsukuba.ibaraki.jp","uchihara.ibaraki.jp","ushiku.ibaraki.jp","yachiyo.ibaraki.jp","yamagata.ibaraki.jp","yawara.ibaraki.jp","yuki.ibaraki.jp","anamizu.ishikawa.jp","hakui.ishikawa.jp","hakusan.ishikawa.jp","kaga.ishikawa.jp","kahoku.ishikawa.jp","kanazawa.ishikawa.jp","kawakita.ishikawa.jp","komatsu.ishikawa.jp","nakanoto.ishikawa.jp","nanao.ishikawa.jp","nomi.ishikawa.jp","nonoichi.ishikawa.jp","noto.ishikawa.jp","shika.ishikawa.jp","suzu.ishikawa.jp","tsubata.ishikawa.jp","tsurugi.ishikawa.jp","uchinada.ishikawa.jp","wajima.ishikawa.jp","fudai.iwate.jp","fujisawa.iwate.jp","hanamaki.iwate.jp","hiraizumi.iwate.jp","hirono.iwate.jp","ichinohe.iwate.jp","ichinoseki.iwate.jp","iwaizumi.iwate.jp","iwate.iwate.jp","joboji.iwate.jp","kamaishi.iwate.jp","kanegasaki.iwate.jp","karumai.iwate.jp","kawai.iwate.jp","kitakami.iwate.jp","kuji.iwate.jp","kunohe.iwate.jp","kuzumaki.iwate.jp","miyako.iwate.jp","mizusawa.iwate.jp","morioka.iwate.jp","ninohe.iwate.jp","noda.iwate.jp","ofunato.iwate.jp","oshu.iwate.jp","otsuchi.iwate.jp","rikuzentakata.iwate.jp","shiwa.iwate.jp","shizukuishi.iwate.jp","sumita.iwate.jp","tanohata.iwate.jp","tono.iwate.jp","yahaba.iwate.jp","yamada.iwate.jp","ayagawa.kagawa.jp","higashikagawa.kagawa.jp","kanonji.kagawa.jp","kotohira.kagawa.jp","manno.kagawa.jp","marugame.kagawa.jp","mitoyo.kagawa.jp","naoshima.kagawa.jp","sanuki.kagawa.jp","tadotsu.kagawa.jp","takamatsu.kagawa.jp","tonosho.kagawa.jp","uchinomi.kagawa.jp","utazu.kagawa.jp","zentsuji.kagawa.jp","akune.kagoshima.jp","amami.kagoshima.jp","hioki.kagoshima.jp","isa.kagoshima.jp","isen.kagoshima.jp","izumi.kagoshima.jp","kagoshima.kagoshima.jp","kanoya.kagoshima.jp","kawanabe.kagoshima.jp","kinko.kagoshima.jp","kouyama.kagoshima.jp","makurazaki.kagoshima.jp","matsumoto.kagoshima.jp","minamitane.kagoshima.jp","nakatane.kagoshima.jp","nishinoomote.kagoshima.jp","satsumasendai.kagoshima.jp","soo.kagoshima.jp","tarumizu.kagoshima.jp","yusui.kagoshima.jp","aikawa.kanagawa.jp","atsugi.kanagawa.jp","ayase.kanagawa.jp","chigasaki.kanagawa.jp","ebina.kanagawa.jp","fujisawa.kanagawa.jp","hadano.kanagawa.jp","hakone.kanagawa.jp","hiratsuka.kanagawa.jp","isehara.kanagawa.jp","kaisei.kanagawa.jp","kamakura.kanagawa.jp","kiyokawa.kanagawa.jp","matsuda.kanagawa.jp","minamiashigara.kanagawa.jp","miura.kanagawa.jp","nakai.kanagawa.jp","ninomiya.kanagawa.jp","odawara.kanagawa.jp","oi.kanagawa.jp","oiso.kanagawa.jp","sagamihara.kanagawa.jp","samukawa.kanagawa.jp","tsukui.kanagawa.jp","yamakita.kanagawa.jp","yamato.kanagawa.jp","yokosuka.kanagawa.jp","yugawara.kanagawa.jp","zama.kanagawa.jp","zushi.kanagawa.jp","aki.kochi.jp","geisei.kochi.jp","hidaka.kochi.jp","higashitsuno.kochi.jp","ino.kochi.jp","kagami.kochi.jp","kami.kochi.jp","kitagawa.kochi.jp","kochi.kochi.jp","mihara.kochi.jp","motoyama.kochi.jp","muroto.kochi.jp","nahari.kochi.jp","nakamura.kochi.jp","nankoku.kochi.jp","nishitosa.kochi.jp","niyodogawa.kochi.jp","ochi.kochi.jp","okawa.kochi.jp","otoyo.kochi.jp","otsuki.kochi.jp","sakawa.kochi.jp","sukumo.kochi.jp","susaki.kochi.jp","tosa.kochi.jp","tosashimizu.kochi.jp","toyo.kochi.jp","tsuno.kochi.jp","umaji.kochi.jp","yasuda.kochi.jp","yusuhara.kochi.jp","amakusa.kumamoto.jp","arao.kumamoto.jp","aso.kumamoto.jp","choyo.kumamoto.jp","gyokuto.kumamoto.jp","kamiamakusa.kumamoto.jp","kikuchi.kumamoto.jp","kumamoto.kumamoto.jp","mashiki.kumamoto.jp","mifune.kumamoto.jp","minamata.kumamoto.jp","minamioguni.kumamoto.jp","nagasu.kumamoto.jp","nishihara.kumamoto.jp","oguni.kumamoto.jp","ozu.kumamoto.jp","sumoto.kumamoto.jp","takamori.kumamoto.jp","uki.kumamoto.jp","uto.kumamoto.jp","yamaga.kumamoto.jp","yamato.kumamoto.jp","yatsushiro.kumamoto.jp","ayabe.kyoto.jp","fukuchiyama.kyoto.jp","higashiyama.kyoto.jp","ide.kyoto.jp","ine.kyoto.jp","joyo.kyoto.jp","kameoka.kyoto.jp","kamo.kyoto.jp","kita.kyoto.jp","kizu.kyoto.jp","kumiyama.kyoto.jp","kyotamba.kyoto.jp","kyotanabe.kyoto.jp","kyotango.kyoto.jp","maizuru.kyoto.jp","minami.kyoto.jp","minamiyamashiro.kyoto.jp","miyazu.kyoto.jp","muko.kyoto.jp","nagaokakyo.kyoto.jp","nakagyo.kyoto.jp","nantan.kyoto.jp","oyamazaki.kyoto.jp","sakyo.kyoto.jp","seika.kyoto.jp","tanabe.kyoto.jp","uji.kyoto.jp","ujitawara.kyoto.jp","wazuka.kyoto.jp","yamashina.kyoto.jp","yawata.kyoto.jp","asahi.mie.jp","inabe.mie.jp","ise.mie.jp","kameyama.mie.jp","kawagoe.mie.jp","kiho.mie.jp","kisosaki.mie.jp","kiwa.mie.jp","komono.mie.jp","kumano.mie.jp","kuwana.mie.jp","matsusaka.mie.jp","meiwa.mie.jp","mihama.mie.jp","minamiise.mie.jp","misugi.mie.jp","miyama.mie.jp","nabari.mie.jp","shima.mie.jp","suzuka.mie.jp","tado.mie.jp","taiki.mie.jp","taki.mie.jp","tamaki.mie.jp","toba.mie.jp","tsu.mie.jp","udono.mie.jp","ureshino.mie.jp","watarai.mie.jp","yokkaichi.mie.jp","furukawa.miyagi.jp","higashimatsushima.miyagi.jp","ishinomaki.miyagi.jp","iwanuma.miyagi.jp","kakuda.miyagi.jp","kami.miyagi.jp","kawasaki.miyagi.jp","marumori.miyagi.jp","matsushima.miyagi.jp","minamisanriku.miyagi.jp","misato.miyagi.jp","murata.miyagi.jp","natori.miyagi.jp","ogawara.miyagi.jp","ohira.miyagi.jp","onagawa.miyagi.jp","osaki.miyagi.jp","rifu.miyagi.jp","semine.miyagi.jp","shibata.miyagi.jp","shichikashuku.miyagi.jp","shikama.miyagi.jp","shiogama.miyagi.jp","shiroishi.miyagi.jp","tagajo.miyagi.jp","taiwa.miyagi.jp","tome.miyagi.jp","tomiya.miyagi.jp","wakuya.miyagi.jp","watari.miyagi.jp","yamamoto.miyagi.jp","zao.miyagi.jp","aya.miyazaki.jp","ebino.miyazaki.jp","gokase.miyazaki.jp","hyuga.miyazaki.jp","kadogawa.miyazaki.jp","kawaminami.miyazaki.jp","kijo.miyazaki.jp","kitagawa.miyazaki.jp","kitakata.miyazaki.jp","kitaura.miyazaki.jp","kobayashi.miyazaki.jp","kunitomi.miyazaki.jp","kushima.miyazaki.jp","mimata.miyazaki.jp","miyakonojo.miyazaki.jp","miyazaki.miyazaki.jp","morotsuka.miyazaki.jp","nichinan.miyazaki.jp","nishimera.miyazaki.jp","nobeoka.miyazaki.jp","saito.miyazaki.jp","shiiba.miyazaki.jp","shintomi.miyazaki.jp","takaharu.miyazaki.jp","takanabe.miyazaki.jp","takazaki.miyazaki.jp","tsuno.miyazaki.jp","achi.nagano.jp","agematsu.nagano.jp","anan.nagano.jp","aoki.nagano.jp","asahi.nagano.jp","azumino.nagano.jp","chikuhoku.nagano.jp","chikuma.nagano.jp","chino.nagano.jp","fujimi.nagano.jp","hakuba.nagano.jp","hara.nagano.jp","hiraya.nagano.jp","iida.nagano.jp","iijima.nagano.jp","iiyama.nagano.jp","iizuna.nagano.jp","ikeda.nagano.jp","ikusaka.nagano.jp","ina.nagano.jp","karuizawa.nagano.jp","kawakami.nagano.jp","kiso.nagano.jp","kisofukushima.nagano.jp","kitaaiki.nagano.jp","komagane.nagano.jp","komoro.nagano.jp","matsukawa.nagano.jp","matsumoto.nagano.jp","miasa.nagano.jp","minamiaiki.nagano.jp","minamimaki.nagano.jp","minamiminowa.nagano.jp","minowa.nagano.jp","miyada.nagano.jp","miyota.nagano.jp","mochizuki.nagano.jp","nagano.nagano.jp","nagawa.nagano.jp","nagiso.nagano.jp","nakagawa.nagano.jp","nakano.nagano.jp","nozawaonsen.nagano.jp","obuse.nagano.jp","ogawa.nagano.jp","okaya.nagano.jp","omachi.nagano.jp","omi.nagano.jp","ookuwa.nagano.jp","ooshika.nagano.jp","otaki.nagano.jp","otari.nagano.jp","sakae.nagano.jp","sakaki.nagano.jp","saku.nagano.jp","sakuho.nagano.jp","shimosuwa.nagano.jp","shinanomachi.nagano.jp","shiojiri.nagano.jp","suwa.nagano.jp","suzaka.nagano.jp","takagi.nagano.jp","takamori.nagano.jp","takayama.nagano.jp","tateshina.nagano.jp","tatsuno.nagano.jp","togakushi.nagano.jp","togura.nagano.jp","tomi.nagano.jp","ueda.nagano.jp","wada.nagano.jp","yamagata.nagano.jp","yamanouchi.nagano.jp","yasaka.nagano.jp","yasuoka.nagano.jp","chijiwa.nagasaki.jp","futsu.nagasaki.jp","goto.nagasaki.jp","hasami.nagasaki.jp","hirado.nagasaki.jp","iki.nagasaki.jp","isahaya.nagasaki.jp","kawatana.nagasaki.jp","kuchinotsu.nagasaki.jp","matsuura.nagasaki.jp","nagasaki.nagasaki.jp","obama.nagasaki.jp","omura.nagasaki.jp","oseto.nagasaki.jp","saikai.nagasaki.jp","sasebo.nagasaki.jp","seihi.nagasaki.jp","shimabara.nagasaki.jp","shinkamigoto.nagasaki.jp","togitsu.nagasaki.jp","tsushima.nagasaki.jp","unzen.nagasaki.jp","ando.nara.jp","gose.nara.jp","heguri.nara.jp","higashiyoshino.nara.jp","ikaruga.nara.jp","ikoma.nara.jp","kamikitayama.nara.jp","kanmaki.nara.jp","kashiba.nara.jp","kashihara.nara.jp","katsuragi.nara.jp","kawai.nara.jp","kawakami.nara.jp","kawanishi.nara.jp","koryo.nara.jp","kurotaki.nara.jp","mitsue.nara.jp","miyake.nara.jp","nara.nara.jp","nosegawa.nara.jp","oji.nara.jp","ouda.nara.jp","oyodo.nara.jp","sakurai.nara.jp","sango.nara.jp","shimoichi.nara.jp","shimokitayama.nara.jp","shinjo.nara.jp","soni.nara.jp","takatori.nara.jp","tawaramoto.nara.jp","tenkawa.nara.jp","tenri.nara.jp","uda.nara.jp","yamatokoriyama.nara.jp","yamatotakada.nara.jp","yamazoe.nara.jp","yoshino.nara.jp","aga.niigata.jp","agano.niigata.jp","gosen.niigata.jp","itoigawa.niigata.jp","izumozaki.niigata.jp","joetsu.niigata.jp","kamo.niigata.jp","kariwa.niigata.jp","kashiwazaki.niigata.jp","minamiuonuma.niigata.jp","mitsuke.niigata.jp","muika.niigata.jp","murakami.niigata.jp","myoko.niigata.jp","nagaoka.niigata.jp","niigata.niigata.jp","ojiya.niigata.jp","omi.niigata.jp","sado.niigata.jp","sanjo.niigata.jp","seiro.niigata.jp","seirou.niigata.jp","sekikawa.niigata.jp","shibata.niigata.jp","tagami.niigata.jp","tainai.niigata.jp","tochio.niigata.jp","tokamachi.niigata.jp","tsubame.niigata.jp","tsunan.niigata.jp","uonuma.niigata.jp","yahiko.niigata.jp","yoita.niigata.jp","yuzawa.niigata.jp","beppu.oita.jp","bungoono.oita.jp","bungotakada.oita.jp","hasama.oita.jp","hiji.oita.jp","himeshima.oita.jp","hita.oita.jp","kamitsue.oita.jp","kokonoe.oita.jp","kuju.oita.jp","kunisaki.oita.jp","kusu.oita.jp","oita.oita.jp","saiki.oita.jp","taketa.oita.jp","tsukumi.oita.jp","usa.oita.jp","usuki.oita.jp","yufu.oita.jp","akaiwa.okayama.jp","asakuchi.okayama.jp","bizen.okayama.jp","hayashima.okayama.jp","ibara.okayama.jp","kagamino.okayama.jp","kasaoka.okayama.jp","kibichuo.okayama.jp","kumenan.okayama.jp","kurashiki.okayama.jp","maniwa.okayama.jp","misaki.okayama.jp","nagi.okayama.jp","niimi.okayama.jp","nishiawakura.okayama.jp","okayama.okayama.jp","satosho.okayama.jp","setouchi.okayama.jp","shinjo.okayama.jp","shoo.okayama.jp","soja.okayama.jp","takahashi.okayama.jp","tamano.okayama.jp","tsuyama.okayama.jp","wake.okayama.jp","yakage.okayama.jp","aguni.okinawa.jp","ginowan.okinawa.jp","ginoza.okinawa.jp","gushikami.okinawa.jp","haebaru.okinawa.jp","higashi.okinawa.jp","hirara.okinawa.jp","iheya.okinawa.jp","ishigaki.okinawa.jp","ishikawa.okinawa.jp","itoman.okinawa.jp","izena.okinawa.jp","kadena.okinawa.jp","kin.okinawa.jp","kitadaito.okinawa.jp","kitanakagusuku.okinawa.jp","kumejima.okinawa.jp","kunigami.okinawa.jp","minamidaito.okinawa.jp","motobu.okinawa.jp","nago.okinawa.jp","naha.okinawa.jp","nakagusuku.okinawa.jp","nakijin.okinawa.jp","nanjo.okinawa.jp","nishihara.okinawa.jp","ogimi.okinawa.jp","okinawa.okinawa.jp","onna.okinawa.jp","shimoji.okinawa.jp","taketomi.okinawa.jp","tarama.okinawa.jp","tokashiki.okinawa.jp","tomigusuku.okinawa.jp","tonaki.okinawa.jp","urasoe.okinawa.jp","uruma.okinawa.jp","yaese.okinawa.jp","yomitan.okinawa.jp","yonabaru.okinawa.jp","yonaguni.okinawa.jp","zamami.okinawa.jp","abeno.osaka.jp","chihayaakasaka.osaka.jp","chuo.osaka.jp","daito.osaka.jp","fujiidera.osaka.jp","habikino.osaka.jp","hannan.osaka.jp","higashiosaka.osaka.jp","higashisumiyoshi.osaka.jp","higashiyodogawa.osaka.jp","hirakata.osaka.jp","ibaraki.osaka.jp","ikeda.osaka.jp","izumi.osaka.jp","izumiotsu.osaka.jp","izumisano.osaka.jp","kadoma.osaka.jp","kaizuka.osaka.jp","kanan.osaka.jp","kashiwara.osaka.jp","katano.osaka.jp","kawachinagano.osaka.jp","kishiwada.osaka.jp","kita.osaka.jp","kumatori.osaka.jp","matsubara.osaka.jp","minato.osaka.jp","minoh.osaka.jp","misaki.osaka.jp","moriguchi.osaka.jp","neyagawa.osaka.jp","nishi.osaka.jp","nose.osaka.jp","osakasayama.osaka.jp","sakai.osaka.jp","sayama.osaka.jp","sennan.osaka.jp","settsu.osaka.jp","shijonawate.osaka.jp","shimamoto.osaka.jp","suita.osaka.jp","tadaoka.osaka.jp","taishi.osaka.jp","tajiri.osaka.jp","takaishi.osaka.jp","takatsuki.osaka.jp","tondabayashi.osaka.jp","toyonaka.osaka.jp","toyono.osaka.jp","yao.osaka.jp","ariake.saga.jp","arita.saga.jp","fukudomi.saga.jp","genkai.saga.jp","hamatama.saga.jp","hizen.saga.jp","imari.saga.jp","kamimine.saga.jp","kanzaki.saga.jp","karatsu.saga.jp","kashima.saga.jp","kitagata.saga.jp","kitahata.saga.jp","kiyama.saga.jp","kouhoku.saga.jp","kyuragi.saga.jp","nishiarita.saga.jp","ogi.saga.jp","omachi.saga.jp","ouchi.saga.jp","saga.saga.jp","shiroishi.saga.jp","taku.saga.jp","tara.saga.jp","tosu.saga.jp","yoshinogari.saga.jp","arakawa.saitama.jp","asaka.saitama.jp","chichibu.saitama.jp","fujimi.saitama.jp","fujimino.saitama.jp","fukaya.saitama.jp","hanno.saitama.jp","hanyu.saitama.jp","hasuda.saitama.jp","hatogaya.saitama.jp","hatoyama.saitama.jp","hidaka.saitama.jp","higashichichibu.saitama.jp","higashimatsuyama.saitama.jp","honjo.saitama.jp","ina.saitama.jp","iruma.saitama.jp","iwatsuki.saitama.jp","kamiizumi.saitama.jp","kamikawa.saitama.jp","kamisato.saitama.jp","kasukabe.saitama.jp","kawagoe.saitama.jp","kawaguchi.saitama.jp","kawajima.saitama.jp","kazo.saitama.jp","kitamoto.saitama.jp","koshigaya.saitama.jp","kounosu.saitama.jp","kuki.saitama.jp","kumagaya.saitama.jp","matsubushi.saitama.jp","minano.saitama.jp","misato.saitama.jp","miyashiro.saitama.jp","miyoshi.saitama.jp","moroyama.saitama.jp","nagatoro.saitama.jp","namegawa.saitama.jp","niiza.saitama.jp","ogano.saitama.jp","ogawa.saitama.jp","ogose.saitama.jp","okegawa.saitama.jp","omiya.saitama.jp","otaki.saitama.jp","ranzan.saitama.jp","ryokami.saitama.jp","saitama.saitama.jp","sakado.saitama.jp","satte.saitama.jp","sayama.saitama.jp","shiki.saitama.jp","shiraoka.saitama.jp","soka.saitama.jp","sugito.saitama.jp","toda.saitama.jp","tokigawa.saitama.jp","tokorozawa.saitama.jp","tsurugashima.saitama.jp","urawa.saitama.jp","warabi.saitama.jp","yashio.saitama.jp","yokoze.saitama.jp","yono.saitama.jp","yorii.saitama.jp","yoshida.saitama.jp","yoshikawa.saitama.jp","yoshimi.saitama.jp","aisho.shiga.jp","gamo.shiga.jp","higashiomi.shiga.jp","hikone.shiga.jp","koka.shiga.jp","konan.shiga.jp","kosei.shiga.jp","koto.shiga.jp","kusatsu.shiga.jp","maibara.shiga.jp","moriyama.shiga.jp","nagahama.shiga.jp","nishiazai.shiga.jp","notogawa.shiga.jp","omihachiman.shiga.jp","otsu.shiga.jp","ritto.shiga.jp","ryuoh.shiga.jp","takashima.shiga.jp","takatsuki.shiga.jp","torahime.shiga.jp","toyosato.shiga.jp","yasu.shiga.jp","akagi.shimane.jp","ama.shimane.jp","gotsu.shimane.jp","hamada.shimane.jp","higashiizumo.shimane.jp","hikawa.shimane.jp","hikimi.shimane.jp","izumo.shimane.jp","kakinoki.shimane.jp","masuda.shimane.jp","matsue.shimane.jp","misato.shimane.jp","nishinoshima.shimane.jp","ohda.shimane.jp","okinoshima.shimane.jp","okuizumo.shimane.jp","shimane.shimane.jp","tamayu.shimane.jp","tsuwano.shimane.jp","unnan.shimane.jp","yakumo.shimane.jp","yasugi.shimane.jp","yatsuka.shimane.jp","arai.shizuoka.jp","atami.shizuoka.jp","fuji.shizuoka.jp","fujieda.shizuoka.jp","fujikawa.shizuoka.jp","fujinomiya.shizuoka.jp","fukuroi.shizuoka.jp","gotemba.shizuoka.jp","haibara.shizuoka.jp","hamamatsu.shizuoka.jp","higashiizu.shizuoka.jp","ito.shizuoka.jp","iwata.shizuoka.jp","izu.shizuoka.jp","izunokuni.shizuoka.jp","kakegawa.shizuoka.jp","kannami.shizuoka.jp","kawanehon.shizuoka.jp","kawazu.shizuoka.jp","kikugawa.shizuoka.jp","kosai.shizuoka.jp","makinohara.shizuoka.jp","matsuzaki.shizuoka.jp","minamiizu.shizuoka.jp","mishima.shizuoka.jp","morimachi.shizuoka.jp","nishiizu.shizuoka.jp","numazu.shizuoka.jp","omaezaki.shizuoka.jp","shimada.shizuoka.jp","shimizu.shizuoka.jp","shimoda.shizuoka.jp","shizuoka.shizuoka.jp","susono.shizuoka.jp","yaizu.shizuoka.jp","yoshida.shizuoka.jp","ashikaga.tochigi.jp","bato.tochigi.jp","haga.tochigi.jp","ichikai.tochigi.jp","iwafune.tochigi.jp","kaminokawa.tochigi.jp","kanuma.tochigi.jp","karasuyama.tochigi.jp","kuroiso.tochigi.jp","mashiko.tochigi.jp","mibu.tochigi.jp","moka.tochigi.jp","motegi.tochigi.jp","nasu.tochigi.jp","nasushiobara.tochigi.jp","nikko.tochigi.jp","nishikata.tochigi.jp","nogi.tochigi.jp","ohira.tochigi.jp","ohtawara.tochigi.jp","oyama.tochigi.jp","sakura.tochigi.jp","sano.tochigi.jp","shimotsuke.tochigi.jp","shioya.tochigi.jp","takanezawa.tochigi.jp","tochigi.tochigi.jp","tsuga.tochigi.jp","ujiie.tochigi.jp","utsunomiya.tochigi.jp","yaita.tochigi.jp","aizumi.tokushima.jp","anan.tokushima.jp","ichiba.tokushima.jp","itano.tokushima.jp","kainan.tokushima.jp","komatsushima.tokushima.jp","matsushige.tokushima.jp","mima.tokushima.jp","minami.tokushima.jp","miyoshi.tokushima.jp","mugi.tokushima.jp","nakagawa.tokushima.jp","naruto.tokushima.jp","sanagochi.tokushima.jp","shishikui.tokushima.jp","tokushima.tokushima.jp","wajiki.tokushima.jp","adachi.tokyo.jp","akiruno.tokyo.jp","akishima.tokyo.jp","aogashima.tokyo.jp","arakawa.tokyo.jp","bunkyo.tokyo.jp","chiyoda.tokyo.jp","chofu.tokyo.jp","chuo.tokyo.jp","edogawa.tokyo.jp","fuchu.tokyo.jp","fussa.tokyo.jp","hachijo.tokyo.jp","hachioji.tokyo.jp","hamura.tokyo.jp","higashikurume.tokyo.jp","higashimurayama.tokyo.jp","higashiyamato.tokyo.jp","hino.tokyo.jp","hinode.tokyo.jp","hinohara.tokyo.jp","inagi.tokyo.jp","itabashi.tokyo.jp","katsushika.tokyo.jp","kita.tokyo.jp","kiyose.tokyo.jp","kodaira.tokyo.jp","koganei.tokyo.jp","kokubunji.tokyo.jp","komae.tokyo.jp","koto.tokyo.jp","kouzushima.tokyo.jp","kunitachi.tokyo.jp","machida.tokyo.jp","meguro.tokyo.jp","minato.tokyo.jp","mitaka.tokyo.jp","mizuho.tokyo.jp","musashimurayama.tokyo.jp","musashino.tokyo.jp","nakano.tokyo.jp","nerima.tokyo.jp","ogasawara.tokyo.jp","okutama.tokyo.jp","ome.tokyo.jp","oshima.tokyo.jp","ota.tokyo.jp","setagaya.tokyo.jp","shibuya.tokyo.jp","shinagawa.tokyo.jp","shinjuku.tokyo.jp","suginami.tokyo.jp","sumida.tokyo.jp","tachikawa.tokyo.jp","taito.tokyo.jp","tama.tokyo.jp","toshima.tokyo.jp","chizu.tottori.jp","hino.tottori.jp","kawahara.tottori.jp","koge.tottori.jp","kotoura.tottori.jp","misasa.tottori.jp","nanbu.tottori.jp","nichinan.tottori.jp","sakaiminato.tottori.jp","tottori.tottori.jp","wakasa.tottori.jp","yazu.tottori.jp","yonago.tottori.jp","asahi.toyama.jp","fuchu.toyama.jp","fukumitsu.toyama.jp","funahashi.toyama.jp","himi.toyama.jp","imizu.toyama.jp","inami.toyama.jp","johana.toyama.jp","kamiichi.toyama.jp","kurobe.toyama.jp","nakaniikawa.toyama.jp","namerikawa.toyama.jp","nanto.toyama.jp","nyuzen.toyama.jp","oyabe.toyama.jp","taira.toyama.jp","takaoka.toyama.jp","tateyama.toyama.jp","toga.toyama.jp","tonami.toyama.jp","toyama.toyama.jp","unazuki.toyama.jp","uozu.toyama.jp","yamada.toyama.jp","arida.wakayama.jp","aridagawa.wakayama.jp","gobo.wakayama.jp","hashimoto.wakayama.jp","hidaka.wakayama.jp","hirogawa.wakayama.jp","inami.wakayama.jp","iwade.wakayama.jp","kainan.wakayama.jp","kamitonda.wakayama.jp","katsuragi.wakayama.jp","kimino.wakayama.jp","kinokawa.wakayama.jp","kitayama.wakayama.jp","koya.wakayama.jp","koza.wakayama.jp","kozagawa.wakayama.jp","kudoyama.wakayama.jp","kushimoto.wakayama.jp","mihama.wakayama.jp","misato.wakayama.jp","nachikatsuura.wakayama.jp","shingu.wakayama.jp","shirahama.wakayama.jp","taiji.wakayama.jp","tanabe.wakayama.jp","wakayama.wakayama.jp","yuasa.wakayama.jp","yura.wakayama.jp","asahi.yamagata.jp","funagata.yamagata.jp","higashine.yamagata.jp","iide.yamagata.jp","kahoku.yamagata.jp","kaminoyama.yamagata.jp","kaneyama.yamagata.jp","kawanishi.yamagata.jp","mamurogawa.yamagata.jp","mikawa.yamagata.jp","murayama.yamagata.jp","nagai.yamagata.jp","nakayama.yamagata.jp","nanyo.yamagata.jp","nishikawa.yamagata.jp","obanazawa.yamagata.jp","oe.yamagata.jp","oguni.yamagata.jp","ohkura.yamagata.jp","oishida.yamagata.jp","sagae.yamagata.jp","sakata.yamagata.jp","sakegawa.yamagata.jp","shinjo.yamagata.jp","shirataka.yamagata.jp","shonai.yamagata.jp","takahata.yamagata.jp","tendo.yamagata.jp","tozawa.yamagata.jp","tsuruoka.yamagata.jp","yamagata.yamagata.jp","yamanobe.yamagata.jp","yonezawa.yamagata.jp","yuza.yamagata.jp","abu.yamaguchi.jp","hagi.yamaguchi.jp","hikari.yamaguchi.jp","hofu.yamaguchi.jp","iwakuni.yamaguchi.jp","kudamatsu.yamaguchi.jp","mitou.yamaguchi.jp","nagato.yamaguchi.jp","oshima.yamaguchi.jp","shimonoseki.yamaguchi.jp","shunan.yamaguchi.jp","tabuse.yamaguchi.jp","tokuyama.yamaguchi.jp","toyota.yamaguchi.jp","ube.yamaguchi.jp","yuu.yamaguchi.jp","chuo.yamanashi.jp","doshi.yamanashi.jp","fuefuki.yamanashi.jp","fujikawa.yamanashi.jp","fujikawaguchiko.yamanashi.jp","fujiyoshida.yamanashi.jp","hayakawa.yamanashi.jp","hokuto.yamanashi.jp","ichikawamisato.yamanashi.jp","kai.yamanashi.jp","kofu.yamanashi.jp","koshu.yamanashi.jp","kosuge.yamanashi.jp","minami-alps.yamanashi.jp","minobu.yamanashi.jp","nakamichi.yamanashi.jp","nanbu.yamanashi.jp","narusawa.yamanashi.jp","nirasaki.yamanashi.jp","nishikatsura.yamanashi.jp","oshino.yamanashi.jp","otsuki.yamanashi.jp","showa.yamanashi.jp","tabayama.yamanashi.jp","tsuru.yamanashi.jp","uenohara.yamanashi.jp","yamanakako.yamanashi.jp","yamanashi.yamanashi.jp","ke","ac.ke","co.ke","go.ke","info.ke","me.ke","mobi.ke","ne.ke","or.ke","sc.ke","kg","org.kg","net.kg","com.kg","edu.kg","gov.kg","mil.kg","*.kh","ki","edu.ki","biz.ki","net.ki","org.ki","gov.ki","info.ki","com.ki","km","org.km","nom.km","gov.km","prd.km","tm.km","edu.km","mil.km","ass.km","com.km","coop.km","asso.km","presse.km","medecin.km","notaires.km","pharmaciens.km","veterinaire.km","gouv.km","kn","net.kn","org.kn","edu.kn","gov.kn","kp","com.kp","edu.kp","gov.kp","org.kp","rep.kp","tra.kp","kr","ac.kr","co.kr","es.kr","go.kr","hs.kr","kg.kr","mil.kr","ms.kr","ne.kr","or.kr","pe.kr","re.kr","sc.kr","busan.kr","chungbuk.kr","chungnam.kr","daegu.kr","daejeon.kr","gangwon.kr","gwangju.kr","gyeongbuk.kr","gyeonggi.kr","gyeongnam.kr","incheon.kr","jeju.kr","jeonbuk.kr","jeonnam.kr","seoul.kr","ulsan.kr","kw","com.kw","edu.kw","emb.kw","gov.kw","ind.kw","net.kw","org.kw","ky","edu.ky","gov.ky","com.ky","org.ky","net.ky","kz","org.kz","edu.kz","net.kz","gov.kz","mil.kz","com.kz","la","int.la","net.la","info.la","edu.la","gov.la","per.la","com.la","org.la","lb","com.lb","edu.lb","gov.lb","net.lb","org.lb","lc","com.lc","net.lc","co.lc","org.lc","edu.lc","gov.lc","li","lk","gov.lk","sch.lk","net.lk","int.lk","com.lk","org.lk","edu.lk","ngo.lk","soc.lk","web.lk","ltd.lk","assn.lk","grp.lk","hotel.lk","ac.lk","lr","com.lr","edu.lr","gov.lr","org.lr","net.lr","ls","ac.ls","biz.ls","co.ls","edu.ls","gov.ls","info.ls","net.ls","org.ls","sc.ls","lt","gov.lt","lu","lv","com.lv","edu.lv","gov.lv","org.lv","mil.lv","id.lv","net.lv","asn.lv","conf.lv","ly","com.ly","net.ly","gov.ly","plc.ly","edu.ly","sch.ly","med.ly","org.ly","id.ly","ma","co.ma","net.ma","gov.ma","org.ma","ac.ma","press.ma","mc","tm.mc","asso.mc","md","me","co.me","net.me","org.me","edu.me","ac.me","gov.me","its.me","priv.me","mg","org.mg","nom.mg","gov.mg","prd.mg","tm.mg","edu.mg","mil.mg","com.mg","co.mg","mh","mil","mk","com.mk","org.mk","net.mk","edu.mk","gov.mk","inf.mk","name.mk","ml","com.ml","edu.ml","gouv.ml","gov.ml","net.ml","org.ml","presse.ml","*.mm","mn","gov.mn","edu.mn","org.mn","mo","com.mo","net.mo","org.mo","edu.mo","gov.mo","mobi","mp","mq","mr","gov.mr","ms","com.ms","edu.ms","gov.ms","net.ms","org.ms","mt","com.mt","edu.mt","net.mt","org.mt","mu","com.mu","net.mu","org.mu","gov.mu","ac.mu","co.mu","or.mu","museum","academy.museum","agriculture.museum","air.museum","airguard.museum","alabama.museum","alaska.museum","amber.museum","ambulance.museum","american.museum","americana.museum","americanantiques.museum","americanart.museum","amsterdam.museum","and.museum","annefrank.museum","anthro.museum","anthropology.museum","antiques.museum","aquarium.museum","arboretum.museum","archaeological.museum","archaeology.museum","architecture.museum","art.museum","artanddesign.museum","artcenter.museum","artdeco.museum","arteducation.museum","artgallery.museum","arts.museum","artsandcrafts.museum","asmatart.museum","assassination.museum","assisi.museum","association.museum","astronomy.museum","atlanta.museum","austin.museum","australia.museum","automotive.museum","aviation.museum","axis.museum","badajoz.museum","baghdad.museum","bahn.museum","bale.museum","baltimore.museum","barcelona.museum","baseball.museum","basel.museum","baths.museum","bauern.museum","beauxarts.museum","beeldengeluid.museum","bellevue.museum","bergbau.museum","berkeley.museum","berlin.museum","bern.museum","bible.museum","bilbao.museum","bill.museum","birdart.museum","birthplace.museum","bonn.museum","boston.museum","botanical.museum","botanicalgarden.museum","botanicgarden.museum","botany.museum","brandywinevalley.museum","brasil.museum","bristol.museum","british.museum","britishcolumbia.museum","broadcast.museum","brunel.museum","brussel.museum","brussels.museum","bruxelles.museum","building.museum","burghof.museum","bus.museum","bushey.museum","cadaques.museum","california.museum","cambridge.museum","can.museum","canada.museum","capebreton.museum","carrier.museum","cartoonart.museum","casadelamoneda.museum","castle.museum","castres.museum","celtic.museum","center.museum","chattanooga.museum","cheltenham.museum","chesapeakebay.museum","chicago.museum","children.museum","childrens.museum","childrensgarden.museum","chiropractic.museum","chocolate.museum","christiansburg.museum","cincinnati.museum","cinema.museum","circus.museum","civilisation.museum","civilization.museum","civilwar.museum","clinton.museum","clock.museum","coal.museum","coastaldefence.museum","cody.museum","coldwar.museum","collection.museum","colonialwilliamsburg.museum","coloradoplateau.museum","columbia.museum","columbus.museum","communication.museum","communications.museum","community.museum","computer.museum","computerhistory.museum","comunicações.museum","contemporary.museum","contemporaryart.museum","convent.museum","copenhagen.museum","corporation.museum","correios-e-telecomunicações.museum","corvette.museum","costume.museum","countryestate.museum","county.museum","crafts.museum","cranbrook.museum","creation.museum","cultural.museum","culturalcenter.museum","culture.museum","cyber.museum","cymru.museum","dali.museum","dallas.museum","database.museum","ddr.museum","decorativearts.museum","delaware.museum","delmenhorst.museum","denmark.museum","depot.museum","design.museum","detroit.museum","dinosaur.museum","discovery.museum","dolls.museum","donostia.museum","durham.museum","eastafrica.museum","eastcoast.museum","education.museum","educational.museum","egyptian.museum","eisenbahn.museum","elburg.museum","elvendrell.museum","embroidery.museum","encyclopedic.museum","england.museum","entomology.museum","environment.museum","environmentalconservation.museum","epilepsy.museum","essex.museum","estate.museum","ethnology.museum","exeter.museum","exhibition.museum","family.museum","farm.museum","farmequipment.museum","farmers.museum","farmstead.museum","field.museum","figueres.museum","filatelia.museum","film.museum","fineart.museum","finearts.museum","finland.museum","flanders.museum","florida.museum","force.museum","fortmissoula.museum","fortworth.museum","foundation.museum","francaise.museum","frankfurt.museum","franziskaner.museum","freemasonry.museum","freiburg.museum","fribourg.museum","frog.museum","fundacio.museum","furniture.museum","gallery.museum","garden.museum","gateway.museum","geelvinck.museum","gemological.museum","geology.museum","georgia.museum","giessen.museum","glas.museum","glass.museum","gorge.museum","grandrapids.museum","graz.museum","guernsey.museum","halloffame.museum","hamburg.museum","handson.museum","harvestcelebration.museum","hawaii.museum","health.museum","heimatunduhren.museum","hellas.museum","helsinki.museum","hembygdsforbund.museum","heritage.museum","histoire.museum","historical.museum","historicalsociety.museum","historichouses.museum","historisch.museum","historisches.museum","history.museum","historyofscience.museum","horology.museum","house.museum","humanities.museum","illustration.museum","imageandsound.museum","indian.museum","indiana.museum","indianapolis.museum","indianmarket.museum","intelligence.museum","interactive.museum","iraq.museum","iron.museum","isleofman.museum","jamison.museum","jefferson.museum","jerusalem.museum","jewelry.museum","jewish.museum","jewishart.museum","jfk.museum","journalism.museum","judaica.museum","judygarland.museum","juedisches.museum","juif.museum","karate.museum","karikatur.museum","kids.museum","koebenhavn.museum","koeln.museum","kunst.museum","kunstsammlung.museum","kunstunddesign.museum","labor.museum","labour.museum","lajolla.museum","lancashire.museum","landes.museum","lans.museum","läns.museum","larsson.museum","lewismiller.museum","lincoln.museum","linz.museum","living.museum","livinghistory.museum","localhistory.museum","london.museum","losangeles.museum","louvre.museum","loyalist.museum","lucerne.museum","luxembourg.museum","luzern.museum","mad.museum","madrid.museum","mallorca.museum","manchester.museum","mansion.museum","mansions.museum","manx.museum","marburg.museum","maritime.museum","maritimo.museum","maryland.museum","marylhurst.museum","media.museum","medical.museum","medizinhistorisches.museum","meeres.museum","memorial.museum","mesaverde.museum","michigan.museum","midatlantic.museum","military.museum","mill.museum","miners.museum","mining.museum","minnesota.museum","missile.museum","missoula.museum","modern.museum","moma.museum","money.museum","monmouth.museum","monticello.museum","montreal.museum","moscow.museum","motorcycle.museum","muenchen.museum","muenster.museum","mulhouse.museum","muncie.museum","museet.museum","museumcenter.museum","museumvereniging.museum","music.museum","national.museum","nationalfirearms.museum","nationalheritage.museum","nativeamerican.museum","naturalhistory.museum","naturalhistorymuseum.museum","naturalsciences.museum","nature.museum","naturhistorisches.museum","natuurwetenschappen.museum","naumburg.museum","naval.museum","nebraska.museum","neues.museum","newhampshire.museum","newjersey.museum","newmexico.museum","newport.museum","newspaper.museum","newyork.museum","niepce.museum","norfolk.museum","north.museum","nrw.museum","nyc.museum","nyny.museum","oceanographic.museum","oceanographique.museum","omaha.museum","online.museum","ontario.museum","openair.museum","oregon.museum","oregontrail.museum","otago.museum","oxford.museum","pacific.museum","paderborn.museum","palace.museum","paleo.museum","palmsprings.museum","panama.museum","paris.museum","pasadena.museum","pharmacy.museum","philadelphia.museum","philadelphiaarea.museum","philately.museum","phoenix.museum","photography.museum","pilots.museum","pittsburgh.museum","planetarium.museum","plantation.museum","plants.museum","plaza.museum","portal.museum","portland.museum","portlligat.museum","posts-and-telecommunications.museum","preservation.museum","presidio.museum","press.museum","project.museum","public.museum","pubol.museum","quebec.museum","railroad.museum","railway.museum","research.museum","resistance.museum","riodejaneiro.museum","rochester.museum","rockart.museum","roma.museum","russia.museum","saintlouis.museum","salem.museum","salvadordali.museum","salzburg.museum","sandiego.museum","sanfrancisco.museum","santabarbara.museum","santacruz.museum","santafe.museum","saskatchewan.museum","satx.museum","savannahga.museum","schlesisches.museum","schoenbrunn.museum","schokoladen.museum","school.museum","schweiz.museum","science.museum","scienceandhistory.museum","scienceandindustry.museum","sciencecenter.museum","sciencecenters.museum","science-fiction.museum","sciencehistory.museum","sciences.museum","sciencesnaturelles.museum","scotland.museum","seaport.museum","settlement.museum","settlers.museum","shell.museum","sherbrooke.museum","sibenik.museum","silk.museum","ski.museum","skole.museum","society.museum","sologne.museum","soundandvision.museum","southcarolina.museum","southwest.museum","space.museum","spy.museum","square.museum","stadt.museum","stalbans.museum","starnberg.museum","state.museum","stateofdelaware.museum","station.museum","steam.museum","steiermark.museum","stjohn.museum","stockholm.museum","stpetersburg.museum","stuttgart.museum","suisse.museum","surgeonshall.museum","surrey.museum","svizzera.museum","sweden.museum","sydney.museum","tank.museum","tcm.museum","technology.museum","telekommunikation.museum","television.museum","texas.museum","textile.museum","theater.museum","time.museum","timekeeping.museum","topology.museum","torino.museum","touch.museum","town.museum","transport.museum","tree.museum","trolley.museum","trust.museum","trustee.museum","uhren.museum","ulm.museum","undersea.museum","university.museum","usa.museum","usantiques.museum","usarts.museum","uscountryestate.museum","usculture.museum","usdecorativearts.museum","usgarden.museum","ushistory.museum","ushuaia.museum","uslivinghistory.museum","utah.museum","uvic.museum","valley.museum","vantaa.museum","versailles.museum","viking.museum","village.museum","virginia.museum","virtual.museum","virtuel.museum","vlaanderen.museum","volkenkunde.museum","wales.museum","wallonie.museum","war.museum","washingtondc.museum","watchandclock.museum","watch-and-clock.museum","western.museum","westfalen.museum","whaling.museum","wildlife.museum","williamsburg.museum","windmill.museum","workshop.museum","york.museum","yorkshire.museum","yosemite.museum","youth.museum","zoological.museum","zoology.museum","ירושלים.museum","иком.museum","mv","aero.mv","biz.mv","com.mv","coop.mv","edu.mv","gov.mv","info.mv","int.mv","mil.mv","museum.mv","name.mv","net.mv","org.mv","pro.mv","mw","ac.mw","biz.mw","co.mw","com.mw","coop.mw","edu.mw","gov.mw","int.mw","museum.mw","net.mw","org.mw","mx","com.mx","org.mx","gob.mx","edu.mx","net.mx","my","com.my","net.my","org.my","gov.my","edu.my","mil.my","name.my","mz","ac.mz","adv.mz","co.mz","edu.mz","gov.mz","mil.mz","net.mz","org.mz","na","info.na","pro.na","name.na","school.na","or.na","dr.na","us.na","mx.na","ca.na","in.na","cc.na","tv.na","ws.na","mobi.na","co.na","com.na","org.na","name","nc","asso.nc","nom.nc","ne","net","nf","com.nf","net.nf","per.nf","rec.nf","web.nf","arts.nf","firm.nf","info.nf","other.nf","store.nf","ng","com.ng","edu.ng","gov.ng","i.ng","mil.ng","mobi.ng","name.ng","net.ng","org.ng","sch.ng","ni","ac.ni","biz.ni","co.ni","com.ni","edu.ni","gob.ni","in.ni","info.ni","int.ni","mil.ni","net.ni","nom.ni","org.ni","web.ni","nl","no","fhs.no","vgs.no","fylkesbibl.no","folkebibl.no","museum.no","idrett.no","priv.no","mil.no","stat.no","dep.no","kommune.no","herad.no","aa.no","ah.no","bu.no","fm.no","hl.no","hm.no","jan-mayen.no","mr.no","nl.no","nt.no","of.no","ol.no","oslo.no","rl.no","sf.no","st.no","svalbard.no","tm.no","tr.no","va.no","vf.no","gs.aa.no","gs.ah.no","gs.bu.no","gs.fm.no","gs.hl.no","gs.hm.no","gs.jan-mayen.no","gs.mr.no","gs.nl.no","gs.nt.no","gs.of.no","gs.ol.no","gs.oslo.no","gs.rl.no","gs.sf.no","gs.st.no","gs.svalbard.no","gs.tm.no","gs.tr.no","gs.va.no","gs.vf.no","akrehamn.no","åkrehamn.no","algard.no","ålgård.no","arna.no","brumunddal.no","bryne.no","bronnoysund.no","brønnøysund.no","drobak.no","drøbak.no","egersund.no","fetsund.no","floro.no","florø.no","fredrikstad.no","hokksund.no","honefoss.no","hønefoss.no","jessheim.no","jorpeland.no","jørpeland.no","kirkenes.no","kopervik.no","krokstadelva.no","langevag.no","langevåg.no","leirvik.no","mjondalen.no","mjøndalen.no","mo-i-rana.no","mosjoen.no","mosjøen.no","nesoddtangen.no","orkanger.no","osoyro.no","osøyro.no","raholt.no","råholt.no","sandnessjoen.no","sandnessjøen.no","skedsmokorset.no","slattum.no","spjelkavik.no","stathelle.no","stavern.no","stjordalshalsen.no","stjørdalshalsen.no","tananger.no","tranby.no","vossevangen.no","afjord.no","åfjord.no","agdenes.no","al.no","ål.no","alesund.no","ålesund.no","alstahaug.no","alta.no","áltá.no","alaheadju.no","álaheadju.no","alvdal.no","amli.no","åmli.no","amot.no","åmot.no","andebu.no","andoy.no","andøy.no","andasuolo.no","ardal.no","årdal.no","aremark.no","arendal.no","ås.no","aseral.no","åseral.no","asker.no","askim.no","askvoll.no","askoy.no","askøy.no","asnes.no","åsnes.no","audnedaln.no","aukra.no","aure.no","aurland.no","aurskog-holand.no","aurskog-høland.no","austevoll.no","austrheim.no","averoy.no","averøy.no","balestrand.no","ballangen.no","balat.no","bálát.no","balsfjord.no","bahccavuotna.no","báhccavuotna.no","bamble.no","bardu.no","beardu.no","beiarn.no","bajddar.no","bájddar.no","baidar.no","báidár.no","berg.no","bergen.no","berlevag.no","berlevåg.no","bearalvahki.no","bearalváhki.no","bindal.no","birkenes.no","bjarkoy.no","bjarkøy.no","bjerkreim.no","bjugn.no","bodo.no","bodø.no","badaddja.no","bådåddjå.no","budejju.no","bokn.no","bremanger.no","bronnoy.no","brønnøy.no","bygland.no","bykle.no","barum.no","bærum.no","bo.telemark.no","bø.telemark.no","bo.nordland.no","bø.nordland.no","bievat.no","bievát.no","bomlo.no","bømlo.no","batsfjord.no","båtsfjord.no","bahcavuotna.no","báhcavuotna.no","dovre.no","drammen.no","drangedal.no","dyroy.no","dyrøy.no","donna.no","dønna.no","eid.no","eidfjord.no","eidsberg.no","eidskog.no","eidsvoll.no","eigersund.no","elverum.no","enebakk.no","engerdal.no","etne.no","etnedal.no","evenes.no","evenassi.no","evenášši.no","evje-og-hornnes.no","farsund.no","fauske.no","fuossko.no","fuoisku.no","fedje.no","fet.no","finnoy.no","finnøy.no","fitjar.no","fjaler.no","fjell.no","flakstad.no","flatanger.no","flekkefjord.no","flesberg.no","flora.no","fla.no","flå.no","folldal.no","forsand.no","fosnes.no","frei.no","frogn.no","froland.no","frosta.no","frana.no","fræna.no","froya.no","frøya.no","fusa.no","fyresdal.no","forde.no","førde.no","gamvik.no","gangaviika.no","gáŋgaviika.no","gaular.no","gausdal.no","gildeskal.no","gildeskål.no","giske.no","gjemnes.no","gjerdrum.no","gjerstad.no","gjesdal.no","gjovik.no","gjøvik.no","gloppen.no","gol.no","gran.no","grane.no","granvin.no","gratangen.no","grimstad.no","grong.no","kraanghke.no","kråanghke.no","grue.no","gulen.no","hadsel.no","halden.no","halsa.no","hamar.no","hamaroy.no","habmer.no","hábmer.no","hapmir.no","hápmir.no","hammerfest.no","hammarfeasta.no","hámmárfeasta.no","haram.no","hareid.no","harstad.no","hasvik.no","aknoluokta.no","ákŋoluokta.no","hattfjelldal.no","aarborte.no","haugesund.no","hemne.no","hemnes.no","hemsedal.no","heroy.more-og-romsdal.no","herøy.møre-og-romsdal.no","heroy.nordland.no","herøy.nordland.no","hitra.no","hjartdal.no","hjelmeland.no","hobol.no","hobøl.no","hof.no","hol.no","hole.no","holmestrand.no","holtalen.no","holtålen.no","hornindal.no","horten.no","hurdal.no","hurum.no","hvaler.no","hyllestad.no","hagebostad.no","hægebostad.no","hoyanger.no","høyanger.no","hoylandet.no","høylandet.no","ha.no","hå.no","ibestad.no","inderoy.no","inderøy.no","iveland.no","jevnaker.no","jondal.no","jolster.no","jølster.no","karasjok.no","karasjohka.no","kárášjohka.no","karlsoy.no","galsa.no","gálsá.no","karmoy.no","karmøy.no","kautokeino.no","guovdageaidnu.no","klepp.no","klabu.no","klæbu.no","kongsberg.no","kongsvinger.no","kragero.no","kragerø.no","kristiansand.no","kristiansund.no","krodsherad.no","krødsherad.no","kvalsund.no","rahkkeravju.no","ráhkkerávju.no","kvam.no","kvinesdal.no","kvinnherad.no","kviteseid.no","kvitsoy.no","kvitsøy.no","kvafjord.no","kvæfjord.no","giehtavuoatna.no","kvanangen.no","kvænangen.no","navuotna.no","návuotna.no","kafjord.no","kåfjord.no","gaivuotna.no","gáivuotna.no","larvik.no","lavangen.no","lavagis.no","loabat.no","loabát.no","lebesby.no","davvesiida.no","leikanger.no","leirfjord.no","leka.no","leksvik.no","lenvik.no","leangaviika.no","leaŋgaviika.no","lesja.no","levanger.no","lier.no","lierne.no","lillehammer.no","lillesand.no","lindesnes.no","lindas.no","lindås.no","lom.no","loppa.no","lahppi.no","láhppi.no","lund.no","lunner.no","luroy.no","lurøy.no","luster.no","lyngdal.no","lyngen.no","ivgu.no","lardal.no","lerdal.no","lærdal.no","lodingen.no","lødingen.no","lorenskog.no","lørenskog.no","loten.no","løten.no","malvik.no","masoy.no","måsøy.no","muosat.no","muosát.no","mandal.no","marker.no","marnardal.no","masfjorden.no","meland.no","meldal.no","melhus.no","meloy.no","meløy.no","meraker.no","meråker.no","moareke.no","moåreke.no","midsund.no","midtre-gauldal.no","modalen.no","modum.no","molde.no","moskenes.no","moss.no","mosvik.no","malselv.no","målselv.no","malatvuopmi.no","málatvuopmi.no","namdalseid.no","aejrie.no","namsos.no","namsskogan.no","naamesjevuemie.no","nååmesjevuemie.no","laakesvuemie.no","nannestad.no","narvik.no","narviika.no","naustdal.no","nedre-eiker.no","nes.akershus.no","nes.buskerud.no","nesna.no","nesodden.no","nesseby.no","unjarga.no","unjárga.no","nesset.no","nissedal.no","nittedal.no","nord-aurdal.no","nord-fron.no","nord-odal.no","norddal.no","nordkapp.no","davvenjarga.no","davvenjárga.no","nordre-land.no","nordreisa.no","raisa.no","ráisa.no","nore-og-uvdal.no","notodden.no","naroy.no","nærøy.no","notteroy.no","nøtterøy.no","odda.no","oksnes.no","øksnes.no","oppdal.no","oppegard.no","oppegård.no","orkdal.no","orland.no","ørland.no","orskog.no","ørskog.no","orsta.no","ørsta.no","os.hedmark.no","os.hordaland.no","osen.no","osteroy.no","osterøy.no","ostre-toten.no","østre-toten.no","overhalla.no","ovre-eiker.no","øvre-eiker.no","oyer.no","øyer.no","oygarden.no","øygarden.no","oystre-slidre.no","øystre-slidre.no","porsanger.no","porsangu.no","porsáŋgu.no","porsgrunn.no","radoy.no","radøy.no","rakkestad.no","rana.no","ruovat.no","randaberg.no","rauma.no","rendalen.no","rennebu.no","rennesoy.no","rennesøy.no","rindal.no","ringebu.no","ringerike.no","ringsaker.no","rissa.no","risor.no","risør.no","roan.no","rollag.no","rygge.no","ralingen.no","rælingen.no","rodoy.no","rødøy.no","romskog.no","rømskog.no","roros.no","røros.no","rost.no","røst.no","royken.no","røyken.no","royrvik.no","røyrvik.no","rade.no","råde.no","salangen.no","siellak.no","saltdal.no","salat.no","sálát.no","sálat.no","samnanger.no","sande.more-og-romsdal.no","sande.møre-og-romsdal.no","sande.vestfold.no","sandefjord.no","sandnes.no","sandoy.no","sandøy.no","sarpsborg.no","sauda.no","sauherad.no","sel.no","selbu.no","selje.no","seljord.no","sigdal.no","siljan.no","sirdal.no","skaun.no","skedsmo.no","ski.no","skien.no","skiptvet.no","skjervoy.no","skjervøy.no","skierva.no","skiervá.no","skjak.no","skjåk.no","skodje.no","skanland.no","skånland.no","skanit.no","skánit.no","smola.no","smøla.no","snillfjord.no","snasa.no","snåsa.no","snoasa.no","snaase.no","snåase.no","sogndal.no","sokndal.no","sola.no","solund.no","songdalen.no","sortland.no","spydeberg.no","stange.no","stavanger.no","steigen.no","steinkjer.no","stjordal.no","stjørdal.no","stokke.no","stor-elvdal.no","stord.no","stordal.no","storfjord.no","omasvuotna.no","strand.no","stranda.no","stryn.no","sula.no","suldal.no","sund.no","sunndal.no","surnadal.no","sveio.no","svelvik.no","sykkylven.no","sogne.no","søgne.no","somna.no","sømna.no","sondre-land.no","søndre-land.no","sor-aurdal.no","sør-aurdal.no","sor-fron.no","sør-fron.no","sor-odal.no","sør-odal.no","sor-varanger.no","sør-varanger.no","matta-varjjat.no","mátta-várjjat.no","sorfold.no","sørfold.no","sorreisa.no","sørreisa.no","sorum.no","sørum.no","tana.no","deatnu.no","time.no","tingvoll.no","tinn.no","tjeldsund.no","dielddanuorri.no","tjome.no","tjøme.no","tokke.no","tolga.no","torsken.no","tranoy.no","tranøy.no","tromso.no","tromsø.no","tromsa.no","romsa.no","trondheim.no","troandin.no","trysil.no","trana.no","træna.no","trogstad.no","trøgstad.no","tvedestrand.no","tydal.no","tynset.no","tysfjord.no","divtasvuodna.no","divttasvuotna.no","tysnes.no","tysvar.no","tysvær.no","tonsberg.no","tønsberg.no","ullensaker.no","ullensvang.no","ulvik.no","utsira.no","vadso.no","vadsø.no","cahcesuolo.no","čáhcesuolo.no","vaksdal.no","valle.no","vang.no","vanylven.no","vardo.no","vardø.no","varggat.no","várggát.no","vefsn.no","vaapste.no","vega.no","vegarshei.no","vegårshei.no","vennesla.no","verdal.no","verran.no","vestby.no","vestnes.no","vestre-slidre.no","vestre-toten.no","vestvagoy.no","vestvågøy.no","vevelstad.no","vik.no","vikna.no","vindafjord.no","volda.no","voss.no","varoy.no","værøy.no","vagan.no","vågan.no","voagat.no","vagsoy.no","vågsøy.no","vaga.no","vågå.no","valer.ostfold.no","våler.østfold.no","valer.hedmark.no","våler.hedmark.no","*.np","nr","biz.nr","info.nr","gov.nr","edu.nr","org.nr","net.nr","com.nr","nu","nz","ac.nz","co.nz","cri.nz","geek.nz","gen.nz","govt.nz","health.nz","iwi.nz","kiwi.nz","maori.nz","mil.nz","māori.nz","net.nz","org.nz","parliament.nz","school.nz","om","co.om","com.om","edu.om","gov.om","med.om","museum.om","net.om","org.om","pro.om","onion","org","pa","ac.pa","gob.pa","com.pa","org.pa","sld.pa","edu.pa","net.pa","ing.pa","abo.pa","med.pa","nom.pa","pe","edu.pe","gob.pe","nom.pe","mil.pe","org.pe","com.pe","net.pe","pf","com.pf","org.pf","edu.pf","*.pg","ph","com.ph","net.ph","org.ph","gov.ph","edu.ph","ngo.ph","mil.ph","i.ph","pk","com.pk","net.pk","edu.pk","org.pk","fam.pk","biz.pk","web.pk","gov.pk","gob.pk","gok.pk","gon.pk","gop.pk","gos.pk","info.pk","pl","com.pl","net.pl","org.pl","aid.pl","agro.pl","atm.pl","auto.pl","biz.pl","edu.pl","gmina.pl","gsm.pl","info.pl","mail.pl","miasta.pl","media.pl","mil.pl","nieruchomosci.pl","nom.pl","pc.pl","powiat.pl","priv.pl","realestate.pl","rel.pl","sex.pl","shop.pl","sklep.pl","sos.pl","szkola.pl","targi.pl","tm.pl","tourism.pl","travel.pl","turystyka.pl","gov.pl","ap.gov.pl","ic.gov.pl","is.gov.pl","us.gov.pl","kmpsp.gov.pl","kppsp.gov.pl","kwpsp.gov.pl","psp.gov.pl","wskr.gov.pl","kwp.gov.pl","mw.gov.pl","ug.gov.pl","um.gov.pl","umig.gov.pl","ugim.gov.pl","upow.gov.pl","uw.gov.pl","starostwo.gov.pl","pa.gov.pl","po.gov.pl","psse.gov.pl","pup.gov.pl","rzgw.gov.pl","sa.gov.pl","so.gov.pl","sr.gov.pl","wsa.gov.pl","sko.gov.pl","uzs.gov.pl","wiih.gov.pl","winb.gov.pl","pinb.gov.pl","wios.gov.pl","witd.gov.pl","wzmiuw.gov.pl","piw.gov.pl","wiw.gov.pl","griw.gov.pl","wif.gov.pl","oum.gov.pl","sdn.gov.pl","zp.gov.pl","uppo.gov.pl","mup.gov.pl","wuoz.gov.pl","konsulat.gov.pl","oirm.gov.pl","augustow.pl","babia-gora.pl","bedzin.pl","beskidy.pl","bialowieza.pl","bialystok.pl","bielawa.pl","bieszczady.pl","boleslawiec.pl","bydgoszcz.pl","bytom.pl","cieszyn.pl","czeladz.pl","czest.pl","dlugoleka.pl","elblag.pl","elk.pl","glogow.pl","gniezno.pl","gorlice.pl","grajewo.pl","ilawa.pl","jaworzno.pl","jelenia-gora.pl","jgora.pl","kalisz.pl","kazimierz-dolny.pl","karpacz.pl","kartuzy.pl","kaszuby.pl","katowice.pl","kepno.pl","ketrzyn.pl","klodzko.pl","kobierzyce.pl","kolobrzeg.pl","konin.pl","konskowola.pl","kutno.pl","lapy.pl","lebork.pl","legnica.pl","lezajsk.pl","limanowa.pl","lomza.pl","lowicz.pl","lubin.pl","lukow.pl","malbork.pl","malopolska.pl","mazowsze.pl","mazury.pl","mielec.pl","mielno.pl","mragowo.pl","naklo.pl","nowaruda.pl","nysa.pl","olawa.pl","olecko.pl","olkusz.pl","olsztyn.pl","opoczno.pl","opole.pl","ostroda.pl","ostroleka.pl","ostrowiec.pl","ostrowwlkp.pl","pila.pl","pisz.pl","podhale.pl","podlasie.pl","polkowice.pl","pomorze.pl","pomorskie.pl","prochowice.pl","pruszkow.pl","przeworsk.pl","pulawy.pl","radom.pl","rawa-maz.pl","rybnik.pl","rzeszow.pl","sanok.pl","sejny.pl","slask.pl","slupsk.pl","sosnowiec.pl","stalowa-wola.pl","skoczow.pl","starachowice.pl","stargard.pl","suwalki.pl","swidnica.pl","swiebodzin.pl","swinoujscie.pl","szczecin.pl","szczytno.pl","tarnobrzeg.pl","tgory.pl","turek.pl","tychy.pl","ustka.pl","walbrzych.pl","warmia.pl","warszawa.pl","waw.pl","wegrow.pl","wielun.pl","wlocl.pl","wloclawek.pl","wodzislaw.pl","wolomin.pl","wroclaw.pl","zachpomor.pl","zagan.pl","zarow.pl","zgora.pl","zgorzelec.pl","pm","pn","gov.pn","co.pn","org.pn","edu.pn","net.pn","post","pr","com.pr","net.pr","org.pr","gov.pr","edu.pr","isla.pr","pro.pr","biz.pr","info.pr","name.pr","est.pr","prof.pr","ac.pr","pro","aaa.pro","aca.pro","acct.pro","avocat.pro","bar.pro","cpa.pro","eng.pro","jur.pro","law.pro","med.pro","recht.pro","ps","edu.ps","gov.ps","sec.ps","plo.ps","com.ps","org.ps","net.ps","pt","net.pt","gov.pt","org.pt","edu.pt","int.pt","publ.pt","com.pt","nome.pt","pw","co.pw","ne.pw","or.pw","ed.pw","go.pw","belau.pw","py","com.py","coop.py","edu.py","gov.py","mil.py","net.py","org.py","qa","com.qa","edu.qa","gov.qa","mil.qa","name.qa","net.qa","org.qa","sch.qa","re","asso.re","com.re","nom.re","ro","arts.ro","com.ro","firm.ro","info.ro","nom.ro","nt.ro","org.ro","rec.ro","store.ro","tm.ro","www.ro","rs","ac.rs","co.rs","edu.rs","gov.rs","in.rs","org.rs","ru","rw","ac.rw","co.rw","coop.rw","gov.rw","mil.rw","net.rw","org.rw","sa","com.sa","net.sa","org.sa","gov.sa","med.sa","pub.sa","edu.sa","sch.sa","sb","com.sb","edu.sb","gov.sb","net.sb","org.sb","sc","com.sc","gov.sc","net.sc","org.sc","edu.sc","sd","com.sd","net.sd","org.sd","edu.sd","med.sd","tv.sd","gov.sd","info.sd","se","a.se","ac.se","b.se","bd.se","brand.se","c.se","d.se","e.se","f.se","fh.se","fhsk.se","fhv.se","g.se","h.se","i.se","k.se","komforb.se","kommunalforbund.se","komvux.se","l.se","lanbib.se","m.se","n.se","naturbruksgymn.se","o.se","org.se","p.se","parti.se","pp.se","press.se","r.se","s.se","t.se","tm.se","u.se","w.se","x.se","y.se","z.se","sg","com.sg","net.sg","org.sg","gov.sg","edu.sg","per.sg","sh","com.sh","net.sh","gov.sh","org.sh","mil.sh","si","sj","sk","sl","com.sl","net.sl","edu.sl","gov.sl","org.sl","sm","sn","art.sn","com.sn","edu.sn","gouv.sn","org.sn","perso.sn","univ.sn","so","com.so","edu.so","gov.so","me.so","net.so","org.so","sr","ss","biz.ss","com.ss","edu.ss","gov.ss","net.ss","org.ss","st","co.st","com.st","consulado.st","edu.st","embaixada.st","gov.st","mil.st","net.st","org.st","principe.st","saotome.st","store.st","su","sv","com.sv","edu.sv","gob.sv","org.sv","red.sv","sx","gov.sx","sy","edu.sy","gov.sy","net.sy","mil.sy","com.sy","org.sy","sz","co.sz","ac.sz","org.sz","tc","td","tel","tf","tg","th","ac.th","co.th","go.th","in.th","mi.th","net.th","or.th","tj","ac.tj","biz.tj","co.tj","com.tj","edu.tj","go.tj","gov.tj","int.tj","mil.tj","name.tj","net.tj","nic.tj","org.tj","test.tj","web.tj","tk","tl","gov.tl","tm","com.tm","co.tm","org.tm","net.tm","nom.tm","gov.tm","mil.tm","edu.tm","tn","com.tn","ens.tn","fin.tn","gov.tn","ind.tn","intl.tn","nat.tn","net.tn","org.tn","info.tn","perso.tn","tourism.tn","edunet.tn","rnrt.tn","rns.tn","rnu.tn","mincom.tn","agrinet.tn","defense.tn","turen.tn","to","com.to","gov.to","net.to","org.to","edu.to","mil.to","tr","av.tr","bbs.tr","bel.tr","biz.tr","com.tr","dr.tr","edu.tr","gen.tr","gov.tr","info.tr","mil.tr","k12.tr","kep.tr","name.tr","net.tr","org.tr","pol.tr","tel.tr","tsk.tr","tv.tr","web.tr","nc.tr","gov.nc.tr","tt","co.tt","com.tt","org.tt","net.tt","biz.tt","info.tt","pro.tt","int.tt","coop.tt","jobs.tt","mobi.tt","travel.tt","museum.tt","aero.tt","name.tt","gov.tt","edu.tt","tv","tw","edu.tw","gov.tw","mil.tw","com.tw","net.tw","org.tw","idv.tw","game.tw","ebiz.tw","club.tw","網路.tw","組織.tw","商業.tw","tz","ac.tz","co.tz","go.tz","hotel.tz","info.tz","me.tz","mil.tz","mobi.tz","ne.tz","or.tz","sc.tz","tv.tz","ua","com.ua","edu.ua","gov.ua","in.ua","net.ua","org.ua","cherkassy.ua","cherkasy.ua","chernigov.ua","chernihiv.ua","chernivtsi.ua","chernovtsy.ua","ck.ua","cn.ua","cr.ua","crimea.ua","cv.ua","dn.ua","dnepropetrovsk.ua","dnipropetrovsk.ua","dominic.ua","donetsk.ua","dp.ua","if.ua","ivano-frankivsk.ua","kh.ua","kharkiv.ua","kharkov.ua","kherson.ua","khmelnitskiy.ua","khmelnytskyi.ua","kiev.ua","kirovograd.ua","km.ua","kr.ua","krym.ua","ks.ua","kv.ua","kyiv.ua","lg.ua","lt.ua","lugansk.ua","lutsk.ua","lv.ua","lviv.ua","mk.ua","mykolaiv.ua","nikolaev.ua","od.ua","odesa.ua","odessa.ua","pl.ua","poltava.ua","rivne.ua","rovno.ua","rv.ua","sb.ua","sebastopol.ua","sevastopol.ua","sm.ua","sumy.ua","te.ua","ternopil.ua","uz.ua","uzhgorod.ua","vinnica.ua","vinnytsia.ua","vn.ua","volyn.ua","yalta.ua","zaporizhzhe.ua","zaporizhzhia.ua","zhitomir.ua","zhytomyr.ua","zp.ua","zt.ua","ug","co.ug","or.ug","ac.ug","sc.ug","go.ug","ne.ug","com.ug","org.ug","uk","ac.uk","co.uk","gov.uk","ltd.uk","me.uk","net.uk","nhs.uk","org.uk","plc.uk","police.uk","*.sch.uk","us","dni.us","fed.us","isa.us","kids.us","nsn.us","ak.us","al.us","ar.us","as.us","az.us","ca.us","co.us","ct.us","dc.us","de.us","fl.us","ga.us","gu.us","hi.us","ia.us","id.us","il.us","in.us","ks.us","ky.us","la.us","ma.us","md.us","me.us","mi.us","mn.us","mo.us","ms.us","mt.us","nc.us","nd.us","ne.us","nh.us","nj.us","nm.us","nv.us","ny.us","oh.us","ok.us","or.us","pa.us","pr.us","ri.us","sc.us","sd.us","tn.us","tx.us","ut.us","vi.us","vt.us","va.us","wa.us","wi.us","wv.us","wy.us","k12.ak.us","k12.al.us","k12.ar.us","k12.as.us","k12.az.us","k12.ca.us","k12.co.us","k12.ct.us","k12.dc.us","k12.de.us","k12.fl.us","k12.ga.us","k12.gu.us","k12.ia.us","k12.id.us","k12.il.us","k12.in.us","k12.ks.us","k12.ky.us","k12.la.us","k12.ma.us","k12.md.us","k12.me.us","k12.mi.us","k12.mn.us","k12.mo.us","k12.ms.us","k12.mt.us","k12.nc.us","k12.ne.us","k12.nh.us","k12.nj.us","k12.nm.us","k12.nv.us","k12.ny.us","k12.oh.us","k12.ok.us","k12.or.us","k12.pa.us","k12.pr.us","k12.ri.us","k12.sc.us","k12.tn.us","k12.tx.us","k12.ut.us","k12.vi.us","k12.vt.us","k12.va.us","k12.wa.us","k12.wi.us","k12.wy.us","cc.ak.us","cc.al.us","cc.ar.us","cc.as.us","cc.az.us","cc.ca.us","cc.co.us","cc.ct.us","cc.dc.us","cc.de.us","cc.fl.us","cc.ga.us","cc.gu.us","cc.hi.us","cc.ia.us","cc.id.us","cc.il.us","cc.in.us","cc.ks.us","cc.ky.us","cc.la.us","cc.ma.us","cc.md.us","cc.me.us","cc.mi.us","cc.mn.us","cc.mo.us","cc.ms.us","cc.mt.us","cc.nc.us","cc.nd.us","cc.ne.us","cc.nh.us","cc.nj.us","cc.nm.us","cc.nv.us","cc.ny.us","cc.oh.us","cc.ok.us","cc.or.us","cc.pa.us","cc.pr.us","cc.ri.us","cc.sc.us","cc.sd.us","cc.tn.us","cc.tx.us","cc.ut.us","cc.vi.us","cc.vt.us","cc.va.us","cc.wa.us","cc.wi.us","cc.wv.us","cc.wy.us","lib.ak.us","lib.al.us","lib.ar.us","lib.as.us","lib.az.us","lib.ca.us","lib.co.us","lib.ct.us","lib.dc.us","lib.fl.us","lib.ga.us","lib.gu.us","lib.hi.us","lib.ia.us","lib.id.us","lib.il.us","lib.in.us","lib.ks.us","lib.ky.us","lib.la.us","lib.ma.us","lib.md.us","lib.me.us","lib.mi.us","lib.mn.us","lib.mo.us","lib.ms.us","lib.mt.us","lib.nc.us","lib.nd.us","lib.ne.us","lib.nh.us","lib.nj.us","lib.nm.us","lib.nv.us","lib.ny.us","lib.oh.us","lib.ok.us","lib.or.us","lib.pa.us","lib.pr.us","lib.ri.us","lib.sc.us","lib.sd.us","lib.tn.us","lib.tx.us","lib.ut.us","lib.vi.us","lib.vt.us","lib.va.us","lib.wa.us","lib.wi.us","lib.wy.us","pvt.k12.ma.us","chtr.k12.ma.us","paroch.k12.ma.us","ann-arbor.mi.us","cog.mi.us","dst.mi.us","eaton.mi.us","gen.mi.us","mus.mi.us","tec.mi.us","washtenaw.mi.us","uy","com.uy","edu.uy","gub.uy","mil.uy","net.uy","org.uy","uz","co.uz","com.uz","net.uz","org.uz","va","vc","com.vc","net.vc","org.vc","gov.vc","mil.vc","edu.vc","ve","arts.ve","co.ve","com.ve","e12.ve","edu.ve","firm.ve","gob.ve","gov.ve","info.ve","int.ve","mil.ve","net.ve","org.ve","rec.ve","store.ve","tec.ve","web.ve","vg","vi","co.vi","com.vi","k12.vi","net.vi","org.vi","vn","com.vn","net.vn","org.vn","edu.vn","gov.vn","int.vn","ac.vn","biz.vn","info.vn","name.vn","pro.vn","health.vn","vu","com.vu","edu.vu","net.vu","org.vu","wf","ws","com.ws","net.ws","org.ws","gov.ws","edu.ws","yt","امارات","հայ","বাংলা","бг","бел","中国","中國","الجزائر","مصر","ею","ευ","موريتانيا","გე","ελ","香港","公司.香港","教育.香港","政府.香港","個人.香港","網絡.香港","組織.香港","ಭಾರತ","ଭାରତ","ভাৰত","भारतम्","भारोत","ڀارت","ഭാരതം","भारत","بارت","بھارت","భారత్","ભારત","ਭਾਰਤ","ভারত","இந்தியா","ایران","ايران","عراق","الاردن","한국","қаз","ලංකා","இலங்கை","المغرب","мкд","мон","澳門","澳门","مليسيا","عمان","پاکستان","پاكستان","فلسطين","срб","пр.срб","орг.срб","обр.срб","од.срб","упр.срб","ак.срб","рф","قطر","السعودية","السعودیة","السعودیۃ","السعوديه","سودان","新加坡","சிங்கப்பூர்","سورية","سوريا","ไทย","ศึกษา.ไทย","ธุรกิจ.ไทย","รัฐบาล.ไทย","ทหาร.ไทย","เน็ต.ไทย","องค์กร.ไทย","تونس","台灣","台湾","臺灣","укр","اليمن","xxx","*.ye","ac.za","agric.za","alt.za","co.za","edu.za","gov.za","grondar.za","law.za","mil.za","net.za","ngo.za","nic.za","nis.za","nom.za","org.za","school.za","tm.za","web.za","zm","ac.zm","biz.zm","co.zm","com.zm","edu.zm","gov.zm","info.zm","mil.zm","net.zm","org.zm","sch.zm","zw","ac.zw","co.zw","gov.zw","mil.zw","org.zw","aaa","aarp","abarth","abb","abbott","abbvie","abc","able","abogado","abudhabi","academy","accenture","accountant","accountants","aco","actor","adac","ads","adult","aeg","aetna","afamilycompany","afl","africa","agakhan","agency","aig","aigo","airbus","airforce","airtel","akdn","alfaromeo","alibaba","alipay","allfinanz","allstate","ally","alsace","alstom","amazon","americanexpress","americanfamily","amex","amfam","amica","amsterdam","analytics","android","anquan","anz","aol","apartments","app","apple","aquarelle","arab","aramco","archi","army","art","arte","asda","associates","athleta","attorney","auction","audi","audible","audio","auspost","author","auto","autos","avianca","aws","axa","azure","baby","baidu","banamex","bananarepublic","band","bank","bar","barcelona","barclaycard","barclays","barefoot","bargains","baseball","basketball","bauhaus","bayern","bbc","bbt","bbva","bcg","bcn","beats","beauty","beer","bentley","berlin","best","bestbuy","bet","bharti","bible","bid","bike","bing","bingo","bio","black","blackfriday","blockbuster","blog","bloomberg","blue","bms","bmw","bnpparibas","boats","boehringer","bofa","bom","bond","boo","book","booking","bosch","bostik","boston","bot","boutique","box","bradesco","bridgestone","broadway","broker","brother","brussels","budapest","bugatti","build","builders","business","buy","buzz","bzh","cab","cafe","cal","call","calvinklein","cam","camera","camp","cancerresearch","canon","capetown","capital","capitalone","car","caravan","cards","care","career","careers","cars","casa","case","caseih","cash","casino","catering","catholic","cba","cbn","cbre","cbs","ceb","center","ceo","cern","cfa","cfd","chanel","channel","charity","chase","chat","cheap","chintai","christmas","chrome","church","cipriani","circle","cisco","citadel","citi","citic","city","cityeats","claims","cleaning","click","clinic","clinique","clothing","cloud","club","clubmed","coach","codes","coffee","college","cologne","comcast","commbank","community","company","compare","computer","comsec","condos","construction","consulting","contact","contractors","cooking","cookingchannel","cool","corsica","country","coupon","coupons","courses","cpa","credit","creditcard","creditunion","cricket","crown","crs","cruise","cruises","csc","cuisinella","cymru","cyou","dabur","dad","dance","data","date","dating","datsun","day","dclk","dds","deal","dealer","deals","degree","delivery","dell","deloitte","delta","democrat","dental","dentist","desi","design","dev","dhl","diamonds","diet","digital","direct","directory","discount","discover","dish","diy","dnp","docs","doctor","dog","domains","dot","download","drive","dtv","dubai","duck","dunlop","dupont","durban","dvag","dvr","earth","eat","eco","edeka","education","email","emerck","energy","engineer","engineering","enterprises","epson","equipment","ericsson","erni","esq","estate","esurance","etisalat","eurovision","eus","events","exchange","expert","exposed","express","extraspace","fage","fail","fairwinds","faith","family","fan","fans","farm","farmers","fashion","fast","fedex","feedback","ferrari","ferrero","fiat","fidelity","fido","film","final","finance","financial","fire","firestone","firmdale","fish","fishing","fit","fitness","flickr","flights","flir","florist","flowers","fly","foo","food","foodnetwork","football","ford","forex","forsale","forum","foundation","fox","free","fresenius","frl","frogans","frontdoor","frontier","ftr","fujitsu","fujixerox","fun","fund","furniture","futbol","fyi","gal","gallery","gallo","gallup","game","games","gap","garden","gay","gbiz","gdn","gea","gent","genting","george","ggee","gift","gifts","gives","giving","glade","glass","gle","global","globo","gmail","gmbh","gmo","gmx","godaddy","gold","goldpoint","golf","goo","goodyear","goog","google","gop","got","grainger","graphics","gratis","green","gripe","grocery","group","guardian","gucci","guge","guide","guitars","guru","hair","hamburg","hangout","haus","hbo","hdfc","hdfcbank","health","healthcare","help","helsinki","here","hermes","hgtv","hiphop","hisamitsu","hitachi","hiv","hkt","hockey","holdings","holiday","homedepot","homegoods","homes","homesense","honda","horse","hospital","host","hosting","hot","hoteles","hotels","hotmail","house","how","hsbc","hughes","hyatt","hyundai","ibm","icbc","ice","icu","ieee","ifm","ikano","imamat","imdb","immo","immobilien","inc","industries","infiniti","ing","ink","institute","insurance","insure","intel","international","intuit","investments","ipiranga","irish","ismaili","ist","istanbul","itau","itv","iveco","jaguar","java","jcb","jcp","jeep","jetzt","jewelry","jio","jll","jmp","jnj","joburg","jot","joy","jpmorgan","jprs","juegos","juniper","kaufen","kddi","kerryhotels","kerrylogistics","kerryproperties","kfh","kia","kim","kinder","kindle","kitchen","kiwi","koeln","komatsu","kosher","kpmg","kpn","krd","kred","kuokgroup","kyoto","lacaixa","lamborghini","lamer","lancaster","lancia","land","landrover","lanxess","lasalle","lat","latino","latrobe","law","lawyer","lds","lease","leclerc","lefrak","legal","lego","lexus","lgbt","lidl","life","lifeinsurance","lifestyle","lighting","like","lilly","limited","limo","lincoln","linde","link","lipsy","live","living","lixil","llc","llp","loan","loans","locker","locus","loft","lol","london","lotte","lotto","love","lpl","lplfinancial","ltd","ltda","lundbeck","lupin","luxe","luxury","macys","madrid","maif","maison","makeup","man","management","mango","map","market","marketing","markets","marriott","marshalls","maserati","mattel","mba","mckinsey","med","media","meet","melbourne","meme","memorial","men","menu","merckmsd","metlife","miami","microsoft","mini","mint","mit","mitsubishi","mlb","mls","mma","mobile","moda","moe","moi","mom","monash","money","monster","mormon","mortgage","moscow","moto","motorcycles","mov","movie","msd","mtn","mtr","mutual","nab","nadex","nagoya","nationwide","natura","navy","nba","nec","netbank","netflix","network","neustar","new","newholland","news","next","nextdirect","nexus","nfl","ngo","nhk","nico","nike","nikon","ninja","nissan","nissay","nokia","northwesternmutual","norton","now","nowruz","nowtv","nra","nrw","ntt","nyc","obi","observer","off","office","okinawa","olayan","olayangroup","oldnavy","ollo","omega","one","ong","onl","online","onyourside","ooo","open","oracle","orange","organic","origins","osaka","otsuka","ott","ovh","page","panasonic","paris","pars","partners","parts","party","passagens","pay","pccw","pet","pfizer","pharmacy","phd","philips","phone","photo","photography","photos","physio","pics","pictet","pictures","pid","pin","ping","pink","pioneer","pizza","place","play","playstation","plumbing","plus","pnc","pohl","poker","politie","porn","pramerica","praxi","press","prime","prod","productions","prof","progressive","promo","properties","property","protection","pru","prudential","pub","pwc","qpon","quebec","quest","qvc","racing","radio","raid","read","realestate","realtor","realty","recipes","red","redstone","redumbrella","rehab","reise","reisen","reit","reliance","ren","rent","rentals","repair","report","republican","rest","restaurant","review","reviews","rexroth","rich","richardli","ricoh","rightathome","ril","rio","rip","rmit","rocher","rocks","rodeo","rogers","room","rsvp","rugby","ruhr","run","rwe","ryukyu","saarland","safe","safety","sakura","sale","salon","samsclub","samsung","sandvik","sandvikcoromant","sanofi","sap","sarl","sas","save","saxo","sbi","sbs","sca","scb","schaeffler","schmidt","scholarships","school","schule","schwarz","science","scjohnson","scor","scot","search","seat","secure","security","seek","select","sener","services","ses","seven","sew","sex","sexy","sfr","shangrila","sharp","shaw","shell","shia","shiksha","shoes","shop","shopping","shouji","show","showtime","shriram","silk","sina","singles","site","ski","skin","sky","skype","sling","smart","smile","sncf","soccer","social","softbank","software","sohu","solar","solutions","song","sony","soy","spa","space","sport","spot","spreadbetting","srl","stada","staples","star","statebank","statefarm","stc","stcgroup","stockholm","storage","store","stream","studio","study","style","sucks","supplies","supply","support","surf","surgery","suzuki","swatch","swiftcover","swiss","sydney","symantec","systems","tab","taipei","talk","taobao","target","tatamotors","tatar","tattoo","tax","taxi","tci","tdk","team","tech","technology","temasek","tennis","teva","thd","theater","theatre","tiaa","tickets","tienda","tiffany","tips","tires","tirol","tjmaxx","tjx","tkmaxx","tmall","today","tokyo","tools","top","toray","toshiba","total","tours","town","toyota","toys","trade","trading","training","travel","travelchannel","travelers","travelersinsurance","trust","trv","tube","tui","tunes","tushu","tvs","ubank","ubs","unicom","university","uno","uol","ups","vacations","vana","vanguard","vegas","ventures","verisign","versicherung","vet","viajes","video","vig","viking","villas","vin","vip","virgin","visa","vision","viva","vivo","vlaanderen","vodka","volkswagen","volvo","vote","voting","voto","voyage","vuelos","wales","walmart","walter","wang","wanggou","watch","watches","weather","weatherchannel","webcam","weber","website","wed","wedding","weibo","weir","whoswho","wien","wiki","williamhill","win","windows","wine","winners","wme","wolterskluwer","woodside","work","works","world","wow","wtc","wtf","xbox","xerox","xfinity","xihuan","xin","कॉम","セール","佛山","慈善","集团","在线","大众汽车","点看","คอม","八卦","موقع","公益","公司","香格里拉","网站","移动","我爱你","москва","католик","онлайн","сайт","联通","קום","时尚","微博","淡马锡","ファッション","орг","नेट","ストア","アマゾン","삼성","商标","商店","商城","дети","ポイント","新闻","工行","家電","كوم","中文网","中信","娱乐","谷歌","電訊盈科","购物","クラウド","通販","网店","संगठन","餐厅","网络","ком","亚马逊","诺基亚","食品","飞利浦","手表","手机","ارامكو","العليان","اتصالات","بازار","ابوظبي","كاثوليك","همراه","닷컴","政府","شبكة","بيتك","عرب","机构","组织机构","健康","招聘","рус","珠宝","大拿","みんな","グーグル","世界","書籍","网址","닷넷","コム","天主教","游戏","vermögensberater","vermögensberatung","企业","信息","嘉里大酒店","嘉里","广东","政务","xyz","yachts","yahoo","yamaxun","yandex","yodobashi","yoga","yokohama","you","youtube","yun","zappos","zara","zero","zip","zone","zuerich","cc.ua","inf.ua","ltd.ua","adobeaemcloud.com","adobeaemcloud.net","*.dev.adobeaemcloud.com","beep.pl","barsy.ca","*.compute.estate","*.alces.network","altervista.org","alwaysdata.net","cloudfront.net","*.compute.amazonaws.com","*.compute-1.amazonaws.com","*.compute.amazonaws.com.cn","us-east-1.amazonaws.com","cn-north-1.eb.amazonaws.com.cn","cn-northwest-1.eb.amazonaws.com.cn","elasticbeanstalk.com","ap-northeast-1.elasticbeanstalk.com","ap-northeast-2.elasticbeanstalk.com","ap-northeast-3.elasticbeanstalk.com","ap-south-1.elasticbeanstalk.com","ap-southeast-1.elasticbeanstalk.com","ap-southeast-2.elasticbeanstalk.com","ca-central-1.elasticbeanstalk.com","eu-central-1.elasticbeanstalk.com","eu-west-1.elasticbeanstalk.com","eu-west-2.elasticbeanstalk.com","eu-west-3.elasticbeanstalk.com","sa-east-1.elasticbeanstalk.com","us-east-1.elasticbeanstalk.com","us-east-2.elasticbeanstalk.com","us-gov-west-1.elasticbeanstalk.com","us-west-1.elasticbeanstalk.com","us-west-2.elasticbeanstalk.com","*.elb.amazonaws.com","*.elb.amazonaws.com.cn","s3.amazonaws.com","s3-ap-northeast-1.amazonaws.com","s3-ap-northeast-2.amazonaws.com","s3-ap-south-1.amazonaws.com","s3-ap-southeast-1.amazonaws.com","s3-ap-southeast-2.amazonaws.com","s3-ca-central-1.amazonaws.com","s3-eu-central-1.amazonaws.com","s3-eu-west-1.amazonaws.com","s3-eu-west-2.amazonaws.com","s3-eu-west-3.amazonaws.com","s3-external-1.amazonaws.com","s3-fips-us-gov-west-1.amazonaws.com","s3-sa-east-1.amazonaws.com","s3-us-gov-west-1.amazonaws.com","s3-us-east-2.amazonaws.com","s3-us-west-1.amazonaws.com","s3-us-west-2.amazonaws.com","s3.ap-northeast-2.amazonaws.com","s3.ap-south-1.amazonaws.com","s3.cn-north-1.amazonaws.com.cn","s3.ca-central-1.amazonaws.com","s3.eu-central-1.amazonaws.com","s3.eu-west-2.amazonaws.com","s3.eu-west-3.amazonaws.com","s3.us-east-2.amazonaws.com","s3.dualstack.ap-northeast-1.amazonaws.com","s3.dualstack.ap-northeast-2.amazonaws.com","s3.dualstack.ap-south-1.amazonaws.com","s3.dualstack.ap-southeast-1.amazonaws.com","s3.dualstack.ap-southeast-2.amazonaws.com","s3.dualstack.ca-central-1.amazonaws.com","s3.dualstack.eu-central-1.amazonaws.com","s3.dualstack.eu-west-1.amazonaws.com","s3.dualstack.eu-west-2.amazonaws.com","s3.dualstack.eu-west-3.amazonaws.com","s3.dualstack.sa-east-1.amazonaws.com","s3.dualstack.us-east-1.amazonaws.com","s3.dualstack.us-east-2.amazonaws.com","s3-website-us-east-1.amazonaws.com","s3-website-us-west-1.amazonaws.com","s3-website-us-west-2.amazonaws.com","s3-website-ap-northeast-1.amazonaws.com","s3-website-ap-southeast-1.amazonaws.com","s3-website-ap-southeast-2.amazonaws.com","s3-website-eu-west-1.amazonaws.com","s3-website-sa-east-1.amazonaws.com","s3-website.ap-northeast-2.amazonaws.com","s3-website.ap-south-1.amazonaws.com","s3-website.ca-central-1.amazonaws.com","s3-website.eu-central-1.amazonaws.com","s3-website.eu-west-2.amazonaws.com","s3-website.eu-west-3.amazonaws.com","s3-website.us-east-2.amazonaws.com","amsw.nl","t3l3p0rt.net","tele.amune.org","apigee.io","on-aptible.com","user.aseinet.ne.jp","gv.vc","d.gv.vc","user.party.eus","pimienta.org","poivron.org","potager.org","sweetpepper.org","myasustor.com","myfritz.net","*.awdev.ca","*.advisor.ws","b-data.io","backplaneapp.io","balena-devices.com","app.banzaicloud.io","betainabox.com","bnr.la","blackbaudcdn.net","boomla.net","boxfuse.io","square7.ch","bplaced.com","bplaced.de","square7.de","bplaced.net","square7.net","browsersafetymark.io","uk0.bigv.io","dh.bytemark.co.uk","vm.bytemark.co.uk","mycd.eu","carrd.co","crd.co","uwu.ai","ae.org","ar.com","br.com","cn.com","com.de","com.se","de.com","eu.com","gb.com","gb.net","hu.com","hu.net","jp.net","jpn.com","kr.com","mex.com","no.com","qc.com","ru.com","sa.com","se.net","uk.com","uk.net","us.com","uy.com","za.bz","za.com","africa.com","gr.com","in.net","us.org","co.com","c.la","certmgr.org","xenapponazure.com","discourse.group","discourse.team","virtueeldomein.nl","cleverapps.io","*.lcl.dev","*.stg.dev","c66.me","cloud66.ws","cloud66.zone","jdevcloud.com","wpdevcloud.com","cloudaccess.host","freesite.host","cloudaccess.net","cloudcontrolled.com","cloudcontrolapp.com","cloudera.site","trycloudflare.com","workers.dev","wnext.app","co.ca","*.otap.co","co.cz","c.cdn77.org","cdn77-ssl.net","r.cdn77.net","rsc.cdn77.org","ssl.origin.cdn77-secure.org","cloudns.asia","cloudns.biz","cloudns.club","cloudns.cc","cloudns.eu","cloudns.in","cloudns.info","cloudns.org","cloudns.pro","cloudns.pw","cloudns.us","cloudeity.net","cnpy.gdn","co.nl","co.no","webhosting.be","hosting-cluster.nl","ac.ru","edu.ru","gov.ru","int.ru","mil.ru","test.ru","dyn.cosidns.de","dynamisches-dns.de","dnsupdater.de","internet-dns.de","l-o-g-i-n.de","dynamic-dns.info","feste-ip.net","knx-server.net","static-access.net","realm.cz","*.cryptonomic.net","cupcake.is","*.customer-oci.com","*.oci.customer-oci.com","*.ocp.customer-oci.com","*.ocs.customer-oci.com","cyon.link","cyon.site","daplie.me","localhost.daplie.me","dattolocal.com","dattorelay.com","dattoweb.com","mydatto.com","dattolocal.net","mydatto.net","biz.dk","co.dk","firm.dk","reg.dk","store.dk","*.dapps.earth","*.bzz.dapps.earth","builtwithdark.com","edgestack.me","debian.net","dedyn.io","dnshome.de","online.th","shop.th","drayddns.com","dreamhosters.com","mydrobo.com","drud.io","drud.us","duckdns.org","dy.fi","tunk.org","dyndns-at-home.com","dyndns-at-work.com","dyndns-blog.com","dyndns-free.com","dyndns-home.com","dyndns-ip.com","dyndns-mail.com","dyndns-office.com","dyndns-pics.com","dyndns-remote.com","dyndns-server.com","dyndns-web.com","dyndns-wiki.com","dyndns-work.com","dyndns.biz","dyndns.info","dyndns.org","dyndns.tv","at-band-camp.net","ath.cx","barrel-of-knowledge.info","barrell-of-knowledge.info","better-than.tv","blogdns.com","blogdns.net","blogdns.org","blogsite.org","boldlygoingnowhere.org","broke-it.net","buyshouses.net","cechire.com","dnsalias.com","dnsalias.net","dnsalias.org","dnsdojo.com","dnsdojo.net","dnsdojo.org","does-it.net","doesntexist.com","doesntexist.org","dontexist.com","dontexist.net","dontexist.org","doomdns.com","doomdns.org","dvrdns.org","dyn-o-saur.com","dynalias.com","dynalias.net","dynalias.org","dynathome.net","dyndns.ws","endofinternet.net","endofinternet.org","endoftheinternet.org","est-a-la-maison.com","est-a-la-masion.com","est-le-patron.com","est-mon-blogueur.com","for-better.biz","for-more.biz","for-our.info","for-some.biz","for-the.biz","forgot.her.name","forgot.his.name","from-ak.com","from-al.com","from-ar.com","from-az.net","from-ca.com","from-co.net","from-ct.com","from-dc.com","from-de.com","from-fl.com","from-ga.com","from-hi.com","from-ia.com","from-id.com","from-il.com","from-in.com","from-ks.com","from-ky.com","from-la.net","from-ma.com","from-md.com","from-me.org","from-mi.com","from-mn.com","from-mo.com","from-ms.com","from-mt.com","from-nc.com","from-nd.com","from-ne.com","from-nh.com","from-nj.com","from-nm.com","from-nv.com","from-ny.net","from-oh.com","from-ok.com","from-or.com","from-pa.com","from-pr.com","from-ri.com","from-sc.com","from-sd.com","from-tn.com","from-tx.com","from-ut.com","from-va.com","from-vt.com","from-wa.com","from-wi.com","from-wv.com","from-wy.com","ftpaccess.cc","fuettertdasnetz.de","game-host.org","game-server.cc","getmyip.com","gets-it.net","go.dyndns.org","gotdns.com","gotdns.org","groks-the.info","groks-this.info","ham-radio-op.net","here-for-more.info","hobby-site.com","hobby-site.org","home.dyndns.org","homedns.org","homeftp.net","homeftp.org","homeip.net","homelinux.com","homelinux.net","homelinux.org","homeunix.com","homeunix.net","homeunix.org","iamallama.com","in-the-band.net","is-a-anarchist.com","is-a-blogger.com","is-a-bookkeeper.com","is-a-bruinsfan.org","is-a-bulls-fan.com","is-a-candidate.org","is-a-caterer.com","is-a-celticsfan.org","is-a-chef.com","is-a-chef.net","is-a-chef.org","is-a-conservative.com","is-a-cpa.com","is-a-cubicle-slave.com","is-a-democrat.com","is-a-designer.com","is-a-doctor.com","is-a-financialadvisor.com","is-a-geek.com","is-a-geek.net","is-a-geek.org","is-a-green.com","is-a-guru.com","is-a-hard-worker.com","is-a-hunter.com","is-a-knight.org","is-a-landscaper.com","is-a-lawyer.com","is-a-liberal.com","is-a-libertarian.com","is-a-linux-user.org","is-a-llama.com","is-a-musician.com","is-a-nascarfan.com","is-a-nurse.com","is-a-painter.com","is-a-patsfan.org","is-a-personaltrainer.com","is-a-photographer.com","is-a-player.com","is-a-republican.com","is-a-rockstar.com","is-a-socialist.com","is-a-soxfan.org","is-a-student.com","is-a-teacher.com","is-a-techie.com","is-a-therapist.com","is-an-accountant.com","is-an-actor.com","is-an-actress.com","is-an-anarchist.com","is-an-artist.com","is-an-engineer.com","is-an-entertainer.com","is-by.us","is-certified.com","is-found.org","is-gone.com","is-into-anime.com","is-into-cars.com","is-into-cartoons.com","is-into-games.com","is-leet.com","is-lost.org","is-not-certified.com","is-saved.org","is-slick.com","is-uberleet.com","is-very-bad.org","is-very-evil.org","is-very-good.org","is-very-nice.org","is-very-sweet.org","is-with-theband.com","isa-geek.com","isa-geek.net","isa-geek.org","isa-hockeynut.com","issmarterthanyou.com","isteingeek.de","istmein.de","kicks-ass.net","kicks-ass.org","knowsitall.info","land-4-sale.us","lebtimnetz.de","leitungsen.de","likes-pie.com","likescandy.com","merseine.nu","mine.nu","misconfused.org","mypets.ws","myphotos.cc","neat-url.com","office-on-the.net","on-the-web.tv","podzone.net","podzone.org","readmyblog.org","saves-the-whales.com","scrapper-site.net","scrapping.cc","selfip.biz","selfip.com","selfip.info","selfip.net","selfip.org","sells-for-less.com","sells-for-u.com","sells-it.net","sellsyourhome.org","servebbs.com","servebbs.net","servebbs.org","serveftp.net","serveftp.org","servegame.org","shacknet.nu","simple-url.com","space-to-rent.com","stuff-4-sale.org","stuff-4-sale.us","teaches-yoga.com","thruhere.net","traeumtgerade.de","webhop.biz","webhop.info","webhop.net","webhop.org","worse-than.tv","writesthisblog.com","ddnss.de","dyn.ddnss.de","dyndns.ddnss.de","dyndns1.de","dyn-ip24.de","home-webserver.de","dyn.home-webserver.de","myhome-server.de","ddnss.org","definima.net","definima.io","bci.dnstrace.pro","ddnsfree.com","ddnsgeek.com","giize.com","gleeze.com","kozow.com","loseyourip.com","ooguy.com","theworkpc.com","casacam.net","dynu.net","accesscam.org","camdvr.org","freeddns.org","mywire.org","webredirect.org","myddns.rocks","blogsite.xyz","dynv6.net","e4.cz","en-root.fr","mytuleap.com","onred.one","staging.onred.one","enonic.io","customer.enonic.io","eu.org","al.eu.org","asso.eu.org","at.eu.org","au.eu.org","be.eu.org","bg.eu.org","ca.eu.org","cd.eu.org","ch.eu.org","cn.eu.org","cy.eu.org","cz.eu.org","de.eu.org","dk.eu.org","edu.eu.org","ee.eu.org","es.eu.org","fi.eu.org","fr.eu.org","gr.eu.org","hr.eu.org","hu.eu.org","ie.eu.org","il.eu.org","in.eu.org","int.eu.org","is.eu.org","it.eu.org","jp.eu.org","kr.eu.org","lt.eu.org","lu.eu.org","lv.eu.org","mc.eu.org","me.eu.org","mk.eu.org","mt.eu.org","my.eu.org","net.eu.org","ng.eu.org","nl.eu.org","no.eu.org","nz.eu.org","paris.eu.org","pl.eu.org","pt.eu.org","q-a.eu.org","ro.eu.org","ru.eu.org","se.eu.org","si.eu.org","sk.eu.org","tr.eu.org","uk.eu.org","us.eu.org","eu-1.evennode.com","eu-2.evennode.com","eu-3.evennode.com","eu-4.evennode.com","us-1.evennode.com","us-2.evennode.com","us-3.evennode.com","us-4.evennode.com","twmail.cc","twmail.net","twmail.org","mymailer.com.tw","url.tw","apps.fbsbx.com","ru.net","adygeya.ru","bashkiria.ru","bir.ru","cbg.ru","com.ru","dagestan.ru","grozny.ru","kalmykia.ru","kustanai.ru","marine.ru","mordovia.ru","msk.ru","mytis.ru","nalchik.ru","nov.ru","pyatigorsk.ru","spb.ru","vladikavkaz.ru","vladimir.ru","abkhazia.su","adygeya.su","aktyubinsk.su","arkhangelsk.su","armenia.su","ashgabad.su","azerbaijan.su","balashov.su","bashkiria.su","bryansk.su","bukhara.su","chimkent.su","dagestan.su","east-kazakhstan.su","exnet.su","georgia.su","grozny.su","ivanovo.su","jambyl.su","kalmykia.su","kaluga.su","karacol.su","karaganda.su","karelia.su","khakassia.su","krasnodar.su","kurgan.su","kustanai.su","lenug.su","mangyshlak.su","mordovia.su","msk.su","murmansk.su","nalchik.su","navoi.su","north-kazakhstan.su","nov.su","obninsk.su","penza.su","pokrovsk.su","sochi.su","spb.su","tashkent.su","termez.su","togliatti.su","troitsk.su","tselinograd.su","tula.su","tuva.su","vladikavkaz.su","vladimir.su","vologda.su","channelsdvr.net","u.channelsdvr.net","fastly-terrarium.com","fastlylb.net","map.fastlylb.net","freetls.fastly.net","map.fastly.net","a.prod.fastly.net","global.prod.fastly.net","a.ssl.fastly.net","b.ssl.fastly.net","global.ssl.fastly.net","fastpanel.direct","fastvps-server.com","fhapp.xyz","fedorainfracloud.org","fedorapeople.org","cloud.fedoraproject.org","app.os.fedoraproject.org","app.os.stg.fedoraproject.org","mydobiss.com","filegear.me","filegear-au.me","filegear-de.me","filegear-gb.me","filegear-ie.me","filegear-jp.me","filegear-sg.me","firebaseapp.com","flynnhub.com","flynnhosting.net","0e.vc","freebox-os.com","freeboxos.com","fbx-os.fr","fbxos.fr","freebox-os.fr","freeboxos.fr","freedesktop.org","*.futurecms.at","*.ex.futurecms.at","*.in.futurecms.at","futurehosting.at","futuremailing.at","*.ex.ortsinfo.at","*.kunden.ortsinfo.at","*.statics.cloud","service.gov.uk","gehirn.ne.jp","usercontent.jp","gentapps.com","lab.ms","github.io","githubusercontent.com","gitlab.io","glitch.me","lolipop.io","cloudapps.digital","london.cloudapps.digital","homeoffice.gov.uk","ro.im","shop.ro","goip.de","run.app","a.run.app","web.app","*.0emm.com","appspot.com","*.r.appspot.com","blogspot.ae","blogspot.al","blogspot.am","blogspot.ba","blogspot.be","blogspot.bg","blogspot.bj","blogspot.ca","blogspot.cf","blogspot.ch","blogspot.cl","blogspot.co.at","blogspot.co.id","blogspot.co.il","blogspot.co.ke","blogspot.co.nz","blogspot.co.uk","blogspot.co.za","blogspot.com","blogspot.com.ar","blogspot.com.au","blogspot.com.br","blogspot.com.by","blogspot.com.co","blogspot.com.cy","blogspot.com.ee","blogspot.com.eg","blogspot.com.es","blogspot.com.mt","blogspot.com.ng","blogspot.com.tr","blogspot.com.uy","blogspot.cv","blogspot.cz","blogspot.de","blogspot.dk","blogspot.fi","blogspot.fr","blogspot.gr","blogspot.hk","blogspot.hr","blogspot.hu","blogspot.ie","blogspot.in","blogspot.is","blogspot.it","blogspot.jp","blogspot.kr","blogspot.li","blogspot.lt","blogspot.lu","blogspot.md","blogspot.mk","blogspot.mr","blogspot.mx","blogspot.my","blogspot.nl","blogspot.no","blogspot.pe","blogspot.pt","blogspot.qa","blogspot.re","blogspot.ro","blogspot.rs","blogspot.ru","blogspot.se","blogspot.sg","blogspot.si","blogspot.sk","blogspot.sn","blogspot.td","blogspot.tw","blogspot.ug","blogspot.vn","cloudfunctions.net","cloud.goog","codespot.com","googleapis.com","googlecode.com","pagespeedmobilizer.com","publishproxy.com","withgoogle.com","withyoutube.com","awsmppl.com","fin.ci","free.hr","caa.li","ua.rs","conf.se","hs.zone","hs.run","hashbang.sh","hasura.app","hasura-app.io","hepforge.org","herokuapp.com","herokussl.com","myravendb.com","ravendb.community","ravendb.me","development.run","ravendb.run","bpl.biz","orx.biz","ng.city","biz.gl","ng.ink","col.ng","firm.ng","gen.ng","ltd.ng","ngo.ng","ng.school","sch.so","häkkinen.fi","*.moonscale.io","moonscale.net","iki.fi","dyn-berlin.de","in-berlin.de","in-brb.de","in-butter.de","in-dsl.de","in-dsl.net","in-dsl.org","in-vpn.de","in-vpn.net","in-vpn.org","biz.at","info.at","info.cx","ac.leg.br","al.leg.br","am.leg.br","ap.leg.br","ba.leg.br","ce.leg.br","df.leg.br","es.leg.br","go.leg.br","ma.leg.br","mg.leg.br","ms.leg.br","mt.leg.br","pa.leg.br","pb.leg.br","pe.leg.br","pi.leg.br","pr.leg.br","rj.leg.br","rn.leg.br","ro.leg.br","rr.leg.br","rs.leg.br","sc.leg.br","se.leg.br","sp.leg.br","to.leg.br","pixolino.com","ipifony.net","mein-iserv.de","test-iserv.de","iserv.dev","iobb.net","myjino.ru","*.hosting.myjino.ru","*.landing.myjino.ru","*.spectrum.myjino.ru","*.vps.myjino.ru","*.triton.zone","*.cns.joyent.com","js.org","kaas.gg","khplay.nl","keymachine.de","kinghost.net","uni5.net","knightpoint.systems","oya.to","co.krd","edu.krd","git-repos.de","lcube-server.de","svn-repos.de","leadpages.co","lpages.co","lpusercontent.com","lelux.site","co.business","co.education","co.events","co.financial","co.network","co.place","co.technology","app.lmpm.com","linkitools.space","linkyard.cloud","linkyard-cloud.ch","members.linode.com","nodebalancer.linode.com","we.bs","loginline.app","loginline.dev","loginline.io","loginline.services","loginline.site","krasnik.pl","leczna.pl","lubartow.pl","lublin.pl","poniatowa.pl","swidnik.pl","uklugs.org","glug.org.uk","lug.org.uk","lugs.org.uk","barsy.bg","barsy.co.uk","barsyonline.co.uk","barsycenter.com","barsyonline.com","barsy.club","barsy.de","barsy.eu","barsy.in","barsy.info","barsy.io","barsy.me","barsy.menu","barsy.mobi","barsy.net","barsy.online","barsy.org","barsy.pro","barsy.pub","barsy.shop","barsy.site","barsy.support","barsy.uk","*.magentosite.cloud","mayfirst.info","mayfirst.org","hb.cldmail.ru","miniserver.com","memset.net","cloud.metacentrum.cz","custom.metacentrum.cz","flt.cloud.muni.cz","usr.cloud.muni.cz","meteorapp.com","eu.meteorapp.com","co.pl","azurecontainer.io","azurewebsites.net","azure-mobile.net","cloudapp.net","mozilla-iot.org","bmoattachments.org","net.ru","org.ru","pp.ru","ui.nabu.casa","pony.club","of.fashion","on.fashion","of.football","in.london","of.london","for.men","and.mom","for.mom","for.one","for.sale","of.work","to.work","nctu.me","bitballoon.com","netlify.com","4u.com","ngrok.io","nh-serv.co.uk","nfshost.com","dnsking.ch","mypi.co","n4t.co","001www.com","ddnslive.com","myiphost.com","forumz.info","16-b.it","32-b.it","64-b.it","soundcast.me","tcp4.me","dnsup.net","hicam.net","now-dns.net","ownip.net","vpndns.net","dynserv.org","now-dns.org","x443.pw","now-dns.top","ntdll.top","freeddns.us","crafting.xyz","zapto.xyz","nsupdate.info","nerdpol.ovh","blogsyte.com","brasilia.me","cable-modem.org","ciscofreak.com","collegefan.org","couchpotatofries.org","damnserver.com","ddns.me","ditchyourip.com","dnsfor.me","dnsiskinky.com","dvrcam.info","dynns.com","eating-organic.net","fantasyleague.cc","geekgalaxy.com","golffan.us","health-carereform.com","homesecuritymac.com","homesecuritypc.com","hopto.me","ilovecollege.info","loginto.me","mlbfan.org","mmafan.biz","myactivedirectory.com","mydissent.net","myeffect.net","mymediapc.net","mypsx.net","mysecuritycamera.com","mysecuritycamera.net","mysecuritycamera.org","net-freaks.com","nflfan.org","nhlfan.net","no-ip.ca","no-ip.co.uk","no-ip.net","noip.us","onthewifi.com","pgafan.net","point2this.com","pointto.us","privatizehealthinsurance.net","quicksytes.com","read-books.org","securitytactics.com","serveexchange.com","servehumour.com","servep2p.com","servesarcasm.com","stufftoread.com","ufcfan.org","unusualperson.com","workisboring.com","3utilities.com","bounceme.net","ddns.net","ddnsking.com","gotdns.ch","hopto.org","myftp.biz","myftp.org","myvnc.com","no-ip.biz","no-ip.info","no-ip.org","noip.me","redirectme.net","servebeer.com","serveblog.net","servecounterstrike.com","serveftp.com","servegame.com","servehalflife.com","servehttp.com","serveirc.com","serveminecraft.net","servemp3.com","servepics.com","servequake.com","sytes.net","webhop.me","zapto.org","stage.nodeart.io","nodum.co","nodum.io","pcloud.host","nyc.mn","nom.ae","nom.af","nom.ai","nom.al","nym.by","nom.bz","nym.bz","nom.cl","nym.ec","nom.gd","nom.ge","nom.gl","nym.gr","nom.gt","nym.gy","nym.hk","nom.hn","nym.ie","nom.im","nom.ke","nym.kz","nym.la","nym.lc","nom.li","nym.li","nym.lt","nym.lu","nom.lv","nym.me","nom.mk","nym.mn","nym.mx","nom.nu","nym.nz","nym.pe","nym.pt","nom.pw","nom.qa","nym.ro","nom.rs","nom.si","nym.sk","nom.st","nym.su","nym.sx","nom.tj","nym.tw","nom.ug","nom.uy","nom.vc","nom.vg","static.observableusercontent.com","cya.gg","cloudycluster.net","nid.io","opencraft.hosting","operaunite.com","skygearapp.com","outsystemscloud.com","ownprovider.com","own.pm","ox.rs","oy.lc","pgfog.com","pagefrontapp.com","art.pl","gliwice.pl","krakow.pl","poznan.pl","wroc.pl","zakopane.pl","pantheonsite.io","gotpantheon.com","mypep.link","perspecta.cloud","on-web.fr","*.platform.sh","*.platformsh.site","dyn53.io","co.bn","xen.prgmr.com","priv.at","prvcy.page","*.dweb.link","protonet.io","chirurgiens-dentistes-en-france.fr","byen.site","pubtls.org","qualifioapp.com","qbuser.com","instantcloud.cn","ras.ru","qa2.com","qcx.io","*.sys.qcx.io","dev-myqnapcloud.com","alpha-myqnapcloud.com","myqnapcloud.com","*.quipelements.com","vapor.cloud","vaporcloud.io","rackmaze.com","rackmaze.net","*.on-k3s.io","*.on-rancher.cloud","*.on-rio.io","readthedocs.io","rhcloud.com","app.render.com","onrender.com","repl.co","repl.run","resindevice.io","devices.resinstaging.io","hzc.io","wellbeingzone.eu","ptplus.fit","wellbeingzone.co.uk","git-pages.rit.edu","sandcats.io","logoip.de","logoip.com","schokokeks.net","gov.scot","scrysec.com","firewall-gateway.com","firewall-gateway.de","my-gateway.de","my-router.de","spdns.de","spdns.eu","firewall-gateway.net","my-firewall.org","myfirewall.org","spdns.org","senseering.net","biz.ua","co.ua","pp.ua","shiftedit.io","myshopblocks.com","shopitsite.com","mo-siemens.io","1kapp.com","appchizi.com","applinzi.com","sinaapp.com","vipsinaapp.com","siteleaf.net","bounty-full.com","alpha.bounty-full.com","beta.bounty-full.com","stackhero-network.com","static.land","dev.static.land","sites.static.land","apps.lair.io","*.stolos.io","spacekit.io","customer.speedpartner.de","api.stdlib.com","storj.farm","utwente.io","soc.srcf.net","user.srcf.net","temp-dns.com","applicationcloud.io","scapp.io","*.s5y.io","*.sensiosite.cloud","syncloud.it","diskstation.me","dscloud.biz","dscloud.me","dscloud.mobi","dsmynas.com","dsmynas.net","dsmynas.org","familyds.com","familyds.net","familyds.org","i234.me","myds.me","synology.me","vpnplus.to","direct.quickconnect.to","taifun-dns.de","gda.pl","gdansk.pl","gdynia.pl","med.pl","sopot.pl","edugit.org","telebit.app","telebit.io","*.telebit.xyz","gwiddle.co.uk","thingdustdata.com","cust.dev.thingdust.io","cust.disrec.thingdust.io","cust.prod.thingdust.io","cust.testing.thingdust.io","arvo.network","azimuth.network","bloxcms.com","townnews-staging.com","12hp.at","2ix.at","4lima.at","lima-city.at","12hp.ch","2ix.ch","4lima.ch","lima-city.ch","trafficplex.cloud","de.cool","12hp.de","2ix.de","4lima.de","lima-city.de","1337.pictures","clan.rip","lima-city.rocks","webspace.rocks","lima.zone","*.transurl.be","*.transurl.eu","*.transurl.nl","tuxfamily.org","dd-dns.de","diskstation.eu","diskstation.org","dray-dns.de","draydns.de","dyn-vpn.de","dynvpn.de","mein-vigor.de","my-vigor.de","my-wan.de","syno-ds.de","synology-diskstation.de","synology-ds.de","uber.space","*.uberspace.de","hk.com","hk.org","ltd.hk","inc.hk","virtualuser.de","virtual-user.de","urown.cloud","dnsupdate.info","lib.de.us","2038.io","router.management","v-info.info","voorloper.cloud","v.ua","wafflecell.com","*.webhare.dev","wedeploy.io","wedeploy.me","wedeploy.sh","remotewd.com","wmflabs.org","myforum.community","community-pro.de","diskussionsbereich.de","community-pro.net","meinforum.net","half.host","xnbay.com","u2.xnbay.com","u2-local.xnbay.com","cistron.nl","demon.nl","xs4all.space","yandexcloud.net","storage.yandexcloud.net","website.yandexcloud.net","official.academy","yolasite.com","ybo.faith","yombo.me","homelink.one","ybo.party","ybo.review","ybo.science","ybo.trade","nohost.me","noho.st","za.net","za.org","now.sh","bss.design","basicserver.io","virtualserver.io","enterprisecloud.nu"]; /***/ }), - -/***/ 53: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - -/*! - * Copyright 2019, OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -const context_1 = __webpack_require__(560); -class NoopContextManager { - active() { - return context_1.Context.ROOT_CONTEXT; - } - with(context, fn) { - return fn(); - } - bind(target, context) { - return target; - } - enable() { - return this; - } - disable() { - return this; - } -} -exports.NoopContextManager = NoopContextManager; -//# sourceMappingURL=NoopContextManager.js.map - -/***/ }), - -/***/ 65: +/* 51 */, +/* 52 */, +/* 53 */, +/* 54 */, +/* 55 */, +/* 56 */, +/* 57 */, +/* 58 */, +/* 59 */, +/* 60 */, +/* 61 */, +/* 62 */, +/* 63 */, +/* 64 */, +/* 65 */ /***/ (function(module) { // Generated by CoffeeScript 1.12.7 @@ -1461,8 +1486,20 @@ exports.NoopContextManager = NoopContextManager; /***/ }), +/* 66 */, +/* 67 */, +/* 68 */, +/* 69 */, +/* 70 */ +/***/ (function(__unusedmodule, exports) { -/***/ 71: +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=trace_state.js.map + +/***/ }), +/* 71 */ /***/ (function() { "use strict"; @@ -1473,8 +1510,21 @@ if (typeof Symbol === undefined || !Symbol.asyncIterator) { //# sourceMappingURL=index.js.map /***/ }), - -/***/ 86: +/* 72 */, +/* 73 */, +/* 74 */, +/* 75 */, +/* 76 */, +/* 77 */, +/* 78 */, +/* 79 */, +/* 80 */, +/* 81 */, +/* 82 */, +/* 83 */, +/* 84 */, +/* 85 */, +/* 86 */ /***/ (function(module, __unusedexports, __webpack_require__) { var rng = __webpack_require__(139); @@ -1589,15 +1639,14 @@ module.exports = v1; /***/ }), - -/***/ 87: +/* 87 */ /***/ (function(module) { module.exports = require("os"); /***/ }), - -/***/ 89: +/* 88 */, +/* 89 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -1674,8 +1723,7 @@ exports.permuteDomain = permuteDomain; /***/ }), - -/***/ 90: +/* 90 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -1697,8 +1745,7 @@ var _default = v5; exports.default = _default; /***/ }), - -/***/ 91: +/* 91 */ /***/ (function(module, __unusedexports, __webpack_require__) { var serialOrdered = __webpack_require__(892); @@ -1721,8 +1768,8 @@ function serial(list, iterator, callback) /***/ }), - -/***/ 93: +/* 92 */, +/* 93 */ /***/ (function(module, __unusedexports, __webpack_require__) { module.exports = minimatch @@ -2651,8 +2698,67 @@ function regExpEscape (s) { /***/ }), +/* 94 */, +/* 95 */ +/***/ (function(__unusedmodule, exports) { -/***/ 104: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=link.js.map + +/***/ }), +/* 96 */, +/* 97 */, +/* 98 */, +/* 99 */, +/* 100 */, +/* 101 */, +/* 102 */ +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports._globalThis = void 0; +/** only globals that common to node and browsers are allowed */ +// eslint-disable-next-line node/no-unsupported-features/es-builtins +exports._globalThis = typeof globalThis === 'object' ? globalThis : global; +//# sourceMappingURL=globalThis.js.map + +/***/ }), +/* 103 */, +/* 104 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -2679,8 +2785,8 @@ var _default = version; exports.default = _default; /***/ }), - -/***/ 106: +/* 105 */, +/* 106 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -2952,8 +3058,37 @@ exports.AbortSignal = AbortSignal; /***/ }), +/* 107 */ +/***/ (function(__unusedmodule, exports) { -/***/ 114: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=Observation.js.map + +/***/ }), +/* 108 */, +/* 109 */, +/* 110 */, +/* 111 */, +/* 112 */, +/* 113 */, +/* 114 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -3171,21 +3306,39 @@ exports.saveCache = saveCache; //# sourceMappingURL=cacheHttpClient.js.map /***/ }), - -/***/ 129: +/* 115 */, +/* 116 */, +/* 117 */, +/* 118 */, +/* 119 */, +/* 120 */, +/* 121 */, +/* 122 */, +/* 123 */, +/* 124 */, +/* 125 */, +/* 126 */, +/* 127 */, +/* 128 */, +/* 129 */ /***/ (function(module) { module.exports = require("child_process"); /***/ }), - -/***/ 136: +/* 130 */, +/* 131 */, +/* 132 */, +/* 133 */, +/* 134 */, +/* 135 */, +/* 136 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; -/*! - * Copyright 2020, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -3200,48 +3353,60 @@ module.exports = require("child_process"); * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const NoopMeterProvider_1 = __webpack_require__(450); +exports.MetricsAPI = void 0; +var NoopMeterProvider_1 = __webpack_require__(450); +var global_utils_1 = __webpack_require__(976); /** * Singleton object which represents the entry point to the OpenTelemetry Metrics API */ -class MetricsAPI { +var MetricsAPI = /** @class */ (function () { /** Empty private constructor prevents end users from constructing a new instance of the API */ - constructor() { - this._meterProvider = NoopMeterProvider_1.NOOP_METER_PROVIDER; + function MetricsAPI() { } /** Get the singleton instance of the Metrics API */ - static getInstance() { + MetricsAPI.getInstance = function () { if (!this._instance) { this._instance = new MetricsAPI(); } return this._instance; - } + }; /** * Set the current global meter. Returns the initialized global meter provider. */ - setGlobalMeterProvider(provider) { - this._meterProvider = provider; + MetricsAPI.prototype.setGlobalMeterProvider = function (provider) { + if (global_utils_1._global[global_utils_1.GLOBAL_METRICS_API_KEY]) { + // global meter provider has already been set + return this.getMeterProvider(); + } + global_utils_1._global[global_utils_1.GLOBAL_METRICS_API_KEY] = global_utils_1.makeGetter(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, provider, NoopMeterProvider_1.NOOP_METER_PROVIDER); return provider; - } + }; /** * Returns the global meter provider. */ - getMeterProvider() { - return this._meterProvider; - } + MetricsAPI.prototype.getMeterProvider = function () { + var _a, _b; + return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_METRICS_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NoopMeterProvider_1.NOOP_METER_PROVIDER); + }; /** * Returns a meter from the global meter provider. */ - getMeter(name, version) { + MetricsAPI.prototype.getMeter = function (name, version) { return this.getMeterProvider().getMeter(name, version); - } -} + }; + /** Remove the global meter provider */ + MetricsAPI.prototype.disable = function () { + delete global_utils_1._global[global_utils_1.GLOBAL_METRICS_API_KEY]; + }; + return MetricsAPI; +}()); exports.MetricsAPI = MetricsAPI; //# sourceMappingURL=metrics.js.map /***/ }), - -/***/ 139: +/* 137 */, +/* 138 */, +/* 139 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Unique ID creation requires a high quality random # generator. In node.js @@ -3255,8 +3420,8 @@ module.exports = function nodeRNG() { /***/ }), - -/***/ 141: +/* 140 */, +/* 141 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -3527,8 +3692,309 @@ exports.debug = debug; // for test /***/ }), +/* 142 */, +/* 143 */, +/* 144 */ +/***/ (function(module) { -/***/ 147: +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global global, define, System, Reflect, Promise */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +var __classPrivateFieldGet; +var __classPrivateFieldSet; +var __createBinding; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if ( true && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + + __extends = function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __exportStar = function(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); + }; + + __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + }) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }; + + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + __classPrivateFieldGet = function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); + }; + + __classPrivateFieldSet = function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); +}); + + +/***/ }), +/* 145 */, +/* 146 */, +/* 147 */ /***/ (function(__unusedmodule, exports) { "use strict"; @@ -3560,14 +4026,16 @@ exports.fromPromise = function (fn) { /***/ }), - -/***/ 151: +/* 148 */, +/* 149 */, +/* 150 */, +/* 151 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; -/*! - * Copyright 2020, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -3582,32 +4050,35 @@ exports.fromPromise = function (fn) { * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const NoopSpan_1 = __webpack_require__(767); +exports.NOOP_TRACER = exports.NoopTracer = void 0; +var NoopSpan_1 = __webpack_require__(767); /** * No-op implementations of {@link Tracer}. */ -class NoopTracer { - getCurrentSpan() { - return NoopSpan_1.NOOP_SPAN; +var NoopTracer = /** @class */ (function () { + function NoopTracer() { } + NoopTracer.prototype.getCurrentSpan = function () { + return NoopSpan_1.NOOP_SPAN; + }; // startSpan starts a noop span. - startSpan(name, options) { + NoopTracer.prototype.startSpan = function (name, options) { return NoopSpan_1.NOOP_SPAN; - } - withSpan(span, fn) { + }; + NoopTracer.prototype.withSpan = function (span, fn) { return fn(); - } - bind(target, span) { + }; + NoopTracer.prototype.bind = function (target, span) { return target; - } -} + }; + return NoopTracer; +}()); exports.NoopTracer = NoopTracer; exports.NOOP_TRACER = new NoopTracer(); //# sourceMappingURL=NoopTracer.js.map /***/ }), - -/***/ 152: +/* 152 */ /***/ (function(module, __unusedexports, __webpack_require__) { var Stream = __webpack_require__(794).Stream; @@ -3720,8 +4191,11 @@ DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { /***/ }), - -/***/ 157: +/* 153 */, +/* 154 */, +/* 155 */, +/* 156 */, +/* 157 */ /***/ (function(module, __unusedexports, __webpack_require__) { var async = __webpack_require__(751) @@ -3802,14 +4276,25 @@ function runJob(iterator, key, item, callback) /***/ }), +/* 158 */ +/***/ (function(__unusedmodule, exports) { -/***/ 162: +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=Time.js.map + +/***/ }), +/* 159 */, +/* 160 */, +/* 161 */, +/* 162 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; -/*! - * Copyright 2019, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -3824,23 +4309,61 @@ function runJob(iterator, key, item, callback) * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const NoopTracer_1 = __webpack_require__(151); +exports.NOOP_TRACER_PROVIDER = exports.NoopTracerProvider = void 0; +var NoopTracer_1 = __webpack_require__(151); /** - * An implementation of the {@link TracerProvider} which returns an impotent Tracer - * for all calls to `getTracer` + * An implementation of the {@link TracerProvider} which returns an impotent + * Tracer for all calls to `getTracer`. + * + * All operations are no-op. */ -class NoopTracerProvider { - getTracer(_name, _version) { - return NoopTracer_1.NOOP_TRACER; +var NoopTracerProvider = /** @class */ (function () { + function NoopTracerProvider() { } -} + NoopTracerProvider.prototype.getTracer = function (_name, _version) { + return NoopTracer_1.NOOP_TRACER; + }; + return NoopTracerProvider; +}()); exports.NoopTracerProvider = NoopTracerProvider; exports.NOOP_TRACER_PROVIDER = new NoopTracerProvider(); //# sourceMappingURL=NoopTracerProvider.js.map /***/ }), +/* 163 */, +/* 164 */, +/* 165 */ +/***/ (function(__unusedmodule, exports) { -/***/ 173: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=Plugin.js.map + +/***/ }), +/* 166 */, +/* 167 */, +/* 168 */, +/* 169 */, +/* 170 */, +/* 171 */, +/* 172 */, +/* 173 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -3953,8 +4476,85 @@ var _default = v1; exports.default = _default; /***/ }), +/* 174 */, +/* 175 */, +/* 176 */, +/* 177 */, +/* 178 */, +/* 179 */, +/* 180 */, +/* 181 */, +/* 182 */, +/* 183 */, +/* 184 */, +/* 185 */, +/* 186 */, +/* 187 */, +/* 188 */, +/* 189 */ +/***/ (function(__unusedmodule, exports) { -/***/ 197: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=ObserverResult.js.map + +/***/ }), +/* 190 */, +/* 191 */, +/* 192 */, +/* 193 */, +/* 194 */, +/* 195 */, +/* 196 */ +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RefKey = exports.Events = exports.State = exports.Outputs = exports.Inputs = void 0; +var Inputs; +(function (Inputs) { + Inputs["Key"] = "key"; + Inputs["Path"] = "path"; + Inputs["RestoreKeys"] = "restore-keys"; + Inputs["UploadChunkSize"] = "upload-chunk-size"; +})(Inputs = exports.Inputs || (exports.Inputs = {})); +var Outputs; +(function (Outputs) { + Outputs["CacheHit"] = "cache-hit"; +})(Outputs = exports.Outputs || (exports.Outputs = {})); +var State; +(function (State) { + State["CachePrimaryKey"] = "CACHE_KEY"; + State["CacheMatchedKey"] = "CACHE_RESULT"; +})(State = exports.State || (exports.State = {})); +var Events; +(function (Events) { + Events["Key"] = "GITHUB_EVENT_NAME"; + Events["Push"] = "push"; + Events["PullRequest"] = "pull_request"; +})(Events = exports.Events || (exports.Events = {})); +exports.RefKey = "GITHUB_REF"; + + +/***/ }), +/* 197 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -4005,8 +4605,19 @@ var _default = parse; exports.default = _default; /***/ }), - -/***/ 210: +/* 198 */, +/* 199 */, +/* 200 */, +/* 201 */, +/* 202 */, +/* 203 */, +/* 204 */, +/* 205 */, +/* 206 */, +/* 207 */, +/* 208 */, +/* 209 */, +/* 210 */ /***/ (function(__unusedmodule, exports) { // Generated by CoffeeScript 1.12.7 @@ -4024,22 +4635,55 @@ exports.default = _default; /***/ }), - -/***/ 211: +/* 211 */ /***/ (function(module) { module.exports = require("https"); /***/ }), - -/***/ 213: +/* 212 */, +/* 213 */ /***/ (function(module) { module.exports = require("punycode"); /***/ }), +/* 214 */, +/* 215 */, +/* 216 */, +/* 217 */, +/* 218 */, +/* 219 */, +/* 220 */ +/***/ (function(__unusedmodule, exports) { -/***/ 226: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=SpanOptions.js.map + +/***/ }), +/* 221 */, +/* 222 */, +/* 223 */, +/* 224 */, +/* 225 */, +/* 226 */ /***/ (function(__unusedmodule, exports) { "use strict"; @@ -4104,8 +4748,9 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ }), - -/***/ 229: +/* 227 */, +/* 228 */, +/* 229 */ /***/ (function(__unusedmodule, exports) { "use strict"; @@ -4180,8 +4825,51 @@ exports.isTokenCredential = isTokenCredential; /***/ }), +/* 230 */, +/* 231 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { -/***/ 238: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(__webpack_require__(328), exports); +__exportStar(__webpack_require__(715), exports); +__exportStar(__webpack_require__(924), exports); +//# sourceMappingURL=index.js.map + +/***/ }), +/* 232 */, +/* 233 */, +/* 234 */, +/* 235 */, +/* 236 */, +/* 237 */, +/* 238 */ /***/ (function(__unusedmodule, exports) { "use strict"; @@ -4195,8 +4883,9 @@ var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[ exports.default = _default; /***/ }), - -/***/ 241: +/* 239 */, +/* 240 */, +/* 241 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -4280,19 +4969,10 @@ function _default(name, version, hashfunc) { } /***/ }), - -/***/ 242: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -__webpack_require__(71); - - -/***/ }), - -/***/ 245: +/* 242 */, +/* 243 */, +/* 244 */, +/* 245 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -4321,8 +5001,12 @@ var _default = md5; exports.default = _default; /***/ }), - -/***/ 251: +/* 246 */, +/* 247 */, +/* 248 */, +/* 249 */, +/* 250 */, +/* 251 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -4558,8 +5242,12 @@ exports.downloadCacheStorageSDK = downloadCacheStorageSDK; //# sourceMappingURL=downloadUtils.js.map /***/ }), - -/***/ 257: +/* 252 */, +/* 253 */, +/* 254 */, +/* 255 */, +/* 256 */, +/* 257 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -5350,8 +6038,12 @@ exports.downloadCacheStorageSDK = downloadCacheStorageSDK; /***/ }), - -/***/ 263: +/* 258 */, +/* 259 */, +/* 260 */, +/* 261 */, +/* 262 */, +/* 263 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -5360,9 +6052,9 @@ exports.downloadCacheStorageSDK = downloadCacheStorageSDK; Object.defineProperty(exports, '__esModule', { value: true }); var api = __webpack_require__(440); -var tslib = __webpack_require__(422); +var tslib = __webpack_require__(144); -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. /** * A no-op implementation of Span that can safely be used without side-effects. */ @@ -5433,7 +6125,7 @@ var NoOpSpan = /** @class */ (function () { return NoOpSpan; }()); -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. /** * A no-op implementation of Tracer that can be used when tracing * is disabled. @@ -5474,13 +6166,13 @@ var NoOpTracer = /** @class */ (function () { return NoOpTracer; }()); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. function getGlobalObject() { return global; } -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // V1 = OpenTelemetry 0.1 // V2 = OpenTelemetry 0.2 // V3 = OpenTelemetry 0.6.1 @@ -5521,7 +6213,7 @@ function getCache() { return cache; } -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. var defaultTracer; function getDefaultTracer() { if (!defaultTracer) { @@ -5549,8 +6241,8 @@ function getTracer() { return cache.tracer; } -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. /** * @ignore * @internal @@ -5574,6 +6266,7 @@ var OpenCensusTraceStateWrapper = /** @class */ (function () { return OpenCensusTraceStateWrapper; }()); +// Copyright (c) Microsoft Corporation. function isWrappedSpan(span) { return !!span && span.getWrappedSpan !== undefined; } @@ -5683,6 +6376,7 @@ var OpenCensusSpanWrapper = /** @class */ (function () { return OpenCensusSpanWrapper; }()); +// Copyright (c) Microsoft Corporation. /** * An implementation of OpenTelemetry Tracer that wraps an OpenCensus Tracer. */ @@ -5733,6 +6427,7 @@ var OpenCensusTracerWrapper = /** @class */ (function () { return OpenCensusTracerWrapper; }()); +// Copyright (c) Microsoft Corporation. /** * A mock span useful for testing. */ @@ -5820,6 +6515,7 @@ var TestSpan = /** @class */ (function (_super) { return TestSpan; }(NoOpSpan)); +// Copyright (c) Microsoft Corporation. /** * A mock tracer useful for testing */ @@ -5940,8 +6636,8 @@ var TestTracer = /** @class */ (function (_super) { return TestTracer; }(NoOpTracer)); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. var VERSION = "00"; /** * Generates a `SpanContext` given a `traceparent` header value. @@ -6002,8 +6698,8 @@ exports.setTracer = setTracer; /***/ }), - -/***/ 265: +/* 264 */, +/* 265 */ /***/ (function(module) { // Generated by CoffeeScript 1.12.7 @@ -6037,8 +6733,67 @@ exports.setTracer = setTracer; /***/ }), +/* 266 */, +/* 267 */, +/* 268 */, +/* 269 */, +/* 270 */, +/* 271 */, +/* 272 */, +/* 273 */, +/* 274 */, +/* 275 */, +/* 276 */ +/***/ (function(__unusedmodule, exports) { -/***/ 280: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=Logger.js.map + +/***/ }), +/* 277 */, +/* 278 */ +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=CorrelationContext.js.map + +/***/ }), +/* 279 */, +/* 280 */ /***/ (function(module, exports) { exports = module.exports = SemVer @@ -7640,8 +8395,7 @@ function coerce (version, options) { /***/ }), - -/***/ 281: +/* 281 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -7672,15 +8426,27 @@ exports.create = create; //# sourceMappingURL=glob.js.map /***/ }), - -/***/ 293: +/* 282 */, +/* 283 */, +/* 284 */, +/* 285 */, +/* 286 */, +/* 287 */, +/* 288 */, +/* 289 */, +/* 290 */, +/* 291 */, +/* 292 */, +/* 293 */ /***/ (function(module) { module.exports = require("buffer"); /***/ }), - -/***/ 297: +/* 294 */, +/* 295 */, +/* 296 */, +/* 297 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -7901,8 +8667,7 @@ exports.DefaultGlobber = DefaultGlobber; //# sourceMappingURL=internal-globber.js.map /***/ }), - -/***/ 298: +/* 298 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -7924,15 +8689,19 @@ var _default = v3; exports.default = _default; /***/ }), - -/***/ 304: +/* 299 */, +/* 300 */, +/* 301 */, +/* 302 */, +/* 303 */, +/* 304 */ /***/ (function(module) { module.exports = require("string_decoder"); /***/ }), - -/***/ 306: +/* 305 */, +/* 306 */ /***/ (function(module, __unusedexports, __webpack_require__) { var concatMap = __webpack_require__(896); @@ -8139,8 +8908,12 @@ function expand(str, isTop) { /***/ }), - -/***/ 312: +/* 307 */, +/* 308 */, +/* 309 */, +/* 310 */, +/* 311 */, +/* 312 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -8211,8 +8984,44 @@ function expand(str, isTop) { /***/ }), +/* 313 */, +/* 314 */, +/* 315 */, +/* 316 */, +/* 317 */, +/* 318 */ +/***/ (function(__unusedmodule, exports) { -/***/ 327: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=BatchObserverResult.js.map + +/***/ }), +/* 319 */, +/* 320 */, +/* 321 */, +/* 322 */, +/* 323 */, +/* 324 */, +/* 325 */, +/* 326 */, +/* 327 */ /***/ (function(__unusedmodule, exports) { "use strict"; @@ -8235,8 +9044,34 @@ var MatchKind; //# sourceMappingURL=internal-match-kind.js.map /***/ }), +/* 328 */ +/***/ (function(__unusedmodule, exports) { -/***/ 332: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map + +/***/ }), +/* 329 */, +/* 330 */, +/* 331 */, +/* 332 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -8433,8 +9268,8 @@ exports.MemoryCookieStore = MemoryCookieStore; /***/ }), - -/***/ 334: +/* 333 */, +/* 334 */ /***/ (function(module, __unusedexports, __webpack_require__) { module.exports = @@ -8446,8 +9281,10 @@ module.exports = /***/ }), - -/***/ 338: +/* 335 */, +/* 336 */, +/* 337 */, +/* 338 */ /***/ (function(__unusedmodule, exports) { "use strict"; @@ -8530,15 +9367,66 @@ exports.Store = Store; /***/ }), +/* 339 */, +/* 340 */ +/***/ (function(__unusedmodule, exports) { -/***/ 343: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SamplingDecision = void 0; +/** + * A sampling decision that determines how a {@link Span} will be recorded + * and collected. + */ +var SamplingDecision; +(function (SamplingDecision) { + /** + * `Span.isRecording() === false`, span will not be recorded and all events + * and attributes will be dropped. + */ + SamplingDecision[SamplingDecision["NOT_RECORD"] = 0] = "NOT_RECORD"; + /** + * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags} + * MUST NOT be set. + */ + SamplingDecision[SamplingDecision["RECORD"] = 1] = "RECORD"; + /** + * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags} + * MUST be set. + */ + SamplingDecision[SamplingDecision["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; +})(SamplingDecision = exports.SamplingDecision || (exports.SamplingDecision = {})); +//# sourceMappingURL=SamplingResult.js.map + +/***/ }), +/* 341 */, +/* 342 */, +/* 343 */ /***/ (function(module) { module.exports = require("timers"); /***/ }), - -/***/ 347: +/* 344 */, +/* 345 */, +/* 346 */, +/* 347 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -8579,8 +9467,7 @@ module.exports = require("timers"); /***/ }), - -/***/ 348: +/* 348 */ /***/ (function(__unusedmodule, exports) { "use strict"; @@ -8648,8 +9535,8 @@ exports.pathMatch = pathMatch; /***/ }), - -/***/ 350: +/* 349 */, +/* 350 */ /***/ (function(__unusedmodule, exports) { // Generated by CoffeeScript 1.12.7 @@ -8689,15 +9576,34 @@ exports.pathMatch = pathMatch; /***/ }), - -/***/ 357: +/* 351 */, +/* 352 */, +/* 353 */, +/* 354 */, +/* 355 */, +/* 356 */, +/* 357 */ /***/ (function(module) { module.exports = require("assert"); /***/ }), - -/***/ 373: +/* 358 */, +/* 359 */, +/* 360 */, +/* 361 */, +/* 362 */, +/* 363 */, +/* 364 */, +/* 365 */, +/* 366 */, +/* 367 */, +/* 368 */, +/* 369 */, +/* 370 */, +/* 371 */, +/* 372 */, +/* 373 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -8706,19 +9612,19 @@ module.exports = require("assert"); Object.defineProperty(exports, '__esModule', { value: true }); var coreHttp = __webpack_require__(999); -var tslib = __webpack_require__(422); +var tslib = __webpack_require__(815); var api = __webpack_require__(440); var logger$1 = __webpack_require__(928); var abortController = __webpack_require__(106); var os = __webpack_require__(87); var stream = __webpack_require__(794); -var fs = __webpack_require__(747); -var util = __webpack_require__(669); +__webpack_require__(510); var crypto = __webpack_require__(417); +var coreLro = __webpack_require__(889); var events = __webpack_require__(614); var coreTracing = __webpack_require__(263); -var coreLro = __webpack_require__(889); -__webpack_require__(242); +var fs = __webpack_require__(747); +var util = __webpack_require__(669); /* * Copyright (c) Microsoft Corporation. All rights reserved. @@ -8862,7 +9768,7 @@ var DataLakeStorageError = { name: "Composite", className: "DataLakeStorageError", modelProperties: { - error: { + dataLakeStorageErrorDetails: { xmlName: "error", serializedName: "error", type: { @@ -8903,12 +9809,12 @@ var AccessPolicy = { } } }; -var BlobProperties = { +var BlobPropertiesInternal = { xmlName: "Properties", - serializedName: "BlobProperties", + serializedName: "BlobPropertiesInternal", type: { name: "Composite", - className: "BlobProperties", + className: "BlobPropertiesInternal", modelProperties: { createdOn: { xmlName: "Creation-Time", @@ -9161,16 +10067,96 @@ var BlobProperties = { type: { name: "DateTimeRfc1123" } + }, + tagCount: { + xmlName: "TagCount", + serializedName: "TagCount", + type: { + name: "Number" + } + }, + expiresOn: { + xmlName: "Expiry-Time", + serializedName: "Expiry-Time", + type: { + name: "DateTimeRfc1123" + } + }, + isSealed: { + xmlName: "Sealed", + serializedName: "Sealed", + type: { + name: "Boolean" + } + }, + rehydratePriority: { + xmlName: "RehydratePriority", + serializedName: "RehydratePriority", + type: { + name: "String" + } } } } }; -var BlobItem = { - xmlName: "Blob", - serializedName: "BlobItem", +var BlobTag = { + xmlName: "Tag", + serializedName: "BlobTag", type: { name: "Composite", - className: "BlobItem", + className: "BlobTag", + modelProperties: { + key: { + xmlName: "Key", + required: true, + serializedName: "Key", + type: { + name: "String" + } + }, + value: { + xmlName: "Value", + required: true, + serializedName: "Value", + type: { + name: "String" + } + } + } + } +}; +var BlobTags = { + xmlName: "Tags", + serializedName: "BlobTags", + type: { + name: "Composite", + className: "BlobTags", + modelProperties: { + blobTagSet: { + xmlIsWrapped: true, + xmlName: "TagSet", + xmlElementName: "Tag", + required: true, + serializedName: "BlobTagSet", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BlobTag" + } + } + } + } + } + } +}; +var BlobItemInternal = { + xmlName: "Blob", + serializedName: "BlobItemInternal", + type: { + name: "Composite", + className: "BlobItemInternal", modelProperties: { name: { xmlName: "Name", @@ -9196,13 +10182,27 @@ var BlobItem = { name: "String" } }, + versionId: { + xmlName: "VersionId", + serializedName: "VersionId", + type: { + name: "String" + } + }, + isCurrentVersion: { + xmlName: "IsCurrentVersion", + serializedName: "IsCurrentVersion", + type: { + name: "Boolean" + } + }, properties: { xmlName: "Properties", required: true, serializedName: "Properties", type: { name: "Composite", - className: "BlobProperties" + className: "BlobPropertiesInternal" } }, metadata: { @@ -9216,6 +10216,26 @@ var BlobItem = { } } } + }, + blobTags: { + xmlName: "Tags", + serializedName: "BlobTags", + type: { + name: "Composite", + className: "BlobTags" + } + }, + objectReplicationMetadata: { + xmlName: "OrMetadata", + serializedName: "ObjectReplicationMetadata", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } } } } @@ -9237,7 +10257,7 @@ var BlobFlatListSegment = { element: { type: { name: "Composite", - className: "BlobItem" + className: "BlobItemInternal" } } } @@ -9358,7 +10378,7 @@ var BlobHierarchyListSegment = { element: { type: { name: "Composite", - className: "BlobItem" + className: "BlobItemInternal" } } } @@ -9643,6 +10663,20 @@ var ContainerProperties = { type: { name: "Boolean" } + }, + deletedOn: { + xmlName: "DeletedTime", + serializedName: "DeletedTime", + type: { + name: "DateTimeRfc1123" + } + }, + remainingRetentionDays: { + xmlName: "RemainingRetentionDays", + serializedName: "RemainingRetentionDays", + type: { + name: "Number" + } } } } @@ -9662,6 +10696,20 @@ var ContainerItem = { name: "String" } }, + deleted: { + xmlName: "Deleted", + serializedName: "Deleted", + type: { + name: "Boolean" + } + }, + version: { + xmlName: "Version", + serializedName: "Version", + type: { + name: "String" + } + }, properties: { xmlName: "Properties", required: true, @@ -9686,6 +10734,72 @@ var ContainerItem = { } } }; +var DelimitedTextConfiguration = { + serializedName: "DelimitedTextConfiguration", + type: { + name: "Composite", + className: "DelimitedTextConfiguration", + modelProperties: { + columnSeparator: { + xmlName: "ColumnSeparator", + required: true, + serializedName: "ColumnSeparator", + type: { + name: "String" + } + }, + fieldQuote: { + xmlName: "FieldQuote", + required: true, + serializedName: "FieldQuote", + type: { + name: "String" + } + }, + recordSeparator: { + xmlName: "RecordSeparator", + required: true, + serializedName: "RecordSeparator", + type: { + name: "String" + } + }, + escapeChar: { + xmlName: "EscapeChar", + required: true, + serializedName: "EscapeChar", + type: { + name: "String" + } + }, + headersPresent: { + xmlName: "HasHeaders", + required: true, + serializedName: "HeadersPresent", + type: { + name: "Boolean" + } + } + } + } +}; +var JsonTextConfiguration = { + serializedName: "JsonTextConfiguration", + type: { + name: "Composite", + className: "JsonTextConfiguration", + modelProperties: { + recordSeparator: { + xmlName: "RecordSeparator", + required: true, + serializedName: "RecordSeparator", + type: { + name: "String" + } + } + } + } +}; var ListContainersSegmentResponse = { xmlName: "EnumerationResults", serializedName: "ListContainersSegmentResponse", @@ -9801,6 +10915,90 @@ var CorsRule = { } } }; +var FilterBlobItem = { + xmlName: "Blob", + serializedName: "FilterBlobItem", + type: { + name: "Composite", + className: "FilterBlobItem", + modelProperties: { + name: { + xmlName: "Name", + required: true, + serializedName: "Name", + type: { + name: "String" + } + }, + containerName: { + xmlName: "ContainerName", + required: true, + serializedName: "ContainerName", + type: { + name: "String" + } + }, + tagValue: { + xmlName: "TagValue", + required: true, + serializedName: "TagValue", + type: { + name: "String" + } + } + } + } +}; +var FilterBlobSegment = { + xmlName: "EnumerationResults", + serializedName: "FilterBlobSegment", + type: { + name: "Composite", + className: "FilterBlobSegment", + modelProperties: { + serviceEndpoint: { + xmlIsAttribute: true, + xmlName: "ServiceEndpoint", + required: true, + serializedName: "ServiceEndpoint", + type: { + name: "String" + } + }, + where: { + xmlName: "Where", + required: true, + serializedName: "Where", + type: { + name: "String" + } + }, + blobs: { + xmlIsWrapped: true, + xmlName: "Blobs", + xmlElementName: "Blob", + required: true, + serializedName: "Blobs", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FilterBlobItem" + } + } + } + }, + continuationToken: { + xmlName: "NextMarker", + serializedName: "NextMarker", + type: { + name: "String" + } + } + } + } +}; var GeoReplication = { serializedName: "GeoReplication", type: { @@ -10029,6 +11227,103 @@ var PageList = { } } }; +var QueryFormat = { + serializedName: "QueryFormat", + type: { + name: "Composite", + className: "QueryFormat", + modelProperties: { + type: { + xmlName: "Type", + serializedName: "Type", + type: { + name: "Enum", + allowedValues: [ + "delimited", + "json" + ] + } + }, + delimitedTextConfiguration: { + xmlName: "DelimitedTextConfiguration", + serializedName: "DelimitedTextConfiguration", + type: { + name: "Composite", + className: "DelimitedTextConfiguration" + } + }, + jsonTextConfiguration: { + xmlName: "JsonTextConfiguration", + serializedName: "JsonTextConfiguration", + type: { + name: "Composite", + className: "JsonTextConfiguration" + } + } + } + } +}; +var QuerySerialization = { + serializedName: "QuerySerialization", + type: { + name: "Composite", + className: "QuerySerialization", + modelProperties: { + format: { + xmlName: "Format", + required: true, + serializedName: "Format", + type: { + name: "Composite", + className: "QueryFormat" + } + } + } + } +}; +var QueryRequest = { + serializedName: "QueryRequest", + type: { + name: "Composite", + className: "QueryRequest", + modelProperties: { + queryType: { + xmlName: "QueryType", + required: true, + isConstant: true, + serializedName: "QueryType", + defaultValue: 'SQL', + type: { + name: "String" + } + }, + expression: { + xmlName: "Expression", + required: true, + serializedName: "Expression", + type: { + name: "String" + } + }, + inputSerialization: { + xmlName: "InputSerialization", + serializedName: "InputSerialization", + type: { + name: "Composite", + className: "QuerySerialization" + } + }, + outputSerialization: { + xmlName: "OutputSerialization", + serializedName: "OutputSerialization", + type: { + name: "Composite", + className: "QuerySerialization" + } + } + } + } +}; var SignedIdentifier = { serializedName: "SignedIdentifier", type: { @@ -10082,6 +11377,13 @@ var StaticWebsite = { type: { name: "String" } + }, + defaultIndexDocumentPath: { + xmlName: "DefaultIndexDocumentPath", + serializedName: "DefaultIndexDocumentPath", + type: { + name: "String" + } } } } @@ -10403,7 +11705,9 @@ var ServiceGetAccountInfoHeaders = { allowedValues: [ "Storage", "BlobStorage", - "StorageV2" + "StorageV2", + "FileStorage", + "BlockBlobStorage" ] } }, @@ -10455,6 +11759,45 @@ var ServiceSubmitBatchHeaders = { } } }; +var ServiceFilterBlobsHeaders = { + serializedName: "service-filterblobs-headers", + type: { + name: "Composite", + className: "ServiceFilterBlobsHeaders", + modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; var ContainerCreateHeaders = { serializedName: "container-create-headers", type: { @@ -10830,6 +12173,45 @@ var ContainerSetAccessPolicyHeaders = { } } }; +var ContainerRestoreHeaders = { + serializedName: "container-restore-headers", + type: { + name: "Composite", + className: "ContainerRestoreHeaders", + modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; var ContainerAcquireLeaseHeaders = { serializedName: "container-acquirelease-headers", type: { @@ -11249,7 +12631,9 @@ var ContainerGetAccountInfoHeaders = { allowedValues: [ "Storage", "BlobStorage", - "StorageV2" + "StorageV2", + "FileStorage", + "BlockBlobStorage" ] } }, @@ -11286,6 +12670,24 @@ var BlobDownloadHeaders = { }, headerCollectionPrefix: "x-ms-meta-" }, + objectReplicationPolicyId: { + serializedName: "x-ms-or-policy-id", + type: { + name: "String" + } + }, + objectReplicationRules: { + serializedName: "x-ms-or", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + }, + headerCollectionPrefix: "x-ms-or-" + }, contentLength: { serializedName: "content-length", type: { @@ -11450,6 +12852,12 @@ var BlobDownloadHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, acceptRanges: { serializedName: "accept-ranges", type: { @@ -11492,6 +12900,18 @@ var BlobDownloadHeaders = { name: "ByteArray" } }, + tagCount: { + serializedName: "x-ms-tag-count", + type: { + name: "Number" + } + }, + isSealed: { + serializedName: "x-ms-blob-sealed", + type: { + name: "Boolean" + } + }, contentCrc64: { serializedName: "x-ms-content-crc64", type: { @@ -11537,6 +12957,24 @@ var BlobGetPropertiesHeaders = { }, headerCollectionPrefix: "x-ms-meta-" }, + objectReplicationPolicyId: { + serializedName: "x-ms-or-policy-id", + type: { + name: "String" + } + }, + objectReplicationRules: { + serializedName: "x-ms-or", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + }, + headerCollectionPrefix: "x-ms-or-" + }, blobType: { serializedName: "x-ms-blob-type", type: { @@ -11767,6 +13205,42 @@ var BlobGetPropertiesHeaders = { name: "DateTimeRfc1123" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, + isCurrentVersion: { + serializedName: "x-ms-is-current-version", + type: { + name: "Boolean" + } + }, + tagCount: { + serializedName: "x-ms-tag-count", + type: { + name: "Number" + } + }, + expiresOn: { + serializedName: "x-ms-expiry-time", + type: { + name: "DateTimeRfc1123" + } + }, + isSealed: { + serializedName: "x-ms-blob-sealed", + type: { + name: "Boolean" + } + }, + rehydratePriority: { + serializedName: "x-ms-rehydrate-priority", + type: { + name: "String" + } + }, errorCode: { serializedName: "x-ms-error-code", type: { @@ -12022,6 +13496,12 @@ var PageBlobCreateHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", type: { @@ -12097,6 +13577,12 @@ var AppendBlobCreateHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", type: { @@ -12172,6 +13658,12 @@ var BlockBlobUploadHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", type: { @@ -12244,6 +13736,57 @@ var BlobUndeleteHeaders = { } } }; +var BlobSetExpiryHeaders = { + serializedName: "blob-setexpiry-headers", + type: { + name: "Composite", + className: "BlobSetExpiryHeaders", + modelProperties: { + etag: { + serializedName: "etag", + type: { + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; var BlobSetHTTPHeadersHeaders = { serializedName: "blob-sethttpheaders-headers", type: { @@ -12337,6 +13880,12 @@ var BlobSetMetadataHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", type: { @@ -12691,6 +14240,12 @@ var BlobCreateSnapshotHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", type: { @@ -12748,6 +14303,12 @@ var BlobStartCopyFromURLHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", type: { @@ -12817,6 +14378,12 @@ var BlobCopyFromURLHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", type: { @@ -12981,7 +14548,9 @@ var BlobGetAccountInfoHeaders = { allowedValues: [ "Storage", "BlobStorage", - "StorageV2" + "StorageV2", + "FileStorage", + "BlockBlobStorage" ] } }, @@ -13180,6 +14749,12 @@ var BlockBlobCommitBlockListHeaders = { name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", type: { @@ -13990,6 +15565,386 @@ var AppendBlobAppendBlockFromUrlHeaders = { } } }; +var AppendBlobSealHeaders = { + serializedName: "appendblob-seal-headers", + type: { + name: "Composite", + className: "AppendBlobSealHeaders", + modelProperties: { + etag: { + serializedName: "etag", + type: { + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + isSealed: { + serializedName: "x-ms-blob-sealed", + type: { + name: "Boolean" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobQueryHeaders = { + serializedName: "blob-query-headers", + type: { + name: "Composite", + className: "BlobQueryHeaders", + modelProperties: { + lastModified: { + serializedName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + metadata: { + serializedName: "x-ms-meta", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + }, + headerCollectionPrefix: "x-ms-meta-" + }, + contentLength: { + serializedName: "content-length", + type: { + name: "Number" + } + }, + contentType: { + serializedName: "content-type", + type: { + name: "String" + } + }, + contentRange: { + serializedName: "content-range", + type: { + name: "String" + } + }, + etag: { + serializedName: "etag", + type: { + name: "String" + } + }, + contentMD5: { + serializedName: "content-md5", + type: { + name: "ByteArray" + } + }, + contentEncoding: { + serializedName: "content-encoding", + type: { + name: "String" + } + }, + cacheControl: { + serializedName: "cache-control", + type: { + name: "String" + } + }, + contentDisposition: { + serializedName: "content-disposition", + type: { + name: "String" + } + }, + contentLanguage: { + serializedName: "content-language", + type: { + name: "String" + } + }, + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + type: { + name: "Number" + } + }, + blobType: { + serializedName: "x-ms-blob-type", + type: { + name: "Enum", + allowedValues: [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ] + } + }, + copyCompletionTime: { + serializedName: "x-ms-copy-completion-time", + type: { + name: "DateTimeRfc1123" + } + }, + copyStatusDescription: { + serializedName: "x-ms-copy-status-description", + type: { + name: "String" + } + }, + copyId: { + serializedName: "x-ms-copy-id", + type: { + name: "String" + } + }, + copyProgress: { + serializedName: "x-ms-copy-progress", + type: { + name: "String" + } + }, + copySource: { + serializedName: "x-ms-copy-source", + type: { + name: "String" + } + }, + copyStatus: { + serializedName: "x-ms-copy-status", + type: { + name: "Enum", + allowedValues: [ + "pending", + "success", + "aborted", + "failed" + ] + } + }, + leaseDuration: { + serializedName: "x-ms-lease-duration", + type: { + name: "Enum", + allowedValues: [ + "infinite", + "fixed" + ] + } + }, + leaseState: { + serializedName: "x-ms-lease-state", + type: { + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] + } + }, + leaseStatus: { + serializedName: "x-ms-lease-status", + type: { + name: "Enum", + allowedValues: [ + "locked", + "unlocked" + ] + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + type: { + name: "String" + } + }, + acceptRanges: { + serializedName: "accept-ranges", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + type: { + name: "Number" + } + }, + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + type: { + name: "Boolean" + } + }, + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + type: { + name: "String" + } + }, + encryptionScope: { + serializedName: "x-ms-encryption-scope", + type: { + name: "String" + } + }, + blobContentMD5: { + serializedName: "x-ms-blob-content-md5", + type: { + name: "ByteArray" + } + }, + contentCrc64: { + serializedName: "x-ms-content-crc64", + type: { + name: "ByteArray" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobGetTagsHeaders = { + serializedName: "blob-gettags-headers", + type: { + name: "Composite", + className: "BlobGetTagsHeaders", + modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobSetTagsHeaders = { + serializedName: "blob-settags-headers", + type: { + name: "Composite", + className: "BlobSetTagsHeaders", + modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; /* * Copyright (c) Microsoft Corporation. All rights reserved. @@ -14006,12 +15961,15 @@ var Mappers = /*#__PURE__*/Object.freeze({ ContainerItem: ContainerItem, ContainerProperties: ContainerProperties, CorsRule: CorsRule, + FilterBlobItem: FilterBlobItem, + FilterBlobSegment: FilterBlobSegment, GeoReplication: GeoReplication, KeyInfo: KeyInfo, ListContainersSegmentResponse: ListContainersSegmentResponse, Logging: Logging, Metrics: Metrics, RetentionPolicy: RetentionPolicy, + ServiceFilterBlobsHeaders: ServiceFilterBlobsHeaders, ServiceGetAccountInfoHeaders: ServiceGetAccountInfoHeaders, ServiceGetPropertiesHeaders: ServiceGetPropertiesHeaders, ServiceGetStatisticsHeaders: ServiceGetStatisticsHeaders, @@ -14243,6 +16201,18 @@ var blobSequenceNumber = { } } }; +var blobTagsString = { + parameterPath: [ + "options", + "blobTagsString" + ], + mapper: { + serializedName: "x-ms-tags", + type: { + name: "String" + } + } +}; var blobType0 = { parameterPath: "blobType", mapper: { @@ -14344,7 +16314,7 @@ var comp10 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'copy', + defaultValue: 'expiry', type: { name: "String" } @@ -14356,7 +16326,7 @@ var comp11 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'tier', + defaultValue: 'snapshot', type: { name: "String" } @@ -14368,7 +16338,7 @@ var comp12 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'page', + defaultValue: 'copy', type: { name: "String" } @@ -14380,7 +16350,7 @@ var comp13 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'pagelist', + defaultValue: 'tier', type: { name: "String" } @@ -14392,7 +16362,7 @@ var comp14 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'incrementalcopy', + defaultValue: 'query', type: { name: "String" } @@ -14404,7 +16374,7 @@ var comp15 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'appendblock', + defaultValue: 'tags', type: { name: "String" } @@ -14416,7 +16386,7 @@ var comp16 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'block', + defaultValue: 'page', type: { name: "String" } @@ -14428,7 +16398,31 @@ var comp17 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'blocklist', + defaultValue: 'pagelist', + type: { + name: "String" + } + } +}; +var comp18 = { + parameterPath: "comp", + mapper: { + required: true, + isConstant: true, + serializedName: "comp", + defaultValue: 'incrementalcopy', + type: { + name: "String" + } + } +}; +var comp19 = { + parameterPath: "comp", + mapper: { + required: true, + isConstant: true, + serializedName: "comp", + defaultValue: 'appendblock', type: { name: "String" } @@ -14446,6 +16440,42 @@ var comp2 = { } } }; +var comp20 = { + parameterPath: "comp", + mapper: { + required: true, + isConstant: true, + serializedName: "comp", + defaultValue: 'seal', + type: { + name: "String" + } + } +}; +var comp21 = { + parameterPath: "comp", + mapper: { + required: true, + isConstant: true, + serializedName: "comp", + defaultValue: 'block', + type: { + name: "String" + } + } +}; +var comp22 = { + parameterPath: "comp", + mapper: { + required: true, + isConstant: true, + serializedName: "comp", + defaultValue: 'blocklist', + type: { + name: "String" + } + } +}; var comp3 = { parameterPath: "comp", mapper: { @@ -14476,7 +16506,7 @@ var comp5 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'metadata', + defaultValue: 'blobs', type: { name: "String" } @@ -14488,7 +16518,7 @@ var comp6 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'acl', + defaultValue: 'metadata', type: { name: "String" } @@ -14500,7 +16530,7 @@ var comp7 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'lease', + defaultValue: 'acl', type: { name: "String" } @@ -14524,7 +16554,7 @@ var comp9 = { required: true, isConstant: true, serializedName: "comp", - defaultValue: 'snapshot', + defaultValue: 'lease', type: { name: "String" } @@ -14637,6 +16667,30 @@ var defaultEncryptionScope = { } } }; +var deletedContainerName = { + parameterPath: [ + "options", + "deletedContainerName" + ], + mapper: { + serializedName: "x-ms-deleted-container-name", + type: { + name: "String" + } + } +}; +var deletedContainerVersion = { + parameterPath: [ + "options", + "deletedContainerVersion" + ], + mapper: { + serializedName: "x-ms-deleted-container-version", + type: { + name: "String" + } + } +}; var deleteSnapshots = { parameterPath: [ "options", @@ -14741,6 +16795,28 @@ var encryptionScope = { } } }; +var expiresOn = { + parameterPath: [ + "options", + "expiresOn" + ], + mapper: { + serializedName: "x-ms-expiry-time", + type: { + name: "String" + } + } +}; +var expiryOptions = { + parameterPath: "expiryOptions", + mapper: { + required: true, + serializedName: "x-ms-expiry-option", + type: { + name: "String" + } + } +}; var group = { parameterPath: [ "options", @@ -14831,6 +16907,19 @@ var ifSequenceNumberLessThanOrEqualTo = { } } }; +var ifTags = { + parameterPath: [ + "options", + "modifiedAccessConditions", + "ifTags" + ], + mapper: { + serializedName: "x-ms-if-tags", + type: { + name: "String" + } + } +}; var ifUnmodifiedSince = { parameterPath: [ "options", @@ -14852,12 +16941,19 @@ var include0 = { mapper: { serializedName: "include", type: { - name: "Enum", - allowedValues: [ - "metadata" - ] + name: "Sequence", + element: { + type: { + name: "Enum", + allowedValues: [ + "metadata", + "deleted" + ] + } + } } - } + }, + collectionFormat: coreHttp.QueryCollectionFormat.Csv }; var include1 = { parameterPath: [ @@ -14876,7 +16972,9 @@ var include1 = { "deleted", "metadata", "snapshots", - "uncommittedblobs" + "uncommittedblobs", + "versions", + "tags" ] } } @@ -15266,6 +17364,18 @@ var restype2 = { } } }; +var sealBlob = { + parameterPath: [ + "options", + "sealBlob" + ], + mapper: { + serializedName: "x-ms-seal-blob", + type: { + name: "Boolean" + } + } +}; var sequenceNumberAction = { parameterPath: "sequenceNumberAction", mapper: { @@ -15356,6 +17466,19 @@ var sourceIfNoneMatch = { } } }; +var sourceIfTags = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfTags" + ], + mapper: { + serializedName: "x-ms-source-if-tags", + type: { + name: "String" + } + } +}; var sourceIfUnmodifiedSince = { parameterPath: [ "options", @@ -15504,7 +17627,31 @@ var version = { required: true, isConstant: true, serializedName: "x-ms-version", - defaultValue: '2019-07-07', + defaultValue: '2019-12-12', + type: { + name: "String" + } + } +}; +var versionId = { + parameterPath: [ + "options", + "versionId" + ], + mapper: { + serializedName: "versionid", + type: { + name: "String" + } + } +}; +var where = { + parameterPath: [ + "options", + "where" + ], + mapper: { + serializedName: "where", type: { name: "String" } @@ -15581,6 +17728,11 @@ var Service = /** @class */ (function () { options: options }, submitBatchOperationSpec, callback); }; + Service.prototype.filterBlobs = function (options, callback) { + return this.client.sendOperationRequest({ + options: options + }, filterBlobsOperationSpec, callback); + }; return Service; }()); // Operation Specifications @@ -15800,6 +17952,35 @@ var submitBatchOperationSpec = { isXML: true, serializer: serializer }; +var filterBlobsOperationSpec = { + httpMethod: "GET", + urlParameters: [ + url + ], + queryParameters: [ + timeoutInSeconds, + where, + marker0, + maxPageSize, + comp5 + ], + headerParameters: [ + version, + requestId + ], + responses: { + 200: { + bodyMapper: FilterBlobSegment, + headersMapper: ServiceFilterBlobsHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ServiceFilterBlobsHeaders + } + }, + isXML: true, + serializer: serializer +}; /* * Copyright (c) Microsoft Corporation. All rights reserved. @@ -15814,9 +17995,11 @@ var Mappers$1 = /*#__PURE__*/Object.freeze({ AccessPolicy: AccessPolicy, BlobFlatListSegment: BlobFlatListSegment, BlobHierarchyListSegment: BlobHierarchyListSegment, - BlobItem: BlobItem, + BlobItemInternal: BlobItemInternal, BlobPrefix: BlobPrefix, - BlobProperties: BlobProperties, + BlobPropertiesInternal: BlobPropertiesInternal, + BlobTag: BlobTag, + BlobTags: BlobTags, ContainerAcquireLeaseHeaders: ContainerAcquireLeaseHeaders, ContainerBreakLeaseHeaders: ContainerBreakLeaseHeaders, ContainerChangeLeaseHeaders: ContainerChangeLeaseHeaders, @@ -15829,6 +18012,7 @@ var Mappers$1 = /*#__PURE__*/Object.freeze({ ContainerListBlobHierarchySegmentHeaders: ContainerListBlobHierarchySegmentHeaders, ContainerReleaseLeaseHeaders: ContainerReleaseLeaseHeaders, ContainerRenewLeaseHeaders: ContainerRenewLeaseHeaders, + ContainerRestoreHeaders: ContainerRestoreHeaders, ContainerSetAccessPolicyHeaders: ContainerSetAccessPolicyHeaders, ContainerSetMetadataHeaders: ContainerSetMetadataHeaders, ListBlobsFlatSegmentResponse: ListBlobsFlatSegmentResponse, @@ -15885,6 +18069,11 @@ var Container = /** @class */ (function () { options: options }, setAccessPolicyOperationSpec, callback); }; + Container.prototype.restore = function (options, callback) { + return this.client.sendOperationRequest({ + options: options + }, restoreOperationSpec, callback); + }; Container.prototype.acquireLease = function (options, callback) { return this.client.sendOperationRequest({ options: options @@ -16029,7 +18218,7 @@ var setMetadataOperationSpec = { queryParameters: [ timeoutInSeconds, restype2, - comp5 + comp6 ], headerParameters: [ metadata, @@ -16059,7 +18248,7 @@ var getAccessPolicyOperationSpec = { queryParameters: [ timeoutInSeconds, restype2, - comp6 + comp7 ], headerParameters: [ version, @@ -16100,7 +18289,7 @@ var setAccessPolicyOperationSpec = { queryParameters: [ timeoutInSeconds, restype2, - comp6 + comp7 ], headerParameters: [ access, @@ -16143,6 +18332,35 @@ var setAccessPolicyOperationSpec = { isXML: true, serializer: serializer$1 }; +var restoreOperationSpec = { + httpMethod: "PUT", + path: "{containerName}", + urlParameters: [ + url + ], + queryParameters: [ + timeoutInSeconds, + restype2, + comp8 + ], + headerParameters: [ + version, + requestId, + deletedContainerName, + deletedContainerVersion + ], + responses: { + 201: { + headersMapper: ContainerRestoreHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerRestoreHeaders + } + }, + isXML: true, + serializer: serializer$1 +}; var acquireLeaseOperationSpec = { httpMethod: "PUT", path: "{containerName}", @@ -16151,7 +18369,7 @@ var acquireLeaseOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp7, + comp9, restype2 ], headerParameters: [ @@ -16183,7 +18401,7 @@ var releaseLeaseOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp7, + comp9, restype2 ], headerParameters: [ @@ -16214,7 +18432,7 @@ var renewLeaseOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp7, + comp9, restype2 ], headerParameters: [ @@ -16245,7 +18463,7 @@ var breakLeaseOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp7, + comp9, restype2 ], headerParameters: [ @@ -16276,7 +18494,7 @@ var changeLeaseOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp7, + comp9, restype2 ], headerParameters: [ @@ -16412,17 +18630,28 @@ var Mappers$2 = /*#__PURE__*/Object.freeze({ BlobGetAccessControlHeaders: BlobGetAccessControlHeaders, BlobGetAccountInfoHeaders: BlobGetAccountInfoHeaders, BlobGetPropertiesHeaders: BlobGetPropertiesHeaders, + BlobGetTagsHeaders: BlobGetTagsHeaders, + BlobQueryHeaders: BlobQueryHeaders, BlobReleaseLeaseHeaders: BlobReleaseLeaseHeaders, BlobRenameHeaders: BlobRenameHeaders, BlobRenewLeaseHeaders: BlobRenewLeaseHeaders, BlobSetAccessControlHeaders: BlobSetAccessControlHeaders, + BlobSetExpiryHeaders: BlobSetExpiryHeaders, BlobSetHTTPHeadersHeaders: BlobSetHTTPHeadersHeaders, BlobSetMetadataHeaders: BlobSetMetadataHeaders, + BlobSetTagsHeaders: BlobSetTagsHeaders, BlobSetTierHeaders: BlobSetTierHeaders, BlobStartCopyFromURLHeaders: BlobStartCopyFromURLHeaders, + BlobTag: BlobTag, + BlobTags: BlobTags, BlobUndeleteHeaders: BlobUndeleteHeaders, DataLakeStorageError: DataLakeStorageError, DataLakeStorageErrorError: DataLakeStorageErrorError, + DelimitedTextConfiguration: DelimitedTextConfiguration, + JsonTextConfiguration: JsonTextConfiguration, + QueryFormat: QueryFormat, + QueryRequest: QueryRequest, + QuerySerialization: QuerySerialization, StorageError: StorageError }); @@ -16480,6 +18709,12 @@ var Blob$1 = /** @class */ (function () { options: options }, undeleteOperationSpec, callback); }; + Blob.prototype.setExpiry = function (expiryOptions, options, callback) { + return this.client.sendOperationRequest({ + expiryOptions: expiryOptions, + options: options + }, setExpiryOperationSpec, callback); + }; Blob.prototype.setHTTPHeaders = function (options, callback) { return this.client.sendOperationRequest({ options: options @@ -16553,6 +18788,21 @@ var Blob$1 = /** @class */ (function () { options: options }, getAccountInfoOperationSpec$2, callback); }; + Blob.prototype.query = function (options, callback) { + return this.client.sendOperationRequest({ + options: options + }, queryOperationSpec, callback); + }; + Blob.prototype.getTags = function (options, callback) { + return this.client.sendOperationRequest({ + options: options + }, getTagsOperationSpec, callback); + }; + Blob.prototype.setTags = function (options, callback) { + return this.client.sendOperationRequest({ + options: options + }, setTagsOperationSpec, callback); + }; return Blob; }()); // Operation Specifications @@ -16565,6 +18815,7 @@ var downloadOperationSpec = { ], queryParameters: [ snapshot, + versionId, timeoutInSeconds ], headerParameters: [ @@ -16580,7 +18831,8 @@ var downloadOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -16617,6 +18869,7 @@ var getPropertiesOperationSpec$2 = { ], queryParameters: [ snapshot, + versionId, timeoutInSeconds ], headerParameters: [ @@ -16629,7 +18882,8 @@ var getPropertiesOperationSpec$2 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -16651,6 +18905,7 @@ var deleteMethodOperationSpec$1 = { ], queryParameters: [ snapshot, + versionId, timeoutInSeconds ], headerParameters: [ @@ -16661,7 +18916,8 @@ var deleteMethodOperationSpec$1 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 202: { @@ -16813,6 +19069,34 @@ var undeleteOperationSpec = { isXML: true, serializer: serializer$2 }; +var setExpiryOperationSpec = { + httpMethod: "PUT", + path: "{containerName}/{blob}", + urlParameters: [ + url + ], + queryParameters: [ + timeoutInSeconds, + comp10 + ], + headerParameters: [ + version, + requestId, + expiryOptions, + expiresOn + ], + responses: { + 200: { + headersMapper: BlobSetExpiryHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlobSetExpiryHeaders + } + }, + isXML: true, + serializer: serializer$2 +}; var setHTTPHeadersOperationSpec = { httpMethod: "PUT", path: "{containerName}/{blob}", @@ -16836,7 +19120,8 @@ var setHTTPHeadersOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -16858,7 +19143,7 @@ var setMetadataOperationSpec$1 = { ], queryParameters: [ timeoutInSeconds, - comp5 + comp6 ], headerParameters: [ metadata, @@ -16872,7 +19157,8 @@ var setMetadataOperationSpec$1 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -16894,7 +19180,7 @@ var acquireLeaseOperationSpec$1 = { ], queryParameters: [ timeoutInSeconds, - comp7 + comp9 ], headerParameters: [ duration, @@ -16905,7 +19191,8 @@ var acquireLeaseOperationSpec$1 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 201: { @@ -16927,7 +19214,7 @@ var releaseLeaseOperationSpec$1 = { ], queryParameters: [ timeoutInSeconds, - comp7 + comp9 ], headerParameters: [ leaseId1, @@ -16937,7 +19224,8 @@ var releaseLeaseOperationSpec$1 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -16959,7 +19247,7 @@ var renewLeaseOperationSpec$1 = { ], queryParameters: [ timeoutInSeconds, - comp7 + comp9 ], headerParameters: [ leaseId1, @@ -16969,7 +19257,8 @@ var renewLeaseOperationSpec$1 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -16991,7 +19280,7 @@ var changeLeaseOperationSpec$1 = { ], queryParameters: [ timeoutInSeconds, - comp7 + comp9 ], headerParameters: [ leaseId1, @@ -17002,7 +19291,8 @@ var changeLeaseOperationSpec$1 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -17024,7 +19314,7 @@ var breakLeaseOperationSpec$1 = { ], queryParameters: [ timeoutInSeconds, - comp7 + comp9 ], headerParameters: [ breakPeriod, @@ -17034,7 +19324,8 @@ var breakLeaseOperationSpec$1 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 202: { @@ -17056,7 +19347,7 @@ var createSnapshotOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp9 + comp11 ], headerParameters: [ metadata, @@ -17070,6 +19361,7 @@ var createSnapshotOperationSpec = { ifUnmodifiedSince, ifMatch, ifNoneMatch, + ifTags, leaseId0 ], responses: { @@ -17100,14 +19392,18 @@ var startCopyFromURLOperationSpec = { copySource, version, requestId, + blobTagsString, + sealBlob, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, + sourceIfTags, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, + ifTags, leaseId0 ], responses: { @@ -17138,6 +19434,7 @@ var copyFromURLOperationSpec = { version, requestId, sourceContentMD5, + blobTagsString, xMsRequiresSync, sourceIfModifiedSince, sourceIfUnmodifiedSince, @@ -17147,6 +19444,7 @@ var copyFromURLOperationSpec = { ifUnmodifiedSince, ifMatch, ifNoneMatch, + ifTags, leaseId0 ], responses: { @@ -17170,7 +19468,7 @@ var abortCopyFromURLOperationSpec = { queryParameters: [ copyId, timeoutInSeconds, - comp10 + comp12 ], headerParameters: [ version, @@ -17197,15 +19495,18 @@ var setTierOperationSpec = { url ], queryParameters: [ + snapshot, + versionId, timeoutInSeconds, - comp11 + comp13 ], headerParameters: [ tier1, rehydratePriority, version, requestId, - leaseId0 + leaseId0, + ifTags ], responses: { 200: { @@ -17247,6 +19548,133 @@ var getAccountInfoOperationSpec$2 = { isXML: true, serializer: serializer$2 }; +var queryOperationSpec = { + httpMethod: "POST", + path: "{containerName}/{blob}", + urlParameters: [ + url + ], + queryParameters: [ + snapshot, + timeoutInSeconds, + comp14 + ], + headerParameters: [ + version, + requestId, + leaseId0, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + ifTags + ], + requestBody: { + parameterPath: [ + "options", + "queryRequest" + ], + mapper: QueryRequest + }, + contentType: "application/xml; charset=utf-8", + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Stream" + } + }, + headersMapper: BlobQueryHeaders + }, + 206: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Stream" + } + }, + headersMapper: BlobQueryHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlobQueryHeaders + } + }, + isXML: true, + serializer: serializer$2 +}; +var getTagsOperationSpec = { + httpMethod: "GET", + path: "{containerName}/{blob}", + urlParameters: [ + url + ], + queryParameters: [ + timeoutInSeconds, + snapshot, + versionId, + comp15 + ], + headerParameters: [ + version, + requestId, + ifTags + ], + responses: { + 200: { + bodyMapper: BlobTags, + headersMapper: BlobGetTagsHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlobGetTagsHeaders + } + }, + isXML: true, + serializer: serializer$2 +}; +var setTagsOperationSpec = { + httpMethod: "PUT", + path: "{containerName}/{blob}", + urlParameters: [ + url + ], + queryParameters: [ + timeoutInSeconds, + versionId, + comp15 + ], + headerParameters: [ + version, + transactionalContentMD5, + transactionalContentCrc64, + requestId, + ifTags + ], + requestBody: { + parameterPath: [ + "options", + "tags" + ], + mapper: BlobTags + }, + contentType: "application/xml; charset=utf-8", + responses: { + 204: { + headersMapper: BlobSetTagsHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlobSetTagsHeaders + } + }, + isXML: true, + serializer: serializer$2 +}; /* * Copyright (c) Microsoft Corporation. All rights reserved. @@ -17370,6 +19798,7 @@ var createOperationSpec$1 = { blobSequenceNumber, version, requestId, + blobTagsString, blobType0, blobContentType, blobContentEncoding, @@ -17384,7 +19813,8 @@ var createOperationSpec$1 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 201: { @@ -17406,7 +19836,7 @@ var uploadPagesOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp12 + comp16 ], headerParameters: [ contentLength, @@ -17427,7 +19857,8 @@ var uploadPagesOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], requestBody: { parameterPath: "body", @@ -17460,7 +19891,7 @@ var clearPagesOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp12 + comp16 ], headerParameters: [ contentLength, @@ -17479,7 +19910,8 @@ var clearPagesOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 201: { @@ -17501,7 +19933,7 @@ var uploadPagesFromURLOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp12 + comp16 ], headerParameters: [ sourceUrl, @@ -17525,6 +19957,7 @@ var uploadPagesFromURLOperationSpec = { ifUnmodifiedSince, ifMatch, ifNoneMatch, + ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, @@ -17551,7 +19984,7 @@ var getPageRangesOperationSpec = { queryParameters: [ snapshot, timeoutInSeconds, - comp13 + comp17 ], headerParameters: [ range0, @@ -17561,7 +19994,8 @@ var getPageRangesOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -17586,7 +20020,7 @@ var getPageRangesDiffOperationSpec = { snapshot, timeoutInSeconds, prevsnapshot, - comp13 + comp17 ], headerParameters: [ prevSnapshotUrl, @@ -17597,7 +20031,8 @@ var getPageRangesDiffOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -17634,7 +20069,8 @@ var resizeOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -17667,7 +20103,8 @@ var updateSequenceNumberOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 200: { @@ -17689,7 +20126,7 @@ var copyIncrementalOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp14 + comp18 ], headerParameters: [ copySource, @@ -17698,7 +20135,8 @@ var copyIncrementalOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 202: { @@ -17726,6 +20164,7 @@ var Mappers$4 = /*#__PURE__*/Object.freeze({ AppendBlobAppendBlockFromUrlHeaders: AppendBlobAppendBlockFromUrlHeaders, AppendBlobAppendBlockHeaders: AppendBlobAppendBlockHeaders, AppendBlobCreateHeaders: AppendBlobCreateHeaders, + AppendBlobSealHeaders: AppendBlobSealHeaders, StorageError: StorageError }); @@ -17767,6 +20206,11 @@ var AppendBlob = /** @class */ (function () { options: options }, appendBlockFromUrlOperationSpec, callback); }; + AppendBlob.prototype.seal = function (options, callback) { + return this.client.sendOperationRequest({ + options: options + }, sealOperationSpec, callback); + }; return AppendBlob; }()); // Operation Specifications @@ -17786,6 +20230,7 @@ var createOperationSpec$2 = { encryptionScope, version, requestId, + blobTagsString, blobType1, blobContentType, blobContentEncoding, @@ -17800,7 +20245,8 @@ var createOperationSpec$2 = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], responses: { 201: { @@ -17822,7 +20268,7 @@ var appendBlockOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp15 + comp19 ], headerParameters: [ contentLength, @@ -17840,7 +20286,8 @@ var appendBlockOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], requestBody: { parameterPath: "body", @@ -17873,7 +20320,7 @@ var appendBlockFromUrlOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp15 + comp19 ], headerParameters: [ sourceUrl, @@ -17895,6 +20342,7 @@ var appendBlockFromUrlOperationSpec = { ifUnmodifiedSince, ifMatch, ifNoneMatch, + ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, @@ -17912,6 +20360,38 @@ var appendBlockFromUrlOperationSpec = { isXML: true, serializer: serializer$4 }; +var sealOperationSpec = { + httpMethod: "PUT", + path: "{containerName}/{blob}", + urlParameters: [ + url + ], + queryParameters: [ + timeoutInSeconds, + comp20 + ], + headerParameters: [ + version, + requestId, + leaseId0, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + appendPosition + ], + responses: { + 200: { + headersMapper: AppendBlobSealHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: AppendBlobSealHeaders + } + }, + isXML: true, + serializer: serializer$4 +}; /* * Copyright (c) Microsoft Corporation. All rights reserved. @@ -18008,6 +20488,7 @@ var uploadOperationSpec = { tier0, version, requestId, + blobTagsString, blobType2, blobContentType, blobContentEncoding, @@ -18022,7 +20503,8 @@ var uploadOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], requestBody: { parameterPath: "body", @@ -18056,7 +20538,7 @@ var stageBlockOperationSpec = { queryParameters: [ blockId, timeoutInSeconds, - comp16 + comp21 ], headerParameters: [ contentLength, @@ -18102,7 +20584,7 @@ var stageBlockFromURLOperationSpec = { queryParameters: [ blockId, timeoutInSeconds, - comp16 + comp21 ], headerParameters: [ contentLength, @@ -18142,7 +20624,7 @@ var commitBlockListOperationSpec = { ], queryParameters: [ timeoutInSeconds, - comp17 + comp22 ], headerParameters: [ transactionalContentMD5, @@ -18152,6 +20634,7 @@ var commitBlockListOperationSpec = { tier0, version, requestId, + blobTagsString, blobCacheControl, blobContentType, blobContentEncoding, @@ -18165,7 +20648,8 @@ var commitBlockListOperationSpec = { ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch + ifNoneMatch, + ifTags ], requestBody: { parameterPath: "blocks", @@ -18194,12 +20678,13 @@ var getBlockListOperationSpec = { snapshot, listType, timeoutInSeconds, - comp17 + comp22 ], headerParameters: [ version, requestId, - leaseId0 + leaseId0, + ifTags ], responses: { 200: { @@ -18223,10 +20708,10 @@ var logger = logger$1.createClientLogger("storage-blob"); // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -var SDK_VERSION = "12.1.2"; -var SERVICE_VERSION = "2019-07-07"; +var SDK_VERSION = "12.2.1"; +var SERVICE_VERSION = "2019-12-12"; var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB -var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 100 * 1024 * 1024; // 100MB +var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB var BLOCK_BLOB_MAX_BLOCKS = 50000; var DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; // 8MB var DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; // 4MB @@ -18240,6 +20725,7 @@ var URLConstants = { FORCE_BROWSER_NO_CACHE: "_", SIGNATURE: "sig", SNAPSHOT: "snapshot", + VERSIONID: "versionid", TIMEOUT: "timeout" } }; @@ -18276,6 +20762,7 @@ var HeaderConstants = { X_MS_VERSION: "x-ms-version" }; var ETagNone = ""; +var ETagAny = "*"; var SIZE_1_MB = 1 * 1024 * 1024; var BATCH_MAX_REQUEST = 256; var BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; @@ -18375,7 +20862,9 @@ var StorageBlobLoggingAllowedHeaderNames = [ "x-ms-source-if-none-match", "x-ms-source-if-unmodified-since", "x-ms-tag-count", - "x-ms-encryption-key-sha256" + "x-ms-encryption-key-sha256", + "x-ms-if-tags", + "x-ms-source-if-tags" ]; var StorageBlobLoggingAllowedQueryParameters = [ "comp", @@ -18419,7 +20908,7 @@ var StorageBlobLoggingAllowedQueryParameters = [ * * ## URL encode and escape strategy for JS SDKs * - * When customers pass a URL string into XxxClient classes constrcutor, the URL string may already be URL encoded or not. + * When customers pass a URL string into XxxClient classes constructor, the URL string may already be URL encoded or not. * But before sending to Azure Storage server, the URL must be encoded. However, it's hard for a SDK to guess whether the URL * string has been encoded or not. We have 2 potential strategies, and chose strategy two for the XxxClient constructors. * @@ -18449,7 +20938,7 @@ var StorageBlobLoggingAllowedQueryParameters = [ * * This strategy gives us flexibility to create with any special characters. But "%" will be treated as a special characters, if the URL string * is not encoded, there shouldn't a "%" in the URL string, otherwise the URL is not a valid URL. - * If customer needs to create a blob with "%" in it's blob name, use "%25" insead of "%". Just like above 3rd sample. + * If customer needs to create a blob with "%" in it's blob name, use "%25" instead of "%". Just like above 3rd sample. * And following URL strings are invalid: * - "http://account.blob.core.windows.net/con/b%" * - "http://account.blob.core.windows.net/con/b%2" @@ -18569,14 +21058,11 @@ function extractConnectionStringParts(connectionString) { else if (!accountSas) { throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String"); } - else if (!accountName) { - throw new Error("Invalid AccountName in the provided SAS Connection String"); - } return { kind: "SASConnString", url: blobEndpoint, accountName: accountName, accountSas: accountSas }; } } /** - * Internal escape method implmented Strategy Two mentioned in escapeURL() description. + * Internal escape method implemented Strategy Two mentioned in escapeURL() description. * * @param {string} text * @returns {string} @@ -18795,6 +21281,8 @@ function delay(timeInMs, aborter, abortError) { */ function padStart(currentString, targetLength, padString) { if (padString === void 0) { padString = " "; } + // TS doesn't know this code needs to run downlevel sometimes. + // @ts-expect-error if (String.prototype.padStart) { return currentString.padStart(targetLength, padString); } @@ -18834,14 +21322,15 @@ function getAccountNameFromUrl(url) { // `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`; accountName = parsedUrl.getHost().split(".")[0]; } - else { + else if (isIpEndpointStyle(parsedUrl)) { // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/ // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/ // .getPath() -> /devstoreaccount1/ accountName = parsedUrl.getPath().split("/")[1]; } - if (!accountName) { - throw new Error("Provided accountName is invalid."); + else { + // Custom domain case: "https://customdomain.com/containername/blob". + accountName = ""; } return accountName; } @@ -18849,6 +21338,154 @@ function getAccountNameFromUrl(url) { throw new Error("Unable to extract accountName with provided information."); } } +function isIpEndpointStyle(parsedUrl) { + if (parsedUrl.getHost() == undefined) { + return false; + } + var host = parsedUrl.getHost() + (parsedUrl.getPort() == undefined ? "" : ":" + parsedUrl.getPort()); + // Case 1: Ipv6, use a broad regex to find out candidates whose host contains two ':'. + // Case 2: localhost(:port), use broad regex to match port part. + // Case 3: Ipv4, use broad regex which just check if host contains Ipv4. + // For valid host please refer to https://man7.org/linux/man-pages/man7/hostname.7.html. + return /^.*:.*:.*$|^localhost(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(host); +} +/** + * Convert Tags to encoded string. + * + * @export + * @param {Tags} tags + * @returns {string | undefined} + */ +function toBlobTagsString(tags) { + if (tags === undefined) { + return undefined; + } + var tagPairs = []; + for (var key in tags) { + if (tags.hasOwnProperty(key)) { + var value = tags[key]; + tagPairs.push(encodeURIComponent(key) + "=" + encodeURIComponent(value)); + } + } + return tagPairs.join("&"); +} +/** + * Convert Tags type to BlobTags. + * + * @export + * @param {Tags} [tags] + * @returns {(BlobTags | undefined)} + */ +function toBlobTags(tags) { + if (tags === undefined) { + return undefined; + } + var res = { + blobTagSet: [] + }; + for (var key in tags) { + if (tags.hasOwnProperty(key)) { + var value = tags[key]; + res.blobTagSet.push({ + key: key, + value: value + }); + } + } + return res; +} +/** + * Covert BlobTags to Tags type. + * + * @export + * @param {BlobTags} [tags] + * @returns {(Tags | undefined)} + */ +function toTags(tags) { + if (tags === undefined) { + return undefined; + } + var res = {}; + for (var _i = 0, _a = tags.blobTagSet; _i < _a.length; _i++) { + var blobTag = _a[_i]; + res[blobTag.key] = blobTag.value; + } + return res; +} +/** + * Convert BlobQueryTextConfiguration to QuerySerialization type. + * + * @export + * @param {(BlobQueryJsonTextConfiguration | BlobQueryCsvTextConfiguration)} [textConfiguration] + * @returns {(QuerySerialization | undefined)} + */ +function toQuerySerialization(textConfiguration) { + if (textConfiguration === undefined) { + return undefined; + } + switch (textConfiguration.kind) { + case "csv": + return { + format: { + type: "delimited", + delimitedTextConfiguration: { + columnSeparator: textConfiguration.columnSeparator || ",", + fieldQuote: textConfiguration.fieldQuote || "", + recordSeparator: textConfiguration.recordSeparator, + escapeChar: textConfiguration.escapeCharacter || "", + headersPresent: textConfiguration.hasHeaders || false + } + } + }; + case "json": + return { + format: { + type: "json", + jsonTextConfiguration: { + recordSeparator: textConfiguration.recordSeparator + } + } + }; + default: + throw Error("Invalid BlobQueryTextConfiguration."); + } +} +function parseObjectReplicationRecord(objectReplicationRecord) { + if (!objectReplicationRecord) { + return undefined; + } + if ("policy-id" in objectReplicationRecord) { + // If the dictionary contains a key with policy id, we are not required to do any parsing since + // the policy id should already be stored in the ObjectReplicationDestinationPolicyId. + return undefined; + } + var orProperties = []; + var _loop_1 = function (key) { + var ids = key.split("_"); + var policyPrefix = "or-"; + if (ids[0].startsWith(policyPrefix)) { + ids[0] = ids[0].substring(policyPrefix.length); + } + var rule = { + ruleId: ids[1], + replicationStatus: objectReplicationRecord[key] + }; + var policyIndex = orProperties.findIndex(function (policy) { return policy.policyId === ids[0]; }); + if (policyIndex > -1) { + orProperties[policyIndex].rules.push(rule); + } + else { + orProperties.push({ + policyId: ids[0], + rules: [rule] + }); + } + }; + for (var key in objectReplicationRecord) { + _loop_1(key); + } + return orProperties; +} // Copyright (c) Microsoft Corporation. All rights reserved. /** @@ -19186,6 +21823,133 @@ var StorageRetryPolicyFactory = /** @class */ (function () { return StorageRetryPolicyFactory; }()); +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * Credential policy used to sign HTTP(S) requests before sending. This is an + * abstract class. + * + * @export + * @abstract + * @class CredentialPolicy + * @extends {BaseRequestPolicy} + */ +var CredentialPolicy = /** @class */ (function (_super) { + tslib.__extends(CredentialPolicy, _super); + function CredentialPolicy() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Sends out request. + * + * @param {WebResource} request + * @returns {Promise} + * @memberof CredentialPolicy + */ + CredentialPolicy.prototype.sendRequest = function (request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + }; + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @protected + * @abstract + * @param {WebResource} request + * @returns {WebResource} + * @memberof CredentialPolicy + */ + CredentialPolicy.prototype.signRequest = function (request) { + // Child classes must override this method with request signing. This method + // will be executed in sendRequest(). + return request; + }; + return CredentialPolicy; +}(coreHttp.BaseRequestPolicy)); + +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * AnonymousCredentialPolicy is used with HTTP(S) requests that read public resources + * or for use with Shared Access Signatures (SAS). + * + * @export + * @class AnonymousCredentialPolicy + * @extends {CredentialPolicy} + */ +var AnonymousCredentialPolicy = /** @class */ (function (_super) { + tslib.__extends(AnonymousCredentialPolicy, _super); + /** + * Creates an instance of AnonymousCredentialPolicy. + * @param {RequestPolicy} nextPolicy + * @param {RequestPolicyOptions} options + * @memberof AnonymousCredentialPolicy + */ + function AnonymousCredentialPolicy(nextPolicy, options) { + return _super.call(this, nextPolicy, options) || this; + } + return AnonymousCredentialPolicy; +}(CredentialPolicy)); + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +/** + * Credential is an abstract class for Azure Storage HTTP requests signing. This + * class will host an credentialPolicyCreator factory which generates CredentialPolicy. + * + * @export + * @abstract + * @class Credential + */ +var Credential = /** @class */ (function () { + function Credential() { + } + /** + * Creates a RequestPolicy object. + * + * @param {RequestPolicy} _nextPolicy + * @param {RequestPolicyOptions} _options + * @returns {RequestPolicy} + * @memberof Credential + */ + Credential.prototype.create = function ( + // tslint:disable-next-line:variable-name + _nextPolicy, + // tslint:disable-next-line:variable-name + _options) { + throw new Error("Method should be implemented in children classes."); + }; + return Credential; +}()); + +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * AnonymousCredential provides a credentialPolicyCreator member used to create + * AnonymousCredentialPolicy objects. AnonymousCredentialPolicy is used with + * HTTP(S) requests that read public resources or for use with Shared Access + * Signatures (SAS). + * + * @export + * @class AnonymousCredential + * @extends {Credential} + */ +var AnonymousCredential = /** @class */ (function (_super) { + tslib.__extends(AnonymousCredential, _super); + function AnonymousCredential() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Creates an {@link AnonymousCredentialPolicy} object. + * + * @param {RequestPolicy} nextPolicy + * @param {RequestPolicyOptions} options + * @returns {AnonymousCredentialPolicy} + * @memberof AnonymousCredential + */ + AnonymousCredential.prototype.create = function (nextPolicy, options) { + return new AnonymousCredentialPolicy(nextPolicy, options); + }; + return AnonymousCredential; +}(Credential)); + // Copyright (c) Microsoft Corporation. All rights reserved. /** * TelemetryPolicy is a policy used to tag user-agent header for every requests. @@ -19250,6 +22014,8 @@ var TelemetryPolicyFactory = /** @class */ (function () { var userAgentInfo = []; { if (telemetry) { + // FIXME: replace() only replaces the first space. And we have no idea why we need to replace spaces in the first place. + // But fixing this would be a breaking change. Logged an issue here: https://github.com/Azure/azure-sdk-for-js/issues/10793 var telemetryString = (telemetry.userAgentPrefix || "").replace(" ", ""); if (telemetryString.length > 0 && userAgentInfo.indexOf(telemetryString) === -1) { userAgentInfo.push(telemetryString); @@ -19339,10 +22105,13 @@ var Pipeline = /** @class */ (function () { * @returns {Pipeline} A new Pipeline object. */ function newPipeline(credential, pipelineOptions) { + if (pipelineOptions === void 0) { pipelineOptions = {}; } + if (credential === undefined) { + credential = new AnonymousCredential(); + } // Order is important. Closer to the API at the top & closer to the network at the bottom. // The credential's policy factory must appear close to the wire so it can sign any // changes made by other factories (like UniqueRequestIDPolicyFactory) - if (pipelineOptions === void 0) { pipelineOptions = {}; } var telemetryPolicy = new TelemetryPolicyFactory(pipelineOptions.userAgentOptions); var factories = [ coreHttp.tracingPolicy({ userAgent: telemetryPolicy.telemetryString }), @@ -19359,7 +22128,7 @@ function newPipeline(credential, pipelineOptions) { }) ]; { - // policies only avaiable in Node.js runtime, not in browsers + // policies only available in Node.js runtime, not in browsers factories.push(coreHttp.proxyPolicy(pipelineOptions.proxyOptions)); factories.push(coreHttp.disableResponseDecompressionPolicy()); } @@ -19497,7 +22266,7 @@ var RetriableReadableStream = /** @class */ (function (_super) { /** * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * BlobDownloadResponse implements BlobDownloadResponseModel interface, and in Node.js runtime it will + * BlobDownloadResponse implements BlobDownloadResponseParsed interface, and in Node.js runtime it will * automatically retry when internal read stream unexpected ends. (This kind of unexpected ends cannot * trigger retries defined in pipeline retry policy.) * @@ -19506,13 +22275,13 @@ var RetriableReadableStream = /** @class */ (function (_super) { * * @export * @class BlobDownloadResponse - * @implements {BlobDownloadResponseModel} + * @implements {BlobDownloadResponseParsed} */ var BlobDownloadResponse = /** @class */ (function () { /** * Creates an instance of BlobDownloadResponse. * - * @param {BlobDownloadResponseModel} originalResponse + * @param {BlobDownloadResponseParsed} originalResponse * @param {ReadableStreamGetter} getter * @param {number} offset * @param {number} count @@ -19536,7 +22305,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.acceptRanges; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "cacheControl", { @@ -19551,7 +22320,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.cacheControl; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentDisposition", { @@ -19567,7 +22336,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.contentDisposition; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentEncoding", { @@ -19582,7 +22351,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.contentEncoding; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentLanguage", { @@ -19597,7 +22366,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.contentLanguage; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "blobSequenceNumber", { @@ -19612,7 +22381,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.blobSequenceNumber; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "blobType", { @@ -19627,7 +22396,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.blobType; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentLength", { @@ -19642,7 +22411,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.contentLength; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentMD5", { @@ -19663,7 +22432,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.contentMD5; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentRange", { @@ -19679,7 +22448,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.contentRange; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentType", { @@ -19694,7 +22463,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.contentType; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "copyCompletedOn", { @@ -19710,7 +22479,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.copyCompletedOn; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "copyId", { @@ -19725,7 +22494,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.copyId; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "copyProgress", { @@ -19742,7 +22511,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.copyProgress; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "copySource", { @@ -19758,7 +22527,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.copySource; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "copyStatus", { @@ -19774,7 +22543,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.copyStatus; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "copyStatusDescription", { @@ -19790,7 +22559,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.copyStatusDescription; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "leaseDuration", { @@ -19806,7 +22575,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.leaseDuration; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "leaseState", { @@ -19821,7 +22590,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.leaseState; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "leaseStatus", { @@ -19836,7 +22605,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.leaseStatus; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "date", { @@ -19851,7 +22620,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.date; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "blobCommittedBlockCount", { @@ -19866,7 +22635,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.blobCommittedBlockCount; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "etag", { @@ -19881,7 +22650,21 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.etag; }, - enumerable: true, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobDownloadResponse.prototype, "tagCount", { + /** + * The number of tags associated with the blob + * + * @readonly + * @type {(number | undefined)} + * @memberof BlobDownloadResponse + */ + get: function () { + return this.originalResponse.tagCount; + }, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "errorCode", { @@ -19895,7 +22678,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.errorCode; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "isServerEncrypted", { @@ -19913,7 +22696,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.isServerEncrypted; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "blobContentMD5", { @@ -19931,7 +22714,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.blobContentMD5; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "lastModified", { @@ -19947,7 +22730,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.lastModified; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "metadata", { @@ -19962,7 +22745,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.metadata; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "requestId", { @@ -19977,7 +22760,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.requestId; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "clientRequestId", { @@ -19992,12 +22775,12 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.clientRequestId; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "version", { /** - * Indicates the version of the File service used + * Indicates the version of the Blob service used * to execute the request. * * @readonly @@ -20007,7 +22790,21 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.version; }, - enumerable: true, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobDownloadResponse.prototype, "versionId", { + /** + * Indicates the versionId of the downloaded blob version. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobDownloadResponse + */ + get: function () { + return this.originalResponse.versionId; + }, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "encryptionKeySha256", { @@ -20022,7 +22819,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.encryptionKeySha256; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentCrc64", { @@ -20038,7 +22835,49 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.contentCrc64; }, - enumerable: true, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobDownloadResponse.prototype, "objectReplicationDestinationPolicyId", { + /** + * Object Replication Policy Id of the destination blob. + * + * @readonly + * @type {(string| undefined)} + * @memberof BlobDownloadResponse + */ + get: function () { + return this.originalResponse.objectReplicationDestinationPolicyId; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobDownloadResponse.prototype, "objectReplicationSourceProperties", { + /** + * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. + * + * @readonly + * @type {(ObjectReplicationPolicy[] | undefined)} + * @memberof BlobDownloadResponse + */ + get: function () { + return this.originalResponse.objectReplicationSourceProperties; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobDownloadResponse.prototype, "isSealed", { + /** + * If this blob has been sealed. + * + * @readonly + * @type {(boolean | undefined)} + * @memberof BlobDownloadResponse + */ + get: function () { + return this.originalResponse.isSealed; + }, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "contentAsBlob", { @@ -20053,7 +22892,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse.blobBody; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "readableStreamBody", { @@ -20070,7 +22909,7 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return coreHttp.isNode ? this.blobDownloadStream : undefined; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobDownloadResponse.prototype, "_response", { @@ -20083,275 +22922,1605 @@ var BlobDownloadResponse = /** @class */ (function () { get: function () { return this.originalResponse._response; }, - enumerable: true, + enumerable: false, configurable: true }); return BlobDownloadResponse; }()); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -/** - * Generate a range string. For example: - * - * "bytes=255-" or "bytes=0-511" - * - * @export - * @param {Range} iRange - * @returns {string} - */ -function rangeToString(iRange) { - if (iRange.offset < 0) { - throw new RangeError("Range.offset cannot be smaller than 0."); +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +var AVRO_SYNC_MARKER_SIZE = 16; +var AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); +var AVRO_CODEC_KEY = "avro.codec"; +var AVRO_SCHEMA_KEY = "avro.schema"; + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +function arraysEqual(a, b) { + if (a === b) + return true; + if (a == null || b == null) + return false; + if (a.length != b.length) + return false; + for (var i = 0; i < a.length; ++i) { + if (a[i] !== b[i]) + return false; } - if (iRange.count && iRange.count <= 0) { - throw new RangeError("Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end."); - } - return iRange.count - ? "bytes=" + iRange.offset + "-" + (iRange.offset + iRange.count - 1) - : "bytes=" + iRange.offset + "-"; + return true; } -// Copyright (c) Microsoft Corporation. All rights reserved. -(function (BlockBlobTier) { - /** - * Optmized for storing data that is accessed frequently. - */ - BlockBlobTier["Hot"] = "Hot"; - /** - * Optimized for storing data that is infrequently accessed and stored for at least 30 days. - */ - BlockBlobTier["Cool"] = "Cool"; - /** - * Optimized for storing data that is rarely accessed and stored for at least 180 days - * with flexible latency requirements (on the order of hours). - */ - BlockBlobTier["Archive"] = "Archive"; -})(exports.BlockBlobTier || (exports.BlockBlobTier = {})); -(function (PremiumPageBlobTier) { - /** - * P4 Tier. - */ - PremiumPageBlobTier["P4"] = "P4"; - /** - * P6 Tier. - */ - PremiumPageBlobTier["P6"] = "P6"; - /** - * P10 Tier. - */ - PremiumPageBlobTier["P10"] = "P10"; - /** - * P15 Tier. - */ - PremiumPageBlobTier["P15"] = "P15"; - /** - * P20 Tier. - */ - PremiumPageBlobTier["P20"] = "P20"; - /** - * P30 Tier. - */ - PremiumPageBlobTier["P30"] = "P30"; - /** - * P40 Tier. - */ - PremiumPageBlobTier["P40"] = "P40"; - /** - * P50 Tier. - */ - PremiumPageBlobTier["P50"] = "P50"; - /** - * P60 Tier. - */ - PremiumPageBlobTier["P60"] = "P60"; - /** - * P70 Tier. - */ - PremiumPageBlobTier["P70"] = "P70"; - /** - * P80 Tier. - */ - PremiumPageBlobTier["P80"] = "P80"; -})(exports.PremiumPageBlobTier || (exports.PremiumPageBlobTier = {})); -function toAccessTier(tier) { - if (tier == undefined) { - return undefined; +// Copyright (c) Microsoft Corporation. +var AvroParser = /** @class */ (function () { + function AvroParser() { } - return tier; // No more check if string is a valid AccessTier, and left this to underlay logic to decide(service). -} -function ensureCpkIfSpecified(cpk, isHttps) { - if (cpk && !isHttps) { - throw new RangeError("Customer-provided encryption key must be used over HTTPS."); + /** + * Reads a fixed number of bytes from the stream. + * + * @static + * @param {AvroReadable} [stream] + * @param {number} [length] + * @param {AvroParserReadOptions} [options={}] + * @returns {Promise} + * @memberof AvroParser + */ + AvroParser.readFixedBytes = function (stream, length, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var bytes; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, stream.read(length, { abortSignal: options.abortSignal })]; + case 1: + bytes = _a.sent(); + if (bytes.length != length) { + throw new Error("Hit stream end."); + } + return [2 /*return*/, bytes]; + } + }); + }); + }; + /** + * Reads a single byte from the stream. + * + * @static + * @param {AvroReadable} [stream] + * @param {AvroParserReadOptions} [options={}] + * @returns {Promise} + * @memberof AvroParser + */ + AvroParser.readByte = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var buf; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readFixedBytes(stream, 1, options)]; + case 1: + buf = _a.sent(); + return [2 /*return*/, buf[0]]; + } + }); + }); + }; + // int and long are stored in variable-length zig-zag coding. + // variable-length: https://lucene.apache.org/core/3_5_0/fileformats.html#VInt + // zig-zag: https://developers.google.com/protocol-buffers/docs/encoding?csw=1#types + AvroParser.readZigZagLong = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var zigZagEncoded, significanceInBit, byte, haveMoreByte, significanceInFloat, res; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + zigZagEncoded = 0; + significanceInBit = 0; + _a.label = 1; + case 1: return [4 /*yield*/, AvroParser.readByte(stream, options)]; + case 2: + byte = _a.sent(); + haveMoreByte = byte & 0x80; + zigZagEncoded |= (byte & 0x7f) << significanceInBit; + significanceInBit += 7; + _a.label = 3; + case 3: + if (haveMoreByte && significanceInBit < 28) return [3 /*break*/, 1]; + _a.label = 4; + case 4: + if (!haveMoreByte) return [3 /*break*/, 9]; + // Switch to float arithmetic + zigZagEncoded = zigZagEncoded; + significanceInFloat = 268435456; // 2 ** 28. + _a.label = 5; + case 5: return [4 /*yield*/, AvroParser.readByte(stream, options)]; + case 6: + byte = _a.sent(); + zigZagEncoded += (byte & 0x7f) * significanceInFloat; + significanceInFloat *= 128; // 2 ** 7 + _a.label = 7; + case 7: + if (byte & 0x80) return [3 /*break*/, 5]; + _a.label = 8; + case 8: + res = (zigZagEncoded % 2 ? -(zigZagEncoded + 1) : zigZagEncoded) / 2; + if (res < Number.MIN_SAFE_INTEGER || res > Number.MAX_SAFE_INTEGER) { + throw new Error("Integer overflow."); + } + return [2 /*return*/, res]; + case 9: return [2 /*return*/, (zigZagEncoded >> 1) ^ -(zigZagEncoded & 1)]; + } + }); + }); + }; + AvroParser.readLong = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + return [2 /*return*/, AvroParser.readZigZagLong(stream, options)]; + }); + }); + }; + AvroParser.readInt = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + return [2 /*return*/, AvroParser.readZigZagLong(stream, options)]; + }); + }); + }; + AvroParser.readNull = function () { + return tslib.__awaiter(this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + return [2 /*return*/, null]; + }); + }); + }; + AvroParser.readBoolean = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var b; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readByte(stream, options)]; + case 1: + b = _a.sent(); + if (b == 1) { + return [2 /*return*/, true]; + } + else if (b == 0) { + return [2 /*return*/, false]; + } + else { + throw new Error("Byte was not a boolean."); + } + } + }); + }); + }; + AvroParser.readFloat = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var u8arr, view; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readFixedBytes(stream, 4, options)]; + case 1: + u8arr = _a.sent(); + view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return [2 /*return*/, view.getFloat32(0, true)]; // littleEndian = true + } + }); + }); + }; + AvroParser.readDouble = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var u8arr, view; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readFixedBytes(stream, 8, options)]; + case 1: + u8arr = _a.sent(); + view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return [2 /*return*/, view.getFloat64(0, true)]; // littleEndian = true + } + }); + }); + }; + AvroParser.readBytes = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var size; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readLong(stream, options)]; + case 1: + size = _a.sent(); + if (size < 0) { + throw new Error("Bytes size was negative."); + } + return [4 /*yield*/, stream.read(size, { abortSignal: options.abortSignal })]; + case 2: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + AvroParser.readString = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var u8arr, utf8decoder; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readBytes(stream, options)]; + case 1: + u8arr = _a.sent(); + // polyfill TextDecoder to be backward compatible with older + // nodejs that doesn't expose TextDecoder as a global variable + if (typeof TextDecoder === "undefined" && "function" !== "undefined") { + global.TextDecoder = __webpack_require__(669).TextDecoder; + } + utf8decoder = new TextDecoder(); + return [2 /*return*/, utf8decoder.decode(u8arr)]; + } + }); + }); + }; + AvroParser.readMapPair = function (stream, readItemMethod, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var key, value; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readString(stream, options)]; + case 1: + key = _a.sent(); + return [4 /*yield*/, readItemMethod(stream, options)]; + case 2: + value = _a.sent(); + return [2 /*return*/, { key: key, value: value }]; + } + }); + }); + }; + AvroParser.readMap = function (stream, readItemMethod, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var readPairMethod, pairs, dict, _i, pairs_1, pair; + var _this = this; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + readPairMethod = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(_this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readMapPair(stream, readItemMethod, options)]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + return [4 /*yield*/, AvroParser.readArray(stream, readPairMethod, options)]; + case 1: + pairs = _a.sent(); + dict = {}; + for (_i = 0, pairs_1 = pairs; _i < pairs_1.length; _i++) { + pair = pairs_1[_i]; + dict[pair.key] = pair.value; + } + return [2 /*return*/, dict]; + } + }); + }); + }; + AvroParser.readArray = function (stream, readItemMethod, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var items, count, item; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + items = []; + return [4 /*yield*/, AvroParser.readLong(stream, options)]; + case 1: + count = _a.sent(); + _a.label = 2; + case 2: + if (!(count != 0)) return [3 /*break*/, 8]; + if (!(count < 0)) return [3 /*break*/, 4]; + // Ignore block sizes + return [4 /*yield*/, AvroParser.readLong(stream, options)]; + case 3: + // Ignore block sizes + _a.sent(); + count = -count; + _a.label = 4; + case 4: + if (!count--) return [3 /*break*/, 6]; + return [4 /*yield*/, readItemMethod(stream, options)]; + case 5: + item = _a.sent(); + items.push(item); + return [3 /*break*/, 4]; + case 6: return [4 /*yield*/, AvroParser.readLong(stream, options)]; + case 7: + count = _a.sent(); + return [3 /*break*/, 2]; + case 8: return [2 /*return*/, items]; + } + }); + }); + }; + return AvroParser; +}()); +var AvroComplex; +(function (AvroComplex) { + AvroComplex["RECORD"] = "record"; + AvroComplex["ENUM"] = "enum"; + AvroComplex["ARRAY"] = "array"; + AvroComplex["MAP"] = "map"; + AvroComplex["UNION"] = "union"; + AvroComplex["FIXED"] = "fixed"; +})(AvroComplex || (AvroComplex = {})); +var AvroType = /** @class */ (function () { + function AvroType() { } - if (cpk && !cpk.encryptionAlgorithm) { - cpk.encryptionAlgorithm = EncryptionAlgorithmAES25; + /** + * Determines the AvroType from the Avro Schema. + */ + AvroType.fromSchema = function (schema) { + if (typeof schema == "string") { + return AvroType.fromStringSchema(schema); + } + else if (Array.isArray(schema)) { + return AvroType.fromArraySchema(schema); + } + else { + return AvroType.fromObjectSchema(schema); + } + }; + AvroType.fromStringSchema = function (schema) { + switch (schema) { + case AvroPrimitive.NULL: + case AvroPrimitive.BOOLEAN: + case AvroPrimitive.INT: + case AvroPrimitive.LONG: + case AvroPrimitive.FLOAT: + case AvroPrimitive.DOUBLE: + case AvroPrimitive.BYTES: + case AvroPrimitive.STRING: + return new AvroPrimitiveType(schema); + default: + throw new Error("Unexpected Avro type " + schema); + } + }; + AvroType.fromArraySchema = function (schema) { + return new AvroUnionType(schema.map(AvroType.fromSchema)); + }; + AvroType.fromObjectSchema = function (schema) { + var type = schema.type; + // Primitives can be defined as strings or objects + try { + return AvroType.fromStringSchema(type); + } + catch (err) { } + switch (type) { + case AvroComplex.RECORD: + if (schema.aliases) { + throw new Error("aliases currently is not supported, schema: " + schema); + } + if (!schema.name) { + throw new Error("Required attribute 'name' doesn't exist on schema: " + schema); + } + var fields = {}; + if (!schema.fields) { + throw new Error("Required attribute 'fields' doesn't exist on schema: " + schema); + } + for (var _i = 0, _a = schema.fields; _i < _a.length; _i++) { + var field = _a[_i]; + fields[field.name] = AvroType.fromSchema(field.type); + } + return new AvroRecordType(fields, schema.name); + case AvroComplex.ENUM: + if (schema.aliases) { + throw new Error("aliases currently is not supported, schema: " + schema); + } + if (!schema.symbols) { + throw new Error("Required attribute 'symbols' doesn't exist on schema: " + schema); + } + return new AvroEnumType(schema.symbols); + case AvroComplex.MAP: + if (!schema.values) { + throw new Error("Required attribute 'values' doesn't exist on schema: " + schema); + } + return new AvroMapType(AvroType.fromSchema(schema.values)); + case AvroComplex.ARRAY: // Unused today + case AvroComplex.FIXED: // Unused today + default: + throw new Error("Unexpected Avro type " + type + " in " + schema); + } + }; + return AvroType; +}()); +var AvroPrimitive; +(function (AvroPrimitive) { + AvroPrimitive["NULL"] = "null"; + AvroPrimitive["BOOLEAN"] = "boolean"; + AvroPrimitive["INT"] = "int"; + AvroPrimitive["LONG"] = "long"; + AvroPrimitive["FLOAT"] = "float"; + AvroPrimitive["DOUBLE"] = "double"; + AvroPrimitive["BYTES"] = "bytes"; + AvroPrimitive["STRING"] = "string"; +})(AvroPrimitive || (AvroPrimitive = {})); +var AvroPrimitiveType = /** @class */ (function (_super) { + tslib.__extends(AvroPrimitiveType, _super); + function AvroPrimitiveType(primitive) { + var _this = _super.call(this) || this; + _this._primitive = primitive; + return _this; } -} + AvroPrimitiveType.prototype.read = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _a; + return tslib.__generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = this._primitive; + switch (_a) { + case AvroPrimitive.NULL: return [3 /*break*/, 1]; + case AvroPrimitive.BOOLEAN: return [3 /*break*/, 3]; + case AvroPrimitive.INT: return [3 /*break*/, 5]; + case AvroPrimitive.LONG: return [3 /*break*/, 7]; + case AvroPrimitive.FLOAT: return [3 /*break*/, 9]; + case AvroPrimitive.DOUBLE: return [3 /*break*/, 11]; + case AvroPrimitive.BYTES: return [3 /*break*/, 13]; + case AvroPrimitive.STRING: return [3 /*break*/, 15]; + } + return [3 /*break*/, 17]; + case 1: return [4 /*yield*/, AvroParser.readNull()]; + case 2: return [2 /*return*/, _b.sent()]; + case 3: return [4 /*yield*/, AvroParser.readBoolean(stream, options)]; + case 4: return [2 /*return*/, _b.sent()]; + case 5: return [4 /*yield*/, AvroParser.readInt(stream, options)]; + case 6: return [2 /*return*/, _b.sent()]; + case 7: return [4 /*yield*/, AvroParser.readLong(stream, options)]; + case 8: return [2 /*return*/, _b.sent()]; + case 9: return [4 /*yield*/, AvroParser.readFloat(stream, options)]; + case 10: return [2 /*return*/, _b.sent()]; + case 11: return [4 /*yield*/, AvroParser.readDouble(stream, options)]; + case 12: return [2 /*return*/, _b.sent()]; + case 13: return [4 /*yield*/, AvroParser.readBytes(stream, options)]; + case 14: return [2 /*return*/, _b.sent()]; + case 15: return [4 /*yield*/, AvroParser.readString(stream, options)]; + case 16: return [2 /*return*/, _b.sent()]; + case 17: throw new Error("Unknown Avro Primitive"); + } + }); + }); + }; + return AvroPrimitiveType; +}(AvroType)); +var AvroEnumType = /** @class */ (function (_super) { + tslib.__extends(AvroEnumType, _super); + function AvroEnumType(symbols) { + var _this = _super.call(this) || this; + _this._symbols = symbols; + return _this; + } + AvroEnumType.prototype.read = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var value; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readInt(stream, options)]; + case 1: + value = _a.sent(); + return [2 /*return*/, this._symbols[value]]; + } + }); + }); + }; + return AvroEnumType; +}(AvroType)); +var AvroUnionType = /** @class */ (function (_super) { + tslib.__extends(AvroUnionType, _super); + function AvroUnionType(types) { + var _this = _super.call(this) || this; + _this._types = types; + return _this; + } + AvroUnionType.prototype.read = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var typeIndex; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, AvroParser.readInt(stream, options)]; + case 1: + typeIndex = _a.sent(); + return [4 /*yield*/, this._types[typeIndex].read(stream, options)]; + case 2: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + return AvroUnionType; +}(AvroType)); +var AvroMapType = /** @class */ (function (_super) { + tslib.__extends(AvroMapType, _super); + function AvroMapType(itemType) { + var _this = _super.call(this) || this; + _this._itemType = itemType; + return _this; + } + AvroMapType.prototype.read = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var readItemMethod; + var _this = this; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + readItemMethod = function (s, options) { return tslib.__awaiter(_this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this._itemType.read(s, options)]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); }; + return [4 /*yield*/, AvroParser.readMap(stream, readItemMethod, options)]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + return AvroMapType; +}(AvroType)); +var AvroRecordType = /** @class */ (function (_super) { + tslib.__extends(AvroRecordType, _super); + function AvroRecordType(fields, name) { + var _this = _super.call(this) || this; + _this._fields = fields; + _this._name = name; + return _this; + } + AvroRecordType.prototype.read = function (stream, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var record, _a, _b, _i, key, _c, _d; + return tslib.__generator(this, function (_e) { + switch (_e.label) { + case 0: + record = {}; + record["$schema"] = this._name; + _a = []; + for (_b in this._fields) + _a.push(_b); + _i = 0; + _e.label = 1; + case 1: + if (!(_i < _a.length)) return [3 /*break*/, 4]; + key = _a[_i]; + if (!this._fields.hasOwnProperty(key)) return [3 /*break*/, 3]; + _c = record; + _d = key; + return [4 /*yield*/, this._fields[key].read(stream, options)]; + case 2: + _c[_d] = _e.sent(); + _e.label = 3; + case 3: + _i++; + return [3 /*break*/, 1]; + case 4: return [2 /*return*/, record]; + } + }); + }); + }; + return AvroRecordType; +}(AvroType)); + +// Copyright (c) Microsoft Corporation. +var AvroReader = /** @class */ (function () { + function AvroReader(dataStream, headerStream, currentBlockOffset, indexWithinCurrentBlock) { + this._dataStream = dataStream; + this._headerStream = headerStream || dataStream; + this._initialized = false; + this._blockOffset = currentBlockOffset || 0; + this._objectIndex = indexWithinCurrentBlock || 0; + this._initialBlockOffset = currentBlockOffset || 0; + } + Object.defineProperty(AvroReader.prototype, "blockOffset", { + get: function () { + return this._blockOffset; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(AvroReader.prototype, "objectIndex", { + get: function () { + return this._objectIndex; + }, + enumerable: false, + configurable: true + }); + AvroReader.prototype.initialize = function (options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var header, _a, codec, _b, schema, _c, i; + return tslib.__generator(this, function (_d) { + switch (_d.label) { + case 0: return [4 /*yield*/, AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { + abortSignal: options.abortSignal + })]; + case 1: + header = _d.sent(); + if (!arraysEqual(header, AVRO_INIT_BYTES)) { + throw new Error("Stream is not an Avro file."); + } + // File metadata is written as if defined by the following map schema: + // { "type": "map", "values": "bytes"} + _a = this; + return [4 /*yield*/, AvroParser.readMap(this._headerStream, AvroParser.readString, { + abortSignal: options.abortSignal + })]; + case 2: + // File metadata is written as if defined by the following map schema: + // { "type": "map", "values": "bytes"} + _a._metadata = _d.sent(); + codec = this._metadata[AVRO_CODEC_KEY]; + if (!(codec == undefined || codec == "null")) { + throw new Error("Codecs are not supported"); + } + // The 16-byte, randomly-generated sync marker for this file. + _b = this; + return [4 /*yield*/, AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, { + abortSignal: options.abortSignal + })]; + case 3: + // The 16-byte, randomly-generated sync marker for this file. + _b._syncMarker = _d.sent(); + schema = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); + this._itemType = AvroType.fromSchema(schema); + if (this._blockOffset == 0) { + this._blockOffset = this._initialBlockOffset + this._dataStream.position; + } + _c = this; + return [4 /*yield*/, AvroParser.readLong(this._dataStream, { + abortSignal: options.abortSignal + })]; + case 4: + _c._itemsRemainingInBlock = _d.sent(); + // skip block length + return [4 /*yield*/, AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })]; + case 5: + // skip block length + _d.sent(); + this._initialized = true; + if (!(this._objectIndex && this._objectIndex > 0)) return [3 /*break*/, 9]; + i = 0; + _d.label = 6; + case 6: + if (!(i < this._objectIndex)) return [3 /*break*/, 9]; + return [4 /*yield*/, this._itemType.read(this._dataStream, { abortSignal: options.abortSignal })]; + case 7: + _d.sent(); + this._itemsRemainingInBlock--; + _d.label = 8; + case 8: + i++; + return [3 /*break*/, 6]; + case 9: return [2 /*return*/]; + } + }); + }); + }; + AvroReader.prototype.hasNext = function () { + return !this._initialized || this._itemsRemainingInBlock > 0; + }; + AvroReader.prototype.parseObjects = function (options) { + if (options === void 0) { options = {}; } + return tslib.__asyncGenerator(this, arguments, function parseObjects_1() { + var result, marker, _a, err_1; + return tslib.__generator(this, function (_b) { + switch (_b.label) { + case 0: + if (!!this._initialized) return [3 /*break*/, 2]; + return [4 /*yield*/, tslib.__await(this.initialize(options))]; + case 1: + _b.sent(); + _b.label = 2; + case 2: + if (!this.hasNext()) return [3 /*break*/, 13]; + return [4 /*yield*/, tslib.__await(this._itemType.read(this._dataStream, { + abortSignal: options.abortSignal + }))]; + case 3: + result = _b.sent(); + this._itemsRemainingInBlock--; + this._objectIndex++; + if (!(this._itemsRemainingInBlock == 0)) return [3 /*break*/, 10]; + return [4 /*yield*/, tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, { + abortSignal: options.abortSignal + }))]; + case 4: + marker = _b.sent(); + this._blockOffset = this._initialBlockOffset + this._dataStream.position; + this._objectIndex = 0; + if (!arraysEqual(this._syncMarker, marker)) { + throw new Error("Stream is not a valid Avro file."); + } + _b.label = 5; + case 5: + _b.trys.push([5, 7, , 8]); + _a = this; + return [4 /*yield*/, tslib.__await(AvroParser.readLong(this._dataStream, { + abortSignal: options.abortSignal + }))]; + case 6: + _a._itemsRemainingInBlock = _b.sent(); + return [3 /*break*/, 8]; + case 7: + err_1 = _b.sent(); + // We hit the end of the stream. + this._itemsRemainingInBlock = 0; + return [3 /*break*/, 8]; + case 8: + if (!(this._itemsRemainingInBlock > 0)) return [3 /*break*/, 10]; + // Ignore block size + return [4 /*yield*/, tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal }))]; + case 9: + // Ignore block size + _b.sent(); + _b.label = 10; + case 10: return [4 /*yield*/, tslib.__await(result)]; + case 11: return [4 /*yield*/, _b.sent()]; + case 12: + _b.sent(); + return [3 /*break*/, 2]; + case 13: return [2 /*return*/]; + } + }); + }); + }; + return AvroReader; +}()); + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +var AvroReadable = /** @class */ (function () { + function AvroReadable() { + } + return AvroReadable; +}()); + +// Copyright (c) Microsoft Corporation. +var ABORT_ERROR$1 = new abortController.AbortError("Reading from the avro stream was aborted."); +var AvroReadableFromStream = /** @class */ (function (_super) { + tslib.__extends(AvroReadableFromStream, _super); + function AvroReadableFromStream(readable) { + var _this = _super.call(this) || this; + _this._readable = readable; + _this._position = 0; + return _this; + } + AvroReadableFromStream.prototype.toUint8Array = function (data) { + if (typeof data === "string") { + return Buffer.from(data); + } + return data; + }; + Object.defineProperty(AvroReadableFromStream.prototype, "position", { + get: function () { + return this._position; + }, + enumerable: false, + configurable: true + }); + AvroReadableFromStream.prototype.read = function (size, options) { + var _a; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var chunk; + var _this = this; + return tslib.__generator(this, function (_b) { + if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { + throw ABORT_ERROR$1; + } + if (size < 0) { + throw new Error("size parameter should be positive: " + size); + } + if (size === 0) { + return [2 /*return*/, new Uint8Array()]; + } + if (!this._readable.readable) { + throw new Error("Stream no longer readable."); + } + chunk = this._readable.read(size); + if (chunk) { + this._position += chunk.length; + // chunk.length maybe less than desired size if the stream ends. + return [2 /*return*/, this.toUint8Array(chunk)]; + } + else { + // register callback to wait for enough data to read + return [2 /*return*/, new Promise(function (resolve, reject) { + var cleanUp = function () { + _this._readable.removeListener("readable", readableCallback); + _this._readable.removeListener("error", rejectCallback); + _this._readable.removeListener("end", rejectCallback); + _this._readable.removeListener("close", rejectCallback); + if (options.abortSignal) { + options.abortSignal.removeEventListener("abort", abortHandler); + } + }; + var readableCallback = function () { + var chunk = _this._readable.read(size); + if (chunk) { + _this._position += chunk.length; + cleanUp(); + // chunk.length maybe less than desired size if the stream ends. + resolve(_this.toUint8Array(chunk)); + } + }; + var rejectCallback = function () { + cleanUp(); + reject(); + }; + var abortHandler = function () { + cleanUp(); + reject(ABORT_ERROR$1); + }; + _this._readable.on("readable", readableCallback); + _this._readable.once("error", rejectCallback); + _this._readable.once("end", rejectCallback); + _this._readable.once("close", rejectCallback); + if (options.abortSignal) { + options.abortSignal.addEventListener("abort", abortHandler); + } + })]; + } + }); + }); + }; + return AvroReadableFromStream; +}(AvroReadable)); // Copyright (c) Microsoft Corporation. All rights reserved. -/** - * Reads a readable stream into buffer. Fill the buffer from offset to end. - * - * @export - * @param {NodeJS.ReadableStream} stream A Node.js Readable stream - * @param {Buffer} buffer Buffer to be filled, length must >= offset - * @param {number} offset From which position in the buffer to be filled, inclusive - * @param {number} end To which position in the buffer to be filled, exclusive - * @param {string} [encoding] Encoding of the Readable stream - * @returns {Promise} - */ -function streamToBuffer(stream, buffer, offset, end, encoding) { - return tslib.__awaiter(this, void 0, void 0, function () { - var pos, count; - return tslib.__generator(this, function (_a) { - pos = 0; - count = end - offset; - return [2 /*return*/, new Promise(function (resolve, reject) { - stream.on("readable", function () { - if (pos >= count) { - resolve(); - return; - } - var chunk = stream.read(); - if (!chunk) { - return; - } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, encoding); - } - // How much data needed in this chunk - var chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); - pos += chunkLength; - }); - stream.on("end", function () { - if (pos < count) { - reject(new Error("Stream drains before getting enough data needed. Data read: " + pos + ", data need: " + count)); - } - resolve(); - }); - stream.on("error", reject); - })]; - }); - }); -} -/** - * Reads a readable stream into buffer entirely. - * - * @export - * @param {NodeJS.ReadableStream} stream A Node.js Readable stream - * @param {Buffer} buffer Buffer to be filled, length must >= offset - * @param {string} [encoding] Encoding of the Readable stream - * @returns {Promise} with the count of bytes read. - * @throws {RangeError} If buffer size is not big enough. - */ -function streamToBuffer2(stream, buffer, encoding) { - return tslib.__awaiter(this, void 0, void 0, function () { - var pos, bufferSize; - return tslib.__generator(this, function (_a) { - pos = 0; - bufferSize = buffer.length; - return [2 /*return*/, new Promise(function (resolve, reject) { - stream.on("readable", function () { - var chunk = stream.read(); - if (!chunk) { - return; - } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, encoding); - } - if (pos + chunk.length > bufferSize) { - reject(new Error("Stream exceeds buffer size. Buffer size: " + bufferSize)); - return; - } - buffer.fill(chunk, pos, pos + chunk.length); - pos += chunk.length; - }); - stream.on("end", function () { - resolve(pos); - }); - stream.on("error", reject); - })]; - }); - }); -} /** * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * Writes the content of a readstream to a local file. Returns a Promise which is completed after the file handle is closed. + * A Node.js BlobQuickQueryStream will internally parse avro data stream for blob query. * - * @export - * @param {NodeJS.ReadableStream} rs The read stream. - * @param {string} file Destination file path. - * @returns {Promise} + * @class BlobQuickQueryStream + * @extends {Readable} */ -function readStreamToLocalFile(rs, file) { - return tslib.__awaiter(this, void 0, void 0, function () { - return tslib.__generator(this, function (_a) { - return [2 /*return*/, new Promise(function (resolve, reject) { - var ws = fs.createWriteStream(file); - rs.on("error", function (err) { - reject(err); - }); - ws.on("error", function (err) { - reject(err); - }); - ws.on("close", resolve); - rs.pipe(ws); - })]; +var BlobQuickQueryStream = /** @class */ (function (_super) { + tslib.__extends(BlobQuickQueryStream, _super); + /** + * Creates an instance of BlobQuickQueryStream. + * + * @param {NodeJS.ReadableStream} source The current ReadableStream returned from getter + * @param {BlobQuickQueryStreamOptions} [options={}] + * @memberof BlobQuickQueryStream + */ + function BlobQuickQueryStream(source, options) { + if (options === void 0) { options = {}; } + var _this = _super.call(this) || this; + _this.source = source; + _this.onProgress = options.onProgress; + _this.onError = options.onError; + _this.avroReader = new AvroReader(new AvroReadableFromStream(_this.source)); + _this.avroIter = _this.avroReader.parseObjects({ abortSignal: options.abortSignal }); + return _this; + } + BlobQuickQueryStream.prototype._read = function () { + var _this = this; + this.readInternal().catch(function (err) { + _this.emit("error", err); }); - }); -} -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Promisified version of fs.stat(). - */ -var fsStat = util.promisify(fs.stat); + }; + BlobQuickQueryStream.prototype.readInternal = function () { + var e_1, _a; + return tslib.__awaiter(this, void 0, void 0, function () { + var _b, _c, obj, schema, exit, data, bytesScanned, totalBytes, fatal, name_1, description, position, e_1_1; + return tslib.__generator(this, function (_d) { + switch (_d.label) { + case 0: + _d.trys.push([0, 5, 6, 11]); + _b = tslib.__asyncValues(this.avroIter); + _d.label = 1; + case 1: return [4 /*yield*/, _b.next()]; + case 2: + if (!(_c = _d.sent(), !_c.done)) return [3 /*break*/, 4]; + obj = _c.value; + schema = obj.$schema; + if (typeof schema !== "string") { + throw Error("Missing schema in avro record."); + } + exit = false; + switch (schema) { + case "com.microsoft.azure.storage.queryBlobContents.resultData": + data = obj.data; + if (data instanceof Uint8Array === false) { + throw Error("Invalid data in avro result record."); + } + if (!this.push(Buffer.from(data))) { + exit = true; + } + break; + case "com.microsoft.azure.storage.queryBlobContents.progress": + bytesScanned = obj.bytesScanned; + if (typeof bytesScanned !== "number") { + throw Error("Invalid bytesScanned in avro progress record."); + } + if (this.onProgress) { + this.onProgress({ loadedBytes: bytesScanned }); + } + break; + case "com.microsoft.azure.storage.queryBlobContents.end": + if (this.onProgress) { + totalBytes = obj.totalBytes; + if (typeof totalBytes !== "number") { + throw Error("Invalid totalBytes in avro end record."); + } + this.onProgress({ loadedBytes: totalBytes }); + } + this.push(null); + break; + case "com.microsoft.azure.storage.queryBlobContents.error": + if (this.onError) { + fatal = obj.fatal; + if (typeof fatal !== "boolean") { + throw Error("Invalid fatal in avro error record."); + } + name_1 = obj.name; + if (typeof name_1 !== "string") { + throw Error("Invalid name in avro error record."); + } + description = obj.description; + if (typeof description !== "string") { + throw Error("Invalid description in avro error record."); + } + position = obj.position; + if (typeof position !== "number") { + throw Error("Invalid position in avro error record."); + } + this.onError({ + position: position, + name: name_1, + isFatal: fatal, + description: description + }); + } + break; + default: + throw Error("Unknown schema " + schema + " in avro progress record."); + } + if (exit) { + return [3 /*break*/, 4]; + } + _d.label = 3; + case 3: return [3 /*break*/, 1]; + case 4: return [3 /*break*/, 11]; + case 5: + e_1_1 = _d.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 11]; + case 6: + _d.trys.push([6, , 9, 10]); + if (!(_c && !_c.done && (_a = _b.return))) return [3 /*break*/, 8]; + return [4 /*yield*/, _a.call(_b)]; + case 7: + _d.sent(); + _d.label = 8; + case 8: return [3 /*break*/, 10]; + case 9: + if (e_1) throw e_1.error; + return [7 /*endfinally*/]; + case 10: return [7 /*endfinally*/]; + case 11: return [2 /*return*/]; + } + }); + }); + }; + return BlobQuickQueryStream; +}(stream.Readable)); // Copyright (c) Microsoft Corporation. All rights reserved. /** - * Credential policy used to sign HTTP(S) requests before sending. This is an - * abstract class. + * ONLY AVAILABLE IN NODE.JS RUNTIME. + * + * BlobQueryResponse implements BlobDownloadResponseModel interface, and in Node.js runtime it will + * parse avor data returned by blob query. * * @export - * @abstract - * @class CredentialPolicy - * @extends {BaseRequestPolicy} + * @class BlobQueryResponse + * @implements {BlobDownloadResponseModel} */ -var CredentialPolicy = /** @class */ (function (_super) { - tslib.__extends(CredentialPolicy, _super); - function CredentialPolicy() { - return _super !== null && _super.apply(this, arguments) || this; +var BlobQueryResponse = /** @class */ (function () { + /** + * Creates an instance of BlobQueryResponse. + * + * @param {BlobQueryResponseModel} originalResponse + * @param {BlobQuickQueryStreamOptions} [options={}] + * @memberof BlobQueryResponse + */ + function BlobQueryResponse(originalResponse, options) { + if (options === void 0) { options = {}; } + this.originalResponse = originalResponse; + this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); } - /** - * Sends out request. - * - * @param {WebResource} request - * @returns {Promise} - * @memberof CredentialPolicy - */ - CredentialPolicy.prototype.sendRequest = function (request) { - return this._nextPolicy.sendRequest(this.signRequest(request)); - }; - /** - * Child classes must implement this method with request signing. This method - * will be executed in {@link sendRequest}. - * - * @protected - * @abstract - * @param {WebResource} request - * @returns {WebResource} - * @memberof CredentialPolicy - */ - CredentialPolicy.prototype.signRequest = function (request) { - // Child classes must override this method with request signing. This method - // will be executed in sendRequest(). - return request; - }; - return CredentialPolicy; -}(coreHttp.BaseRequestPolicy)); + Object.defineProperty(BlobQueryResponse.prototype, "acceptRanges", { + /** + * Indicates that the service supports + * requests for partial file content. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.acceptRanges; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "cacheControl", { + /** + * Returns if it was previously specified + * for the file. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.cacheControl; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "contentDisposition", { + /** + * Returns the value that was specified + * for the 'x-ms-content-disposition' header and specifies how to process the + * response. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.contentDisposition; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "contentEncoding", { + /** + * Returns the value that was specified + * for the Content-Encoding request header. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.contentEncoding; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "contentLanguage", { + /** + * Returns the value that was specified + * for the Content-Language request header. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.contentLanguage; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "blobSequenceNumber", { + /** + * The current sequence number for a + * page blob. This header is not returned for block blobs or append blobs. + * + * @readonly + * @type {(number | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.blobSequenceNumber; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "blobType", { + /** + * The blob's type. Possible values include: + * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * + * @readonly + * @type {(BlobType | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.blobType; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "contentLength", { + /** + * The number of bytes present in the + * response body. + * + * @readonly + * @type {(number | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.contentLength; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "contentMD5", { + /** + * If the file has an MD5 hash and the + * request is to read the full file, this response header is returned so that + * the client can check for message content integrity. If the request is to + * read a specified range and the 'x-ms-range-get-content-md5' is set to + * true, then the request returns an MD5 hash for the range, as long as the + * range size is less than or equal to 4 MB. If neither of these sets of + * conditions is true, then no value is returned for the 'Content-MD5' + * header. + * + * @readonly + * @type {(Uint8Array | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.contentMD5; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "contentRange", { + /** + * Indicates the range of bytes returned if + * the client requested a subset of the file by setting the Range request + * header. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.contentRange; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "contentType", { + /** + * The content type specified for the file. + * The default content type is 'application/octet-stream' + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.contentType; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "copyCompletedOn", { + /** + * Conclusion time of the last attempted + * Copy File operation where this file was the destination file. This value + * can specify the time of a completed, aborted, or failed copy attempt. + * + * @readonly + * @type {(Date | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return undefined; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "copyId", { + /** + * String identifier for the last attempted Copy + * File operation where this file was the destination file. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.copyId; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "copyProgress", { + /** + * Contains the number of bytes copied and + * the total bytes in the source in the last attempted Copy File operation + * where this file was the destination file. Can show between 0 and + * Content-Length bytes copied. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.copyProgress; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "copySource", { + /** + * URL up to 2KB in length that specifies the + * source file used in the last attempted Copy File operation where this file + * was the destination file. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.copySource; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "copyStatus", { + /** + * State of the copy operation + * identified by 'x-ms-copy-id'. Possible values include: 'pending', + * 'success', 'aborted', 'failed' + * + * @readonly + * @type {(CopyStatusType | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.copyStatus; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "copyStatusDescription", { + /** + * Only appears when + * x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.copyStatusDescription; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "leaseDuration", { + /** + * When a blob is leased, + * specifies whether the lease is of infinite or fixed duration. Possible + * values include: 'infinite', 'fixed'. + * + * @readonly + * @type {(LeaseDurationType | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.leaseDuration; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "leaseState", { + /** + * Lease state of the blob. Possible + * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * + * @readonly + * @type {(LeaseStateType | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.leaseState; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "leaseStatus", { + /** + * The current lease status of the + * blob. Possible values include: 'locked', 'unlocked'. + * + * @readonly + * @type {(LeaseStatusType | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.leaseStatus; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "date", { + /** + * A UTC date/time value generated by the service that + * indicates the time at which the response was initiated. + * + * @readonly + * @type {(Date | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.date; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "blobCommittedBlockCount", { + /** + * The number of committed blocks + * present in the blob. This header is returned only for append blobs. + * + * @readonly + * @type {(number | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.blobCommittedBlockCount; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "etag", { + /** + * The ETag contains a value that you can use to + * perform operations conditionally, in quotes. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.etag; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "errorCode", { + /** + * The error code. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.errorCode; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "isServerEncrypted", { + /** + * The value of this header is set to + * true if the file data and application metadata are completely encrypted + * using the specified algorithm. Otherwise, the value is set to false (when + * the file is unencrypted, or if only parts of the file/application metadata + * are encrypted). + * + * @readonly + * @type {(boolean | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.isServerEncrypted; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "blobContentMD5", { + /** + * If the blob has a MD5 hash, and if + * request contains range header (Range or x-ms-range), this response header + * is returned with the value of the whole blob's MD5 value. This value may + * or may not be equal to the value returned in Content-MD5 header, with the + * latter calculated from the requested range. + * + * @readonly + * @type {(Uint8Array | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.blobContentMD5; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "lastModified", { + /** + * Returns the date and time the file was last + * modified. Any operation that modifies the file or its properties updates + * the last modified time. + * + * @readonly + * @type {(Date | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.lastModified; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "metadata", { + /** + * A name-value pair + * to associate with a file storage object. + * + * @readonly + * @type {(Metadata | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.metadata; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "requestId", { + /** + * This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.requestId; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "clientRequestId", { + /** + * If a client request id header is sent in the request, this header will be present in the + * response with the same value. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.clientRequestId; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "version", { + /** + * Indicates the version of the File service used + * to execute the request. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.version; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "encryptionKeySha256", { + /** + * The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned + * when the blob was encrypted with a customer-provided key. + * + * @readonly + * @type {(string | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.encryptionKeySha256; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "contentCrc64", { + /** + * If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to + * true, then the request returns a crc64 for the range, as long as the range size is less than + * or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is + * specified in the same request, it will fail with 400(Bad Request) + * + * @type {(Uint8Array | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse.contentCrc64; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "blobBody", { + /** + * The response body as a browser Blob. + * Always undefined in node.js. + * + * @readonly + * @type {(Promise | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return undefined; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "readableStreamBody", { + /** + * The response body as a node.js Readable stream. + * Always undefined in the browser. + * + * It will parse avor data returned by blob query. + * + * @readonly + * @type {(NodeJS.ReadableStream | undefined)} + * @memberof BlobQueryResponse + */ + get: function () { + return coreHttp.isNode ? this.blobDownloadStream : undefined; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BlobQueryResponse.prototype, "_response", { + /** + * The HTTP response. + * + * @type {HttpResponse} + * @memberof BlobQueryResponse + */ + get: function () { + return this.originalResponse._response; + }, + enumerable: false, + configurable: true + }); + return BlobQueryResponse; +}()); // Copyright (c) Microsoft Corporation. All rights reserved. /** @@ -20407,12 +24576,6 @@ var StorageSharedKeyCredentialPolicy = /** @class */ (function (_super) { this.getCanonicalizedResourceString(request); var signature = this.factory.computeHMACSHA256(stringToSign); request.headers.set(HeaderConstants.AUTHORIZATION, "SharedKey " + this.factory.accountName + ":" + signature); - // Workaround for https://github.com/axios/axios/issues/2107 - // We should always keep the 'content-length' header once the issue is solved - // For a better explanation about this workaround, look here: https://github.com/Azure/azure-sdk-for-js/pull/3273 - if (typeof request.body !== "function" && !(request.body && request.onUploadProgress)) { - request.headers.remove(HeaderConstants.CONTENT_LENGTH); - } // console.log(`[URL]:${request.url}`); // console.log(`[HEADERS]:${request.headers.toString()}`); // console.log(`[STRING TO SIGN]:${JSON.stringify(stringToSign)}`); @@ -20514,37 +24677,6 @@ var StorageSharedKeyCredentialPolicy = /** @class */ (function (_super) { return StorageSharedKeyCredentialPolicy; }(CredentialPolicy)); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -/** - * Credential is an abstract class for Azure Storage HTTP requests signing. This - * class will host an credentialPolicyCreator factory which generates CredentialPolicy. - * - * @export - * @abstract - * @class Credential - */ -var Credential = /** @class */ (function () { - function Credential() { - } - /** - * Creates a RequestPolicy object. - * - * @param {RequestPolicy} _nextPolicy - * @param {RequestPolicyOptions} _options - * @returns {RequestPolicy} - * @memberof Credential - */ - Credential.prototype.create = function ( - // tslint:disable-next-line:variable-name - _nextPolicy, - // tslint:disable-next-line:variable-name - _options) { - throw new Error("Method should be implemented in children classes."); - }; - return Credential; -}()); - // Copyright (c) Microsoft Corporation. All rights reserved. /** * ONLY AVAILABLE IN NODE.JS RUNTIME. @@ -20595,252 +24727,6 @@ var StorageSharedKeyCredential = /** @class */ (function (_super) { return StorageSharedKeyCredential; }(Credential)); -// Copyright (c) Microsoft Corporation. All rights reserved. -/** - * AnonymousCredentialPolicy is used with HTTP(S) requests that read public resources - * or for use with Shared Access Signatures (SAS). - * - * @export - * @class AnonymousCredentialPolicy - * @extends {CredentialPolicy} - */ -var AnonymousCredentialPolicy = /** @class */ (function (_super) { - tslib.__extends(AnonymousCredentialPolicy, _super); - /** - * Creates an instance of AnonymousCredentialPolicy. - * @param {RequestPolicy} nextPolicy - * @param {RequestPolicyOptions} options - * @memberof AnonymousCredentialPolicy - */ - function AnonymousCredentialPolicy(nextPolicy, options) { - return _super.call(this, nextPolicy, options) || this; - } - return AnonymousCredentialPolicy; -}(CredentialPolicy)); - -// Copyright (c) Microsoft Corporation. All rights reserved. -/** - * AnonymousCredential provides a credentialPolicyCreator member used to create - * AnonymousCredentialPolicy objects. AnonymousCredentialPolicy is used with - * HTTP(S) requests that read public resources or for use with Shared Access - * Signatures (SAS). - * - * @export - * @class AnonymousCredential - * @extends {Credential} - */ -var AnonymousCredential = /** @class */ (function (_super) { - tslib.__extends(AnonymousCredential, _super); - function AnonymousCredential() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Creates an {@link AnonymousCredentialPolicy} object. - * - * @param {RequestPolicy} nextPolicy - * @param {RequestPolicyOptions} options - * @returns {AnonymousCredentialPolicy} - * @memberof AnonymousCredential - */ - AnonymousCredential.prototype.create = function (nextPolicy, options) { - return new AnonymousCredentialPolicy(nextPolicy, options); - }; - return AnonymousCredential; -}(Credential)); - -// Copyright (c) Microsoft Corporation. All rights reserved. -/** - * States for Batch. - * - * @enum {number} - */ -var BatchStates; -(function (BatchStates) { - BatchStates[BatchStates["Good"] = 0] = "Good"; - BatchStates[BatchStates["Error"] = 1] = "Error"; -})(BatchStates || (BatchStates = {})); -/** - * Batch provides basic parallel execution with concurrency limits. - * Will stop execute left operations when one of the executed operation throws an error. - * But Batch cannot cancel ongoing operations, you need to cancel them by yourself. - * - * @export - * @class Batch - */ -var Batch = /** @class */ (function () { - /** - * Creates an instance of Batch. - * @param {number} [concurrency=5] - * @memberof Batch - */ - function Batch(concurrency) { - if (concurrency === void 0) { concurrency = 5; } - /** - * Number of active operations under execution. - * - * @private - * @type {number} - * @memberof Batch - */ - this.actives = 0; - /** - * Number of completed operations under execution. - * - * @private - * @type {number} - * @memberof Batch - */ - this.completed = 0; - /** - * Offset of next operation to be executed. - * - * @private - * @type {number} - * @memberof Batch - */ - this.offset = 0; - /** - * Operation array to be executed. - * - * @private - * @type {Operation[]} - * @memberof Batch - */ - this.operations = []; - /** - * States of Batch. When an error happens, state will turn into error. - * Batch will stop execute left operations. - * - * @private - * @type {BatchStates} - * @memberof Batch - */ - this.state = BatchStates.Good; - if (concurrency < 1) { - throw new RangeError("concurrency must be larger than 0"); - } - this.concurrency = concurrency; - this.emitter = new events.EventEmitter(); - } - /** - * Add a operation into queue. - * - * @param {Operation} operation - * @memberof Batch - */ - Batch.prototype.addOperation = function (operation) { - var _this = this; - this.operations.push(function () { return tslib.__awaiter(_this, void 0, void 0, function () { - var error_1; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - this.actives++; - return [4 /*yield*/, operation()]; - case 1: - _a.sent(); - this.actives--; - this.completed++; - this.parallelExecute(); - return [3 /*break*/, 3]; - case 2: - error_1 = _a.sent(); - this.emitter.emit("error", error_1); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); - }); }); - }; - /** - * Start execute operations in the queue. - * - * @returns {Promise} - * @memberof Batch - */ - Batch.prototype.do = function () { - return tslib.__awaiter(this, void 0, void 0, function () { - var _this = this; - return tslib.__generator(this, function (_a) { - if (this.operations.length === 0) { - return [2 /*return*/, Promise.resolve()]; - } - this.parallelExecute(); - return [2 /*return*/, new Promise(function (resolve, reject) { - _this.emitter.on("finish", resolve); - _this.emitter.on("error", function (error) { - _this.state = BatchStates.Error; - reject(error); - }); - })]; - }); - }); - }; - /** - * Get next operation to be executed. Return null when reaching ends. - * - * @private - * @returns {(Operation | null)} - * @memberof Batch - */ - Batch.prototype.nextOperation = function () { - if (this.offset < this.operations.length) { - return this.operations[this.offset++]; - } - return null; - }; - /** - * Start execute operations. One one the most important difference between - * this method with do() is that do() wraps as an sync method. - * - * @private - * @returns {void} - * @memberof Batch - */ - Batch.prototype.parallelExecute = function () { - if (this.state === BatchStates.Error) { - return; - } - if (this.completed >= this.operations.length) { - this.emitter.emit("finish"); - return; - } - while (this.actives < this.concurrency) { - var operation = this.nextOperation(); - if (operation) { - operation(); - } - else { - return; - } - } - }; - return Batch; -}()); - -// Copyright (c) Microsoft Corporation. -/** - * Creates a span using the global tracer. - * @param name The name of the operation being performed. - * @param tracingOptions The options for the underlying http request. - */ -function createSpan(operationName, tracingOptions) { - if (tracingOptions === void 0) { tracingOptions = {}; } - var tracer = coreTracing.getTracer(); - var spanOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { kind: api.SpanKind.INTERNAL }); - var span = tracer.startSpan("Azure.Storage.Blob." + operationName, spanOptions); - span.setAttribute("az.namespace", "Microsoft.Storage"); - var newOptions = tracingOptions.spanOptions || {}; - if (span.isRecording()) { - newOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { parent: span.context(), attributes: tslib.__assign(tslib.__assign({}, spanOptions.attributes), { "az.namespace": "Microsoft.Storage" }) }); - } - return { - span: span, - spanOptions: newOptions - }; -} - /* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for @@ -20851,7 +24737,7 @@ function createSpan(operationName, tracingOptions) { * regenerated. */ var packageName = "azure-storage-blob"; -var packageVersion = "12.1.2"; +var packageVersion = "12.2.1"; var StorageClientContext = /** @class */ (function (_super) { tslib.__extends(StorageClientContext, _super); /** @@ -20873,7 +24759,7 @@ var StorageClientContext = /** @class */ (function (_super) { options.userAgent = packageName + "/" + packageVersion + " " + defaultUserAgent; } _this = _super.call(this, undefined, options) || this; - _this.version = '2019-07-07'; + _this.version = "2019-12-12"; _this.baseUri = "{url}"; _this.requestContentType = "application/json; charset=utf-8"; _this.url = url; @@ -20883,389 +24769,81 @@ var StorageClientContext = /** @class */ (function (_super) { }(coreHttp.ServiceClient)); // Copyright (c) Microsoft Corporation. All rights reserved. -/** - * A StorageClient represents a based URL class for {@link BlobServiceClient}, {@link ContainerClient} - * and etc. - * - * @export - * @class StorageClient - */ -var StorageClient = /** @class */ (function () { +(function (BlockBlobTier) { /** - * Creates an instance of StorageClient. - * @param {string} url url to resource - * @param {Pipeline} pipeline request policy pipeline. - * @memberof StorageClient + * Optimized for storing data that is accessed frequently. */ - function StorageClient(url, pipeline) { - // URL should be encoded and only once, protocol layer shouldn't encode URL again - this.url = escapeURLPath(url); - this.accountName = getAccountNameFromUrl(url); - this.pipeline = pipeline; - this.storageClientContext = new StorageClientContext(this.url, pipeline.toServiceClientOptions()); - this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); - this.credential = new AnonymousCredential(); - for (var _i = 0, _a = this.pipeline.factories; _i < _a.length; _i++) { - var factory = _a[_i]; - if ((coreHttp.isNode && factory instanceof StorageSharedKeyCredential) || - factory instanceof AnonymousCredential || - coreHttp.isTokenCredential(factory)) { - this.credential = factory; - } - } - // Override protocol layer's default content-type - var storageClientContext = this.storageClientContext; - storageClientContext.requestContentType = undefined; + BlockBlobTier["Hot"] = "Hot"; + /** + * Optimized for storing data that is infrequently accessed and stored for at least 30 days. + */ + BlockBlobTier["Cool"] = "Cool"; + /** + * Optimized for storing data that is rarely accessed and stored for at least 180 days + * with flexible latency requirements (on the order of hours). + */ + BlockBlobTier["Archive"] = "Archive"; +})(exports.BlockBlobTier || (exports.BlockBlobTier = {})); +(function (PremiumPageBlobTier) { + /** + * P4 Tier. + */ + PremiumPageBlobTier["P4"] = "P4"; + /** + * P6 Tier. + */ + PremiumPageBlobTier["P6"] = "P6"; + /** + * P10 Tier. + */ + PremiumPageBlobTier["P10"] = "P10"; + /** + * P15 Tier. + */ + PremiumPageBlobTier["P15"] = "P15"; + /** + * P20 Tier. + */ + PremiumPageBlobTier["P20"] = "P20"; + /** + * P30 Tier. + */ + PremiumPageBlobTier["P30"] = "P30"; + /** + * P40 Tier. + */ + PremiumPageBlobTier["P40"] = "P40"; + /** + * P50 Tier. + */ + PremiumPageBlobTier["P50"] = "P50"; + /** + * P60 Tier. + */ + PremiumPageBlobTier["P60"] = "P60"; + /** + * P70 Tier. + */ + PremiumPageBlobTier["P70"] = "P70"; + /** + * P80 Tier. + */ + PremiumPageBlobTier["P80"] = "P80"; +})(exports.PremiumPageBlobTier || (exports.PremiumPageBlobTier = {})); +function toAccessTier(tier) { + if (tier == undefined) { + return undefined; } - return StorageClient; -}()); - -// Copyright (c) Microsoft Corporation. All rights reserved. -/** - * This class accepts a Node.js Readable stream as input, and keeps reading data - * from the stream into the internal buffer structure, until it reaches maxBuffers. - * Every available buffer will try to trigger outgoingHandler. - * - * The internal buffer structure includes an incoming buffer array, and a outgoing - * buffer array. The incoming buffer array includes the "empty" buffers can be filled - * with new incoming data. The outgoing array includes the filled buffers to be - * handled by outgoingHandler. Every above buffer size is defined by parameter bufferSize. - * - * NUM_OF_ALL_BUFFERS = BUFFERS_IN_INCOMING + BUFFERS_IN_OUTGOING + BUFFERS_UNDER_HANDLING - * - * NUM_OF_ALL_BUFFERS <= maxBuffers - * - * PERFORMANCE IMPROVEMENT TIPS: - * 1. Input stream highWaterMark is better to set a same value with bufferSize - * parameter, which will avoid Buffer.concat() operations. - * 2. concurrency should set a smaller value than maxBuffers, which is helpful to - * reduce the possibility when a outgoing handler waits for the stream data. - * in this situation, outgoing handlers are blocked. - * Outgoing queue shouldn't be empty. - * @export - * @class BufferScheduler - */ -var BufferScheduler = /** @class */ (function () { - /** - * Creates an instance of BufferScheduler. - * - * @param {Readable} readable A Node.js Readable stream - * @param {number} bufferSize Buffer size of every maintained buffer - * @param {number} maxBuffers How many buffers can be allocated - * @param {OutgoingHandler} outgoingHandler An async function scheduled to be - * triggered when a buffer fully filled - * with stream data - * @param {number} concurrency Concurrency of executing outgoingHandlers (>0) - * @param {string} [encoding] [Optional] Encoding of Readable stream when it's a string stream - * @memberof BufferScheduler - */ - function BufferScheduler(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) { - /** - * An internal event emitter. - * - * @private - * @type {EventEmitter} - * @memberof BufferScheduler - */ - this.emitter = new events.EventEmitter(); - /** - * An internal offset marker to track data offset in bytes of next outgoingHandler. - * - * @private - * @type {number} - * @memberof BufferScheduler - */ - this.offset = 0; - /** - * An internal marker to track whether stream is end. - * - * @private - * @type {boolean} - * @memberof BufferScheduler - */ - this.isStreamEnd = false; - /** - * An internal marker to track whether stream or outgoingHandler returns error. - * - * @private - * @type {boolean} - * @memberof BufferScheduler - */ - this.isError = false; - /** - * How many handlers are executing. - * - * @private - * @type {number} - * @memberof BufferScheduler - */ - this.executingOutgoingHandlers = 0; - /** - * How many buffers have been allocated. - * - * @private - * @type {number} - * @memberof BufferScheduler - */ - this.numBuffers = 0; - /** - * Because this class doesn't know how much data every time stream pops, which - * is defined by highWaterMarker of the stream. So BufferScheduler will cache - * data received from the stream, when data in unresolvedDataArray exceeds the - * blockSize defined, it will try to concat a blockSize of buffer, fill into available - * buffers from incoming and push to outgoing array. - * - * @private - * @type {Buffer[]} - * @memberof BufferScheduler - */ - this.unresolvedDataArray = []; - /** - * How much data consisted in unresolvedDataArray. - * - * @private - * @type {number} - * @memberof BufferScheduler - */ - this.unresolvedLength = 0; - /** - * The array includes all the available buffers can be used to fill data from stream. - * - * @private - * @type {Buffer[]} - * @memberof BufferScheduler - */ - this.incoming = []; - /** - * The array (queue) includes all the buffers filled from stream data. - * - * @private - * @type {Buffer[]} - * @memberof BufferScheduler - */ - this.outgoing = []; - if (bufferSize <= 0) { - throw new RangeError("bufferSize must be larger than 0, current is " + bufferSize); - } - if (maxBuffers <= 0) { - throw new RangeError("maxBuffers must be larger than 0, current is " + maxBuffers); - } - if (concurrency <= 0) { - throw new RangeError("concurrency must be larger than 0, current is " + concurrency); - } - this.bufferSize = bufferSize; - this.maxBuffers = maxBuffers; - this.readable = readable; - this.outgoingHandler = outgoingHandler; - this.concurrency = concurrency; - this.encoding = encoding; + return tier; // No more check if string is a valid AccessTier, and left this to underlay logic to decide(service). +} +function ensureCpkIfSpecified(cpk, isHttps) { + if (cpk && !isHttps) { + throw new RangeError("Customer-provided encryption key must be used over HTTPS."); } - /** - * Start the scheduler, will return error when stream of any of the outgoingHandlers - * returns error. - * - * @returns {Promise} - * @memberof BufferScheduler - */ - BufferScheduler.prototype.do = function () { - return tslib.__awaiter(this, void 0, void 0, function () { - var _this = this; - return tslib.__generator(this, function (_a) { - return [2 /*return*/, new Promise(function (resolve, reject) { - _this.readable.on("data", function (data) { - data = typeof data === "string" ? Buffer.from(data, _this.encoding) : data; - _this.appendUnresolvedData(data); - if (!_this.resolveData()) { - _this.readable.pause(); - } - }); - _this.readable.on("error", function (err) { - _this.emitter.emit("error", err); - }); - _this.readable.on("end", function () { - _this.isStreamEnd = true; - _this.emitter.emit("checkEnd"); - }); - _this.emitter.on("error", function (err) { - _this.isError = true; - _this.readable.pause(); - reject(err); - }); - _this.emitter.on("checkEnd", function () { - if (_this.outgoing.length > 0) { - _this.triggerOutgoingHandlers(); - return; - } - if (_this.isStreamEnd && _this.executingOutgoingHandlers === 0) { - if (_this.unresolvedLength > 0 && _this.unresolvedLength < _this.bufferSize) { - _this.outgoingHandler(_this.shiftBufferFromUnresolvedDataArray(), _this.offset) - .then(resolve) - .catch(reject); - } - else if (_this.unresolvedLength >= _this.bufferSize) { - return; - } - else { - resolve(); - } - } - }); - })]; - }); - }); - }; - /** - * Insert a new data into unresolved array. - * - * @private - * @param {Buffer} data - * @memberof BufferScheduler - */ - BufferScheduler.prototype.appendUnresolvedData = function (data) { - this.unresolvedDataArray.push(data); - this.unresolvedLength += data.length; - }; - /** - * Try to shift a buffer with size in blockSize. The buffer returned may be less - * than blockSize when data in unresolvedDataArray is less than bufferSize. - * - * @private - * @returns {Buffer} - * @memberof BufferScheduler - */ - BufferScheduler.prototype.shiftBufferFromUnresolvedDataArray = function () { - if (this.unresolvedLength >= this.bufferSize) { - if (this.bufferSize === this.unresolvedDataArray[0].length) { - this.unresolvedLength -= this.bufferSize; - return this.unresolvedDataArray.shift(); - } - // Lazy concat because Buffer.concat highly drops performance - var merged = Buffer.concat(this.unresolvedDataArray, this.unresolvedLength); - var buffer = merged.slice(0, this.bufferSize); - merged = merged.slice(this.bufferSize); - this.unresolvedDataArray = [merged]; - this.unresolvedLength -= buffer.length; - return buffer; - } - else if (this.unresolvedLength > 0) { - var merged = Buffer.concat(this.unresolvedDataArray, this.unresolvedLength); - this.unresolvedDataArray = []; - this.unresolvedLength = 0; - return merged; - } - else { - return Buffer.allocUnsafe(0); - } - }; - /** - * Resolve data in unresolvedDataArray. For every buffer with size in blockSize - * shifted, it will try to get (or allocate a buffer) from incoming, and fill it, - * then push it into outgoing to be handled by outgoing handler. - * - * Return false when available buffers in incoming are not enough, else true. - * - * @private - * @returns {boolean} Return false when buffers in incoming are not enough, else true. - * @memberof BufferScheduler - */ - BufferScheduler.prototype.resolveData = function () { - while (this.unresolvedLength >= this.bufferSize) { - var buffer = void 0; - if (this.incoming.length > 0) { - buffer = this.incoming.shift(); - } - else { - if (this.numBuffers < this.maxBuffers) { - buffer = Buffer.allocUnsafe(this.bufferSize); - this.numBuffers++; - } - else { - // No available buffer, wait for buffer returned - return false; - } - } - buffer.fill(this.shiftBufferFromUnresolvedDataArray()); - this.outgoing.push(buffer); - this.triggerOutgoingHandlers(); - } - return true; - }; - /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. - * - * @private - * @memberof BufferScheduler - */ - BufferScheduler.prototype.triggerOutgoingHandlers = function () { - return tslib.__awaiter(this, void 0, void 0, function () { - var buffer; - return tslib.__generator(this, function (_a) { - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return [2 /*return*/]; - } - buffer = this.outgoing.shift(); - if (buffer) { - this.triggerOutgoingHandler(buffer); - } - } while (buffer); - return [2 /*return*/]; - }); - }); - }; - /** - * Trigger a outgoing handler for a buffer shifted from outgoing. - * - * @private - * @param {Buffer} buffer - * @returns {Promise} - * @memberof BufferScheduler - */ - BufferScheduler.prototype.triggerOutgoingHandler = function (buffer) { - return tslib.__awaiter(this, void 0, void 0, function () { - var bufferLength, err_1; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: - bufferLength = buffer.length; - this.executingOutgoingHandlers++; - this.offset += bufferLength; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.outgoingHandler(buffer, this.offset - bufferLength)]; - case 2: - _a.sent(); - return [3 /*break*/, 4]; - case 3: - err_1 = _a.sent(); - this.emitter.emit("error", err_1); - return [2 /*return*/]; - case 4: - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer); - this.emitter.emit("checkEnd"); - return [2 /*return*/]; - } - }); - }); - }; - /** - * Return buffer used by outgoing handler into incoming. - * - * @private - * @param {Buffer} buffer - * @memberof BufferScheduler - */ - BufferScheduler.prototype.reuseBuffer = function (buffer) { - this.incoming.push(buffer); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); - } - }; - return BufferScheduler; -}()); + if (cpk && !cpk.encryptionAlgorithm) { + cpk.encryptionAlgorithm = EncryptionAlgorithmAES25; + } +} /** * Function that converts PageRange and ClearRange to a common Range object. @@ -21449,6 +25027,906 @@ function makeBlobBeginCopyFromURLPollOperation(state) { } // Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +/** + * Generate a range string. For example: + * + * "bytes=255-" or "bytes=0-511" + * + * @export + * @param {Range} iRange + * @returns {string} + */ +function rangeToString(iRange) { + if (iRange.offset < 0) { + throw new RangeError("Range.offset cannot be smaller than 0."); + } + if (iRange.count && iRange.count <= 0) { + throw new RangeError("Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end."); + } + return iRange.count + ? "bytes=" + iRange.offset + "-" + (iRange.offset + iRange.count - 1) + : "bytes=" + iRange.offset + "-"; +} + +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * A StorageClient represents a based URL class for {@link BlobServiceClient}, {@link ContainerClient} + * and etc. + * + * @export + * @class StorageClient + */ +var StorageClient = /** @class */ (function () { + /** + * Creates an instance of StorageClient. + * @param {string} url url to resource + * @param {Pipeline} pipeline request policy pipeline. + * @memberof StorageClient + */ + function StorageClient(url, pipeline) { + // URL should be encoded and only once, protocol layer shouldn't encode URL again + this.url = escapeURLPath(url); + this.accountName = getAccountNameFromUrl(url); + this.pipeline = pipeline; + this.storageClientContext = new StorageClientContext(this.url, pipeline.toServiceClientOptions()); + this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); + this.credential = new AnonymousCredential(); + for (var _i = 0, _a = this.pipeline.factories; _i < _a.length; _i++) { + var factory = _a[_i]; + if ((coreHttp.isNode && factory instanceof StorageSharedKeyCredential) || + factory instanceof AnonymousCredential || + coreHttp.isTokenCredential(factory)) { + this.credential = factory; + } + } + // Override protocol layer's default content-type + var storageClientContext = this.storageClientContext; + storageClientContext.requestContentType = undefined; + } + return StorageClient; +}()); + +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * States for Batch. + * + * @enum {number} + */ +var BatchStates; +(function (BatchStates) { + BatchStates[BatchStates["Good"] = 0] = "Good"; + BatchStates[BatchStates["Error"] = 1] = "Error"; +})(BatchStates || (BatchStates = {})); +/** + * Batch provides basic parallel execution with concurrency limits. + * Will stop execute left operations when one of the executed operation throws an error. + * But Batch cannot cancel ongoing operations, you need to cancel them by yourself. + * + * @export + * @class Batch + */ +var Batch = /** @class */ (function () { + /** + * Creates an instance of Batch. + * @param {number} [concurrency=5] + * @memberof Batch + */ + function Batch(concurrency) { + if (concurrency === void 0) { concurrency = 5; } + /** + * Number of active operations under execution. + * + * @private + * @type {number} + * @memberof Batch + */ + this.actives = 0; + /** + * Number of completed operations under execution. + * + * @private + * @type {number} + * @memberof Batch + */ + this.completed = 0; + /** + * Offset of next operation to be executed. + * + * @private + * @type {number} + * @memberof Batch + */ + this.offset = 0; + /** + * Operation array to be executed. + * + * @private + * @type {Operation[]} + * @memberof Batch + */ + this.operations = []; + /** + * States of Batch. When an error happens, state will turn into error. + * Batch will stop execute left operations. + * + * @private + * @type {BatchStates} + * @memberof Batch + */ + this.state = BatchStates.Good; + if (concurrency < 1) { + throw new RangeError("concurrency must be larger than 0"); + } + this.concurrency = concurrency; + this.emitter = new events.EventEmitter(); + } + /** + * Add a operation into queue. + * + * @param {Operation} operation + * @memberof Batch + */ + Batch.prototype.addOperation = function (operation) { + var _this = this; + this.operations.push(function () { return tslib.__awaiter(_this, void 0, void 0, function () { + var error_1; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + this.actives++; + return [4 /*yield*/, operation()]; + case 1: + _a.sent(); + this.actives--; + this.completed++; + this.parallelExecute(); + return [3 /*break*/, 3]; + case 2: + error_1 = _a.sent(); + this.emitter.emit("error", error_1); + return [3 /*break*/, 3]; + case 3: return [2 /*return*/]; + } + }); + }); }); + }; + /** + * Start execute operations in the queue. + * + * @returns {Promise} + * @memberof Batch + */ + Batch.prototype.do = function () { + return tslib.__awaiter(this, void 0, void 0, function () { + var _this = this; + return tslib.__generator(this, function (_a) { + if (this.operations.length === 0) { + return [2 /*return*/, Promise.resolve()]; + } + this.parallelExecute(); + return [2 /*return*/, new Promise(function (resolve, reject) { + _this.emitter.on("finish", resolve); + _this.emitter.on("error", function (error) { + _this.state = BatchStates.Error; + reject(error); + }); + })]; + }); + }); + }; + /** + * Get next operation to be executed. Return null when reaching ends. + * + * @private + * @returns {(Operation | null)} + * @memberof Batch + */ + Batch.prototype.nextOperation = function () { + if (this.offset < this.operations.length) { + return this.operations[this.offset++]; + } + return null; + }; + /** + * Start execute operations. One one the most important difference between + * this method with do() is that do() wraps as an sync method. + * + * @private + * @returns {void} + * @memberof Batch + */ + Batch.prototype.parallelExecute = function () { + if (this.state === BatchStates.Error) { + return; + } + if (this.completed >= this.operations.length) { + this.emitter.emit("finish"); + return; + } + while (this.actives < this.concurrency) { + var operation = this.nextOperation(); + if (operation) { + operation(); + } + else { + return; + } + } + }; + return Batch; +}()); + +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * This class generates a readable stream from the data in an array of buffers. + * + * @export + * @class BuffersStream + */ +var BuffersStream = /** @class */ (function (_super) { + tslib.__extends(BuffersStream, _super); + /** + * Creates an instance of BuffersStream that will emit the data + * contained in the array of buffers. + * + * @param {Buffer[]} buffers Array of buffers containing the data + * @param {number} byteLength The total length of data contained in the buffers + * @memberof BuffersStream + */ + function BuffersStream(buffers, byteLength, options) { + var _this = _super.call(this, options) || this; + _this.buffers = buffers; + _this.byteLength = byteLength; + _this.byteOffsetInCurrentBuffer = 0; + _this.bufferIndex = 0; + _this.pushedBytesLength = 0; + // check byteLength is no larger than buffers[] total length + var buffersLength = 0; + for (var _i = 0, _a = _this.buffers; _i < _a.length; _i++) { + var buf = _a[_i]; + buffersLength += buf.byteLength; + } + if (buffersLength < _this.byteLength) { + throw new Error("Data size shouldn't be larger than the total length of buffers."); + } + return _this; + } + /** + * Internal _read() that will be called when the stream wants to pull more data in. + * + * @param {number} size Optional. The size of data to be read + * @memberof BuffersStream + */ + BuffersStream.prototype._read = function (size) { + if (this.pushedBytesLength >= this.byteLength) { + this.push(null); + } + if (!size) { + size = this.readableHighWaterMark; + } + var outBuffers = []; + var i = 0; + while (i < size && this.pushedBytesLength < this.byteLength) { + // The last buffer may be longer than the data it contains. + var remainingDataInAllBuffers = this.byteLength - this.pushedBytesLength; + var remainingCapacityInThisBuffer = this.buffers[this.bufferIndex].byteLength - this.byteOffsetInCurrentBuffer; + var remaining = Math.min(remainingCapacityInThisBuffer, remainingDataInAllBuffers); + if (remaining > size - i) { + // chunkSize = size - i + var end = this.byteOffsetInCurrentBuffer + size - i; + outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end)); + this.pushedBytesLength += size - i; + this.byteOffsetInCurrentBuffer = end; + i = size; + break; + } + else { + // chunkSize = remaining + var end = this.byteOffsetInCurrentBuffer + remaining; + outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end)); + if (remaining === remainingCapacityInThisBuffer) { + // this.buffers[this.bufferIndex] used up, shift to next one + this.byteOffsetInCurrentBuffer = 0; + this.bufferIndex++; + } + else { + this.byteOffsetInCurrentBuffer = end; + } + this.pushedBytesLength += remaining; + i += remaining; + } + } + if (outBuffers.length > 1) { + this.push(Buffer.concat(outBuffers)); + } + else if (outBuffers.length === 1) { + this.push(outBuffers[0]); + } + }; + return BuffersStream; +}(stream.Readable)); + +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * maxBufferLength is max size of each buffer in the pooled buffers. + */ +// Can't use import as Typescript doesn't recognize "buffer". +var maxBufferLength = __webpack_require__(293).constants.MAX_LENGTH; +/** + * This class provides a buffer container which conceptually has no hard size limit. + * It accepts a capacity, an array of input buffers and the total length of input data. + * It will allocate an internal "buffer" of the capacity and fill the data in the input buffers + * into the internal "buffer" serially with respect to the total length. + * Then by calling PooledBuffer.getReadableStream(), you can get a readable stream + * assembled from all the data in the internal "buffer". + * + * @export + * @class BufferScheduler + */ +var PooledBuffer = /** @class */ (function () { + function PooledBuffer(capacity, buffers, totalLength) { + /** + * Internal buffers used to keep the data. + * Each buffer has a length of the maxBufferLength except last one. + * + * @private + * @type {Buffer[]} + * @memberof PooledBuffer + */ + this.buffers = []; + this.capacity = capacity; + this._size = 0; + // allocate + var bufferNum = Math.ceil(capacity / maxBufferLength); + for (var i = 0; i < bufferNum; i++) { + var len = i === bufferNum - 1 ? capacity % maxBufferLength : maxBufferLength; + if (len === 0) { + len = maxBufferLength; + } + this.buffers.push(Buffer.allocUnsafe(len)); + } + if (buffers) { + this.fill(buffers, totalLength); + } + } + Object.defineProperty(PooledBuffer.prototype, "size", { + /** + * The size of the data contained in the pooled buffers. + */ + get: function () { + return this._size; + }, + enumerable: false, + configurable: true + }); + /** + * Fill the internal buffers with data in the input buffers serially + * with respect to the total length and the total capacity of the internal buffers. + * Data copied will be shift out of the input buffers. + * + * @param {Buffer[]} buffers Input buffers containing the data to be filled in the pooled buffer + * @param {number} totalLength Total length of the data to be filled in. + * + * @returns {void} + * @memberof PooledBuffer + */ + PooledBuffer.prototype.fill = function (buffers, totalLength) { + this._size = Math.min(this.capacity, totalLength); + var i = 0, j = 0, targetOffset = 0, sourceOffset = 0, totalCopiedNum = 0; + while (totalCopiedNum < this._size) { + var source = buffers[i]; + var target = this.buffers[j]; + var copiedNum = source.copy(target, targetOffset, sourceOffset); + totalCopiedNum += copiedNum; + sourceOffset += copiedNum; + targetOffset += copiedNum; + if (sourceOffset === source.length) { + i++; + sourceOffset = 0; + } + if (targetOffset === target.length) { + j++; + targetOffset = 0; + } + } + // clear copied from source buffers + buffers.splice(0, i); + if (buffers.length > 0) { + buffers[0] = buffers[0].slice(sourceOffset); + } + }; + /** + * Get the readable stream assembled from all the data in the internal buffers. + * + * @returns {Readable} + * @memberof PooledBuffer + */ + PooledBuffer.prototype.getReadableStream = function () { + return new BuffersStream(this.buffers, this.size); + }; + return PooledBuffer; +}()); + +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * This class accepts a Node.js Readable stream as input, and keeps reading data + * from the stream into the internal buffer structure, until it reaches maxBuffers. + * Every available buffer will try to trigger outgoingHandler. + * + * The internal buffer structure includes an incoming buffer array, and a outgoing + * buffer array. The incoming buffer array includes the "empty" buffers can be filled + * with new incoming data. The outgoing array includes the filled buffers to be + * handled by outgoingHandler. Every above buffer size is defined by parameter bufferSize. + * + * NUM_OF_ALL_BUFFERS = BUFFERS_IN_INCOMING + BUFFERS_IN_OUTGOING + BUFFERS_UNDER_HANDLING + * + * NUM_OF_ALL_BUFFERS <= maxBuffers + * + * PERFORMANCE IMPROVEMENT TIPS: + * 1. Input stream highWaterMark is better to set a same value with bufferSize + * parameter, which will avoid Buffer.concat() operations. + * 2. concurrency should set a smaller value than maxBuffers, which is helpful to + * reduce the possibility when a outgoing handler waits for the stream data. + * in this situation, outgoing handlers are blocked. + * Outgoing queue shouldn't be empty. + * @export + * @class BufferScheduler + */ +var BufferScheduler = /** @class */ (function () { + /** + * Creates an instance of BufferScheduler. + * + * @param {Readable} readable A Node.js Readable stream + * @param {number} bufferSize Buffer size of every maintained buffer + * @param {number} maxBuffers How many buffers can be allocated + * @param {OutgoingHandler} outgoingHandler An async function scheduled to be + * triggered when a buffer fully filled + * with stream data + * @param {number} concurrency Concurrency of executing outgoingHandlers (>0) + * @param {string} [encoding] [Optional] Encoding of Readable stream when it's a string stream + * @memberof BufferScheduler + */ + function BufferScheduler(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) { + /** + * An internal event emitter. + * + * @private + * @type {EventEmitter} + * @memberof BufferScheduler + */ + this.emitter = new events.EventEmitter(); + /** + * An internal offset marker to track data offset in bytes of next outgoingHandler. + * + * @private + * @type {number} + * @memberof BufferScheduler + */ + this.offset = 0; + /** + * An internal marker to track whether stream is end. + * + * @private + * @type {boolean} + * @memberof BufferScheduler + */ + this.isStreamEnd = false; + /** + * An internal marker to track whether stream or outgoingHandler returns error. + * + * @private + * @type {boolean} + * @memberof BufferScheduler + */ + this.isError = false; + /** + * How many handlers are executing. + * + * @private + * @type {number} + * @memberof BufferScheduler + */ + this.executingOutgoingHandlers = 0; + /** + * How many buffers have been allocated. + * + * @private + * @type {number} + * @memberof BufferScheduler + */ + this.numBuffers = 0; + /** + * Because this class doesn't know how much data every time stream pops, which + * is defined by highWaterMarker of the stream. So BufferScheduler will cache + * data received from the stream, when data in unresolvedDataArray exceeds the + * blockSize defined, it will try to concat a blockSize of buffer, fill into available + * buffers from incoming and push to outgoing array. + * + * @private + * @type {Buffer[]} + * @memberof BufferScheduler + */ + this.unresolvedDataArray = []; + /** + * How much data consisted in unresolvedDataArray. + * + * @private + * @type {number} + * @memberof BufferScheduler + */ + this.unresolvedLength = 0; + /** + * The array includes all the available buffers can be used to fill data from stream. + * + * @private + * @type {PooledBuffer[]} + * @memberof BufferScheduler + */ + this.incoming = []; + /** + * The array (queue) includes all the buffers filled from stream data. + * + * @private + * @type {PooledBuffer[]} + * @memberof BufferScheduler + */ + this.outgoing = []; + if (bufferSize <= 0) { + throw new RangeError("bufferSize must be larger than 0, current is " + bufferSize); + } + if (maxBuffers <= 0) { + throw new RangeError("maxBuffers must be larger than 0, current is " + maxBuffers); + } + if (concurrency <= 0) { + throw new RangeError("concurrency must be larger than 0, current is " + concurrency); + } + this.bufferSize = bufferSize; + this.maxBuffers = maxBuffers; + this.readable = readable; + this.outgoingHandler = outgoingHandler; + this.concurrency = concurrency; + this.encoding = encoding; + } + /** + * Start the scheduler, will return error when stream of any of the outgoingHandlers + * returns error. + * + * @returns {Promise} + * @memberof BufferScheduler + */ + BufferScheduler.prototype.do = function () { + return tslib.__awaiter(this, void 0, void 0, function () { + var _this = this; + return tslib.__generator(this, function (_a) { + return [2 /*return*/, new Promise(function (resolve, reject) { + _this.readable.on("data", function (data) { + data = typeof data === "string" ? Buffer.from(data, _this.encoding) : data; + _this.appendUnresolvedData(data); + if (!_this.resolveData()) { + _this.readable.pause(); + } + }); + _this.readable.on("error", function (err) { + _this.emitter.emit("error", err); + }); + _this.readable.on("end", function () { + _this.isStreamEnd = true; + _this.emitter.emit("checkEnd"); + }); + _this.emitter.on("error", function (err) { + _this.isError = true; + _this.readable.pause(); + reject(err); + }); + _this.emitter.on("checkEnd", function () { + if (_this.outgoing.length > 0) { + _this.triggerOutgoingHandlers(); + return; + } + if (_this.isStreamEnd && _this.executingOutgoingHandlers === 0) { + if (_this.unresolvedLength > 0 && _this.unresolvedLength < _this.bufferSize) { + var buffer_1 = _this.shiftBufferFromUnresolvedDataArray(); + _this.outgoingHandler(function () { return buffer_1.getReadableStream(); }, buffer_1.size, _this.offset) + .then(resolve) + .catch(reject); + } + else if (_this.unresolvedLength >= _this.bufferSize) { + return; + } + else { + resolve(); + } + } + }); + })]; + }); + }); + }; + /** + * Insert a new data into unresolved array. + * + * @private + * @param {Buffer} data + * @memberof BufferScheduler + */ + BufferScheduler.prototype.appendUnresolvedData = function (data) { + this.unresolvedDataArray.push(data); + this.unresolvedLength += data.length; + }; + /** + * Try to shift a buffer with size in blockSize. The buffer returned may be less + * than blockSize when data in unresolvedDataArray is less than bufferSize. + * + * @private + * @returns {PooledBuffer} + * @memberof BufferScheduler + */ + BufferScheduler.prototype.shiftBufferFromUnresolvedDataArray = function (buffer) { + if (!buffer) { + buffer = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); + } + else { + buffer.fill(this.unresolvedDataArray, this.unresolvedLength); + } + this.unresolvedLength -= buffer.size; + return buffer; + }; + /** + * Resolve data in unresolvedDataArray. For every buffer with size in blockSize + * shifted, it will try to get (or allocate a buffer) from incoming, and fill it, + * then push it into outgoing to be handled by outgoing handler. + * + * Return false when available buffers in incoming are not enough, else true. + * + * @private + * @returns {boolean} Return false when buffers in incoming are not enough, else true. + * @memberof BufferScheduler + */ + BufferScheduler.prototype.resolveData = function () { + while (this.unresolvedLength >= this.bufferSize) { + var buffer = void 0; + if (this.incoming.length > 0) { + buffer = this.incoming.shift(); + this.shiftBufferFromUnresolvedDataArray(buffer); + } + else { + if (this.numBuffers < this.maxBuffers) { + buffer = this.shiftBufferFromUnresolvedDataArray(); + this.numBuffers++; + } + else { + // No available buffer, wait for buffer returned + return false; + } + } + this.outgoing.push(buffer); + this.triggerOutgoingHandlers(); + } + return true; + }; + /** + * Try to trigger a outgoing handler for every buffer in outgoing. Stop when + * concurrency reaches. + * + * @private + * @memberof BufferScheduler + */ + BufferScheduler.prototype.triggerOutgoingHandlers = function () { + return tslib.__awaiter(this, void 0, void 0, function () { + var buffer; + return tslib.__generator(this, function (_a) { + do { + if (this.executingOutgoingHandlers >= this.concurrency) { + return [2 /*return*/]; + } + buffer = this.outgoing.shift(); + if (buffer) { + this.triggerOutgoingHandler(buffer); + } + } while (buffer); + return [2 /*return*/]; + }); + }); + }; + /** + * Trigger a outgoing handler for a buffer shifted from outgoing. + * + * @private + * @param {Buffer} buffer + * @returns {Promise} + * @memberof BufferScheduler + */ + BufferScheduler.prototype.triggerOutgoingHandler = function (buffer) { + return tslib.__awaiter(this, void 0, void 0, function () { + var bufferLength, err_1; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + bufferLength = buffer.size; + this.executingOutgoingHandlers++; + this.offset += bufferLength; + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4 /*yield*/, this.outgoingHandler(function () { return buffer.getReadableStream(); }, bufferLength, this.offset - bufferLength)]; + case 2: + _a.sent(); + return [3 /*break*/, 4]; + case 3: + err_1 = _a.sent(); + this.emitter.emit("error", err_1); + return [2 /*return*/]; + case 4: + this.executingOutgoingHandlers--; + this.reuseBuffer(buffer); + this.emitter.emit("checkEnd"); + return [2 /*return*/]; + } + }); + }); + }; + /** + * Return buffer used by outgoing handler into incoming. + * + * @private + * @param {Buffer} buffer + * @memberof BufferScheduler + */ + BufferScheduler.prototype.reuseBuffer = function (buffer) { + this.incoming.push(buffer); + if (!this.isError && this.resolveData() && !this.isStreamEnd) { + this.readable.resume(); + } + }; + return BufferScheduler; +}()); + +// Copyright (c) Microsoft Corporation. +/** + * Creates a span using the global tracer. + * @param name The name of the operation being performed. + * @param tracingOptions The options for the underlying http request. + */ +function createSpan(operationName, tracingOptions) { + if (tracingOptions === void 0) { tracingOptions = {}; } + var tracer = coreTracing.getTracer(); + var spanOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { kind: api.SpanKind.INTERNAL }); + var span = tracer.startSpan("Azure.Storage.Blob." + operationName, spanOptions); + span.setAttribute("az.namespace", "Microsoft.Storage"); + var newOptions = tracingOptions.spanOptions || {}; + if (span.isRecording()) { + newOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { parent: span.context(), attributes: tslib.__assign(tslib.__assign({}, spanOptions.attributes), { "az.namespace": "Microsoft.Storage" }) }); + } + return { + span: span, + spanOptions: newOptions + }; +} + +// Copyright (c) Microsoft Corporation. All rights reserved. +/** + * Reads a readable stream into buffer. Fill the buffer from offset to end. + * + * @export + * @param {NodeJS.ReadableStream} stream A Node.js Readable stream + * @param {Buffer} buffer Buffer to be filled, length must >= offset + * @param {number} offset From which position in the buffer to be filled, inclusive + * @param {number} end To which position in the buffer to be filled, exclusive + * @param {string} [encoding] Encoding of the Readable stream + * @returns {Promise} + */ +function streamToBuffer(stream, buffer, offset, end, encoding) { + return tslib.__awaiter(this, void 0, void 0, function () { + var pos, count; + return tslib.__generator(this, function (_a) { + pos = 0; + count = end - offset; + return [2 /*return*/, new Promise(function (resolve, reject) { + stream.on("readable", function () { + if (pos >= count) { + resolve(); + return; + } + var chunk = stream.read(); + if (!chunk) { + return; + } + if (typeof chunk === "string") { + chunk = Buffer.from(chunk, encoding); + } + // How much data needed in this chunk + var chunkLength = pos + chunk.length > count ? count - pos : chunk.length; + buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); + pos += chunkLength; + }); + stream.on("end", function () { + if (pos < count) { + reject(new Error("Stream drains before getting enough data needed. Data read: " + pos + ", data need: " + count)); + } + resolve(); + }); + stream.on("error", reject); + })]; + }); + }); +} +/** + * Reads a readable stream into buffer entirely. + * + * @export + * @param {NodeJS.ReadableStream} stream A Node.js Readable stream + * @param {Buffer} buffer Buffer to be filled, length must >= offset + * @param {string} [encoding] Encoding of the Readable stream + * @returns {Promise} with the count of bytes read. + * @throws {RangeError} If buffer size is not big enough. + */ +function streamToBuffer2(stream, buffer, encoding) { + return tslib.__awaiter(this, void 0, void 0, function () { + var pos, bufferSize; + return tslib.__generator(this, function (_a) { + pos = 0; + bufferSize = buffer.length; + return [2 /*return*/, new Promise(function (resolve, reject) { + stream.on("readable", function () { + var chunk = stream.read(); + if (!chunk) { + return; + } + if (typeof chunk === "string") { + chunk = Buffer.from(chunk, encoding); + } + if (pos + chunk.length > bufferSize) { + reject(new Error("Stream exceeds buffer size. Buffer size: " + bufferSize)); + return; + } + buffer.fill(chunk, pos, pos + chunk.length); + pos += chunk.length; + }); + stream.on("end", function () { + resolve(pos); + }); + stream.on("error", reject); + })]; + }); + }); +} +/** + * ONLY AVAILABLE IN NODE.JS RUNTIME. + * + * Writes the content of a readstream to a local file. Returns a Promise which is completed after the file handle is closed. + * + * @export + * @param {NodeJS.ReadableStream} rs The read stream. + * @param {string} file Destination file path. + * @returns {Promise} + */ +function readStreamToLocalFile(rs, file) { + return tslib.__awaiter(this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + return [2 /*return*/, new Promise(function (resolve, reject) { + var ws = fs.createWriteStream(file); + rs.on("error", function (err) { + reject(err); + }); + ws.on("error", function (err) { + reject(err); + }); + ws.on("close", resolve); + rs.pipe(ws); + })]; + }); + }); +} +/** + * ONLY AVAILABLE IN NODE.JS RUNTIME. + * + * Promisified version of fs.stat(). + */ +var fsStat = util.promisify(fs.stat); +var fsCreateReadStream = fs.createReadStream; + /** * A BlobClient represents a URL to an Azure Storage blob; the blob may be a block blob, * append blob, or page blob. @@ -21526,7 +26004,7 @@ var BlobClient = /** @class */ (function (_super) { get: function () { return this._name; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobClient.prototype, "containerName", { @@ -21536,7 +26014,7 @@ var BlobClient = /** @class */ (function (_super) { get: function () { return this._containerName; }, - enumerable: true, + enumerable: false, configurable: true }); /** @@ -21550,6 +26028,17 @@ var BlobClient = /** @class */ (function (_super) { BlobClient.prototype.withSnapshot = function (snapshot) { return new BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline); }; + /** + * Creates a new BlobClient object pointing to a version of this blob. + * Provide "" will remove the versionId and return a Client to the base blob. + * + * @param {string} versionId The versionId. + * @returns {BlobClient} A new BlobClient object pointing to the version of this blob. + * @memberof BlobClient + */ + BlobClient.prototype.withVersion = function (versionId) { + return new BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId.length === 0 ? undefined : versionId), this.pipeline); + }; /** * Creates a AppendBlobClient object. * @@ -21589,7 +26078,7 @@ var BlobClient = /** @class */ (function (_super) { * @param {number} [offset] From which position of the blob to download, >= 0 * @param {number} [count] How much data to be downloaded, > 0. Will download to the end when undefined * @param {BlobDownloadOptions} [options] Optional options to Blob Download operation. - * @returns {Promise} + * @returns {Promise} * @memberof BlobClient * * Example usage (Node.js): @@ -21597,20 +26086,20 @@ var BlobClient = /** @class */ (function (_super) { * ```js * // Download and convert a blob to a string * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await streamToString(downloadBlockBlobResponse.readableStreamBody); - * console.log("Downloaded blob content:", downloaded); + * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody); + * console.log("Downloaded blob content:", downloaded.toString()); * - * async function streamToString(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data.toString()); - * }); - * readableStream.on("end", () => { - * resolve(chunks.join("")); - * }); - * readableStream.on("error", reject); - * }); + * async function streamToBuffer(readableStream) { + * return new Promise((resolve, reject) => { + * const chunks = []; + * readableStream.on("data", (data) => { + * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); + * }); + * readableStream.on("end", () => { + * resolve(Buffer.concat(chunks)); + * }); + * readableStream.on("error", reject); + * }); * } * ``` * @@ -21638,25 +26127,26 @@ var BlobClient = /** @class */ (function (_super) { * ``` */ BlobClient.prototype.download = function (offset, count, options) { + var _a; if (offset === void 0) { offset = 0; } if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, res_1, e_1; + var _b, span, spanOptions, res_1, wrappedRes, e_1; var _this = this; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; options.conditions = options.conditions || {}; ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - _a = createSpan("BlobClient-download", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("BlobClient-download", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.blobContext.download({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), onDownloadProgress: coreHttp.isNode ? undefined : options.onProgress, range: offset === 0 && !count ? undefined : rangeToString({ offset: offset, count: count }), rangeGetContentMD5: options.rangeGetContentMD5, @@ -21666,7 +26156,8 @@ var BlobClient = /** @class */ (function (_super) { spanOptions: spanOptions })]; case 2: - res_1 = _b.sent(); + res_1 = _c.sent(); + wrappedRes = tslib.__assign(tslib.__assign({}, res_1), { _response: res_1._response, objectReplicationDestinationPolicyId: res_1.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res_1.objectReplicationRules) }); // We support retrying when download stream unexpected ends in Node.js runtime // Following code shouldn't be bundled into browser build, however some // bundlers may try to bundle following code and "FileReadResponse.ts". @@ -21682,10 +26173,11 @@ var BlobClient = /** @class */ (function (_super) { if (!res_1.etag) { throw new RangeError("File download response doesn't contain valid etag header"); } - return [2 /*return*/, new BlobDownloadResponse(res_1, function (start) { return tslib.__awaiter(_this, void 0, void 0, function () { + return [2 /*return*/, new BlobDownloadResponse(wrappedRes, function (start) { return tslib.__awaiter(_this, void 0, void 0, function () { var updatedOptions; - return tslib.__generator(this, function (_a) { - switch (_a.label) { + var _a; + return tslib.__generator(this, function (_b) { + switch (_b.label) { case 0: updatedOptions = { leaseAccessConditions: options.conditions, @@ -21693,7 +26185,8 @@ var BlobClient = /** @class */ (function (_super) { ifMatch: options.conditions.ifMatch || res_1.etag, ifModifiedSince: options.conditions.ifModifiedSince, ifNoneMatch: options.conditions.ifNoneMatch, - ifUnmodifiedSince: options.conditions.ifUnmodifiedSince + ifUnmodifiedSince: options.conditions.ifUnmodifiedSince, + ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }, range: rangeToString({ count: offset + res_1.contentLength - start, @@ -21712,7 +26205,7 @@ var BlobClient = /** @class */ (function (_super) { // updatedOptions.range // }, options: ${JSON.stringify(updatedOptions)}` // ); - return [2 /*return*/, (_a.sent()).readableStreamBody]; + return [2 /*return*/, (_b.sent()).readableStreamBody]; } }); }); }, offset, res_1.contentLength, { @@ -21721,7 +26214,7 @@ var BlobClient = /** @class */ (function (_super) { onProgress: options.onProgress })]; case 3: - e_1 = _b.sent(); + e_1 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, message: e_1.message @@ -21736,7 +26229,7 @@ var BlobClient = /** @class */ (function (_super) { }); }; /** - * Returns true if the Azrue blob resource represented by this client exists; false otherwise. + * Returns true if the Azure blob resource represented by this client exists; false otherwise. * * NOTE: use this function with care since an existing blob might be deleted by other clients or * applications. Vice versa new blobs might be added by other clients or applications after this @@ -21761,6 +26254,7 @@ var BlobClient = /** @class */ (function (_super) { return [4 /*yield*/, this.getProperties({ abortSignal: options.abortSignal, customerProvidedKey: options.customerProvidedKey, + conditions: options.conditions, tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) })]; case 2: @@ -21803,28 +26297,31 @@ var BlobClient = /** @class */ (function (_super) { * @memberof BlobClient */ BlobClient.prototype.getProperties = function (options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_3; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, res, e_3; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlobClient-getProperties", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("BlobClient-getProperties", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); options.conditions = options.conditions || {}; ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.blobContext.getProperties({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: + res = _c.sent(); + return [2 /*return*/, tslib.__assign(tslib.__assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) })]; case 3: - e_3 = _b.sent(); + e_3 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, message: e_3.message @@ -21850,27 +26347,28 @@ var BlobClient = /** @class */ (function (_super) { * @memberof BlobClient */ BlobClient.prototype.delete = function (options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_4; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_4; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlobClient-delete", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("BlobClient-delete", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.blobContext.deleteMethod({ abortSignal: options.abortSignal, deleteSnapshots: options.deleteSnapshots, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_4 = _b.sent(); + e_4 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, message: e_4.message @@ -21884,6 +26382,56 @@ var BlobClient = /** @class */ (function (_super) { }); }); }; + /** + * Marks the specified blob or snapshot for deletion if it exists. The blob is later deleted + * during garbage collection. Note that in order to delete a blob, you must delete + * all of its snapshots. You can delete both at the same time with the Delete + * Blob operation. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * + * @param {BlobDeleteOptions} [options] Optional options to Blob Delete operation. + * @returns {Promise} + * @memberof BlobClient + */ + BlobClient.prototype.deleteIfExists = function (options) { + var _a, _b; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _c, span, spanOptions, res, e_5; + return tslib.__generator(this, function (_d) { + switch (_d.label) { + case 0: + _c = createSpan("BlobClient-deleteIfExists", options.tracingOptions), span = _c.span, spanOptions = _c.spanOptions; + _d.label = 1; + case 1: + _d.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this.delete(tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; + case 2: + res = _d.sent(); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable + })]; + case 3: + e_5 = _d.sent(); + if (((_a = e_5.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { + span.setStatus({ + code: api.CanonicalCode.NOT_FOUND, + message: "Expected exception when deleting a blob or snapshot only if it exists." + }); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_5.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_5.response })]; + } + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_5.message + }); + throw e_5; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; /** * Restores the contents and metadata of soft deleted blob and any associated * soft deleted snapshots. Undelete Blob is supported only on version 2017-07-29 @@ -21897,7 +26445,7 @@ var BlobClient = /** @class */ (function (_super) { BlobClient.prototype.undelete = function (options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_5; + var _a, span, spanOptions, e_6; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -21911,12 +26459,12 @@ var BlobClient = /** @class */ (function (_super) { })]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_5 = _b.sent(); + e_6 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_5.message + message: e_6.message }); - throw e_5; + throw e_6; case 4: span.end(); return [7 /*endfinally*/]; @@ -21928,46 +26476,47 @@ var BlobClient = /** @class */ (function (_super) { /** * Sets system properties on the blob. * - * If no value provided, or no value provided for the specificed blob HTTP headers, + * If no value provided, or no value provided for the specified blob HTTP headers, * these blob HTTP headers without a value will be cleared. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties * * @param {BlobHTTPHeaders} [blobHTTPHeaders] If no value provided, or no value provided for - * the specificed blob HTTP headers, these blob HTTP + * the specified blob HTTP headers, these blob HTTP * headers without a value will be cleared. * @param {BlobSetHTTPHeadersOptions} [options] Optional options to Blob Set HTTP Headers operation. * @returns {Promise} * @memberof BlobClient */ BlobClient.prototype.setHTTPHeaders = function (blobHTTPHeaders, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_6; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_7; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlobClient-setHTTPHeaders", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("BlobClient-setHTTPHeaders", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.blobContext.setHTTPHeaders({ abortSignal: options.abortSignal, blobHTTPHeaders: blobHTTPHeaders, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_6 = _b.sent(); + e_7 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_6.message + message: e_7.message }); - throw e_6; + throw e_7; case 4: span.end(); return [7 /*endfinally*/]; @@ -21990,35 +26539,124 @@ var BlobClient = /** @class */ (function (_super) { * @memberof BlobClient */ BlobClient.prototype.setMetadata = function (metadata, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_7; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_8; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlobClient-setMetadata", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("BlobClient-setMetadata", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.blobContext.setMetadata({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: metadata, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_7 = _b.sent(); + e_8 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_7.message + message: e_8.message }); - throw e_7; + throw e_8; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + /** + * Sets tags on the underlying blob. + * A blob can have up to 10 tags. Tag keys must be between 1 and 128 characters. Tag values must be between 0 and 256 characters. + * Valid tag key and value characters include lower and upper case letters, digits (0-9), + * space (' '), plus ('+'), minus ('-'), period ('.'), foward slash ('/'), colon (':'), equals ('='), and underscore ('_'). + * + * @param {Tags} tags + * @param {BlobSetTagsOptions} [options={}] + * @returns {Promise} + * @memberof BlobClient + */ + BlobClient.prototype.setTags = function (tags, options) { + var _a; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _b, span, spanOptions, e_9; + return tslib.__generator(this, function (_c) { + switch (_c.label) { + case 0: + _b = createSpan("BlobClient-setTags", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; + case 1: + _c.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this.blobContext.setTags({ + abortSignal: options.abortSignal, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + spanOptions: spanOptions, + tags: toBlobTags(tags) + })]; + case 2: return [2 /*return*/, _c.sent()]; + case 3: + e_9 = _c.sent(); + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_9.message + }); + throw e_9; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + /** + * Gets the tags associated with the underlying blob. + * + * @param {BlobGetTagsOptions} [options={}] + * @returns {Promise} + * @memberof BlobClient + */ + BlobClient.prototype.getTags = function (options) { + var _a; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _b, span, spanOptions, response, wrappedResponse, e_10; + return tslib.__generator(this, function (_c) { + switch (_c.label) { + case 0: + _b = createSpan("BlobClient-getTags", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; + case 1: + _c.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this.blobContext.getTags({ + abortSignal: options.abortSignal, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + spanOptions: spanOptions + })]; + case 2: + response = _c.sent(); + wrappedResponse = tslib.__assign(tslib.__assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); + return [2 /*return*/, wrappedResponse]; + case 3: + e_10 = _c.sent(); + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_10.message + }); + throw e_10; case 4: span.end(); return [7 /*endfinally*/]; @@ -22046,35 +26684,36 @@ var BlobClient = /** @class */ (function (_super) { * @memberof BlobClient */ BlobClient.prototype.createSnapshot = function (options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_8; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_11; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlobClient-createSnapshot", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("BlobClient-createSnapshot", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.blobContext.createSnapshot({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_8 = _b.sent(); + e_11 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_8.message + message: e_11.message }); - throw e_8; + throw e_11; case 4: span.end(); return [7 /*endfinally*/]; @@ -22219,7 +26858,7 @@ var BlobClient = /** @class */ (function (_super) { BlobClient.prototype.abortCopyFromURL = function (copyId, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_9; + var _a, span, spanOptions, e_12; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -22234,12 +26873,12 @@ var BlobClient = /** @class */ (function (_super) { })]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_9 = _b.sent(); + e_12 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_9.message + message: e_12.message }); - throw e_9; + throw e_12; case 4: span.end(); return [7 /*endfinally*/]; @@ -22259,23 +26898,24 @@ var BlobClient = /** @class */ (function (_super) { * @memberof BlobClient */ BlobClient.prototype.syncCopyFromURL = function (copySource, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_10; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_13; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlobClient-syncCopyFromURL", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("BlobClient-syncCopyFromURL", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.blobContext.copyFromURL(copySource, { abortSignal: options.abortSignal, metadata: options.metadata, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, @@ -22283,16 +26923,17 @@ var BlobClient = /** @class */ (function (_super) { sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince }, sourceContentMD5: options.sourceContentMD5, + blobTagsString: toBlobTagsString(options.tags), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_10 = _b.sent(); + e_13 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_10.message + message: e_13.message }); - throw e_10; + throw e_13; case 4: span.end(); return [7 /*endfinally*/]; @@ -22315,30 +26956,32 @@ var BlobClient = /** @class */ (function (_super) { * @memberof BlobClient */ BlobClient.prototype.setAccessTier = function (tier, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_11; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_14; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlobClient-setAccessTier", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("BlobClient-setAccessTier", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.blobContext.setTier(toAccessTier(tier), { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), rehydratePriority: options.rehydratePriority, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_11 = _b.sent(); + e_14 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_11.message + message: e_14.message }); - throw e_11; + throw e_14; case 4: span.end(); return [7 /*endfinally*/]; @@ -22350,7 +26993,7 @@ var BlobClient = /** @class */ (function (_super) { BlobClient.prototype.downloadToBuffer = function (param1, param2, param3, param4) { if (param4 === void 0) { param4 = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var buffer, offset, count, options, _a, span, spanOptions, response, transferProgress_1, batch, _loop_1, off, e_12; + var buffer, offset, count, options, _a, span, spanOptions, response, transferProgress_1, batch, _loop_1, off, e_15; var _this = this; return tslib.__generator(this, function (_b) { switch (_b.label) { @@ -22428,6 +27071,7 @@ var BlobClient = /** @class */ (function (_super) { abortSignal: options.abortSignal, conditions: options.conditions, maxRetryRequests: options.maxRetryRequestsPerBlock, + customerProvidedKey: options.customerProvidedKey, tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) })]; case 1: @@ -22456,12 +27100,12 @@ var BlobClient = /** @class */ (function (_super) { _b.sent(); return [2 /*return*/, buffer]; case 5: - e_12 = _b.sent(); + e_15 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_12.message + message: e_15.message }); - throw e_12; + throw e_15; case 6: span.end(); return [7 /*endfinally*/]; @@ -22481,7 +27125,7 @@ var BlobClient = /** @class */ (function (_super) { * @param {number} [offset] From which position of the block blob to download. * @param {number} [count] How much data to be downloaded. Will download to the end when passing undefined. * @param {BlobDownloadOptions} [options] Options to Blob download options. - * @returns {Promise} The response data for blob download operation, + * @returns {Promise} The response data for blob download operation, * but with readableStreamBody set to undefined since its * content is already read and written into a local file * at the specified path. @@ -22491,7 +27135,7 @@ var BlobClient = /** @class */ (function (_super) { if (offset === void 0) { offset = 0; } if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, response, e_13; + var _a, span, spanOptions, response, e_16; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -22512,12 +27156,12 @@ var BlobClient = /** @class */ (function (_super) { response.blobDownloadStream = undefined; return [2 /*return*/, response]; case 5: - e_13 = _b.sent(); + e_16 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_13.message + message: e_16.message }); - throw e_13; + throw e_16; case 6: span.end(); return [7 /*endfinally*/]; @@ -22545,7 +27189,7 @@ var BlobClient = /** @class */ (function (_super) { containerName = pathComponents[1]; blobName = pathComponents[3]; } - else { + else if (isIpEndpointStyle(parsedUrl)) { // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/containername/blob // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/containername/blob // .getPath() -> /devstoreaccount1/containername/blob @@ -22553,6 +27197,13 @@ var BlobClient = /** @class */ (function (_super) { containerName = pathComponents[2]; blobName = pathComponents[4]; } + else { + // "https://customdomain.com/containername/blob". + // .getPath() -> /containername/blob + var pathComponents = parsedUrl.getPath().match("/([^/]*)(/(.*))?"); + containerName = pathComponents[1]; + blobName = pathComponents[3]; + } // decode the encoded blobName, containerName - to get all the special characters that might be present in them containerName = decodeURIComponent(containerName); blobName = decodeURIComponent(blobName); @@ -22587,41 +27238,45 @@ var BlobClient = /** @class */ (function (_super) { * @memberof BlobClient */ BlobClient.prototype.startCopyFromURL = function (copySource, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_14; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_17; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlobClient-startCopyFromURL", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("BlobClient-startCopyFromURL", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.blobContext.startCopyFromURL(copySource, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince + sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, + sourceIfTags: options.sourceConditions.tagConditions }, rehydratePriority: options.rehydratePriority, tier: toAccessTier(options.tier), + blobTagsString: toBlobTagsString(options.tags), + sealBlob: options.sealBlob, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_14 = _b.sent(); + e_17 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_14.message + message: e_17.message }); - throw e_14; + throw e_17; case 4: span.end(); return [7 /*endfinally*/]; @@ -22730,36 +27385,130 @@ var AppendBlobClient = /** @class */ (function (_super) { * ``` */ AppendBlobClient.prototype.create = function (options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_15; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_18; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("AppendBlobClient-create", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("AppendBlobClient-create", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.appendBlobContext.create(0, { abortSignal: options.abortSignal, blobHTTPHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, + blobTagsString: toBlobTagsString(options.tags), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_15 = _b.sent(); + e_18 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_15.message + message: e_18.message }); - throw e_15; + throw e_18; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + /** + * Creates a 0-length append blob. Call AppendBlock to append data to an append blob. + * If the blob with the same name already exists, the content of the existing blob will remain unchanged. + * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * + * @param {AppendBlobCreateIfNotExistsOptions} [options] + * @returns {Promise} + * @memberof AppendBlobClient + */ + AppendBlobClient.prototype.createIfNotExists = function (options) { + var _a, _b; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _c, span, spanOptions, conditions, res, e_19; + return tslib.__generator(this, function (_d) { + switch (_d.label) { + case 0: + _c = createSpan("AppendBlobClient-createIfNotExists", options.tracingOptions), span = _c.span, spanOptions = _c.spanOptions; + conditions = { ifNoneMatch: ETagAny }; + _d.label = 1; + case 1: + _d.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this.create(tslib.__assign(tslib.__assign({}, options), { conditions: conditions, tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; + case 2: + res = _d.sent(); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable + })]; + case 3: + e_19 = _d.sent(); + if (((_a = e_19.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { + span.setStatus({ + code: api.CanonicalCode.ALREADY_EXISTS, + message: "Expected exception when creating a blob only if it does not already exist." + }); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_19.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_19.response })]; + } + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_19.message + }); + throw e_19; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + /** + * Seals the append blob, making it read only. + * + * @param {AppendBlobSealOptions} [options={}] + * @returns {Promise} + * @memberof AppendBlobClient + */ + AppendBlobClient.prototype.seal = function (options) { + var _a; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _b, span, spanOptions, e_20; + return tslib.__generator(this, function (_c) { + switch (_c.label) { + case 0: + _b = createSpan("AppendBlobClient-seal", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + options.conditions = options.conditions || {}; + _c.label = 1; + case 1: + _c.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this.appendBlobContext.seal({ + abortSignal: options.abortSignal, + appendPositionAccessConditions: options.conditions, + leaseAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + spanOptions: spanOptions + })]; + case 2: return [2 /*return*/, _c.sent()]; + case 3: + e_20 = _c.sent(); + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_20.message + }); + throw e_20; case 4: span.end(); return [7 /*endfinally*/]; @@ -22794,23 +27543,24 @@ var AppendBlobClient = /** @class */ (function (_super) { * ``` */ AppendBlobClient.prototype.appendBlock = function (body, contentLength, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_16; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_21; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("AppendBlobClient-appendBlock", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("AppendBlobClient-appendBlock", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.appendBlobContext.appendBlock(body, contentLength, { abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), onUploadProgress: options.onProgress, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, @@ -22818,14 +27568,14 @@ var AppendBlobClient = /** @class */ (function (_super) { encryptionScope: options.encryptionScope, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_16 = _b.sent(); + e_21 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_16.message + message: e_21.message }); - throw e_16; + throw e_21; case 4: span.end(); return [7 /*endfinally*/]; @@ -22851,18 +27601,19 @@ var AppendBlobClient = /** @class */ (function (_super) { * @memberof AppendBlobClient */ AppendBlobClient.prototype.appendBlockFromURL = function (sourceURL, sourceOffset, count, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_17; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_22; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("AppendBlobClient-appendBlockFromURL", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b = createSpan("AppendBlobClient-appendBlockFromURL", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - _b.label = 1; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { abortSignal: options.abortSignal, @@ -22871,7 +27622,7 @@ var AppendBlobClient = /** @class */ (function (_super) { sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, appendPositionAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, @@ -22882,14 +27633,14 @@ var AppendBlobClient = /** @class */ (function (_super) { encryptionScope: options.encryptionScope, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_17 = _b.sent(); + e_22 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_17.message + message: e_22.message }); - throw e_17; + throw e_22; case 4: span.end(); return [7 /*endfinally*/]; @@ -22968,6 +27719,7 @@ var BlockBlobClient = /** @class */ (function (_super) { } _this = _super.call(this, url, pipeline) || this; _this.blockBlobContext = new BlockBlob(_this.storageClientContext); + _this._blobContext = new Blob$1(_this.storageClientContext); return _this; } /** @@ -22982,6 +27734,84 @@ var BlockBlobClient = /** @class */ (function (_super) { BlockBlobClient.prototype.withSnapshot = function (snapshot) { return new BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline); }; + /** + * ONLY AVAILABLE IN NODE.JS RUNTIME. + * + * Quick query for a JSON or CSV formatted blob. + * + * Example usage (Node.js): + * + * ```js + * // Query and convert a blob to a string + * const queryBlockBlobResponse = await blockBlobClient.query("select * from BlobStorage"); + * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString(); + * console.log("Query blob content:", downloaded); + * + * async function streamToBuffer(readableStream) { + * return new Promise((resolve, reject) => { + * const chunks = []; + * readableStream.on("data", (data) => { + * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); + * }); + * readableStream.on("end", () => { + * resolve(Buffer.concat(chunks)); + * }); + * readableStream.on("error", reject); + * }); + * } + * ``` + * + * @param {string} query + * @param {BlockBlobQueryOptions} [options={}] + * @returns {Promise} + * @memberof BlockBlobClient + */ + BlockBlobClient.prototype.query = function (query, options) { + var _a; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _b, span, spanOptions, response, e_23; + return tslib.__generator(this, function (_c) { + switch (_c.label) { + case 0: + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + _b = createSpan("BlockBlobClient-query", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; + case 1: + _c.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this._blobContext.query({ + abortSignal: options.abortSignal, + queryRequest: { + expression: query, + inputSerialization: toQuerySerialization(options.inputTextConfiguration), + outputSerialization: toQuerySerialization(options.outputTextConfiguration) + }, + leaseAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + spanOptions: spanOptions + })]; + case 2: + response = _c.sent(); + return [2 /*return*/, new BlobQueryResponse(response, { + abortSignal: options.abortSignal, + onProgress: options.onProgress, + onError: options.onError + })]; + case 3: + e_23 = _c.sent(); + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_23.message + }); + throw e_23; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; /** * Creates a new block blob, or updates the content of an existing block blob. * Updating an existing block blob overwrites any existing metadata on the blob. @@ -23011,38 +27841,40 @@ var BlockBlobClient = /** @class */ (function (_super) { * ``` */ BlockBlobClient.prototype.upload = function (body, contentLength, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_18; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_24; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("BlockBlobClient-upload", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("BlockBlobClient-upload", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.blockBlobContext.upload(body, contentLength, { abortSignal: options.abortSignal, blobHTTPHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), onUploadProgress: options.onProgress, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), + blobTagsString: toBlobTagsString(options.tags), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_18 = _b.sent(); + e_24 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_18.message + message: e_24.message }); - throw e_18; + throw e_24; case 4: span.end(); return [7 /*endfinally*/]; @@ -23066,7 +27898,7 @@ var BlockBlobClient = /** @class */ (function (_super) { BlockBlobClient.prototype.stageBlock = function (blockId, body, contentLength, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_19; + var _a, span, spanOptions, e_25; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -23087,12 +27919,12 @@ var BlockBlobClient = /** @class */ (function (_super) { })]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_19 = _b.sent(); + e_25 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_19.message + message: e_25.message }); - throw e_19; + throw e_25; case 4: span.end(); return [7 /*endfinally*/]; @@ -23127,7 +27959,7 @@ var BlockBlobClient = /** @class */ (function (_super) { if (offset === void 0) { offset = 0; } if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_20; + var _a, span, spanOptions, e_26; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -23148,12 +27980,12 @@ var BlockBlobClient = /** @class */ (function (_super) { })]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_20 = _b.sent(); + e_26 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_20.message + message: e_26.message }); - throw e_20; + throw e_26; case 4: span.end(); return [7 /*endfinally*/]; @@ -23176,37 +28008,39 @@ var BlockBlobClient = /** @class */ (function (_super) { * @memberof BlockBlobClient */ BlockBlobClient.prototype.commitBlockList = function (blocks, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_21; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_27; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("BlockBlobClient-commitBlockList", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("BlockBlobClient-commitBlockList", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.blockBlobContext.commitBlockList({ latest: blocks }, { abortSignal: options.abortSignal, blobHTTPHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), + blobTagsString: toBlobTagsString(options.tags), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_21 = _b.sent(); + e_27 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_21.message + message: e_27.message }); - throw e_21; + throw e_27; case 4: span.end(); return [7 /*endfinally*/]; @@ -23227,23 +28061,25 @@ var BlockBlobClient = /** @class */ (function (_super) { * @memberof BlockBlobClient */ BlockBlobClient.prototype.getBlockList = function (listType, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, res, e_22; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, res, e_28; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("BlockBlobClient-getBlockList", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("BlockBlobClient-getBlockList", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.blockBlobContext.getBlockList(listType, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), spanOptions: spanOptions })]; case 2: - res = _b.sent(); + res = _c.sent(); if (!res.committedBlocks) { res.committedBlocks = []; } @@ -23252,12 +28088,12 @@ var BlockBlobClient = /** @class */ (function (_super) { } return [2 /*return*/, res]; case 3: - e_22 = _b.sent(); + e_28 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_22.message + message: e_28.message }); - throw e_22; + throw e_28; case 4: span.end(); return [7 /*endfinally*/]; @@ -23285,7 +28121,7 @@ var BlockBlobClient = /** @class */ (function (_super) { BlockBlobClient.prototype.uploadBrowserData = function (browserData, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, browserBlob_1, e_23; + var _a, span, spanOptions, browserBlob_1, e_29; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -23299,12 +28135,12 @@ var BlockBlobClient = /** @class */ (function (_super) { }, browserBlob_1.size, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_23 = _b.sent(); + e_29 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_23.message + message: e_29.message }); - throw e_23; + throw e_29; case 4: span.end(); return [7 /*endfinally*/]; @@ -23332,7 +28168,7 @@ var BlockBlobClient = /** @class */ (function (_super) { BlockBlobClient.prototype.uploadSeekableBlob = function (blobFactory, size, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, numBlocks_1, blockList_1, blockIDPrefix_1, transferProgress_2, batch, _loop_2, i, e_24; + var _a, span, spanOptions, numBlocks_1, blockList_1, blockIDPrefix_1, transferProgress_2, batch, _loop_2, i, e_30; var _this = this; return tslib.__generator(this, function (_b) { switch (_b.label) { @@ -23424,12 +28260,12 @@ var BlockBlobClient = /** @class */ (function (_super) { _b.sent(); return [2 /*return*/, this.commitBlockList(blockList_1, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; case 5: - e_24 = _b.sent(); + e_30 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_24.message + message: e_30.message }); - throw e_24; + throw e_30; case 6: span.end(); return [7 /*endfinally*/]; @@ -23455,7 +28291,7 @@ var BlockBlobClient = /** @class */ (function (_super) { BlockBlobClient.prototype.uploadFile = function (filePath, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, size, e_25; + var _a, span, spanOptions, size, e_31; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -23467,7 +28303,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 2: size = (_b.sent()).size; return [4 /*yield*/, this.uploadResetableStream(function (offset, count) { - return fs.createReadStream(filePath, { + return fsCreateReadStream(filePath, { autoClose: true, end: count ? offset + count - 1 : Infinity, start: offset @@ -23475,12 +28311,12 @@ var BlockBlobClient = /** @class */ (function (_super) { }, size, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; case 3: return [2 /*return*/, _b.sent()]; case 4: - e_25 = _b.sent(); + e_31 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_25.message + message: e_31.message }); - throw e_25; + throw e_31; case 5: span.end(); return [7 /*endfinally*/]; @@ -23511,7 +28347,7 @@ var BlockBlobClient = /** @class */ (function (_super) { if (maxConcurrency === void 0) { maxConcurrency = 5; } if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, blockNum_1, blockIDPrefix_2, transferProgress_3, blockList_2, scheduler, e_26; + var _a, span, spanOptions, blockNum_1, blockIDPrefix_2, transferProgress_3, blockList_2, scheduler, e_32; var _this = this; return tslib.__generator(this, function (_b) { switch (_b.label) { @@ -23530,7 +28366,7 @@ var BlockBlobClient = /** @class */ (function (_super) { blockIDPrefix_2 = coreHttp.generateUuid(); transferProgress_3 = 0; blockList_2 = []; - scheduler = new BufferScheduler(stream, bufferSize, maxConcurrency, function (buffer) { return tslib.__awaiter(_this, void 0, void 0, function () { + scheduler = new BufferScheduler(stream, bufferSize, maxConcurrency, function (body, length) { return tslib.__awaiter(_this, void 0, void 0, function () { var blockID; return tslib.__generator(this, function (_a) { switch (_a.label) { @@ -23538,7 +28374,7 @@ var BlockBlobClient = /** @class */ (function (_super) { blockID = generateBlockID(blockIDPrefix_2, blockNum_1); blockList_2.push(blockID); blockNum_1++; - return [4 /*yield*/, this.stageBlock(blockID, buffer, buffer.length, { + return [4 /*yield*/, this.stageBlock(blockID, body, length, { conditions: options.conditions, encryptionScope: options.encryptionScope, tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) @@ -23546,7 +28382,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 1: _a.sent(); // Update progress after block is successfully uploaded to server, in case of block trying - transferProgress_3 += buffer.length; + transferProgress_3 += length; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress_3 }); } @@ -23565,12 +28401,12 @@ var BlockBlobClient = /** @class */ (function (_super) { return [4 /*yield*/, this.commitBlockList(blockList_2, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; case 3: return [2 /*return*/, _b.sent()]; case 4: - e_26 = _b.sent(); + e_32 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_26.message + message: e_32.message }); - throw e_26; + throw e_32; case 5: span.end(); return [7 /*endfinally*/]; @@ -23601,7 +28437,7 @@ var BlockBlobClient = /** @class */ (function (_super) { BlockBlobClient.prototype.uploadResetableStream = function (streamFactory, size, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, numBlocks_2, blockList_3, blockIDPrefix_3, transferProgress_4, batch, _loop_3, i, e_27; + var _a, span, spanOptions, numBlocks_2, blockList_3, blockIDPrefix_3, transferProgress_4, batch, _loop_3, i, e_33; var _this = this; return tslib.__generator(this, function (_b) { switch (_b.label) { @@ -23691,12 +28527,12 @@ var BlockBlobClient = /** @class */ (function (_super) { return [4 /*yield*/, this.commitBlockList(blockList_3, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; case 5: return [2 /*return*/, _b.sent()]; case 6: - e_27 = _b.sent(); + e_33 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_27.message + message: e_33.message }); - throw e_27; + throw e_33; case 7: span.end(); return [7 /*endfinally*/]; @@ -23800,17 +28636,18 @@ var PageBlobClient = /** @class */ (function (_super) { * @memberof PageBlobClient */ PageBlobClient.prototype.create = function (size, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_28; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_34; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("PageBlobClient-create", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-create", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.pageBlobContext.create(0, size, { abortSignal: options.abortSignal, @@ -23818,20 +28655,72 @@ var PageBlobClient = /** @class */ (function (_super) { blobSequenceNumber: options.blobSequenceNumber, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), + blobTagsString: toBlobTagsString(options.tags), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_28 = _b.sent(); + e_34 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_28.message + message: e_34.message }); - throw e_28; + throw e_34; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + /** + * Creates a page blob of the specified length. Call uploadPages to upload data + * data to a page blob. If the blob with the same name already exists, the content + * of the existing blob will remain unchanged. + * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * + * @param {number} size size of the page blob. + * @param {PageBlobCreateIfNotExistsOptions} [options] + * @returns {Promise} + * @memberof PageBlobClient + */ + PageBlobClient.prototype.createIfNotExists = function (size, options) { + var _a, _b; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _c, span, spanOptions, conditions, res, e_35; + return tslib.__generator(this, function (_d) { + switch (_d.label) { + case 0: + _c = createSpan("PageBlobClient-createIfNotExists", options.tracingOptions), span = _c.span, spanOptions = _c.spanOptions; + _d.label = 1; + case 1: + _d.trys.push([1, 3, 4, 5]); + conditions = { ifNoneMatch: ETagAny }; + return [4 /*yield*/, this.create(size, tslib.__assign(tslib.__assign({}, options), { conditions: conditions, tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; + case 2: + res = _d.sent(); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable + })]; + case 3: + e_35 = _d.sent(); + if (((_a = e_35.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { + span.setStatus({ + code: api.CanonicalCode.ALREADY_EXISTS, + message: "Expected exception when creating a blob only if it does not already exist." + }); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_35.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_35.response })]; + } + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_35.message + }); + throw e_35; case 4: span.end(); return [7 /*endfinally*/]; @@ -23852,22 +28741,23 @@ var PageBlobClient = /** @class */ (function (_super) { * @memberof PageBlobClient */ PageBlobClient.prototype.uploadPages = function (body, offset, count, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_29; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_36; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("PageBlobClient-uploadPages", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-uploadPages", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.pageBlobContext.uploadPages(body, count, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), onUploadProgress: options.onProgress, range: rangeToString({ offset: offset, count: count }), sequenceNumberAccessConditions: options.conditions, @@ -23877,14 +28767,14 @@ var PageBlobClient = /** @class */ (function (_super) { encryptionScope: options.encryptionScope, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_29 = _b.sent(); + e_36 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_29.message + message: e_36.message }); - throw e_29; + throw e_36; case 4: span.end(); return [7 /*endfinally*/]; @@ -23907,18 +28797,19 @@ var PageBlobClient = /** @class */ (function (_super) { * @memberof PageBlobClient */ PageBlobClient.prototype.uploadPagesFromURL = function (sourceURL, sourceOffset, destOffset, count, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_30; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_37; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - _a = createSpan("PageBlobClient-uploadPagesFromURL", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-uploadPagesFromURL", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return [4 /*yield*/, this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count: count }), 0, rangeToString({ offset: destOffset, count: count }), { abortSignal: options.abortSignal, @@ -23926,7 +28817,7 @@ var PageBlobClient = /** @class */ (function (_super) { sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, sequenceNumberAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, @@ -23937,14 +28828,14 @@ var PageBlobClient = /** @class */ (function (_super) { encryptionScope: options.encryptionScope, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_30 = _b.sent(); + e_37 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_30.message + message: e_37.message }); - throw e_30; + throw e_37; case 4: span.end(); return [7 /*endfinally*/]; @@ -23964,36 +28855,37 @@ var PageBlobClient = /** @class */ (function (_super) { * @memberof PageBlobClient */ PageBlobClient.prototype.clearPages = function (offset, count, options) { + var _a; if (offset === void 0) { offset = 0; } if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_31; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_38; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("PageBlobClient-clearPages", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-clearPages", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.pageBlobContext.clearPages(0, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), range: rangeToString({ offset: offset, count: count }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_31 = _b.sent(); + e_38 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_31.message + message: e_38.message }); - throw e_31; + throw e_38; case 4: span.end(); return [7 /*endfinally*/]; @@ -24013,35 +28905,36 @@ var PageBlobClient = /** @class */ (function (_super) { * @memberof PageBlobClient */ PageBlobClient.prototype.getPageRanges = function (offset, count, options) { + var _a; if (offset === void 0) { offset = 0; } if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_32; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_39; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("PageBlobClient-getPageRanges", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-getPageRanges", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.pageBlobContext .getPageRanges({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), range: rangeToString({ offset: offset, count: count }), spanOptions: spanOptions }) .then(rangeResponseFromModel)]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_32 = _b.sent(); + e_39 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_32.message + message: e_39.message }); - throw e_32; + throw e_39; case 4: span.end(); return [7 /*endfinally*/]; @@ -24056,41 +28949,42 @@ var PageBlobClient = /** @class */ (function (_super) { * * @param {number} offset Starting byte position of the page blob * @param {number} count Number of bytes to get ranges diff. - * @param {string} prevSnapshot Timestamp of snapshot to retrive the difference. + * @param {string} prevSnapshot Timestamp of snapshot to retrieve the difference. * @param {PageBlobGetPageRangesDiffOptions} [options] Options to the Page Blob Get Page Ranges Diff operation. * @returns {Promise} Response data for the Page Blob Get Page Range Diff operation. * @memberof PageBlobClient */ PageBlobClient.prototype.getPageRangesDiff = function (offset, count, prevSnapshot, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_33; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_40; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("PageBlobClient-getPageRangesDiff", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-getPageRangesDiff", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.pageBlobContext .getPageRangesDiff({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), prevsnapshot: prevSnapshot, range: rangeToString({ offset: offset, count: count }), spanOptions: spanOptions }) .then(rangeResponseFromModel)]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_33 = _b.sent(); + e_40 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_33.message + message: e_40.message }); - throw e_33; + throw e_40; case 4: span.end(); return [7 /*endfinally*/]; @@ -24105,41 +28999,42 @@ var PageBlobClient = /** @class */ (function (_super) { * * @param {number} offset Starting byte position of the page blob * @param {number} count Number of bytes to get ranges diff. - * @param {string} prevSnapshotUrl URL of snapshot to retrive the difference. + * @param {string} prevSnapshotUrl URL of snapshot to retrieve the difference. * @param {PageBlobGetPageRangesDiffOptions} [options] Options to the Page Blob Get Page Ranges Diff operation. * @returns {Promise} Response data for the Page Blob Get Page Range Diff operation. * @memberof PageBlobClient */ PageBlobClient.prototype.getPageRangesDiffForManagedDisks = function (offset, count, prevSnapshotUrl, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_34; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_41; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.pageBlobContext .getPageRangesDiff({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), prevSnapshotUrl: prevSnapshotUrl, range: rangeToString({ offset: offset, count: count }), spanOptions: spanOptions }) .then(rangeResponseFromModel)]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_34 = _b.sent(); + e_41 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_34.message + message: e_41.message }); - throw e_34; + throw e_41; case 4: span.end(); return [7 /*endfinally*/]; @@ -24158,32 +29053,33 @@ var PageBlobClient = /** @class */ (function (_super) { * @memberof PageBlobClient */ PageBlobClient.prototype.resize = function (size, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_35; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_42; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("PageBlobClient-resize", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-resize", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.pageBlobContext.resize(size, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), encryptionScope: options.encryptionScope, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_35 = _b.sent(); + e_42 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_35.message + message: e_42.message }); - throw e_35; + throw e_42; case 4: span.end(); return [7 /*endfinally*/]; @@ -24203,32 +29099,33 @@ var PageBlobClient = /** @class */ (function (_super) { * @memberof PageBlobClient */ PageBlobClient.prototype.updateSequenceNumber = function (sequenceNumberAction, sequenceNumber, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_36; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_43; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: options.conditions = options.conditions || {}; - _a = createSpan("PageBlobClient-updateSequenceNumber", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-updateSequenceNumber", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.pageBlobContext.updateSequenceNumber(sequenceNumberAction, { abortSignal: options.abortSignal, blobSequenceNumber: sequenceNumber, leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_36 = _b.sent(); + e_43 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_36.message + message: e_43.message }); - throw e_36; + throw e_43; case 4: span.end(); return [7 /*endfinally*/]; @@ -24252,29 +29149,30 @@ var PageBlobClient = /** @class */ (function (_super) { * @memberof PageBlobClient */ PageBlobClient.prototype.startCopyIncremental = function (copySource, options) { + var _a; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_37; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _b, span, spanOptions, e_44; + return tslib.__generator(this, function (_c) { + switch (_c.label) { case 0: - _a = createSpan("PageBlobClient-startCopyIncremental", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _b = createSpan("PageBlobClient-startCopyIncremental", options.tracingOptions), span = _b.span, spanOptions = _b.spanOptions; + _c.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.pageBlobContext.copyIncremental(copySource, { abortSignal: options.abortSignal, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _c.sent()]; case 3: - e_37 = _b.sent(); + e_44 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_37.message + message: e_44.message }); - throw e_37; + throw e_44; case 4: span.end(); return [7 /*endfinally*/]; @@ -24302,9 +29200,11 @@ var BlobLeaseClient = /** @class */ (function () { var clientContext = new StorageClientContext(client.url, client.pipeline.toServiceClientOptions()); this._url = client.url; if (client instanceof ContainerClient) { + this._isContainer = true; this._containerOrBlobOperation = new Container(clientContext); } else { + this._isContainer = false; this._containerOrBlobOperation = new Blob$1(clientContext); } if (!leaseId) { @@ -24323,7 +29223,7 @@ var BlobLeaseClient = /** @class */ (function () { get: function () { return this._leaseId; }, - enumerable: true, + enumerable: false, configurable: true }); Object.defineProperty(BlobLeaseClient.prototype, "url", { @@ -24337,7 +29237,7 @@ var BlobLeaseClient = /** @class */ (function () { get: function () { return this._url; }, - enumerable: true, + enumerable: false, configurable: true }); /** @@ -24354,31 +29254,37 @@ var BlobLeaseClient = /** @class */ (function () { * @memberof BlobLeaseClient */ BlobLeaseClient.prototype.acquireLease = function (duration, options) { + var _a, _b, _c, _d, _e, _f; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_38; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _g, span, spanOptions, e_45; + return tslib.__generator(this, function (_h) { + switch (_h.label) { case 0: - _a = createSpan("BlobLeaseClient-acquireLease", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _g = createSpan("BlobLeaseClient-acquireLease", options.tracingOptions), span = _g.span, spanOptions = _g.spanOptions; + if (this._isContainer && + ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) || + (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { + throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + } + _h.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _h.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this._containerOrBlobOperation.acquireLease({ abortSignal: options.abortSignal, duration: duration, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }), proposedLeaseId: this._leaseId, spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _h.sent()]; case 3: - e_38 = _b.sent(); + e_45 = _h.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_38.message + message: e_45.message }); - throw e_38; + throw e_45; case 4: span.end(); return [7 /*endfinally*/]; @@ -24399,32 +29305,38 @@ var BlobLeaseClient = /** @class */ (function () { * @memberof BlobLeaseClient */ BlobLeaseClient.prototype.changeLease = function (proposedLeaseId, options) { + var _a, _b, _c, _d, _e, _f; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, response, e_39; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _g, span, spanOptions, response, e_46; + return tslib.__generator(this, function (_h) { + switch (_h.label) { case 0: - _a = createSpan("BlobLeaseClient-changeLease", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _g = createSpan("BlobLeaseClient-changeLease", options.tracingOptions), span = _g.span, spanOptions = _g.spanOptions; + if (this._isContainer && + ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) || + (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { + throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + } + _h.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _h.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId, { abortSignal: options.abortSignal, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }), spanOptions: spanOptions })]; case 2: - response = _b.sent(); + response = _h.sent(); this._leaseId = proposedLeaseId; return [2 /*return*/, response]; case 3: - e_39 = _b.sent(); + e_46 = _h.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_39.message + message: e_46.message }); - throw e_39; + throw e_46; case 4: span.end(); return [7 /*endfinally*/]; @@ -24445,29 +29357,35 @@ var BlobLeaseClient = /** @class */ (function () { * @memberof BlobLeaseClient */ BlobLeaseClient.prototype.releaseLease = function (options) { + var _a, _b, _c, _d, _e, _f; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_40; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _g, span, spanOptions, e_47; + return tslib.__generator(this, function (_h) { + switch (_h.label) { case 0: - _a = createSpan("BlobLeaseClient-releaseLease", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _g = createSpan("BlobLeaseClient-releaseLease", options.tracingOptions), span = _g.span, spanOptions = _g.spanOptions; + if (this._isContainer && + ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) || + (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { + throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + } + _h.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _h.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this._containerOrBlobOperation.releaseLease(this._leaseId, { abortSignal: options.abortSignal, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _h.sent()]; case 3: - e_40 = _b.sent(); + e_47 = _h.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_40.message + message: e_47.message }); - throw e_40; + throw e_47; case 4: span.end(); return [7 /*endfinally*/]; @@ -24487,29 +29405,35 @@ var BlobLeaseClient = /** @class */ (function () { * @memberof BlobLeaseClient */ BlobLeaseClient.prototype.renewLease = function (options) { + var _a, _b, _c, _d, _e, _f; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_41; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _g, span, spanOptions, e_48; + return tslib.__generator(this, function (_h) { + switch (_h.label) { case 0: - _a = createSpan("BlobLeaseClient-renewLease", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _g = createSpan("BlobLeaseClient-renewLease", options.tracingOptions), span = _g.span, spanOptions = _g.spanOptions; + if (this._isContainer && + ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) || + (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { + throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + } + _h.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _h.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this._containerOrBlobOperation.renewLease(this._leaseId, { abortSignal: options.abortSignal, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }), spanOptions: spanOptions })]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _h.sent()]; case 3: - e_41 = _b.sent(); + e_48 = _h.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_41.message + message: e_48.message }); - throw e_41; + throw e_48; case 4: span.end(); return [7 /*endfinally*/]; @@ -24532,31 +29456,37 @@ var BlobLeaseClient = /** @class */ (function () { * @memberof BlobLeaseClient */ BlobLeaseClient.prototype.breakLease = function (breakPeriod, options) { + var _a, _b, _c, _d, _e, _f; if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, operationOptions, e_42; - return tslib.__generator(this, function (_b) { - switch (_b.label) { + var _g, span, spanOptions, operationOptions, e_49; + return tslib.__generator(this, function (_h) { + switch (_h.label) { case 0: - _a = createSpan("BlobLeaseClient-breakLease", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; - _b.label = 1; + _g = createSpan("BlobLeaseClient-breakLease", options.tracingOptions), span = _g.span, spanOptions = _g.spanOptions; + if (this._isContainer && + ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) || + (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { + throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + } + _h.label = 1; case 1: - _b.trys.push([1, 3, 4, 5]); + _h.trys.push([1, 3, 4, 5]); operationOptions = { abortSignal: options.abortSignal, breakPeriod: breakPeriod, - modifiedAccessConditions: options.conditions, + modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }), spanOptions: spanOptions }; return [4 /*yield*/, this._containerOrBlobOperation.breakLease(operationOptions)]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: return [2 /*return*/, _h.sent()]; case 3: - e_42 = _b.sent(); + e_49 = _h.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_42.message + message: e_49.message }); - throw e_42; + throw e_49; case 4: span.end(); return [7 /*endfinally*/]; @@ -24638,7 +29568,7 @@ var ContainerClient = /** @class */ (function (_super) { get: function () { return this._containerName; }, - enumerable: true, + enumerable: false, configurable: true }); /** @@ -24661,7 +29591,7 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.create = function (options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_43; + var _a, span, spanOptions, e_50; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -24675,12 +29605,12 @@ var ContainerClient = /** @class */ (function (_super) { // this will filter out unwanted properties from the response object into result object return [2 /*return*/, _b.sent()]; case 3: - e_43 = _b.sent(); + e_50 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_43.message + message: e_50.message }); - throw e_43; + throw e_50; case 4: span.end(); return [7 /*endfinally*/]; @@ -24690,7 +29620,55 @@ var ContainerClient = /** @class */ (function (_super) { }); }; /** - * Returns true if the Azrue container resource represented by this client exists; false otherwise. + * Creates a new container under the specified account. If the container with + * the same name already exists, it is not changed. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * + * @param {ContainerCreateOptions} [options] + * @returns {Promise} + * @memberof ContainerClient + */ + ContainerClient.prototype.createIfNotExists = function (options) { + var _a, _b; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _c, span, spanOptions, res, e_51; + return tslib.__generator(this, function (_d) { + switch (_d.label) { + case 0: + _c = createSpan("ContainerClient-createIfNotExists", options.tracingOptions), span = _c.span, spanOptions = _c.spanOptions; + _d.label = 1; + case 1: + _d.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this.create(tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; + case 2: + res = _d.sent(); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable + })]; + case 3: + e_51 = _d.sent(); + if (((_a = e_51.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { + span.setStatus({ + code: api.CanonicalCode.ALREADY_EXISTS, + message: "Expected exception when creating a container only if it does not already exist." + }); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_51.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_51.response })]; + } + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_51.message + }); + throw e_51; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + /** + * Returns true if the Azure container resource represented by this client exists; false otherwise. * * NOTE: use this function with care since an existing container might be deleted by other clients or * applications. Vice versa new containers with the same name might be added by other clients or @@ -24703,7 +29681,7 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.exists = function (options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_44; + var _a, span, spanOptions, e_52; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -24719,8 +29697,8 @@ var ContainerClient = /** @class */ (function (_super) { _b.sent(); return [2 /*return*/, true]; case 3: - e_44 = _b.sent(); - if (e_44.statusCode === 404) { + e_52 = _b.sent(); + if (e_52.statusCode === 404) { span.setStatus({ code: api.CanonicalCode.NOT_FOUND, message: "Expected exception when checking container existence" @@ -24729,9 +29707,9 @@ var ContainerClient = /** @class */ (function (_super) { } span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_44.message + message: e_52.message }); - throw e_44; + throw e_52; case 4: span.end(); return [7 /*endfinally*/]; @@ -24806,7 +29784,7 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.getProperties = function (options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_45; + var _a, span, spanOptions, e_53; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -24820,12 +29798,12 @@ var ContainerClient = /** @class */ (function (_super) { return [4 /*yield*/, this.containerContext.getProperties(tslib.__assign(tslib.__assign({ abortSignal: options.abortSignal }, options.conditions), { spanOptions: spanOptions }))]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_45 = _b.sent(); + e_53 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_45.message + message: e_53.message }); - throw e_45; + throw e_53; case 4: span.end(); return [7 /*endfinally*/]; @@ -24846,18 +29824,13 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.delete = function (options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_46; + var _a, span, spanOptions, e_54; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: if (!options.conditions) { options.conditions = {}; } - if ((options.conditions.ifMatch && options.conditions.ifMatch !== ETagNone) || - (options.conditions.ifNoneMatch && options.conditions.ifNoneMatch !== ETagNone)) { - throw new RangeError("the IfMatch and IfNoneMatch access conditions must have their default\ - values because they are ignored by the service"); - } _a = createSpan("ContainerClient-delete", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; _b.label = 1; case 1: @@ -24870,12 +29843,60 @@ var ContainerClient = /** @class */ (function (_super) { })]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_46 = _b.sent(); + e_54 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_46.message + message: e_54.message }); - throw e_46; + throw e_54; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + /** + * Marks the specified container for deletion if it exists. The container and any blobs + * contained within it are later deleted during garbage collection. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * + * @param {ContainerDeleteMethodOptions} [options] Options to Container Delete operation. + * @returns {Promise} + * @memberof ContainerClient + */ + ContainerClient.prototype.deleteIfExists = function (options) { + var _a, _b; + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _c, span, spanOptions, res, e_55; + return tslib.__generator(this, function (_d) { + switch (_d.label) { + case 0: + _c = createSpan("ContainerClient-deleteIfExists", options.tracingOptions), span = _c.span, spanOptions = _c.spanOptions; + _d.label = 1; + case 1: + _d.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this.delete(tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; + case 2: + res = _d.sent(); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable + })]; + case 3: + e_55 = _d.sent(); + if (((_a = e_55.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { + span.setStatus({ + code: api.CanonicalCode.NOT_FOUND, + message: "Expected exception when deleting a container only if it exists." + }); + return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_55.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_55.response })]; + } + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_55.message + }); + throw e_55; case 4: span.end(); return [7 /*endfinally*/]; @@ -24901,18 +29922,15 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.setMetadata = function (metadata, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_47; + var _a, span, spanOptions, e_56; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: if (!options.conditions) { options.conditions = {}; } - if (options.conditions.ifUnmodifiedSince || - (options.conditions.ifMatch && options.conditions.ifMatch !== ETagNone) || - (options.conditions.ifNoneMatch && options.conditions.ifNoneMatch !== ETagNone)) { - throw new RangeError("the IfUnmodifiedSince, IfMatch, and IfNoneMatch must have their default values\ - because they are ignored by the blob service"); + if (options.conditions.ifUnmodifiedSince) { + throw new RangeError("the IfUnmodifiedSince must have their default values because they are ignored by the blob service"); } _a = createSpan("ContainerClient-setMetadata", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; _b.label = 1; @@ -24927,12 +29945,12 @@ var ContainerClient = /** @class */ (function (_super) { })]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_47 = _b.sent(); + e_56 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_47.message + message: e_56.message }); - throw e_47; + throw e_56; case 4: span.end(); return [7 /*endfinally*/]; @@ -24957,7 +29975,7 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.getAccessPolicy = function (options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, response, res, _i, response_1, identifier, accessPolicy, e_48; + var _a, span, spanOptions, response, res, _i, response_1, identifier, accessPolicy, e_57; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -25008,12 +30026,12 @@ var ContainerClient = /** @class */ (function (_super) { } return [2 /*return*/, res]; case 3: - e_48 = _b.sent(); + e_57 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_48.message + message: e_57.message }); - throw e_48; + throw e_57; case 4: span.end(); return [7 /*endfinally*/]; @@ -25044,7 +30062,7 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.setAccessPolicy = function (access, containerAcl, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, acl, _i, _b, identifier, e_49; + var _a, span, spanOptions, acl, _i, _b, identifier, e_58; return tslib.__generator(this, function (_c) { switch (_c.label) { case 0: @@ -25079,12 +30097,12 @@ var ContainerClient = /** @class */ (function (_super) { })]; case 2: return [2 /*return*/, _c.sent()]; case 3: - e_49 = _c.sent(); + e_58 = _c.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_49.message + message: e_58.message }); - throw e_49; + throw e_58; case 4: span.end(); return [7 /*endfinally*/]; @@ -25129,7 +30147,7 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.uploadBlockBlob = function (blobName, body, contentLength, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, blockBlobClient, response, e_50; + var _a, span, spanOptions, blockBlobClient, response, e_59; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -25146,12 +30164,12 @@ var ContainerClient = /** @class */ (function (_super) { response: response }]; case 3: - e_50 = _b.sent(); + e_59 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_50.message + message: e_59.message }); - throw e_50; + throw e_59; case 4: span.end(); return [7 /*endfinally*/]; @@ -25168,14 +30186,14 @@ var ContainerClient = /** @class */ (function (_super) { * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob * * @param {string} blobName - * @param {BlobDeleteOptions} [options] Options to Blob Delete operation. + * @param {ContainerDeleteBlobOptions} [options] Options to Blob Delete operation. * @returns {Promise} Block blob deletion response data. * @memberof ContainerClient */ ContainerClient.prototype.deleteBlob = function (blobName, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, blobClient, e_51; + var _a, span, spanOptions, blobClient, e_60; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -25184,15 +30202,18 @@ var ContainerClient = /** @class */ (function (_super) { case 1: _b.trys.push([1, 3, 4, 5]); blobClient = this.getBlobClient(blobName); + if (options.versionId) { + blobClient = blobClient.withVersion(options.versionId); + } return [4 /*yield*/, blobClient.delete(tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))]; case 2: return [2 /*return*/, _b.sent()]; case 3: - e_51 = _b.sent(); + e_60 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_51.message + message: e_60.message }); - throw e_51; + throw e_60; case 4: span.end(); return [7 /*endfinally*/]; @@ -25216,7 +30237,7 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.listBlobFlatSegment = function (marker, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_52; + var _a, span, spanOptions, response, wrappedResponse, e_61; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -25225,14 +30246,20 @@ var ContainerClient = /** @class */ (function (_super) { case 1: _b.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.containerContext.listBlobFlatSegment(tslib.__assign(tslib.__assign({ marker: marker }, options), { spanOptions: spanOptions }))]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: + response = _b.sent(); + wrappedResponse = tslib.__assign(tslib.__assign({}, response), { _response: response._response, segment: tslib.__assign(tslib.__assign({}, response.segment), { blobItems: response.segment.blobItems.map(function (blobItemInteral) { + var blobItem = tslib.__assign(tslib.__assign({}, blobItemInteral), { tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) }); + return blobItem; + }) }) }); + return [2 /*return*/, wrappedResponse]; case 3: - e_52 = _b.sent(); + e_61 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_52.message + message: e_61.message }); - throw e_52; + throw e_61; case 4: span.end(); return [7 /*endfinally*/]; @@ -25248,7 +30275,7 @@ var ContainerClient = /** @class */ (function (_super) { * again (passing the the previously-returned Marker) to get the next segment. * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs * - * @param {string} delimiter The charactor or string used to define the virtual hierarchy + * @param {string} delimiter The character or string used to define the virtual hierarchy * @param {string} [marker] A string value that identifies the portion of the list to be returned with the next list operation. * @param {ContainerListBlobsSegmentOptions} [options] Options to Container List Blob Hierarchy Segment operation. * @returns {Promise} @@ -25257,7 +30284,7 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.listBlobHierarchySegment = function (delimiter, marker, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, e_53; + var _a, span, spanOptions, response, wrappedResponse, e_62; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -25266,14 +30293,20 @@ var ContainerClient = /** @class */ (function (_super) { case 1: _b.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this.containerContext.listBlobHierarchySegment(delimiter, tslib.__assign(tslib.__assign({ marker: marker }, options), { spanOptions: spanOptions }))]; - case 2: return [2 /*return*/, _b.sent()]; + case 2: + response = _b.sent(); + wrappedResponse = tslib.__assign(tslib.__assign({}, response), { _response: response._response, segment: tslib.__assign(tslib.__assign({}, response.segment), { blobItems: response.segment.blobItems.map(function (blobItemInteral) { + var blobItem = tslib.__assign(tslib.__assign({}, blobItemInteral), { tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) }); + return blobItem; + }) }) }); + return [2 /*return*/, wrappedResponse]; case 3: - e_53 = _b.sent(); + e_62 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_53.message + message: e_62.message }); - throw e_53; + throw e_62; case 4: span.end(); return [7 /*endfinally*/]; @@ -25335,8 +30368,8 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.listItems = function (options) { if (options === void 0) { options = {}; } return tslib.__asyncGenerator(this, arguments, function listItems_1() { - var marker, _a, _b, listBlobsFlatSegmentResponse, e_54_1; - var e_54, _c; + var marker, _a, _b, listBlobsFlatSegmentResponse, e_63_1; + var e_63, _c; return tslib.__generator(this, function (_d) { switch (_d.label) { case 0: @@ -25355,8 +30388,8 @@ var ContainerClient = /** @class */ (function (_super) { case 5: return [3 /*break*/, 1]; case 6: return [3 /*break*/, 13]; case 7: - e_54_1 = _d.sent(); - e_54 = { error: e_54_1 }; + e_63_1 = _d.sent(); + e_63 = { error: e_63_1 }; return [3 /*break*/, 13]; case 8: _d.trys.push([8, , 11, 12]); @@ -25367,7 +30400,7 @@ var ContainerClient = /** @class */ (function (_super) { _d.label = 10; case 10: return [3 /*break*/, 12]; case 11: - if (e_54) throw e_54.error; + if (e_63) throw e_63.error; return [7 /*endfinally*/]; case 12: return [7 /*endfinally*/]; case 13: return [2 /*return*/]; @@ -25463,9 +30496,15 @@ var ContainerClient = /** @class */ (function (_super) { if (options.includeSnapshots) { include.push("snapshots"); } + if (options.includeVersions) { + include.push("versions"); + } if (options.includeUncommitedBlobs) { include.push("uncommittedblobs"); } + if (options.includeTags) { + include.push("tags"); + } if (options.prefix === "") { options.prefix = undefined; } @@ -25499,7 +30538,7 @@ var ContainerClient = /** @class */ (function (_super) { * Returns an AsyncIterableIterator for ContainerListBlobHierarchySegmentResponse * * @private - * @param {string} delimiter The charactor or string used to define the virtual hierarchy + * @param {string} delimiter The character or string used to define the virtual hierarchy * @param {string} [marker] A string value that identifies the portion of * the list of blobs to be returned with the next listing operation. The * operation returns the ContinuationToken value within the response body if the @@ -25510,7 +30549,8 @@ var ContainerClient = /** @class */ (function (_super) { * @param {ContainerListBlobsSegmentOptions} [options] Options to list blobs operation. * @returns {AsyncIterableIterator} * @memberof ContainerClient - */ ContainerClient.prototype.listHierarchySegments = function (delimiter, marker, options) { + */ + ContainerClient.prototype.listHierarchySegments = function (delimiter, marker, options) { if (options === void 0) { options = {}; } return tslib.__asyncGenerator(this, arguments, function listHierarchySegments_1() { var listBlobsHierarchySegmentResponse; @@ -25541,7 +30581,7 @@ var ContainerClient = /** @class */ (function (_super) { * Returns an AsyncIterableIterator for {@link BlobPrefix} and {@link BlobItem} objects. * * @private - * @param {string} delimiter The charactor or string used to define the virtual hierarchy + * @param {string} delimiter The character or string used to define the virtual hierarchy * @param {ContainerListBlobsSegmentOptions} [options] Options to list blobs operation. * @returns {AsyncIterableIterator<{ kind: "prefix" } & BlobPrefix | { kind: "blob" } & BlobItem>} * @memberof ContainerClient @@ -25549,8 +30589,8 @@ var ContainerClient = /** @class */ (function (_super) { ContainerClient.prototype.listItemsByHierarchy = function (delimiter, options) { if (options === void 0) { options = {}; } return tslib.__asyncGenerator(this, arguments, function listItemsByHierarchy_1() { - var marker, _a, _b, listBlobsHierarchySegmentResponse, segment, _i, _c, prefix, _d, _e, blob, e_55_1; - var e_55, _f; + var marker, _a, _b, listBlobsHierarchySegmentResponse, segment, _i, _c, prefix, _d, _e, blob, e_64_1; + var e_64, _f; return tslib.__generator(this, function (_g) { switch (_g.label) { case 0: @@ -25593,8 +30633,8 @@ var ContainerClient = /** @class */ (function (_super) { case 12: return [3 /*break*/, 1]; case 13: return [3 /*break*/, 20]; case 14: - e_55_1 = _g.sent(); - e_55 = { error: e_55_1 }; + e_64_1 = _g.sent(); + e_64 = { error: e_64_1 }; return [3 /*break*/, 20]; case 15: _g.trys.push([15, , 18, 19]); @@ -25605,7 +30645,7 @@ var ContainerClient = /** @class */ (function (_super) { _g.label = 17; case 17: return [3 /*break*/, 19]; case 18: - if (e_55) throw e_55.error; + if (e_64) throw e_64.error; return [7 /*endfinally*/]; case 19: return [7 /*endfinally*/]; case 20: return [2 /*return*/]; @@ -25634,7 +30674,7 @@ var ContainerClient = /** @class */ (function (_super) { * Example using `iter.next()`: * * ```js - * let iter = await containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); + * let iter = containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); * let entity = await iter.next(); * while (!entity.done) { * let item = entity.value; @@ -25686,7 +30726,7 @@ var ContainerClient = /** @class */ (function (_super) { * } * ``` * - * @param {string} delimiter The charactor or string used to define the virtual hierarchy + * @param {string} delimiter The character or string used to define the virtual hierarchy * @param {ContainerListBlobsOptions} [options={}] Options to list blobs operation. * @returns {(PagedAsyncIterableIterator< * { kind: "prefix" } & BlobPrefix | { kind: "blob" } & BlobItem, @@ -25698,6 +30738,9 @@ var ContainerClient = /** @class */ (function (_super) { var _a; var _this = this; if (options === void 0) { options = {}; } + if (delimiter === "") { + throw new RangeError("delimiter should contain one or more characters"); + } var include = []; if (options.includeCopy) { include.push("copy"); @@ -25711,9 +30754,15 @@ var ContainerClient = /** @class */ (function (_super) { if (options.includeSnapshots) { include.push("snapshots"); } + if (options.includeVersions) { + include.push("versions"); + } if (options.includeUncommitedBlobs) { include.push("uncommittedblobs"); } + if (options.includeTags) { + include.push("tags"); + } if (options.prefix === "") { options.prefix = undefined; } @@ -25758,15 +30807,21 @@ var ContainerClient = /** @class */ (function (_super) { var parsedUrl = coreHttp.URLBuilder.parse(this.url); if (parsedUrl.getHost().split(".")[1] === "blob") { // "https://myaccount.blob.core.windows.net/containername". + // "https://customdomain.com/containername". // .getPath() -> /containername containerName = parsedUrl.getPath().split("/")[1]; } - else { + else if (isIpEndpointStyle(parsedUrl)) { // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/containername // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/containername // .getPath() -> /devstoreaccount1/containername containerName = parsedUrl.getPath().split("/")[2]; } + else { + // "https://customdomain.com/containername". + // .getPath() -> /containername + containerName = parsedUrl.getPath().split("/")[1]; + } // decode the encoded containerName - to get all the special characters that might be present in it containerName = decodeURIComponent(containerName); if (!containerName) { @@ -26235,7 +31290,7 @@ var InnerBatchRequest = /** @class */ (function () { this.subRequests = new Map(); } /** - * Create pipeline to assemble sub requests. The idea here is to use exising + * Create pipeline to assemble sub requests. The idea here is to use existing * credential and serialization/deserialization components, with additional policies to * filter unnecessary headers, assemble sub requests into request's body * and intercept request from going to wire. @@ -26243,7 +31298,7 @@ var InnerBatchRequest = /** @class */ (function () { */ InnerBatchRequest.prototype.createPipeline = function (credential) { var isAnonymousCreds = credential instanceof AnonymousCredential; - var policyFactoryLength = 3 + (isAnonymousCreds ? 0 : 1); // [deserilizationPolicy, BatchHeaderFilterPolicyFactory, (Optional)Credential, BatchRequestAssemblePolicyFactory] + var policyFactoryLength = 3 + (isAnonymousCreds ? 0 : 1); // [deserializationPolicy, BatchHeaderFilterPolicyFactory, (Optional)Credential, BatchRequestAssemblePolicyFactory] var factories = new Array(policyFactoryLength); factories[0] = coreHttp.deserializationPolicy(); // Default deserializationPolicy is provided by protocol layer factories[1] = new BatchHeaderFilterPolicyFactory(); // Use batch header filter policy to exclude unnecessary headers @@ -26887,7 +31942,7 @@ var BlobServiceClient = /** @class */ (function (_super) { _b.label = 1; case 1: _b.trys.push([1, 3, 4, 5]); - return [4 /*yield*/, this.serviceContext.listContainersSegment(tslib.__assign(tslib.__assign({ abortSignal: options.abortSignal, marker: marker }, options), { spanOptions: spanOptions }))]; + return [4 /*yield*/, this.serviceContext.listContainersSegment(tslib.__assign(tslib.__assign({ abortSignal: options.abortSignal, marker: marker }, options), { include: typeof options.include === "string" ? [options.include] : options.include, spanOptions: spanOptions }))]; case 2: return [2 /*return*/, _b.sent()]; case 3: e_7 = _b.sent(); @@ -26904,6 +31959,273 @@ var BlobServiceClient = /** @class */ (function (_super) { }); }); }; + /** + * The Filter Blobs operation enables callers to list blobs across all containers whose tags + * match a given search expression. Filter blobs searches across all containers within a + * storage account but can be scoped within the expression to a single container. + * + * @private + * @param {string} tagFilterSqlExpression The where parameter enables the caller to query blobs whose tags match a given expression. + * The given expression must evaluate to true for a blob to be returned in the results. + * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; + * however, only a subset of the OData filter syntax is supported in the Blob service. + * @param {string} [marker] A string value that identifies the portion of + * the list of blobs to be returned with the next listing operation. The + * operation returns the NextMarker value within the response body if the + * listing operation did not return all blobs remaining to be listed + * with the current page. The NextMarker value can be used as the value for + * the marker parameter in a subsequent call to request the next page of list + * items. The marker value is opaque to the client. + * @param {ServiceFindBlobsByTagsSegmentOptions} [options={}] Options to find blobs by tags. + * @returns {Promise} + * @memberof BlobServiceClient + */ + BlobServiceClient.prototype.findBlobsByTagsSegment = function (tagFilterSqlExpression, marker, options) { + if (options === void 0) { options = {}; } + return tslib.__awaiter(this, void 0, void 0, function () { + var _a, span, spanOptions, e_8; + return tslib.__generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = createSpan("BlobServiceClient-findBlobsByTagsSegment", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions; + _b.label = 1; + case 1: + _b.trys.push([1, 3, 4, 5]); + return [4 /*yield*/, this.serviceContext.filterBlobs({ + abortSignal: options.abortSignal, + where: tagFilterSqlExpression, + marker: marker, + maxPageSize: options.maxPageSize, + spanOptions: spanOptions + })]; + case 2: return [2 /*return*/, _b.sent()]; + case 3: + e_8 = _b.sent(); + span.setStatus({ + code: api.CanonicalCode.UNKNOWN, + message: e_8.message + }); + throw e_8; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + /** + * Returns an AsyncIterableIterator for ServiceFindBlobsByTagsSegmentResponse. + * + * @private + * @param {string} tagFilterSqlExpression The where parameter enables the caller to query blobs whose tags match a given expression. + * The given expression must evaluate to true for a blob to be returned in the results. + * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; + * however, only a subset of the OData filter syntax is supported in the Blob service. + * @param {string} [marker] A string value that identifies the portion of + * the list of blobs to be returned with the next listing operation. The + * operation returns the NextMarker value within the response body if the + * listing operation did not return all blobs remaining to be listed + * with the current page. The NextMarker value can be used as the value for + * the marker parameter in a subsequent call to request the next page of list + * items. The marker value is opaque to the client. + * @param {ServiceFindBlobsByTagsSegmentOptions} [options={}] Options to find blobs by tags. + * @returns {AsyncIterableIterator} + * @memberof BlobServiceClient + */ + BlobServiceClient.prototype.findBlobsByTagsSegments = function (tagFilterSqlExpression, marker, options) { + if (options === void 0) { options = {}; } + return tslib.__asyncGenerator(this, arguments, function findBlobsByTagsSegments_1() { + var response; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(!!marker || marker === undefined)) return [3 /*break*/, 6]; + _a.label = 1; + case 1: return [4 /*yield*/, tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options))]; + case 2: + response = _a.sent(); + response.blobs = response.blobs || []; + marker = response.continuationToken; + return [4 /*yield*/, tslib.__await(response)]; + case 3: return [4 /*yield*/, _a.sent()]; + case 4: + _a.sent(); + _a.label = 5; + case 5: + if (marker) return [3 /*break*/, 1]; + _a.label = 6; + case 6: return [2 /*return*/]; + } + }); + }); + }; + /** + * Returns an AsyncIterableIterator for blobs. + * + * @private + * @param {string} tagFilterSqlExpression The where parameter enables the caller to query blobs whose tags match a given expression. + * The given expression must evaluate to true for a blob to be returned in the results. + * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; + * however, only a subset of the OData filter syntax is supported in the Blob service. + * @param {ServiceFindBlobsByTagsSegmentOptions} [options={}] Options to findBlobsByTagsItems. + * @returns {AsyncIterableIterator} + * @memberof BlobServiceClient + */ + BlobServiceClient.prototype.findBlobsByTagsItems = function (tagFilterSqlExpression, options) { + if (options === void 0) { options = {}; } + return tslib.__asyncGenerator(this, arguments, function findBlobsByTagsItems_1() { + var marker, _a, _b, segment, e_9_1; + var e_9, _c; + return tslib.__generator(this, function (_d) { + switch (_d.label) { + case 0: + _d.trys.push([0, 7, 8, 13]); + _a = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)); + _d.label = 1; + case 1: return [4 /*yield*/, tslib.__await(_a.next())]; + case 2: + if (!(_b = _d.sent(), !_b.done)) return [3 /*break*/, 6]; + segment = _b.value; + return [5 /*yield**/, tslib.__values(tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs)))]; + case 3: return [4 /*yield*/, tslib.__await.apply(void 0, [_d.sent()])]; + case 4: + _d.sent(); + _d.label = 5; + case 5: return [3 /*break*/, 1]; + case 6: return [3 /*break*/, 13]; + case 7: + e_9_1 = _d.sent(); + e_9 = { error: e_9_1 }; + return [3 /*break*/, 13]; + case 8: + _d.trys.push([8, , 11, 12]); + if (!(_b && !_b.done && (_c = _a.return))) return [3 /*break*/, 10]; + return [4 /*yield*/, tslib.__await(_c.call(_a))]; + case 9: + _d.sent(); + _d.label = 10; + case 10: return [3 /*break*/, 12]; + case 11: + if (e_9) throw e_9.error; + return [7 /*endfinally*/]; + case 12: return [7 /*endfinally*/]; + case 13: return [2 /*return*/]; + } + }); + }); + }; + /** + * Returns an async iterable iterator to find all blobs with specified tag + * under the specified account. + * + * .byPage() returns an async iterable iterator to list the blobs in pages. + * + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * + * Example using `for await` syntax: + * + * ```js + * let i = 1; + * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) { + * console.log(`Blob ${i++}: ${container.name}`); + * } + * ``` + * + * Example using `iter.next()`: + * + * ```js + * let i = 1; + * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); + * let blobItem = await iter.next(); + * while (!blobItem.done) { + * console.log(`Blob ${i++}: ${blobItem.value.name}`); + * blobItem = await iter.next(); + * } + * ``` + * + * Example using `byPage()`: + * + * ```js + * // passing optional maxPageSize in the page settings + * let i = 1; + * for await (const response of blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { + * if (response.blobs) { + * for (const blob of response.blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } + * } + * } + * ``` + * + * Example using paging with a marker: + * + * ```js + * let i = 1; + * let iterator = blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 }); + * let response = (await iterator.next()).value; + * + * // Prints 2 blob names + * if (response.blobs) { + * for (const blob of response.blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } + * } + * + * // Gets next marker + * let marker = response.continuationToken; + * // Passing next marker as continuationToken + * iterator = blobServiceClient + * .findBlobsByTags("tagkey='tagvalue'") + * .byPage({ continuationToken: marker, maxPageSize: 10 }); + * response = (await iterator.next()).value; + * + * // Prints blob names + * if (response.blobs) { + * for (const blob of response.blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } + * } + * ``` + * + * @param {string} tagFilterSqlExpression The where parameter enables the caller to query blobs whose tags match a given expression. + * The given expression must evaluate to true for a blob to be returned in the results. + * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; + * however, only a subset of the OData filter syntax is supported in the Blob service. + * @param {ServiceFindBlobByTagsOptions} [options={}] Options to find blobs by tags. + * @returns {PagedAsyncIterableIterator} + * @memberof BlobServiceClient + */ + BlobServiceClient.prototype.findBlobsByTags = function (tagFilterSqlExpression, options) { + var _a; + var _this = this; + if (options === void 0) { options = {}; } + // AsyncIterableIterator to iterate over blobs + var listSegmentOptions = tslib.__assign({}, options); + var iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); + return _a = { + /** + * @member {Promise} [next] The next method, part of the iteration protocol + */ + next: function () { + return iter.next(); + } + }, + /** + * @member {Symbol} [asyncIterator] The connection to the async iterator, part of the iteration protocol + */ + _a[Symbol.asyncIterator] = function () { + return this; + }, + /** + * @member {Function} [byPage] Return an AsyncIterableIterator that works a page at a time + */ + _a.byPage = function (settings) { + if (settings === void 0) { settings = {}; } + return _this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, tslib.__assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + }, + _a; + }; /** * Returns an AsyncIterableIterator for ServiceListContainersSegmentResponses * @@ -26959,8 +32281,8 @@ var BlobServiceClient = /** @class */ (function (_super) { BlobServiceClient.prototype.listItems = function (options) { if (options === void 0) { options = {}; } return tslib.__asyncGenerator(this, arguments, function listItems_1() { - var marker, _a, _b, segment, e_8_1; - var e_8, _c; + var marker, _a, _b, segment, e_10_1; + var e_10, _c; return tslib.__generator(this, function (_d) { switch (_d.label) { case 0: @@ -26979,8 +32301,8 @@ var BlobServiceClient = /** @class */ (function (_super) { case 5: return [3 /*break*/, 1]; case 6: return [3 /*break*/, 13]; case 7: - e_8_1 = _d.sent(); - e_8 = { error: e_8_1 }; + e_10_1 = _d.sent(); + e_10 = { error: e_10_1 }; return [3 /*break*/, 13]; case 8: _d.trys.push([8, , 11, 12]); @@ -26991,7 +32313,7 @@ var BlobServiceClient = /** @class */ (function (_super) { _d.label = 10; case 10: return [3 /*break*/, 12]; case 11: - if (e_8) throw e_8.error; + if (e_10) throw e_10.error; return [7 /*endfinally*/]; case 12: return [7 /*endfinally*/]; case 13: return [2 /*return*/]; @@ -27123,7 +32445,7 @@ var BlobServiceClient = /** @class */ (function (_super) { BlobServiceClient.prototype.getUserDelegationKey = function (startsOn, expiresOn, options) { if (options === void 0) { options = {}; } return tslib.__awaiter(this, void 0, void 0, function () { - var _a, span, spanOptions, response, userDelegationKey, res, e_9; + var _a, span, spanOptions, response, userDelegationKey, res, e_11; return tslib.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -27152,12 +32474,12 @@ var BlobServiceClient = /** @class */ (function (_super) { res = tslib.__assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey); return [2 /*return*/, res]; case 3: - e_9 = _b.sent(); + e_11 = _b.sent(); span.setStatus({ code: api.CanonicalCode.UNKNOWN, - message: e_9.message + message: e_11.message }); - throw e_9; + throw e_11; case 4: span.end(); return [7 /*endfinally*/]; @@ -27217,6 +32539,13 @@ var AccountSASPermissions = /** @class */ (function () { * @memberof AccountSASPermissions */ this.delete = false; + /** + * Permission to delete versions granted. + * + * @type {boolean} + * @memberof AccountSASPermissions + */ + this.deleteVersion = false; /** * Permission to list blob containers, blobs, shares, directories, and files granted. * @@ -27252,6 +32581,20 @@ var AccountSASPermissions = /** @class */ (function () { * @memberof AccountSASPermissions */ this.process = false; + /** + * Specfies Tag access granted. + * + * @type {boolean} + * @memberof AccountSASPermissions + */ + this.tag = false; + /** + * Permission to filter blobs. + * + * @type {boolean} + * @memberof AccountSASPermissions + */ + this.filter = false; } /** * Parse initializes the AccountSASPermissions fields from a string. @@ -27275,6 +32618,9 @@ var AccountSASPermissions = /** @class */ (function () { case "d": accountSASPermissions.delete = true; break; + case "x": + accountSASPermissions.deleteVersion = true; + break; case "l": accountSASPermissions.list = true; break; @@ -27290,6 +32636,12 @@ var AccountSASPermissions = /** @class */ (function () { case "p": accountSASPermissions.process = true; break; + case "t": + accountSASPermissions.tag = true; + break; + case "f": + accountSASPermissions.filter = true; + break; default: throw new RangeError("Invalid permission character: " + c); } @@ -27322,6 +32674,15 @@ var AccountSASPermissions = /** @class */ (function () { if (this.delete) { permissions.push("d"); } + if (this.deleteVersion) { + permissions.push("x"); + } + if (this.filter) { + permissions.push("f"); + } + if (this.tag) { + permissions.push("t"); + } if (this.list) { permissions.push("l"); } @@ -27615,7 +32976,7 @@ var SASQueryParameters = /** @class */ (function () { this.contentType = contentType; if (userDelegationKey) { this.signedOid = userDelegationKey.signedObjectId; - this.signedTenentId = userDelegationKey.signedTenantId; + this.signedTenantId = userDelegationKey.signedTenantId; this.signedStartsOn = userDelegationKey.signedStartsOn; this.signedExpiresOn = userDelegationKey.signedExpiresOn; this.signedService = userDelegationKey.signedService; @@ -27639,7 +33000,7 @@ var SASQueryParameters = /** @class */ (function () { } return undefined; }, - enumerable: true, + enumerable: false, configurable: true }); /** @@ -27705,7 +33066,7 @@ var SASQueryParameters = /** @class */ (function () { this.tryAppendQueryParameter(queries, param, this.signedOid); break; case "sktid": // Signed tenant ID - this.tryAppendQueryParameter(queries, param, this.signedTenentId); + this.tryAppendQueryParameter(queries, param, this.signedTenantId); break; case "skt": // Signed key start time this.tryAppendQueryParameter(queries, param, this.signedStartsOn ? truncatedISO8061Date(this.signedStartsOn, false) : undefined); @@ -27788,6 +33149,21 @@ function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyC var version = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; + if (accountSASSignatureValues.permissions && + accountSASSignatureValues.permissions.deleteVersion && + version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission."); + } + if (accountSASSignatureValues.permissions && + accountSASSignatureValues.permissions.tag && + version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission."); + } + if (accountSASSignatureValues.permissions && + accountSASSignatureValues.permissions.filter && + version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission."); + } var parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); var parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); var parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); @@ -27860,6 +33236,20 @@ var BlobSASPermissions = /** @class */ (function () { * @memberof BlobSASPermissions */ this.delete = false; + /** + * Specifies Delete version access granted. + * + * @type {boolean} + * @memberof BlobSASPermissions + */ + this.deleteVersion = false; + /** + * Specfies Tag access granted. + * + * @type {boolean} + * @memberof BlobSASPermissions + */ + this.tag = false; } /** * Creates a {@link BlobSASPermissions} from the specified permissions string. This method will throw an @@ -27890,6 +33280,12 @@ var BlobSASPermissions = /** @class */ (function () { case "d": blobSASPermissions.delete = true; break; + case "x": + blobSASPermissions.deleteVersion = true; + break; + case "t": + blobSASPermissions.tag = true; + break; default: throw new RangeError("Invalid permission: " + char); } @@ -27920,6 +33316,12 @@ var BlobSASPermissions = /** @class */ (function () { if (this.delete) { permissions.push("d"); } + if (this.deleteVersion) { + permissions.push("x"); + } + if (this.tag) { + permissions.push("t"); + } return permissions.join(""); }; return BlobSASPermissions; @@ -27974,6 +33376,13 @@ var ContainerSASPermissions = /** @class */ (function () { * @memberof ContainerSASPermissions */ this.delete = false; + /** + * Specifies Delete version access granted. + * + * @type {boolean} + * @memberof ContainerSASPermissions + */ + this.deleteVersion = false; /** * Specifies List access granted. * @@ -27981,6 +33390,13 @@ var ContainerSASPermissions = /** @class */ (function () { * @memberof ContainerSASPermissions */ this.list = false; + /** + * Specfies Tag access granted. + * + * @type {boolean} + * @memberof ContainerSASPermissions + */ + this.tag = false; } /** * Creates an {@link ContainerSASPermissions} from the specified permissions string. This method will throw an @@ -28014,6 +33430,12 @@ var ContainerSASPermissions = /** @class */ (function () { case "l": containerSASPermissions.list = true; break; + case "t": + containerSASPermissions.tag = true; + break; + case "x": + containerSASPermissions.deleteVersion = true; + break; default: throw new RangeError("Invalid permission " + char); } @@ -28047,9 +33469,15 @@ var ContainerSASPermissions = /** @class */ (function () { if (this.delete) { permissions.push("d"); } + if (this.deleteVersion) { + permissions.push("x"); + } if (this.list) { permissions.push("l"); } + if (this.tag) { + permissions.push("t"); + } return permissions.join(""); }; return ContainerSASPermissions; @@ -28105,6 +33533,7 @@ function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredent if (sharedKeyCredential === undefined && userDelegationKeyCredential === undefined) { throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); } + // Version 2019-12-12 adds support for the blob tags permission. // Version 2018-11-09 adds support for the signed resource and signed blob snapshot time fields. // https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas#constructing-the-signature-string if (version >= "2018-11-09") { @@ -28144,7 +33573,8 @@ function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredent */ function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential) { if (!blobSASSignatureValues.identifier && - !blobSASSignatureValues.permissions && !blobSASSignatureValues.expiresOn) { + !blobSASSignatureValues.permissions && + !blobSASSignatureValues.expiresOn) { throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); } var version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; @@ -28153,6 +33583,19 @@ function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKe if (blobSASSignatureValues.snapshotTime) { throw RangeError("'version' must be >= '2018-11-09' when provided 'snapshotTime'."); } + if (blobSASSignatureValues.versionId) { + throw RangeError("'version' must be >= '2019-10-10' when provided 'versionId'."); + } + if (blobSASSignatureValues.permissions && + blobSASSignatureValues.permissions.deleteVersion && + version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission."); + } + if (blobSASSignatureValues.permissions && + blobSASSignatureValues.permissions.tag && + version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission."); + } if (blobSASSignatureValues.blobName) { resource = "b"; } @@ -28207,20 +33650,42 @@ function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKe */ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential) { if (!blobSASSignatureValues.identifier && - !blobSASSignatureValues.permissions && !blobSASSignatureValues.expiresOn) { + !blobSASSignatureValues.permissions && + !blobSASSignatureValues.expiresOn) { throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); } var version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; var resource = "c"; var verifiedPermissions; + if (blobSASSignatureValues.versionId && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when provided 'versionId'."); + } + if (blobSASSignatureValues.permissions && + blobSASSignatureValues.permissions.deleteVersion && + version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission."); + } + if (blobSASSignatureValues.permissions && + blobSASSignatureValues.permissions.tag && + version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission."); + } if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.snapshotTime) { throw RangeError("Must provide 'blobName' when provided 'snapshotTime'."); } + if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.versionId) { + throw RangeError("Must provide 'blobName' when provided 'versionId'."); + } + var timestamp = blobSASSignatureValues.snapshotTime; if (blobSASSignatureValues.blobName) { resource = "b"; if (blobSASSignatureValues.snapshotTime) { resource = "bs"; } + else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp = blobSASSignatureValues.versionId; + } } // Calling parse and toString guarantees the proper ordering and throws on invalid characters. if (blobSASSignatureValues.permissions) { @@ -28246,7 +33711,7 @@ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKe blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", version, resource, - blobSASSignatureValues.snapshotTime, + timestamp, blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "", blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "", blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "", @@ -28276,16 +33741,37 @@ function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userD throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS."); } var version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; + if (blobSASSignatureValues.versionId && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when provided 'versionId'."); + } + if (blobSASSignatureValues.permissions && + blobSASSignatureValues.permissions.deleteVersion && + version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission."); + } + if (blobSASSignatureValues.permissions && + blobSASSignatureValues.permissions.tag && + version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission."); + } var resource = "c"; var verifiedPermissions; if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.snapshotTime) { throw RangeError("Must provide 'blobName' when provided 'snapshotTime'."); } + if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.versionId) { + throw RangeError("Must provide 'blobName' when provided 'versionId'."); + } + var timestamp = blobSASSignatureValues.snapshotTime; if (blobSASSignatureValues.blobName) { resource = "b"; if (blobSASSignatureValues.snapshotTime) { resource = "bs"; } + else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp = blobSASSignatureValues.versionId; + } } // Calling parse and toString guarantees the proper ordering and throws on invalid characters. if (blobSASSignatureValues.permissions) { @@ -28320,7 +33806,7 @@ function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userD blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", version, resource, - blobSASSignatureValues.snapshotTime, + timestamp, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, @@ -28411,8 +33897,16 @@ exports.newPipeline = newPipeline; /***/ }), - -/***/ 383: +/* 374 */, +/* 375 */, +/* 376 */, +/* 377 */, +/* 378 */, +/* 379 */, +/* 380 */, +/* 381 */, +/* 382 */, +/* 383 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -28508,8 +34002,16 @@ exports.Path = Path; //# sourceMappingURL=internal-path.js.map /***/ }), - -/***/ 393: +/* 384 */, +/* 385 */, +/* 386 */, +/* 387 */, +/* 388 */, +/* 389 */, +/* 390 */, +/* 391 */, +/* 392 */, +/* 393 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -30187,23 +35689,46 @@ exports.PrefixSecurityEnum = PrefixSecurityEnum; /***/ }), - -/***/ 413: +/* 394 */, +/* 395 */, +/* 396 */, +/* 397 */, +/* 398 */, +/* 399 */, +/* 400 */, +/* 401 */, +/* 402 */, +/* 403 */, +/* 404 */, +/* 405 */, +/* 406 */, +/* 407 */, +/* 408 */, +/* 409 */, +/* 410 */, +/* 411 */, +/* 412 */, +/* 413 */ /***/ (function(module, __unusedexports, __webpack_require__) { module.exports = __webpack_require__(141); /***/ }), - -/***/ 417: +/* 414 */, +/* 415 */, +/* 416 */, +/* 417 */ /***/ (function(module) { module.exports = require("crypto"); /***/ }), - -/***/ 422: +/* 418 */, +/* 419 */, +/* 420 */, +/* 421 */, +/* 422 */ /***/ (function(module) { /*! ***************************************************************************** @@ -30493,8 +36018,7 @@ var __createBinding; /***/ }), - -/***/ 423: +/* 423 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -30928,8 +36452,7 @@ var __createBinding; /***/ }), - -/***/ 424: +/* 424 */ /***/ (function(module, __unusedexports, __webpack_require__) { var iterate = __webpack_require__(157) @@ -30978,8 +36501,13 @@ function parallel(list, iterator, callback) /***/ }), - -/***/ 431: +/* 425 */, +/* 426 */, +/* 427 */, +/* 428 */, +/* 429 */, +/* 430 */, +/* 431 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -31077,8 +36605,9 @@ function escapeProperty(s) { //# sourceMappingURL=command.js.map /***/ }), - -/***/ 434: +/* 432 */, +/* 433 */, +/* 434 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -31209,14 +36738,18 @@ exports.createTar = createTar; //# sourceMappingURL=tar.js.map /***/ }), - -/***/ 440: +/* 435 */, +/* 436 */, +/* 437 */, +/* 438 */, +/* 439 */, +/* 440 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; -/*! - * Copyright 2019, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31230,35 +36763,67 @@ exports.createTar = createTar; * See the License for the specific language governing permissions and * limitations under the License. */ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; Object.defineProperty(exports, "__esModule", { value: true }); -__export(__webpack_require__(2)); -__export(__webpack_require__(744)); -__export(__webpack_require__(753)); -__export(__webpack_require__(40)); -__export(__webpack_require__(43)); -__export(__webpack_require__(625)); -__export(__webpack_require__(450)); -__export(__webpack_require__(767)); -__export(__webpack_require__(151)); -__export(__webpack_require__(162)); -__export(__webpack_require__(670)); -__export(__webpack_require__(932)); -__export(__webpack_require__(975)); -var context_base_1 = __webpack_require__(459); -exports.Context = context_base_1.Context; -const context_1 = __webpack_require__(492); +exports.propagation = exports.metrics = exports.trace = exports.context = void 0; +__exportStar(__webpack_require__(276), exports); +__exportStar(__webpack_require__(158), exports); +__exportStar(__webpack_require__(2), exports); +__exportStar(__webpack_require__(33), exports); +__exportStar(__webpack_require__(744), exports); +__exportStar(__webpack_require__(753), exports); +__exportStar(__webpack_require__(278), exports); +__exportStar(__webpack_require__(40), exports); +__exportStar(__webpack_require__(318), exports); +__exportStar(__webpack_require__(551), exports); +__exportStar(__webpack_require__(659), exports); +__exportStar(__webpack_require__(702), exports); +__exportStar(__webpack_require__(43), exports); +__exportStar(__webpack_require__(625), exports); +__exportStar(__webpack_require__(450), exports); +__exportStar(__webpack_require__(107), exports); +__exportStar(__webpack_require__(189), exports); +__exportStar(__webpack_require__(906), exports); +__exportStar(__webpack_require__(727), exports); +__exportStar(__webpack_require__(165), exports); +__exportStar(__webpack_require__(851), exports); +__exportStar(__webpack_require__(95), exports); +__exportStar(__webpack_require__(767), exports); +__exportStar(__webpack_require__(151), exports); +__exportStar(__webpack_require__(162), exports); +__exportStar(__webpack_require__(781), exports); +__exportStar(__webpack_require__(340), exports); +__exportStar(__webpack_require__(607), exports); +__exportStar(__webpack_require__(670), exports); +__exportStar(__webpack_require__(586), exports); +__exportStar(__webpack_require__(220), exports); +__exportStar(__webpack_require__(932), exports); +__exportStar(__webpack_require__(839), exports); +__exportStar(__webpack_require__(975), exports); +__exportStar(__webpack_require__(70), exports); +__exportStar(__webpack_require__(694), exports); +__exportStar(__webpack_require__(695), exports); +var context_base_1 = __webpack_require__(231); +Object.defineProperty(exports, "Context", { enumerable: true, get: function () { return context_base_1.Context; } }); +var context_1 = __webpack_require__(492); /** Entrypoint for context API */ exports.context = context_1.ContextAPI.getInstance(); -const trace_1 = __webpack_require__(875); +var trace_1 = __webpack_require__(875); /** Entrypoint for trace API */ exports.trace = trace_1.TraceAPI.getInstance(); -const metrics_1 = __webpack_require__(136); +var metrics_1 = __webpack_require__(136); /** Entrypoint for metrics API */ exports.metrics = metrics_1.MetricsAPI.getInstance(); -const propagation_1 = __webpack_require__(22); +var propagation_1 = __webpack_require__(22); /** Entrypoint for propagation API */ exports.propagation = propagation_1.PropagationAPI.getInstance(); exports.default = { @@ -31270,8 +36835,9 @@ exports.default = { //# sourceMappingURL=index.js.map /***/ }), - -/***/ 443: +/* 441 */, +/* 442 */, +/* 443 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -31298,7 +36864,7 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getInputAsInt = exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.getCacheState = exports.setOutputAndState = exports.setCacheHitOutput = exports.setCacheState = exports.isExactKeyMatch = exports.isGhes = void 0; const core = __importStar(__webpack_require__(470)); -const constants_1 = __webpack_require__(694); +const constants_1 = __webpack_require__(196); function isGhes() { const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); return ghUrl.hostname.toUpperCase() !== "GITHUB.COM"; @@ -31364,14 +36930,19 @@ exports.getInputAsInt = getInputAsInt; /***/ }), - -/***/ 450: +/* 444 */, +/* 445 */, +/* 446 */, +/* 447 */, +/* 448 */, +/* 449 */, +/* 450 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; -/*! - * Copyright 2019, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31386,23 +36957,26 @@ exports.getInputAsInt = getInputAsInt; * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const NoopMeter_1 = __webpack_require__(625); +exports.NOOP_METER_PROVIDER = exports.NoopMeterProvider = void 0; +var NoopMeter_1 = __webpack_require__(625); /** * An implementation of the {@link MeterProvider} which returns an impotent Meter * for all calls to `getMeter` */ -class NoopMeterProvider { - getMeter(_name, _version) { - return NoopMeter_1.NOOP_METER; +var NoopMeterProvider = /** @class */ (function () { + function NoopMeterProvider() { } -} + NoopMeterProvider.prototype.getMeter = function (_name, _version) { + return NoopMeter_1.NOOP_METER; + }; + return NoopMeterProvider; +}()); exports.NoopMeterProvider = NoopMeterProvider; exports.NOOP_METER_PROVIDER = new NoopMeterProvider(); //# sourceMappingURL=NoopMeterProvider.js.map /***/ }), - -/***/ 451: +/* 451 */ /***/ (function(module) { // Generated by CoffeeScript 1.12.7 @@ -31466,8 +37040,9 @@ exports.NOOP_METER_PROVIDER = new NoopMeterProvider(); /***/ }), - -/***/ 454: +/* 452 */, +/* 453 */, +/* 454 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31938,6 +37513,12 @@ function convertBody(buffer, headers) { // html4 if (!res && str) { res = / rnds8Pool.length - 16) { + _crypto.default.randomFillSync(rnds8Pool); + + poolPtr = 0; + } + + return rnds8Pool.slice(poolPtr, poolPtr += 16); } /***/ }), - -/***/ 735: +/* 734 */, +/* 735 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -38970,8 +44959,9 @@ function rng() { /***/ }), - -/***/ 738: +/* 736 */, +/* 737 */, +/* 738 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -39020,14 +45010,18 @@ function rng() { /***/ }), - -/***/ 744: +/* 739 */, +/* 740 */, +/* 741 */, +/* 742 */, +/* 743 */, +/* 744 */ /***/ (function(__unusedmodule, exports) { "use strict"; -/*! - * Copyright 2019, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39042,31 +45036,37 @@ function rng() { * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.NOOP_HTTP_TEXT_PROPAGATOR = exports.NoopHttpTextPropagator = void 0; /** * No-op implementations of {@link HttpTextPropagator}. */ -class NoopHttpTextPropagator { - /** Noop inject function does nothing */ - inject(context, carrier, setter) { } - /** Noop extract function does nothing and returns the input context */ - extract(context, carrier, getter) { - return context; +var NoopHttpTextPropagator = /** @class */ (function () { + function NoopHttpTextPropagator() { } -} + /** Noop inject function does nothing */ + NoopHttpTextPropagator.prototype.inject = function (context, carrier, setter) { }; + /** Noop extract function does nothing and returns the input context */ + NoopHttpTextPropagator.prototype.extract = function (context, carrier, getter) { + return context; + }; + return NoopHttpTextPropagator; +}()); exports.NoopHttpTextPropagator = NoopHttpTextPropagator; exports.NOOP_HTTP_TEXT_PROPAGATOR = new NoopHttpTextPropagator(); //# sourceMappingURL=NoopHttpTextPropagator.js.map /***/ }), - -/***/ 747: +/* 745 */, +/* 746 */, +/* 747 */ /***/ (function(module) { module.exports = require("fs"); /***/ }), - -/***/ 750: +/* 748 */, +/* 749 */, +/* 750 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -39342,8 +45342,7 @@ exports.isValid = function (domain) { /***/ }), - -/***/ 751: +/* 751 */ /***/ (function(module, __unusedexports, __webpack_require__) { var defer = __webpack_require__(500); @@ -39383,14 +45382,14 @@ function async(callback) /***/ }), - -/***/ 753: +/* 752 */, +/* 753 */ /***/ (function(__unusedmodule, exports) { "use strict"; -/*! - * Copyright 2020, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39405,6 +45404,7 @@ function async(callback) * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultSetter = void 0; /** * Default setter which sets value via direct property access * @@ -39418,15 +45418,58 @@ exports.defaultSetter = defaultSetter; //# sourceMappingURL=setter.js.map /***/ }), - -/***/ 761: +/* 754 */, +/* 755 */, +/* 756 */, +/* 757 */, +/* 758 */, +/* 759 */, +/* 760 */, +/* 761 */ /***/ (function(module) { module.exports = require("zlib"); /***/ }), +/* 762 */, +/* 763 */, +/* 764 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { -/***/ 766: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(__webpack_require__(102), exports); +//# sourceMappingURL=index.js.map + +/***/ }), +/* 765 */, +/* 766 */ /***/ (function(module) { // populates missing values @@ -39442,14 +45485,13 @@ module.exports = function(dst, src) { /***/ }), - -/***/ 767: +/* 767 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; -/*! - * Copyright 2019, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39464,10 +45506,11 @@ module.exports = function(dst, src) { * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const trace_flags_1 = __webpack_require__(975); +exports.NOOP_SPAN = exports.NoopSpan = exports.INVALID_SPAN_ID = exports.INVALID_TRACE_ID = void 0; +var trace_flags_1 = __webpack_require__(975); exports.INVALID_TRACE_ID = '0'; exports.INVALID_SPAN_ID = '0'; -const INVALID_SPAN_CONTEXT = { +var INVALID_SPAN_CONTEXT = { traceId: exports.INVALID_TRACE_ID, spanId: exports.INVALID_SPAN_ID, traceFlags: trace_flags_1.TraceFlags.NONE, @@ -39477,48 +45520,49 @@ const INVALID_SPAN_CONTEXT = { * implementation is available. All operations are no-op including context * propagation. */ -class NoopSpan { - constructor(_spanContext = INVALID_SPAN_CONTEXT) { +var NoopSpan = /** @class */ (function () { + function NoopSpan(_spanContext) { + if (_spanContext === void 0) { _spanContext = INVALID_SPAN_CONTEXT; } this._spanContext = _spanContext; } // Returns a SpanContext. - context() { + NoopSpan.prototype.context = function () { return this._spanContext; - } + }; // By default does nothing - setAttribute(key, value) { + NoopSpan.prototype.setAttribute = function (key, value) { return this; - } + }; // By default does nothing - setAttributes(attributes) { + NoopSpan.prototype.setAttributes = function (attributes) { return this; - } + }; // By default does nothing - addEvent(name, attributes) { + NoopSpan.prototype.addEvent = function (name, attributes) { return this; - } + }; // By default does nothing - setStatus(status) { + NoopSpan.prototype.setStatus = function (status) { return this; - } + }; // By default does nothing - updateName(name) { + NoopSpan.prototype.updateName = function (name) { return this; - } + }; // By default does nothing - end(endTime) { } + NoopSpan.prototype.end = function (endTime) { }; // isRecording always returns false for noopSpan. - isRecording() { + NoopSpan.prototype.isRecording = function () { return false; - } -} + }; + return NoopSpan; +}()); exports.NoopSpan = NoopSpan; exports.NOOP_SPAN = new NoopSpan(); //# sourceMappingURL=NoopSpan.js.map /***/ }), - -/***/ 768: +/* 768 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -40052,8 +46096,17 @@ exports.NOOP_SPAN = new NoopSpan(); /***/ }), - -/***/ 779: +/* 769 */, +/* 770 */, +/* 771 */, +/* 772 */, +/* 773 */, +/* 774 */, +/* 775 */, +/* 776 */, +/* 777 */, +/* 778 */, +/* 779 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -40248,8 +46301,40 @@ function populateMaps (extensions, types) { /***/ }), +/* 780 */, +/* 781 */ +/***/ (function(__unusedmodule, exports) { -/***/ 790: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=Sampler.js.map + +/***/ }), +/* 782 */, +/* 783 */, +/* 784 */, +/* 785 */, +/* 786 */, +/* 787 */, +/* 788 */, +/* 789 */, +/* 790 */ /***/ (function(module, __unusedexports, __webpack_require__) { var CombinedStream = __webpack_require__(547); @@ -40749,8 +46834,7 @@ FormData.prototype.toString = function () { /***/ }), - -/***/ 791: +/* 791 */ /***/ (function(__unusedmodule, exports) { // Generated by CoffeeScript 1.12.7 @@ -40828,15 +46912,16 @@ FormData.prototype.toString = function () { /***/ }), - -/***/ 794: +/* 792 */, +/* 793 */, +/* 794 */ /***/ (function(module) { module.exports = require("stream"); /***/ }), - -/***/ 796: +/* 795 */, +/* 796 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -41140,8 +47225,11 @@ module.exports = require("stream"); /***/ }), - -/***/ 801: +/* 797 */, +/* 798 */, +/* 799 */, +/* 800 */, +/* 801 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -41202,115 +47290,20 @@ module.exports = require("stream"); /***/ }), - -/***/ 826: -/***/ (function(module, __unusedexports, __webpack_require__) { - -var rng = __webpack_require__(139); -var bytesToUuid = __webpack_require__(722); - -function v4(options, buf, offset) { - var i = buf && offset || 0; - - if (typeof(options) == 'string') { - buf = options === 'binary' ? new Array(16) : null; - options = null; - } - options = options || {}; - - var rnds = options.random || (options.rng || rng)(); - - // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - rnds[6] = (rnds[6] & 0x0f) | 0x40; - rnds[8] = (rnds[8] & 0x3f) | 0x80; - - // Copy bytes to buffer, if provided - if (buf) { - for (var ii = 0; ii < 16; ++ii) { - buf[i + ii] = rnds[ii]; - } - } - - return buf || bytesToUuid(rnds); -} - -module.exports = v4; - - -/***/ }), - -/***/ 835: -/***/ (function(module) { - -module.exports = require("url"); - -/***/ }), - -/***/ 852: -/***/ (function(module, __unusedexports, __webpack_require__) { - -/*! - * mime-db - * Copyright(c) 2014 Jonathan Ong - * MIT Licensed - */ - -/** - * Module exports. - */ - -module.exports = __webpack_require__(512) - - -/***/ }), - -/***/ 855: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _validate = _interopRequireDefault(__webpack_require__(676)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ -const byteToHex = []; - -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).substr(1)); -} - -function stringify(arr, offset = 0) { - // Note: Be careful editing this code! It's been tuned for performance - // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 - const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one - // of the following: - // - One or more input array values don't map to a hex octet (leading to - // "undefined" in the uuid) - // - Invalid input values for the RFC `version` or `variant` fields - - if (!(0, _validate.default)(uuid)) { - throw TypeError('Stringified UUID is invalid'); - } - - return uuid; -} - -var _default = stringify; -exports.default = _default; - -/***/ }), - -/***/ 865: +/* 802 */, +/* 803 */, +/* 804 */, +/* 805 */, +/* 806 */, +/* 807 */, +/* 808 */, +/* 809 */, +/* 810 */, +/* 811 */, +/* 812 */, +/* 813 */, +/* 814 */, +/* 815 */ /***/ (function(module) { /*! ***************************************************************************** @@ -41377,7 +47370,7 @@ var __createBinding; (function (exporter) { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; __extends = function (d, b) { extendStatics(d, b); @@ -41458,8 +47451,8 @@ var __createBinding; } }; - __exportStar = function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); + __exportStar = function(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); }; __createBinding = Object.create ? (function(o, m, k, k2) { @@ -41557,7 +47550,7 @@ var __createBinding; __importStar = function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -41608,14 +47601,75 @@ var __createBinding; /***/ }), +/* 816 */, +/* 817 */, +/* 818 */, +/* 819 */, +/* 820 */, +/* 821 */, +/* 822 */, +/* 823 */, +/* 824 */, +/* 825 */, +/* 826 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -/***/ 875: -/***/ (function(__unusedmodule, exports, __webpack_require__) { +var rng = __webpack_require__(139); +var bytesToUuid = __webpack_require__(722); + +function v4(options, buf, offset) { + var i = buf && offset || 0; + + if (typeof(options) == 'string') { + buf = options === 'binary' ? new Array(16) : null; + options = null; + } + options = options || {}; + + var rnds = options.random || (options.rng || rng)(); + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + + // Copy bytes to buffer, if provided + if (buf) { + for (var ii = 0; ii < 16; ++ii) { + buf[i + ii] = rnds[ii]; + } + } + + return buf || bytesToUuid(rnds); +} + +module.exports = v4; + + +/***/ }), +/* 827 */, +/* 828 */, +/* 829 */, +/* 830 */, +/* 831 */, +/* 832 */, +/* 833 */, +/* 834 */, +/* 835 */ +/***/ (function(module) { + +module.exports = require("url"); + +/***/ }), +/* 836 */, +/* 837 */, +/* 838 */, +/* 839 */ +/***/ (function(__unusedmodule, exports) { "use strict"; -/*! - * Copyright 2020, OpenTelemetry Authors +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41630,48 +47684,505 @@ var __createBinding; * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const NoopTracerProvider_1 = __webpack_require__(162); +//# sourceMappingURL=TimedEvent.js.map + +/***/ }), +/* 840 */, +/* 841 */, +/* 842 */, +/* 843 */, +/* 844 */, +/* 845 */, +/* 846 */, +/* 847 */, +/* 848 */, +/* 849 */, +/* 850 */, +/* 851 */ +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=link_context.js.map + +/***/ }), +/* 852 */ +/***/ (function(module, __unusedexports, __webpack_require__) { + +/*! + * mime-db + * Copyright(c) 2014 Jonathan Ong + * MIT Licensed + */ + +/** + * Module exports. + */ + +module.exports = __webpack_require__(512) + + +/***/ }), +/* 853 */, +/* 854 */, +/* 855 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _validate = _interopRequireDefault(__webpack_require__(676)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ +const byteToHex = []; + +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); +} + +function stringify(arr, offset = 0) { + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!(0, _validate.default)(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +var _default = stringify; +exports.default = _default; + +/***/ }), +/* 856 */, +/* 857 */, +/* 858 */, +/* 859 */, +/* 860 */, +/* 861 */, +/* 862 */, +/* 863 */, +/* 864 */, +/* 865 */ +/***/ (function(module) { + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global global, define, System, Reflect, Promise */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +var __classPrivateFieldGet; +var __classPrivateFieldSet; +var __createBinding; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if ( true && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + + __extends = function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __exportStar = function(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); + }; + + __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + }) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }; + + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + __classPrivateFieldGet = function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); + }; + + __classPrivateFieldSet = function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); +}); + + +/***/ }), +/* 866 */, +/* 867 */, +/* 868 */, +/* 869 */, +/* 870 */, +/* 871 */, +/* 872 */, +/* 873 */, +/* 874 */, +/* 875 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TraceAPI = void 0; +var NoopTracerProvider_1 = __webpack_require__(162); +var global_utils_1 = __webpack_require__(976); /** * Singleton object which represents the entry point to the OpenTelemetry Tracing API */ -class TraceAPI { +var TraceAPI = /** @class */ (function () { /** Empty private constructor prevents end users from constructing a new instance of the API */ - constructor() { - this._tracerProvider = NoopTracerProvider_1.NOOP_TRACER_PROVIDER; + function TraceAPI() { } /** Get the singleton instance of the Trace API */ - static getInstance() { + TraceAPI.getInstance = function () { if (!this._instance) { this._instance = new TraceAPI(); } return this._instance; - } + }; /** * Set the current global tracer. Returns the initialized global tracer provider */ - setGlobalTracerProvider(provider) { - this._tracerProvider = provider; - return provider; - } + TraceAPI.prototype.setGlobalTracerProvider = function (provider) { + if (global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY]) { + // global tracer provider has already been set + return this.getTracerProvider(); + } + global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY] = global_utils_1.makeGetter(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, provider, NoopTracerProvider_1.NOOP_TRACER_PROVIDER); + return this.getTracerProvider(); + }; /** * Returns the global tracer provider. */ - getTracerProvider() { - return this._tracerProvider; - } + TraceAPI.prototype.getTracerProvider = function () { + var _a, _b; + return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NoopTracerProvider_1.NOOP_TRACER_PROVIDER); + }; /** * Returns a tracer from the global tracer provider. */ - getTracer(name, version) { + TraceAPI.prototype.getTracer = function (name, version) { return this.getTracerProvider().getTracer(name, version); - } -} + }; + /** Remove the global tracer provider */ + TraceAPI.prototype.disable = function () { + delete global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY]; + }; + return TraceAPI; +}()); exports.TraceAPI = TraceAPI; //# sourceMappingURL=trace.js.map /***/ }), - -/***/ 884: +/* 876 */, +/* 877 */, +/* 878 */, +/* 879 */, +/* 880 */, +/* 881 */, +/* 882 */, +/* 883 */, +/* 884 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -41785,8 +48296,7 @@ exports.TraceAPI = TraceAPI; /***/ }), - -/***/ 885: +/* 885 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -42173,8 +48683,10 @@ exports.TraceAPI = TraceAPI; /***/ }), - -/***/ 889: +/* 886 */, +/* 887 */, +/* 888 */, +/* 889 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -42647,8 +49159,9 @@ exports.PollerStoppedError = PollerStoppedError; /***/ }), - -/***/ 892: +/* 890 */, +/* 891 */, +/* 892 */ /***/ (function(module, __unusedexports, __webpack_require__) { var iterate = __webpack_require__(157) @@ -42729,8 +49242,10 @@ function descending(a, b) /***/ }), - -/***/ 896: +/* 893 */, +/* 894 */, +/* 895 */, +/* 896 */ /***/ (function(module) { module.exports = function (xs, fn) { @@ -42749,8 +49264,8 @@ var isArray = Array.isArray || function (xs) { /***/ }), - -/***/ 898: +/* 897 */, +/* 898 */ /***/ (function(module, __unusedexports, __webpack_require__) { var v1 = __webpack_require__(86); @@ -42764,8 +49279,7 @@ module.exports = uuid; /***/ }), - -/***/ 899: +/* 899 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -42789,6 +49303,7 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(__webpack_require__(470)); const http_client_1 = __webpack_require__(539); +const constants_1 = __webpack_require__(931); function isSuccessStatusCode(statusCode) { if (!statusCode) { return false; @@ -42815,55 +49330,84 @@ function isRetryableStatusCode(statusCode) { return retryableStatusCodes.includes(statusCode); } exports.isRetryableStatusCode = isRetryableStatusCode; -function retry(name, method, getStatusCode, maxAttempts = 2) { +function sleep(milliseconds) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise(resolve => setTimeout(resolve, milliseconds)); + }); +} +function retry(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay, onError = undefined) { return __awaiter(this, void 0, void 0, function* () { - let response = undefined; - let statusCode = undefined; - let isRetryable = false; let errorMessage = ''; let attempt = 1; while (attempt <= maxAttempts) { + let response = undefined; + let statusCode = undefined; + let isRetryable = false; try { response = yield method(); + } + catch (error) { + if (onError) { + response = onError(error); + } + isRetryable = true; + errorMessage = error.message; + } + if (response) { statusCode = getStatusCode(response); if (!isServerErrorStatusCode(statusCode)) { return response; } + } + if (statusCode) { isRetryable = isRetryableStatusCode(statusCode); errorMessage = `Cache service responded with ${statusCode}`; } - catch (error) { - isRetryable = true; - errorMessage = error.message; - } core.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); if (!isRetryable) { core.debug(`${name} - Error is not retryable`); break; } + yield sleep(delay); attempt++; } throw Error(`${name} failed: ${errorMessage}`); }); } exports.retry = retry; -function retryTypedResponse(name, method, maxAttempts = 2) { +function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { return __awaiter(this, void 0, void 0, function* () { - return yield retry(name, method, (response) => response.statusCode, maxAttempts); + return yield retry(name, method, (response) => response.statusCode, maxAttempts, delay, + // If the error object contains the statusCode property, extract it and return + // an ITypedResponse so it can be processed by the retry logic. + (error) => { + if (error instanceof http_client_1.HttpClientError) { + return { + statusCode: error.statusCode, + result: null, + headers: {} + }; + } + else { + return undefined; + } + }); }); } exports.retryTypedResponse = retryTypedResponse; -function retryHttpClientResponse(name, method, maxAttempts = 2) { +function retryHttpClientResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { return __awaiter(this, void 0, void 0, function* () { - return yield retry(name, method, (response) => response.message.statusCode, maxAttempts); + return yield retry(name, method, (response) => response.message.statusCode, maxAttempts, delay); }); } exports.retryHttpClientResponse = retryHttpClientResponse; //# sourceMappingURL=requestUtils.js.map /***/ }), - -/***/ 903: +/* 900 */, +/* 901 */, +/* 902 */, +/* 903 */ /***/ (function(module) { // API @@ -42906,8 +49450,64 @@ function state(list, sortMethod) /***/ }), +/* 904 */, +/* 905 */, +/* 906 */ +/***/ (function(__unusedmodule, exports) { -/***/ 919: +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=attributes.js.map + +/***/ }), +/* 907 */, +/* 908 */, +/* 909 */, +/* 910 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(__webpack_require__(764), exports); +//# sourceMappingURL=index.js.map + +/***/ }), +/* 911 */, +/* 912 */, +/* 913 */, +/* 914 */, +/* 915 */, +/* 916 */, +/* 917 */, +/* 918 */, +/* 919 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -42949,8 +49549,10 @@ function state(list, sortMethod) /***/ }), - -/***/ 923: +/* 920 */, +/* 921 */, +/* 922 */, +/* 923 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -43187,8 +49789,57 @@ exports.Pattern = Pattern; //# sourceMappingURL=internal-pattern.js.map /***/ }), +/* 924 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { -/***/ 928: +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NoopContextManager = void 0; +var context_1 = __webpack_require__(715); +var NoopContextManager = /** @class */ (function () { + function NoopContextManager() { + } + NoopContextManager.prototype.active = function () { + return context_1.Context.ROOT_CONTEXT; + }; + NoopContextManager.prototype.with = function (context, fn) { + return fn(); + }; + NoopContextManager.prototype.bind = function (target, context) { + return target; + }; + NoopContextManager.prototype.enable = function () { + return this; + }; + NoopContextManager.prototype.disable = function () { + return this; + }; + return NoopContextManager; +}()); +exports.NoopContextManager = NoopContextManager; +//# sourceMappingURL=NoopContextManager.js.map + +/***/ }), +/* 925 */, +/* 926 */, +/* 927 */, +/* 928 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -43475,8 +50126,9 @@ exports.setLogLevel = setLogLevel; /***/ }), - -/***/ 931: +/* 929 */, +/* 930 */, +/* 931 */ /***/ (function(__unusedmodule, exports) { "use strict"; @@ -43495,6 +50147,10 @@ var CompressionMethod; CompressionMethod["ZstdWithoutLong"] = "zstd-without-long"; CompressionMethod["Zstd"] = "zstd"; })(CompressionMethod = exports.CompressionMethod || (exports.CompressionMethod = {})); +// The default number of retry attempts. +exports.DefaultRetryAttempts = 2; +// The default delay in milliseconds between retry attempts. +exports.DefaultRetryDelay = 5000; // Socket timeout in milliseconds during download. If no traffic is received // over the socket during this period, the socket is destroyed and the download // is aborted. @@ -43502,28 +50158,13 @@ exports.SocketTimeout = 5000; //# sourceMappingURL=constants.js.map /***/ }), - -/***/ 932: +/* 932 */ /***/ (function(__unusedmodule, exports) { "use strict"; -/*! - * Copyright 2019, OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.CanonicalCode = void 0; /** * An enumeration of canonical status codes. */ @@ -43664,8 +50305,13 @@ var CanonicalCode; //# sourceMappingURL=status.js.map /***/ }), - -/***/ 939: +/* 933 */, +/* 934 */, +/* 935 */, +/* 936 */, +/* 937 */, +/* 938 */, +/* 939 */ /***/ (function(module, __unusedexports, __webpack_require__) { var abort = __webpack_require__(566) @@ -43700,14 +50346,22 @@ function terminator(callback) /***/ }), - -/***/ 950: -/***/ (function(__unusedmodule, exports, __webpack_require__) { +/* 940 */, +/* 941 */, +/* 942 */, +/* 943 */, +/* 944 */, +/* 945 */, +/* 946 */, +/* 947 */, +/* 948 */, +/* 949 */, +/* 950 */ +/***/ (function(__unusedmodule, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const url = __webpack_require__(835); function getProxyUrl(reqUrl) { let usingSsl = reqUrl.protocol === 'https:'; let proxyUrl; @@ -43722,7 +50376,7 @@ function getProxyUrl(reqUrl) { proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY']; } if (proxyVar) { - proxyUrl = url.parse(proxyVar); + proxyUrl = new URL(proxyVar); } return proxyUrl; } @@ -43766,8 +50420,12 @@ exports.checkBypass = checkBypass; /***/ }), - -/***/ 956: +/* 951 */, +/* 952 */, +/* 953 */, +/* 954 */, +/* 955 */, +/* 956 */ /***/ (function(module, __unusedexports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -43804,8 +50462,22 @@ exports.checkBypass = checkBypass; /***/ }), - -/***/ 972: +/* 957 */, +/* 958 */, +/* 959 */, +/* 960 */, +/* 961 */, +/* 962 */, +/* 963 */, +/* 964 */, +/* 965 */, +/* 966 */, +/* 967 */, +/* 968 */, +/* 969 */, +/* 970 */, +/* 971 */, +/* 972 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -43986,14 +50658,47 @@ exports.safeTrimTrailingSeparator = safeTrimTrailingSeparator; //# sourceMappingURL=internal-path-helper.js.map /***/ }), - -/***/ 975: +/* 973 */, +/* 974 */, +/* 975 */ /***/ (function(__unusedmodule, exports) { "use strict"; -/*! - * Copyright 2019, OpenTelemetry Authors +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TraceFlags = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var TraceFlags; +(function (TraceFlags) { + /** Represents no flag set. */ + TraceFlags[TraceFlags["NONE"] = 0] = "NONE"; + /** Bit to represent whether trace is sampled in trace flags. */ + TraceFlags[TraceFlags["SAMPLED"] = 1] = "SAMPLED"; +})(TraceFlags = exports.TraceFlags || (exports.TraceFlags = {})); +//# sourceMappingURL=trace_flags.js.map + +/***/ }), +/* 976 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44008,23 +50713,48 @@ exports.safeTrimTrailingSeparator = safeTrimTrailingSeparator; * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.API_BACKWARDS_COMPATIBILITY_VERSION = exports.makeGetter = exports._global = exports.GLOBAL_TRACE_API_KEY = exports.GLOBAL_PROPAGATION_API_KEY = exports.GLOBAL_METRICS_API_KEY = exports.GLOBAL_CONTEXT_MANAGER_API_KEY = void 0; +var platform_1 = __webpack_require__(910); +exports.GLOBAL_CONTEXT_MANAGER_API_KEY = Symbol.for('io.opentelemetry.js.api.context'); +exports.GLOBAL_METRICS_API_KEY = Symbol.for('io.opentelemetry.js.api.metrics'); +exports.GLOBAL_PROPAGATION_API_KEY = Symbol.for('io.opentelemetry.js.api.propagation'); +exports.GLOBAL_TRACE_API_KEY = Symbol.for('io.opentelemetry.js.api.trace'); +exports._global = platform_1._globalThis; /** - * An enumeration that represents global trace flags. These flags are - * propagated to all child {@link Span}. These determine features such as - * whether a Span should be traced. It is implemented as a bitmask. + * Make a function which accepts a version integer and returns the instance of an API if the version + * is compatible, or a fallback version (usually NOOP) if it is not. + * + * @param requiredVersion Backwards compatibility version which is required to return the instance + * @param instance Instance which should be returned if the required version is compatible + * @param fallback Fallback instance, usually NOOP, which will be returned if the required version is not compatible */ -var TraceFlags; -(function (TraceFlags) { - /** Represents no flag set. */ - TraceFlags[TraceFlags["NONE"] = 0] = "NONE"; - /** Bit to represent whether trace is sampled in trace flags. */ - TraceFlags[TraceFlags["SAMPLED"] = 1] = "SAMPLED"; -})(TraceFlags = exports.TraceFlags || (exports.TraceFlags = {})); -//# sourceMappingURL=trace_flags.js.map +function makeGetter(requiredVersion, instance, fallback) { + return function (version) { + return version === requiredVersion ? instance : fallback; + }; +} +exports.makeGetter = makeGetter; +/** + * A number which should be incremented each time a backwards incompatible + * change is made to the API. This number is used when an API package + * attempts to access the global API to ensure it is getting a compatible + * version. If the global API is not compatible with the API package + * attempting to get it, a NOOP API implementation will be returned. + */ +exports.API_BACKWARDS_COMPATIBILITY_VERSION = 0; +//# sourceMappingURL=global-utils.js.map /***/ }), - -/***/ 986: +/* 977 */, +/* 978 */, +/* 979 */, +/* 980 */, +/* 981 */, +/* 982 */, +/* 983 */, +/* 984 */, +/* 985 */, +/* 986 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -44074,8 +50804,12 @@ exports.exec = exec; //# sourceMappingURL=exec.js.map /***/ }), - -/***/ 992: +/* 987 */, +/* 988 */, +/* 989 */, +/* 990 */, +/* 991 */, +/* 992 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 @@ -44120,8 +50854,13 @@ exports.exec = exec; /***/ }), - -/***/ 999: +/* 993 */, +/* 994 */, +/* 995 */, +/* 996 */, +/* 997 */, +/* 998 */, +/* 999 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -44131,8 +50870,8 @@ Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var uuid = __webpack_require__(585); var tslib = __webpack_require__(865); +var uuid = __webpack_require__(585); var tough = __webpack_require__(393); var http = __webpack_require__(605); var https = __webpack_require__(211); @@ -44323,7 +51062,7 @@ var Constants = { * @const * @type {string} */ - coreHttpVersion: "1.1.5", + coreHttpVersion: "1.1.9", /** * Specifies HTTP. * @@ -44352,6 +51091,20 @@ var Constants = { * @type {string} */ HTTPS_PROXY: "HTTPS_PROXY", + /** + * Specifies NO Proxy. + * + * @const + * @type {string} + */ + NO_PROXY: "NO_PROXY", + /** + * Specifies ALL Proxy. + * + * @const + * @type {string} + */ + ALL_PROXY: "ALL_PROXY", HttpConstants: { /** * Http Verbs @@ -44542,12 +51295,15 @@ function promiseToServiceCallback(promise) { }); }; } -function prepareXMLRootList(obj, elementName) { - var _a; +function prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { + var _a, _b, _c; if (!Array.isArray(obj)) { obj = [obj]; } - return _a = {}, _a[elementName] = obj, _a; + if (!xmlNamespaceKey || !xmlNamespace) { + return _a = {}, _a[elementName] = obj, _a; + } + return _b = {}, _b[elementName] = obj, _b.$ = (_c = {}, _c[xmlNamespaceKey] = xmlNamespace, _c), _b; } /** * Applies the properties on the prototype of sourceCtors to the prototype of targetCtor @@ -44589,6 +51345,15 @@ function replaceAll(value, searchValue, replaceValue) { function isPrimitiveType(value) { return (typeof value !== "object" && typeof value !== "function") || value === null; } +function getEnvironmentValue(name) { + if (process.env[name]) { + return process.env[name]; + } + else if (process.env[name.toLowerCase()]) { + return process.env[name.toLowerCase()]; + } + return undefined; +} // Copyright (c) Microsoft Corporation. var Serializer = /** @class */ (function () { @@ -44710,13 +51475,13 @@ var Serializer = /** @class */ (function () { payload = serializeBase64UrlType(objectName, object); } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName); + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML)); } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName); + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML)); } else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, objectName); + payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML)); } } return payload; @@ -44990,7 +51755,8 @@ function serializeDateTypes(typeName, value, objectName) { } return value; } -function serializeSequenceType(serializer, mapper, object, objectName) { +function serializeSequenceType(serializer, mapper, object, objectName, isXml) { + var _a, _b; if (!Array.isArray(object)) { throw new Error(objectName + " must be of type Array."); } @@ -45001,11 +51767,26 @@ function serializeSequenceType(serializer, mapper, object, objectName) { } var tempArray = []; for (var i = 0; i < object.length; i++) { - tempArray[i] = serializer.serialize(elementType, object[i], objectName); + var serializedValue = serializer.serialize(elementType, object[i], objectName); + if (isXml && elementType.xmlNamespace) { + var xmlnsKey = elementType.xmlNamespacePrefix + ? "xmlns:" + elementType.xmlNamespacePrefix + : "xmlns"; + if (elementType.type.name === "Composite") { + tempArray[i] = tslib.__assign(tslib.__assign({}, serializedValue), { $: (_a = {}, _a[xmlnsKey] = elementType.xmlNamespace, _a) }); + } + else { + tempArray[i] = { _: serializedValue, $: (_b = {}, _b[xmlnsKey] = elementType.xmlNamespace, _b) }; + } + } + else { + tempArray[i] = serializedValue; + } } return tempArray; } -function serializeDictionaryType(serializer, mapper, object, objectName) { +function serializeDictionaryType(serializer, mapper, object, objectName, isXml) { + var _a; if (typeof object !== "object") { throw new Error(objectName + " must be of type object."); } @@ -45015,12 +51796,46 @@ function serializeDictionaryType(serializer, mapper, object, objectName) { ("mapper and it must of type \"object\" in " + objectName + ".")); } var tempDictionary = {}; - for (var _i = 0, _a = Object.keys(object); _i < _a.length; _i++) { - var key = _a[_i]; - tempDictionary[key] = serializer.serialize(valueType, object[key], objectName + "." + key); + for (var _i = 0, _b = Object.keys(object); _i < _b.length; _i++) { + var key = _b[_i]; + var serializedValue = serializer.serialize(valueType, object[key], objectName); + // If the element needs an XML namespace we need to add it within the $ property + tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml); + } + // Add the namespace to the root element if needed + if (isXml && mapper.xmlNamespace) { + var xmlnsKey = mapper.xmlNamespacePrefix ? "xmlns:" + mapper.xmlNamespacePrefix : "xmlns"; + return tslib.__assign(tslib.__assign({}, tempDictionary), { $: (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a) }); } return tempDictionary; } +/** + * Resolves the additionalProperties property from a referenced mapper + * @param serializer the serializer containing the entire set of mappers + * @param mapper the composite mapper to resolve + * @param objectName name of the object being serialized + */ +function resolveAdditionalProperties(serializer, mapper, objectName) { + var additionalProperties = mapper.type.additionalProperties; + if (!additionalProperties && mapper.type.className) { + var modelMapper = resolveReferencedMapper(serializer, mapper, objectName); + return modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; + } + return additionalProperties; +} +/** + * Finds the mapper referenced by className + * @param serializer the serializer containing the entire set of mappers + * @param mapper the composite mapper to resolve + * @param objectName name of the object being serialized + */ +function resolveReferencedMapper(serializer, mapper, objectName) { + var className = mapper.type.className; + if (!className) { + throw new Error("Class name for model \"" + objectName + "\" is not provided in the mapper \"" + JSON.stringify(mapper, undefined, 2) + "\"."); + } + return serializer.modelMappers[className]; +} /** * Resolves a composite mapper's modelProperties. * @param serializer the serializer containing the entire set of mappers @@ -45029,32 +51844,28 @@ function serializeDictionaryType(serializer, mapper, object, objectName) { function resolveModelProperties(serializer, mapper, objectName) { var modelProps = mapper.type.modelProperties; if (!modelProps) { - var className = mapper.type.className; - if (!className) { - throw new Error("Class name for model \"" + objectName + "\" is not provided in the mapper \"" + JSON.stringify(mapper, undefined, 2) + "\"."); - } - var modelMapper = serializer.modelMappers[className]; + var modelMapper = resolveReferencedMapper(serializer, mapper, objectName); if (!modelMapper) { - throw new Error("mapper() cannot be null or undefined for model \"" + className + "\"."); + throw new Error("mapper() cannot be null or undefined for model \"" + mapper.type.className + "\"."); } - modelProps = modelMapper.type.modelProperties; + modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.modelProperties; if (!modelProps) { throw new Error("modelProperties cannot be null or undefined in the " + - ("mapper \"" + JSON.stringify(modelMapper) + "\" of type \"" + className + "\" for object \"" + objectName + "\".")); + ("mapper \"" + JSON.stringify(modelMapper) + "\" of type \"" + mapper.type.className + "\" for object \"" + objectName + "\".")); } } return modelProps; } -function serializeCompositeType(serializer, mapper, object, objectName) { - var _a; +function serializeCompositeType(serializer, mapper, object, objectName, isXml) { + var _a, _b; if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); } if (object != undefined) { var payload = {}; var modelProps = resolveModelProperties(serializer, mapper, objectName); - for (var _i = 0, _b = Object.keys(modelProps); _i < _b.length; _i++) { - var key = _b[_i]; + for (var _i = 0, _c = Object.keys(modelProps); _i < _c.length; _i++) { + var key = _c[_i]; var propertyMapper = modelProps[key]; if (propertyMapper.readOnly) { continue; @@ -45072,8 +51883,8 @@ function serializeCompositeType(serializer, mapper, object, objectName) { else { var paths = splitSerializeName(propertyMapper.serializedName); propName = paths.pop(); - for (var _c = 0, paths_1 = paths; _c < paths_1.length; _c++) { - var pathName = paths_1[_c]; + for (var _d = 0, paths_1 = paths; _d < paths_1.length; _d++) { + var pathName = paths_1[_d]; var childObject = parentObject[pathName]; if (childObject == undefined && (object[key] != undefined || propertyMapper.defaultValue !== undefined)) { @@ -45083,6 +51894,12 @@ function serializeCompositeType(serializer, mapper, object, objectName) { } } if (parentObject != undefined) { + if (isXml && mapper.xmlNamespace) { + var xmlnsKey = mapper.xmlNamespacePrefix + ? "xmlns:" + mapper.xmlNamespacePrefix + : "xmlns"; + parentObject.$ = tslib.__assign(tslib.__assign({}, parentObject.$), (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a)); + } var propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; @@ -45095,23 +51912,24 @@ function serializeCompositeType(serializer, mapper, object, objectName) { } var serializedValue = serializer.serialize(propertyMapper, toSerialize, propertyObjectName); if (serializedValue !== undefined && propName != undefined) { - if (propertyMapper.xmlIsAttribute) { + var value = getXmlObjectValue(propertyMapper, serializedValue, isXml); + if (isXml && propertyMapper.xmlIsAttribute) { // $ is the key attributes are kept under in xml2js. // This keeps things simple while preventing name collision // with names in user documents. parentObject.$ = parentObject.$ || {}; parentObject.$[propName] = serializedValue; } - else if (propertyMapper.xmlIsWrapped) { - parentObject[propName] = (_a = {}, _a[propertyMapper.xmlElementName] = serializedValue, _a); + else if (isXml && propertyMapper.xmlIsWrapped) { + parentObject[propName] = (_b = {}, _b[propertyMapper.xmlElementName] = value, _b); } else { - parentObject[propName] = serializedValue; + parentObject[propName] = value; } } } } - var additionalPropertiesMapper = mapper.type.additionalProperties; + var additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); if (additionalPropertiesMapper) { var propNames = Object.keys(modelProps); var _loop_1 = function (clientPropName) { @@ -45128,18 +51946,33 @@ function serializeCompositeType(serializer, mapper, object, objectName) { } return object; } +function getXmlObjectValue(propertyMapper, serializedValue, isXml) { + var _a; + if (!isXml || !propertyMapper.xmlNamespace) { + return serializedValue; + } + var xmlnsKey = propertyMapper.xmlNamespacePrefix + ? "xmlns:" + propertyMapper.xmlNamespacePrefix + : "xmlns"; + var xmlNamespace = (_a = {}, _a[xmlnsKey] = propertyMapper.xmlNamespace, _a); + if (["Composite"].includes(propertyMapper.type.name)) { + return tslib.__assign({ $: xmlNamespace }, serializedValue); + } + return { _: serializedValue, $: xmlNamespace }; +} function isSpecialXmlProperty(propertyName) { return ["$", "_"].includes(propertyName); } function deserializeCompositeType(serializer, mapper, responseBody, objectName) { + var _a; if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); } var modelProps = resolveModelProperties(serializer, mapper, objectName); var instance = {}; var handledPropertyNames = []; - for (var _i = 0, _a = Object.keys(modelProps); _i < _a.length; _i++) { - var key = _a[_i]; + for (var _i = 0, _b = Object.keys(modelProps); _i < _b.length; _i++) { + var key = _b[_i]; var propertyMapper = modelProps[key]; var paths = splitSerializeName(modelProps[key].serializedName); handledPropertyNames.push(paths[0]); @@ -45151,8 +51984,8 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName) var headerCollectionPrefix = propertyMapper.headerCollectionPrefix; if (headerCollectionPrefix) { var dictionary = {}; - for (var _b = 0, _c = Object.keys(responseBody); _b < _c.length; _b++) { - var headerKey = _c[_b]; + for (var _c = 0, _d = Object.keys(responseBody); _c < _d.length; _c++) { + var headerKey = _d[_c]; if (headerKey.startsWith(headerCollectionPrefix)) { dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer.deserialize(propertyMapper.type.value, responseBody[headerKey], propertyObjectName); } @@ -45166,16 +51999,29 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName) } else { var propertyName = xmlElementName || xmlName || serializedName; - var unwrappedProperty = responseBody[propertyName]; if (propertyMapper.xmlIsWrapped) { - unwrappedProperty = responseBody[xmlName]; - unwrappedProperty = unwrappedProperty && unwrappedProperty[xmlElementName]; - var isEmptyWrappedList = unwrappedProperty === undefined; - if (isEmptyWrappedList) { - unwrappedProperty = []; - } + /* a list of wrapped by + For the xml example below + + ... + ... + + the responseBody has + { + Cors: { + CorsRule: [{...}, {...}] + } + } + xmlName is "Cors" and xmlElementName is"CorsRule". + */ + var wrapped = responseBody[xmlName]; + var elementList = (_a = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _a !== void 0 ? _a : []; + instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName); + } + else { + var property = responseBody[propertyName]; + instance[key] = serializer.deserialize(propertyMapper, property, propertyObjectName); } - instance[key] = serializer.deserialize(propertyMapper, unwrappedProperty, propertyObjectName); } } else { @@ -45183,8 +52029,8 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName) var propertyInstance = void 0; var res = responseBody; // traversing the object step by step. - for (var _d = 0, paths_2 = paths; _d < paths_2.length; _d++) { - var item = paths_2[_d]; + for (var _e = 0, paths_2 = paths; _e < paths_2.length; _e++) { + var item = paths_2[_e]; if (!res) break; res = res[item]; @@ -45235,8 +52081,8 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName) } } else if (responseBody) { - for (var _e = 0, _f = Object.keys(responseBody); _e < _f.length; _e++) { - var key = _f[_e]; + for (var _f = 0, _g = Object.keys(responseBody); _f < _g.length; _f++) { + var key = _g[_f]; if (instance[key] === undefined && !handledPropertyNames.includes(key) && !isSpecialXmlProperty(key)) { @@ -45729,11 +52575,6 @@ var URLQuery = /** @class */ (function () { break; case "ParameterValue": switch (currentCharacter) { - case "=": - parameterName = ""; - parameterValue = ""; - currentState = "Invalid"; - break; case "&": result.set(parameterName, parameterValue); parameterName = ""; @@ -45745,11 +52586,6 @@ var URLQuery = /** @class */ (function () { break; } break; - case "Invalid": - if (currentCharacter === "&") { - currentState = "ParameterName"; - } - break; default: throw new Error("Unrecognized URLQuery parse state: " + currentState); } @@ -47757,6 +54593,65 @@ var ExpiringAccessTokenCache = /** @class */ (function () { return ExpiringAccessTokenCache; }()); +// Copyright (c) Microsoft Corporation. +/** + * Helps the core-http token authentication policies with requesting a new token if we're not currently waiting for a new token. + */ +var AccessTokenRefresher = /** @class */ (function () { + function AccessTokenRefresher(credential, scopes, requiredMillisecondsBeforeNewRefresh) { + if (requiredMillisecondsBeforeNewRefresh === void 0) { requiredMillisecondsBeforeNewRefresh = 30000; } + this.credential = credential; + this.scopes = scopes; + this.requiredMillisecondsBeforeNewRefresh = requiredMillisecondsBeforeNewRefresh; + this.lastCalled = 0; + } + /** + * Returns true if the required milliseconds(defaulted to 30000) have been passed signifying + * that we are ready for a new refresh. + * + * @returns {boolean} + */ + AccessTokenRefresher.prototype.isReady = function () { + // We're only ready for a new refresh if the required milliseconds have passed. + return (!this.lastCalled || Date.now() - this.lastCalled > this.requiredMillisecondsBeforeNewRefresh); + }; + /** + * Stores the time in which it is called, + * then requests a new token, + * then sets this.promise to undefined, + * then returns the token. + * @param options getToken options + */ + AccessTokenRefresher.prototype.getToken = function (options) { + return tslib.__awaiter(this, void 0, void 0, function () { + var token; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + this.lastCalled = Date.now(); + return [4 /*yield*/, this.credential.getToken(this.scopes, options)]; + case 1: + token = _a.sent(); + this.promise = undefined; + return [2 /*return*/, token || undefined]; + } + }); + }); + }; + /** + * Requests a new token if we're not currently waiting for a new token. + * Returns null if the required time between each call hasn't been reached. + * @param options getToken options + */ + AccessTokenRefresher.prototype.refresh = function (options) { + if (!this.promise) { + this.promise = this.getToken(options); + } + return this.promise; + }; + return AccessTokenRefresher; +}()); + // Copyright (c) Microsoft Corporation. /** * Creates a new BearerTokenAuthenticationPolicy factory. @@ -47766,12 +54661,19 @@ var ExpiringAccessTokenCache = /** @class */ (function () { */ function bearerTokenAuthenticationPolicy(credential, scopes) { var tokenCache = new ExpiringAccessTokenCache(); + var tokenRefresher = new AccessTokenRefresher(credential, scopes, timeBetweenRefreshAttemptsInMs); return { create: function (nextPolicy, options) { - return new BearerTokenAuthenticationPolicy(nextPolicy, options, credential, scopes, tokenCache); + return new BearerTokenAuthenticationPolicy(nextPolicy, options, tokenCache, tokenRefresher); } }; } +/** + * The automated token refresh will only start to happen at the + * expiration date minus the value of timeBetweenRefreshAttemptsInMs, + * which is by default 30 seconds. + */ +var timeBetweenRefreshAttemptsInMs = 30000; /** * * Provides a RequestPolicy that can request a token from a TokenCredential @@ -47790,11 +54692,10 @@ var BearerTokenAuthenticationPolicy = /** @class */ (function (_super) { * @param scopes The scopes for which the bearer token applies. * @param tokenCache The cache for the most recent AccessToken returned from the TokenCredential. */ - function BearerTokenAuthenticationPolicy(nextPolicy, options, credential, scopes, tokenCache) { + function BearerTokenAuthenticationPolicy(nextPolicy, options, tokenCache, tokenRefresher) { var _this = _super.call(this, nextPolicy, options) || this; - _this.credential = credential; - _this.scopes = scopes; _this.tokenCache = tokenCache; + _this.tokenRefresher = tokenRefresher; return _this; } /** @@ -47823,6 +54724,26 @@ var BearerTokenAuthenticationPolicy = /** @class */ (function (_super) { }); }); }; + /** + * Attempts a token update if any other time related conditionals have been reached based on the tokenRefresher class. + */ + BearerTokenAuthenticationPolicy.prototype.updateTokenIfNeeded = function (options) { + return tslib.__awaiter(this, void 0, void 0, function () { + var accessToken; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!this.tokenRefresher.isReady()) return [3 /*break*/, 2]; + return [4 /*yield*/, this.tokenRefresher.refresh(options)]; + case 1: + accessToken = _a.sent(); + this.tokenCache.setCachedToken(accessToken); + _a.label = 2; + case 2: return [2 /*return*/]; + } + }); + }); + }; BearerTokenAuthenticationPolicy.prototype.getToken = function (options) { return tslib.__awaiter(this, void 0, void 0, function () { var accessToken; @@ -47831,12 +54752,20 @@ var BearerTokenAuthenticationPolicy = /** @class */ (function (_super) { case 0: accessToken = this.tokenCache.getCachedToken(); if (!(accessToken === undefined)) return [3 /*break*/, 2]; - return [4 /*yield*/, this.credential.getToken(this.scopes, options)]; + return [4 /*yield*/, this.tokenRefresher.refresh(options)]; case 1: - accessToken = (_a.sent()) || undefined; + // Waiting for the next refresh only if the cache is unable to retrieve the access token, + // which means that it has expired, or it has never been set. + accessToken = _a.sent(); this.tokenCache.setCachedToken(accessToken); - _a.label = 2; - case 2: return [2 /*return*/, accessToken ? accessToken.token : undefined]; + return [3 /*break*/, 3]; + case 2: + // If we still have a cached access token, + // And any other time related conditionals have been reached based on the tokenRefresher class, + // then attempt to refresh without waiting. + this.updateTokenIfNeeded(options); + _a.label = 3; + case 3: return [2 /*return*/, accessToken ? accessToken.token : undefined]; } }); }); @@ -47937,23 +54866,57 @@ function retry$1(policy, request, operationResponse, err, retryData) { })(exports.QueryCollectionFormat || (exports.QueryCollectionFormat = {})); // Copyright (c) Microsoft Corporation. +var noProxyList = []; +var isNoProxyInitalized = false; +var byPassedList = new Map(); function loadEnvironmentProxyValue() { if (!process) { return undefined; } - if (process.env[Constants.HTTPS_PROXY]) { - return process.env[Constants.HTTPS_PROXY]; + var httpsProxy = getEnvironmentValue(Constants.HTTPS_PROXY); + var allProxy = getEnvironmentValue(Constants.ALL_PROXY); + var httpProxy = getEnvironmentValue(Constants.HTTP_PROXY); + return httpsProxy || allProxy || httpProxy; +} +// Check whether the given `uri` matches the noProxyList. If it matches, any request sent to that same `uri` won't set the proxy settings. +function isBypassed(uri) { + if (byPassedList.has(uri)) { + return byPassedList.get(uri); } - else if (process.env[Constants.HTTPS_PROXY.toLowerCase()]) { - return process.env[Constants.HTTPS_PROXY.toLowerCase()]; + loadNoProxy(); + var isBypassed = false; + var host = URLBuilder.parse(uri).getHost(); + for (var _i = 0, noProxyList_1 = noProxyList; _i < noProxyList_1.length; _i++) { + var proxyString = noProxyList_1[_i]; + if (proxyString[0] === ".") { + if (uri.endsWith(proxyString)) { + isBypassed = true; + } + else { + if (host === proxyString.slice(1) && host.length === proxyString.length - 1) { + isBypassed = true; + } + } + } + else { + if (host === proxyString) { + isBypassed = true; + } + } } - else if (process.env[Constants.HTTP_PROXY]) { - return process.env[Constants.HTTP_PROXY]; + byPassedList.set(uri, isBypassed); + return isBypassed; +} +function loadNoProxy() { + if (isNoProxyInitalized) { + return; } - else if (process.env[Constants.HTTP_PROXY.toLowerCase()]) { - return process.env[Constants.HTTP_PROXY.toLowerCase()]; + var noProxy = getEnvironmentValue(Constants.NO_PROXY); + if (noProxy) { + var list = noProxy.split(","); + noProxyList = list.map(function (item) { return item.trim(); }).filter(function (item) { return item.length; }); } - return undefined; + isNoProxyInitalized = true; } function getDefaultProxySettings(proxyUrl) { if (!proxyUrl) { @@ -48009,7 +54972,7 @@ var ProxyPolicy = /** @class */ (function (_super) { return _this; } ProxyPolicy.prototype.sendRequest = function (request) { - if (!request.proxySettings) { + if (!request.proxySettings && !isBypassed(request.url)) { request.proxySettings = this.proxySettings; } return this._nextPolicy.sendRequest(request); @@ -48284,6 +55247,51 @@ var DisableResponseDecompressionPolicy = /** @class */ (function (_super) { return DisableResponseDecompressionPolicy; }(BaseRequestPolicy)); +// Copyright (c) Microsoft Corporation. +function ndJsonPolicy() { + return { + create: function (nextPolicy, options) { + return new NdJsonPolicy(nextPolicy, options); + } + }; +} +/** + * NdJsonPolicy that formats a JSON array as newline-delimited JSON + */ +var NdJsonPolicy = /** @class */ (function (_super) { + tslib.__extends(NdJsonPolicy, _super); + /** + * Creates an instance of KeepAlivePolicy. + * + * @param nextPolicy + * @param options + */ + function NdJsonPolicy(nextPolicy, options) { + return _super.call(this, nextPolicy, options) || this; + } + /** + * Sends a request. + * + * @param request + */ + NdJsonPolicy.prototype.sendRequest = function (request) { + return tslib.__awaiter(this, void 0, void 0, function () { + var body; + return tslib.__generator(this, function (_a) { + // There currently isn't a good way to bypass the serializer + if (typeof request.body === "string" && request.body.startsWith("[")) { + body = JSON.parse(request.body); + if (Array.isArray(body)) { + request.body = body.map(function (item) { return JSON.stringify(item) + "\n"; }).join(""); + } + } + return [2 /*return*/, this._nextPolicy.sendRequest(request)]; + }); + }); + }; + return NdJsonPolicy; +}(BaseRequestPolicy)); + // Copyright (c) Microsoft Corporation. /** * @class @@ -48581,7 +55589,7 @@ function serializeRequestBody(serviceClient, httpRequest, operationArguments, op if (operationSpec.requestBody && operationSpec.requestBody.mapper) { httpRequest.body = getOperationArgumentValueFromParameter(serviceClient, operationArguments, operationSpec.requestBody, operationSpec.serializer); var bodyMapper = operationSpec.requestBody.mapper; - var required = bodyMapper.required, xmlName = bodyMapper.xmlName, xmlElementName = bodyMapper.xmlElementName, serializedName = bodyMapper.serializedName; + var required = bodyMapper.required, xmlName = bodyMapper.xmlName, xmlElementName = bodyMapper.xmlElementName, serializedName = bodyMapper.serializedName, xmlNamespace = bodyMapper.xmlNamespace, xmlNamespacePrefix = bodyMapper.xmlNamespacePrefix; var typeName = bodyMapper.type.name; try { if ((httpRequest.body !== undefined && httpRequest.body !== null) || required) { @@ -48589,11 +55597,13 @@ function serializeRequestBody(serviceClient, httpRequest, operationArguments, op httpRequest.body = operationSpec.serializer.serialize(bodyMapper, httpRequest.body, requestBodyParameterPathString); var isStream = typeName === MapperType.Stream; if (operationSpec.isXML) { + var xmlnsKey = xmlNamespacePrefix ? "xmlns:" + xmlNamespacePrefix : "xmlns"; + var value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, httpRequest.body); if (typeName === MapperType.Sequence) { - httpRequest.body = stringifyXML(prepareXMLRootList(httpRequest.body, xmlElementName || xmlName || serializedName), { rootName: xmlName || serializedName }); + httpRequest.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName }); } else if (!isStream) { - httpRequest.body = stringifyXML(httpRequest.body, { + httpRequest.body = stringifyXML(value, { rootName: xmlName || serializedName }); } @@ -48625,6 +55635,18 @@ function serializeRequestBody(serviceClient, httpRequest, operationArguments, op } } } +/** + * Adds an xml namespace to the xml serialized object if needed, otherwise it just returns the value itself + */ +function getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue) { + var _a; + // Composite and Sequence schemas already got their root namespace set during serialization + // We just need to add xmlns to the other schema types + if (xmlNamespace && !["Composite", "Sequence", "Dictionary"].includes(typeName)) { + return { _: serializedValue, $: (_a = {}, _a[xmlnsKey] = xmlNamespace, _a) }; + } + return serializedValue; +} function getValueOrFunctionResult(value, defaultValueCreator) { var result; if (typeof value === "string") { @@ -48667,6 +55689,9 @@ function createDefaultRequestPolicyFactories(authPolicyFactory, options) { } function createPipelineFromOptions(pipelineOptions, authPolicyFactory) { var requestPolicyFactories = []; + if (pipelineOptions.sendStreamingJson) { + requestPolicyFactories.push(ndJsonPolicy()); + } var userAgentValue = undefined; if (pipelineOptions.userAgentOptions && pipelineOptions.userAgentOptions.userAgentPrefix) { var userAgentInfo = []; @@ -48945,16 +55970,14 @@ Object.defineProperty(exports, 'isTokenCredential', { return coreAuth.isTokenCredential; } }); +exports.AccessTokenRefresher = AccessTokenRefresher; exports.ApiKeyCredentials = ApiKeyCredentials; exports.BaseRequestPolicy = BaseRequestPolicy; exports.BasicAuthenticationCredentials = BasicAuthenticationCredentials; -exports.BearerTokenAuthenticationPolicy = BearerTokenAuthenticationPolicy; exports.Constants = Constants; exports.DefaultHttpClient = NodeFetchHttpClient; -exports.DisableResponseDecompressionPolicy = DisableResponseDecompressionPolicy; exports.ExpiringAccessTokenCache = ExpiringAccessTokenCache; exports.HttpHeaders = HttpHeaders; -exports.KeepAlivePolicy = KeepAlivePolicy; exports.MapperType = MapperType; exports.RequestPolicyOptions = RequestPolicyOptions; exports.RestError = RestError; @@ -49003,5 +56026,4 @@ exports.userAgentPolicy = userAgentPolicy; /***/ }) - -/******/ }); \ No newline at end of file +/******/ ]); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 2af5c86..f9da575 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,18 @@ { "name": "cache", - "version": "2.1.2", + "version": "2.1.3", "lockfileVersion": 1, "requires": true, "dependencies": { "@actions/cache": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-1.0.2.tgz", - "integrity": "sha512-CzAseaJ4cKmOI58EIWUb/LfeYdM7Y25s39OEMtWAhEPrPPzrbSEjGHCLaYjJ0V8C4iojo8vBYh5B3OIJ37EiJw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-1.0.3.tgz", + "integrity": "sha512-2DcdMrqbfj5LcsEYIh6ACgjb0bNMeMPP7y1a+bf/Sk0MFfkkrYRNFihkXRV6v0TNkNo0b5X38xmUguRZ5ZPLbw==", "requires": { "@actions/core": "^1.2.4", "@actions/exec": "^1.0.1", "@actions/glob": "^0.1.0", - "@actions/http-client": "^1.0.8", + "@actions/http-client": "^1.0.9", "@actions/io": "^1.0.1", "@azure/ms-rest-js": "^2.0.7", "@azure/storage-blob": "^12.1.2", @@ -43,9 +43,9 @@ } }, "@actions/http-client": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.8.tgz", - "integrity": "sha512-G4JjJ6f9Hb3Zvejj+ewLLKLf99ZC+9v+yCxoYf9vSyH+WkzPLB2LuUtRMGNkooMqdugGBFStIKXOuvH1W+EctA==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.9.tgz", + "integrity": "sha512-0O4SsJ7q+MK0ycvXPl2e6bMXV7dxAXOGjrXS1eTF9s2S401Tp6c/P3c3Joz04QefC1J6Gt942Wl2jbm3f4mLcg==", "requires": { "tunnel": "0.0.6" } @@ -79,23 +79,48 @@ "tslib": "^2.0.0" }, "dependencies": { + "@azure/core-tracing": { + "version": "1.0.0-preview.8", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.8.tgz", + "integrity": "sha512-ZKUpCd7Dlyfn7bdc+/zC/sf0aRIaNQMDuSj2RhYRFe3p70hVAnYGp3TX4cnG2yoEALp/LTj/XnZGQ8Xzf6Ja/Q==", + "requires": { + "@opencensus/web-types": "0.0.7", + "@opentelemetry/api": "^0.6.1", + "tslib": "^1.10.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } + } + }, + "@opentelemetry/api": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-0.6.1.tgz", + "integrity": "sha512-wpufGZa7tTxw7eAsjXJtiyIQ42IWQdX9iUQp7ACJcKo1hCtuhLU+K2Nv1U6oRwT1oAlZTE6m4CgWKZBhOiau3Q==", + "requires": { + "@opentelemetry/context-base": "^0.6.1" + } + }, "tslib": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.0.tgz", - "integrity": "sha512-lTqkx847PI7xEDYJntxZH89L2/aXInsyF2luSafe/+0fHOMjlBNXdH6th7f70qxLDhul7KZK0zC8V5ZIyHl0/g==" + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz", + "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==" } } }, "@azure/core-http": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-1.1.5.tgz", - "integrity": "sha512-4nrA7SzfPxoyTF7hzmN6Zi2RJf57/ZE5rKTSb2oCOrzxKqTRNZrBm0mCDxTLktxsRN1xbNUTxFy5dm/Irb1RCQ==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-1.1.9.tgz", + "integrity": "sha512-wM0HMRNQaE2NtTHb+9FXF7uxUqaAHFTMVu6OzlEll6gUGybcDqM7+9Oklp33BhEfq+ZumpCoqxq3njNbMHuf/w==", "requires": { "@azure/abort-controller": "^1.0.0", "@azure/core-auth": "^1.1.3", - "@azure/core-tracing": "1.0.0-preview.8", + "@azure/core-tracing": "1.0.0-preview.9", "@azure/logger": "^1.0.0", - "@opentelemetry/api": "^0.6.1", + "@opentelemetry/api": "^0.10.2", "@types/node-fetch": "^2.5.0", "@types/tunnel": "^0.0.1", "form-data": "^3.0.0", @@ -129,14 +154,14 @@ } }, "tslib": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.0.tgz", - "integrity": "sha512-lTqkx847PI7xEDYJntxZH89L2/aXInsyF2luSafe/+0fHOMjlBNXdH6th7f70qxLDhul7KZK0zC8V5ZIyHl0/g==" + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz", + "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==" }, "uuid": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz", - "integrity": "sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ==" + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.1.tgz", + "integrity": "sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg==" } } }, @@ -152,21 +177,28 @@ } }, "@azure/core-paging": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.1.1.tgz", - "integrity": "sha512-hqEJBEGKan4YdOaL9ZG/GRG6PXaFd/Wb3SSjQW4LWotZzgl6xqG00h6wmkrpd2NNkbBkD1erLHBO3lPHApv+iQ==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.1.3.tgz", + "integrity": "sha512-his7Ah40ThEYORSpIAwuh6B8wkGwO/zG7gqVtmSE4WAJ46e36zUDXTKReUCLBDc6HmjjApQQxxcRFy5FruG79A==", "requires": { "@azure/core-asynciterator-polyfill": "^1.0.0" } }, "@azure/core-tracing": { - "version": "1.0.0-preview.8", - "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.8.tgz", - "integrity": "sha512-ZKUpCd7Dlyfn7bdc+/zC/sf0aRIaNQMDuSj2RhYRFe3p70hVAnYGp3TX4cnG2yoEALp/LTj/XnZGQ8Xzf6Ja/Q==", + "version": "1.0.0-preview.9", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.9.tgz", + "integrity": "sha512-zczolCLJ5QG42AEPQ+Qg9SRYNUyB+yZ5dzof4YEc+dyWczO9G2sBqbAjLB7IqrsdHN2apkiB2oXeDKCsq48jug==", "requires": { "@opencensus/web-types": "0.0.7", - "@opentelemetry/api": "^0.6.1", - "tslib": "^1.10.0" + "@opentelemetry/api": "^0.10.2", + "tslib": "^2.0.0" + }, + "dependencies": { + "tslib": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz", + "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==" + } } }, "@azure/logger": { @@ -178,9 +210,9 @@ } }, "@azure/ms-rest-js": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.0.8.tgz", - "integrity": "sha512-PO4pnYaF66IAB/RWbhrTprGyhOzDzsgcbT7z8k3O38JKlwifbrhW+8M0fzx0ScZnaacP8rZyBazYMUF9P12c0g==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.1.0.tgz", + "integrity": "sha512-4BXLVImYRt+jcUmEJ5LUWglI8RBNVQndY6IcyvQ4U8O4kIXdmlRz3cJdA/RpXf5rKT38KOoTO2T6Z1f6Z1HDBg==", "requires": { "@types/node-fetch": "^2.3.7", "@types/tunnel": "0.0.1", @@ -217,19 +249,26 @@ } }, "@azure/storage-blob": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.1.2.tgz", - "integrity": "sha512-PCHgG4r3xLt5FaFj+uiMqrRpuzD3TD17cvxCeA1JKK2bJEf8b07H3QRLQVf0DM1MmvYY8FgQagkWZTp+jr9yew==", + "version": "12.2.1", + "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.2.1.tgz", + "integrity": "sha512-erqCSmDL8b/AHZi94nq+nCE+2whQmvBDkAv4N9uic0MRac/gRyZqnsqkfrun/gr2rZo+qVtnMenwkkE3roXn8Q==", "requires": { "@azure/abort-controller": "^1.0.0", - "@azure/core-http": "^1.1.1", + "@azure/core-http": "^1.1.6", "@azure/core-lro": "^1.0.2", "@azure/core-paging": "^1.1.1", - "@azure/core-tracing": "1.0.0-preview.8", + "@azure/core-tracing": "1.0.0-preview.9", "@azure/logger": "^1.0.0", - "@opentelemetry/api": "^0.6.1", + "@opentelemetry/api": "^0.10.2", "events": "^3.0.0", - "tslib": "^1.10.0" + "tslib": "^2.0.0" + }, + "dependencies": { + "tslib": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz", + "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==" + } } }, "@babel/code-frame": { @@ -680,11 +719,18 @@ "integrity": "sha512-xB+w7ZDAu3YBzqH44rCmG9/RlrOmFuDPt/bpf17eJr8eZSrLt7nc7LnWdxM9Mmoj/YKMHpxRg28txu3TcpiL+g==" }, "@opentelemetry/api": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-0.6.1.tgz", - "integrity": "sha512-wpufGZa7tTxw7eAsjXJtiyIQ42IWQdX9iUQp7ACJcKo1hCtuhLU+K2Nv1U6oRwT1oAlZTE6m4CgWKZBhOiau3Q==", + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-0.10.2.tgz", + "integrity": "sha512-GtpMGd6vkzDMYcpu2t9LlhEgMy/SzBwRnz48EejlRArYqZzqSzAsKmegUK7zHgl+EOIaK9mKHhnRaQu3qw20cA==", "requires": { - "@opentelemetry/context-base": "^0.6.1" + "@opentelemetry/context-base": "^0.10.2" + }, + "dependencies": { + "@opentelemetry/context-base": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/context-base/-/context-base-0.10.2.tgz", + "integrity": "sha512-hZNKjKOYsckoOEgBziGMnBcX0M7EtstnCmwz5jZUOUYwlZ+/xxX6z3jPu1XVO2Jivk0eLfuP9GP+vFD49CMetw==" + } } }, "@opentelemetry/context-base": { @@ -4078,9 +4124,9 @@ } }, "node-fetch": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" }, "node-int64": { "version": "0.4.0", diff --git a/package.json b/package.json index e4564ed..4f1d0f1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cache", - "version": "2.1.2", + "version": "2.1.3", "private": true, "description": "Cache dependencies and build outputs", "main": "dist/restore/index.js", @@ -26,7 +26,7 @@ "@actions/core": "^1.2.0", "@actions/exec": "^1.0.1", "@actions/io": "^1.0.1", - "@actions/cache": "^1.0.2" + "@actions/cache": "^1.0.3" }, "devDependencies": { "@types/jest": "^24.0.13",