index.js 1.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520
  1. /******/ (() => { // webpackBootstrap
  2. /******/ var __webpack_modules__ = ({
  3. /***/ 7219:
  4. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5. "use strict";
  6. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  7. if (k2 === undefined) k2 = k;
  8. var desc = Object.getOwnPropertyDescriptor(m, k);
  9. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  10. desc = { enumerable: true, get: function() { return m[k]; } };
  11. }
  12. Object.defineProperty(o, k2, desc);
  13. }) : (function(o, m, k, k2) {
  14. if (k2 === undefined) k2 = k;
  15. o[k2] = m[k];
  16. }));
  17. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  18. Object.defineProperty(o, "default", { enumerable: true, value: v });
  19. }) : function(o, v) {
  20. o["default"] = v;
  21. });
  22. var __importStar = (this && this.__importStar) || function (mod) {
  23. if (mod && mod.__esModule) return mod;
  24. var result = {};
  25. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  26. __setModuleDefault(result, mod);
  27. return result;
  28. };
  29. Object.defineProperty(exports, "__esModule", ({ value: true }));
  30. exports.directoryExistsSync = directoryExistsSync;
  31. exports.existsSync = existsSync;
  32. exports.fileExistsSync = fileExistsSync;
  33. const fs = __importStar(__nccwpck_require__(7147));
  34. function directoryExistsSync(path, required) {
  35. var _a;
  36. if (!path) {
  37. throw new Error("Arg 'path' must not be empty");
  38. }
  39. let stats;
  40. try {
  41. stats = fs.statSync(path);
  42. }
  43. catch (error) {
  44. if ((error === null || error === void 0 ? void 0 : error.code) === 'ENOENT') {
  45. if (!required) {
  46. return false;
  47. }
  48. throw new Error(`Directory '${path}' does not exist`);
  49. }
  50. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  51. }
  52. if (stats.isDirectory()) {
  53. return true;
  54. }
  55. else if (!required) {
  56. return false;
  57. }
  58. throw new Error(`Directory '${path}' does not exist`);
  59. }
  60. function existsSync(path) {
  61. var _a;
  62. if (!path) {
  63. throw new Error("Arg 'path' must not be empty");
  64. }
  65. try {
  66. fs.statSync(path);
  67. }
  68. catch (error) {
  69. if ((error === null || error === void 0 ? void 0 : error.code) === 'ENOENT') {
  70. return false;
  71. }
  72. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  73. }
  74. return true;
  75. }
  76. function fileExistsSync(path) {
  77. var _a;
  78. if (!path) {
  79. throw new Error("Arg 'path' must not be empty");
  80. }
  81. let stats;
  82. try {
  83. stats = fs.statSync(path);
  84. }
  85. catch (error) {
  86. if ((error === null || error === void 0 ? void 0 : error.code) === 'ENOENT') {
  87. return false;
  88. }
  89. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  90. }
  91. if (!stats.isDirectory()) {
  92. return true;
  93. }
  94. return false;
  95. }
  96. /***/ }),
  97. /***/ 2565:
  98. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  99. "use strict";
  100. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  101. if (k2 === undefined) k2 = k;
  102. var desc = Object.getOwnPropertyDescriptor(m, k);
  103. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  104. desc = { enumerable: true, get: function() { return m[k]; } };
  105. }
  106. Object.defineProperty(o, k2, desc);
  107. }) : (function(o, m, k, k2) {
  108. if (k2 === undefined) k2 = k;
  109. o[k2] = m[k];
  110. }));
  111. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  112. Object.defineProperty(o, "default", { enumerable: true, value: v });
  113. }) : function(o, v) {
  114. o["default"] = v;
  115. });
  116. var __importStar = (this && this.__importStar) || function (mod) {
  117. if (mod && mod.__esModule) return mod;
  118. var result = {};
  119. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  120. __setModuleDefault(result, mod);
  121. return result;
  122. };
  123. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  124. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  125. return new (P || (P = Promise))(function (resolve, reject) {
  126. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  127. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  128. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  129. step((generator = generator.apply(thisArg, _arguments || [])).next());
  130. });
  131. };
  132. Object.defineProperty(exports, "__esModule", ({ value: true }));
  133. exports.createAuthHelper = createAuthHelper;
  134. const assert = __importStar(__nccwpck_require__(9491));
  135. const core = __importStar(__nccwpck_require__(2186));
  136. const exec = __importStar(__nccwpck_require__(1514));
  137. const fs = __importStar(__nccwpck_require__(7147));
  138. const io = __importStar(__nccwpck_require__(7436));
  139. const os = __importStar(__nccwpck_require__(2037));
  140. const path = __importStar(__nccwpck_require__(1017));
  141. const regexpHelper = __importStar(__nccwpck_require__(3120));
  142. const stateHelper = __importStar(__nccwpck_require__(4866));
  143. const urlHelper = __importStar(__nccwpck_require__(9437));
  144. const uuid_1 = __nccwpck_require__(5840);
  145. const IS_WINDOWS = process.platform === 'win32';
  146. // Use case-insensitive gitdir matching on Windows to handle path casing mismatches
  147. // between the runner's GITHUB_WORKSPACE and the actual filesystem casing.
  148. // See: https://github.com/actions/checkout/issues/2345
  149. const INCLUDE_IF_GITDIR = IS_WINDOWS
  150. ? 'includeIf.gitdir/i:'
  151. : 'includeIf.gitdir:';
  152. const SSH_COMMAND_KEY = 'core.sshCommand';
  153. function createAuthHelper(git, settings) {
  154. return new GitAuthHelper(git, settings);
  155. }
  156. class GitAuthHelper {
  157. constructor(gitCommandManager, gitSourceSettings) {
  158. this.insteadOfValues = [];
  159. this.sshCommand = '';
  160. this.sshKeyPath = '';
  161. this.sshKnownHostsPath = '';
  162. this.temporaryHomePath = '';
  163. this.credentialsConfigPath = ''; // Path to separate credentials config file in RUNNER_TEMP
  164. this.git = gitCommandManager;
  165. this.settings = gitSourceSettings || {};
  166. // Token auth header
  167. const serverUrl = urlHelper.getServerUrl(this.settings.githubServerUrl);
  168. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  169. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  170. core.setSecret(basicCredential);
  171. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  172. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  173. // Instead of SSH URL
  174. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  175. this.insteadOfValues.push(`git@${serverUrl.hostname}:`);
  176. if (this.settings.workflowOrganizationId) {
  177. this.insteadOfValues.push(`org-${this.settings.workflowOrganizationId}@github.com:`);
  178. }
  179. }
  180. configureAuth() {
  181. return __awaiter(this, void 0, void 0, function* () {
  182. // Remove possible previous values
  183. yield this.removeAuth();
  184. // Configure new values
  185. yield this.configureSsh();
  186. yield this.configureToken();
  187. });
  188. }
  189. configureTempGlobalConfig() {
  190. return __awaiter(this, void 0, void 0, function* () {
  191. var _a;
  192. // Already setup global config
  193. if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.length) > 0) {
  194. return path.join(this.temporaryHomePath, '.gitconfig');
  195. }
  196. // Create a temp home directory
  197. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  198. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  199. const uniqueId = (0, uuid_1.v4)();
  200. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  201. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  202. // Copy the global git config
  203. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  204. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  205. let configExists = false;
  206. try {
  207. yield fs.promises.stat(gitConfigPath);
  208. configExists = true;
  209. }
  210. catch (err) {
  211. if ((err === null || err === void 0 ? void 0 : err.code) !== 'ENOENT') {
  212. throw err;
  213. }
  214. }
  215. if (configExists) {
  216. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  217. yield io.cp(gitConfigPath, newGitConfigPath);
  218. }
  219. else {
  220. yield fs.promises.writeFile(newGitConfigPath, '');
  221. }
  222. // Override HOME
  223. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  224. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  225. return newGitConfigPath;
  226. });
  227. }
  228. configureGlobalAuth() {
  229. return __awaiter(this, void 0, void 0, function* () {
  230. // 'configureTempGlobalConfig' noops if already set, just returns the path
  231. yield this.configureTempGlobalConfig();
  232. try {
  233. // Configure the token
  234. yield this.configureToken(true);
  235. // Configure HTTPS instead of SSH
  236. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  237. if (!this.settings.sshKey) {
  238. for (const insteadOfValue of this.insteadOfValues) {
  239. yield this.git.config(this.insteadOfKey, insteadOfValue, true, // globalConfig?
  240. true // add?
  241. );
  242. }
  243. }
  244. }
  245. catch (err) {
  246. // Unset in case somehow written to the real global config
  247. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  248. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  249. throw err;
  250. }
  251. });
  252. }
  253. configureSubmoduleAuth() {
  254. return __awaiter(this, void 0, void 0, function* () {
  255. // Remove possible previous HTTPS instead of SSH
  256. yield this.removeSubmoduleGitConfig(this.insteadOfKey);
  257. if (this.settings.persistCredentials) {
  258. // Get the credentials config file path in RUNNER_TEMP
  259. const credentialsConfigPath = this.getCredentialsConfigPath();
  260. // Container credentials config path
  261. const containerCredentialsPath = path.posix.join('/github/runner_temp', path.basename(credentialsConfigPath));
  262. // Get submodule config file paths.
  263. const configPaths = yield this.git.getSubmoduleConfigPaths(this.settings.nestedSubmodules);
  264. // For each submodule, configure includeIf entries pointing to the shared credentials file.
  265. // Configure both host and container paths to support Docker container actions.
  266. for (const configPath of configPaths) {
  267. // Submodule Git directory
  268. let submoduleGitDir = path.dirname(configPath); // The config file is at .git/modules/submodule-name/config
  269. submoduleGitDir = submoduleGitDir.replace(/\\/g, '/'); // Use forward slashes, even on Windows
  270. // Configure host includeIf
  271. yield this.git.config(`${INCLUDE_IF_GITDIR}${submoduleGitDir}.path`, credentialsConfigPath, false, // globalConfig?
  272. false, // add?
  273. configPath);
  274. // Container submodule git directory
  275. const githubWorkspace = process.env['GITHUB_WORKSPACE'];
  276. assert.ok(githubWorkspace, 'GITHUB_WORKSPACE is not defined');
  277. let relativeSubmoduleGitDir = path.relative(githubWorkspace, submoduleGitDir);
  278. relativeSubmoduleGitDir = relativeSubmoduleGitDir.replace(/\\/g, '/'); // Use forward slashes, even on Windows
  279. const containerSubmoduleGitDir = path.posix.join('/github/workspace', relativeSubmoduleGitDir);
  280. // Configure container includeIf
  281. yield this.git.config(`${INCLUDE_IF_GITDIR}${containerSubmoduleGitDir}.path`, containerCredentialsPath, false, // globalConfig?
  282. false, // add?
  283. configPath);
  284. }
  285. if (this.settings.sshKey) {
  286. // Configure core.sshCommand
  287. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  288. }
  289. else {
  290. // Configure HTTPS instead of SSH
  291. for (const insteadOfValue of this.insteadOfValues) {
  292. yield this.git.submoduleForeach(`git config --local --add '${this.insteadOfKey}' '${insteadOfValue}'`, this.settings.nestedSubmodules);
  293. }
  294. }
  295. }
  296. });
  297. }
  298. removeAuth() {
  299. return __awaiter(this, void 0, void 0, function* () {
  300. yield this.removeSsh();
  301. yield this.removeToken();
  302. });
  303. }
  304. removeGlobalConfig() {
  305. return __awaiter(this, void 0, void 0, function* () {
  306. var _a;
  307. if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.length) > 0) {
  308. core.debug(`Unsetting HOME override`);
  309. this.git.removeEnvironmentVariable('HOME');
  310. yield io.rmRF(this.temporaryHomePath);
  311. }
  312. });
  313. }
  314. /**
  315. * Configures SSH authentication by writing the SSH key and known hosts,
  316. * and setting up the GIT_SSH_COMMAND environment variable.
  317. */
  318. configureSsh() {
  319. return __awaiter(this, void 0, void 0, function* () {
  320. if (!this.settings.sshKey) {
  321. return;
  322. }
  323. // Write key
  324. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  325. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  326. const uniqueId = (0, uuid_1.v4)();
  327. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  328. stateHelper.setSshKeyPath(this.sshKeyPath);
  329. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  330. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  331. // Remove inherited permissions on Windows
  332. if (IS_WINDOWS) {
  333. const icacls = yield io.which('icacls.exe');
  334. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  335. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  336. }
  337. // Write known hosts
  338. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  339. let userKnownHosts = '';
  340. try {
  341. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  342. }
  343. catch (err) {
  344. if ((err === null || err === void 0 ? void 0 : err.code) !== 'ENOENT') {
  345. throw err;
  346. }
  347. }
  348. let knownHosts = '';
  349. if (userKnownHosts) {
  350. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  351. }
  352. if (this.settings.sshKnownHosts) {
  353. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  354. }
  355. knownHosts += `# Begin implicitly added github.com\ngithub.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=\n# End implicitly added github.com\n`;
  356. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  357. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  358. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  359. // Configure GIT_SSH_COMMAND
  360. const sshPath = yield io.which('ssh', true);
  361. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  362. if (this.settings.sshStrict) {
  363. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  364. }
  365. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  366. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  367. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  368. // Configure core.sshCommand
  369. if (this.settings.persistCredentials) {
  370. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  371. }
  372. });
  373. }
  374. /**
  375. * Configures token-based authentication by creating a credentials config file
  376. * and setting up includeIf entries to reference it.
  377. * @param globalConfig Whether to configure global config instead of local
  378. */
  379. configureToken(globalConfig) {
  380. return __awaiter(this, void 0, void 0, function* () {
  381. // Get the credentials config file path in RUNNER_TEMP
  382. const credentialsConfigPath = this.getCredentialsConfigPath();
  383. // Write placeholder to the separate credentials config file using git config.
  384. // This approach avoids the credential being captured by process creation audit events,
  385. // which are commonly logged. For more information, refer to
  386. // https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  387. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, false, // globalConfig?
  388. false, // add?
  389. credentialsConfigPath);
  390. // Replace the placeholder in the credentials config file
  391. let content = (yield fs.promises.readFile(credentialsConfigPath)).toString();
  392. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  393. if (placeholderIndex < 0 ||
  394. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  395. throw new Error(`Unable to replace auth placeholder in ${credentialsConfigPath}`);
  396. }
  397. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  398. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  399. yield fs.promises.writeFile(credentialsConfigPath, content);
  400. // Add include or includeIf to reference the credentials config
  401. if (globalConfig) {
  402. // Global config file is temporary
  403. yield this.git.config('include.path', credentialsConfigPath, true // globalConfig?
  404. );
  405. }
  406. else {
  407. // Host git directory
  408. let gitDir = path.join(this.git.getWorkingDirectory(), '.git');
  409. gitDir = gitDir.replace(/\\/g, '/'); // Use forward slashes, even on Windows
  410. // Configure host includeIf
  411. const hostIncludeKey = `${INCLUDE_IF_GITDIR}${gitDir}.path`;
  412. yield this.git.config(hostIncludeKey, credentialsConfigPath);
  413. // Configure host includeIf for worktrees
  414. const hostWorktreeIncludeKey = `${INCLUDE_IF_GITDIR}${gitDir}/worktrees/*.path`;
  415. yield this.git.config(hostWorktreeIncludeKey, credentialsConfigPath);
  416. // Container git directory
  417. const workingDirectory = this.git.getWorkingDirectory();
  418. const githubWorkspace = process.env['GITHUB_WORKSPACE'];
  419. assert.ok(githubWorkspace, 'GITHUB_WORKSPACE is not defined');
  420. let relativePath = path.relative(githubWorkspace, workingDirectory);
  421. relativePath = relativePath.replace(/\\/g, '/'); // Use forward slashes, even on Windows
  422. const containerGitDir = path.posix.join('/github/workspace', relativePath, '.git');
  423. // Container credentials config path
  424. const containerCredentialsPath = path.posix.join('/github/runner_temp', path.basename(credentialsConfigPath));
  425. // Configure container includeIf
  426. const containerIncludeKey = `${INCLUDE_IF_GITDIR}${containerGitDir}.path`;
  427. yield this.git.config(containerIncludeKey, containerCredentialsPath);
  428. // Configure container includeIf for worktrees
  429. const containerWorktreeIncludeKey = `${INCLUDE_IF_GITDIR}${containerGitDir}/worktrees/*.path`;
  430. yield this.git.config(containerWorktreeIncludeKey, containerCredentialsPath);
  431. }
  432. });
  433. }
  434. /**
  435. * Gets or creates the path to the credentials config file in RUNNER_TEMP.
  436. * @returns The absolute path to the credentials config file
  437. */
  438. getCredentialsConfigPath() {
  439. if (this.credentialsConfigPath) {
  440. return this.credentialsConfigPath;
  441. }
  442. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  443. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  444. // Create a unique filename for this checkout instance
  445. const configFileName = `git-credentials-${(0, uuid_1.v4)()}.config`;
  446. this.credentialsConfigPath = path.join(runnerTemp, configFileName);
  447. core.debug(`Credentials config path: ${this.credentialsConfigPath}`);
  448. return this.credentialsConfigPath;
  449. }
  450. /**
  451. * Removes SSH authentication configuration by cleaning up SSH keys,
  452. * known hosts files, and SSH command configurations.
  453. */
  454. removeSsh() {
  455. return __awaiter(this, void 0, void 0, function* () {
  456. var _a, _b;
  457. // SSH key
  458. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  459. if (keyPath) {
  460. try {
  461. core.info(`Removing SSH key '${keyPath}'`);
  462. yield io.rmRF(keyPath);
  463. }
  464. catch (err) {
  465. core.debug(`${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`);
  466. core.warning(`Failed to remove SSH key '${keyPath}'`);
  467. }
  468. }
  469. // SSH known hosts
  470. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  471. if (knownHostsPath) {
  472. try {
  473. core.info(`Removing SSH known hosts '${knownHostsPath}'`);
  474. yield io.rmRF(knownHostsPath);
  475. }
  476. catch (err) {
  477. core.debug(`${(_b = err === null || err === void 0 ? void 0 : err.message) !== null && _b !== void 0 ? _b : err}`);
  478. core.warning(`Failed to remove SSH known hosts '${knownHostsPath}'`);
  479. }
  480. }
  481. // SSH command
  482. core.info('Removing SSH command configuration');
  483. yield this.removeGitConfig(SSH_COMMAND_KEY);
  484. yield this.removeSubmoduleGitConfig(SSH_COMMAND_KEY);
  485. });
  486. }
  487. /**
  488. * Removes token-based authentication by cleaning up HTTP headers,
  489. * includeIf entries, and credentials config files.
  490. */
  491. removeToken() {
  492. return __awaiter(this, void 0, void 0, function* () {
  493. var _a;
  494. // Remove HTTP extra header
  495. core.info('Removing HTTP extra header');
  496. yield this.removeGitConfig(this.tokenConfigKey);
  497. yield this.removeSubmoduleGitConfig(this.tokenConfigKey);
  498. // Collect credentials config paths that need to be removed
  499. const credentialsPaths = new Set();
  500. // Remove includeIf entries that point to git-credentials-*.config files
  501. core.info('Removing includeIf entries pointing to credentials config files');
  502. const mainCredentialsPaths = yield this.removeIncludeIfCredentials();
  503. mainCredentialsPaths.forEach(path => credentialsPaths.add(path));
  504. // Remove submodule includeIf entries that point to git-credentials-*.config files
  505. const submoduleConfigPaths = yield this.git.getSubmoduleConfigPaths(true);
  506. for (const configPath of submoduleConfigPaths) {
  507. const submoduleCredentialsPaths = yield this.removeIncludeIfCredentials(configPath);
  508. submoduleCredentialsPaths.forEach(path => credentialsPaths.add(path));
  509. }
  510. // Remove credentials config files
  511. for (const credentialsPath of credentialsPaths) {
  512. // Only remove credentials config files if they are under RUNNER_TEMP
  513. const runnerTemp = process.env['RUNNER_TEMP'];
  514. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  515. if (credentialsPath.startsWith(runnerTemp)) {
  516. try {
  517. core.info(`Removing credentials config '${credentialsPath}'`);
  518. yield io.rmRF(credentialsPath);
  519. }
  520. catch (err) {
  521. core.debug(`${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`);
  522. core.warning(`Failed to remove credentials config '${credentialsPath}'`);
  523. }
  524. }
  525. else {
  526. core.debug(`Skipping removal of credentials config '${credentialsPath}' - not under RUNNER_TEMP`);
  527. }
  528. }
  529. });
  530. }
  531. /**
  532. * Removes a git config key from the local repository config.
  533. * @param configKey The git config key to remove
  534. */
  535. removeGitConfig(configKey) {
  536. return __awaiter(this, void 0, void 0, function* () {
  537. if ((yield this.git.configExists(configKey)) &&
  538. !(yield this.git.tryConfigUnset(configKey))) {
  539. // Load the config contents
  540. core.warning(`Failed to remove '${configKey}' from the git config`);
  541. }
  542. });
  543. }
  544. /**
  545. * Removes a git config key from all submodule configs.
  546. * @param configKey The git config key to remove
  547. */
  548. removeSubmoduleGitConfig(configKey) {
  549. return __awaiter(this, void 0, void 0, function* () {
  550. const pattern = regexpHelper.escape(configKey);
  551. yield this.git.submoduleForeach(
  552. // Wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline.
  553. `sh -c "git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :"`, true);
  554. });
  555. }
  556. /**
  557. * Removes includeIf entries that point to git-credentials-*.config files.
  558. * @param configPath Optional path to a specific git config file to operate on
  559. * @returns Array of unique credentials config file paths that were found and removed
  560. */
  561. removeIncludeIfCredentials(configPath) {
  562. return __awaiter(this, void 0, void 0, function* () {
  563. const credentialsPaths = new Set();
  564. try {
  565. // Get all includeIf.gitdir keys
  566. const keys = yield this.git.tryGetConfigKeys('^includeIf\\.gitdir(/i)?:', false, // globalConfig?
  567. configPath);
  568. for (const key of keys) {
  569. // Get all values for this key
  570. const values = yield this.git.tryGetConfigValues(key, false, // globalConfig?
  571. configPath);
  572. if (values.length > 0) {
  573. // Remove only values that match git-credentials-<uuid>.config pattern
  574. for (const value of values) {
  575. if (this.testCredentialsConfigPath(value)) {
  576. credentialsPaths.add(value);
  577. yield this.git.tryConfigUnsetValue(key, value, false, configPath);
  578. }
  579. }
  580. }
  581. }
  582. }
  583. catch (err) {
  584. // Ignore errors - this is cleanup code
  585. if (configPath) {
  586. core.debug(`Error during includeIf cleanup for ${configPath}: ${err}`);
  587. }
  588. else {
  589. core.debug(`Error during includeIf cleanup: ${err}`);
  590. }
  591. }
  592. return Array.from(credentialsPaths);
  593. });
  594. }
  595. /**
  596. * Tests if a path matches the git-credentials-*.config pattern.
  597. * @param path The path to test
  598. * @returns True if the path matches the credentials config pattern
  599. */
  600. testCredentialsConfigPath(path) {
  601. return /git-credentials-[0-9a-f-]+\.config$/i.test(path);
  602. }
  603. }
  604. /***/ }),
  605. /***/ 738:
  606. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  607. "use strict";
  608. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  609. if (k2 === undefined) k2 = k;
  610. var desc = Object.getOwnPropertyDescriptor(m, k);
  611. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  612. desc = { enumerable: true, get: function() { return m[k]; } };
  613. }
  614. Object.defineProperty(o, k2, desc);
  615. }) : (function(o, m, k, k2) {
  616. if (k2 === undefined) k2 = k;
  617. o[k2] = m[k];
  618. }));
  619. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  620. Object.defineProperty(o, "default", { enumerable: true, value: v });
  621. }) : function(o, v) {
  622. o["default"] = v;
  623. });
  624. var __importStar = (this && this.__importStar) || function (mod) {
  625. if (mod && mod.__esModule) return mod;
  626. var result = {};
  627. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  628. __setModuleDefault(result, mod);
  629. return result;
  630. };
  631. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  632. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  633. return new (P || (P = Promise))(function (resolve, reject) {
  634. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  635. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  636. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  637. step((generator = generator.apply(thisArg, _arguments || [])).next());
  638. });
  639. };
  640. Object.defineProperty(exports, "__esModule", ({ value: true }));
  641. exports.MinimumGitSparseCheckoutVersion = exports.MinimumGitVersion = void 0;
  642. exports.createCommandManager = createCommandManager;
  643. const core = __importStar(__nccwpck_require__(2186));
  644. const exec = __importStar(__nccwpck_require__(1514));
  645. const fs = __importStar(__nccwpck_require__(7147));
  646. const fshelper = __importStar(__nccwpck_require__(7219));
  647. const io = __importStar(__nccwpck_require__(7436));
  648. const path = __importStar(__nccwpck_require__(1017));
  649. const regexpHelper = __importStar(__nccwpck_require__(3120));
  650. const retryHelper = __importStar(__nccwpck_require__(2155));
  651. const git_version_1 = __nccwpck_require__(3142);
  652. // Auth header not supported before 2.9
  653. // Wire protocol v2 not supported before 2.18
  654. // sparse-checkout not [well-]supported before 2.28 (see https://github.com/actions/checkout/issues/1386)
  655. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  656. exports.MinimumGitSparseCheckoutVersion = new git_version_1.GitVersion('2.28');
  657. function createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  658. return __awaiter(this, void 0, void 0, function* () {
  659. return yield GitCommandManager.createCommandManager(workingDirectory, lfs, doSparseCheckout);
  660. });
  661. }
  662. class GitCommandManager {
  663. // Private constructor; use createCommandManager()
  664. constructor() {
  665. this.gitEnv = {
  666. GIT_TERMINAL_PROMPT: '0', // Disable git prompt
  667. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  668. };
  669. this.gitPath = '';
  670. this.lfs = false;
  671. this.doSparseCheckout = false;
  672. this.workingDirectory = '';
  673. this.gitVersion = new git_version_1.GitVersion();
  674. }
  675. branchDelete(remote, branch) {
  676. return __awaiter(this, void 0, void 0, function* () {
  677. const args = ['branch', '--delete', '--force'];
  678. if (remote) {
  679. args.push('--remote');
  680. }
  681. args.push(branch);
  682. yield this.execGit(args);
  683. });
  684. }
  685. branchExists(remote, pattern) {
  686. return __awaiter(this, void 0, void 0, function* () {
  687. const args = ['branch', '--list'];
  688. if (remote) {
  689. args.push('--remote');
  690. }
  691. args.push(pattern);
  692. const output = yield this.execGit(args);
  693. return !!output.stdout.trim();
  694. });
  695. }
  696. branchList(remote) {
  697. return __awaiter(this, void 0, void 0, function* () {
  698. const result = [];
  699. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  700. // "branch --list" is more difficult when in a detached HEAD state.
  701. // TODO(https://github.com/actions/checkout/issues/786): this implementation uses
  702. // "rev-parse --symbolic-full-name" because there is a bug
  703. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names. When
  704. // 2.18 is no longer supported, we can switch back to --symbolic.
  705. const args = ['rev-parse', '--symbolic-full-name'];
  706. if (remote) {
  707. args.push('--remotes=origin');
  708. }
  709. else {
  710. args.push('--branches');
  711. }
  712. const stderr = [];
  713. const errline = [];
  714. const stdout = [];
  715. const stdline = [];
  716. const listeners = {
  717. stderr: (data) => {
  718. stderr.push(data.toString());
  719. },
  720. errline: (data) => {
  721. errline.push(data.toString());
  722. },
  723. stdout: (data) => {
  724. stdout.push(data.toString());
  725. },
  726. stdline: (data) => {
  727. stdline.push(data.toString());
  728. }
  729. };
  730. // Suppress the output in order to avoid flooding annotations with innocuous errors.
  731. yield this.execGit(args, false, true, listeners);
  732. core.debug(`stderr callback is: ${stderr}`);
  733. core.debug(`errline callback is: ${errline}`);
  734. core.debug(`stdout callback is: ${stdout}`);
  735. core.debug(`stdline callback is: ${stdline}`);
  736. for (let branch of stdline) {
  737. branch = branch.trim();
  738. if (!branch) {
  739. continue;
  740. }
  741. if (branch.startsWith('refs/heads/')) {
  742. branch = branch.substring('refs/heads/'.length);
  743. }
  744. else if (branch.startsWith('refs/remotes/')) {
  745. branch = branch.substring('refs/remotes/'.length);
  746. }
  747. result.push(branch);
  748. }
  749. return result;
  750. });
  751. }
  752. disableSparseCheckout() {
  753. return __awaiter(this, void 0, void 0, function* () {
  754. yield this.execGit(['sparse-checkout', 'disable']);
  755. // Disabling 'sparse-checkout` leaves behind an undesirable side-effect in config (even in a pristine environment).
  756. yield this.tryConfigUnset('extensions.worktreeConfig', false);
  757. });
  758. }
  759. sparseCheckout(sparseCheckout) {
  760. return __awaiter(this, void 0, void 0, function* () {
  761. yield this.execGit(['sparse-checkout', 'set', ...sparseCheckout]);
  762. });
  763. }
  764. sparseCheckoutNonConeMode(sparseCheckout) {
  765. return __awaiter(this, void 0, void 0, function* () {
  766. yield this.execGit(['config', 'core.sparseCheckout', 'true']);
  767. const output = yield this.execGit([
  768. 'rev-parse',
  769. '--git-path',
  770. 'info/sparse-checkout'
  771. ]);
  772. const sparseCheckoutPath = path.join(this.workingDirectory, output.stdout.trimRight());
  773. yield fs.promises.appendFile(sparseCheckoutPath, `\n${sparseCheckout.join('\n')}\n`);
  774. });
  775. }
  776. checkout(ref, startPoint) {
  777. return __awaiter(this, void 0, void 0, function* () {
  778. const args = ['checkout', '--progress', '--force'];
  779. if (startPoint) {
  780. args.push('-B', ref, startPoint);
  781. }
  782. else {
  783. args.push(ref);
  784. }
  785. yield this.execGit(args);
  786. });
  787. }
  788. checkoutDetach() {
  789. return __awaiter(this, void 0, void 0, function* () {
  790. const args = ['checkout', '--detach'];
  791. yield this.execGit(args);
  792. });
  793. }
  794. config(configKey, configValue, globalConfig, add, configFile) {
  795. return __awaiter(this, void 0, void 0, function* () {
  796. const args = ['config'];
  797. if (configFile) {
  798. args.push('--file', configFile);
  799. }
  800. else {
  801. args.push(globalConfig ? '--global' : '--local');
  802. }
  803. if (add) {
  804. args.push('--add');
  805. }
  806. args.push(...[configKey, configValue]);
  807. yield this.execGit(args);
  808. });
  809. }
  810. configExists(configKey, globalConfig) {
  811. return __awaiter(this, void 0, void 0, function* () {
  812. const pattern = regexpHelper.escape(configKey);
  813. const output = yield this.execGit([
  814. 'config',
  815. globalConfig ? '--global' : '--local',
  816. '--name-only',
  817. '--get-regexp',
  818. pattern
  819. ], true);
  820. return output.exitCode === 0;
  821. });
  822. }
  823. fetch(refSpec, options) {
  824. return __awaiter(this, void 0, void 0, function* () {
  825. const args = ['-c', 'protocol.version=2', 'fetch'];
  826. // Always use --no-tags for explicit control over tag fetching
  827. // Tags are fetched explicitly via refspec when needed
  828. args.push('--no-tags');
  829. args.push('--prune', '--no-recurse-submodules');
  830. if (options.showProgress) {
  831. args.push('--progress');
  832. }
  833. if (options.filter) {
  834. args.push(`--filter=${options.filter}`);
  835. }
  836. if (options.fetchDepth && options.fetchDepth > 0) {
  837. args.push(`--depth=${options.fetchDepth}`);
  838. }
  839. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  840. args.push('--unshallow');
  841. }
  842. args.push('origin');
  843. for (const arg of refSpec) {
  844. args.push(arg);
  845. }
  846. const that = this;
  847. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  848. yield that.execGit(args);
  849. }));
  850. });
  851. }
  852. getDefaultBranch(repositoryUrl) {
  853. return __awaiter(this, void 0, void 0, function* () {
  854. let output;
  855. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  856. output = yield this.execGit([
  857. 'ls-remote',
  858. '--quiet',
  859. '--exit-code',
  860. '--symref',
  861. repositoryUrl,
  862. 'HEAD'
  863. ]);
  864. }));
  865. if (output) {
  866. // Satisfy compiler, will always be set
  867. for (let line of output.stdout.trim().split('\n')) {
  868. line = line.trim();
  869. if (line.startsWith('ref:') || line.endsWith('HEAD')) {
  870. return line
  871. .substr('ref:'.length, line.length - 'ref:'.length - 'HEAD'.length)
  872. .trim();
  873. }
  874. }
  875. }
  876. throw new Error('Unexpected output when retrieving default branch');
  877. });
  878. }
  879. getSubmoduleConfigPaths(recursive) {
  880. return __awaiter(this, void 0, void 0, function* () {
  881. // Get submodule config file paths.
  882. // Use `--show-origin` to get the config file path for each submodule.
  883. const output = yield this.submoduleForeach(`git config --local --show-origin --name-only --get-regexp remote.origin.url`, recursive);
  884. // Extract config file paths from the output (lines starting with "file:").
  885. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  886. return configPaths;
  887. });
  888. }
  889. getWorkingDirectory() {
  890. return this.workingDirectory;
  891. }
  892. init() {
  893. return __awaiter(this, void 0, void 0, function* () {
  894. yield this.execGit(['init', this.workingDirectory]);
  895. });
  896. }
  897. isDetached() {
  898. return __awaiter(this, void 0, void 0, function* () {
  899. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  900. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  901. return !output.stdout.trim().startsWith('refs/heads/');
  902. });
  903. }
  904. lfsFetch(ref) {
  905. return __awaiter(this, void 0, void 0, function* () {
  906. const args = ['lfs', 'fetch', 'origin', ref];
  907. const that = this;
  908. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  909. yield that.execGit(args);
  910. }));
  911. });
  912. }
  913. lfsInstall() {
  914. return __awaiter(this, void 0, void 0, function* () {
  915. yield this.execGit(['lfs', 'install', '--local']);
  916. });
  917. }
  918. log1(format) {
  919. return __awaiter(this, void 0, void 0, function* () {
  920. const args = format ? ['log', '-1', format] : ['log', '-1'];
  921. const silent = format ? false : true;
  922. const output = yield this.execGit(args, false, silent);
  923. return output.stdout;
  924. });
  925. }
  926. remoteAdd(remoteName, remoteUrl) {
  927. return __awaiter(this, void 0, void 0, function* () {
  928. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  929. });
  930. }
  931. removeEnvironmentVariable(name) {
  932. delete this.gitEnv[name];
  933. }
  934. /**
  935. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  936. * For an annotated tag, the tag SHA is returned.
  937. * @param {string} ref For example: 'refs/heads/main' or '/refs/tags/v1'
  938. * @returns {Promise<string>}
  939. */
  940. revParse(ref) {
  941. return __awaiter(this, void 0, void 0, function* () {
  942. const output = yield this.execGit(['rev-parse', ref]);
  943. return output.stdout.trim();
  944. });
  945. }
  946. setEnvironmentVariable(name, value) {
  947. this.gitEnv[name] = value;
  948. }
  949. shaExists(sha) {
  950. return __awaiter(this, void 0, void 0, function* () {
  951. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  952. const output = yield this.execGit(args, true);
  953. return output.exitCode === 0;
  954. });
  955. }
  956. submoduleForeach(command, recursive) {
  957. return __awaiter(this, void 0, void 0, function* () {
  958. const args = ['submodule', 'foreach'];
  959. if (recursive) {
  960. args.push('--recursive');
  961. }
  962. args.push(command);
  963. const output = yield this.execGit(args);
  964. return output.stdout;
  965. });
  966. }
  967. submoduleSync(recursive) {
  968. return __awaiter(this, void 0, void 0, function* () {
  969. const args = ['submodule', 'sync'];
  970. if (recursive) {
  971. args.push('--recursive');
  972. }
  973. yield this.execGit(args);
  974. });
  975. }
  976. submoduleUpdate(fetchDepth, recursive) {
  977. return __awaiter(this, void 0, void 0, function* () {
  978. const args = ['-c', 'protocol.version=2'];
  979. args.push('submodule', 'update', '--init', '--force');
  980. if (fetchDepth > 0) {
  981. args.push(`--depth=${fetchDepth}`);
  982. }
  983. if (recursive) {
  984. args.push('--recursive');
  985. }
  986. yield this.execGit(args);
  987. });
  988. }
  989. submoduleStatus() {
  990. return __awaiter(this, void 0, void 0, function* () {
  991. const output = yield this.execGit(['submodule', 'status'], true);
  992. core.debug(output.stdout);
  993. return output.exitCode === 0;
  994. });
  995. }
  996. tagExists(pattern) {
  997. return __awaiter(this, void 0, void 0, function* () {
  998. const output = yield this.execGit(['tag', '--list', pattern]);
  999. return !!output.stdout.trim();
  1000. });
  1001. }
  1002. tryClean() {
  1003. return __awaiter(this, void 0, void 0, function* () {
  1004. const output = yield this.execGit(['clean', '-ffdx'], true);
  1005. return output.exitCode === 0;
  1006. });
  1007. }
  1008. tryConfigUnset(configKey, globalConfig) {
  1009. return __awaiter(this, void 0, void 0, function* () {
  1010. const output = yield this.execGit([
  1011. 'config',
  1012. globalConfig ? '--global' : '--local',
  1013. '--unset-all',
  1014. configKey
  1015. ], true);
  1016. return output.exitCode === 0;
  1017. });
  1018. }
  1019. tryConfigUnsetValue(configKey, configValue, globalConfig, configFile) {
  1020. return __awaiter(this, void 0, void 0, function* () {
  1021. const args = ['config'];
  1022. if (configFile) {
  1023. args.push('--file', configFile);
  1024. }
  1025. else {
  1026. args.push(globalConfig ? '--global' : '--local');
  1027. }
  1028. args.push('--unset', configKey, configValue);
  1029. const output = yield this.execGit(args, true);
  1030. return output.exitCode === 0;
  1031. });
  1032. }
  1033. tryDisableAutomaticGarbageCollection() {
  1034. return __awaiter(this, void 0, void 0, function* () {
  1035. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  1036. return output.exitCode === 0;
  1037. });
  1038. }
  1039. tryGetFetchUrl() {
  1040. return __awaiter(this, void 0, void 0, function* () {
  1041. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  1042. if (output.exitCode !== 0) {
  1043. return '';
  1044. }
  1045. const stdout = output.stdout.trim();
  1046. if (stdout.includes('\n')) {
  1047. return '';
  1048. }
  1049. return stdout;
  1050. });
  1051. }
  1052. tryGetConfigValues(configKey, globalConfig, configFile) {
  1053. return __awaiter(this, void 0, void 0, function* () {
  1054. const args = ['config'];
  1055. if (configFile) {
  1056. args.push('--file', configFile);
  1057. }
  1058. else {
  1059. args.push(globalConfig ? '--global' : '--local');
  1060. }
  1061. args.push('--get-all', configKey);
  1062. const output = yield this.execGit(args, true);
  1063. if (output.exitCode !== 0) {
  1064. return [];
  1065. }
  1066. return output.stdout
  1067. .trim()
  1068. .split('\n')
  1069. .filter(value => value.trim());
  1070. });
  1071. }
  1072. tryGetConfigKeys(pattern, globalConfig, configFile) {
  1073. return __awaiter(this, void 0, void 0, function* () {
  1074. const args = ['config'];
  1075. if (configFile) {
  1076. args.push('--file', configFile);
  1077. }
  1078. else {
  1079. args.push(globalConfig ? '--global' : '--local');
  1080. }
  1081. args.push('--name-only', '--get-regexp', pattern);
  1082. const output = yield this.execGit(args, true);
  1083. if (output.exitCode !== 0) {
  1084. return [];
  1085. }
  1086. return output.stdout
  1087. .trim()
  1088. .split('\n')
  1089. .filter(key => key.trim());
  1090. });
  1091. }
  1092. tryReset() {
  1093. return __awaiter(this, void 0, void 0, function* () {
  1094. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  1095. return output.exitCode === 0;
  1096. });
  1097. }
  1098. version() {
  1099. return __awaiter(this, void 0, void 0, function* () {
  1100. return this.gitVersion;
  1101. });
  1102. }
  1103. static createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  1104. return __awaiter(this, void 0, void 0, function* () {
  1105. const result = new GitCommandManager();
  1106. yield result.initializeCommandManager(workingDirectory, lfs, doSparseCheckout);
  1107. return result;
  1108. });
  1109. }
  1110. execGit(args_1) {
  1111. return __awaiter(this, arguments, void 0, function* (args, allowAllExitCodes = false, silent = false, customListeners = {}) {
  1112. fshelper.directoryExistsSync(this.workingDirectory, true);
  1113. const result = new GitOutput();
  1114. const env = {};
  1115. for (const key of Object.keys(process.env)) {
  1116. env[key] = process.env[key];
  1117. }
  1118. for (const key of Object.keys(this.gitEnv)) {
  1119. env[key] = this.gitEnv[key];
  1120. }
  1121. const defaultListener = {
  1122. stdout: (data) => {
  1123. stdout.push(data.toString());
  1124. }
  1125. };
  1126. const mergedListeners = Object.assign(Object.assign({}, defaultListener), customListeners);
  1127. const stdout = [];
  1128. const options = {
  1129. cwd: this.workingDirectory,
  1130. env,
  1131. silent,
  1132. ignoreReturnCode: allowAllExitCodes,
  1133. listeners: mergedListeners
  1134. };
  1135. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  1136. result.stdout = stdout.join('');
  1137. core.debug(result.exitCode.toString());
  1138. core.debug(result.stdout);
  1139. return result;
  1140. });
  1141. }
  1142. initializeCommandManager(workingDirectory, lfs, doSparseCheckout) {
  1143. return __awaiter(this, void 0, void 0, function* () {
  1144. this.workingDirectory = workingDirectory;
  1145. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  1146. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  1147. this.lfs = lfs;
  1148. if (!this.lfs) {
  1149. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  1150. }
  1151. this.gitPath = yield io.which('git', true);
  1152. // Git version
  1153. core.debug('Getting git version');
  1154. this.gitVersion = new git_version_1.GitVersion();
  1155. let gitOutput = yield this.execGit(['version']);
  1156. let stdout = gitOutput.stdout.trim();
  1157. if (!stdout.includes('\n')) {
  1158. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  1159. if (match) {
  1160. this.gitVersion = new git_version_1.GitVersion(match[0]);
  1161. }
  1162. }
  1163. if (!this.gitVersion.isValid()) {
  1164. throw new Error('Unable to determine git version');
  1165. }
  1166. // Minimum git version
  1167. if (!this.gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  1168. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  1169. }
  1170. if (this.lfs) {
  1171. // Git-lfs version
  1172. core.debug('Getting git-lfs version');
  1173. let gitLfsVersion = new git_version_1.GitVersion();
  1174. const gitLfsPath = yield io.which('git-lfs', true);
  1175. gitOutput = yield this.execGit(['lfs', 'version']);
  1176. stdout = gitOutput.stdout.trim();
  1177. if (!stdout.includes('\n')) {
  1178. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  1179. if (match) {
  1180. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  1181. }
  1182. }
  1183. if (!gitLfsVersion.isValid()) {
  1184. throw new Error('Unable to determine git-lfs version');
  1185. }
  1186. // Minimum git-lfs version
  1187. // Note:
  1188. // - Auth header not supported before 2.1
  1189. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  1190. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  1191. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  1192. }
  1193. }
  1194. this.doSparseCheckout = doSparseCheckout;
  1195. if (this.doSparseCheckout) {
  1196. if (!this.gitVersion.checkMinimum(exports.MinimumGitSparseCheckoutVersion)) {
  1197. throw new Error(`Minimum Git version required for sparse checkout is ${exports.MinimumGitSparseCheckoutVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  1198. }
  1199. }
  1200. // Set the user agent
  1201. let gitHttpUserAgent = `git/${this.gitVersion} (github-actions-checkout)`;
  1202. // Append orchestration ID if set
  1203. const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];
  1204. if (orchId) {
  1205. // Sanitize the orchestration ID to ensure it contains only valid characters
  1206. // Valid characters: 0-9, a-z, _, -, .
  1207. const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');
  1208. if (sanitizedId) {
  1209. gitHttpUserAgent = `${gitHttpUserAgent} actions_orchestration_id/${sanitizedId}`;
  1210. }
  1211. }
  1212. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  1213. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  1214. });
  1215. }
  1216. }
  1217. class GitOutput {
  1218. constructor() {
  1219. this.stdout = '';
  1220. this.exitCode = 0;
  1221. }
  1222. }
  1223. /***/ }),
  1224. /***/ 8609:
  1225. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1226. "use strict";
  1227. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1228. if (k2 === undefined) k2 = k;
  1229. var desc = Object.getOwnPropertyDescriptor(m, k);
  1230. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1231. desc = { enumerable: true, get: function() { return m[k]; } };
  1232. }
  1233. Object.defineProperty(o, k2, desc);
  1234. }) : (function(o, m, k, k2) {
  1235. if (k2 === undefined) k2 = k;
  1236. o[k2] = m[k];
  1237. }));
  1238. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1239. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1240. }) : function(o, v) {
  1241. o["default"] = v;
  1242. });
  1243. var __importStar = (this && this.__importStar) || function (mod) {
  1244. if (mod && mod.__esModule) return mod;
  1245. var result = {};
  1246. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1247. __setModuleDefault(result, mod);
  1248. return result;
  1249. };
  1250. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1251. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1252. return new (P || (P = Promise))(function (resolve, reject) {
  1253. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1254. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1255. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1256. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1257. });
  1258. };
  1259. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1260. exports.prepareExistingDirectory = prepareExistingDirectory;
  1261. const assert = __importStar(__nccwpck_require__(9491));
  1262. const core = __importStar(__nccwpck_require__(2186));
  1263. const fs = __importStar(__nccwpck_require__(7147));
  1264. const fsHelper = __importStar(__nccwpck_require__(7219));
  1265. const io = __importStar(__nccwpck_require__(7436));
  1266. const path = __importStar(__nccwpck_require__(1017));
  1267. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  1268. return __awaiter(this, void 0, void 0, function* () {
  1269. var _a;
  1270. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  1271. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  1272. // Indicates whether to delete the directory contents
  1273. let remove = false;
  1274. // Check whether using git or REST API
  1275. if (!git) {
  1276. remove = true;
  1277. }
  1278. // Fetch URL does not match
  1279. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  1280. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  1281. remove = true;
  1282. }
  1283. else {
  1284. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  1285. const lockPaths = [
  1286. path.join(repositoryPath, '.git', 'index.lock'),
  1287. path.join(repositoryPath, '.git', 'shallow.lock')
  1288. ];
  1289. for (const lockPath of lockPaths) {
  1290. try {
  1291. yield io.rmRF(lockPath);
  1292. }
  1293. catch (error) {
  1294. core.debug(`Unable to delete '${lockPath}'. ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1295. }
  1296. }
  1297. try {
  1298. core.startGroup('Removing previously created refs, to avoid conflicts');
  1299. // Checkout detached HEAD
  1300. if (!(yield git.isDetached())) {
  1301. yield git.checkoutDetach();
  1302. }
  1303. // Remove all refs/heads/*
  1304. let branches = yield git.branchList(false);
  1305. for (const branch of branches) {
  1306. yield git.branchDelete(false, branch);
  1307. }
  1308. // Remove any conflicting refs/remotes/origin/*
  1309. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  1310. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  1311. if (ref) {
  1312. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  1313. if (ref.startsWith('refs/heads/')) {
  1314. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  1315. const upperName1Slash = `${upperName1}/`;
  1316. branches = yield git.branchList(true);
  1317. for (const branch of branches) {
  1318. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  1319. const upperName2Slash = `${upperName2}/`;
  1320. if (upperName1.startsWith(upperName2Slash) ||
  1321. upperName2.startsWith(upperName1Slash)) {
  1322. yield git.branchDelete(true, branch);
  1323. }
  1324. }
  1325. }
  1326. }
  1327. core.endGroup();
  1328. // Check for submodules and delete any existing files if submodules are present
  1329. if (!(yield git.submoduleStatus())) {
  1330. remove = true;
  1331. core.info('Bad Submodules found, removing existing files');
  1332. }
  1333. // Clean
  1334. if (clean) {
  1335. core.startGroup('Cleaning the repository');
  1336. if (!(yield git.tryClean())) {
  1337. core.debug(`The clean command failed. This might be caused by: 1) path too long, 2) permission issue, or 3) file in use. For further investigation, manually run 'git clean -ffdx' on the directory '${repositoryPath}'.`);
  1338. remove = true;
  1339. }
  1340. else if (!(yield git.tryReset())) {
  1341. remove = true;
  1342. }
  1343. core.endGroup();
  1344. if (remove) {
  1345. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  1346. }
  1347. }
  1348. }
  1349. catch (error) {
  1350. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  1351. remove = true;
  1352. }
  1353. }
  1354. if (remove) {
  1355. // Delete the contents of the directory. Don't delete the directory itself
  1356. // since it might be the current working directory.
  1357. core.info(`Deleting the contents of '${repositoryPath}'`);
  1358. for (const file of yield fs.promises.readdir(repositoryPath)) {
  1359. yield io.rmRF(path.join(repositoryPath, file));
  1360. }
  1361. }
  1362. });
  1363. }
  1364. /***/ }),
  1365. /***/ 9210:
  1366. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1367. "use strict";
  1368. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1369. if (k2 === undefined) k2 = k;
  1370. var desc = Object.getOwnPropertyDescriptor(m, k);
  1371. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1372. desc = { enumerable: true, get: function() { return m[k]; } };
  1373. }
  1374. Object.defineProperty(o, k2, desc);
  1375. }) : (function(o, m, k, k2) {
  1376. if (k2 === undefined) k2 = k;
  1377. o[k2] = m[k];
  1378. }));
  1379. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1380. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1381. }) : function(o, v) {
  1382. o["default"] = v;
  1383. });
  1384. var __importStar = (this && this.__importStar) || function (mod) {
  1385. if (mod && mod.__esModule) return mod;
  1386. var result = {};
  1387. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1388. __setModuleDefault(result, mod);
  1389. return result;
  1390. };
  1391. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1392. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1393. return new (P || (P = Promise))(function (resolve, reject) {
  1394. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1395. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1396. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1397. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1398. });
  1399. };
  1400. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1401. exports.getSource = getSource;
  1402. exports.cleanup = cleanup;
  1403. const core = __importStar(__nccwpck_require__(2186));
  1404. const fsHelper = __importStar(__nccwpck_require__(7219));
  1405. const gitAuthHelper = __importStar(__nccwpck_require__(2565));
  1406. const gitCommandManager = __importStar(__nccwpck_require__(738));
  1407. const gitDirectoryHelper = __importStar(__nccwpck_require__(8609));
  1408. const githubApiHelper = __importStar(__nccwpck_require__(138));
  1409. const io = __importStar(__nccwpck_require__(7436));
  1410. const path = __importStar(__nccwpck_require__(1017));
  1411. const refHelper = __importStar(__nccwpck_require__(8601));
  1412. const stateHelper = __importStar(__nccwpck_require__(4866));
  1413. const urlHelper = __importStar(__nccwpck_require__(9437));
  1414. const git_command_manager_1 = __nccwpck_require__(738);
  1415. function getSource(settings) {
  1416. return __awaiter(this, void 0, void 0, function* () {
  1417. // Repository URL
  1418. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  1419. const repositoryUrl = urlHelper.getFetchUrl(settings);
  1420. // Remove conflicting file path
  1421. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  1422. yield io.rmRF(settings.repositoryPath);
  1423. }
  1424. // Create directory
  1425. let isExisting = true;
  1426. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  1427. isExisting = false;
  1428. yield io.mkdirP(settings.repositoryPath);
  1429. }
  1430. // Git command manager
  1431. core.startGroup('Getting Git version info');
  1432. const git = yield getGitCommandManager(settings);
  1433. core.endGroup();
  1434. let authHelper = null;
  1435. try {
  1436. if (git) {
  1437. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1438. if (settings.setSafeDirectory) {
  1439. // Setup the repository path as a safe directory, so if we pass this into a container job with a different user it doesn't fail
  1440. // Otherwise all git commands we run in a container fail
  1441. yield authHelper.configureTempGlobalConfig();
  1442. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1443. yield git
  1444. .config('safe.directory', settings.repositoryPath, true, true)
  1445. .catch(error => {
  1446. core.info(`Failed to initialize safe directory with error: ${error}`);
  1447. });
  1448. stateHelper.setSafeDirectory();
  1449. }
  1450. }
  1451. // Prepare existing directory, otherwise recreate
  1452. if (isExisting) {
  1453. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  1454. }
  1455. if (!git) {
  1456. // Downloading using REST API
  1457. core.info(`The repository will be downloaded using the GitHub REST API`);
  1458. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  1459. if (settings.submodules) {
  1460. throw new Error(`Input 'submodules' not supported when falling back to download using the GitHub REST API. To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH.`);
  1461. }
  1462. else if (settings.sshKey) {
  1463. throw new Error(`Input 'ssh-key' not supported when falling back to download using the GitHub REST API. To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH.`);
  1464. }
  1465. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath, settings.githubServerUrl);
  1466. return;
  1467. }
  1468. // Save state for POST action
  1469. stateHelper.setRepositoryPath(settings.repositoryPath);
  1470. // Initialize the repository
  1471. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  1472. core.startGroup('Initializing the repository');
  1473. yield git.init();
  1474. yield git.remoteAdd('origin', repositoryUrl);
  1475. core.endGroup();
  1476. }
  1477. // Disable automatic garbage collection
  1478. core.startGroup('Disabling automatic garbage collection');
  1479. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  1480. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  1481. }
  1482. core.endGroup();
  1483. // If we didn't initialize it above, do it now
  1484. if (!authHelper) {
  1485. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1486. }
  1487. // Configure auth
  1488. core.startGroup('Setting up auth');
  1489. yield authHelper.configureAuth();
  1490. core.endGroup();
  1491. // Determine the default branch
  1492. if (!settings.ref && !settings.commit) {
  1493. core.startGroup('Determining the default branch');
  1494. if (settings.sshKey) {
  1495. settings.ref = yield git.getDefaultBranch(repositoryUrl);
  1496. }
  1497. else {
  1498. settings.ref = yield githubApiHelper.getDefaultBranch(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.githubServerUrl);
  1499. }
  1500. core.endGroup();
  1501. }
  1502. // LFS install
  1503. if (settings.lfs) {
  1504. yield git.lfsInstall();
  1505. }
  1506. // Fetch
  1507. core.startGroup('Fetching the repository');
  1508. const fetchOptions = {};
  1509. if (settings.filter) {
  1510. fetchOptions.filter = settings.filter;
  1511. }
  1512. else if (settings.sparseCheckout) {
  1513. fetchOptions.filter = 'blob:none';
  1514. }
  1515. if (settings.fetchDepth <= 0) {
  1516. // Fetch all branches and tags
  1517. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  1518. yield git.fetch(refSpec, fetchOptions);
  1519. // When all history is fetched, the ref we're interested in may have moved to a different
  1520. // commit (push or force push). If so, fetch again with a targeted refspec.
  1521. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  1522. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  1523. yield git.fetch(refSpec, fetchOptions);
  1524. // Verify the ref now matches. For branches, the targeted fetch above brings
  1525. // in the specific commit. For tags (fetched by ref), this will fail if
  1526. // the tag was moved after the workflow was triggered.
  1527. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  1528. throw new Error(`The ref '${settings.ref}' does not point to the expected commit '${settings.commit}'. ` +
  1529. `The ref may have been updated after the workflow was triggered.`);
  1530. }
  1531. }
  1532. }
  1533. else {
  1534. fetchOptions.fetchDepth = settings.fetchDepth;
  1535. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit, settings.fetchTags);
  1536. yield git.fetch(refSpec, fetchOptions);
  1537. // For tags, verify the ref still points to the expected commit.
  1538. // Tags are fetched by ref (not commit), so if a tag was moved after the
  1539. // workflow was triggered, we would silently check out the wrong commit.
  1540. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  1541. throw new Error(`The ref '${settings.ref}' does not point to the expected commit '${settings.commit}'. ` +
  1542. `The ref may have been updated after the workflow was triggered.`);
  1543. }
  1544. }
  1545. core.endGroup();
  1546. // Checkout info
  1547. core.startGroup('Determining the checkout info');
  1548. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  1549. core.endGroup();
  1550. // LFS fetch
  1551. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  1552. // Explicit lfs fetch will fetch lfs objects in parallel.
  1553. // For sparse checkouts, let `checkout` fetch the needed objects lazily.
  1554. if (settings.lfs && !settings.sparseCheckout) {
  1555. core.startGroup('Fetching LFS objects');
  1556. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  1557. core.endGroup();
  1558. }
  1559. // Sparse checkout
  1560. if (!settings.sparseCheckout) {
  1561. let gitVersion = yield git.version();
  1562. // no need to disable sparse-checkout if the installed git runtime doesn't even support it.
  1563. if (gitVersion.checkMinimum(git_command_manager_1.MinimumGitSparseCheckoutVersion)) {
  1564. yield git.disableSparseCheckout();
  1565. }
  1566. }
  1567. else {
  1568. core.startGroup('Setting up sparse checkout');
  1569. if (settings.sparseCheckoutConeMode) {
  1570. yield git.sparseCheckout(settings.sparseCheckout);
  1571. }
  1572. else {
  1573. yield git.sparseCheckoutNonConeMode(settings.sparseCheckout);
  1574. }
  1575. core.endGroup();
  1576. }
  1577. // Checkout
  1578. core.startGroup('Checking out the ref');
  1579. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  1580. core.endGroup();
  1581. // Submodules
  1582. if (settings.submodules) {
  1583. // Temporarily override global config
  1584. core.startGroup('Setting up auth for fetching submodules');
  1585. yield authHelper.configureGlobalAuth();
  1586. core.endGroup();
  1587. // Checkout submodules
  1588. core.startGroup('Fetching submodules');
  1589. yield git.submoduleSync(settings.nestedSubmodules);
  1590. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  1591. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  1592. core.endGroup();
  1593. // Persist credentials
  1594. if (settings.persistCredentials) {
  1595. core.startGroup('Persisting credentials for submodules');
  1596. yield authHelper.configureSubmoduleAuth();
  1597. core.endGroup();
  1598. }
  1599. }
  1600. // Get commit information
  1601. const commitInfo = yield git.log1();
  1602. // Log commit sha
  1603. const commitSHA = yield git.log1('--format=%H');
  1604. core.setOutput('commit', commitSHA.trim());
  1605. // Check for incorrect pull request merge commit
  1606. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.githubServerUrl);
  1607. }
  1608. finally {
  1609. // Remove auth
  1610. if (authHelper) {
  1611. if (!settings.persistCredentials) {
  1612. core.startGroup('Removing auth');
  1613. yield authHelper.removeAuth();
  1614. core.endGroup();
  1615. }
  1616. authHelper.removeGlobalConfig();
  1617. }
  1618. }
  1619. });
  1620. }
  1621. function cleanup(repositoryPath) {
  1622. return __awaiter(this, void 0, void 0, function* () {
  1623. // Repo exists?
  1624. if (!repositoryPath ||
  1625. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  1626. return;
  1627. }
  1628. let git;
  1629. try {
  1630. git = yield gitCommandManager.createCommandManager(repositoryPath, false, false);
  1631. }
  1632. catch (_a) {
  1633. return;
  1634. }
  1635. // Remove auth
  1636. const authHelper = gitAuthHelper.createAuthHelper(git);
  1637. try {
  1638. if (stateHelper.PostSetSafeDirectory) {
  1639. // Setup the repository path as a safe directory, so if we pass this into a container job with a different user it doesn't fail
  1640. // Otherwise all git commands we run in a container fail
  1641. yield authHelper.configureTempGlobalConfig();
  1642. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1643. yield git
  1644. .config('safe.directory', repositoryPath, true, true)
  1645. .catch(error => {
  1646. core.info(`Failed to initialize safe directory with error: ${error}`);
  1647. });
  1648. }
  1649. yield authHelper.removeAuth();
  1650. }
  1651. finally {
  1652. yield authHelper.removeGlobalConfig();
  1653. }
  1654. });
  1655. }
  1656. function getGitCommandManager(settings) {
  1657. return __awaiter(this, void 0, void 0, function* () {
  1658. core.info(`Working directory is '${settings.repositoryPath}'`);
  1659. try {
  1660. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs, settings.sparseCheckout != null);
  1661. }
  1662. catch (err) {
  1663. // Git is required for LFS
  1664. if (settings.lfs) {
  1665. throw err;
  1666. }
  1667. // Otherwise fallback to REST API
  1668. return undefined;
  1669. }
  1670. });
  1671. }
  1672. /***/ }),
  1673. /***/ 3142:
  1674. /***/ ((__unused_webpack_module, exports) => {
  1675. "use strict";
  1676. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1677. exports.GitVersion = void 0;
  1678. class GitVersion {
  1679. /**
  1680. * Used for comparing the version of git and git-lfs against the minimum required version
  1681. * @param version the version string, e.g. 1.2 or 1.2.3
  1682. */
  1683. constructor(version) {
  1684. this.major = NaN;
  1685. this.minor = NaN;
  1686. this.patch = NaN;
  1687. if (version) {
  1688. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  1689. if (match) {
  1690. this.major = Number(match[1]);
  1691. this.minor = Number(match[2]);
  1692. if (match[4]) {
  1693. this.patch = Number(match[4]);
  1694. }
  1695. }
  1696. }
  1697. }
  1698. /**
  1699. * Compares the instance against a minimum required version
  1700. * @param minimum Minimum version
  1701. */
  1702. checkMinimum(minimum) {
  1703. if (!minimum.isValid()) {
  1704. throw new Error('Arg minimum is not a valid version');
  1705. }
  1706. // Major is insufficient
  1707. if (this.major < minimum.major) {
  1708. return false;
  1709. }
  1710. // Major is equal
  1711. if (this.major === minimum.major) {
  1712. // Minor is insufficient
  1713. if (this.minor < minimum.minor) {
  1714. return false;
  1715. }
  1716. // Minor is equal
  1717. if (this.minor === minimum.minor) {
  1718. // Patch is insufficient
  1719. if (this.patch && this.patch < (minimum.patch || 0)) {
  1720. return false;
  1721. }
  1722. }
  1723. }
  1724. return true;
  1725. }
  1726. /**
  1727. * Indicates whether the instance was constructed from a valid version string
  1728. */
  1729. isValid() {
  1730. return !isNaN(this.major);
  1731. }
  1732. /**
  1733. * Returns the version as a string, e.g. 1.2 or 1.2.3
  1734. */
  1735. toString() {
  1736. let result = '';
  1737. if (this.isValid()) {
  1738. result = `${this.major}.${this.minor}`;
  1739. if (!isNaN(this.patch)) {
  1740. result += `.${this.patch}`;
  1741. }
  1742. }
  1743. return result;
  1744. }
  1745. }
  1746. exports.GitVersion = GitVersion;
  1747. /***/ }),
  1748. /***/ 138:
  1749. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1750. "use strict";
  1751. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1752. if (k2 === undefined) k2 = k;
  1753. var desc = Object.getOwnPropertyDescriptor(m, k);
  1754. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1755. desc = { enumerable: true, get: function() { return m[k]; } };
  1756. }
  1757. Object.defineProperty(o, k2, desc);
  1758. }) : (function(o, m, k, k2) {
  1759. if (k2 === undefined) k2 = k;
  1760. o[k2] = m[k];
  1761. }));
  1762. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1763. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1764. }) : function(o, v) {
  1765. o["default"] = v;
  1766. });
  1767. var __importStar = (this && this.__importStar) || function (mod) {
  1768. if (mod && mod.__esModule) return mod;
  1769. var result = {};
  1770. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1771. __setModuleDefault(result, mod);
  1772. return result;
  1773. };
  1774. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1775. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1776. return new (P || (P = Promise))(function (resolve, reject) {
  1777. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1778. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1779. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1780. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1781. });
  1782. };
  1783. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1784. exports.downloadRepository = downloadRepository;
  1785. exports.getDefaultBranch = getDefaultBranch;
  1786. const assert = __importStar(__nccwpck_require__(9491));
  1787. const core = __importStar(__nccwpck_require__(2186));
  1788. const fs = __importStar(__nccwpck_require__(7147));
  1789. const github = __importStar(__nccwpck_require__(5438));
  1790. const io = __importStar(__nccwpck_require__(7436));
  1791. const path = __importStar(__nccwpck_require__(1017));
  1792. const retryHelper = __importStar(__nccwpck_require__(2155));
  1793. const toolCache = __importStar(__nccwpck_require__(7784));
  1794. const uuid_1 = __nccwpck_require__(5840);
  1795. const url_helper_1 = __nccwpck_require__(9437);
  1796. const IS_WINDOWS = process.platform === 'win32';
  1797. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath, baseUrl) {
  1798. return __awaiter(this, void 0, void 0, function* () {
  1799. // Determine the default branch
  1800. if (!ref && !commit) {
  1801. core.info('Determining the default branch');
  1802. ref = yield getDefaultBranch(authToken, owner, repo, baseUrl);
  1803. }
  1804. // Download the archive
  1805. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1806. core.info('Downloading the archive');
  1807. return yield downloadArchive(authToken, owner, repo, ref, commit, baseUrl);
  1808. }));
  1809. // Write archive to disk
  1810. core.info('Writing archive to disk');
  1811. const uniqueId = (0, uuid_1.v4)();
  1812. const archivePath = IS_WINDOWS
  1813. ? path.join(repositoryPath, `${uniqueId}.zip`)
  1814. : path.join(repositoryPath, `${uniqueId}.tar.gz`);
  1815. yield fs.promises.writeFile(archivePath, archiveData);
  1816. archiveData = Buffer.from(''); // Free memory
  1817. // Extract archive
  1818. core.info('Extracting the archive');
  1819. const extractPath = path.join(repositoryPath, uniqueId);
  1820. yield io.mkdirP(extractPath);
  1821. if (IS_WINDOWS) {
  1822. yield toolCache.extractZip(archivePath, extractPath);
  1823. }
  1824. else {
  1825. yield toolCache.extractTar(archivePath, extractPath);
  1826. }
  1827. yield io.rmRF(archivePath);
  1828. // Determine the path of the repository content. The archive contains
  1829. // a top-level folder and the repository content is inside.
  1830. const archiveFileNames = yield fs.promises.readdir(extractPath);
  1831. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  1832. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  1833. core.info(`Resolved version ${archiveVersion}`);
  1834. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  1835. // Move the files
  1836. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  1837. const sourcePath = path.join(tempRepositoryPath, fileName);
  1838. const targetPath = path.join(repositoryPath, fileName);
  1839. if (IS_WINDOWS) {
  1840. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  1841. }
  1842. else {
  1843. yield io.mv(sourcePath, targetPath);
  1844. }
  1845. }
  1846. yield io.rmRF(extractPath);
  1847. });
  1848. }
  1849. /**
  1850. * Looks up the default branch name
  1851. */
  1852. function getDefaultBranch(authToken, owner, repo, baseUrl) {
  1853. return __awaiter(this, void 0, void 0, function* () {
  1854. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1855. core.info('Retrieving the default branch name');
  1856. const octokit = github.getOctokit(authToken, {
  1857. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1858. });
  1859. let result;
  1860. try {
  1861. // Get the default branch from the repo info
  1862. const response = yield octokit.rest.repos.get({ owner, repo });
  1863. result = response.data.default_branch;
  1864. assert.ok(result, 'default_branch cannot be empty');
  1865. }
  1866. catch (err) {
  1867. // Handle .wiki repo
  1868. if ((err === null || err === void 0 ? void 0 : err.status) === 404 &&
  1869. repo.toUpperCase().endsWith('.WIKI')) {
  1870. result = 'master';
  1871. }
  1872. // Otherwise error
  1873. else {
  1874. throw err;
  1875. }
  1876. }
  1877. // Print the default branch
  1878. core.info(`Default branch '${result}'`);
  1879. // Prefix with 'refs/heads'
  1880. if (!result.startsWith('refs/')) {
  1881. result = `refs/heads/${result}`;
  1882. }
  1883. return result;
  1884. }));
  1885. });
  1886. }
  1887. function downloadArchive(authToken, owner, repo, ref, commit, baseUrl) {
  1888. return __awaiter(this, void 0, void 0, function* () {
  1889. const octokit = github.getOctokit(authToken, {
  1890. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1891. });
  1892. const download = IS_WINDOWS
  1893. ? octokit.rest.repos.downloadZipballArchive
  1894. : octokit.rest.repos.downloadTarballArchive;
  1895. const response = yield download({
  1896. owner: owner,
  1897. repo: repo,
  1898. ref: commit || ref
  1899. });
  1900. return Buffer.from(response.data); // response.data is ArrayBuffer
  1901. });
  1902. }
  1903. /***/ }),
  1904. /***/ 5480:
  1905. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1906. "use strict";
  1907. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1908. if (k2 === undefined) k2 = k;
  1909. var desc = Object.getOwnPropertyDescriptor(m, k);
  1910. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1911. desc = { enumerable: true, get: function() { return m[k]; } };
  1912. }
  1913. Object.defineProperty(o, k2, desc);
  1914. }) : (function(o, m, k, k2) {
  1915. if (k2 === undefined) k2 = k;
  1916. o[k2] = m[k];
  1917. }));
  1918. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1919. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1920. }) : function(o, v) {
  1921. o["default"] = v;
  1922. });
  1923. var __importStar = (this && this.__importStar) || function (mod) {
  1924. if (mod && mod.__esModule) return mod;
  1925. var result = {};
  1926. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1927. __setModuleDefault(result, mod);
  1928. return result;
  1929. };
  1930. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1931. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1932. return new (P || (P = Promise))(function (resolve, reject) {
  1933. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1934. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1935. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1936. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1937. });
  1938. };
  1939. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1940. exports.getInputs = getInputs;
  1941. const core = __importStar(__nccwpck_require__(2186));
  1942. const fsHelper = __importStar(__nccwpck_require__(7219));
  1943. const github = __importStar(__nccwpck_require__(5438));
  1944. const path = __importStar(__nccwpck_require__(1017));
  1945. const workflowContextHelper = __importStar(__nccwpck_require__(9568));
  1946. function getInputs() {
  1947. return __awaiter(this, void 0, void 0, function* () {
  1948. const result = {};
  1949. // GitHub workspace
  1950. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  1951. if (!githubWorkspacePath) {
  1952. throw new Error('GITHUB_WORKSPACE not defined');
  1953. }
  1954. githubWorkspacePath = path.resolve(githubWorkspacePath);
  1955. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  1956. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  1957. // Qualified repository
  1958. const qualifiedRepository = core.getInput('repository') ||
  1959. `${github.context.repo.owner}/${github.context.repo.repo}`;
  1960. core.debug(`qualified repository = '${qualifiedRepository}'`);
  1961. const splitRepository = qualifiedRepository.split('/');
  1962. if (splitRepository.length !== 2 ||
  1963. !splitRepository[0] ||
  1964. !splitRepository[1]) {
  1965. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  1966. }
  1967. result.repositoryOwner = splitRepository[0];
  1968. result.repositoryName = splitRepository[1];
  1969. // Repository path
  1970. result.repositoryPath = core.getInput('path') || '.';
  1971. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  1972. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  1973. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  1974. }
  1975. // Workflow repository?
  1976. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  1977. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  1978. // Source branch, source version
  1979. result.ref = core.getInput('ref');
  1980. if (!result.ref) {
  1981. if (isWorkflowRepository) {
  1982. result.ref = github.context.ref;
  1983. result.commit = github.context.sha;
  1984. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  1985. // the ref is unqualifed like "main" instead of "refs/heads/main".
  1986. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  1987. result.ref = `refs/heads/${result.ref}`;
  1988. }
  1989. }
  1990. }
  1991. // SHA?
  1992. else if (result.ref.match(/^(?:[0-9a-fA-F]{40}|[0-9a-fA-F]{64})$/)) {
  1993. result.commit = result.ref;
  1994. result.ref = '';
  1995. }
  1996. core.debug(`ref = '${result.ref}'`);
  1997. core.debug(`commit = '${result.commit}'`);
  1998. // Clean
  1999. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  2000. core.debug(`clean = ${result.clean}`);
  2001. // Filter
  2002. const filter = core.getInput('filter');
  2003. if (filter) {
  2004. result.filter = filter;
  2005. }
  2006. core.debug(`filter = ${result.filter}`);
  2007. // Sparse checkout
  2008. const sparseCheckout = core.getMultilineInput('sparse-checkout');
  2009. if (sparseCheckout.length) {
  2010. result.sparseCheckout = sparseCheckout;
  2011. core.debug(`sparse checkout = ${result.sparseCheckout}`);
  2012. }
  2013. result.sparseCheckoutConeMode =
  2014. (core.getInput('sparse-checkout-cone-mode') || 'true').toUpperCase() ===
  2015. 'TRUE';
  2016. // Fetch depth
  2017. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  2018. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  2019. result.fetchDepth = 0;
  2020. }
  2021. core.debug(`fetch depth = ${result.fetchDepth}`);
  2022. // Fetch tags
  2023. result.fetchTags =
  2024. (core.getInput('fetch-tags') || 'false').toUpperCase() === 'TRUE';
  2025. core.debug(`fetch tags = ${result.fetchTags}`);
  2026. // Show fetch progress
  2027. result.showProgress =
  2028. (core.getInput('show-progress') || 'true').toUpperCase() === 'TRUE';
  2029. core.debug(`show progress = ${result.showProgress}`);
  2030. // LFS
  2031. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  2032. core.debug(`lfs = ${result.lfs}`);
  2033. // Submodules
  2034. result.submodules = false;
  2035. result.nestedSubmodules = false;
  2036. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  2037. if (submodulesString == 'RECURSIVE') {
  2038. result.submodules = true;
  2039. result.nestedSubmodules = true;
  2040. }
  2041. else if (submodulesString == 'TRUE') {
  2042. result.submodules = true;
  2043. }
  2044. core.debug(`submodules = ${result.submodules}`);
  2045. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  2046. // Auth token
  2047. result.authToken = core.getInput('token', { required: true });
  2048. // SSH
  2049. result.sshKey = core.getInput('ssh-key');
  2050. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  2051. result.sshStrict =
  2052. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  2053. result.sshUser = core.getInput('ssh-user');
  2054. // Persist credentials
  2055. result.persistCredentials =
  2056. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  2057. // Workflow organization ID
  2058. result.workflowOrganizationId =
  2059. yield workflowContextHelper.getOrganizationId();
  2060. // Set safe.directory in git global config.
  2061. result.setSafeDirectory =
  2062. (core.getInput('set-safe-directory') || 'true').toUpperCase() === 'TRUE';
  2063. // Determine the GitHub URL that the repository is being hosted from
  2064. result.githubServerUrl = core.getInput('github-server-url');
  2065. core.debug(`GitHub Host URL = ${result.githubServerUrl}`);
  2066. return result;
  2067. });
  2068. }
  2069. /***/ }),
  2070. /***/ 3109:
  2071. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2072. "use strict";
  2073. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2074. if (k2 === undefined) k2 = k;
  2075. var desc = Object.getOwnPropertyDescriptor(m, k);
  2076. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2077. desc = { enumerable: true, get: function() { return m[k]; } };
  2078. }
  2079. Object.defineProperty(o, k2, desc);
  2080. }) : (function(o, m, k, k2) {
  2081. if (k2 === undefined) k2 = k;
  2082. o[k2] = m[k];
  2083. }));
  2084. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2085. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2086. }) : function(o, v) {
  2087. o["default"] = v;
  2088. });
  2089. var __importStar = (this && this.__importStar) || function (mod) {
  2090. if (mod && mod.__esModule) return mod;
  2091. var result = {};
  2092. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2093. __setModuleDefault(result, mod);
  2094. return result;
  2095. };
  2096. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2097. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2098. return new (P || (P = Promise))(function (resolve, reject) {
  2099. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2100. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2101. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2102. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2103. });
  2104. };
  2105. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2106. const core = __importStar(__nccwpck_require__(2186));
  2107. const coreCommand = __importStar(__nccwpck_require__(7351));
  2108. const gitSourceProvider = __importStar(__nccwpck_require__(9210));
  2109. const inputHelper = __importStar(__nccwpck_require__(5480));
  2110. const path = __importStar(__nccwpck_require__(1017));
  2111. const stateHelper = __importStar(__nccwpck_require__(4866));
  2112. function run() {
  2113. return __awaiter(this, void 0, void 0, function* () {
  2114. var _a;
  2115. try {
  2116. const sourceSettings = yield inputHelper.getInputs();
  2117. try {
  2118. // Register problem matcher
  2119. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2120. // Get sources
  2121. yield gitSourceProvider.getSource(sourceSettings);
  2122. core.setOutput('ref', sourceSettings.ref);
  2123. }
  2124. finally {
  2125. // Unregister problem matcher
  2126. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2127. }
  2128. }
  2129. catch (error) {
  2130. core.setFailed(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  2131. }
  2132. });
  2133. }
  2134. function cleanup() {
  2135. return __awaiter(this, void 0, void 0, function* () {
  2136. var _a;
  2137. try {
  2138. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2139. }
  2140. catch (error) {
  2141. core.warning(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  2142. }
  2143. });
  2144. }
  2145. // Main
  2146. if (!stateHelper.IsPost) {
  2147. run();
  2148. }
  2149. // Post
  2150. else {
  2151. cleanup();
  2152. }
  2153. /***/ }),
  2154. /***/ 8601:
  2155. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2156. "use strict";
  2157. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2158. if (k2 === undefined) k2 = k;
  2159. var desc = Object.getOwnPropertyDescriptor(m, k);
  2160. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2161. desc = { enumerable: true, get: function() { return m[k]; } };
  2162. }
  2163. Object.defineProperty(o, k2, desc);
  2164. }) : (function(o, m, k, k2) {
  2165. if (k2 === undefined) k2 = k;
  2166. o[k2] = m[k];
  2167. }));
  2168. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2169. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2170. }) : function(o, v) {
  2171. o["default"] = v;
  2172. });
  2173. var __importStar = (this && this.__importStar) || function (mod) {
  2174. if (mod && mod.__esModule) return mod;
  2175. var result = {};
  2176. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2177. __setModuleDefault(result, mod);
  2178. return result;
  2179. };
  2180. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2181. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2182. return new (P || (P = Promise))(function (resolve, reject) {
  2183. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2184. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2185. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2186. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2187. });
  2188. };
  2189. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2190. exports.tagsRefSpec = void 0;
  2191. exports.getCheckoutInfo = getCheckoutInfo;
  2192. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  2193. exports.getRefSpec = getRefSpec;
  2194. exports.testRef = testRef;
  2195. exports.checkCommitInfo = checkCommitInfo;
  2196. const core = __importStar(__nccwpck_require__(2186));
  2197. const github = __importStar(__nccwpck_require__(5438));
  2198. const url_helper_1 = __nccwpck_require__(9437);
  2199. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  2200. function getCheckoutInfo(git, ref, commit) {
  2201. return __awaiter(this, void 0, void 0, function* () {
  2202. if (!git) {
  2203. throw new Error('Arg git cannot be empty');
  2204. }
  2205. if (!ref && !commit) {
  2206. throw new Error('Args ref and commit cannot both be empty');
  2207. }
  2208. const result = {};
  2209. const upperRef = (ref || '').toUpperCase();
  2210. // SHA only
  2211. if (!ref) {
  2212. result.ref = commit;
  2213. }
  2214. // refs/heads/
  2215. else if (upperRef.startsWith('REFS/HEADS/')) {
  2216. const branch = ref.substring('refs/heads/'.length);
  2217. result.ref = branch;
  2218. result.startPoint = `refs/remotes/origin/${branch}`;
  2219. }
  2220. // refs/pull/
  2221. else if (upperRef.startsWith('REFS/PULL/')) {
  2222. const branch = ref.substring('refs/pull/'.length);
  2223. result.ref = `refs/remotes/pull/${branch}`;
  2224. }
  2225. // refs/tags/
  2226. else if (upperRef.startsWith('REFS/TAGS/')) {
  2227. result.ref = ref;
  2228. }
  2229. // refs/
  2230. else if (upperRef.startsWith('REFS/')) {
  2231. result.ref = commit ? commit : ref;
  2232. }
  2233. // Unqualified ref, check for a matching branch or tag
  2234. else {
  2235. if (yield git.branchExists(true, `origin/${ref}`)) {
  2236. result.ref = ref;
  2237. result.startPoint = `refs/remotes/origin/${ref}`;
  2238. }
  2239. else if (yield git.tagExists(`${ref}`)) {
  2240. result.ref = `refs/tags/${ref}`;
  2241. }
  2242. else {
  2243. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2244. }
  2245. }
  2246. return result;
  2247. });
  2248. }
  2249. function getRefSpecForAllHistory(ref, commit) {
  2250. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  2251. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  2252. const branch = ref.substring('refs/pull/'.length);
  2253. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  2254. }
  2255. return result;
  2256. }
  2257. function getRefSpec(ref, commit, fetchTags) {
  2258. if (!ref && !commit) {
  2259. throw new Error('Args ref and commit cannot both be empty');
  2260. }
  2261. const upperRef = (ref || '').toUpperCase();
  2262. const result = [];
  2263. // When fetchTags is true, always include the tags refspec
  2264. if (fetchTags) {
  2265. result.push(exports.tagsRefSpec);
  2266. }
  2267. // SHA
  2268. if (commit) {
  2269. // refs/heads
  2270. if (upperRef.startsWith('REFS/HEADS/')) {
  2271. const branch = ref.substring('refs/heads/'.length);
  2272. result.push(`+${commit}:refs/remotes/origin/${branch}`);
  2273. }
  2274. // refs/pull/
  2275. else if (upperRef.startsWith('REFS/PULL/')) {
  2276. const branch = ref.substring('refs/pull/'.length);
  2277. result.push(`+${commit}:refs/remotes/pull/${branch}`);
  2278. }
  2279. // refs/tags/
  2280. else if (upperRef.startsWith('REFS/TAGS/')) {
  2281. if (!fetchTags) {
  2282. result.push(`+${ref}:${ref}`);
  2283. }
  2284. }
  2285. // Otherwise no destination ref
  2286. else {
  2287. result.push(commit);
  2288. }
  2289. }
  2290. // Unqualified ref, check for a matching branch or tag
  2291. else if (!upperRef.startsWith('REFS/')) {
  2292. result.push(`+refs/heads/${ref}*:refs/remotes/origin/${ref}*`);
  2293. if (!fetchTags) {
  2294. result.push(`+refs/tags/${ref}*:refs/tags/${ref}*`);
  2295. }
  2296. }
  2297. // refs/heads/
  2298. else if (upperRef.startsWith('REFS/HEADS/')) {
  2299. const branch = ref.substring('refs/heads/'.length);
  2300. result.push(`+${ref}:refs/remotes/origin/${branch}`);
  2301. }
  2302. // refs/pull/
  2303. else if (upperRef.startsWith('REFS/PULL/')) {
  2304. const branch = ref.substring('refs/pull/'.length);
  2305. result.push(`+${ref}:refs/remotes/pull/${branch}`);
  2306. }
  2307. // refs/tags/
  2308. else if (upperRef.startsWith('REFS/TAGS/')) {
  2309. if (!fetchTags) {
  2310. result.push(`+${ref}:${ref}`);
  2311. }
  2312. }
  2313. // Other refs
  2314. else {
  2315. result.push(`+${ref}:${ref}`);
  2316. }
  2317. return result;
  2318. }
  2319. /**
  2320. * Tests whether the initial fetch created the ref at the expected commit
  2321. */
  2322. function testRef(git, ref, commit) {
  2323. return __awaiter(this, void 0, void 0, function* () {
  2324. if (!git) {
  2325. throw new Error('Arg git cannot be empty');
  2326. }
  2327. if (!ref && !commit) {
  2328. throw new Error('Args ref and commit cannot both be empty');
  2329. }
  2330. // No SHA? Nothing to test
  2331. if (!commit) {
  2332. return true;
  2333. }
  2334. // SHA only?
  2335. else if (!ref) {
  2336. return yield git.shaExists(commit);
  2337. }
  2338. const upperRef = ref.toUpperCase();
  2339. // refs/heads/
  2340. if (upperRef.startsWith('REFS/HEADS/')) {
  2341. const branch = ref.substring('refs/heads/'.length);
  2342. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  2343. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  2344. }
  2345. // refs/pull/
  2346. else if (upperRef.startsWith('REFS/PULL/')) {
  2347. // Assume matches because fetched using the commit
  2348. return true;
  2349. }
  2350. // refs/tags/
  2351. else if (upperRef.startsWith('REFS/TAGS/')) {
  2352. const tagName = ref.substring('refs/tags/'.length);
  2353. // Use ^{commit} to dereference annotated tags to their underlying commit
  2354. return ((yield git.tagExists(tagName)) &&
  2355. commit === (yield git.revParse(`${ref}^{commit}`)));
  2356. }
  2357. // Unexpected
  2358. else {
  2359. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  2360. return true;
  2361. }
  2362. });
  2363. }
  2364. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit, baseUrl) {
  2365. return __awaiter(this, void 0, void 0, function* () {
  2366. var _a;
  2367. try {
  2368. // GHES?
  2369. if ((0, url_helper_1.isGhes)(baseUrl)) {
  2370. return;
  2371. }
  2372. // Auth token?
  2373. if (!token) {
  2374. return;
  2375. }
  2376. // Public PR synchronize, for workflow repo?
  2377. if (fromPayload('repository.private') !== false ||
  2378. github.context.eventName !== 'pull_request' ||
  2379. fromPayload('action') !== 'synchronize' ||
  2380. repositoryOwner !== github.context.repo.owner ||
  2381. repositoryName !== github.context.repo.repo ||
  2382. ref !== github.context.ref ||
  2383. !ref.startsWith('refs/pull/') ||
  2384. commit !== github.context.sha) {
  2385. return;
  2386. }
  2387. // Head SHA
  2388. const expectedHeadSha = fromPayload('after');
  2389. if (!expectedHeadSha) {
  2390. core.debug('Unable to determine head sha');
  2391. return;
  2392. }
  2393. // Base SHA
  2394. const expectedBaseSha = fromPayload('pull_request.base.sha');
  2395. if (!expectedBaseSha) {
  2396. core.debug('Unable to determine base sha');
  2397. return;
  2398. }
  2399. // Expected message?
  2400. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  2401. if (commitInfo.indexOf(expectedMessage) >= 0) {
  2402. return;
  2403. }
  2404. // Extract details from message
  2405. const match = commitInfo.match(/Merge ([0-9a-f]{40}|[0-9a-f]{64}) into ([0-9a-f]{40}|[0-9a-f]{64})/);
  2406. if (!match) {
  2407. core.debug('Unexpected message format');
  2408. return;
  2409. }
  2410. // Post telemetry
  2411. const actualHeadSha = match[1];
  2412. if (actualHeadSha !== expectedHeadSha) {
  2413. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  2414. const octokit = github.getOctokit(token, {
  2415. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl),
  2416. userAgent: `actions-checkout-tracepoint/1.0 (code=STALE_MERGE;owner=${repositoryOwner};repo=${repositoryName};pr=${fromPayload('number')};run_id=${process.env['GITHUB_RUN_ID']};expected_head_sha=${expectedHeadSha};actual_head_sha=${actualHeadSha})`
  2417. });
  2418. yield octokit.rest.repos.get({
  2419. owner: repositoryOwner,
  2420. repo: repositoryName
  2421. });
  2422. }
  2423. }
  2424. catch (err) {
  2425. core.debug(`Error when validating commit info: ${(_a = err === null || err === void 0 ? void 0 : err.stack) !== null && _a !== void 0 ? _a : err}`);
  2426. }
  2427. });
  2428. }
  2429. function fromPayload(path) {
  2430. return select(github.context.payload, path);
  2431. }
  2432. function select(obj, path) {
  2433. if (!obj) {
  2434. return undefined;
  2435. }
  2436. const i = path.indexOf('.');
  2437. if (i < 0) {
  2438. return obj[path];
  2439. }
  2440. const key = path.substr(0, i);
  2441. return select(obj[key], path.substr(i + 1));
  2442. }
  2443. /***/ }),
  2444. /***/ 3120:
  2445. /***/ ((__unused_webpack_module, exports) => {
  2446. "use strict";
  2447. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2448. exports.escape = escape;
  2449. function escape(value) {
  2450. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  2451. return `\\${x}`;
  2452. });
  2453. }
  2454. /***/ }),
  2455. /***/ 2155:
  2456. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2457. "use strict";
  2458. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2459. if (k2 === undefined) k2 = k;
  2460. var desc = Object.getOwnPropertyDescriptor(m, k);
  2461. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2462. desc = { enumerable: true, get: function() { return m[k]; } };
  2463. }
  2464. Object.defineProperty(o, k2, desc);
  2465. }) : (function(o, m, k, k2) {
  2466. if (k2 === undefined) k2 = k;
  2467. o[k2] = m[k];
  2468. }));
  2469. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2470. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2471. }) : function(o, v) {
  2472. o["default"] = v;
  2473. });
  2474. var __importStar = (this && this.__importStar) || function (mod) {
  2475. if (mod && mod.__esModule) return mod;
  2476. var result = {};
  2477. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2478. __setModuleDefault(result, mod);
  2479. return result;
  2480. };
  2481. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2482. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2483. return new (P || (P = Promise))(function (resolve, reject) {
  2484. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2485. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2486. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2487. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2488. });
  2489. };
  2490. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2491. exports.RetryHelper = void 0;
  2492. exports.execute = execute;
  2493. const core = __importStar(__nccwpck_require__(2186));
  2494. const defaultMaxAttempts = 3;
  2495. const defaultMinSeconds = 10;
  2496. const defaultMaxSeconds = 20;
  2497. class RetryHelper {
  2498. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  2499. this.maxAttempts = maxAttempts;
  2500. this.minSeconds = Math.floor(minSeconds);
  2501. this.maxSeconds = Math.floor(maxSeconds);
  2502. if (this.minSeconds > this.maxSeconds) {
  2503. throw new Error('min seconds should be less than or equal to max seconds');
  2504. }
  2505. }
  2506. execute(action) {
  2507. return __awaiter(this, void 0, void 0, function* () {
  2508. let attempt = 1;
  2509. while (attempt < this.maxAttempts) {
  2510. // Try
  2511. try {
  2512. return yield action();
  2513. }
  2514. catch (err) {
  2515. core.info(err === null || err === void 0 ? void 0 : err.message);
  2516. }
  2517. // Sleep
  2518. const seconds = this.getSleepAmount();
  2519. core.info(`Waiting ${seconds} seconds before trying again`);
  2520. yield this.sleep(seconds);
  2521. attempt++;
  2522. }
  2523. // Last attempt
  2524. return yield action();
  2525. });
  2526. }
  2527. getSleepAmount() {
  2528. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  2529. this.minSeconds);
  2530. }
  2531. sleep(seconds) {
  2532. return __awaiter(this, void 0, void 0, function* () {
  2533. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  2534. });
  2535. }
  2536. }
  2537. exports.RetryHelper = RetryHelper;
  2538. function execute(action) {
  2539. return __awaiter(this, void 0, void 0, function* () {
  2540. const retryHelper = new RetryHelper();
  2541. return yield retryHelper.execute(action);
  2542. });
  2543. }
  2544. /***/ }),
  2545. /***/ 4866:
  2546. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2547. "use strict";
  2548. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2549. if (k2 === undefined) k2 = k;
  2550. var desc = Object.getOwnPropertyDescriptor(m, k);
  2551. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2552. desc = { enumerable: true, get: function() { return m[k]; } };
  2553. }
  2554. Object.defineProperty(o, k2, desc);
  2555. }) : (function(o, m, k, k2) {
  2556. if (k2 === undefined) k2 = k;
  2557. o[k2] = m[k];
  2558. }));
  2559. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2560. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2561. }) : function(o, v) {
  2562. o["default"] = v;
  2563. });
  2564. var __importStar = (this && this.__importStar) || function (mod) {
  2565. if (mod && mod.__esModule) return mod;
  2566. var result = {};
  2567. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2568. __setModuleDefault(result, mod);
  2569. return result;
  2570. };
  2571. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2572. exports.SshKnownHostsPath = exports.SshKeyPath = exports.PostSetSafeDirectory = exports.RepositoryPath = exports.IsPost = void 0;
  2573. exports.setRepositoryPath = setRepositoryPath;
  2574. exports.setSshKeyPath = setSshKeyPath;
  2575. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2576. exports.setSafeDirectory = setSafeDirectory;
  2577. const core = __importStar(__nccwpck_require__(2186));
  2578. /**
  2579. * Indicates whether the POST action is running
  2580. */
  2581. exports.IsPost = !!core.getState('isPost');
  2582. /**
  2583. * The repository path for the POST action. The value is empty during the MAIN action.
  2584. */
  2585. exports.RepositoryPath = core.getState('repositoryPath');
  2586. /**
  2587. * The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action.
  2588. */
  2589. exports.PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true';
  2590. /**
  2591. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2592. */
  2593. exports.SshKeyPath = core.getState('sshKeyPath');
  2594. /**
  2595. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2596. */
  2597. exports.SshKnownHostsPath = core.getState('sshKnownHostsPath');
  2598. /**
  2599. * Save the repository path so the POST action can retrieve the value.
  2600. */
  2601. function setRepositoryPath(repositoryPath) {
  2602. core.saveState('repositoryPath', repositoryPath);
  2603. }
  2604. /**
  2605. * Save the SSH key path so the POST action can retrieve the value.
  2606. */
  2607. function setSshKeyPath(sshKeyPath) {
  2608. core.saveState('sshKeyPath', sshKeyPath);
  2609. }
  2610. /**
  2611. * Save the SSH known hosts path so the POST action can retrieve the value.
  2612. */
  2613. function setSshKnownHostsPath(sshKnownHostsPath) {
  2614. core.saveState('sshKnownHostsPath', sshKnownHostsPath);
  2615. }
  2616. /**
  2617. * Save the set-safe-directory input so the POST action can retrieve the value.
  2618. */
  2619. function setSafeDirectory() {
  2620. core.saveState('setSafeDirectory', 'true');
  2621. }
  2622. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2623. // This is necessary since we don't have a separate entry point.
  2624. if (!exports.IsPost) {
  2625. core.saveState('isPost', 'true');
  2626. }
  2627. /***/ }),
  2628. /***/ 9437:
  2629. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2630. "use strict";
  2631. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2632. if (k2 === undefined) k2 = k;
  2633. var desc = Object.getOwnPropertyDescriptor(m, k);
  2634. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2635. desc = { enumerable: true, get: function() { return m[k]; } };
  2636. }
  2637. Object.defineProperty(o, k2, desc);
  2638. }) : (function(o, m, k, k2) {
  2639. if (k2 === undefined) k2 = k;
  2640. o[k2] = m[k];
  2641. }));
  2642. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2643. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2644. }) : function(o, v) {
  2645. o["default"] = v;
  2646. });
  2647. var __importStar = (this && this.__importStar) || function (mod) {
  2648. if (mod && mod.__esModule) return mod;
  2649. var result = {};
  2650. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2651. __setModuleDefault(result, mod);
  2652. return result;
  2653. };
  2654. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2655. exports.getFetchUrl = getFetchUrl;
  2656. exports.getServerUrl = getServerUrl;
  2657. exports.getServerApiUrl = getServerApiUrl;
  2658. exports.isGhes = isGhes;
  2659. const assert = __importStar(__nccwpck_require__(9491));
  2660. const url_1 = __nccwpck_require__(7310);
  2661. function getFetchUrl(settings) {
  2662. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  2663. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  2664. const serviceUrl = getServerUrl(settings.githubServerUrl);
  2665. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  2666. const encodedName = encodeURIComponent(settings.repositoryName);
  2667. if (settings.sshKey) {
  2668. const user = settings.sshUser.length > 0 ? settings.sshUser : 'git';
  2669. return `${user}@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  2670. }
  2671. // "origin" is SCHEME://HOSTNAME[:PORT]
  2672. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  2673. }
  2674. function getServerUrl(url) {
  2675. let resolvedUrl = process.env['GITHUB_SERVER_URL'] || 'https://github.com';
  2676. if (hasContent(url, WhitespaceMode.Trim)) {
  2677. resolvedUrl = url;
  2678. }
  2679. return new url_1.URL(resolvedUrl);
  2680. }
  2681. function getServerApiUrl(url) {
  2682. if (hasContent(url, WhitespaceMode.Trim)) {
  2683. let serverUrl = getServerUrl(url);
  2684. if (isGhes(url)) {
  2685. serverUrl.pathname = 'api/v3';
  2686. }
  2687. else {
  2688. serverUrl.hostname = 'api.' + serverUrl.hostname;
  2689. }
  2690. return pruneSuffix(serverUrl.toString(), '/');
  2691. }
  2692. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  2693. }
  2694. function isGhes(url) {
  2695. const ghUrl = new url_1.URL(url || process.env['GITHUB_SERVER_URL'] || 'https://github.com');
  2696. const hostname = ghUrl.hostname.trimEnd().toUpperCase();
  2697. const isGitHubHost = hostname === 'GITHUB.COM';
  2698. const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM');
  2699. const isLocalHost = hostname.endsWith('.LOCALHOST');
  2700. return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
  2701. }
  2702. function pruneSuffix(text, suffix) {
  2703. if (hasContent(suffix, WhitespaceMode.Preserve) && (text === null || text === void 0 ? void 0 : text.endsWith(suffix))) {
  2704. return text.substring(0, text.length - suffix.length);
  2705. }
  2706. return text;
  2707. }
  2708. var WhitespaceMode;
  2709. (function (WhitespaceMode) {
  2710. WhitespaceMode[WhitespaceMode["Trim"] = 0] = "Trim";
  2711. WhitespaceMode[WhitespaceMode["Preserve"] = 1] = "Preserve";
  2712. })(WhitespaceMode || (WhitespaceMode = {}));
  2713. function hasContent(text, whitespaceMode) {
  2714. let refinedText = text !== null && text !== void 0 ? text : '';
  2715. if (whitespaceMode == WhitespaceMode.Trim) {
  2716. refinedText = refinedText.trim();
  2717. }
  2718. return refinedText.length > 0;
  2719. }
  2720. /***/ }),
  2721. /***/ 9568:
  2722. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2723. "use strict";
  2724. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2725. if (k2 === undefined) k2 = k;
  2726. var desc = Object.getOwnPropertyDescriptor(m, k);
  2727. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2728. desc = { enumerable: true, get: function() { return m[k]; } };
  2729. }
  2730. Object.defineProperty(o, k2, desc);
  2731. }) : (function(o, m, k, k2) {
  2732. if (k2 === undefined) k2 = k;
  2733. o[k2] = m[k];
  2734. }));
  2735. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2736. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2737. }) : function(o, v) {
  2738. o["default"] = v;
  2739. });
  2740. var __importStar = (this && this.__importStar) || function (mod) {
  2741. if (mod && mod.__esModule) return mod;
  2742. var result = {};
  2743. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2744. __setModuleDefault(result, mod);
  2745. return result;
  2746. };
  2747. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2748. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2749. return new (P || (P = Promise))(function (resolve, reject) {
  2750. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2751. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2752. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2753. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2754. });
  2755. };
  2756. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2757. exports.getOrganizationId = getOrganizationId;
  2758. const core = __importStar(__nccwpck_require__(2186));
  2759. const fs = __importStar(__nccwpck_require__(7147));
  2760. /**
  2761. * Gets the organization ID of the running workflow or undefined if the value cannot be loaded from the GITHUB_EVENT_PATH
  2762. */
  2763. function getOrganizationId() {
  2764. return __awaiter(this, void 0, void 0, function* () {
  2765. var _a, _b;
  2766. try {
  2767. const eventPath = process.env.GITHUB_EVENT_PATH;
  2768. if (!eventPath) {
  2769. core.debug(`GITHUB_EVENT_PATH is not defined`);
  2770. return;
  2771. }
  2772. const content = yield fs.promises.readFile(eventPath, { encoding: 'utf8' });
  2773. const event = JSON.parse(content);
  2774. const id = (_b = (_a = event === null || event === void 0 ? void 0 : event.repository) === null || _a === void 0 ? void 0 : _a.owner) === null || _b === void 0 ? void 0 : _b.id;
  2775. if (typeof id !== 'number') {
  2776. core.debug('Repository owner ID not found within GITHUB event info');
  2777. return;
  2778. }
  2779. return id;
  2780. }
  2781. catch (err) {
  2782. core.debug(`Unable to load organization ID from GITHUB_EVENT_PATH: ${err.message || err}`);
  2783. }
  2784. });
  2785. }
  2786. /***/ }),
  2787. /***/ 7351:
  2788. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2789. "use strict";
  2790. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2791. if (k2 === undefined) k2 = k;
  2792. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2793. }) : (function(o, m, k, k2) {
  2794. if (k2 === undefined) k2 = k;
  2795. o[k2] = m[k];
  2796. }));
  2797. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2798. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2799. }) : function(o, v) {
  2800. o["default"] = v;
  2801. });
  2802. var __importStar = (this && this.__importStar) || function (mod) {
  2803. if (mod && mod.__esModule) return mod;
  2804. var result = {};
  2805. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2806. __setModuleDefault(result, mod);
  2807. return result;
  2808. };
  2809. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2810. exports.issue = exports.issueCommand = void 0;
  2811. const os = __importStar(__nccwpck_require__(2037));
  2812. const utils_1 = __nccwpck_require__(5278);
  2813. /**
  2814. * Commands
  2815. *
  2816. * Command Format:
  2817. * ::name key=value,key=value::message
  2818. *
  2819. * Examples:
  2820. * ::warning::This is the message
  2821. * ::set-env name=MY_VAR::some value
  2822. */
  2823. function issueCommand(command, properties, message) {
  2824. const cmd = new Command(command, properties, message);
  2825. process.stdout.write(cmd.toString() + os.EOL);
  2826. }
  2827. exports.issueCommand = issueCommand;
  2828. function issue(name, message = '') {
  2829. issueCommand(name, {}, message);
  2830. }
  2831. exports.issue = issue;
  2832. const CMD_STRING = '::';
  2833. class Command {
  2834. constructor(command, properties, message) {
  2835. if (!command) {
  2836. command = 'missing.command';
  2837. }
  2838. this.command = command;
  2839. this.properties = properties;
  2840. this.message = message;
  2841. }
  2842. toString() {
  2843. let cmdStr = CMD_STRING + this.command;
  2844. if (this.properties && Object.keys(this.properties).length > 0) {
  2845. cmdStr += ' ';
  2846. let first = true;
  2847. for (const key in this.properties) {
  2848. if (this.properties.hasOwnProperty(key)) {
  2849. const val = this.properties[key];
  2850. if (val) {
  2851. if (first) {
  2852. first = false;
  2853. }
  2854. else {
  2855. cmdStr += ',';
  2856. }
  2857. cmdStr += `${key}=${escapeProperty(val)}`;
  2858. }
  2859. }
  2860. }
  2861. }
  2862. cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
  2863. return cmdStr;
  2864. }
  2865. }
  2866. function escapeData(s) {
  2867. return utils_1.toCommandValue(s)
  2868. .replace(/%/g, '%25')
  2869. .replace(/\r/g, '%0D')
  2870. .replace(/\n/g, '%0A');
  2871. }
  2872. function escapeProperty(s) {
  2873. return utils_1.toCommandValue(s)
  2874. .replace(/%/g, '%25')
  2875. .replace(/\r/g, '%0D')
  2876. .replace(/\n/g, '%0A')
  2877. .replace(/:/g, '%3A')
  2878. .replace(/,/g, '%2C');
  2879. }
  2880. //# sourceMappingURL=command.js.map
  2881. /***/ }),
  2882. /***/ 2186:
  2883. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2884. "use strict";
  2885. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2886. if (k2 === undefined) k2 = k;
  2887. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2888. }) : (function(o, m, k, k2) {
  2889. if (k2 === undefined) k2 = k;
  2890. o[k2] = m[k];
  2891. }));
  2892. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2893. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2894. }) : function(o, v) {
  2895. o["default"] = v;
  2896. });
  2897. var __importStar = (this && this.__importStar) || function (mod) {
  2898. if (mod && mod.__esModule) return mod;
  2899. var result = {};
  2900. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2901. __setModuleDefault(result, mod);
  2902. return result;
  2903. };
  2904. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2905. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2906. return new (P || (P = Promise))(function (resolve, reject) {
  2907. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2908. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2909. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2910. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2911. });
  2912. };
  2913. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2914. exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
  2915. const command_1 = __nccwpck_require__(7351);
  2916. const file_command_1 = __nccwpck_require__(717);
  2917. const utils_1 = __nccwpck_require__(5278);
  2918. const os = __importStar(__nccwpck_require__(2037));
  2919. const path = __importStar(__nccwpck_require__(1017));
  2920. const oidc_utils_1 = __nccwpck_require__(8041);
  2921. /**
  2922. * The code to exit an action
  2923. */
  2924. var ExitCode;
  2925. (function (ExitCode) {
  2926. /**
  2927. * A code indicating that the action was successful
  2928. */
  2929. ExitCode[ExitCode["Success"] = 0] = "Success";
  2930. /**
  2931. * A code indicating that the action was a failure
  2932. */
  2933. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  2934. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  2935. //-----------------------------------------------------------------------
  2936. // Variables
  2937. //-----------------------------------------------------------------------
  2938. /**
  2939. * Sets env variable for this action and future actions in the job
  2940. * @param name the name of the variable to set
  2941. * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
  2942. */
  2943. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2944. function exportVariable(name, val) {
  2945. const convertedVal = utils_1.toCommandValue(val);
  2946. process.env[name] = convertedVal;
  2947. const filePath = process.env['GITHUB_ENV'] || '';
  2948. if (filePath) {
  2949. return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
  2950. }
  2951. command_1.issueCommand('set-env', { name }, convertedVal);
  2952. }
  2953. exports.exportVariable = exportVariable;
  2954. /**
  2955. * Registers a secret which will get masked from logs
  2956. * @param secret value of the secret
  2957. */
  2958. function setSecret(secret) {
  2959. command_1.issueCommand('add-mask', {}, secret);
  2960. }
  2961. exports.setSecret = setSecret;
  2962. /**
  2963. * Prepends inputPath to the PATH (for this action and future actions)
  2964. * @param inputPath
  2965. */
  2966. function addPath(inputPath) {
  2967. const filePath = process.env['GITHUB_PATH'] || '';
  2968. if (filePath) {
  2969. file_command_1.issueFileCommand('PATH', inputPath);
  2970. }
  2971. else {
  2972. command_1.issueCommand('add-path', {}, inputPath);
  2973. }
  2974. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  2975. }
  2976. exports.addPath = addPath;
  2977. /**
  2978. * Gets the value of an input.
  2979. * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
  2980. * Returns an empty string if the value is not defined.
  2981. *
  2982. * @param name name of the input to get
  2983. * @param options optional. See InputOptions.
  2984. * @returns string
  2985. */
  2986. function getInput(name, options) {
  2987. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  2988. if (options && options.required && !val) {
  2989. throw new Error(`Input required and not supplied: ${name}`);
  2990. }
  2991. if (options && options.trimWhitespace === false) {
  2992. return val;
  2993. }
  2994. return val.trim();
  2995. }
  2996. exports.getInput = getInput;
  2997. /**
  2998. * Gets the values of an multiline input. Each value is also trimmed.
  2999. *
  3000. * @param name name of the input to get
  3001. * @param options optional. See InputOptions.
  3002. * @returns string[]
  3003. *
  3004. */
  3005. function getMultilineInput(name, options) {
  3006. const inputs = getInput(name, options)
  3007. .split('\n')
  3008. .filter(x => x !== '');
  3009. if (options && options.trimWhitespace === false) {
  3010. return inputs;
  3011. }
  3012. return inputs.map(input => input.trim());
  3013. }
  3014. exports.getMultilineInput = getMultilineInput;
  3015. /**
  3016. * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
  3017. * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
  3018. * The return value is also in boolean type.
  3019. * ref: https://yaml.org/spec/1.2/spec.html#id2804923
  3020. *
  3021. * @param name name of the input to get
  3022. * @param options optional. See InputOptions.
  3023. * @returns boolean
  3024. */
  3025. function getBooleanInput(name, options) {
  3026. const trueValue = ['true', 'True', 'TRUE'];
  3027. const falseValue = ['false', 'False', 'FALSE'];
  3028. const val = getInput(name, options);
  3029. if (trueValue.includes(val))
  3030. return true;
  3031. if (falseValue.includes(val))
  3032. return false;
  3033. throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
  3034. `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
  3035. }
  3036. exports.getBooleanInput = getBooleanInput;
  3037. /**
  3038. * Sets the value of an output.
  3039. *
  3040. * @param name name of the output to set
  3041. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  3042. */
  3043. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  3044. function setOutput(name, value) {
  3045. const filePath = process.env['GITHUB_OUTPUT'] || '';
  3046. if (filePath) {
  3047. return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
  3048. }
  3049. process.stdout.write(os.EOL);
  3050. command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
  3051. }
  3052. exports.setOutput = setOutput;
  3053. /**
  3054. * Enables or disables the echoing of commands into stdout for the rest of the step.
  3055. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
  3056. *
  3057. */
  3058. function setCommandEcho(enabled) {
  3059. command_1.issue('echo', enabled ? 'on' : 'off');
  3060. }
  3061. exports.setCommandEcho = setCommandEcho;
  3062. //-----------------------------------------------------------------------
  3063. // Results
  3064. //-----------------------------------------------------------------------
  3065. /**
  3066. * Sets the action status to failed.
  3067. * When the action exits it will be with an exit code of 1
  3068. * @param message add error issue message
  3069. */
  3070. function setFailed(message) {
  3071. process.exitCode = ExitCode.Failure;
  3072. error(message);
  3073. }
  3074. exports.setFailed = setFailed;
  3075. //-----------------------------------------------------------------------
  3076. // Logging Commands
  3077. //-----------------------------------------------------------------------
  3078. /**
  3079. * Gets whether Actions Step Debug is on or not
  3080. */
  3081. function isDebug() {
  3082. return process.env['RUNNER_DEBUG'] === '1';
  3083. }
  3084. exports.isDebug = isDebug;
  3085. /**
  3086. * Writes debug message to user log
  3087. * @param message debug message
  3088. */
  3089. function debug(message) {
  3090. command_1.issueCommand('debug', {}, message);
  3091. }
  3092. exports.debug = debug;
  3093. /**
  3094. * Adds an error issue
  3095. * @param message error issue message. Errors will be converted to string via toString()
  3096. * @param properties optional properties to add to the annotation.
  3097. */
  3098. function error(message, properties = {}) {
  3099. command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3100. }
  3101. exports.error = error;
  3102. /**
  3103. * Adds a warning issue
  3104. * @param message warning issue message. Errors will be converted to string via toString()
  3105. * @param properties optional properties to add to the annotation.
  3106. */
  3107. function warning(message, properties = {}) {
  3108. command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3109. }
  3110. exports.warning = warning;
  3111. /**
  3112. * Adds a notice issue
  3113. * @param message notice issue message. Errors will be converted to string via toString()
  3114. * @param properties optional properties to add to the annotation.
  3115. */
  3116. function notice(message, properties = {}) {
  3117. command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3118. }
  3119. exports.notice = notice;
  3120. /**
  3121. * Writes info to log with console.log.
  3122. * @param message info message
  3123. */
  3124. function info(message) {
  3125. process.stdout.write(message + os.EOL);
  3126. }
  3127. exports.info = info;
  3128. /**
  3129. * Begin an output group.
  3130. *
  3131. * Output until the next `groupEnd` will be foldable in this group
  3132. *
  3133. * @param name The name of the output group
  3134. */
  3135. function startGroup(name) {
  3136. command_1.issue('group', name);
  3137. }
  3138. exports.startGroup = startGroup;
  3139. /**
  3140. * End an output group.
  3141. */
  3142. function endGroup() {
  3143. command_1.issue('endgroup');
  3144. }
  3145. exports.endGroup = endGroup;
  3146. /**
  3147. * Wrap an asynchronous function call in a group.
  3148. *
  3149. * Returns the same type as the function itself.
  3150. *
  3151. * @param name The name of the group
  3152. * @param fn The function to wrap in the group
  3153. */
  3154. function group(name, fn) {
  3155. return __awaiter(this, void 0, void 0, function* () {
  3156. startGroup(name);
  3157. let result;
  3158. try {
  3159. result = yield fn();
  3160. }
  3161. finally {
  3162. endGroup();
  3163. }
  3164. return result;
  3165. });
  3166. }
  3167. exports.group = group;
  3168. //-----------------------------------------------------------------------
  3169. // Wrapper action state
  3170. //-----------------------------------------------------------------------
  3171. /**
  3172. * Saves state for current action, the state can only be retrieved by this action's post job execution.
  3173. *
  3174. * @param name name of the state to store
  3175. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  3176. */
  3177. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  3178. function saveState(name, value) {
  3179. const filePath = process.env['GITHUB_STATE'] || '';
  3180. if (filePath) {
  3181. return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
  3182. }
  3183. command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
  3184. }
  3185. exports.saveState = saveState;
  3186. /**
  3187. * Gets the value of an state set by this action's main execution.
  3188. *
  3189. * @param name name of the state to get
  3190. * @returns string
  3191. */
  3192. function getState(name) {
  3193. return process.env[`STATE_${name}`] || '';
  3194. }
  3195. exports.getState = getState;
  3196. function getIDToken(aud) {
  3197. return __awaiter(this, void 0, void 0, function* () {
  3198. return yield oidc_utils_1.OidcClient.getIDToken(aud);
  3199. });
  3200. }
  3201. exports.getIDToken = getIDToken;
  3202. /**
  3203. * Summary exports
  3204. */
  3205. var summary_1 = __nccwpck_require__(1327);
  3206. Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
  3207. /**
  3208. * @deprecated use core.summary
  3209. */
  3210. var summary_2 = __nccwpck_require__(1327);
  3211. Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
  3212. /**
  3213. * Path exports
  3214. */
  3215. var path_utils_1 = __nccwpck_require__(2981);
  3216. Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
  3217. Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
  3218. Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
  3219. //# sourceMappingURL=core.js.map
  3220. /***/ }),
  3221. /***/ 717:
  3222. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3223. "use strict";
  3224. // For internal use, subject to change.
  3225. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3226. if (k2 === undefined) k2 = k;
  3227. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3228. }) : (function(o, m, k, k2) {
  3229. if (k2 === undefined) k2 = k;
  3230. o[k2] = m[k];
  3231. }));
  3232. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3233. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3234. }) : function(o, v) {
  3235. o["default"] = v;
  3236. });
  3237. var __importStar = (this && this.__importStar) || function (mod) {
  3238. if (mod && mod.__esModule) return mod;
  3239. var result = {};
  3240. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3241. __setModuleDefault(result, mod);
  3242. return result;
  3243. };
  3244. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3245. exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
  3246. // We use any as a valid input type
  3247. /* eslint-disable @typescript-eslint/no-explicit-any */
  3248. const fs = __importStar(__nccwpck_require__(7147));
  3249. const os = __importStar(__nccwpck_require__(2037));
  3250. const uuid_1 = __nccwpck_require__(8974);
  3251. const utils_1 = __nccwpck_require__(5278);
  3252. function issueFileCommand(command, message) {
  3253. const filePath = process.env[`GITHUB_${command}`];
  3254. if (!filePath) {
  3255. throw new Error(`Unable to find environment variable for file command ${command}`);
  3256. }
  3257. if (!fs.existsSync(filePath)) {
  3258. throw new Error(`Missing file at path: ${filePath}`);
  3259. }
  3260. fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
  3261. encoding: 'utf8'
  3262. });
  3263. }
  3264. exports.issueFileCommand = issueFileCommand;
  3265. function prepareKeyValueMessage(key, value) {
  3266. const delimiter = `ghadelimiter_${uuid_1.v4()}`;
  3267. const convertedValue = utils_1.toCommandValue(value);
  3268. // These should realistically never happen, but just in case someone finds a
  3269. // way to exploit uuid generation let's not allow keys or values that contain
  3270. // the delimiter.
  3271. if (key.includes(delimiter)) {
  3272. throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
  3273. }
  3274. if (convertedValue.includes(delimiter)) {
  3275. throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
  3276. }
  3277. return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
  3278. }
  3279. exports.prepareKeyValueMessage = prepareKeyValueMessage;
  3280. //# sourceMappingURL=file-command.js.map
  3281. /***/ }),
  3282. /***/ 8041:
  3283. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3284. "use strict";
  3285. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3286. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3287. return new (P || (P = Promise))(function (resolve, reject) {
  3288. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3289. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3290. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3291. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3292. });
  3293. };
  3294. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3295. exports.OidcClient = void 0;
  3296. const http_client_1 = __nccwpck_require__(6255);
  3297. const auth_1 = __nccwpck_require__(5526);
  3298. const core_1 = __nccwpck_require__(2186);
  3299. class OidcClient {
  3300. static createHttpClient(allowRetry = true, maxRetry = 10) {
  3301. const requestOptions = {
  3302. allowRetries: allowRetry,
  3303. maxRetries: maxRetry
  3304. };
  3305. return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
  3306. }
  3307. static getRequestToken() {
  3308. const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
  3309. if (!token) {
  3310. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
  3311. }
  3312. return token;
  3313. }
  3314. static getIDTokenUrl() {
  3315. const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
  3316. if (!runtimeUrl) {
  3317. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
  3318. }
  3319. return runtimeUrl;
  3320. }
  3321. static getCall(id_token_url) {
  3322. var _a;
  3323. return __awaiter(this, void 0, void 0, function* () {
  3324. const httpclient = OidcClient.createHttpClient();
  3325. const res = yield httpclient
  3326. .getJson(id_token_url)
  3327. .catch(error => {
  3328. throw new Error(`Failed to get ID Token. \n
  3329. Error Code : ${error.statusCode}\n
  3330. Error Message: ${error.message}`);
  3331. });
  3332. const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
  3333. if (!id_token) {
  3334. throw new Error('Response json body do not have ID Token field');
  3335. }
  3336. return id_token;
  3337. });
  3338. }
  3339. static getIDToken(audience) {
  3340. return __awaiter(this, void 0, void 0, function* () {
  3341. try {
  3342. // New ID Token is requested from action service
  3343. let id_token_url = OidcClient.getIDTokenUrl();
  3344. if (audience) {
  3345. const encodedAudience = encodeURIComponent(audience);
  3346. id_token_url = `${id_token_url}&audience=${encodedAudience}`;
  3347. }
  3348. core_1.debug(`ID token url is ${id_token_url}`);
  3349. const id_token = yield OidcClient.getCall(id_token_url);
  3350. core_1.setSecret(id_token);
  3351. return id_token;
  3352. }
  3353. catch (error) {
  3354. throw new Error(`Error message: ${error.message}`);
  3355. }
  3356. });
  3357. }
  3358. }
  3359. exports.OidcClient = OidcClient;
  3360. //# sourceMappingURL=oidc-utils.js.map
  3361. /***/ }),
  3362. /***/ 2981:
  3363. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3364. "use strict";
  3365. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3366. if (k2 === undefined) k2 = k;
  3367. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3368. }) : (function(o, m, k, k2) {
  3369. if (k2 === undefined) k2 = k;
  3370. o[k2] = m[k];
  3371. }));
  3372. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3373. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3374. }) : function(o, v) {
  3375. o["default"] = v;
  3376. });
  3377. var __importStar = (this && this.__importStar) || function (mod) {
  3378. if (mod && mod.__esModule) return mod;
  3379. var result = {};
  3380. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3381. __setModuleDefault(result, mod);
  3382. return result;
  3383. };
  3384. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3385. exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
  3386. const path = __importStar(__nccwpck_require__(1017));
  3387. /**
  3388. * toPosixPath converts the given path to the posix form. On Windows, \\ will be
  3389. * replaced with /.
  3390. *
  3391. * @param pth. Path to transform.
  3392. * @return string Posix path.
  3393. */
  3394. function toPosixPath(pth) {
  3395. return pth.replace(/[\\]/g, '/');
  3396. }
  3397. exports.toPosixPath = toPosixPath;
  3398. /**
  3399. * toWin32Path converts the given path to the win32 form. On Linux, / will be
  3400. * replaced with \\.
  3401. *
  3402. * @param pth. Path to transform.
  3403. * @return string Win32 path.
  3404. */
  3405. function toWin32Path(pth) {
  3406. return pth.replace(/[/]/g, '\\');
  3407. }
  3408. exports.toWin32Path = toWin32Path;
  3409. /**
  3410. * toPlatformPath converts the given path to a platform-specific path. It does
  3411. * this by replacing instances of / and \ with the platform-specific path
  3412. * separator.
  3413. *
  3414. * @param pth The path to platformize.
  3415. * @return string The platform-specific path.
  3416. */
  3417. function toPlatformPath(pth) {
  3418. return pth.replace(/[/\\]/g, path.sep);
  3419. }
  3420. exports.toPlatformPath = toPlatformPath;
  3421. //# sourceMappingURL=path-utils.js.map
  3422. /***/ }),
  3423. /***/ 1327:
  3424. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3425. "use strict";
  3426. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3427. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3428. return new (P || (P = Promise))(function (resolve, reject) {
  3429. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3430. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3431. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3432. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3433. });
  3434. };
  3435. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3436. exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
  3437. const os_1 = __nccwpck_require__(2037);
  3438. const fs_1 = __nccwpck_require__(7147);
  3439. const { access, appendFile, writeFile } = fs_1.promises;
  3440. exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
  3441. exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
  3442. class Summary {
  3443. constructor() {
  3444. this._buffer = '';
  3445. }
  3446. /**
  3447. * Finds the summary file path from the environment, rejects if env var is not found or file does not exist
  3448. * Also checks r/w permissions.
  3449. *
  3450. * @returns step summary file path
  3451. */
  3452. filePath() {
  3453. return __awaiter(this, void 0, void 0, function* () {
  3454. if (this._filePath) {
  3455. return this._filePath;
  3456. }
  3457. const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
  3458. if (!pathFromEnv) {
  3459. throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
  3460. }
  3461. try {
  3462. yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
  3463. }
  3464. catch (_a) {
  3465. throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
  3466. }
  3467. this._filePath = pathFromEnv;
  3468. return this._filePath;
  3469. });
  3470. }
  3471. /**
  3472. * Wraps content in an HTML tag, adding any HTML attributes
  3473. *
  3474. * @param {string} tag HTML tag to wrap
  3475. * @param {string | null} content content within the tag
  3476. * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
  3477. *
  3478. * @returns {string} content wrapped in HTML element
  3479. */
  3480. wrap(tag, content, attrs = {}) {
  3481. const htmlAttrs = Object.entries(attrs)
  3482. .map(([key, value]) => ` ${key}="${value}"`)
  3483. .join('');
  3484. if (!content) {
  3485. return `<${tag}${htmlAttrs}>`;
  3486. }
  3487. return `<${tag}${htmlAttrs}>${content}</${tag}>`;
  3488. }
  3489. /**
  3490. * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
  3491. *
  3492. * @param {SummaryWriteOptions} [options] (optional) options for write operation
  3493. *
  3494. * @returns {Promise<Summary>} summary instance
  3495. */
  3496. write(options) {
  3497. return __awaiter(this, void 0, void 0, function* () {
  3498. const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
  3499. const filePath = yield this.filePath();
  3500. const writeFunc = overwrite ? writeFile : appendFile;
  3501. yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
  3502. return this.emptyBuffer();
  3503. });
  3504. }
  3505. /**
  3506. * Clears the summary buffer and wipes the summary file
  3507. *
  3508. * @returns {Summary} summary instance
  3509. */
  3510. clear() {
  3511. return __awaiter(this, void 0, void 0, function* () {
  3512. return this.emptyBuffer().write({ overwrite: true });
  3513. });
  3514. }
  3515. /**
  3516. * Returns the current summary buffer as a string
  3517. *
  3518. * @returns {string} string of summary buffer
  3519. */
  3520. stringify() {
  3521. return this._buffer;
  3522. }
  3523. /**
  3524. * If the summary buffer is empty
  3525. *
  3526. * @returns {boolen} true if the buffer is empty
  3527. */
  3528. isEmptyBuffer() {
  3529. return this._buffer.length === 0;
  3530. }
  3531. /**
  3532. * Resets the summary buffer without writing to summary file
  3533. *
  3534. * @returns {Summary} summary instance
  3535. */
  3536. emptyBuffer() {
  3537. this._buffer = '';
  3538. return this;
  3539. }
  3540. /**
  3541. * Adds raw text to the summary buffer
  3542. *
  3543. * @param {string} text content to add
  3544. * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
  3545. *
  3546. * @returns {Summary} summary instance
  3547. */
  3548. addRaw(text, addEOL = false) {
  3549. this._buffer += text;
  3550. return addEOL ? this.addEOL() : this;
  3551. }
  3552. /**
  3553. * Adds the operating system-specific end-of-line marker to the buffer
  3554. *
  3555. * @returns {Summary} summary instance
  3556. */
  3557. addEOL() {
  3558. return this.addRaw(os_1.EOL);
  3559. }
  3560. /**
  3561. * Adds an HTML codeblock to the summary buffer
  3562. *
  3563. * @param {string} code content to render within fenced code block
  3564. * @param {string} lang (optional) language to syntax highlight code
  3565. *
  3566. * @returns {Summary} summary instance
  3567. */
  3568. addCodeBlock(code, lang) {
  3569. const attrs = Object.assign({}, (lang && { lang }));
  3570. const element = this.wrap('pre', this.wrap('code', code), attrs);
  3571. return this.addRaw(element).addEOL();
  3572. }
  3573. /**
  3574. * Adds an HTML list to the summary buffer
  3575. *
  3576. * @param {string[]} items list of items to render
  3577. * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
  3578. *
  3579. * @returns {Summary} summary instance
  3580. */
  3581. addList(items, ordered = false) {
  3582. const tag = ordered ? 'ol' : 'ul';
  3583. const listItems = items.map(item => this.wrap('li', item)).join('');
  3584. const element = this.wrap(tag, listItems);
  3585. return this.addRaw(element).addEOL();
  3586. }
  3587. /**
  3588. * Adds an HTML table to the summary buffer
  3589. *
  3590. * @param {SummaryTableCell[]} rows table rows
  3591. *
  3592. * @returns {Summary} summary instance
  3593. */
  3594. addTable(rows) {
  3595. const tableBody = rows
  3596. .map(row => {
  3597. const cells = row
  3598. .map(cell => {
  3599. if (typeof cell === 'string') {
  3600. return this.wrap('td', cell);
  3601. }
  3602. const { header, data, colspan, rowspan } = cell;
  3603. const tag = header ? 'th' : 'td';
  3604. const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
  3605. return this.wrap(tag, data, attrs);
  3606. })
  3607. .join('');
  3608. return this.wrap('tr', cells);
  3609. })
  3610. .join('');
  3611. const element = this.wrap('table', tableBody);
  3612. return this.addRaw(element).addEOL();
  3613. }
  3614. /**
  3615. * Adds a collapsable HTML details element to the summary buffer
  3616. *
  3617. * @param {string} label text for the closed state
  3618. * @param {string} content collapsable content
  3619. *
  3620. * @returns {Summary} summary instance
  3621. */
  3622. addDetails(label, content) {
  3623. const element = this.wrap('details', this.wrap('summary', label) + content);
  3624. return this.addRaw(element).addEOL();
  3625. }
  3626. /**
  3627. * Adds an HTML image tag to the summary buffer
  3628. *
  3629. * @param {string} src path to the image you to embed
  3630. * @param {string} alt text description of the image
  3631. * @param {SummaryImageOptions} options (optional) addition image attributes
  3632. *
  3633. * @returns {Summary} summary instance
  3634. */
  3635. addImage(src, alt, options) {
  3636. const { width, height } = options || {};
  3637. const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
  3638. const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
  3639. return this.addRaw(element).addEOL();
  3640. }
  3641. /**
  3642. * Adds an HTML section heading element
  3643. *
  3644. * @param {string} text heading text
  3645. * @param {number | string} [level=1] (optional) the heading level, default: 1
  3646. *
  3647. * @returns {Summary} summary instance
  3648. */
  3649. addHeading(text, level) {
  3650. const tag = `h${level}`;
  3651. const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
  3652. ? tag
  3653. : 'h1';
  3654. const element = this.wrap(allowedTag, text);
  3655. return this.addRaw(element).addEOL();
  3656. }
  3657. /**
  3658. * Adds an HTML thematic break (<hr>) to the summary buffer
  3659. *
  3660. * @returns {Summary} summary instance
  3661. */
  3662. addSeparator() {
  3663. const element = this.wrap('hr', null);
  3664. return this.addRaw(element).addEOL();
  3665. }
  3666. /**
  3667. * Adds an HTML line break (<br>) to the summary buffer
  3668. *
  3669. * @returns {Summary} summary instance
  3670. */
  3671. addBreak() {
  3672. const element = this.wrap('br', null);
  3673. return this.addRaw(element).addEOL();
  3674. }
  3675. /**
  3676. * Adds an HTML blockquote to the summary buffer
  3677. *
  3678. * @param {string} text quote text
  3679. * @param {string} cite (optional) citation url
  3680. *
  3681. * @returns {Summary} summary instance
  3682. */
  3683. addQuote(text, cite) {
  3684. const attrs = Object.assign({}, (cite && { cite }));
  3685. const element = this.wrap('blockquote', text, attrs);
  3686. return this.addRaw(element).addEOL();
  3687. }
  3688. /**
  3689. * Adds an HTML anchor tag to the summary buffer
  3690. *
  3691. * @param {string} text link text/content
  3692. * @param {string} href hyperlink
  3693. *
  3694. * @returns {Summary} summary instance
  3695. */
  3696. addLink(text, href) {
  3697. const element = this.wrap('a', text, { href });
  3698. return this.addRaw(element).addEOL();
  3699. }
  3700. }
  3701. const _summary = new Summary();
  3702. /**
  3703. * @deprecated use `core.summary`
  3704. */
  3705. exports.markdownSummary = _summary;
  3706. exports.summary = _summary;
  3707. //# sourceMappingURL=summary.js.map
  3708. /***/ }),
  3709. /***/ 5278:
  3710. /***/ ((__unused_webpack_module, exports) => {
  3711. "use strict";
  3712. // We use any as a valid input type
  3713. /* eslint-disable @typescript-eslint/no-explicit-any */
  3714. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3715. exports.toCommandProperties = exports.toCommandValue = void 0;
  3716. /**
  3717. * Sanitizes an input into a string so it can be passed into issueCommand safely
  3718. * @param input input to sanitize into a string
  3719. */
  3720. function toCommandValue(input) {
  3721. if (input === null || input === undefined) {
  3722. return '';
  3723. }
  3724. else if (typeof input === 'string' || input instanceof String) {
  3725. return input;
  3726. }
  3727. return JSON.stringify(input);
  3728. }
  3729. exports.toCommandValue = toCommandValue;
  3730. /**
  3731. *
  3732. * @param annotationProperties
  3733. * @returns The command properties to send with the actual annotation command
  3734. * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
  3735. */
  3736. function toCommandProperties(annotationProperties) {
  3737. if (!Object.keys(annotationProperties).length) {
  3738. return {};
  3739. }
  3740. return {
  3741. title: annotationProperties.title,
  3742. file: annotationProperties.file,
  3743. line: annotationProperties.startLine,
  3744. endLine: annotationProperties.endLine,
  3745. col: annotationProperties.startColumn,
  3746. endColumn: annotationProperties.endColumn
  3747. };
  3748. }
  3749. exports.toCommandProperties = toCommandProperties;
  3750. //# sourceMappingURL=utils.js.map
  3751. /***/ }),
  3752. /***/ 8974:
  3753. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3754. "use strict";
  3755. Object.defineProperty(exports, "__esModule", ({
  3756. value: true
  3757. }));
  3758. Object.defineProperty(exports, "v1", ({
  3759. enumerable: true,
  3760. get: function () {
  3761. return _v.default;
  3762. }
  3763. }));
  3764. Object.defineProperty(exports, "v3", ({
  3765. enumerable: true,
  3766. get: function () {
  3767. return _v2.default;
  3768. }
  3769. }));
  3770. Object.defineProperty(exports, "v4", ({
  3771. enumerable: true,
  3772. get: function () {
  3773. return _v3.default;
  3774. }
  3775. }));
  3776. Object.defineProperty(exports, "v5", ({
  3777. enumerable: true,
  3778. get: function () {
  3779. return _v4.default;
  3780. }
  3781. }));
  3782. Object.defineProperty(exports, "NIL", ({
  3783. enumerable: true,
  3784. get: function () {
  3785. return _nil.default;
  3786. }
  3787. }));
  3788. Object.defineProperty(exports, "version", ({
  3789. enumerable: true,
  3790. get: function () {
  3791. return _version.default;
  3792. }
  3793. }));
  3794. Object.defineProperty(exports, "validate", ({
  3795. enumerable: true,
  3796. get: function () {
  3797. return _validate.default;
  3798. }
  3799. }));
  3800. Object.defineProperty(exports, "stringify", ({
  3801. enumerable: true,
  3802. get: function () {
  3803. return _stringify.default;
  3804. }
  3805. }));
  3806. Object.defineProperty(exports, "parse", ({
  3807. enumerable: true,
  3808. get: function () {
  3809. return _parse.default;
  3810. }
  3811. }));
  3812. var _v = _interopRequireDefault(__nccwpck_require__(1595));
  3813. var _v2 = _interopRequireDefault(__nccwpck_require__(6993));
  3814. var _v3 = _interopRequireDefault(__nccwpck_require__(1472));
  3815. var _v4 = _interopRequireDefault(__nccwpck_require__(6217));
  3816. var _nil = _interopRequireDefault(__nccwpck_require__(2381));
  3817. var _version = _interopRequireDefault(__nccwpck_require__(427));
  3818. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3819. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3820. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3821. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3822. /***/ }),
  3823. /***/ 5842:
  3824. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3825. "use strict";
  3826. Object.defineProperty(exports, "__esModule", ({
  3827. value: true
  3828. }));
  3829. exports["default"] = void 0;
  3830. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3831. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3832. function md5(bytes) {
  3833. if (Array.isArray(bytes)) {
  3834. bytes = Buffer.from(bytes);
  3835. } else if (typeof bytes === 'string') {
  3836. bytes = Buffer.from(bytes, 'utf8');
  3837. }
  3838. return _crypto.default.createHash('md5').update(bytes).digest();
  3839. }
  3840. var _default = md5;
  3841. exports["default"] = _default;
  3842. /***/ }),
  3843. /***/ 2381:
  3844. /***/ ((__unused_webpack_module, exports) => {
  3845. "use strict";
  3846. Object.defineProperty(exports, "__esModule", ({
  3847. value: true
  3848. }));
  3849. exports["default"] = void 0;
  3850. var _default = '00000000-0000-0000-0000-000000000000';
  3851. exports["default"] = _default;
  3852. /***/ }),
  3853. /***/ 6385:
  3854. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3855. "use strict";
  3856. Object.defineProperty(exports, "__esModule", ({
  3857. value: true
  3858. }));
  3859. exports["default"] = void 0;
  3860. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3861. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3862. function parse(uuid) {
  3863. if (!(0, _validate.default)(uuid)) {
  3864. throw TypeError('Invalid UUID');
  3865. }
  3866. let v;
  3867. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  3868. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  3869. arr[1] = v >>> 16 & 0xff;
  3870. arr[2] = v >>> 8 & 0xff;
  3871. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  3872. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  3873. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  3874. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  3875. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  3876. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  3877. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  3878. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  3879. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  3880. arr[11] = v / 0x100000000 & 0xff;
  3881. arr[12] = v >>> 24 & 0xff;
  3882. arr[13] = v >>> 16 & 0xff;
  3883. arr[14] = v >>> 8 & 0xff;
  3884. arr[15] = v & 0xff;
  3885. return arr;
  3886. }
  3887. var _default = parse;
  3888. exports["default"] = _default;
  3889. /***/ }),
  3890. /***/ 6230:
  3891. /***/ ((__unused_webpack_module, exports) => {
  3892. "use strict";
  3893. Object.defineProperty(exports, "__esModule", ({
  3894. value: true
  3895. }));
  3896. exports["default"] = void 0;
  3897. var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
  3898. exports["default"] = _default;
  3899. /***/ }),
  3900. /***/ 9784:
  3901. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3902. "use strict";
  3903. Object.defineProperty(exports, "__esModule", ({
  3904. value: true
  3905. }));
  3906. exports["default"] = rng;
  3907. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3908. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3909. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  3910. let poolPtr = rnds8Pool.length;
  3911. function rng() {
  3912. if (poolPtr > rnds8Pool.length - 16) {
  3913. _crypto.default.randomFillSync(rnds8Pool);
  3914. poolPtr = 0;
  3915. }
  3916. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  3917. }
  3918. /***/ }),
  3919. /***/ 8844:
  3920. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3921. "use strict";
  3922. Object.defineProperty(exports, "__esModule", ({
  3923. value: true
  3924. }));
  3925. exports["default"] = void 0;
  3926. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3927. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3928. function sha1(bytes) {
  3929. if (Array.isArray(bytes)) {
  3930. bytes = Buffer.from(bytes);
  3931. } else if (typeof bytes === 'string') {
  3932. bytes = Buffer.from(bytes, 'utf8');
  3933. }
  3934. return _crypto.default.createHash('sha1').update(bytes).digest();
  3935. }
  3936. var _default = sha1;
  3937. exports["default"] = _default;
  3938. /***/ }),
  3939. /***/ 1458:
  3940. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3941. "use strict";
  3942. Object.defineProperty(exports, "__esModule", ({
  3943. value: true
  3944. }));
  3945. exports["default"] = void 0;
  3946. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3947. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3948. /**
  3949. * Convert array of 16 byte values to UUID string format of the form:
  3950. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  3951. */
  3952. const byteToHex = [];
  3953. for (let i = 0; i < 256; ++i) {
  3954. byteToHex.push((i + 0x100).toString(16).substr(1));
  3955. }
  3956. function stringify(arr, offset = 0) {
  3957. // Note: Be careful editing this code! It's been tuned for performance
  3958. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  3959. 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
  3960. // of the following:
  3961. // - One or more input array values don't map to a hex octet (leading to
  3962. // "undefined" in the uuid)
  3963. // - Invalid input values for the RFC `version` or `variant` fields
  3964. if (!(0, _validate.default)(uuid)) {
  3965. throw TypeError('Stringified UUID is invalid');
  3966. }
  3967. return uuid;
  3968. }
  3969. var _default = stringify;
  3970. exports["default"] = _default;
  3971. /***/ }),
  3972. /***/ 1595:
  3973. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3974. "use strict";
  3975. Object.defineProperty(exports, "__esModule", ({
  3976. value: true
  3977. }));
  3978. exports["default"] = void 0;
  3979. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  3980. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3981. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3982. // **`v1()` - Generate time-based UUID**
  3983. //
  3984. // Inspired by https://github.com/LiosK/UUID.js
  3985. // and http://docs.python.org/library/uuid.html
  3986. let _nodeId;
  3987. let _clockseq; // Previous uuid creation time
  3988. let _lastMSecs = 0;
  3989. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  3990. function v1(options, buf, offset) {
  3991. let i = buf && offset || 0;
  3992. const b = buf || new Array(16);
  3993. options = options || {};
  3994. let node = options.node || _nodeId;
  3995. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  3996. // specified. We do this lazily to minimize issues related to insufficient
  3997. // system entropy. See #189
  3998. if (node == null || clockseq == null) {
  3999. const seedBytes = options.random || (options.rng || _rng.default)();
  4000. if (node == null) {
  4001. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  4002. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  4003. }
  4004. if (clockseq == null) {
  4005. // Per 4.2.2, randomize (14 bit) clockseq
  4006. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  4007. }
  4008. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  4009. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  4010. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  4011. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  4012. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  4013. // cycle to simulate higher resolution clock
  4014. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  4015. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  4016. if (dt < 0 && options.clockseq === undefined) {
  4017. clockseq = clockseq + 1 & 0x3fff;
  4018. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  4019. // time interval
  4020. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  4021. nsecs = 0;
  4022. } // Per 4.2.1.2 Throw error if too many uuids are requested
  4023. if (nsecs >= 10000) {
  4024. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  4025. }
  4026. _lastMSecs = msecs;
  4027. _lastNSecs = nsecs;
  4028. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  4029. msecs += 12219292800000; // `time_low`
  4030. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  4031. b[i++] = tl >>> 24 & 0xff;
  4032. b[i++] = tl >>> 16 & 0xff;
  4033. b[i++] = tl >>> 8 & 0xff;
  4034. b[i++] = tl & 0xff; // `time_mid`
  4035. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  4036. b[i++] = tmh >>> 8 & 0xff;
  4037. b[i++] = tmh & 0xff; // `time_high_and_version`
  4038. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  4039. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  4040. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  4041. b[i++] = clockseq & 0xff; // `node`
  4042. for (let n = 0; n < 6; ++n) {
  4043. b[i + n] = node[n];
  4044. }
  4045. return buf || (0, _stringify.default)(b);
  4046. }
  4047. var _default = v1;
  4048. exports["default"] = _default;
  4049. /***/ }),
  4050. /***/ 6993:
  4051. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4052. "use strict";
  4053. Object.defineProperty(exports, "__esModule", ({
  4054. value: true
  4055. }));
  4056. exports["default"] = void 0;
  4057. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  4058. var _md = _interopRequireDefault(__nccwpck_require__(5842));
  4059. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4060. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  4061. var _default = v3;
  4062. exports["default"] = _default;
  4063. /***/ }),
  4064. /***/ 5920:
  4065. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4066. "use strict";
  4067. Object.defineProperty(exports, "__esModule", ({
  4068. value: true
  4069. }));
  4070. exports["default"] = _default;
  4071. exports.URL = exports.DNS = void 0;
  4072. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  4073. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  4074. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4075. function stringToBytes(str) {
  4076. str = unescape(encodeURIComponent(str)); // UTF8 escape
  4077. const bytes = [];
  4078. for (let i = 0; i < str.length; ++i) {
  4079. bytes.push(str.charCodeAt(i));
  4080. }
  4081. return bytes;
  4082. }
  4083. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  4084. exports.DNS = DNS;
  4085. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  4086. exports.URL = URL;
  4087. function _default(name, version, hashfunc) {
  4088. function generateUUID(value, namespace, buf, offset) {
  4089. if (typeof value === 'string') {
  4090. value = stringToBytes(value);
  4091. }
  4092. if (typeof namespace === 'string') {
  4093. namespace = (0, _parse.default)(namespace);
  4094. }
  4095. if (namespace.length !== 16) {
  4096. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  4097. } // Compute hash of namespace and value, Per 4.3
  4098. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  4099. // hashfunc([...namespace, ... value])`
  4100. let bytes = new Uint8Array(16 + value.length);
  4101. bytes.set(namespace);
  4102. bytes.set(value, namespace.length);
  4103. bytes = hashfunc(bytes);
  4104. bytes[6] = bytes[6] & 0x0f | version;
  4105. bytes[8] = bytes[8] & 0x3f | 0x80;
  4106. if (buf) {
  4107. offset = offset || 0;
  4108. for (let i = 0; i < 16; ++i) {
  4109. buf[offset + i] = bytes[i];
  4110. }
  4111. return buf;
  4112. }
  4113. return (0, _stringify.default)(bytes);
  4114. } // Function#name is not settable on some platforms (#270)
  4115. try {
  4116. generateUUID.name = name; // eslint-disable-next-line no-empty
  4117. } catch (err) {} // For CommonJS default export support
  4118. generateUUID.DNS = DNS;
  4119. generateUUID.URL = URL;
  4120. return generateUUID;
  4121. }
  4122. /***/ }),
  4123. /***/ 1472:
  4124. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4125. "use strict";
  4126. Object.defineProperty(exports, "__esModule", ({
  4127. value: true
  4128. }));
  4129. exports["default"] = void 0;
  4130. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  4131. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  4132. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4133. function v4(options, buf, offset) {
  4134. options = options || {};
  4135. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  4136. rnds[6] = rnds[6] & 0x0f | 0x40;
  4137. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  4138. if (buf) {
  4139. offset = offset || 0;
  4140. for (let i = 0; i < 16; ++i) {
  4141. buf[offset + i] = rnds[i];
  4142. }
  4143. return buf;
  4144. }
  4145. return (0, _stringify.default)(rnds);
  4146. }
  4147. var _default = v4;
  4148. exports["default"] = _default;
  4149. /***/ }),
  4150. /***/ 6217:
  4151. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4152. "use strict";
  4153. Object.defineProperty(exports, "__esModule", ({
  4154. value: true
  4155. }));
  4156. exports["default"] = void 0;
  4157. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  4158. var _sha = _interopRequireDefault(__nccwpck_require__(8844));
  4159. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4160. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  4161. var _default = v5;
  4162. exports["default"] = _default;
  4163. /***/ }),
  4164. /***/ 2609:
  4165. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4166. "use strict";
  4167. Object.defineProperty(exports, "__esModule", ({
  4168. value: true
  4169. }));
  4170. exports["default"] = void 0;
  4171. var _regex = _interopRequireDefault(__nccwpck_require__(6230));
  4172. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4173. function validate(uuid) {
  4174. return typeof uuid === 'string' && _regex.default.test(uuid);
  4175. }
  4176. var _default = validate;
  4177. exports["default"] = _default;
  4178. /***/ }),
  4179. /***/ 427:
  4180. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4181. "use strict";
  4182. Object.defineProperty(exports, "__esModule", ({
  4183. value: true
  4184. }));
  4185. exports["default"] = void 0;
  4186. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  4187. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4188. function version(uuid) {
  4189. if (!(0, _validate.default)(uuid)) {
  4190. throw TypeError('Invalid UUID');
  4191. }
  4192. return parseInt(uuid.substr(14, 1), 16);
  4193. }
  4194. var _default = version;
  4195. exports["default"] = _default;
  4196. /***/ }),
  4197. /***/ 1514:
  4198. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4199. "use strict";
  4200. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4201. if (k2 === undefined) k2 = k;
  4202. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4203. }) : (function(o, m, k, k2) {
  4204. if (k2 === undefined) k2 = k;
  4205. o[k2] = m[k];
  4206. }));
  4207. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4208. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4209. }) : function(o, v) {
  4210. o["default"] = v;
  4211. });
  4212. var __importStar = (this && this.__importStar) || function (mod) {
  4213. if (mod && mod.__esModule) return mod;
  4214. var result = {};
  4215. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4216. __setModuleDefault(result, mod);
  4217. return result;
  4218. };
  4219. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4220. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4221. return new (P || (P = Promise))(function (resolve, reject) {
  4222. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4223. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4224. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4225. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4226. });
  4227. };
  4228. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4229. exports.getExecOutput = exports.exec = void 0;
  4230. const string_decoder_1 = __nccwpck_require__(1576);
  4231. const tr = __importStar(__nccwpck_require__(8159));
  4232. /**
  4233. * Exec a command.
  4234. * Output will be streamed to the live console.
  4235. * Returns promise with return code
  4236. *
  4237. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  4238. * @param args optional arguments for tool. Escaping is handled by the lib.
  4239. * @param options optional exec options. See ExecOptions
  4240. * @returns Promise<number> exit code
  4241. */
  4242. function exec(commandLine, args, options) {
  4243. return __awaiter(this, void 0, void 0, function* () {
  4244. const commandArgs = tr.argStringToArray(commandLine);
  4245. if (commandArgs.length === 0) {
  4246. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  4247. }
  4248. // Path to tool to execute should be first arg
  4249. const toolPath = commandArgs[0];
  4250. args = commandArgs.slice(1).concat(args || []);
  4251. const runner = new tr.ToolRunner(toolPath, args, options);
  4252. return runner.exec();
  4253. });
  4254. }
  4255. exports.exec = exec;
  4256. /**
  4257. * Exec a command and get the output.
  4258. * Output will be streamed to the live console.
  4259. * Returns promise with the exit code and collected stdout and stderr
  4260. *
  4261. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  4262. * @param args optional arguments for tool. Escaping is handled by the lib.
  4263. * @param options optional exec options. See ExecOptions
  4264. * @returns Promise<ExecOutput> exit code, stdout, and stderr
  4265. */
  4266. function getExecOutput(commandLine, args, options) {
  4267. var _a, _b;
  4268. return __awaiter(this, void 0, void 0, function* () {
  4269. let stdout = '';
  4270. let stderr = '';
  4271. //Using string decoder covers the case where a mult-byte character is split
  4272. const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');
  4273. const stderrDecoder = new string_decoder_1.StringDecoder('utf8');
  4274. const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
  4275. const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
  4276. const stdErrListener = (data) => {
  4277. stderr += stderrDecoder.write(data);
  4278. if (originalStdErrListener) {
  4279. originalStdErrListener(data);
  4280. }
  4281. };
  4282. const stdOutListener = (data) => {
  4283. stdout += stdoutDecoder.write(data);
  4284. if (originalStdoutListener) {
  4285. originalStdoutListener(data);
  4286. }
  4287. };
  4288. const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
  4289. const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
  4290. //flush any remaining characters
  4291. stdout += stdoutDecoder.end();
  4292. stderr += stderrDecoder.end();
  4293. return {
  4294. exitCode,
  4295. stdout,
  4296. stderr
  4297. };
  4298. });
  4299. }
  4300. exports.getExecOutput = getExecOutput;
  4301. //# sourceMappingURL=exec.js.map
  4302. /***/ }),
  4303. /***/ 8159:
  4304. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4305. "use strict";
  4306. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4307. if (k2 === undefined) k2 = k;
  4308. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4309. }) : (function(o, m, k, k2) {
  4310. if (k2 === undefined) k2 = k;
  4311. o[k2] = m[k];
  4312. }));
  4313. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4314. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4315. }) : function(o, v) {
  4316. o["default"] = v;
  4317. });
  4318. var __importStar = (this && this.__importStar) || function (mod) {
  4319. if (mod && mod.__esModule) return mod;
  4320. var result = {};
  4321. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4322. __setModuleDefault(result, mod);
  4323. return result;
  4324. };
  4325. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4326. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4327. return new (P || (P = Promise))(function (resolve, reject) {
  4328. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4329. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4330. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4331. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4332. });
  4333. };
  4334. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4335. exports.argStringToArray = exports.ToolRunner = void 0;
  4336. const os = __importStar(__nccwpck_require__(2037));
  4337. const events = __importStar(__nccwpck_require__(2361));
  4338. const child = __importStar(__nccwpck_require__(2081));
  4339. const path = __importStar(__nccwpck_require__(1017));
  4340. const io = __importStar(__nccwpck_require__(7436));
  4341. const ioUtil = __importStar(__nccwpck_require__(1962));
  4342. const timers_1 = __nccwpck_require__(9512);
  4343. /* eslint-disable @typescript-eslint/unbound-method */
  4344. const IS_WINDOWS = process.platform === 'win32';
  4345. /*
  4346. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  4347. */
  4348. class ToolRunner extends events.EventEmitter {
  4349. constructor(toolPath, args, options) {
  4350. super();
  4351. if (!toolPath) {
  4352. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  4353. }
  4354. this.toolPath = toolPath;
  4355. this.args = args || [];
  4356. this.options = options || {};
  4357. }
  4358. _debug(message) {
  4359. if (this.options.listeners && this.options.listeners.debug) {
  4360. this.options.listeners.debug(message);
  4361. }
  4362. }
  4363. _getCommandString(options, noPrefix) {
  4364. const toolPath = this._getSpawnFileName();
  4365. const args = this._getSpawnArgs(options);
  4366. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  4367. if (IS_WINDOWS) {
  4368. // Windows + cmd file
  4369. if (this._isCmdFile()) {
  4370. cmd += toolPath;
  4371. for (const a of args) {
  4372. cmd += ` ${a}`;
  4373. }
  4374. }
  4375. // Windows + verbatim
  4376. else if (options.windowsVerbatimArguments) {
  4377. cmd += `"${toolPath}"`;
  4378. for (const a of args) {
  4379. cmd += ` ${a}`;
  4380. }
  4381. }
  4382. // Windows (regular)
  4383. else {
  4384. cmd += this._windowsQuoteCmdArg(toolPath);
  4385. for (const a of args) {
  4386. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  4387. }
  4388. }
  4389. }
  4390. else {
  4391. // OSX/Linux - this can likely be improved with some form of quoting.
  4392. // creating processes on Unix is fundamentally different than Windows.
  4393. // on Unix, execvp() takes an arg array.
  4394. cmd += toolPath;
  4395. for (const a of args) {
  4396. cmd += ` ${a}`;
  4397. }
  4398. }
  4399. return cmd;
  4400. }
  4401. _processLineBuffer(data, strBuffer, onLine) {
  4402. try {
  4403. let s = strBuffer + data.toString();
  4404. let n = s.indexOf(os.EOL);
  4405. while (n > -1) {
  4406. const line = s.substring(0, n);
  4407. onLine(line);
  4408. // the rest of the string ...
  4409. s = s.substring(n + os.EOL.length);
  4410. n = s.indexOf(os.EOL);
  4411. }
  4412. return s;
  4413. }
  4414. catch (err) {
  4415. // streaming lines to console is best effort. Don't fail a build.
  4416. this._debug(`error processing line. Failed with error ${err}`);
  4417. return '';
  4418. }
  4419. }
  4420. _getSpawnFileName() {
  4421. if (IS_WINDOWS) {
  4422. if (this._isCmdFile()) {
  4423. return process.env['COMSPEC'] || 'cmd.exe';
  4424. }
  4425. }
  4426. return this.toolPath;
  4427. }
  4428. _getSpawnArgs(options) {
  4429. if (IS_WINDOWS) {
  4430. if (this._isCmdFile()) {
  4431. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  4432. for (const a of this.args) {
  4433. argline += ' ';
  4434. argline += options.windowsVerbatimArguments
  4435. ? a
  4436. : this._windowsQuoteCmdArg(a);
  4437. }
  4438. argline += '"';
  4439. return [argline];
  4440. }
  4441. }
  4442. return this.args;
  4443. }
  4444. _endsWith(str, end) {
  4445. return str.endsWith(end);
  4446. }
  4447. _isCmdFile() {
  4448. const upperToolPath = this.toolPath.toUpperCase();
  4449. return (this._endsWith(upperToolPath, '.CMD') ||
  4450. this._endsWith(upperToolPath, '.BAT'));
  4451. }
  4452. _windowsQuoteCmdArg(arg) {
  4453. // for .exe, apply the normal quoting rules that libuv applies
  4454. if (!this._isCmdFile()) {
  4455. return this._uvQuoteCmdArg(arg);
  4456. }
  4457. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  4458. // the libuv rules are generic and are not designed specifically for cmd.exe
  4459. // command line parser.
  4460. //
  4461. // for a detailed description of the cmd.exe command line parser, refer to
  4462. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  4463. // need quotes for empty arg
  4464. if (!arg) {
  4465. return '""';
  4466. }
  4467. // determine whether the arg needs to be quoted
  4468. const cmdSpecialChars = [
  4469. ' ',
  4470. '\t',
  4471. '&',
  4472. '(',
  4473. ')',
  4474. '[',
  4475. ']',
  4476. '{',
  4477. '}',
  4478. '^',
  4479. '=',
  4480. ';',
  4481. '!',
  4482. "'",
  4483. '+',
  4484. ',',
  4485. '`',
  4486. '~',
  4487. '|',
  4488. '<',
  4489. '>',
  4490. '"'
  4491. ];
  4492. let needsQuotes = false;
  4493. for (const char of arg) {
  4494. if (cmdSpecialChars.some(x => x === char)) {
  4495. needsQuotes = true;
  4496. break;
  4497. }
  4498. }
  4499. // short-circuit if quotes not needed
  4500. if (!needsQuotes) {
  4501. return arg;
  4502. }
  4503. // the following quoting rules are very similar to the rules that by libuv applies.
  4504. //
  4505. // 1) wrap the string in quotes
  4506. //
  4507. // 2) double-up quotes - i.e. " => ""
  4508. //
  4509. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  4510. // doesn't work well with a cmd.exe command line.
  4511. //
  4512. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  4513. // for example, the command line:
  4514. // foo.exe "myarg:""my val"""
  4515. // is parsed by a .NET console app into an arg array:
  4516. // [ "myarg:\"my val\"" ]
  4517. // which is the same end result when applying libuv quoting rules. although the actual
  4518. // command line from libuv quoting rules would look like:
  4519. // foo.exe "myarg:\"my val\""
  4520. //
  4521. // 3) double-up slashes that precede a quote,
  4522. // e.g. hello \world => "hello \world"
  4523. // hello\"world => "hello\\""world"
  4524. // hello\\"world => "hello\\\\""world"
  4525. // hello world\ => "hello world\\"
  4526. //
  4527. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  4528. // the reasons for including this as a .cmd quoting rule are:
  4529. //
  4530. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  4531. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  4532. //
  4533. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  4534. // haven't heard any complaints about that aspect.
  4535. //
  4536. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  4537. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  4538. // by using %%.
  4539. //
  4540. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  4541. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  4542. //
  4543. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  4544. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  4545. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  4546. // to an external program.
  4547. //
  4548. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  4549. // % can be escaped within a .cmd file.
  4550. let reverse = '"';
  4551. let quoteHit = true;
  4552. for (let i = arg.length; i > 0; i--) {
  4553. // walk the string in reverse
  4554. reverse += arg[i - 1];
  4555. if (quoteHit && arg[i - 1] === '\\') {
  4556. reverse += '\\'; // double the slash
  4557. }
  4558. else if (arg[i - 1] === '"') {
  4559. quoteHit = true;
  4560. reverse += '"'; // double the quote
  4561. }
  4562. else {
  4563. quoteHit = false;
  4564. }
  4565. }
  4566. reverse += '"';
  4567. return reverse
  4568. .split('')
  4569. .reverse()
  4570. .join('');
  4571. }
  4572. _uvQuoteCmdArg(arg) {
  4573. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  4574. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  4575. // is used.
  4576. //
  4577. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  4578. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  4579. // pasting copyright notice from Node within this function:
  4580. //
  4581. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  4582. //
  4583. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4584. // of this software and associated documentation files (the "Software"), to
  4585. // deal in the Software without restriction, including without limitation the
  4586. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  4587. // sell copies of the Software, and to permit persons to whom the Software is
  4588. // furnished to do so, subject to the following conditions:
  4589. //
  4590. // The above copyright notice and this permission notice shall be included in
  4591. // all copies or substantial portions of the Software.
  4592. //
  4593. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4594. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4595. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4596. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4597. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  4598. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  4599. // IN THE SOFTWARE.
  4600. if (!arg) {
  4601. // Need double quotation for empty argument
  4602. return '""';
  4603. }
  4604. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  4605. // No quotation needed
  4606. return arg;
  4607. }
  4608. if (!arg.includes('"') && !arg.includes('\\')) {
  4609. // No embedded double quotes or backslashes, so I can just wrap
  4610. // quote marks around the whole thing.
  4611. return `"${arg}"`;
  4612. }
  4613. // Expected input/output:
  4614. // input : hello"world
  4615. // output: "hello\"world"
  4616. // input : hello""world
  4617. // output: "hello\"\"world"
  4618. // input : hello\world
  4619. // output: hello\world
  4620. // input : hello\\world
  4621. // output: hello\\world
  4622. // input : hello\"world
  4623. // output: "hello\\\"world"
  4624. // input : hello\\"world
  4625. // output: "hello\\\\\"world"
  4626. // input : hello world\
  4627. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  4628. // but it appears the comment is wrong, it should be "hello world\\"
  4629. let reverse = '"';
  4630. let quoteHit = true;
  4631. for (let i = arg.length; i > 0; i--) {
  4632. // walk the string in reverse
  4633. reverse += arg[i - 1];
  4634. if (quoteHit && arg[i - 1] === '\\') {
  4635. reverse += '\\';
  4636. }
  4637. else if (arg[i - 1] === '"') {
  4638. quoteHit = true;
  4639. reverse += '\\';
  4640. }
  4641. else {
  4642. quoteHit = false;
  4643. }
  4644. }
  4645. reverse += '"';
  4646. return reverse
  4647. .split('')
  4648. .reverse()
  4649. .join('');
  4650. }
  4651. _cloneExecOptions(options) {
  4652. options = options || {};
  4653. const result = {
  4654. cwd: options.cwd || process.cwd(),
  4655. env: options.env || process.env,
  4656. silent: options.silent || false,
  4657. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  4658. failOnStdErr: options.failOnStdErr || false,
  4659. ignoreReturnCode: options.ignoreReturnCode || false,
  4660. delay: options.delay || 10000
  4661. };
  4662. result.outStream = options.outStream || process.stdout;
  4663. result.errStream = options.errStream || process.stderr;
  4664. return result;
  4665. }
  4666. _getSpawnOptions(options, toolPath) {
  4667. options = options || {};
  4668. const result = {};
  4669. result.cwd = options.cwd;
  4670. result.env = options.env;
  4671. result['windowsVerbatimArguments'] =
  4672. options.windowsVerbatimArguments || this._isCmdFile();
  4673. if (options.windowsVerbatimArguments) {
  4674. result.argv0 = `"${toolPath}"`;
  4675. }
  4676. return result;
  4677. }
  4678. /**
  4679. * Exec a tool.
  4680. * Output will be streamed to the live console.
  4681. * Returns promise with return code
  4682. *
  4683. * @param tool path to tool to exec
  4684. * @param options optional exec options. See ExecOptions
  4685. * @returns number
  4686. */
  4687. exec() {
  4688. return __awaiter(this, void 0, void 0, function* () {
  4689. // root the tool path if it is unrooted and contains relative pathing
  4690. if (!ioUtil.isRooted(this.toolPath) &&
  4691. (this.toolPath.includes('/') ||
  4692. (IS_WINDOWS && this.toolPath.includes('\\')))) {
  4693. // prefer options.cwd if it is specified, however options.cwd may also need to be rooted
  4694. this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
  4695. }
  4696. // if the tool is only a file name, then resolve it from the PATH
  4697. // otherwise verify it exists (add extension on Windows if necessary)
  4698. this.toolPath = yield io.which(this.toolPath, true);
  4699. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  4700. this._debug(`exec tool: ${this.toolPath}`);
  4701. this._debug('arguments:');
  4702. for (const arg of this.args) {
  4703. this._debug(` ${arg}`);
  4704. }
  4705. const optionsNonNull = this._cloneExecOptions(this.options);
  4706. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4707. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  4708. }
  4709. const state = new ExecState(optionsNonNull, this.toolPath);
  4710. state.on('debug', (message) => {
  4711. this._debug(message);
  4712. });
  4713. if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {
  4714. return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
  4715. }
  4716. const fileName = this._getSpawnFileName();
  4717. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  4718. let stdbuffer = '';
  4719. if (cp.stdout) {
  4720. cp.stdout.on('data', (data) => {
  4721. if (this.options.listeners && this.options.listeners.stdout) {
  4722. this.options.listeners.stdout(data);
  4723. }
  4724. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4725. optionsNonNull.outStream.write(data);
  4726. }
  4727. stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {
  4728. if (this.options.listeners && this.options.listeners.stdline) {
  4729. this.options.listeners.stdline(line);
  4730. }
  4731. });
  4732. });
  4733. }
  4734. let errbuffer = '';
  4735. if (cp.stderr) {
  4736. cp.stderr.on('data', (data) => {
  4737. state.processStderr = true;
  4738. if (this.options.listeners && this.options.listeners.stderr) {
  4739. this.options.listeners.stderr(data);
  4740. }
  4741. if (!optionsNonNull.silent &&
  4742. optionsNonNull.errStream &&
  4743. optionsNonNull.outStream) {
  4744. const s = optionsNonNull.failOnStdErr
  4745. ? optionsNonNull.errStream
  4746. : optionsNonNull.outStream;
  4747. s.write(data);
  4748. }
  4749. errbuffer = this._processLineBuffer(data, errbuffer, (line) => {
  4750. if (this.options.listeners && this.options.listeners.errline) {
  4751. this.options.listeners.errline(line);
  4752. }
  4753. });
  4754. });
  4755. }
  4756. cp.on('error', (err) => {
  4757. state.processError = err.message;
  4758. state.processExited = true;
  4759. state.processClosed = true;
  4760. state.CheckComplete();
  4761. });
  4762. cp.on('exit', (code) => {
  4763. state.processExitCode = code;
  4764. state.processExited = true;
  4765. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  4766. state.CheckComplete();
  4767. });
  4768. cp.on('close', (code) => {
  4769. state.processExitCode = code;
  4770. state.processExited = true;
  4771. state.processClosed = true;
  4772. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  4773. state.CheckComplete();
  4774. });
  4775. state.on('done', (error, exitCode) => {
  4776. if (stdbuffer.length > 0) {
  4777. this.emit('stdline', stdbuffer);
  4778. }
  4779. if (errbuffer.length > 0) {
  4780. this.emit('errline', errbuffer);
  4781. }
  4782. cp.removeAllListeners();
  4783. if (error) {
  4784. reject(error);
  4785. }
  4786. else {
  4787. resolve(exitCode);
  4788. }
  4789. });
  4790. if (this.options.input) {
  4791. if (!cp.stdin) {
  4792. throw new Error('child process missing stdin');
  4793. }
  4794. cp.stdin.end(this.options.input);
  4795. }
  4796. }));
  4797. });
  4798. }
  4799. }
  4800. exports.ToolRunner = ToolRunner;
  4801. /**
  4802. * Convert an arg string to an array of args. Handles escaping
  4803. *
  4804. * @param argString string of arguments
  4805. * @returns string[] array of arguments
  4806. */
  4807. function argStringToArray(argString) {
  4808. const args = [];
  4809. let inQuotes = false;
  4810. let escaped = false;
  4811. let arg = '';
  4812. function append(c) {
  4813. // we only escape double quotes.
  4814. if (escaped && c !== '"') {
  4815. arg += '\\';
  4816. }
  4817. arg += c;
  4818. escaped = false;
  4819. }
  4820. for (let i = 0; i < argString.length; i++) {
  4821. const c = argString.charAt(i);
  4822. if (c === '"') {
  4823. if (!escaped) {
  4824. inQuotes = !inQuotes;
  4825. }
  4826. else {
  4827. append(c);
  4828. }
  4829. continue;
  4830. }
  4831. if (c === '\\' && escaped) {
  4832. append(c);
  4833. continue;
  4834. }
  4835. if (c === '\\' && inQuotes) {
  4836. escaped = true;
  4837. continue;
  4838. }
  4839. if (c === ' ' && !inQuotes) {
  4840. if (arg.length > 0) {
  4841. args.push(arg);
  4842. arg = '';
  4843. }
  4844. continue;
  4845. }
  4846. append(c);
  4847. }
  4848. if (arg.length > 0) {
  4849. args.push(arg.trim());
  4850. }
  4851. return args;
  4852. }
  4853. exports.argStringToArray = argStringToArray;
  4854. class ExecState extends events.EventEmitter {
  4855. constructor(options, toolPath) {
  4856. super();
  4857. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  4858. this.processError = '';
  4859. this.processExitCode = 0;
  4860. this.processExited = false; // tracks whether the process has exited
  4861. this.processStderr = false; // tracks whether stderr was written to
  4862. this.delay = 10000; // 10 seconds
  4863. this.done = false;
  4864. this.timeout = null;
  4865. if (!toolPath) {
  4866. throw new Error('toolPath must not be empty');
  4867. }
  4868. this.options = options;
  4869. this.toolPath = toolPath;
  4870. if (options.delay) {
  4871. this.delay = options.delay;
  4872. }
  4873. }
  4874. CheckComplete() {
  4875. if (this.done) {
  4876. return;
  4877. }
  4878. if (this.processClosed) {
  4879. this._setResult();
  4880. }
  4881. else if (this.processExited) {
  4882. this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);
  4883. }
  4884. }
  4885. _debug(message) {
  4886. this.emit('debug', message);
  4887. }
  4888. _setResult() {
  4889. // determine whether there is an error
  4890. let error;
  4891. if (this.processExited) {
  4892. if (this.processError) {
  4893. error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
  4894. }
  4895. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  4896. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  4897. }
  4898. else if (this.processStderr && this.options.failOnStdErr) {
  4899. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  4900. }
  4901. }
  4902. // clear the timeout
  4903. if (this.timeout) {
  4904. clearTimeout(this.timeout);
  4905. this.timeout = null;
  4906. }
  4907. this.done = true;
  4908. this.emit('done', error, this.processExitCode);
  4909. }
  4910. static HandleTimeout(state) {
  4911. if (state.done) {
  4912. return;
  4913. }
  4914. if (!state.processClosed && state.processExited) {
  4915. const message = `The STDIO streams did not close within ${state.delay /
  4916. 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
  4917. state._debug(message);
  4918. }
  4919. state._setResult();
  4920. }
  4921. }
  4922. //# sourceMappingURL=toolrunner.js.map
  4923. /***/ }),
  4924. /***/ 4087:
  4925. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4926. "use strict";
  4927. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4928. exports.Context = void 0;
  4929. const fs_1 = __nccwpck_require__(7147);
  4930. const os_1 = __nccwpck_require__(2037);
  4931. class Context {
  4932. /**
  4933. * Hydrate the context from the environment
  4934. */
  4935. constructor() {
  4936. var _a, _b, _c;
  4937. this.payload = {};
  4938. if (process.env.GITHUB_EVENT_PATH) {
  4939. if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {
  4940. this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  4941. }
  4942. else {
  4943. const path = process.env.GITHUB_EVENT_PATH;
  4944. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  4945. }
  4946. }
  4947. this.eventName = process.env.GITHUB_EVENT_NAME;
  4948. this.sha = process.env.GITHUB_SHA;
  4949. this.ref = process.env.GITHUB_REF;
  4950. this.workflow = process.env.GITHUB_WORKFLOW;
  4951. this.action = process.env.GITHUB_ACTION;
  4952. this.actor = process.env.GITHUB_ACTOR;
  4953. this.job = process.env.GITHUB_JOB;
  4954. this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
  4955. this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
  4956. this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
  4957. this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
  4958. this.graphqlUrl =
  4959. (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
  4960. }
  4961. get issue() {
  4962. const payload = this.payload;
  4963. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  4964. }
  4965. get repo() {
  4966. if (process.env.GITHUB_REPOSITORY) {
  4967. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  4968. return { owner, repo };
  4969. }
  4970. if (this.payload.repository) {
  4971. return {
  4972. owner: this.payload.repository.owner.login,
  4973. repo: this.payload.repository.name
  4974. };
  4975. }
  4976. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  4977. }
  4978. }
  4979. exports.Context = Context;
  4980. //# sourceMappingURL=context.js.map
  4981. /***/ }),
  4982. /***/ 5438:
  4983. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4984. "use strict";
  4985. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4986. if (k2 === undefined) k2 = k;
  4987. var desc = Object.getOwnPropertyDescriptor(m, k);
  4988. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4989. desc = { enumerable: true, get: function() { return m[k]; } };
  4990. }
  4991. Object.defineProperty(o, k2, desc);
  4992. }) : (function(o, m, k, k2) {
  4993. if (k2 === undefined) k2 = k;
  4994. o[k2] = m[k];
  4995. }));
  4996. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4997. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4998. }) : function(o, v) {
  4999. o["default"] = v;
  5000. });
  5001. var __importStar = (this && this.__importStar) || function (mod) {
  5002. if (mod && mod.__esModule) return mod;
  5003. var result = {};
  5004. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5005. __setModuleDefault(result, mod);
  5006. return result;
  5007. };
  5008. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5009. exports.getOctokit = exports.context = void 0;
  5010. const Context = __importStar(__nccwpck_require__(4087));
  5011. const utils_1 = __nccwpck_require__(3030);
  5012. exports.context = new Context.Context();
  5013. /**
  5014. * Returns a hydrated octokit ready to use for GitHub Actions
  5015. *
  5016. * @param token the repo PAT or GITHUB_TOKEN
  5017. * @param options other options to set
  5018. */
  5019. function getOctokit(token, options, ...additionalPlugins) {
  5020. const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
  5021. return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
  5022. }
  5023. exports.getOctokit = getOctokit;
  5024. //# sourceMappingURL=github.js.map
  5025. /***/ }),
  5026. /***/ 7914:
  5027. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5028. "use strict";
  5029. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5030. if (k2 === undefined) k2 = k;
  5031. var desc = Object.getOwnPropertyDescriptor(m, k);
  5032. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5033. desc = { enumerable: true, get: function() { return m[k]; } };
  5034. }
  5035. Object.defineProperty(o, k2, desc);
  5036. }) : (function(o, m, k, k2) {
  5037. if (k2 === undefined) k2 = k;
  5038. o[k2] = m[k];
  5039. }));
  5040. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5041. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5042. }) : function(o, v) {
  5043. o["default"] = v;
  5044. });
  5045. var __importStar = (this && this.__importStar) || function (mod) {
  5046. if (mod && mod.__esModule) return mod;
  5047. var result = {};
  5048. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5049. __setModuleDefault(result, mod);
  5050. return result;
  5051. };
  5052. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5053. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5054. return new (P || (P = Promise))(function (resolve, reject) {
  5055. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5056. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5057. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5058. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5059. });
  5060. };
  5061. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5062. exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0;
  5063. const httpClient = __importStar(__nccwpck_require__(6255));
  5064. const undici_1 = __nccwpck_require__(1773);
  5065. function getAuthString(token, options) {
  5066. if (!token && !options.auth) {
  5067. throw new Error('Parameter token or opts.auth is required');
  5068. }
  5069. else if (token && options.auth) {
  5070. throw new Error('Parameters token and opts.auth may not both be specified');
  5071. }
  5072. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  5073. }
  5074. exports.getAuthString = getAuthString;
  5075. function getProxyAgent(destinationUrl) {
  5076. const hc = new httpClient.HttpClient();
  5077. return hc.getAgent(destinationUrl);
  5078. }
  5079. exports.getProxyAgent = getProxyAgent;
  5080. function getProxyAgentDispatcher(destinationUrl) {
  5081. const hc = new httpClient.HttpClient();
  5082. return hc.getAgentDispatcher(destinationUrl);
  5083. }
  5084. exports.getProxyAgentDispatcher = getProxyAgentDispatcher;
  5085. function getProxyFetch(destinationUrl) {
  5086. const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
  5087. const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () {
  5088. return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
  5089. });
  5090. return proxyFetch;
  5091. }
  5092. exports.getProxyFetch = getProxyFetch;
  5093. function getApiBaseUrl() {
  5094. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  5095. }
  5096. exports.getApiBaseUrl = getApiBaseUrl;
  5097. //# sourceMappingURL=utils.js.map
  5098. /***/ }),
  5099. /***/ 3030:
  5100. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5101. "use strict";
  5102. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5103. if (k2 === undefined) k2 = k;
  5104. var desc = Object.getOwnPropertyDescriptor(m, k);
  5105. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5106. desc = { enumerable: true, get: function() { return m[k]; } };
  5107. }
  5108. Object.defineProperty(o, k2, desc);
  5109. }) : (function(o, m, k, k2) {
  5110. if (k2 === undefined) k2 = k;
  5111. o[k2] = m[k];
  5112. }));
  5113. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5114. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5115. }) : function(o, v) {
  5116. o["default"] = v;
  5117. });
  5118. var __importStar = (this && this.__importStar) || function (mod) {
  5119. if (mod && mod.__esModule) return mod;
  5120. var result = {};
  5121. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5122. __setModuleDefault(result, mod);
  5123. return result;
  5124. };
  5125. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5126. exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
  5127. const Context = __importStar(__nccwpck_require__(4087));
  5128. const Utils = __importStar(__nccwpck_require__(7914));
  5129. // octokit + plugins
  5130. const core_1 = __nccwpck_require__(6762);
  5131. const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
  5132. const plugin_paginate_rest_1 = __nccwpck_require__(4193);
  5133. exports.context = new Context.Context();
  5134. const baseUrl = Utils.getApiBaseUrl();
  5135. exports.defaults = {
  5136. baseUrl,
  5137. request: {
  5138. agent: Utils.getProxyAgent(baseUrl),
  5139. fetch: Utils.getProxyFetch(baseUrl)
  5140. }
  5141. };
  5142. exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
  5143. /**
  5144. * Convience function to correctly format Octokit Options to pass into the constructor.
  5145. *
  5146. * @param token the repo PAT or GITHUB_TOKEN
  5147. * @param options other options to set
  5148. */
  5149. function getOctokitOptions(token, options) {
  5150. const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
  5151. // Auth
  5152. const auth = Utils.getAuthString(token, opts);
  5153. if (auth) {
  5154. opts.auth = auth;
  5155. }
  5156. return opts;
  5157. }
  5158. exports.getOctokitOptions = getOctokitOptions;
  5159. //# sourceMappingURL=utils.js.map
  5160. /***/ }),
  5161. /***/ 5526:
  5162. /***/ (function(__unused_webpack_module, exports) {
  5163. "use strict";
  5164. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5165. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5166. return new (P || (P = Promise))(function (resolve, reject) {
  5167. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5168. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5169. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5170. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5171. });
  5172. };
  5173. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5174. exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
  5175. class BasicCredentialHandler {
  5176. constructor(username, password) {
  5177. this.username = username;
  5178. this.password = password;
  5179. }
  5180. prepareRequest(options) {
  5181. if (!options.headers) {
  5182. throw Error('The request has no headers');
  5183. }
  5184. options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
  5185. }
  5186. // This handler cannot handle 401
  5187. canHandleAuthentication() {
  5188. return false;
  5189. }
  5190. handleAuthentication() {
  5191. return __awaiter(this, void 0, void 0, function* () {
  5192. throw new Error('not implemented');
  5193. });
  5194. }
  5195. }
  5196. exports.BasicCredentialHandler = BasicCredentialHandler;
  5197. class BearerCredentialHandler {
  5198. constructor(token) {
  5199. this.token = token;
  5200. }
  5201. // currently implements pre-authorization
  5202. // TODO: support preAuth = false where it hooks on 401
  5203. prepareRequest(options) {
  5204. if (!options.headers) {
  5205. throw Error('The request has no headers');
  5206. }
  5207. options.headers['Authorization'] = `Bearer ${this.token}`;
  5208. }
  5209. // This handler cannot handle 401
  5210. canHandleAuthentication() {
  5211. return false;
  5212. }
  5213. handleAuthentication() {
  5214. return __awaiter(this, void 0, void 0, function* () {
  5215. throw new Error('not implemented');
  5216. });
  5217. }
  5218. }
  5219. exports.BearerCredentialHandler = BearerCredentialHandler;
  5220. class PersonalAccessTokenCredentialHandler {
  5221. constructor(token) {
  5222. this.token = token;
  5223. }
  5224. // currently implements pre-authorization
  5225. // TODO: support preAuth = false where it hooks on 401
  5226. prepareRequest(options) {
  5227. if (!options.headers) {
  5228. throw Error('The request has no headers');
  5229. }
  5230. options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
  5231. }
  5232. // This handler cannot handle 401
  5233. canHandleAuthentication() {
  5234. return false;
  5235. }
  5236. handleAuthentication() {
  5237. return __awaiter(this, void 0, void 0, function* () {
  5238. throw new Error('not implemented');
  5239. });
  5240. }
  5241. }
  5242. exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
  5243. //# sourceMappingURL=auth.js.map
  5244. /***/ }),
  5245. /***/ 6255:
  5246. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5247. "use strict";
  5248. /* eslint-disable @typescript-eslint/no-explicit-any */
  5249. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5250. if (k2 === undefined) k2 = k;
  5251. var desc = Object.getOwnPropertyDescriptor(m, k);
  5252. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5253. desc = { enumerable: true, get: function() { return m[k]; } };
  5254. }
  5255. Object.defineProperty(o, k2, desc);
  5256. }) : (function(o, m, k, k2) {
  5257. if (k2 === undefined) k2 = k;
  5258. o[k2] = m[k];
  5259. }));
  5260. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5261. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5262. }) : function(o, v) {
  5263. o["default"] = v;
  5264. });
  5265. var __importStar = (this && this.__importStar) || function (mod) {
  5266. if (mod && mod.__esModule) return mod;
  5267. var result = {};
  5268. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5269. __setModuleDefault(result, mod);
  5270. return result;
  5271. };
  5272. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5273. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5274. return new (P || (P = Promise))(function (resolve, reject) {
  5275. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5276. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5277. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5278. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5279. });
  5280. };
  5281. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5282. exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
  5283. const http = __importStar(__nccwpck_require__(3685));
  5284. const https = __importStar(__nccwpck_require__(5687));
  5285. const pm = __importStar(__nccwpck_require__(9835));
  5286. const tunnel = __importStar(__nccwpck_require__(4294));
  5287. const undici_1 = __nccwpck_require__(1773);
  5288. var HttpCodes;
  5289. (function (HttpCodes) {
  5290. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  5291. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  5292. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  5293. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  5294. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  5295. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  5296. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  5297. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  5298. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  5299. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  5300. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  5301. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  5302. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  5303. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  5304. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  5305. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  5306. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  5307. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  5308. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  5309. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  5310. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  5311. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  5312. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  5313. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  5314. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  5315. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  5316. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  5317. })(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
  5318. var Headers;
  5319. (function (Headers) {
  5320. Headers["Accept"] = "accept";
  5321. Headers["ContentType"] = "content-type";
  5322. })(Headers || (exports.Headers = Headers = {}));
  5323. var MediaTypes;
  5324. (function (MediaTypes) {
  5325. MediaTypes["ApplicationJson"] = "application/json";
  5326. })(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
  5327. /**
  5328. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  5329. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5330. */
  5331. function getProxyUrl(serverUrl) {
  5332. const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
  5333. return proxyUrl ? proxyUrl.href : '';
  5334. }
  5335. exports.getProxyUrl = getProxyUrl;
  5336. const HttpRedirectCodes = [
  5337. HttpCodes.MovedPermanently,
  5338. HttpCodes.ResourceMoved,
  5339. HttpCodes.SeeOther,
  5340. HttpCodes.TemporaryRedirect,
  5341. HttpCodes.PermanentRedirect
  5342. ];
  5343. const HttpResponseRetryCodes = [
  5344. HttpCodes.BadGateway,
  5345. HttpCodes.ServiceUnavailable,
  5346. HttpCodes.GatewayTimeout
  5347. ];
  5348. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  5349. const ExponentialBackoffCeiling = 10;
  5350. const ExponentialBackoffTimeSlice = 5;
  5351. class HttpClientError extends Error {
  5352. constructor(message, statusCode) {
  5353. super(message);
  5354. this.name = 'HttpClientError';
  5355. this.statusCode = statusCode;
  5356. Object.setPrototypeOf(this, HttpClientError.prototype);
  5357. }
  5358. }
  5359. exports.HttpClientError = HttpClientError;
  5360. class HttpClientResponse {
  5361. constructor(message) {
  5362. this.message = message;
  5363. }
  5364. readBody() {
  5365. return __awaiter(this, void 0, void 0, function* () {
  5366. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5367. let output = Buffer.alloc(0);
  5368. this.message.on('data', (chunk) => {
  5369. output = Buffer.concat([output, chunk]);
  5370. });
  5371. this.message.on('end', () => {
  5372. resolve(output.toString());
  5373. });
  5374. }));
  5375. });
  5376. }
  5377. readBodyBuffer() {
  5378. return __awaiter(this, void 0, void 0, function* () {
  5379. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5380. const chunks = [];
  5381. this.message.on('data', (chunk) => {
  5382. chunks.push(chunk);
  5383. });
  5384. this.message.on('end', () => {
  5385. resolve(Buffer.concat(chunks));
  5386. });
  5387. }));
  5388. });
  5389. }
  5390. }
  5391. exports.HttpClientResponse = HttpClientResponse;
  5392. function isHttps(requestUrl) {
  5393. const parsedUrl = new URL(requestUrl);
  5394. return parsedUrl.protocol === 'https:';
  5395. }
  5396. exports.isHttps = isHttps;
  5397. class HttpClient {
  5398. constructor(userAgent, handlers, requestOptions) {
  5399. this._ignoreSslError = false;
  5400. this._allowRedirects = true;
  5401. this._allowRedirectDowngrade = false;
  5402. this._maxRedirects = 50;
  5403. this._allowRetries = false;
  5404. this._maxRetries = 1;
  5405. this._keepAlive = false;
  5406. this._disposed = false;
  5407. this.userAgent = userAgent;
  5408. this.handlers = handlers || [];
  5409. this.requestOptions = requestOptions;
  5410. if (requestOptions) {
  5411. if (requestOptions.ignoreSslError != null) {
  5412. this._ignoreSslError = requestOptions.ignoreSslError;
  5413. }
  5414. this._socketTimeout = requestOptions.socketTimeout;
  5415. if (requestOptions.allowRedirects != null) {
  5416. this._allowRedirects = requestOptions.allowRedirects;
  5417. }
  5418. if (requestOptions.allowRedirectDowngrade != null) {
  5419. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  5420. }
  5421. if (requestOptions.maxRedirects != null) {
  5422. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  5423. }
  5424. if (requestOptions.keepAlive != null) {
  5425. this._keepAlive = requestOptions.keepAlive;
  5426. }
  5427. if (requestOptions.allowRetries != null) {
  5428. this._allowRetries = requestOptions.allowRetries;
  5429. }
  5430. if (requestOptions.maxRetries != null) {
  5431. this._maxRetries = requestOptions.maxRetries;
  5432. }
  5433. }
  5434. }
  5435. options(requestUrl, additionalHeaders) {
  5436. return __awaiter(this, void 0, void 0, function* () {
  5437. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  5438. });
  5439. }
  5440. get(requestUrl, additionalHeaders) {
  5441. return __awaiter(this, void 0, void 0, function* () {
  5442. return this.request('GET', requestUrl, null, additionalHeaders || {});
  5443. });
  5444. }
  5445. del(requestUrl, additionalHeaders) {
  5446. return __awaiter(this, void 0, void 0, function* () {
  5447. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  5448. });
  5449. }
  5450. post(requestUrl, data, additionalHeaders) {
  5451. return __awaiter(this, void 0, void 0, function* () {
  5452. return this.request('POST', requestUrl, data, additionalHeaders || {});
  5453. });
  5454. }
  5455. patch(requestUrl, data, additionalHeaders) {
  5456. return __awaiter(this, void 0, void 0, function* () {
  5457. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  5458. });
  5459. }
  5460. put(requestUrl, data, additionalHeaders) {
  5461. return __awaiter(this, void 0, void 0, function* () {
  5462. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  5463. });
  5464. }
  5465. head(requestUrl, additionalHeaders) {
  5466. return __awaiter(this, void 0, void 0, function* () {
  5467. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  5468. });
  5469. }
  5470. sendStream(verb, requestUrl, stream, additionalHeaders) {
  5471. return __awaiter(this, void 0, void 0, function* () {
  5472. return this.request(verb, requestUrl, stream, additionalHeaders);
  5473. });
  5474. }
  5475. /**
  5476. * Gets a typed object from an endpoint
  5477. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  5478. */
  5479. getJson(requestUrl, additionalHeaders = {}) {
  5480. return __awaiter(this, void 0, void 0, function* () {
  5481. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5482. const res = yield this.get(requestUrl, additionalHeaders);
  5483. return this._processResponse(res, this.requestOptions);
  5484. });
  5485. }
  5486. postJson(requestUrl, obj, additionalHeaders = {}) {
  5487. return __awaiter(this, void 0, void 0, function* () {
  5488. const data = JSON.stringify(obj, null, 2);
  5489. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5490. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5491. const res = yield this.post(requestUrl, data, additionalHeaders);
  5492. return this._processResponse(res, this.requestOptions);
  5493. });
  5494. }
  5495. putJson(requestUrl, obj, additionalHeaders = {}) {
  5496. return __awaiter(this, void 0, void 0, function* () {
  5497. const data = JSON.stringify(obj, null, 2);
  5498. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5499. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5500. const res = yield this.put(requestUrl, data, additionalHeaders);
  5501. return this._processResponse(res, this.requestOptions);
  5502. });
  5503. }
  5504. patchJson(requestUrl, obj, additionalHeaders = {}) {
  5505. return __awaiter(this, void 0, void 0, function* () {
  5506. const data = JSON.stringify(obj, null, 2);
  5507. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5508. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5509. const res = yield this.patch(requestUrl, data, additionalHeaders);
  5510. return this._processResponse(res, this.requestOptions);
  5511. });
  5512. }
  5513. /**
  5514. * Makes a raw http request.
  5515. * All other methods such as get, post, patch, and request ultimately call this.
  5516. * Prefer get, del, post and patch
  5517. */
  5518. request(verb, requestUrl, data, headers) {
  5519. return __awaiter(this, void 0, void 0, function* () {
  5520. if (this._disposed) {
  5521. throw new Error('Client has already been disposed.');
  5522. }
  5523. const parsedUrl = new URL(requestUrl);
  5524. let info = this._prepareRequest(verb, parsedUrl, headers);
  5525. // Only perform retries on reads since writes may not be idempotent.
  5526. const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
  5527. ? this._maxRetries + 1
  5528. : 1;
  5529. let numTries = 0;
  5530. let response;
  5531. do {
  5532. response = yield this.requestRaw(info, data);
  5533. // Check if it's an authentication challenge
  5534. if (response &&
  5535. response.message &&
  5536. response.message.statusCode === HttpCodes.Unauthorized) {
  5537. let authenticationHandler;
  5538. for (const handler of this.handlers) {
  5539. if (handler.canHandleAuthentication(response)) {
  5540. authenticationHandler = handler;
  5541. break;
  5542. }
  5543. }
  5544. if (authenticationHandler) {
  5545. return authenticationHandler.handleAuthentication(this, info, data);
  5546. }
  5547. else {
  5548. // We have received an unauthorized response but have no handlers to handle it.
  5549. // Let the response return to the caller.
  5550. return response;
  5551. }
  5552. }
  5553. let redirectsRemaining = this._maxRedirects;
  5554. while (response.message.statusCode &&
  5555. HttpRedirectCodes.includes(response.message.statusCode) &&
  5556. this._allowRedirects &&
  5557. redirectsRemaining > 0) {
  5558. const redirectUrl = response.message.headers['location'];
  5559. if (!redirectUrl) {
  5560. // if there's no location to redirect to, we won't
  5561. break;
  5562. }
  5563. const parsedRedirectUrl = new URL(redirectUrl);
  5564. if (parsedUrl.protocol === 'https:' &&
  5565. parsedUrl.protocol !== parsedRedirectUrl.protocol &&
  5566. !this._allowRedirectDowngrade) {
  5567. throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');
  5568. }
  5569. // we need to finish reading the response before reassigning response
  5570. // which will leak the open socket.
  5571. yield response.readBody();
  5572. // strip authorization header if redirected to a different hostname
  5573. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  5574. for (const header in headers) {
  5575. // header names are case insensitive
  5576. if (header.toLowerCase() === 'authorization') {
  5577. delete headers[header];
  5578. }
  5579. }
  5580. }
  5581. // let's make the request with the new redirectUrl
  5582. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  5583. response = yield this.requestRaw(info, data);
  5584. redirectsRemaining--;
  5585. }
  5586. if (!response.message.statusCode ||
  5587. !HttpResponseRetryCodes.includes(response.message.statusCode)) {
  5588. // If not a retry code, return immediately instead of retrying
  5589. return response;
  5590. }
  5591. numTries += 1;
  5592. if (numTries < maxTries) {
  5593. yield response.readBody();
  5594. yield this._performExponentialBackoff(numTries);
  5595. }
  5596. } while (numTries < maxTries);
  5597. return response;
  5598. });
  5599. }
  5600. /**
  5601. * Needs to be called if keepAlive is set to true in request options.
  5602. */
  5603. dispose() {
  5604. if (this._agent) {
  5605. this._agent.destroy();
  5606. }
  5607. this._disposed = true;
  5608. }
  5609. /**
  5610. * Raw request.
  5611. * @param info
  5612. * @param data
  5613. */
  5614. requestRaw(info, data) {
  5615. return __awaiter(this, void 0, void 0, function* () {
  5616. return new Promise((resolve, reject) => {
  5617. function callbackForResult(err, res) {
  5618. if (err) {
  5619. reject(err);
  5620. }
  5621. else if (!res) {
  5622. // If `err` is not passed, then `res` must be passed.
  5623. reject(new Error('Unknown error'));
  5624. }
  5625. else {
  5626. resolve(res);
  5627. }
  5628. }
  5629. this.requestRawWithCallback(info, data, callbackForResult);
  5630. });
  5631. });
  5632. }
  5633. /**
  5634. * Raw request with callback.
  5635. * @param info
  5636. * @param data
  5637. * @param onResult
  5638. */
  5639. requestRawWithCallback(info, data, onResult) {
  5640. if (typeof data === 'string') {
  5641. if (!info.options.headers) {
  5642. info.options.headers = {};
  5643. }
  5644. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  5645. }
  5646. let callbackCalled = false;
  5647. function handleResult(err, res) {
  5648. if (!callbackCalled) {
  5649. callbackCalled = true;
  5650. onResult(err, res);
  5651. }
  5652. }
  5653. const req = info.httpModule.request(info.options, (msg) => {
  5654. const res = new HttpClientResponse(msg);
  5655. handleResult(undefined, res);
  5656. });
  5657. let socket;
  5658. req.on('socket', sock => {
  5659. socket = sock;
  5660. });
  5661. // If we ever get disconnected, we want the socket to timeout eventually
  5662. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  5663. if (socket) {
  5664. socket.end();
  5665. }
  5666. handleResult(new Error(`Request timeout: ${info.options.path}`));
  5667. });
  5668. req.on('error', function (err) {
  5669. // err has statusCode property
  5670. // res should have headers
  5671. handleResult(err);
  5672. });
  5673. if (data && typeof data === 'string') {
  5674. req.write(data, 'utf8');
  5675. }
  5676. if (data && typeof data !== 'string') {
  5677. data.on('close', function () {
  5678. req.end();
  5679. });
  5680. data.pipe(req);
  5681. }
  5682. else {
  5683. req.end();
  5684. }
  5685. }
  5686. /**
  5687. * Gets an http agent. This function is useful when you need an http agent that handles
  5688. * routing through a proxy server - depending upon the url and proxy environment variables.
  5689. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5690. */
  5691. getAgent(serverUrl) {
  5692. const parsedUrl = new URL(serverUrl);
  5693. return this._getAgent(parsedUrl);
  5694. }
  5695. getAgentDispatcher(serverUrl) {
  5696. const parsedUrl = new URL(serverUrl);
  5697. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5698. const useProxy = proxyUrl && proxyUrl.hostname;
  5699. if (!useProxy) {
  5700. return;
  5701. }
  5702. return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
  5703. }
  5704. _prepareRequest(method, requestUrl, headers) {
  5705. const info = {};
  5706. info.parsedUrl = requestUrl;
  5707. const usingSsl = info.parsedUrl.protocol === 'https:';
  5708. info.httpModule = usingSsl ? https : http;
  5709. const defaultPort = usingSsl ? 443 : 80;
  5710. info.options = {};
  5711. info.options.host = info.parsedUrl.hostname;
  5712. info.options.port = info.parsedUrl.port
  5713. ? parseInt(info.parsedUrl.port)
  5714. : defaultPort;
  5715. info.options.path =
  5716. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  5717. info.options.method = method;
  5718. info.options.headers = this._mergeHeaders(headers);
  5719. if (this.userAgent != null) {
  5720. info.options.headers['user-agent'] = this.userAgent;
  5721. }
  5722. info.options.agent = this._getAgent(info.parsedUrl);
  5723. // gives handlers an opportunity to participate
  5724. if (this.handlers) {
  5725. for (const handler of this.handlers) {
  5726. handler.prepareRequest(info.options);
  5727. }
  5728. }
  5729. return info;
  5730. }
  5731. _mergeHeaders(headers) {
  5732. if (this.requestOptions && this.requestOptions.headers) {
  5733. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
  5734. }
  5735. return lowercaseKeys(headers || {});
  5736. }
  5737. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  5738. let clientHeader;
  5739. if (this.requestOptions && this.requestOptions.headers) {
  5740. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  5741. }
  5742. return additionalHeaders[header] || clientHeader || _default;
  5743. }
  5744. _getAgent(parsedUrl) {
  5745. let agent;
  5746. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5747. const useProxy = proxyUrl && proxyUrl.hostname;
  5748. if (this._keepAlive && useProxy) {
  5749. agent = this._proxyAgent;
  5750. }
  5751. if (!useProxy) {
  5752. agent = this._agent;
  5753. }
  5754. // if agent is already assigned use that agent.
  5755. if (agent) {
  5756. return agent;
  5757. }
  5758. const usingSsl = parsedUrl.protocol === 'https:';
  5759. let maxSockets = 100;
  5760. if (this.requestOptions) {
  5761. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  5762. }
  5763. // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
  5764. if (proxyUrl && proxyUrl.hostname) {
  5765. const agentOptions = {
  5766. maxSockets,
  5767. keepAlive: this._keepAlive,
  5768. proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
  5769. proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
  5770. })), { host: proxyUrl.hostname, port: proxyUrl.port })
  5771. };
  5772. let tunnelAgent;
  5773. const overHttps = proxyUrl.protocol === 'https:';
  5774. if (usingSsl) {
  5775. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  5776. }
  5777. else {
  5778. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  5779. }
  5780. agent = tunnelAgent(agentOptions);
  5781. this._proxyAgent = agent;
  5782. }
  5783. // if tunneling agent isn't assigned create a new agent
  5784. if (!agent) {
  5785. const options = { keepAlive: this._keepAlive, maxSockets };
  5786. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  5787. this._agent = agent;
  5788. }
  5789. if (usingSsl && this._ignoreSslError) {
  5790. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5791. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5792. // we have to cast it to any and change it directly
  5793. agent.options = Object.assign(agent.options || {}, {
  5794. rejectUnauthorized: false
  5795. });
  5796. }
  5797. return agent;
  5798. }
  5799. _getProxyAgentDispatcher(parsedUrl, proxyUrl) {
  5800. let proxyAgent;
  5801. if (this._keepAlive) {
  5802. proxyAgent = this._proxyAgentDispatcher;
  5803. }
  5804. // if agent is already assigned use that agent.
  5805. if (proxyAgent) {
  5806. return proxyAgent;
  5807. }
  5808. const usingSsl = parsedUrl.protocol === 'https:';
  5809. proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
  5810. token: `${proxyUrl.username}:${proxyUrl.password}`
  5811. })));
  5812. this._proxyAgentDispatcher = proxyAgent;
  5813. if (usingSsl && this._ignoreSslError) {
  5814. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5815. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5816. // we have to cast it to any and change it directly
  5817. proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
  5818. rejectUnauthorized: false
  5819. });
  5820. }
  5821. return proxyAgent;
  5822. }
  5823. _performExponentialBackoff(retryNumber) {
  5824. return __awaiter(this, void 0, void 0, function* () {
  5825. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  5826. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  5827. return new Promise(resolve => setTimeout(() => resolve(), ms));
  5828. });
  5829. }
  5830. _processResponse(res, options) {
  5831. return __awaiter(this, void 0, void 0, function* () {
  5832. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  5833. const statusCode = res.message.statusCode || 0;
  5834. const response = {
  5835. statusCode,
  5836. result: null,
  5837. headers: {}
  5838. };
  5839. // not found leads to null obj returned
  5840. if (statusCode === HttpCodes.NotFound) {
  5841. resolve(response);
  5842. }
  5843. // get the result from the body
  5844. function dateTimeDeserializer(key, value) {
  5845. if (typeof value === 'string') {
  5846. const a = new Date(value);
  5847. if (!isNaN(a.valueOf())) {
  5848. return a;
  5849. }
  5850. }
  5851. return value;
  5852. }
  5853. let obj;
  5854. let contents;
  5855. try {
  5856. contents = yield res.readBody();
  5857. if (contents && contents.length > 0) {
  5858. if (options && options.deserializeDates) {
  5859. obj = JSON.parse(contents, dateTimeDeserializer);
  5860. }
  5861. else {
  5862. obj = JSON.parse(contents);
  5863. }
  5864. response.result = obj;
  5865. }
  5866. response.headers = res.message.headers;
  5867. }
  5868. catch (err) {
  5869. // Invalid resource (contents not json); leaving result obj null
  5870. }
  5871. // note that 3xx redirects are handled by the http layer.
  5872. if (statusCode > 299) {
  5873. let msg;
  5874. // if exception/error in body, attempt to get better error
  5875. if (obj && obj.message) {
  5876. msg = obj.message;
  5877. }
  5878. else if (contents && contents.length > 0) {
  5879. // it may be the case that the exception is in the body message as string
  5880. msg = contents;
  5881. }
  5882. else {
  5883. msg = `Failed request: (${statusCode})`;
  5884. }
  5885. const err = new HttpClientError(msg, statusCode);
  5886. err.result = response.result;
  5887. reject(err);
  5888. }
  5889. else {
  5890. resolve(response);
  5891. }
  5892. }));
  5893. });
  5894. }
  5895. }
  5896. exports.HttpClient = HttpClient;
  5897. const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  5898. //# sourceMappingURL=index.js.map
  5899. /***/ }),
  5900. /***/ 9835:
  5901. /***/ ((__unused_webpack_module, exports) => {
  5902. "use strict";
  5903. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5904. exports.checkBypass = exports.getProxyUrl = void 0;
  5905. function getProxyUrl(reqUrl) {
  5906. const usingSsl = reqUrl.protocol === 'https:';
  5907. if (checkBypass(reqUrl)) {
  5908. return undefined;
  5909. }
  5910. const proxyVar = (() => {
  5911. if (usingSsl) {
  5912. return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  5913. }
  5914. else {
  5915. return process.env['http_proxy'] || process.env['HTTP_PROXY'];
  5916. }
  5917. })();
  5918. if (proxyVar) {
  5919. try {
  5920. return new URL(proxyVar);
  5921. }
  5922. catch (_a) {
  5923. if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
  5924. return new URL(`http://${proxyVar}`);
  5925. }
  5926. }
  5927. else {
  5928. return undefined;
  5929. }
  5930. }
  5931. exports.getProxyUrl = getProxyUrl;
  5932. function checkBypass(reqUrl) {
  5933. if (!reqUrl.hostname) {
  5934. return false;
  5935. }
  5936. const reqHost = reqUrl.hostname;
  5937. if (isLoopbackAddress(reqHost)) {
  5938. return true;
  5939. }
  5940. const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  5941. if (!noProxy) {
  5942. return false;
  5943. }
  5944. // Determine the request port
  5945. let reqPort;
  5946. if (reqUrl.port) {
  5947. reqPort = Number(reqUrl.port);
  5948. }
  5949. else if (reqUrl.protocol === 'http:') {
  5950. reqPort = 80;
  5951. }
  5952. else if (reqUrl.protocol === 'https:') {
  5953. reqPort = 443;
  5954. }
  5955. // Format the request hostname and hostname with port
  5956. const upperReqHosts = [reqUrl.hostname.toUpperCase()];
  5957. if (typeof reqPort === 'number') {
  5958. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  5959. }
  5960. // Compare request host against noproxy
  5961. for (const upperNoProxyItem of noProxy
  5962. .split(',')
  5963. .map(x => x.trim().toUpperCase())
  5964. .filter(x => x)) {
  5965. if (upperNoProxyItem === '*' ||
  5966. upperReqHosts.some(x => x === upperNoProxyItem ||
  5967. x.endsWith(`.${upperNoProxyItem}`) ||
  5968. (upperNoProxyItem.startsWith('.') &&
  5969. x.endsWith(`${upperNoProxyItem}`)))) {
  5970. return true;
  5971. }
  5972. }
  5973. return false;
  5974. }
  5975. exports.checkBypass = checkBypass;
  5976. function isLoopbackAddress(host) {
  5977. const hostLower = host.toLowerCase();
  5978. return (hostLower === 'localhost' ||
  5979. hostLower.startsWith('127.') ||
  5980. hostLower.startsWith('[::1]') ||
  5981. hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
  5982. }
  5983. //# sourceMappingURL=proxy.js.map
  5984. /***/ }),
  5985. /***/ 1962:
  5986. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5987. "use strict";
  5988. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5989. if (k2 === undefined) k2 = k;
  5990. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5991. }) : (function(o, m, k, k2) {
  5992. if (k2 === undefined) k2 = k;
  5993. o[k2] = m[k];
  5994. }));
  5995. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5996. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5997. }) : function(o, v) {
  5998. o["default"] = v;
  5999. });
  6000. var __importStar = (this && this.__importStar) || function (mod) {
  6001. if (mod && mod.__esModule) return mod;
  6002. var result = {};
  6003. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6004. __setModuleDefault(result, mod);
  6005. return result;
  6006. };
  6007. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6008. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6009. return new (P || (P = Promise))(function (resolve, reject) {
  6010. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6011. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6012. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6013. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6014. });
  6015. };
  6016. var _a;
  6017. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6018. exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0;
  6019. const fs = __importStar(__nccwpck_require__(7147));
  6020. const path = __importStar(__nccwpck_require__(1017));
  6021. _a = fs.promises
  6022. // export const {open} = 'fs'
  6023. , exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
  6024. // export const {open} = 'fs'
  6025. exports.IS_WINDOWS = process.platform === 'win32';
  6026. // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
  6027. exports.UV_FS_O_EXLOCK = 0x10000000;
  6028. exports.READONLY = fs.constants.O_RDONLY;
  6029. function exists(fsPath) {
  6030. return __awaiter(this, void 0, void 0, function* () {
  6031. try {
  6032. yield exports.stat(fsPath);
  6033. }
  6034. catch (err) {
  6035. if (err.code === 'ENOENT') {
  6036. return false;
  6037. }
  6038. throw err;
  6039. }
  6040. return true;
  6041. });
  6042. }
  6043. exports.exists = exists;
  6044. function isDirectory(fsPath, useStat = false) {
  6045. return __awaiter(this, void 0, void 0, function* () {
  6046. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  6047. return stats.isDirectory();
  6048. });
  6049. }
  6050. exports.isDirectory = isDirectory;
  6051. /**
  6052. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  6053. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  6054. */
  6055. function isRooted(p) {
  6056. p = normalizeSeparators(p);
  6057. if (!p) {
  6058. throw new Error('isRooted() parameter "p" cannot be empty');
  6059. }
  6060. if (exports.IS_WINDOWS) {
  6061. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  6062. ); // e.g. C: or C:\hello
  6063. }
  6064. return p.startsWith('/');
  6065. }
  6066. exports.isRooted = isRooted;
  6067. /**
  6068. * Best effort attempt to determine whether a file exists and is executable.
  6069. * @param filePath file path to check
  6070. * @param extensions additional file extensions to try
  6071. * @return if file exists and is executable, returns the file path. otherwise empty string.
  6072. */
  6073. function tryGetExecutablePath(filePath, extensions) {
  6074. return __awaiter(this, void 0, void 0, function* () {
  6075. let stats = undefined;
  6076. try {
  6077. // test file exists
  6078. stats = yield exports.stat(filePath);
  6079. }
  6080. catch (err) {
  6081. if (err.code !== 'ENOENT') {
  6082. // eslint-disable-next-line no-console
  6083. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  6084. }
  6085. }
  6086. if (stats && stats.isFile()) {
  6087. if (exports.IS_WINDOWS) {
  6088. // on Windows, test for valid extension
  6089. const upperExt = path.extname(filePath).toUpperCase();
  6090. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  6091. return filePath;
  6092. }
  6093. }
  6094. else {
  6095. if (isUnixExecutable(stats)) {
  6096. return filePath;
  6097. }
  6098. }
  6099. }
  6100. // try each extension
  6101. const originalFilePath = filePath;
  6102. for (const extension of extensions) {
  6103. filePath = originalFilePath + extension;
  6104. stats = undefined;
  6105. try {
  6106. stats = yield exports.stat(filePath);
  6107. }
  6108. catch (err) {
  6109. if (err.code !== 'ENOENT') {
  6110. // eslint-disable-next-line no-console
  6111. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  6112. }
  6113. }
  6114. if (stats && stats.isFile()) {
  6115. if (exports.IS_WINDOWS) {
  6116. // preserve the case of the actual file (since an extension was appended)
  6117. try {
  6118. const directory = path.dirname(filePath);
  6119. const upperName = path.basename(filePath).toUpperCase();
  6120. for (const actualName of yield exports.readdir(directory)) {
  6121. if (upperName === actualName.toUpperCase()) {
  6122. filePath = path.join(directory, actualName);
  6123. break;
  6124. }
  6125. }
  6126. }
  6127. catch (err) {
  6128. // eslint-disable-next-line no-console
  6129. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  6130. }
  6131. return filePath;
  6132. }
  6133. else {
  6134. if (isUnixExecutable(stats)) {
  6135. return filePath;
  6136. }
  6137. }
  6138. }
  6139. }
  6140. return '';
  6141. });
  6142. }
  6143. exports.tryGetExecutablePath = tryGetExecutablePath;
  6144. function normalizeSeparators(p) {
  6145. p = p || '';
  6146. if (exports.IS_WINDOWS) {
  6147. // convert slashes on Windows
  6148. p = p.replace(/\//g, '\\');
  6149. // remove redundant slashes
  6150. return p.replace(/\\\\+/g, '\\');
  6151. }
  6152. // remove redundant slashes
  6153. return p.replace(/\/\/+/g, '/');
  6154. }
  6155. // on Mac/Linux, test the execute bit
  6156. // R W X R W X R W X
  6157. // 256 128 64 32 16 8 4 2 1
  6158. function isUnixExecutable(stats) {
  6159. return ((stats.mode & 1) > 0 ||
  6160. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  6161. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  6162. }
  6163. // Get the path of cmd.exe in windows
  6164. function getCmdPath() {
  6165. var _a;
  6166. return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
  6167. }
  6168. exports.getCmdPath = getCmdPath;
  6169. //# sourceMappingURL=io-util.js.map
  6170. /***/ }),
  6171. /***/ 7436:
  6172. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6173. "use strict";
  6174. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6175. if (k2 === undefined) k2 = k;
  6176. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6177. }) : (function(o, m, k, k2) {
  6178. if (k2 === undefined) k2 = k;
  6179. o[k2] = m[k];
  6180. }));
  6181. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6182. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6183. }) : function(o, v) {
  6184. o["default"] = v;
  6185. });
  6186. var __importStar = (this && this.__importStar) || function (mod) {
  6187. if (mod && mod.__esModule) return mod;
  6188. var result = {};
  6189. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6190. __setModuleDefault(result, mod);
  6191. return result;
  6192. };
  6193. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6194. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6195. return new (P || (P = Promise))(function (resolve, reject) {
  6196. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6197. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6198. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6199. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6200. });
  6201. };
  6202. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6203. exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
  6204. const assert_1 = __nccwpck_require__(9491);
  6205. const path = __importStar(__nccwpck_require__(1017));
  6206. const ioUtil = __importStar(__nccwpck_require__(1962));
  6207. /**
  6208. * Copies a file or folder.
  6209. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  6210. *
  6211. * @param source source path
  6212. * @param dest destination path
  6213. * @param options optional. See CopyOptions.
  6214. */
  6215. function cp(source, dest, options = {}) {
  6216. return __awaiter(this, void 0, void 0, function* () {
  6217. const { force, recursive, copySourceDirectory } = readCopyOptions(options);
  6218. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  6219. // Dest is an existing file, but not forcing
  6220. if (destStat && destStat.isFile() && !force) {
  6221. return;
  6222. }
  6223. // If dest is an existing directory, should copy inside.
  6224. const newDest = destStat && destStat.isDirectory() && copySourceDirectory
  6225. ? path.join(dest, path.basename(source))
  6226. : dest;
  6227. if (!(yield ioUtil.exists(source))) {
  6228. throw new Error(`no such file or directory: ${source}`);
  6229. }
  6230. const sourceStat = yield ioUtil.stat(source);
  6231. if (sourceStat.isDirectory()) {
  6232. if (!recursive) {
  6233. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  6234. }
  6235. else {
  6236. yield cpDirRecursive(source, newDest, 0, force);
  6237. }
  6238. }
  6239. else {
  6240. if (path.relative(source, newDest) === '') {
  6241. // a file cannot be copied to itself
  6242. throw new Error(`'${newDest}' and '${source}' are the same file`);
  6243. }
  6244. yield copyFile(source, newDest, force);
  6245. }
  6246. });
  6247. }
  6248. exports.cp = cp;
  6249. /**
  6250. * Moves a path.
  6251. *
  6252. * @param source source path
  6253. * @param dest destination path
  6254. * @param options optional. See MoveOptions.
  6255. */
  6256. function mv(source, dest, options = {}) {
  6257. return __awaiter(this, void 0, void 0, function* () {
  6258. if (yield ioUtil.exists(dest)) {
  6259. let destExists = true;
  6260. if (yield ioUtil.isDirectory(dest)) {
  6261. // If dest is directory copy src into dest
  6262. dest = path.join(dest, path.basename(source));
  6263. destExists = yield ioUtil.exists(dest);
  6264. }
  6265. if (destExists) {
  6266. if (options.force == null || options.force) {
  6267. yield rmRF(dest);
  6268. }
  6269. else {
  6270. throw new Error('Destination already exists');
  6271. }
  6272. }
  6273. }
  6274. yield mkdirP(path.dirname(dest));
  6275. yield ioUtil.rename(source, dest);
  6276. });
  6277. }
  6278. exports.mv = mv;
  6279. /**
  6280. * Remove a path recursively with force
  6281. *
  6282. * @param inputPath path to remove
  6283. */
  6284. function rmRF(inputPath) {
  6285. return __awaiter(this, void 0, void 0, function* () {
  6286. if (ioUtil.IS_WINDOWS) {
  6287. // Check for invalid characters
  6288. // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
  6289. if (/[*"<>|]/.test(inputPath)) {
  6290. throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
  6291. }
  6292. }
  6293. try {
  6294. // note if path does not exist, error is silent
  6295. yield ioUtil.rm(inputPath, {
  6296. force: true,
  6297. maxRetries: 3,
  6298. recursive: true,
  6299. retryDelay: 300
  6300. });
  6301. }
  6302. catch (err) {
  6303. throw new Error(`File was unable to be removed ${err}`);
  6304. }
  6305. });
  6306. }
  6307. exports.rmRF = rmRF;
  6308. /**
  6309. * Make a directory. Creates the full path with folders in between
  6310. * Will throw if it fails
  6311. *
  6312. * @param fsPath path to create
  6313. * @returns Promise<void>
  6314. */
  6315. function mkdirP(fsPath) {
  6316. return __awaiter(this, void 0, void 0, function* () {
  6317. assert_1.ok(fsPath, 'a path argument must be provided');
  6318. yield ioUtil.mkdir(fsPath, { recursive: true });
  6319. });
  6320. }
  6321. exports.mkdirP = mkdirP;
  6322. /**
  6323. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  6324. * If you check and the tool does not exist, it will throw.
  6325. *
  6326. * @param tool name of the tool
  6327. * @param check whether to check if tool exists
  6328. * @returns Promise<string> path to tool
  6329. */
  6330. function which(tool, check) {
  6331. return __awaiter(this, void 0, void 0, function* () {
  6332. if (!tool) {
  6333. throw new Error("parameter 'tool' is required");
  6334. }
  6335. // recursive when check=true
  6336. if (check) {
  6337. const result = yield which(tool, false);
  6338. if (!result) {
  6339. if (ioUtil.IS_WINDOWS) {
  6340. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
  6341. }
  6342. else {
  6343. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
  6344. }
  6345. }
  6346. return result;
  6347. }
  6348. const matches = yield findInPath(tool);
  6349. if (matches && matches.length > 0) {
  6350. return matches[0];
  6351. }
  6352. return '';
  6353. });
  6354. }
  6355. exports.which = which;
  6356. /**
  6357. * Returns a list of all occurrences of the given tool on the system path.
  6358. *
  6359. * @returns Promise<string[]> the paths of the tool
  6360. */
  6361. function findInPath(tool) {
  6362. return __awaiter(this, void 0, void 0, function* () {
  6363. if (!tool) {
  6364. throw new Error("parameter 'tool' is required");
  6365. }
  6366. // build the list of extensions to try
  6367. const extensions = [];
  6368. if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
  6369. for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
  6370. if (extension) {
  6371. extensions.push(extension);
  6372. }
  6373. }
  6374. }
  6375. // if it's rooted, return it if exists. otherwise return empty.
  6376. if (ioUtil.isRooted(tool)) {
  6377. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  6378. if (filePath) {
  6379. return [filePath];
  6380. }
  6381. return [];
  6382. }
  6383. // if any path separators, return empty
  6384. if (tool.includes(path.sep)) {
  6385. return [];
  6386. }
  6387. // build the list of directories
  6388. //
  6389. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  6390. // it feels like we should not do this. Checking the current directory seems like more of a use
  6391. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  6392. // across platforms.
  6393. const directories = [];
  6394. if (process.env.PATH) {
  6395. for (const p of process.env.PATH.split(path.delimiter)) {
  6396. if (p) {
  6397. directories.push(p);
  6398. }
  6399. }
  6400. }
  6401. // find all matches
  6402. const matches = [];
  6403. for (const directory of directories) {
  6404. const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
  6405. if (filePath) {
  6406. matches.push(filePath);
  6407. }
  6408. }
  6409. return matches;
  6410. });
  6411. }
  6412. exports.findInPath = findInPath;
  6413. function readCopyOptions(options) {
  6414. const force = options.force == null ? true : options.force;
  6415. const recursive = Boolean(options.recursive);
  6416. const copySourceDirectory = options.copySourceDirectory == null
  6417. ? true
  6418. : Boolean(options.copySourceDirectory);
  6419. return { force, recursive, copySourceDirectory };
  6420. }
  6421. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  6422. return __awaiter(this, void 0, void 0, function* () {
  6423. // Ensure there is not a run away recursive copy
  6424. if (currentDepth >= 255)
  6425. return;
  6426. currentDepth++;
  6427. yield mkdirP(destDir);
  6428. const files = yield ioUtil.readdir(sourceDir);
  6429. for (const fileName of files) {
  6430. const srcFile = `${sourceDir}/${fileName}`;
  6431. const destFile = `${destDir}/${fileName}`;
  6432. const srcFileStat = yield ioUtil.lstat(srcFile);
  6433. if (srcFileStat.isDirectory()) {
  6434. // Recurse
  6435. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  6436. }
  6437. else {
  6438. yield copyFile(srcFile, destFile, force);
  6439. }
  6440. }
  6441. // Change the mode for the newly created directory
  6442. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  6443. });
  6444. }
  6445. // Buffered file copy
  6446. function copyFile(srcFile, destFile, force) {
  6447. return __awaiter(this, void 0, void 0, function* () {
  6448. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  6449. // unlink/re-link it
  6450. try {
  6451. yield ioUtil.lstat(destFile);
  6452. yield ioUtil.unlink(destFile);
  6453. }
  6454. catch (e) {
  6455. // Try to override file permission
  6456. if (e.code === 'EPERM') {
  6457. yield ioUtil.chmod(destFile, '0666');
  6458. yield ioUtil.unlink(destFile);
  6459. }
  6460. // other errors = it doesn't exist, no work to do
  6461. }
  6462. // Copy over symlink
  6463. const symlinkFull = yield ioUtil.readlink(srcFile);
  6464. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  6465. }
  6466. else if (!(yield ioUtil.exists(destFile)) || force) {
  6467. yield ioUtil.copyFile(srcFile, destFile);
  6468. }
  6469. });
  6470. }
  6471. //# sourceMappingURL=io.js.map
  6472. /***/ }),
  6473. /***/ 2473:
  6474. /***/ (function(module, exports, __nccwpck_require__) {
  6475. "use strict";
  6476. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6477. if (k2 === undefined) k2 = k;
  6478. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6479. }) : (function(o, m, k, k2) {
  6480. if (k2 === undefined) k2 = k;
  6481. o[k2] = m[k];
  6482. }));
  6483. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6484. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6485. }) : function(o, v) {
  6486. o["default"] = v;
  6487. });
  6488. var __importStar = (this && this.__importStar) || function (mod) {
  6489. if (mod && mod.__esModule) return mod;
  6490. var result = {};
  6491. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6492. __setModuleDefault(result, mod);
  6493. return result;
  6494. };
  6495. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6496. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6497. return new (P || (P = Promise))(function (resolve, reject) {
  6498. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6499. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6500. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6501. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6502. });
  6503. };
  6504. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6505. exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0;
  6506. const semver = __importStar(__nccwpck_require__(5911));
  6507. const core_1 = __nccwpck_require__(2186);
  6508. // needs to be require for core node modules to be mocked
  6509. /* eslint @typescript-eslint/no-require-imports: 0 */
  6510. const os = __nccwpck_require__(2037);
  6511. const cp = __nccwpck_require__(2081);
  6512. const fs = __nccwpck_require__(7147);
  6513. function _findMatch(versionSpec, stable, candidates, archFilter) {
  6514. return __awaiter(this, void 0, void 0, function* () {
  6515. const platFilter = os.platform();
  6516. let result;
  6517. let match;
  6518. let file;
  6519. for (const candidate of candidates) {
  6520. const version = candidate.version;
  6521. core_1.debug(`check ${version} satisfies ${versionSpec}`);
  6522. if (semver.satisfies(version, versionSpec) &&
  6523. (!stable || candidate.stable === stable)) {
  6524. file = candidate.files.find(item => {
  6525. core_1.debug(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`);
  6526. let chk = item.arch === archFilter && item.platform === platFilter;
  6527. if (chk && item.platform_version) {
  6528. const osVersion = module.exports._getOsVersion();
  6529. if (osVersion === item.platform_version) {
  6530. chk = true;
  6531. }
  6532. else {
  6533. chk = semver.satisfies(osVersion, item.platform_version);
  6534. }
  6535. }
  6536. return chk;
  6537. });
  6538. if (file) {
  6539. core_1.debug(`matched ${candidate.version}`);
  6540. match = candidate;
  6541. break;
  6542. }
  6543. }
  6544. }
  6545. if (match && file) {
  6546. // clone since we're mutating the file list to be only the file that matches
  6547. result = Object.assign({}, match);
  6548. result.files = [file];
  6549. }
  6550. return result;
  6551. });
  6552. }
  6553. exports._findMatch = _findMatch;
  6554. function _getOsVersion() {
  6555. // TODO: add windows and other linux, arm variants
  6556. // right now filtering on version is only an ubuntu and macos scenario for tools we build for hosted (python)
  6557. const plat = os.platform();
  6558. let version = '';
  6559. if (plat === 'darwin') {
  6560. version = cp.execSync('sw_vers -productVersion').toString();
  6561. }
  6562. else if (plat === 'linux') {
  6563. // lsb_release process not in some containers, readfile
  6564. // Run cat /etc/lsb-release
  6565. // DISTRIB_ID=Ubuntu
  6566. // DISTRIB_RELEASE=18.04
  6567. // DISTRIB_CODENAME=bionic
  6568. // DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
  6569. const lsbContents = module.exports._readLinuxVersionFile();
  6570. if (lsbContents) {
  6571. const lines = lsbContents.split('\n');
  6572. for (const line of lines) {
  6573. const parts = line.split('=');
  6574. if (parts.length === 2 &&
  6575. (parts[0].trim() === 'VERSION_ID' ||
  6576. parts[0].trim() === 'DISTRIB_RELEASE')) {
  6577. version = parts[1]
  6578. .trim()
  6579. .replace(/^"/, '')
  6580. .replace(/"$/, '');
  6581. break;
  6582. }
  6583. }
  6584. }
  6585. }
  6586. return version;
  6587. }
  6588. exports._getOsVersion = _getOsVersion;
  6589. function _readLinuxVersionFile() {
  6590. const lsbReleaseFile = '/etc/lsb-release';
  6591. const osReleaseFile = '/etc/os-release';
  6592. let contents = '';
  6593. if (fs.existsSync(lsbReleaseFile)) {
  6594. contents = fs.readFileSync(lsbReleaseFile).toString();
  6595. }
  6596. else if (fs.existsSync(osReleaseFile)) {
  6597. contents = fs.readFileSync(osReleaseFile).toString();
  6598. }
  6599. return contents;
  6600. }
  6601. exports._readLinuxVersionFile = _readLinuxVersionFile;
  6602. //# sourceMappingURL=manifest.js.map
  6603. /***/ }),
  6604. /***/ 8279:
  6605. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6606. "use strict";
  6607. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6608. if (k2 === undefined) k2 = k;
  6609. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6610. }) : (function(o, m, k, k2) {
  6611. if (k2 === undefined) k2 = k;
  6612. o[k2] = m[k];
  6613. }));
  6614. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6615. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6616. }) : function(o, v) {
  6617. o["default"] = v;
  6618. });
  6619. var __importStar = (this && this.__importStar) || function (mod) {
  6620. if (mod && mod.__esModule) return mod;
  6621. var result = {};
  6622. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6623. __setModuleDefault(result, mod);
  6624. return result;
  6625. };
  6626. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6627. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6628. return new (P || (P = Promise))(function (resolve, reject) {
  6629. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6630. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6631. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6632. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6633. });
  6634. };
  6635. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6636. exports.RetryHelper = void 0;
  6637. const core = __importStar(__nccwpck_require__(2186));
  6638. /**
  6639. * Internal class for retries
  6640. */
  6641. class RetryHelper {
  6642. constructor(maxAttempts, minSeconds, maxSeconds) {
  6643. if (maxAttempts < 1) {
  6644. throw new Error('max attempts should be greater than or equal to 1');
  6645. }
  6646. this.maxAttempts = maxAttempts;
  6647. this.minSeconds = Math.floor(minSeconds);
  6648. this.maxSeconds = Math.floor(maxSeconds);
  6649. if (this.minSeconds > this.maxSeconds) {
  6650. throw new Error('min seconds should be less than or equal to max seconds');
  6651. }
  6652. }
  6653. execute(action, isRetryable) {
  6654. return __awaiter(this, void 0, void 0, function* () {
  6655. let attempt = 1;
  6656. while (attempt < this.maxAttempts) {
  6657. // Try
  6658. try {
  6659. return yield action();
  6660. }
  6661. catch (err) {
  6662. if (isRetryable && !isRetryable(err)) {
  6663. throw err;
  6664. }
  6665. core.info(err.message);
  6666. }
  6667. // Sleep
  6668. const seconds = this.getSleepAmount();
  6669. core.info(`Waiting ${seconds} seconds before trying again`);
  6670. yield this.sleep(seconds);
  6671. attempt++;
  6672. }
  6673. // Last attempt
  6674. return yield action();
  6675. });
  6676. }
  6677. getSleepAmount() {
  6678. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  6679. this.minSeconds);
  6680. }
  6681. sleep(seconds) {
  6682. return __awaiter(this, void 0, void 0, function* () {
  6683. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  6684. });
  6685. }
  6686. }
  6687. exports.RetryHelper = RetryHelper;
  6688. //# sourceMappingURL=retry-helper.js.map
  6689. /***/ }),
  6690. /***/ 7784:
  6691. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6692. "use strict";
  6693. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6694. if (k2 === undefined) k2 = k;
  6695. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6696. }) : (function(o, m, k, k2) {
  6697. if (k2 === undefined) k2 = k;
  6698. o[k2] = m[k];
  6699. }));
  6700. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6701. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6702. }) : function(o, v) {
  6703. o["default"] = v;
  6704. });
  6705. var __importStar = (this && this.__importStar) || function (mod) {
  6706. if (mod && mod.__esModule) return mod;
  6707. var result = {};
  6708. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6709. __setModuleDefault(result, mod);
  6710. return result;
  6711. };
  6712. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6713. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6714. return new (P || (P = Promise))(function (resolve, reject) {
  6715. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6716. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6717. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6718. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6719. });
  6720. };
  6721. var __importDefault = (this && this.__importDefault) || function (mod) {
  6722. return (mod && mod.__esModule) ? mod : { "default": mod };
  6723. };
  6724. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6725. exports.evaluateVersions = exports.isExplicitVersion = exports.findFromManifest = exports.getManifestFromRepo = exports.findAllVersions = exports.find = exports.cacheFile = exports.cacheDir = exports.extractZip = exports.extractXar = exports.extractTar = exports.extract7z = exports.downloadTool = exports.HTTPError = void 0;
  6726. const core = __importStar(__nccwpck_require__(2186));
  6727. const io = __importStar(__nccwpck_require__(7436));
  6728. const fs = __importStar(__nccwpck_require__(7147));
  6729. const mm = __importStar(__nccwpck_require__(2473));
  6730. const os = __importStar(__nccwpck_require__(2037));
  6731. const path = __importStar(__nccwpck_require__(1017));
  6732. const httpm = __importStar(__nccwpck_require__(6255));
  6733. const semver = __importStar(__nccwpck_require__(5911));
  6734. const stream = __importStar(__nccwpck_require__(2781));
  6735. const util = __importStar(__nccwpck_require__(3837));
  6736. const assert_1 = __nccwpck_require__(9491);
  6737. const v4_1 = __importDefault(__nccwpck_require__(7468));
  6738. const exec_1 = __nccwpck_require__(1514);
  6739. const retry_helper_1 = __nccwpck_require__(8279);
  6740. class HTTPError extends Error {
  6741. constructor(httpStatusCode) {
  6742. super(`Unexpected HTTP response: ${httpStatusCode}`);
  6743. this.httpStatusCode = httpStatusCode;
  6744. Object.setPrototypeOf(this, new.target.prototype);
  6745. }
  6746. }
  6747. exports.HTTPError = HTTPError;
  6748. const IS_WINDOWS = process.platform === 'win32';
  6749. const IS_MAC = process.platform === 'darwin';
  6750. const userAgent = 'actions/tool-cache';
  6751. /**
  6752. * Download a tool from an url and stream it into a file
  6753. *
  6754. * @param url url of tool to download
  6755. * @param dest path to download tool
  6756. * @param auth authorization header
  6757. * @param headers other headers
  6758. * @returns path to downloaded tool
  6759. */
  6760. function downloadTool(url, dest, auth, headers) {
  6761. return __awaiter(this, void 0, void 0, function* () {
  6762. dest = dest || path.join(_getTempDirectory(), v4_1.default());
  6763. yield io.mkdirP(path.dirname(dest));
  6764. core.debug(`Downloading ${url}`);
  6765. core.debug(`Destination ${dest}`);
  6766. const maxAttempts = 3;
  6767. const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10);
  6768. const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
  6769. const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
  6770. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  6771. return yield downloadToolAttempt(url, dest || '', auth, headers);
  6772. }), (err) => {
  6773. if (err instanceof HTTPError && err.httpStatusCode) {
  6774. // Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
  6775. if (err.httpStatusCode < 500 &&
  6776. err.httpStatusCode !== 408 &&
  6777. err.httpStatusCode !== 429) {
  6778. return false;
  6779. }
  6780. }
  6781. // Otherwise retry
  6782. return true;
  6783. });
  6784. });
  6785. }
  6786. exports.downloadTool = downloadTool;
  6787. function downloadToolAttempt(url, dest, auth, headers) {
  6788. return __awaiter(this, void 0, void 0, function* () {
  6789. if (fs.existsSync(dest)) {
  6790. throw new Error(`Destination file path ${dest} already exists`);
  6791. }
  6792. // Get the response headers
  6793. const http = new httpm.HttpClient(userAgent, [], {
  6794. allowRetries: false
  6795. });
  6796. if (auth) {
  6797. core.debug('set auth');
  6798. if (headers === undefined) {
  6799. headers = {};
  6800. }
  6801. headers.authorization = auth;
  6802. }
  6803. const response = yield http.get(url, headers);
  6804. if (response.message.statusCode !== 200) {
  6805. const err = new HTTPError(response.message.statusCode);
  6806. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  6807. throw err;
  6808. }
  6809. // Download the response body
  6810. const pipeline = util.promisify(stream.pipeline);
  6811. const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message);
  6812. const readStream = responseMessageFactory();
  6813. let succeeded = false;
  6814. try {
  6815. yield pipeline(readStream, fs.createWriteStream(dest));
  6816. core.debug('download complete');
  6817. succeeded = true;
  6818. return dest;
  6819. }
  6820. finally {
  6821. // Error, delete dest before retry
  6822. if (!succeeded) {
  6823. core.debug('download failed');
  6824. try {
  6825. yield io.rmRF(dest);
  6826. }
  6827. catch (err) {
  6828. core.debug(`Failed to delete '${dest}'. ${err.message}`);
  6829. }
  6830. }
  6831. }
  6832. });
  6833. }
  6834. /**
  6835. * Extract a .7z file
  6836. *
  6837. * @param file path to the .7z file
  6838. * @param dest destination directory. Optional.
  6839. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  6840. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  6841. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  6842. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  6843. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  6844. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  6845. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  6846. * to 7zr.exe can be pass to this function.
  6847. * @returns path to the destination directory
  6848. */
  6849. function extract7z(file, dest, _7zPath) {
  6850. return __awaiter(this, void 0, void 0, function* () {
  6851. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  6852. assert_1.ok(file, 'parameter "file" is required');
  6853. dest = yield _createExtractFolder(dest);
  6854. const originalCwd = process.cwd();
  6855. process.chdir(dest);
  6856. if (_7zPath) {
  6857. try {
  6858. const logLevel = core.isDebug() ? '-bb1' : '-bb0';
  6859. const args = [
  6860. 'x',
  6861. logLevel,
  6862. '-bd',
  6863. '-sccUTF-8',
  6864. file
  6865. ];
  6866. const options = {
  6867. silent: true
  6868. };
  6869. yield exec_1.exec(`"${_7zPath}"`, args, options);
  6870. }
  6871. finally {
  6872. process.chdir(originalCwd);
  6873. }
  6874. }
  6875. else {
  6876. const escapedScript = path
  6877. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  6878. .replace(/'/g, "''")
  6879. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6880. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6881. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6882. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  6883. const args = [
  6884. '-NoLogo',
  6885. '-Sta',
  6886. '-NoProfile',
  6887. '-NonInteractive',
  6888. '-ExecutionPolicy',
  6889. 'Unrestricted',
  6890. '-Command',
  6891. command
  6892. ];
  6893. const options = {
  6894. silent: true
  6895. };
  6896. try {
  6897. const powershellPath = yield io.which('powershell', true);
  6898. yield exec_1.exec(`"${powershellPath}"`, args, options);
  6899. }
  6900. finally {
  6901. process.chdir(originalCwd);
  6902. }
  6903. }
  6904. return dest;
  6905. });
  6906. }
  6907. exports.extract7z = extract7z;
  6908. /**
  6909. * Extract a compressed tar archive
  6910. *
  6911. * @param file path to the tar
  6912. * @param dest destination directory. Optional.
  6913. * @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
  6914. * @returns path to the destination directory
  6915. */
  6916. function extractTar(file, dest, flags = 'xz') {
  6917. return __awaiter(this, void 0, void 0, function* () {
  6918. if (!file) {
  6919. throw new Error("parameter 'file' is required");
  6920. }
  6921. // Create dest
  6922. dest = yield _createExtractFolder(dest);
  6923. // Determine whether GNU tar
  6924. core.debug('Checking tar --version');
  6925. let versionOutput = '';
  6926. yield exec_1.exec('tar --version', [], {
  6927. ignoreReturnCode: true,
  6928. silent: true,
  6929. listeners: {
  6930. stdout: (data) => (versionOutput += data.toString()),
  6931. stderr: (data) => (versionOutput += data.toString())
  6932. }
  6933. });
  6934. core.debug(versionOutput.trim());
  6935. const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
  6936. // Initialize args
  6937. let args;
  6938. if (flags instanceof Array) {
  6939. args = flags;
  6940. }
  6941. else {
  6942. args = [flags];
  6943. }
  6944. if (core.isDebug() && !flags.includes('v')) {
  6945. args.push('-v');
  6946. }
  6947. let destArg = dest;
  6948. let fileArg = file;
  6949. if (IS_WINDOWS && isGnuTar) {
  6950. args.push('--force-local');
  6951. destArg = dest.replace(/\\/g, '/');
  6952. // Technically only the dest needs to have `/` but for aesthetic consistency
  6953. // convert slashes in the file arg too.
  6954. fileArg = file.replace(/\\/g, '/');
  6955. }
  6956. if (isGnuTar) {
  6957. // Suppress warnings when using GNU tar to extract archives created by BSD tar
  6958. args.push('--warning=no-unknown-keyword');
  6959. args.push('--overwrite');
  6960. }
  6961. args.push('-C', destArg, '-f', fileArg);
  6962. yield exec_1.exec(`tar`, args);
  6963. return dest;
  6964. });
  6965. }
  6966. exports.extractTar = extractTar;
  6967. /**
  6968. * Extract a xar compatible archive
  6969. *
  6970. * @param file path to the archive
  6971. * @param dest destination directory. Optional.
  6972. * @param flags flags for the xar. Optional.
  6973. * @returns path to the destination directory
  6974. */
  6975. function extractXar(file, dest, flags = []) {
  6976. return __awaiter(this, void 0, void 0, function* () {
  6977. assert_1.ok(IS_MAC, 'extractXar() not supported on current OS');
  6978. assert_1.ok(file, 'parameter "file" is required');
  6979. dest = yield _createExtractFolder(dest);
  6980. let args;
  6981. if (flags instanceof Array) {
  6982. args = flags;
  6983. }
  6984. else {
  6985. args = [flags];
  6986. }
  6987. args.push('-x', '-C', dest, '-f', file);
  6988. if (core.isDebug()) {
  6989. args.push('-v');
  6990. }
  6991. const xarPath = yield io.which('xar', true);
  6992. yield exec_1.exec(`"${xarPath}"`, _unique(args));
  6993. return dest;
  6994. });
  6995. }
  6996. exports.extractXar = extractXar;
  6997. /**
  6998. * Extract a zip
  6999. *
  7000. * @param file path to the zip
  7001. * @param dest destination directory. Optional.
  7002. * @returns path to the destination directory
  7003. */
  7004. function extractZip(file, dest) {
  7005. return __awaiter(this, void 0, void 0, function* () {
  7006. if (!file) {
  7007. throw new Error("parameter 'file' is required");
  7008. }
  7009. dest = yield _createExtractFolder(dest);
  7010. if (IS_WINDOWS) {
  7011. yield extractZipWin(file, dest);
  7012. }
  7013. else {
  7014. yield extractZipNix(file, dest);
  7015. }
  7016. return dest;
  7017. });
  7018. }
  7019. exports.extractZip = extractZip;
  7020. function extractZipWin(file, dest) {
  7021. return __awaiter(this, void 0, void 0, function* () {
  7022. // build the powershell command
  7023. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  7024. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7025. const pwshPath = yield io.which('pwsh', false);
  7026. //To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory
  7027. //and the -Force flag for Expand-Archive as a fallback
  7028. if (pwshPath) {
  7029. //attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive
  7030. const pwshCommand = [
  7031. `$ErrorActionPreference = 'Stop' ;`,
  7032. `try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,
  7033. `try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`,
  7034. `catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force } else { throw $_ } } ;`
  7035. ].join(' ');
  7036. const args = [
  7037. '-NoLogo',
  7038. '-NoProfile',
  7039. '-NonInteractive',
  7040. '-ExecutionPolicy',
  7041. 'Unrestricted',
  7042. '-Command',
  7043. pwshCommand
  7044. ];
  7045. core.debug(`Using pwsh at path: ${pwshPath}`);
  7046. yield exec_1.exec(`"${pwshPath}"`, args);
  7047. }
  7048. else {
  7049. const powershellCommand = [
  7050. `$ErrorActionPreference = 'Stop' ;`,
  7051. `try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,
  7052. `if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`,
  7053. `else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`
  7054. ].join(' ');
  7055. const args = [
  7056. '-NoLogo',
  7057. '-Sta',
  7058. '-NoProfile',
  7059. '-NonInteractive',
  7060. '-ExecutionPolicy',
  7061. 'Unrestricted',
  7062. '-Command',
  7063. powershellCommand
  7064. ];
  7065. const powershellPath = yield io.which('powershell', true);
  7066. core.debug(`Using powershell at path: ${powershellPath}`);
  7067. yield exec_1.exec(`"${powershellPath}"`, args);
  7068. }
  7069. });
  7070. }
  7071. function extractZipNix(file, dest) {
  7072. return __awaiter(this, void 0, void 0, function* () {
  7073. const unzipPath = yield io.which('unzip', true);
  7074. const args = [file];
  7075. if (!core.isDebug()) {
  7076. args.unshift('-q');
  7077. }
  7078. args.unshift('-o'); //overwrite with -o, otherwise a prompt is shown which freezes the run
  7079. yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest });
  7080. });
  7081. }
  7082. /**
  7083. * Caches a directory and installs it into the tool cacheDir
  7084. *
  7085. * @param sourceDir the directory to cache into tools
  7086. * @param tool tool name
  7087. * @param version version of the tool. semver format
  7088. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7089. */
  7090. function cacheDir(sourceDir, tool, version, arch) {
  7091. return __awaiter(this, void 0, void 0, function* () {
  7092. version = semver.clean(version) || version;
  7093. arch = arch || os.arch();
  7094. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  7095. core.debug(`source dir: ${sourceDir}`);
  7096. if (!fs.statSync(sourceDir).isDirectory()) {
  7097. throw new Error('sourceDir is not a directory');
  7098. }
  7099. // Create the tool dir
  7100. const destPath = yield _createToolPath(tool, version, arch);
  7101. // copy each child item. do not move. move can fail on Windows
  7102. // due to anti-virus software having an open handle on a file.
  7103. for (const itemName of fs.readdirSync(sourceDir)) {
  7104. const s = path.join(sourceDir, itemName);
  7105. yield io.cp(s, destPath, { recursive: true });
  7106. }
  7107. // write .complete
  7108. _completeToolPath(tool, version, arch);
  7109. return destPath;
  7110. });
  7111. }
  7112. exports.cacheDir = cacheDir;
  7113. /**
  7114. * Caches a downloaded file (GUID) and installs it
  7115. * into the tool cache with a given targetName
  7116. *
  7117. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  7118. * @param targetFile the name of the file name in the tools directory
  7119. * @param tool tool name
  7120. * @param version version of the tool. semver format
  7121. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7122. */
  7123. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  7124. return __awaiter(this, void 0, void 0, function* () {
  7125. version = semver.clean(version) || version;
  7126. arch = arch || os.arch();
  7127. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  7128. core.debug(`source file: ${sourceFile}`);
  7129. if (!fs.statSync(sourceFile).isFile()) {
  7130. throw new Error('sourceFile is not a file');
  7131. }
  7132. // create the tool dir
  7133. const destFolder = yield _createToolPath(tool, version, arch);
  7134. // copy instead of move. move can fail on Windows due to
  7135. // anti-virus software having an open handle on a file.
  7136. const destPath = path.join(destFolder, targetFile);
  7137. core.debug(`destination file ${destPath}`);
  7138. yield io.cp(sourceFile, destPath);
  7139. // write .complete
  7140. _completeToolPath(tool, version, arch);
  7141. return destFolder;
  7142. });
  7143. }
  7144. exports.cacheFile = cacheFile;
  7145. /**
  7146. * Finds the path to a tool version in the local installed tool cache
  7147. *
  7148. * @param toolName name of the tool
  7149. * @param versionSpec version of the tool
  7150. * @param arch optional arch. defaults to arch of computer
  7151. */
  7152. function find(toolName, versionSpec, arch) {
  7153. if (!toolName) {
  7154. throw new Error('toolName parameter is required');
  7155. }
  7156. if (!versionSpec) {
  7157. throw new Error('versionSpec parameter is required');
  7158. }
  7159. arch = arch || os.arch();
  7160. // attempt to resolve an explicit version
  7161. if (!isExplicitVersion(versionSpec)) {
  7162. const localVersions = findAllVersions(toolName, arch);
  7163. const match = evaluateVersions(localVersions, versionSpec);
  7164. versionSpec = match;
  7165. }
  7166. // check for the explicit version in the cache
  7167. let toolPath = '';
  7168. if (versionSpec) {
  7169. versionSpec = semver.clean(versionSpec) || '';
  7170. const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch);
  7171. core.debug(`checking cache: ${cachePath}`);
  7172. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  7173. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  7174. toolPath = cachePath;
  7175. }
  7176. else {
  7177. core.debug('not found');
  7178. }
  7179. }
  7180. return toolPath;
  7181. }
  7182. exports.find = find;
  7183. /**
  7184. * Finds the paths to all versions of a tool that are installed in the local tool cache
  7185. *
  7186. * @param toolName name of the tool
  7187. * @param arch optional arch. defaults to arch of computer
  7188. */
  7189. function findAllVersions(toolName, arch) {
  7190. const versions = [];
  7191. arch = arch || os.arch();
  7192. const toolPath = path.join(_getCacheDirectory(), toolName);
  7193. if (fs.existsSync(toolPath)) {
  7194. const children = fs.readdirSync(toolPath);
  7195. for (const child of children) {
  7196. if (isExplicitVersion(child)) {
  7197. const fullPath = path.join(toolPath, child, arch || '');
  7198. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  7199. versions.push(child);
  7200. }
  7201. }
  7202. }
  7203. }
  7204. return versions;
  7205. }
  7206. exports.findAllVersions = findAllVersions;
  7207. function getManifestFromRepo(owner, repo, auth, branch = 'master') {
  7208. return __awaiter(this, void 0, void 0, function* () {
  7209. let releases = [];
  7210. const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`;
  7211. const http = new httpm.HttpClient('tool-cache');
  7212. const headers = {};
  7213. if (auth) {
  7214. core.debug('set auth');
  7215. headers.authorization = auth;
  7216. }
  7217. const response = yield http.getJson(treeUrl, headers);
  7218. if (!response.result) {
  7219. return releases;
  7220. }
  7221. let manifestUrl = '';
  7222. for (const item of response.result.tree) {
  7223. if (item.path === 'versions-manifest.json') {
  7224. manifestUrl = item.url;
  7225. break;
  7226. }
  7227. }
  7228. headers['accept'] = 'application/vnd.github.VERSION.raw';
  7229. let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody();
  7230. if (versionsRaw) {
  7231. // shouldn't be needed but protects against invalid json saved with BOM
  7232. versionsRaw = versionsRaw.replace(/^\uFEFF/, '');
  7233. try {
  7234. releases = JSON.parse(versionsRaw);
  7235. }
  7236. catch (_a) {
  7237. core.debug('Invalid json');
  7238. }
  7239. }
  7240. return releases;
  7241. });
  7242. }
  7243. exports.getManifestFromRepo = getManifestFromRepo;
  7244. function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) {
  7245. return __awaiter(this, void 0, void 0, function* () {
  7246. // wrap the internal impl
  7247. const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter);
  7248. return match;
  7249. });
  7250. }
  7251. exports.findFromManifest = findFromManifest;
  7252. function _createExtractFolder(dest) {
  7253. return __awaiter(this, void 0, void 0, function* () {
  7254. if (!dest) {
  7255. // create a temp dir
  7256. dest = path.join(_getTempDirectory(), v4_1.default());
  7257. }
  7258. yield io.mkdirP(dest);
  7259. return dest;
  7260. });
  7261. }
  7262. function _createToolPath(tool, version, arch) {
  7263. return __awaiter(this, void 0, void 0, function* () {
  7264. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  7265. core.debug(`destination ${folderPath}`);
  7266. const markerPath = `${folderPath}.complete`;
  7267. yield io.rmRF(folderPath);
  7268. yield io.rmRF(markerPath);
  7269. yield io.mkdirP(folderPath);
  7270. return folderPath;
  7271. });
  7272. }
  7273. function _completeToolPath(tool, version, arch) {
  7274. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  7275. const markerPath = `${folderPath}.complete`;
  7276. fs.writeFileSync(markerPath, '');
  7277. core.debug('finished caching tool');
  7278. }
  7279. /**
  7280. * Check if version string is explicit
  7281. *
  7282. * @param versionSpec version string to check
  7283. */
  7284. function isExplicitVersion(versionSpec) {
  7285. const c = semver.clean(versionSpec) || '';
  7286. core.debug(`isExplicit: ${c}`);
  7287. const valid = semver.valid(c) != null;
  7288. core.debug(`explicit? ${valid}`);
  7289. return valid;
  7290. }
  7291. exports.isExplicitVersion = isExplicitVersion;
  7292. /**
  7293. * Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`
  7294. *
  7295. * @param versions array of versions to evaluate
  7296. * @param versionSpec semantic version spec to satisfy
  7297. */
  7298. function evaluateVersions(versions, versionSpec) {
  7299. let version = '';
  7300. core.debug(`evaluating ${versions.length} versions`);
  7301. versions = versions.sort((a, b) => {
  7302. if (semver.gt(a, b)) {
  7303. return 1;
  7304. }
  7305. return -1;
  7306. });
  7307. for (let i = versions.length - 1; i >= 0; i--) {
  7308. const potential = versions[i];
  7309. const satisfied = semver.satisfies(potential, versionSpec);
  7310. if (satisfied) {
  7311. version = potential;
  7312. break;
  7313. }
  7314. }
  7315. if (version) {
  7316. core.debug(`matched: ${version}`);
  7317. }
  7318. else {
  7319. core.debug('match not found');
  7320. }
  7321. return version;
  7322. }
  7323. exports.evaluateVersions = evaluateVersions;
  7324. /**
  7325. * Gets RUNNER_TOOL_CACHE
  7326. */
  7327. function _getCacheDirectory() {
  7328. const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || '';
  7329. assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined');
  7330. return cacheDirectory;
  7331. }
  7332. /**
  7333. * Gets RUNNER_TEMP
  7334. */
  7335. function _getTempDirectory() {
  7336. const tempDirectory = process.env['RUNNER_TEMP'] || '';
  7337. assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
  7338. return tempDirectory;
  7339. }
  7340. /**
  7341. * Gets a global variable
  7342. */
  7343. function _getGlobal(key, defaultValue) {
  7344. /* eslint-disable @typescript-eslint/no-explicit-any */
  7345. const value = global[key];
  7346. /* eslint-enable @typescript-eslint/no-explicit-any */
  7347. return value !== undefined ? value : defaultValue;
  7348. }
  7349. /**
  7350. * Returns an array of unique values.
  7351. * @param values Values to make unique.
  7352. */
  7353. function _unique(values) {
  7354. return Array.from(new Set(values));
  7355. }
  7356. //# sourceMappingURL=tool-cache.js.map
  7357. /***/ }),
  7358. /***/ 7701:
  7359. /***/ ((module) => {
  7360. /**
  7361. * Convert array of 16 byte values to UUID string format of the form:
  7362. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  7363. */
  7364. var byteToHex = [];
  7365. for (var i = 0; i < 256; ++i) {
  7366. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  7367. }
  7368. function bytesToUuid(buf, offset) {
  7369. var i = offset || 0;
  7370. var bth = byteToHex;
  7371. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  7372. return ([
  7373. bth[buf[i++]], bth[buf[i++]],
  7374. bth[buf[i++]], bth[buf[i++]], '-',
  7375. bth[buf[i++]], bth[buf[i++]], '-',
  7376. bth[buf[i++]], bth[buf[i++]], '-',
  7377. bth[buf[i++]], bth[buf[i++]], '-',
  7378. bth[buf[i++]], bth[buf[i++]],
  7379. bth[buf[i++]], bth[buf[i++]],
  7380. bth[buf[i++]], bth[buf[i++]]
  7381. ]).join('');
  7382. }
  7383. module.exports = bytesToUuid;
  7384. /***/ }),
  7385. /***/ 7269:
  7386. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7387. // Unique ID creation requires a high quality random # generator. In node.js
  7388. // this is pretty straight-forward - we use the crypto API.
  7389. var crypto = __nccwpck_require__(6113);
  7390. module.exports = function nodeRNG() {
  7391. return crypto.randomBytes(16);
  7392. };
  7393. /***/ }),
  7394. /***/ 7468:
  7395. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7396. var rng = __nccwpck_require__(7269);
  7397. var bytesToUuid = __nccwpck_require__(7701);
  7398. function v4(options, buf, offset) {
  7399. var i = buf && offset || 0;
  7400. if (typeof(options) == 'string') {
  7401. buf = options === 'binary' ? new Array(16) : null;
  7402. options = null;
  7403. }
  7404. options = options || {};
  7405. var rnds = options.random || (options.rng || rng)();
  7406. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  7407. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  7408. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  7409. // Copy bytes to buffer, if provided
  7410. if (buf) {
  7411. for (var ii = 0; ii < 16; ++ii) {
  7412. buf[i + ii] = rnds[ii];
  7413. }
  7414. }
  7415. return buf || bytesToUuid(rnds);
  7416. }
  7417. module.exports = v4;
  7418. /***/ }),
  7419. /***/ 334:
  7420. /***/ ((module) => {
  7421. "use strict";
  7422. var __defProp = Object.defineProperty;
  7423. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7424. var __getOwnPropNames = Object.getOwnPropertyNames;
  7425. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7426. var __export = (target, all) => {
  7427. for (var name in all)
  7428. __defProp(target, name, { get: all[name], enumerable: true });
  7429. };
  7430. var __copyProps = (to, from, except, desc) => {
  7431. if (from && typeof from === "object" || typeof from === "function") {
  7432. for (let key of __getOwnPropNames(from))
  7433. if (!__hasOwnProp.call(to, key) && key !== except)
  7434. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7435. }
  7436. return to;
  7437. };
  7438. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7439. // pkg/dist-src/index.js
  7440. var dist_src_exports = {};
  7441. __export(dist_src_exports, {
  7442. createTokenAuth: () => createTokenAuth
  7443. });
  7444. module.exports = __toCommonJS(dist_src_exports);
  7445. // pkg/dist-src/auth.js
  7446. var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
  7447. var REGEX_IS_INSTALLATION = /^ghs_/;
  7448. var REGEX_IS_USER_TO_SERVER = /^ghu_/;
  7449. async function auth(token) {
  7450. const isApp = token.split(/\./).length === 3;
  7451. const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
  7452. const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
  7453. const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
  7454. return {
  7455. type: "token",
  7456. token,
  7457. tokenType
  7458. };
  7459. }
  7460. // pkg/dist-src/with-authorization-prefix.js
  7461. function withAuthorizationPrefix(token) {
  7462. if (token.split(/\./).length === 3) {
  7463. return `bearer ${token}`;
  7464. }
  7465. return `token ${token}`;
  7466. }
  7467. // pkg/dist-src/hook.js
  7468. async function hook(token, request, route, parameters) {
  7469. const endpoint = request.endpoint.merge(
  7470. route,
  7471. parameters
  7472. );
  7473. endpoint.headers.authorization = withAuthorizationPrefix(token);
  7474. return request(endpoint);
  7475. }
  7476. // pkg/dist-src/index.js
  7477. var createTokenAuth = function createTokenAuth2(token) {
  7478. if (!token) {
  7479. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  7480. }
  7481. if (typeof token !== "string") {
  7482. throw new Error(
  7483. "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
  7484. );
  7485. }
  7486. token = token.replace(/^(token|bearer) +/i, "");
  7487. return Object.assign(auth.bind(null, token), {
  7488. hook: hook.bind(null, token)
  7489. });
  7490. };
  7491. // Annotate the CommonJS export names for ESM import in node:
  7492. 0 && (0);
  7493. /***/ }),
  7494. /***/ 6762:
  7495. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7496. "use strict";
  7497. var __defProp = Object.defineProperty;
  7498. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7499. var __getOwnPropNames = Object.getOwnPropertyNames;
  7500. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7501. var __export = (target, all) => {
  7502. for (var name in all)
  7503. __defProp(target, name, { get: all[name], enumerable: true });
  7504. };
  7505. var __copyProps = (to, from, except, desc) => {
  7506. if (from && typeof from === "object" || typeof from === "function") {
  7507. for (let key of __getOwnPropNames(from))
  7508. if (!__hasOwnProp.call(to, key) && key !== except)
  7509. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7510. }
  7511. return to;
  7512. };
  7513. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7514. // pkg/dist-src/index.js
  7515. var dist_src_exports = {};
  7516. __export(dist_src_exports, {
  7517. Octokit: () => Octokit
  7518. });
  7519. module.exports = __toCommonJS(dist_src_exports);
  7520. var import_universal_user_agent = __nccwpck_require__(5030);
  7521. var import_before_after_hook = __nccwpck_require__(3682);
  7522. var import_request = __nccwpck_require__(6234);
  7523. var import_graphql = __nccwpck_require__(8467);
  7524. var import_auth_token = __nccwpck_require__(334);
  7525. // pkg/dist-src/version.js
  7526. var VERSION = "5.2.0";
  7527. // pkg/dist-src/index.js
  7528. var noop = () => {
  7529. };
  7530. var consoleWarn = console.warn.bind(console);
  7531. var consoleError = console.error.bind(console);
  7532. var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7533. var Octokit = class {
  7534. static {
  7535. this.VERSION = VERSION;
  7536. }
  7537. static defaults(defaults) {
  7538. const OctokitWithDefaults = class extends this {
  7539. constructor(...args) {
  7540. const options = args[0] || {};
  7541. if (typeof defaults === "function") {
  7542. super(defaults(options));
  7543. return;
  7544. }
  7545. super(
  7546. Object.assign(
  7547. {},
  7548. defaults,
  7549. options,
  7550. options.userAgent && defaults.userAgent ? {
  7551. userAgent: `${options.userAgent} ${defaults.userAgent}`
  7552. } : null
  7553. )
  7554. );
  7555. }
  7556. };
  7557. return OctokitWithDefaults;
  7558. }
  7559. static {
  7560. this.plugins = [];
  7561. }
  7562. /**
  7563. * Attach a plugin (or many) to your Octokit instance.
  7564. *
  7565. * @example
  7566. * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
  7567. */
  7568. static plugin(...newPlugins) {
  7569. const currentPlugins = this.plugins;
  7570. const NewOctokit = class extends this {
  7571. static {
  7572. this.plugins = currentPlugins.concat(
  7573. newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
  7574. );
  7575. }
  7576. };
  7577. return NewOctokit;
  7578. }
  7579. constructor(options = {}) {
  7580. const hook = new import_before_after_hook.Collection();
  7581. const requestDefaults = {
  7582. baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl,
  7583. headers: {},
  7584. request: Object.assign({}, options.request, {
  7585. // @ts-ignore internal usage only, no need to type
  7586. hook: hook.bind(null, "request")
  7587. }),
  7588. mediaType: {
  7589. previews: [],
  7590. format: ""
  7591. }
  7592. };
  7593. requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
  7594. if (options.baseUrl) {
  7595. requestDefaults.baseUrl = options.baseUrl;
  7596. }
  7597. if (options.previews) {
  7598. requestDefaults.mediaType.previews = options.previews;
  7599. }
  7600. if (options.timeZone) {
  7601. requestDefaults.headers["time-zone"] = options.timeZone;
  7602. }
  7603. this.request = import_request.request.defaults(requestDefaults);
  7604. this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
  7605. this.log = Object.assign(
  7606. {
  7607. debug: noop,
  7608. info: noop,
  7609. warn: consoleWarn,
  7610. error: consoleError
  7611. },
  7612. options.log
  7613. );
  7614. this.hook = hook;
  7615. if (!options.authStrategy) {
  7616. if (!options.auth) {
  7617. this.auth = async () => ({
  7618. type: "unauthenticated"
  7619. });
  7620. } else {
  7621. const auth = (0, import_auth_token.createTokenAuth)(options.auth);
  7622. hook.wrap("request", auth.hook);
  7623. this.auth = auth;
  7624. }
  7625. } else {
  7626. const { authStrategy, ...otherOptions } = options;
  7627. const auth = authStrategy(
  7628. Object.assign(
  7629. {
  7630. request: this.request,
  7631. log: this.log,
  7632. // we pass the current octokit instance as well as its constructor options
  7633. // to allow for authentication strategies that return a new octokit instance
  7634. // that shares the same internal state as the current one. The original
  7635. // requirement for this was the "event-octokit" authentication strategy
  7636. // of https://github.com/probot/octokit-auth-probot.
  7637. octokit: this,
  7638. octokitOptions: otherOptions
  7639. },
  7640. options.auth
  7641. )
  7642. );
  7643. hook.wrap("request", auth.hook);
  7644. this.auth = auth;
  7645. }
  7646. const classConstructor = this.constructor;
  7647. for (let i = 0; i < classConstructor.plugins.length; ++i) {
  7648. Object.assign(this, classConstructor.plugins[i](this, options));
  7649. }
  7650. }
  7651. };
  7652. // Annotate the CommonJS export names for ESM import in node:
  7653. 0 && (0);
  7654. /***/ }),
  7655. /***/ 9440:
  7656. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7657. "use strict";
  7658. var __defProp = Object.defineProperty;
  7659. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7660. var __getOwnPropNames = Object.getOwnPropertyNames;
  7661. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7662. var __export = (target, all) => {
  7663. for (var name in all)
  7664. __defProp(target, name, { get: all[name], enumerable: true });
  7665. };
  7666. var __copyProps = (to, from, except, desc) => {
  7667. if (from && typeof from === "object" || typeof from === "function") {
  7668. for (let key of __getOwnPropNames(from))
  7669. if (!__hasOwnProp.call(to, key) && key !== except)
  7670. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7671. }
  7672. return to;
  7673. };
  7674. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7675. // pkg/dist-src/index.js
  7676. var dist_src_exports = {};
  7677. __export(dist_src_exports, {
  7678. endpoint: () => endpoint
  7679. });
  7680. module.exports = __toCommonJS(dist_src_exports);
  7681. // pkg/dist-src/defaults.js
  7682. var import_universal_user_agent = __nccwpck_require__(5030);
  7683. // pkg/dist-src/version.js
  7684. var VERSION = "9.0.6";
  7685. // pkg/dist-src/defaults.js
  7686. var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7687. var DEFAULTS = {
  7688. method: "GET",
  7689. baseUrl: "https://api.github.com",
  7690. headers: {
  7691. accept: "application/vnd.github.v3+json",
  7692. "user-agent": userAgent
  7693. },
  7694. mediaType: {
  7695. format: ""
  7696. }
  7697. };
  7698. // pkg/dist-src/util/lowercase-keys.js
  7699. function lowercaseKeys(object) {
  7700. if (!object) {
  7701. return {};
  7702. }
  7703. return Object.keys(object).reduce((newObj, key) => {
  7704. newObj[key.toLowerCase()] = object[key];
  7705. return newObj;
  7706. }, {});
  7707. }
  7708. // pkg/dist-src/util/is-plain-object.js
  7709. function isPlainObject(value) {
  7710. if (typeof value !== "object" || value === null)
  7711. return false;
  7712. if (Object.prototype.toString.call(value) !== "[object Object]")
  7713. return false;
  7714. const proto = Object.getPrototypeOf(value);
  7715. if (proto === null)
  7716. return true;
  7717. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  7718. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  7719. }
  7720. // pkg/dist-src/util/merge-deep.js
  7721. function mergeDeep(defaults, options) {
  7722. const result = Object.assign({}, defaults);
  7723. Object.keys(options).forEach((key) => {
  7724. if (isPlainObject(options[key])) {
  7725. if (!(key in defaults))
  7726. Object.assign(result, { [key]: options[key] });
  7727. else
  7728. result[key] = mergeDeep(defaults[key], options[key]);
  7729. } else {
  7730. Object.assign(result, { [key]: options[key] });
  7731. }
  7732. });
  7733. return result;
  7734. }
  7735. // pkg/dist-src/util/remove-undefined-properties.js
  7736. function removeUndefinedProperties(obj) {
  7737. for (const key in obj) {
  7738. if (obj[key] === void 0) {
  7739. delete obj[key];
  7740. }
  7741. }
  7742. return obj;
  7743. }
  7744. // pkg/dist-src/merge.js
  7745. function merge(defaults, route, options) {
  7746. if (typeof route === "string") {
  7747. let [method, url] = route.split(" ");
  7748. options = Object.assign(url ? { method, url } : { url: method }, options);
  7749. } else {
  7750. options = Object.assign({}, route);
  7751. }
  7752. options.headers = lowercaseKeys(options.headers);
  7753. removeUndefinedProperties(options);
  7754. removeUndefinedProperties(options.headers);
  7755. const mergedOptions = mergeDeep(defaults || {}, options);
  7756. if (options.url === "/graphql") {
  7757. if (defaults && defaults.mediaType.previews?.length) {
  7758. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
  7759. (preview) => !mergedOptions.mediaType.previews.includes(preview)
  7760. ).concat(mergedOptions.mediaType.previews);
  7761. }
  7762. mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
  7763. }
  7764. return mergedOptions;
  7765. }
  7766. // pkg/dist-src/util/add-query-parameters.js
  7767. function addQueryParameters(url, parameters) {
  7768. const separator = /\?/.test(url) ? "&" : "?";
  7769. const names = Object.keys(parameters);
  7770. if (names.length === 0) {
  7771. return url;
  7772. }
  7773. return url + separator + names.map((name) => {
  7774. if (name === "q") {
  7775. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  7776. }
  7777. return `${name}=${encodeURIComponent(parameters[name])}`;
  7778. }).join("&");
  7779. }
  7780. // pkg/dist-src/util/extract-url-variable-names.js
  7781. var urlVariableRegex = /\{[^{}}]+\}/g;
  7782. function removeNonChars(variableName) {
  7783. return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
  7784. }
  7785. function extractUrlVariableNames(url) {
  7786. const matches = url.match(urlVariableRegex);
  7787. if (!matches) {
  7788. return [];
  7789. }
  7790. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  7791. }
  7792. // pkg/dist-src/util/omit.js
  7793. function omit(object, keysToOmit) {
  7794. const result = { __proto__: null };
  7795. for (const key of Object.keys(object)) {
  7796. if (keysToOmit.indexOf(key) === -1) {
  7797. result[key] = object[key];
  7798. }
  7799. }
  7800. return result;
  7801. }
  7802. // pkg/dist-src/util/url-template.js
  7803. function encodeReserved(str) {
  7804. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
  7805. if (!/%[0-9A-Fa-f]/.test(part)) {
  7806. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  7807. }
  7808. return part;
  7809. }).join("");
  7810. }
  7811. function encodeUnreserved(str) {
  7812. return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
  7813. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  7814. });
  7815. }
  7816. function encodeValue(operator, value, key) {
  7817. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  7818. if (key) {
  7819. return encodeUnreserved(key) + "=" + value;
  7820. } else {
  7821. return value;
  7822. }
  7823. }
  7824. function isDefined(value) {
  7825. return value !== void 0 && value !== null;
  7826. }
  7827. function isKeyOperator(operator) {
  7828. return operator === ";" || operator === "&" || operator === "?";
  7829. }
  7830. function getValues(context, operator, key, modifier) {
  7831. var value = context[key], result = [];
  7832. if (isDefined(value) && value !== "") {
  7833. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  7834. value = value.toString();
  7835. if (modifier && modifier !== "*") {
  7836. value = value.substring(0, parseInt(modifier, 10));
  7837. }
  7838. result.push(
  7839. encodeValue(operator, value, isKeyOperator(operator) ? key : "")
  7840. );
  7841. } else {
  7842. if (modifier === "*") {
  7843. if (Array.isArray(value)) {
  7844. value.filter(isDefined).forEach(function(value2) {
  7845. result.push(
  7846. encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
  7847. );
  7848. });
  7849. } else {
  7850. Object.keys(value).forEach(function(k) {
  7851. if (isDefined(value[k])) {
  7852. result.push(encodeValue(operator, value[k], k));
  7853. }
  7854. });
  7855. }
  7856. } else {
  7857. const tmp = [];
  7858. if (Array.isArray(value)) {
  7859. value.filter(isDefined).forEach(function(value2) {
  7860. tmp.push(encodeValue(operator, value2));
  7861. });
  7862. } else {
  7863. Object.keys(value).forEach(function(k) {
  7864. if (isDefined(value[k])) {
  7865. tmp.push(encodeUnreserved(k));
  7866. tmp.push(encodeValue(operator, value[k].toString()));
  7867. }
  7868. });
  7869. }
  7870. if (isKeyOperator(operator)) {
  7871. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  7872. } else if (tmp.length !== 0) {
  7873. result.push(tmp.join(","));
  7874. }
  7875. }
  7876. }
  7877. } else {
  7878. if (operator === ";") {
  7879. if (isDefined(value)) {
  7880. result.push(encodeUnreserved(key));
  7881. }
  7882. } else if (value === "" && (operator === "&" || operator === "?")) {
  7883. result.push(encodeUnreserved(key) + "=");
  7884. } else if (value === "") {
  7885. result.push("");
  7886. }
  7887. }
  7888. return result;
  7889. }
  7890. function parseUrl(template) {
  7891. return {
  7892. expand: expand.bind(null, template)
  7893. };
  7894. }
  7895. function expand(template, context) {
  7896. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  7897. template = template.replace(
  7898. /\{([^\{\}]+)\}|([^\{\}]+)/g,
  7899. function(_, expression, literal) {
  7900. if (expression) {
  7901. let operator = "";
  7902. const values = [];
  7903. if (operators.indexOf(expression.charAt(0)) !== -1) {
  7904. operator = expression.charAt(0);
  7905. expression = expression.substr(1);
  7906. }
  7907. expression.split(/,/g).forEach(function(variable) {
  7908. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  7909. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  7910. });
  7911. if (operator && operator !== "+") {
  7912. var separator = ",";
  7913. if (operator === "?") {
  7914. separator = "&";
  7915. } else if (operator !== "#") {
  7916. separator = operator;
  7917. }
  7918. return (values.length !== 0 ? operator : "") + values.join(separator);
  7919. } else {
  7920. return values.join(",");
  7921. }
  7922. } else {
  7923. return encodeReserved(literal);
  7924. }
  7925. }
  7926. );
  7927. if (template === "/") {
  7928. return template;
  7929. } else {
  7930. return template.replace(/\/$/, "");
  7931. }
  7932. }
  7933. // pkg/dist-src/parse.js
  7934. function parse(options) {
  7935. let method = options.method.toUpperCase();
  7936. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
  7937. let headers = Object.assign({}, options.headers);
  7938. let body;
  7939. let parameters = omit(options, [
  7940. "method",
  7941. "baseUrl",
  7942. "url",
  7943. "headers",
  7944. "request",
  7945. "mediaType"
  7946. ]);
  7947. const urlVariableNames = extractUrlVariableNames(url);
  7948. url = parseUrl(url).expand(parameters);
  7949. if (!/^http/.test(url)) {
  7950. url = options.baseUrl + url;
  7951. }
  7952. const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
  7953. const remainingParameters = omit(parameters, omittedParameters);
  7954. const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
  7955. if (!isBinaryRequest) {
  7956. if (options.mediaType.format) {
  7957. headers.accept = headers.accept.split(/,/).map(
  7958. (format) => format.replace(
  7959. /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
  7960. `application/vnd$1$2.${options.mediaType.format}`
  7961. )
  7962. ).join(",");
  7963. }
  7964. if (url.endsWith("/graphql")) {
  7965. if (options.mediaType.previews?.length) {
  7966. const previewsFromAcceptHeader = headers.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g) || [];
  7967. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
  7968. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  7969. return `application/vnd.github.${preview}-preview${format}`;
  7970. }).join(",");
  7971. }
  7972. }
  7973. }
  7974. if (["GET", "HEAD"].includes(method)) {
  7975. url = addQueryParameters(url, remainingParameters);
  7976. } else {
  7977. if ("data" in remainingParameters) {
  7978. body = remainingParameters.data;
  7979. } else {
  7980. if (Object.keys(remainingParameters).length) {
  7981. body = remainingParameters;
  7982. }
  7983. }
  7984. }
  7985. if (!headers["content-type"] && typeof body !== "undefined") {
  7986. headers["content-type"] = "application/json; charset=utf-8";
  7987. }
  7988. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  7989. body = "";
  7990. }
  7991. return Object.assign(
  7992. { method, url, headers },
  7993. typeof body !== "undefined" ? { body } : null,
  7994. options.request ? { request: options.request } : null
  7995. );
  7996. }
  7997. // pkg/dist-src/endpoint-with-defaults.js
  7998. function endpointWithDefaults(defaults, route, options) {
  7999. return parse(merge(defaults, route, options));
  8000. }
  8001. // pkg/dist-src/with-defaults.js
  8002. function withDefaults(oldDefaults, newDefaults) {
  8003. const DEFAULTS2 = merge(oldDefaults, newDefaults);
  8004. const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
  8005. return Object.assign(endpoint2, {
  8006. DEFAULTS: DEFAULTS2,
  8007. defaults: withDefaults.bind(null, DEFAULTS2),
  8008. merge: merge.bind(null, DEFAULTS2),
  8009. parse
  8010. });
  8011. }
  8012. // pkg/dist-src/index.js
  8013. var endpoint = withDefaults(null, DEFAULTS);
  8014. // Annotate the CommonJS export names for ESM import in node:
  8015. 0 && (0);
  8016. /***/ }),
  8017. /***/ 8467:
  8018. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  8019. "use strict";
  8020. var __defProp = Object.defineProperty;
  8021. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8022. var __getOwnPropNames = Object.getOwnPropertyNames;
  8023. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8024. var __export = (target, all) => {
  8025. for (var name in all)
  8026. __defProp(target, name, { get: all[name], enumerable: true });
  8027. };
  8028. var __copyProps = (to, from, except, desc) => {
  8029. if (from && typeof from === "object" || typeof from === "function") {
  8030. for (let key of __getOwnPropNames(from))
  8031. if (!__hasOwnProp.call(to, key) && key !== except)
  8032. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8033. }
  8034. return to;
  8035. };
  8036. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8037. // pkg/dist-src/index.js
  8038. var dist_src_exports = {};
  8039. __export(dist_src_exports, {
  8040. GraphqlResponseError: () => GraphqlResponseError,
  8041. graphql: () => graphql2,
  8042. withCustomRequest: () => withCustomRequest
  8043. });
  8044. module.exports = __toCommonJS(dist_src_exports);
  8045. var import_request3 = __nccwpck_require__(6234);
  8046. var import_universal_user_agent = __nccwpck_require__(5030);
  8047. // pkg/dist-src/version.js
  8048. var VERSION = "7.1.0";
  8049. // pkg/dist-src/with-defaults.js
  8050. var import_request2 = __nccwpck_require__(6234);
  8051. // pkg/dist-src/graphql.js
  8052. var import_request = __nccwpck_require__(6234);
  8053. // pkg/dist-src/error.js
  8054. function _buildMessageForResponseErrors(data) {
  8055. return `Request failed due to following response errors:
  8056. ` + data.errors.map((e) => ` - ${e.message}`).join("\n");
  8057. }
  8058. var GraphqlResponseError = class extends Error {
  8059. constructor(request2, headers, response) {
  8060. super(_buildMessageForResponseErrors(response));
  8061. this.request = request2;
  8062. this.headers = headers;
  8063. this.response = response;
  8064. this.name = "GraphqlResponseError";
  8065. this.errors = response.errors;
  8066. this.data = response.data;
  8067. if (Error.captureStackTrace) {
  8068. Error.captureStackTrace(this, this.constructor);
  8069. }
  8070. }
  8071. };
  8072. // pkg/dist-src/graphql.js
  8073. var NON_VARIABLE_OPTIONS = [
  8074. "method",
  8075. "baseUrl",
  8076. "url",
  8077. "headers",
  8078. "request",
  8079. "query",
  8080. "mediaType"
  8081. ];
  8082. var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
  8083. var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
  8084. function graphql(request2, query, options) {
  8085. if (options) {
  8086. if (typeof query === "string" && "query" in options) {
  8087. return Promise.reject(
  8088. new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
  8089. );
  8090. }
  8091. for (const key in options) {
  8092. if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
  8093. continue;
  8094. return Promise.reject(
  8095. new Error(
  8096. `[@octokit/graphql] "${key}" cannot be used as variable name`
  8097. )
  8098. );
  8099. }
  8100. }
  8101. const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
  8102. const requestOptions = Object.keys(
  8103. parsedOptions
  8104. ).reduce((result, key) => {
  8105. if (NON_VARIABLE_OPTIONS.includes(key)) {
  8106. result[key] = parsedOptions[key];
  8107. return result;
  8108. }
  8109. if (!result.variables) {
  8110. result.variables = {};
  8111. }
  8112. result.variables[key] = parsedOptions[key];
  8113. return result;
  8114. }, {});
  8115. const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
  8116. if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
  8117. requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
  8118. }
  8119. return request2(requestOptions).then((response) => {
  8120. if (response.data.errors) {
  8121. const headers = {};
  8122. for (const key of Object.keys(response.headers)) {
  8123. headers[key] = response.headers[key];
  8124. }
  8125. throw new GraphqlResponseError(
  8126. requestOptions,
  8127. headers,
  8128. response.data
  8129. );
  8130. }
  8131. return response.data.data;
  8132. });
  8133. }
  8134. // pkg/dist-src/with-defaults.js
  8135. function withDefaults(request2, newDefaults) {
  8136. const newRequest = request2.defaults(newDefaults);
  8137. const newApi = (query, options) => {
  8138. return graphql(newRequest, query, options);
  8139. };
  8140. return Object.assign(newApi, {
  8141. defaults: withDefaults.bind(null, newRequest),
  8142. endpoint: newRequest.endpoint
  8143. });
  8144. }
  8145. // pkg/dist-src/index.js
  8146. var graphql2 = withDefaults(import_request3.request, {
  8147. headers: {
  8148. "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  8149. },
  8150. method: "POST",
  8151. url: "/graphql"
  8152. });
  8153. function withCustomRequest(customRequest) {
  8154. return withDefaults(customRequest, {
  8155. method: "POST",
  8156. url: "/graphql"
  8157. });
  8158. }
  8159. // Annotate the CommonJS export names for ESM import in node:
  8160. 0 && (0);
  8161. /***/ }),
  8162. /***/ 4193:
  8163. /***/ ((module) => {
  8164. "use strict";
  8165. var __defProp = Object.defineProperty;
  8166. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8167. var __getOwnPropNames = Object.getOwnPropertyNames;
  8168. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8169. var __export = (target, all) => {
  8170. for (var name in all)
  8171. __defProp(target, name, { get: all[name], enumerable: true });
  8172. };
  8173. var __copyProps = (to, from, except, desc) => {
  8174. if (from && typeof from === "object" || typeof from === "function") {
  8175. for (let key of __getOwnPropNames(from))
  8176. if (!__hasOwnProp.call(to, key) && key !== except)
  8177. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8178. }
  8179. return to;
  8180. };
  8181. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8182. // pkg/dist-src/index.js
  8183. var dist_src_exports = {};
  8184. __export(dist_src_exports, {
  8185. composePaginateRest: () => composePaginateRest,
  8186. isPaginatingEndpoint: () => isPaginatingEndpoint,
  8187. paginateRest: () => paginateRest,
  8188. paginatingEndpoints: () => paginatingEndpoints
  8189. });
  8190. module.exports = __toCommonJS(dist_src_exports);
  8191. // pkg/dist-src/version.js
  8192. var VERSION = "9.2.2";
  8193. // pkg/dist-src/normalize-paginated-list-response.js
  8194. function normalizePaginatedListResponse(response) {
  8195. if (!response.data) {
  8196. return {
  8197. ...response,
  8198. data: []
  8199. };
  8200. }
  8201. const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
  8202. if (!responseNeedsNormalization)
  8203. return response;
  8204. const incompleteResults = response.data.incomplete_results;
  8205. const repositorySelection = response.data.repository_selection;
  8206. const totalCount = response.data.total_count;
  8207. delete response.data.incomplete_results;
  8208. delete response.data.repository_selection;
  8209. delete response.data.total_count;
  8210. const namespaceKey = Object.keys(response.data)[0];
  8211. const data = response.data[namespaceKey];
  8212. response.data = data;
  8213. if (typeof incompleteResults !== "undefined") {
  8214. response.data.incomplete_results = incompleteResults;
  8215. }
  8216. if (typeof repositorySelection !== "undefined") {
  8217. response.data.repository_selection = repositorySelection;
  8218. }
  8219. response.data.total_count = totalCount;
  8220. return response;
  8221. }
  8222. // pkg/dist-src/iterator.js
  8223. function iterator(octokit, route, parameters) {
  8224. const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
  8225. const requestMethod = typeof route === "function" ? route : octokit.request;
  8226. const method = options.method;
  8227. const headers = options.headers;
  8228. let url = options.url;
  8229. return {
  8230. [Symbol.asyncIterator]: () => ({
  8231. async next() {
  8232. if (!url)
  8233. return { done: true };
  8234. try {
  8235. const response = await requestMethod({ method, url, headers });
  8236. const normalizedResponse = normalizePaginatedListResponse(response);
  8237. url = ((normalizedResponse.headers.link || "").match(
  8238. /<([^<>]+)>;\s*rel="next"/
  8239. ) || [])[1];
  8240. return { value: normalizedResponse };
  8241. } catch (error) {
  8242. if (error.status !== 409)
  8243. throw error;
  8244. url = "";
  8245. return {
  8246. value: {
  8247. status: 200,
  8248. headers: {},
  8249. data: []
  8250. }
  8251. };
  8252. }
  8253. }
  8254. })
  8255. };
  8256. }
  8257. // pkg/dist-src/paginate.js
  8258. function paginate(octokit, route, parameters, mapFn) {
  8259. if (typeof parameters === "function") {
  8260. mapFn = parameters;
  8261. parameters = void 0;
  8262. }
  8263. return gather(
  8264. octokit,
  8265. [],
  8266. iterator(octokit, route, parameters)[Symbol.asyncIterator](),
  8267. mapFn
  8268. );
  8269. }
  8270. function gather(octokit, results, iterator2, mapFn) {
  8271. return iterator2.next().then((result) => {
  8272. if (result.done) {
  8273. return results;
  8274. }
  8275. let earlyExit = false;
  8276. function done() {
  8277. earlyExit = true;
  8278. }
  8279. results = results.concat(
  8280. mapFn ? mapFn(result.value, done) : result.value.data
  8281. );
  8282. if (earlyExit) {
  8283. return results;
  8284. }
  8285. return gather(octokit, results, iterator2, mapFn);
  8286. });
  8287. }
  8288. // pkg/dist-src/compose-paginate.js
  8289. var composePaginateRest = Object.assign(paginate, {
  8290. iterator
  8291. });
  8292. // pkg/dist-src/generated/paginating-endpoints.js
  8293. var paginatingEndpoints = [
  8294. "GET /advisories",
  8295. "GET /app/hook/deliveries",
  8296. "GET /app/installation-requests",
  8297. "GET /app/installations",
  8298. "GET /assignments/{assignment_id}/accepted_assignments",
  8299. "GET /classrooms",
  8300. "GET /classrooms/{classroom_id}/assignments",
  8301. "GET /enterprises/{enterprise}/dependabot/alerts",
  8302. "GET /enterprises/{enterprise}/secret-scanning/alerts",
  8303. "GET /events",
  8304. "GET /gists",
  8305. "GET /gists/public",
  8306. "GET /gists/starred",
  8307. "GET /gists/{gist_id}/comments",
  8308. "GET /gists/{gist_id}/commits",
  8309. "GET /gists/{gist_id}/forks",
  8310. "GET /installation/repositories",
  8311. "GET /issues",
  8312. "GET /licenses",
  8313. "GET /marketplace_listing/plans",
  8314. "GET /marketplace_listing/plans/{plan_id}/accounts",
  8315. "GET /marketplace_listing/stubbed/plans",
  8316. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
  8317. "GET /networks/{owner}/{repo}/events",
  8318. "GET /notifications",
  8319. "GET /organizations",
  8320. "GET /orgs/{org}/actions/cache/usage-by-repository",
  8321. "GET /orgs/{org}/actions/permissions/repositories",
  8322. "GET /orgs/{org}/actions/runners",
  8323. "GET /orgs/{org}/actions/secrets",
  8324. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
  8325. "GET /orgs/{org}/actions/variables",
  8326. "GET /orgs/{org}/actions/variables/{name}/repositories",
  8327. "GET /orgs/{org}/blocks",
  8328. "GET /orgs/{org}/code-scanning/alerts",
  8329. "GET /orgs/{org}/codespaces",
  8330. "GET /orgs/{org}/codespaces/secrets",
  8331. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
  8332. "GET /orgs/{org}/copilot/billing/seats",
  8333. "GET /orgs/{org}/dependabot/alerts",
  8334. "GET /orgs/{org}/dependabot/secrets",
  8335. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
  8336. "GET /orgs/{org}/events",
  8337. "GET /orgs/{org}/failed_invitations",
  8338. "GET /orgs/{org}/hooks",
  8339. "GET /orgs/{org}/hooks/{hook_id}/deliveries",
  8340. "GET /orgs/{org}/installations",
  8341. "GET /orgs/{org}/invitations",
  8342. "GET /orgs/{org}/invitations/{invitation_id}/teams",
  8343. "GET /orgs/{org}/issues",
  8344. "GET /orgs/{org}/members",
  8345. "GET /orgs/{org}/members/{username}/codespaces",
  8346. "GET /orgs/{org}/migrations",
  8347. "GET /orgs/{org}/migrations/{migration_id}/repositories",
  8348. "GET /orgs/{org}/organization-roles/{role_id}/teams",
  8349. "GET /orgs/{org}/organization-roles/{role_id}/users",
  8350. "GET /orgs/{org}/outside_collaborators",
  8351. "GET /orgs/{org}/packages",
  8352. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  8353. "GET /orgs/{org}/personal-access-token-requests",
  8354. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
  8355. "GET /orgs/{org}/personal-access-tokens",
  8356. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
  8357. "GET /orgs/{org}/projects",
  8358. "GET /orgs/{org}/properties/values",
  8359. "GET /orgs/{org}/public_members",
  8360. "GET /orgs/{org}/repos",
  8361. "GET /orgs/{org}/rulesets",
  8362. "GET /orgs/{org}/rulesets/rule-suites",
  8363. "GET /orgs/{org}/secret-scanning/alerts",
  8364. "GET /orgs/{org}/security-advisories",
  8365. "GET /orgs/{org}/teams",
  8366. "GET /orgs/{org}/teams/{team_slug}/discussions",
  8367. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
  8368. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8369. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
  8370. "GET /orgs/{org}/teams/{team_slug}/invitations",
  8371. "GET /orgs/{org}/teams/{team_slug}/members",
  8372. "GET /orgs/{org}/teams/{team_slug}/projects",
  8373. "GET /orgs/{org}/teams/{team_slug}/repos",
  8374. "GET /orgs/{org}/teams/{team_slug}/teams",
  8375. "GET /projects/columns/{column_id}/cards",
  8376. "GET /projects/{project_id}/collaborators",
  8377. "GET /projects/{project_id}/columns",
  8378. "GET /repos/{owner}/{repo}/actions/artifacts",
  8379. "GET /repos/{owner}/{repo}/actions/caches",
  8380. "GET /repos/{owner}/{repo}/actions/organization-secrets",
  8381. "GET /repos/{owner}/{repo}/actions/organization-variables",
  8382. "GET /repos/{owner}/{repo}/actions/runners",
  8383. "GET /repos/{owner}/{repo}/actions/runs",
  8384. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
  8385. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
  8386. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
  8387. "GET /repos/{owner}/{repo}/actions/secrets",
  8388. "GET /repos/{owner}/{repo}/actions/variables",
  8389. "GET /repos/{owner}/{repo}/actions/workflows",
  8390. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
  8391. "GET /repos/{owner}/{repo}/activity",
  8392. "GET /repos/{owner}/{repo}/assignees",
  8393. "GET /repos/{owner}/{repo}/branches",
  8394. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
  8395. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
  8396. "GET /repos/{owner}/{repo}/code-scanning/alerts",
  8397. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8398. "GET /repos/{owner}/{repo}/code-scanning/analyses",
  8399. "GET /repos/{owner}/{repo}/codespaces",
  8400. "GET /repos/{owner}/{repo}/codespaces/devcontainers",
  8401. "GET /repos/{owner}/{repo}/codespaces/secrets",
  8402. "GET /repos/{owner}/{repo}/collaborators",
  8403. "GET /repos/{owner}/{repo}/comments",
  8404. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
  8405. "GET /repos/{owner}/{repo}/commits",
  8406. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
  8407. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
  8408. "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
  8409. "GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
  8410. "GET /repos/{owner}/{repo}/commits/{ref}/status",
  8411. "GET /repos/{owner}/{repo}/commits/{ref}/statuses",
  8412. "GET /repos/{owner}/{repo}/contributors",
  8413. "GET /repos/{owner}/{repo}/dependabot/alerts",
  8414. "GET /repos/{owner}/{repo}/dependabot/secrets",
  8415. "GET /repos/{owner}/{repo}/deployments",
  8416. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
  8417. "GET /repos/{owner}/{repo}/environments",
  8418. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
  8419. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
  8420. "GET /repos/{owner}/{repo}/events",
  8421. "GET /repos/{owner}/{repo}/forks",
  8422. "GET /repos/{owner}/{repo}/hooks",
  8423. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
  8424. "GET /repos/{owner}/{repo}/invitations",
  8425. "GET /repos/{owner}/{repo}/issues",
  8426. "GET /repos/{owner}/{repo}/issues/comments",
  8427. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
  8428. "GET /repos/{owner}/{repo}/issues/events",
  8429. "GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
  8430. "GET /repos/{owner}/{repo}/issues/{issue_number}/events",
  8431. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
  8432. "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
  8433. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
  8434. "GET /repos/{owner}/{repo}/keys",
  8435. "GET /repos/{owner}/{repo}/labels",
  8436. "GET /repos/{owner}/{repo}/milestones",
  8437. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
  8438. "GET /repos/{owner}/{repo}/notifications",
  8439. "GET /repos/{owner}/{repo}/pages/builds",
  8440. "GET /repos/{owner}/{repo}/projects",
  8441. "GET /repos/{owner}/{repo}/pulls",
  8442. "GET /repos/{owner}/{repo}/pulls/comments",
  8443. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
  8444. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
  8445. "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
  8446. "GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
  8447. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
  8448. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
  8449. "GET /repos/{owner}/{repo}/releases",
  8450. "GET /repos/{owner}/{repo}/releases/{release_id}/assets",
  8451. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
  8452. "GET /repos/{owner}/{repo}/rules/branches/{branch}",
  8453. "GET /repos/{owner}/{repo}/rulesets",
  8454. "GET /repos/{owner}/{repo}/rulesets/rule-suites",
  8455. "GET /repos/{owner}/{repo}/secret-scanning/alerts",
  8456. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
  8457. "GET /repos/{owner}/{repo}/security-advisories",
  8458. "GET /repos/{owner}/{repo}/stargazers",
  8459. "GET /repos/{owner}/{repo}/subscribers",
  8460. "GET /repos/{owner}/{repo}/tags",
  8461. "GET /repos/{owner}/{repo}/teams",
  8462. "GET /repos/{owner}/{repo}/topics",
  8463. "GET /repositories",
  8464. "GET /repositories/{repository_id}/environments/{environment_name}/secrets",
  8465. "GET /repositories/{repository_id}/environments/{environment_name}/variables",
  8466. "GET /search/code",
  8467. "GET /search/commits",
  8468. "GET /search/issues",
  8469. "GET /search/labels",
  8470. "GET /search/repositories",
  8471. "GET /search/topics",
  8472. "GET /search/users",
  8473. "GET /teams/{team_id}/discussions",
  8474. "GET /teams/{team_id}/discussions/{discussion_number}/comments",
  8475. "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8476. "GET /teams/{team_id}/discussions/{discussion_number}/reactions",
  8477. "GET /teams/{team_id}/invitations",
  8478. "GET /teams/{team_id}/members",
  8479. "GET /teams/{team_id}/projects",
  8480. "GET /teams/{team_id}/repos",
  8481. "GET /teams/{team_id}/teams",
  8482. "GET /user/blocks",
  8483. "GET /user/codespaces",
  8484. "GET /user/codespaces/secrets",
  8485. "GET /user/emails",
  8486. "GET /user/followers",
  8487. "GET /user/following",
  8488. "GET /user/gpg_keys",
  8489. "GET /user/installations",
  8490. "GET /user/installations/{installation_id}/repositories",
  8491. "GET /user/issues",
  8492. "GET /user/keys",
  8493. "GET /user/marketplace_purchases",
  8494. "GET /user/marketplace_purchases/stubbed",
  8495. "GET /user/memberships/orgs",
  8496. "GET /user/migrations",
  8497. "GET /user/migrations/{migration_id}/repositories",
  8498. "GET /user/orgs",
  8499. "GET /user/packages",
  8500. "GET /user/packages/{package_type}/{package_name}/versions",
  8501. "GET /user/public_emails",
  8502. "GET /user/repos",
  8503. "GET /user/repository_invitations",
  8504. "GET /user/social_accounts",
  8505. "GET /user/ssh_signing_keys",
  8506. "GET /user/starred",
  8507. "GET /user/subscriptions",
  8508. "GET /user/teams",
  8509. "GET /users",
  8510. "GET /users/{username}/events",
  8511. "GET /users/{username}/events/orgs/{org}",
  8512. "GET /users/{username}/events/public",
  8513. "GET /users/{username}/followers",
  8514. "GET /users/{username}/following",
  8515. "GET /users/{username}/gists",
  8516. "GET /users/{username}/gpg_keys",
  8517. "GET /users/{username}/keys",
  8518. "GET /users/{username}/orgs",
  8519. "GET /users/{username}/packages",
  8520. "GET /users/{username}/projects",
  8521. "GET /users/{username}/received_events",
  8522. "GET /users/{username}/received_events/public",
  8523. "GET /users/{username}/repos",
  8524. "GET /users/{username}/social_accounts",
  8525. "GET /users/{username}/ssh_signing_keys",
  8526. "GET /users/{username}/starred",
  8527. "GET /users/{username}/subscriptions"
  8528. ];
  8529. // pkg/dist-src/paginating-endpoints.js
  8530. function isPaginatingEndpoint(arg) {
  8531. if (typeof arg === "string") {
  8532. return paginatingEndpoints.includes(arg);
  8533. } else {
  8534. return false;
  8535. }
  8536. }
  8537. // pkg/dist-src/index.js
  8538. function paginateRest(octokit) {
  8539. return {
  8540. paginate: Object.assign(paginate.bind(null, octokit), {
  8541. iterator: iterator.bind(null, octokit)
  8542. })
  8543. };
  8544. }
  8545. paginateRest.VERSION = VERSION;
  8546. // Annotate the CommonJS export names for ESM import in node:
  8547. 0 && (0);
  8548. /***/ }),
  8549. /***/ 3044:
  8550. /***/ ((module) => {
  8551. "use strict";
  8552. var __defProp = Object.defineProperty;
  8553. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8554. var __getOwnPropNames = Object.getOwnPropertyNames;
  8555. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8556. var __export = (target, all) => {
  8557. for (var name in all)
  8558. __defProp(target, name, { get: all[name], enumerable: true });
  8559. };
  8560. var __copyProps = (to, from, except, desc) => {
  8561. if (from && typeof from === "object" || typeof from === "function") {
  8562. for (let key of __getOwnPropNames(from))
  8563. if (!__hasOwnProp.call(to, key) && key !== except)
  8564. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8565. }
  8566. return to;
  8567. };
  8568. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8569. // pkg/dist-src/index.js
  8570. var dist_src_exports = {};
  8571. __export(dist_src_exports, {
  8572. legacyRestEndpointMethods: () => legacyRestEndpointMethods,
  8573. restEndpointMethods: () => restEndpointMethods
  8574. });
  8575. module.exports = __toCommonJS(dist_src_exports);
  8576. // pkg/dist-src/version.js
  8577. var VERSION = "10.4.1";
  8578. // pkg/dist-src/generated/endpoints.js
  8579. var Endpoints = {
  8580. actions: {
  8581. addCustomLabelsToSelfHostedRunnerForOrg: [
  8582. "POST /orgs/{org}/actions/runners/{runner_id}/labels"
  8583. ],
  8584. addCustomLabelsToSelfHostedRunnerForRepo: [
  8585. "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8586. ],
  8587. addSelectedRepoToOrgSecret: [
  8588. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8589. ],
  8590. addSelectedRepoToOrgVariable: [
  8591. "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8592. ],
  8593. approveWorkflowRun: [
  8594. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
  8595. ],
  8596. cancelWorkflowRun: [
  8597. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
  8598. ],
  8599. createEnvironmentVariable: [
  8600. "POST /repositories/{repository_id}/environments/{environment_name}/variables"
  8601. ],
  8602. createOrUpdateEnvironmentSecret: [
  8603. "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8604. ],
  8605. createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
  8606. createOrUpdateRepoSecret: [
  8607. "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8608. ],
  8609. createOrgVariable: ["POST /orgs/{org}/actions/variables"],
  8610. createRegistrationTokenForOrg: [
  8611. "POST /orgs/{org}/actions/runners/registration-token"
  8612. ],
  8613. createRegistrationTokenForRepo: [
  8614. "POST /repos/{owner}/{repo}/actions/runners/registration-token"
  8615. ],
  8616. createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
  8617. createRemoveTokenForRepo: [
  8618. "POST /repos/{owner}/{repo}/actions/runners/remove-token"
  8619. ],
  8620. createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
  8621. createWorkflowDispatch: [
  8622. "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
  8623. ],
  8624. deleteActionsCacheById: [
  8625. "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
  8626. ],
  8627. deleteActionsCacheByKey: [
  8628. "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
  8629. ],
  8630. deleteArtifact: [
  8631. "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
  8632. ],
  8633. deleteEnvironmentSecret: [
  8634. "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8635. ],
  8636. deleteEnvironmentVariable: [
  8637. "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8638. ],
  8639. deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
  8640. deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
  8641. deleteRepoSecret: [
  8642. "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8643. ],
  8644. deleteRepoVariable: [
  8645. "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
  8646. ],
  8647. deleteSelfHostedRunnerFromOrg: [
  8648. "DELETE /orgs/{org}/actions/runners/{runner_id}"
  8649. ],
  8650. deleteSelfHostedRunnerFromRepo: [
  8651. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8652. ],
  8653. deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8654. deleteWorkflowRunLogs: [
  8655. "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8656. ],
  8657. disableSelectedRepositoryGithubActionsOrganization: [
  8658. "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8659. ],
  8660. disableWorkflow: [
  8661. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
  8662. ],
  8663. downloadArtifact: [
  8664. "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
  8665. ],
  8666. downloadJobLogsForWorkflowRun: [
  8667. "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
  8668. ],
  8669. downloadWorkflowRunAttemptLogs: [
  8670. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
  8671. ],
  8672. downloadWorkflowRunLogs: [
  8673. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8674. ],
  8675. enableSelectedRepositoryGithubActionsOrganization: [
  8676. "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8677. ],
  8678. enableWorkflow: [
  8679. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
  8680. ],
  8681. forceCancelWorkflowRun: [
  8682. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
  8683. ],
  8684. generateRunnerJitconfigForOrg: [
  8685. "POST /orgs/{org}/actions/runners/generate-jitconfig"
  8686. ],
  8687. generateRunnerJitconfigForRepo: [
  8688. "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
  8689. ],
  8690. getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
  8691. getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
  8692. getActionsCacheUsageByRepoForOrg: [
  8693. "GET /orgs/{org}/actions/cache/usage-by-repository"
  8694. ],
  8695. getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
  8696. getAllowedActionsOrganization: [
  8697. "GET /orgs/{org}/actions/permissions/selected-actions"
  8698. ],
  8699. getAllowedActionsRepository: [
  8700. "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8701. ],
  8702. getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
  8703. getCustomOidcSubClaimForRepo: [
  8704. "GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8705. ],
  8706. getEnvironmentPublicKey: [
  8707. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
  8708. ],
  8709. getEnvironmentSecret: [
  8710. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8711. ],
  8712. getEnvironmentVariable: [
  8713. "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8714. ],
  8715. getGithubActionsDefaultWorkflowPermissionsOrganization: [
  8716. "GET /orgs/{org}/actions/permissions/workflow"
  8717. ],
  8718. getGithubActionsDefaultWorkflowPermissionsRepository: [
  8719. "GET /repos/{owner}/{repo}/actions/permissions/workflow"
  8720. ],
  8721. getGithubActionsPermissionsOrganization: [
  8722. "GET /orgs/{org}/actions/permissions"
  8723. ],
  8724. getGithubActionsPermissionsRepository: [
  8725. "GET /repos/{owner}/{repo}/actions/permissions"
  8726. ],
  8727. getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
  8728. getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
  8729. getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
  8730. getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
  8731. getPendingDeploymentsForRun: [
  8732. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8733. ],
  8734. getRepoPermissions: [
  8735. "GET /repos/{owner}/{repo}/actions/permissions",
  8736. {},
  8737. { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
  8738. ],
  8739. getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
  8740. getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
  8741. getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
  8742. getReviewsForRun: [
  8743. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
  8744. ],
  8745. getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
  8746. getSelfHostedRunnerForRepo: [
  8747. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8748. ],
  8749. getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
  8750. getWorkflowAccessToRepository: [
  8751. "GET /repos/{owner}/{repo}/actions/permissions/access"
  8752. ],
  8753. getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8754. getWorkflowRunAttempt: [
  8755. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
  8756. ],
  8757. getWorkflowRunUsage: [
  8758. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
  8759. ],
  8760. getWorkflowUsage: [
  8761. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
  8762. ],
  8763. listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
  8764. listEnvironmentSecrets: [
  8765. "GET /repositories/{repository_id}/environments/{environment_name}/secrets"
  8766. ],
  8767. listEnvironmentVariables: [
  8768. "GET /repositories/{repository_id}/environments/{environment_name}/variables"
  8769. ],
  8770. listJobsForWorkflowRun: [
  8771. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
  8772. ],
  8773. listJobsForWorkflowRunAttempt: [
  8774. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
  8775. ],
  8776. listLabelsForSelfHostedRunnerForOrg: [
  8777. "GET /orgs/{org}/actions/runners/{runner_id}/labels"
  8778. ],
  8779. listLabelsForSelfHostedRunnerForRepo: [
  8780. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8781. ],
  8782. listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
  8783. listOrgVariables: ["GET /orgs/{org}/actions/variables"],
  8784. listRepoOrganizationSecrets: [
  8785. "GET /repos/{owner}/{repo}/actions/organization-secrets"
  8786. ],
  8787. listRepoOrganizationVariables: [
  8788. "GET /repos/{owner}/{repo}/actions/organization-variables"
  8789. ],
  8790. listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
  8791. listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
  8792. listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
  8793. listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
  8794. listRunnerApplicationsForRepo: [
  8795. "GET /repos/{owner}/{repo}/actions/runners/downloads"
  8796. ],
  8797. listSelectedReposForOrgSecret: [
  8798. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8799. ],
  8800. listSelectedReposForOrgVariable: [
  8801. "GET /orgs/{org}/actions/variables/{name}/repositories"
  8802. ],
  8803. listSelectedRepositoriesEnabledGithubActionsOrganization: [
  8804. "GET /orgs/{org}/actions/permissions/repositories"
  8805. ],
  8806. listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
  8807. listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
  8808. listWorkflowRunArtifacts: [
  8809. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
  8810. ],
  8811. listWorkflowRuns: [
  8812. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
  8813. ],
  8814. listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
  8815. reRunJobForWorkflowRun: [
  8816. "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
  8817. ],
  8818. reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
  8819. reRunWorkflowFailedJobs: [
  8820. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
  8821. ],
  8822. removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
  8823. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
  8824. ],
  8825. removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
  8826. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8827. ],
  8828. removeCustomLabelFromSelfHostedRunnerForOrg: [
  8829. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
  8830. ],
  8831. removeCustomLabelFromSelfHostedRunnerForRepo: [
  8832. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
  8833. ],
  8834. removeSelectedRepoFromOrgSecret: [
  8835. "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8836. ],
  8837. removeSelectedRepoFromOrgVariable: [
  8838. "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8839. ],
  8840. reviewCustomGatesForRun: [
  8841. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
  8842. ],
  8843. reviewPendingDeploymentsForRun: [
  8844. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8845. ],
  8846. setAllowedActionsOrganization: [
  8847. "PUT /orgs/{org}/actions/permissions/selected-actions"
  8848. ],
  8849. setAllowedActionsRepository: [
  8850. "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8851. ],
  8852. setCustomLabelsForSelfHostedRunnerForOrg: [
  8853. "PUT /orgs/{org}/actions/runners/{runner_id}/labels"
  8854. ],
  8855. setCustomLabelsForSelfHostedRunnerForRepo: [
  8856. "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8857. ],
  8858. setCustomOidcSubClaimForRepo: [
  8859. "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8860. ],
  8861. setGithubActionsDefaultWorkflowPermissionsOrganization: [
  8862. "PUT /orgs/{org}/actions/permissions/workflow"
  8863. ],
  8864. setGithubActionsDefaultWorkflowPermissionsRepository: [
  8865. "PUT /repos/{owner}/{repo}/actions/permissions/workflow"
  8866. ],
  8867. setGithubActionsPermissionsOrganization: [
  8868. "PUT /orgs/{org}/actions/permissions"
  8869. ],
  8870. setGithubActionsPermissionsRepository: [
  8871. "PUT /repos/{owner}/{repo}/actions/permissions"
  8872. ],
  8873. setSelectedReposForOrgSecret: [
  8874. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8875. ],
  8876. setSelectedReposForOrgVariable: [
  8877. "PUT /orgs/{org}/actions/variables/{name}/repositories"
  8878. ],
  8879. setSelectedRepositoriesEnabledGithubActionsOrganization: [
  8880. "PUT /orgs/{org}/actions/permissions/repositories"
  8881. ],
  8882. setWorkflowAccessToRepository: [
  8883. "PUT /repos/{owner}/{repo}/actions/permissions/access"
  8884. ],
  8885. updateEnvironmentVariable: [
  8886. "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8887. ],
  8888. updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
  8889. updateRepoVariable: [
  8890. "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
  8891. ]
  8892. },
  8893. activity: {
  8894. checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
  8895. deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
  8896. deleteThreadSubscription: [
  8897. "DELETE /notifications/threads/{thread_id}/subscription"
  8898. ],
  8899. getFeeds: ["GET /feeds"],
  8900. getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
  8901. getThread: ["GET /notifications/threads/{thread_id}"],
  8902. getThreadSubscriptionForAuthenticatedUser: [
  8903. "GET /notifications/threads/{thread_id}/subscription"
  8904. ],
  8905. listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
  8906. listNotificationsForAuthenticatedUser: ["GET /notifications"],
  8907. listOrgEventsForAuthenticatedUser: [
  8908. "GET /users/{username}/events/orgs/{org}"
  8909. ],
  8910. listPublicEvents: ["GET /events"],
  8911. listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
  8912. listPublicEventsForUser: ["GET /users/{username}/events/public"],
  8913. listPublicOrgEvents: ["GET /orgs/{org}/events"],
  8914. listReceivedEventsForUser: ["GET /users/{username}/received_events"],
  8915. listReceivedPublicEventsForUser: [
  8916. "GET /users/{username}/received_events/public"
  8917. ],
  8918. listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
  8919. listRepoNotificationsForAuthenticatedUser: [
  8920. "GET /repos/{owner}/{repo}/notifications"
  8921. ],
  8922. listReposStarredByAuthenticatedUser: ["GET /user/starred"],
  8923. listReposStarredByUser: ["GET /users/{username}/starred"],
  8924. listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
  8925. listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
  8926. listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
  8927. listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
  8928. markNotificationsAsRead: ["PUT /notifications"],
  8929. markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
  8930. markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
  8931. markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
  8932. setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
  8933. setThreadSubscription: [
  8934. "PUT /notifications/threads/{thread_id}/subscription"
  8935. ],
  8936. starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
  8937. unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
  8938. },
  8939. apps: {
  8940. addRepoToInstallation: [
  8941. "PUT /user/installations/{installation_id}/repositories/{repository_id}",
  8942. {},
  8943. { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
  8944. ],
  8945. addRepoToInstallationForAuthenticatedUser: [
  8946. "PUT /user/installations/{installation_id}/repositories/{repository_id}"
  8947. ],
  8948. checkToken: ["POST /applications/{client_id}/token"],
  8949. createFromManifest: ["POST /app-manifests/{code}/conversions"],
  8950. createInstallationAccessToken: [
  8951. "POST /app/installations/{installation_id}/access_tokens"
  8952. ],
  8953. deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
  8954. deleteInstallation: ["DELETE /app/installations/{installation_id}"],
  8955. deleteToken: ["DELETE /applications/{client_id}/token"],
  8956. getAuthenticated: ["GET /app"],
  8957. getBySlug: ["GET /apps/{app_slug}"],
  8958. getInstallation: ["GET /app/installations/{installation_id}"],
  8959. getOrgInstallation: ["GET /orgs/{org}/installation"],
  8960. getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
  8961. getSubscriptionPlanForAccount: [
  8962. "GET /marketplace_listing/accounts/{account_id}"
  8963. ],
  8964. getSubscriptionPlanForAccountStubbed: [
  8965. "GET /marketplace_listing/stubbed/accounts/{account_id}"
  8966. ],
  8967. getUserInstallation: ["GET /users/{username}/installation"],
  8968. getWebhookConfigForApp: ["GET /app/hook/config"],
  8969. getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
  8970. listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
  8971. listAccountsForPlanStubbed: [
  8972. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
  8973. ],
  8974. listInstallationReposForAuthenticatedUser: [
  8975. "GET /user/installations/{installation_id}/repositories"
  8976. ],
  8977. listInstallationRequestsForAuthenticatedApp: [
  8978. "GET /app/installation-requests"
  8979. ],
  8980. listInstallations: ["GET /app/installations"],
  8981. listInstallationsForAuthenticatedUser: ["GET /user/installations"],
  8982. listPlans: ["GET /marketplace_listing/plans"],
  8983. listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
  8984. listReposAccessibleToInstallation: ["GET /installation/repositories"],
  8985. listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
  8986. listSubscriptionsForAuthenticatedUserStubbed: [
  8987. "GET /user/marketplace_purchases/stubbed"
  8988. ],
  8989. listWebhookDeliveries: ["GET /app/hook/deliveries"],
  8990. redeliverWebhookDelivery: [
  8991. "POST /app/hook/deliveries/{delivery_id}/attempts"
  8992. ],
  8993. removeRepoFromInstallation: [
  8994. "DELETE /user/installations/{installation_id}/repositories/{repository_id}",
  8995. {},
  8996. { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
  8997. ],
  8998. removeRepoFromInstallationForAuthenticatedUser: [
  8999. "DELETE /user/installations/{installation_id}/repositories/{repository_id}"
  9000. ],
  9001. resetToken: ["PATCH /applications/{client_id}/token"],
  9002. revokeInstallationAccessToken: ["DELETE /installation/token"],
  9003. scopeToken: ["POST /applications/{client_id}/token/scoped"],
  9004. suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
  9005. unsuspendInstallation: [
  9006. "DELETE /app/installations/{installation_id}/suspended"
  9007. ],
  9008. updateWebhookConfigForApp: ["PATCH /app/hook/config"]
  9009. },
  9010. billing: {
  9011. getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
  9012. getGithubActionsBillingUser: [
  9013. "GET /users/{username}/settings/billing/actions"
  9014. ],
  9015. getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
  9016. getGithubPackagesBillingUser: [
  9017. "GET /users/{username}/settings/billing/packages"
  9018. ],
  9019. getSharedStorageBillingOrg: [
  9020. "GET /orgs/{org}/settings/billing/shared-storage"
  9021. ],
  9022. getSharedStorageBillingUser: [
  9023. "GET /users/{username}/settings/billing/shared-storage"
  9024. ]
  9025. },
  9026. checks: {
  9027. create: ["POST /repos/{owner}/{repo}/check-runs"],
  9028. createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
  9029. get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
  9030. getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
  9031. listAnnotations: [
  9032. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
  9033. ],
  9034. listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
  9035. listForSuite: [
  9036. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
  9037. ],
  9038. listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
  9039. rerequestRun: [
  9040. "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
  9041. ],
  9042. rerequestSuite: [
  9043. "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
  9044. ],
  9045. setSuitesPreferences: [
  9046. "PATCH /repos/{owner}/{repo}/check-suites/preferences"
  9047. ],
  9048. update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
  9049. },
  9050. codeScanning: {
  9051. deleteAnalysis: [
  9052. "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
  9053. ],
  9054. getAlert: [
  9055. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
  9056. {},
  9057. { renamedParameters: { alert_id: "alert_number" } }
  9058. ],
  9059. getAnalysis: [
  9060. "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
  9061. ],
  9062. getCodeqlDatabase: [
  9063. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
  9064. ],
  9065. getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
  9066. getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
  9067. listAlertInstances: [
  9068. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
  9069. ],
  9070. listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
  9071. listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
  9072. listAlertsInstances: [
  9073. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  9074. {},
  9075. { renamed: ["codeScanning", "listAlertInstances"] }
  9076. ],
  9077. listCodeqlDatabases: [
  9078. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
  9079. ],
  9080. listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
  9081. updateAlert: [
  9082. "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
  9083. ],
  9084. updateDefaultSetup: [
  9085. "PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
  9086. ],
  9087. uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
  9088. },
  9089. codesOfConduct: {
  9090. getAllCodesOfConduct: ["GET /codes_of_conduct"],
  9091. getConductCode: ["GET /codes_of_conduct/{key}"]
  9092. },
  9093. codespaces: {
  9094. addRepositoryForSecretForAuthenticatedUser: [
  9095. "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9096. ],
  9097. addSelectedRepoToOrgSecret: [
  9098. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9099. ],
  9100. checkPermissionsForDevcontainer: [
  9101. "GET /repos/{owner}/{repo}/codespaces/permissions_check"
  9102. ],
  9103. codespaceMachinesForAuthenticatedUser: [
  9104. "GET /user/codespaces/{codespace_name}/machines"
  9105. ],
  9106. createForAuthenticatedUser: ["POST /user/codespaces"],
  9107. createOrUpdateOrgSecret: [
  9108. "PUT /orgs/{org}/codespaces/secrets/{secret_name}"
  9109. ],
  9110. createOrUpdateRepoSecret: [
  9111. "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9112. ],
  9113. createOrUpdateSecretForAuthenticatedUser: [
  9114. "PUT /user/codespaces/secrets/{secret_name}"
  9115. ],
  9116. createWithPrForAuthenticatedUser: [
  9117. "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
  9118. ],
  9119. createWithRepoForAuthenticatedUser: [
  9120. "POST /repos/{owner}/{repo}/codespaces"
  9121. ],
  9122. deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
  9123. deleteFromOrganization: [
  9124. "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
  9125. ],
  9126. deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
  9127. deleteRepoSecret: [
  9128. "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9129. ],
  9130. deleteSecretForAuthenticatedUser: [
  9131. "DELETE /user/codespaces/secrets/{secret_name}"
  9132. ],
  9133. exportForAuthenticatedUser: [
  9134. "POST /user/codespaces/{codespace_name}/exports"
  9135. ],
  9136. getCodespacesForUserInOrg: [
  9137. "GET /orgs/{org}/members/{username}/codespaces"
  9138. ],
  9139. getExportDetailsForAuthenticatedUser: [
  9140. "GET /user/codespaces/{codespace_name}/exports/{export_id}"
  9141. ],
  9142. getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
  9143. getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
  9144. getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
  9145. getPublicKeyForAuthenticatedUser: [
  9146. "GET /user/codespaces/secrets/public-key"
  9147. ],
  9148. getRepoPublicKey: [
  9149. "GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
  9150. ],
  9151. getRepoSecret: [
  9152. "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9153. ],
  9154. getSecretForAuthenticatedUser: [
  9155. "GET /user/codespaces/secrets/{secret_name}"
  9156. ],
  9157. listDevcontainersInRepositoryForAuthenticatedUser: [
  9158. "GET /repos/{owner}/{repo}/codespaces/devcontainers"
  9159. ],
  9160. listForAuthenticatedUser: ["GET /user/codespaces"],
  9161. listInOrganization: [
  9162. "GET /orgs/{org}/codespaces",
  9163. {},
  9164. { renamedParameters: { org_id: "org" } }
  9165. ],
  9166. listInRepositoryForAuthenticatedUser: [
  9167. "GET /repos/{owner}/{repo}/codespaces"
  9168. ],
  9169. listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
  9170. listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
  9171. listRepositoriesForSecretForAuthenticatedUser: [
  9172. "GET /user/codespaces/secrets/{secret_name}/repositories"
  9173. ],
  9174. listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
  9175. listSelectedReposForOrgSecret: [
  9176. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  9177. ],
  9178. preFlightWithRepoForAuthenticatedUser: [
  9179. "GET /repos/{owner}/{repo}/codespaces/new"
  9180. ],
  9181. publishForAuthenticatedUser: [
  9182. "POST /user/codespaces/{codespace_name}/publish"
  9183. ],
  9184. removeRepositoryForSecretForAuthenticatedUser: [
  9185. "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9186. ],
  9187. removeSelectedRepoFromOrgSecret: [
  9188. "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9189. ],
  9190. repoMachinesForAuthenticatedUser: [
  9191. "GET /repos/{owner}/{repo}/codespaces/machines"
  9192. ],
  9193. setRepositoriesForSecretForAuthenticatedUser: [
  9194. "PUT /user/codespaces/secrets/{secret_name}/repositories"
  9195. ],
  9196. setSelectedReposForOrgSecret: [
  9197. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  9198. ],
  9199. startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
  9200. stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
  9201. stopInOrganization: [
  9202. "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
  9203. ],
  9204. updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
  9205. },
  9206. copilot: {
  9207. addCopilotSeatsForTeams: [
  9208. "POST /orgs/{org}/copilot/billing/selected_teams"
  9209. ],
  9210. addCopilotSeatsForUsers: [
  9211. "POST /orgs/{org}/copilot/billing/selected_users"
  9212. ],
  9213. cancelCopilotSeatAssignmentForTeams: [
  9214. "DELETE /orgs/{org}/copilot/billing/selected_teams"
  9215. ],
  9216. cancelCopilotSeatAssignmentForUsers: [
  9217. "DELETE /orgs/{org}/copilot/billing/selected_users"
  9218. ],
  9219. getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
  9220. getCopilotSeatDetailsForUser: [
  9221. "GET /orgs/{org}/members/{username}/copilot"
  9222. ],
  9223. listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
  9224. },
  9225. dependabot: {
  9226. addSelectedRepoToOrgSecret: [
  9227. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  9228. ],
  9229. createOrUpdateOrgSecret: [
  9230. "PUT /orgs/{org}/dependabot/secrets/{secret_name}"
  9231. ],
  9232. createOrUpdateRepoSecret: [
  9233. "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9234. ],
  9235. deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
  9236. deleteRepoSecret: [
  9237. "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9238. ],
  9239. getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
  9240. getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
  9241. getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
  9242. getRepoPublicKey: [
  9243. "GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
  9244. ],
  9245. getRepoSecret: [
  9246. "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9247. ],
  9248. listAlertsForEnterprise: [
  9249. "GET /enterprises/{enterprise}/dependabot/alerts"
  9250. ],
  9251. listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
  9252. listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
  9253. listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
  9254. listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
  9255. listSelectedReposForOrgSecret: [
  9256. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  9257. ],
  9258. removeSelectedRepoFromOrgSecret: [
  9259. "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  9260. ],
  9261. setSelectedReposForOrgSecret: [
  9262. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  9263. ],
  9264. updateAlert: [
  9265. "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
  9266. ]
  9267. },
  9268. dependencyGraph: {
  9269. createRepositorySnapshot: [
  9270. "POST /repos/{owner}/{repo}/dependency-graph/snapshots"
  9271. ],
  9272. diffRange: [
  9273. "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
  9274. ],
  9275. exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
  9276. },
  9277. emojis: { get: ["GET /emojis"] },
  9278. gists: {
  9279. checkIsStarred: ["GET /gists/{gist_id}/star"],
  9280. create: ["POST /gists"],
  9281. createComment: ["POST /gists/{gist_id}/comments"],
  9282. delete: ["DELETE /gists/{gist_id}"],
  9283. deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
  9284. fork: ["POST /gists/{gist_id}/forks"],
  9285. get: ["GET /gists/{gist_id}"],
  9286. getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
  9287. getRevision: ["GET /gists/{gist_id}/{sha}"],
  9288. list: ["GET /gists"],
  9289. listComments: ["GET /gists/{gist_id}/comments"],
  9290. listCommits: ["GET /gists/{gist_id}/commits"],
  9291. listForUser: ["GET /users/{username}/gists"],
  9292. listForks: ["GET /gists/{gist_id}/forks"],
  9293. listPublic: ["GET /gists/public"],
  9294. listStarred: ["GET /gists/starred"],
  9295. star: ["PUT /gists/{gist_id}/star"],
  9296. unstar: ["DELETE /gists/{gist_id}/star"],
  9297. update: ["PATCH /gists/{gist_id}"],
  9298. updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
  9299. },
  9300. git: {
  9301. createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
  9302. createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
  9303. createRef: ["POST /repos/{owner}/{repo}/git/refs"],
  9304. createTag: ["POST /repos/{owner}/{repo}/git/tags"],
  9305. createTree: ["POST /repos/{owner}/{repo}/git/trees"],
  9306. deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
  9307. getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
  9308. getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
  9309. getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
  9310. getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
  9311. getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
  9312. listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
  9313. updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
  9314. },
  9315. gitignore: {
  9316. getAllTemplates: ["GET /gitignore/templates"],
  9317. getTemplate: ["GET /gitignore/templates/{name}"]
  9318. },
  9319. interactions: {
  9320. getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
  9321. getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
  9322. getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
  9323. getRestrictionsForYourPublicRepos: [
  9324. "GET /user/interaction-limits",
  9325. {},
  9326. { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
  9327. ],
  9328. removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
  9329. removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
  9330. removeRestrictionsForRepo: [
  9331. "DELETE /repos/{owner}/{repo}/interaction-limits"
  9332. ],
  9333. removeRestrictionsForYourPublicRepos: [
  9334. "DELETE /user/interaction-limits",
  9335. {},
  9336. { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
  9337. ],
  9338. setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
  9339. setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
  9340. setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
  9341. setRestrictionsForYourPublicRepos: [
  9342. "PUT /user/interaction-limits",
  9343. {},
  9344. { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
  9345. ]
  9346. },
  9347. issues: {
  9348. addAssignees: [
  9349. "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9350. ],
  9351. addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9352. checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
  9353. checkUserCanBeAssignedToIssue: [
  9354. "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
  9355. ],
  9356. create: ["POST /repos/{owner}/{repo}/issues"],
  9357. createComment: [
  9358. "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
  9359. ],
  9360. createLabel: ["POST /repos/{owner}/{repo}/labels"],
  9361. createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
  9362. deleteComment: [
  9363. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
  9364. ],
  9365. deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
  9366. deleteMilestone: [
  9367. "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
  9368. ],
  9369. get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
  9370. getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9371. getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
  9372. getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
  9373. getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
  9374. list: ["GET /issues"],
  9375. listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
  9376. listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
  9377. listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
  9378. listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
  9379. listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
  9380. listEventsForTimeline: [
  9381. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
  9382. ],
  9383. listForAuthenticatedUser: ["GET /user/issues"],
  9384. listForOrg: ["GET /orgs/{org}/issues"],
  9385. listForRepo: ["GET /repos/{owner}/{repo}/issues"],
  9386. listLabelsForMilestone: [
  9387. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
  9388. ],
  9389. listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
  9390. listLabelsOnIssue: [
  9391. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9392. ],
  9393. listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
  9394. lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9395. removeAllLabels: [
  9396. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9397. ],
  9398. removeAssignees: [
  9399. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9400. ],
  9401. removeLabel: [
  9402. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
  9403. ],
  9404. setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9405. unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9406. update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
  9407. updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9408. updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
  9409. updateMilestone: [
  9410. "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
  9411. ]
  9412. },
  9413. licenses: {
  9414. get: ["GET /licenses/{license}"],
  9415. getAllCommonlyUsed: ["GET /licenses"],
  9416. getForRepo: ["GET /repos/{owner}/{repo}/license"]
  9417. },
  9418. markdown: {
  9419. render: ["POST /markdown"],
  9420. renderRaw: [
  9421. "POST /markdown/raw",
  9422. { headers: { "content-type": "text/plain; charset=utf-8" } }
  9423. ]
  9424. },
  9425. meta: {
  9426. get: ["GET /meta"],
  9427. getAllVersions: ["GET /versions"],
  9428. getOctocat: ["GET /octocat"],
  9429. getZen: ["GET /zen"],
  9430. root: ["GET /"]
  9431. },
  9432. migrations: {
  9433. cancelImport: [
  9434. "DELETE /repos/{owner}/{repo}/import",
  9435. {},
  9436. {
  9437. deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
  9438. }
  9439. ],
  9440. deleteArchiveForAuthenticatedUser: [
  9441. "DELETE /user/migrations/{migration_id}/archive"
  9442. ],
  9443. deleteArchiveForOrg: [
  9444. "DELETE /orgs/{org}/migrations/{migration_id}/archive"
  9445. ],
  9446. downloadArchiveForOrg: [
  9447. "GET /orgs/{org}/migrations/{migration_id}/archive"
  9448. ],
  9449. getArchiveForAuthenticatedUser: [
  9450. "GET /user/migrations/{migration_id}/archive"
  9451. ],
  9452. getCommitAuthors: [
  9453. "GET /repos/{owner}/{repo}/import/authors",
  9454. {},
  9455. {
  9456. deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
  9457. }
  9458. ],
  9459. getImportStatus: [
  9460. "GET /repos/{owner}/{repo}/import",
  9461. {},
  9462. {
  9463. deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
  9464. }
  9465. ],
  9466. getLargeFiles: [
  9467. "GET /repos/{owner}/{repo}/import/large_files",
  9468. {},
  9469. {
  9470. deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
  9471. }
  9472. ],
  9473. getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
  9474. getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
  9475. listForAuthenticatedUser: ["GET /user/migrations"],
  9476. listForOrg: ["GET /orgs/{org}/migrations"],
  9477. listReposForAuthenticatedUser: [
  9478. "GET /user/migrations/{migration_id}/repositories"
  9479. ],
  9480. listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
  9481. listReposForUser: [
  9482. "GET /user/migrations/{migration_id}/repositories",
  9483. {},
  9484. { renamed: ["migrations", "listReposForAuthenticatedUser"] }
  9485. ],
  9486. mapCommitAuthor: [
  9487. "PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
  9488. {},
  9489. {
  9490. deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
  9491. }
  9492. ],
  9493. setLfsPreference: [
  9494. "PATCH /repos/{owner}/{repo}/import/lfs",
  9495. {},
  9496. {
  9497. deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
  9498. }
  9499. ],
  9500. startForAuthenticatedUser: ["POST /user/migrations"],
  9501. startForOrg: ["POST /orgs/{org}/migrations"],
  9502. startImport: [
  9503. "PUT /repos/{owner}/{repo}/import",
  9504. {},
  9505. {
  9506. deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
  9507. }
  9508. ],
  9509. unlockRepoForAuthenticatedUser: [
  9510. "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
  9511. ],
  9512. unlockRepoForOrg: [
  9513. "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
  9514. ],
  9515. updateImport: [
  9516. "PATCH /repos/{owner}/{repo}/import",
  9517. {},
  9518. {
  9519. deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
  9520. }
  9521. ]
  9522. },
  9523. oidc: {
  9524. getOidcCustomSubTemplateForOrg: [
  9525. "GET /orgs/{org}/actions/oidc/customization/sub"
  9526. ],
  9527. updateOidcCustomSubTemplateForOrg: [
  9528. "PUT /orgs/{org}/actions/oidc/customization/sub"
  9529. ]
  9530. },
  9531. orgs: {
  9532. addSecurityManagerTeam: [
  9533. "PUT /orgs/{org}/security-managers/teams/{team_slug}"
  9534. ],
  9535. assignTeamToOrgRole: [
  9536. "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9537. ],
  9538. assignUserToOrgRole: [
  9539. "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9540. ],
  9541. blockUser: ["PUT /orgs/{org}/blocks/{username}"],
  9542. cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
  9543. checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
  9544. checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
  9545. checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
  9546. convertMemberToOutsideCollaborator: [
  9547. "PUT /orgs/{org}/outside_collaborators/{username}"
  9548. ],
  9549. createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
  9550. createInvitation: ["POST /orgs/{org}/invitations"],
  9551. createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
  9552. createOrUpdateCustomPropertiesValuesForRepos: [
  9553. "PATCH /orgs/{org}/properties/values"
  9554. ],
  9555. createOrUpdateCustomProperty: [
  9556. "PUT /orgs/{org}/properties/schema/{custom_property_name}"
  9557. ],
  9558. createWebhook: ["POST /orgs/{org}/hooks"],
  9559. delete: ["DELETE /orgs/{org}"],
  9560. deleteCustomOrganizationRole: [
  9561. "DELETE /orgs/{org}/organization-roles/{role_id}"
  9562. ],
  9563. deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
  9564. enableOrDisableSecurityProductOnAllOrgRepos: [
  9565. "POST /orgs/{org}/{security_product}/{enablement}"
  9566. ],
  9567. get: ["GET /orgs/{org}"],
  9568. getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
  9569. getCustomProperty: [
  9570. "GET /orgs/{org}/properties/schema/{custom_property_name}"
  9571. ],
  9572. getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
  9573. getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
  9574. getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
  9575. getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
  9576. getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
  9577. getWebhookDelivery: [
  9578. "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
  9579. ],
  9580. list: ["GET /organizations"],
  9581. listAppInstallations: ["GET /orgs/{org}/installations"],
  9582. listBlockedUsers: ["GET /orgs/{org}/blocks"],
  9583. listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
  9584. listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
  9585. listForAuthenticatedUser: ["GET /user/orgs"],
  9586. listForUser: ["GET /users/{username}/orgs"],
  9587. listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
  9588. listMembers: ["GET /orgs/{org}/members"],
  9589. listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
  9590. listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
  9591. listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
  9592. listOrgRoles: ["GET /orgs/{org}/organization-roles"],
  9593. listOrganizationFineGrainedPermissions: [
  9594. "GET /orgs/{org}/organization-fine-grained-permissions"
  9595. ],
  9596. listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
  9597. listPatGrantRepositories: [
  9598. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
  9599. ],
  9600. listPatGrantRequestRepositories: [
  9601. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
  9602. ],
  9603. listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
  9604. listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
  9605. listPendingInvitations: ["GET /orgs/{org}/invitations"],
  9606. listPublicMembers: ["GET /orgs/{org}/public_members"],
  9607. listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
  9608. listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
  9609. listWebhooks: ["GET /orgs/{org}/hooks"],
  9610. patchCustomOrganizationRole: [
  9611. "PATCH /orgs/{org}/organization-roles/{role_id}"
  9612. ],
  9613. pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
  9614. redeliverWebhookDelivery: [
  9615. "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9616. ],
  9617. removeCustomProperty: [
  9618. "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
  9619. ],
  9620. removeMember: ["DELETE /orgs/{org}/members/{username}"],
  9621. removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
  9622. removeOutsideCollaborator: [
  9623. "DELETE /orgs/{org}/outside_collaborators/{username}"
  9624. ],
  9625. removePublicMembershipForAuthenticatedUser: [
  9626. "DELETE /orgs/{org}/public_members/{username}"
  9627. ],
  9628. removeSecurityManagerTeam: [
  9629. "DELETE /orgs/{org}/security-managers/teams/{team_slug}"
  9630. ],
  9631. reviewPatGrantRequest: [
  9632. "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
  9633. ],
  9634. reviewPatGrantRequestsInBulk: [
  9635. "POST /orgs/{org}/personal-access-token-requests"
  9636. ],
  9637. revokeAllOrgRolesTeam: [
  9638. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
  9639. ],
  9640. revokeAllOrgRolesUser: [
  9641. "DELETE /orgs/{org}/organization-roles/users/{username}"
  9642. ],
  9643. revokeOrgRoleTeam: [
  9644. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9645. ],
  9646. revokeOrgRoleUser: [
  9647. "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9648. ],
  9649. setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
  9650. setPublicMembershipForAuthenticatedUser: [
  9651. "PUT /orgs/{org}/public_members/{username}"
  9652. ],
  9653. unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
  9654. update: ["PATCH /orgs/{org}"],
  9655. updateMembershipForAuthenticatedUser: [
  9656. "PATCH /user/memberships/orgs/{org}"
  9657. ],
  9658. updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
  9659. updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
  9660. updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
  9661. updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
  9662. },
  9663. packages: {
  9664. deletePackageForAuthenticatedUser: [
  9665. "DELETE /user/packages/{package_type}/{package_name}"
  9666. ],
  9667. deletePackageForOrg: [
  9668. "DELETE /orgs/{org}/packages/{package_type}/{package_name}"
  9669. ],
  9670. deletePackageForUser: [
  9671. "DELETE /users/{username}/packages/{package_type}/{package_name}"
  9672. ],
  9673. deletePackageVersionForAuthenticatedUser: [
  9674. "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9675. ],
  9676. deletePackageVersionForOrg: [
  9677. "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9678. ],
  9679. deletePackageVersionForUser: [
  9680. "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9681. ],
  9682. getAllPackageVersionsForAPackageOwnedByAnOrg: [
  9683. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  9684. {},
  9685. { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
  9686. ],
  9687. getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
  9688. "GET /user/packages/{package_type}/{package_name}/versions",
  9689. {},
  9690. {
  9691. renamed: [
  9692. "packages",
  9693. "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
  9694. ]
  9695. }
  9696. ],
  9697. getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
  9698. "GET /user/packages/{package_type}/{package_name}/versions"
  9699. ],
  9700. getAllPackageVersionsForPackageOwnedByOrg: [
  9701. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
  9702. ],
  9703. getAllPackageVersionsForPackageOwnedByUser: [
  9704. "GET /users/{username}/packages/{package_type}/{package_name}/versions"
  9705. ],
  9706. getPackageForAuthenticatedUser: [
  9707. "GET /user/packages/{package_type}/{package_name}"
  9708. ],
  9709. getPackageForOrganization: [
  9710. "GET /orgs/{org}/packages/{package_type}/{package_name}"
  9711. ],
  9712. getPackageForUser: [
  9713. "GET /users/{username}/packages/{package_type}/{package_name}"
  9714. ],
  9715. getPackageVersionForAuthenticatedUser: [
  9716. "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9717. ],
  9718. getPackageVersionForOrganization: [
  9719. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9720. ],
  9721. getPackageVersionForUser: [
  9722. "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9723. ],
  9724. listDockerMigrationConflictingPackagesForAuthenticatedUser: [
  9725. "GET /user/docker/conflicts"
  9726. ],
  9727. listDockerMigrationConflictingPackagesForOrganization: [
  9728. "GET /orgs/{org}/docker/conflicts"
  9729. ],
  9730. listDockerMigrationConflictingPackagesForUser: [
  9731. "GET /users/{username}/docker/conflicts"
  9732. ],
  9733. listPackagesForAuthenticatedUser: ["GET /user/packages"],
  9734. listPackagesForOrganization: ["GET /orgs/{org}/packages"],
  9735. listPackagesForUser: ["GET /users/{username}/packages"],
  9736. restorePackageForAuthenticatedUser: [
  9737. "POST /user/packages/{package_type}/{package_name}/restore{?token}"
  9738. ],
  9739. restorePackageForOrg: [
  9740. "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
  9741. ],
  9742. restorePackageForUser: [
  9743. "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
  9744. ],
  9745. restorePackageVersionForAuthenticatedUser: [
  9746. "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9747. ],
  9748. restorePackageVersionForOrg: [
  9749. "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9750. ],
  9751. restorePackageVersionForUser: [
  9752. "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9753. ]
  9754. },
  9755. projects: {
  9756. addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
  9757. createCard: ["POST /projects/columns/{column_id}/cards"],
  9758. createColumn: ["POST /projects/{project_id}/columns"],
  9759. createForAuthenticatedUser: ["POST /user/projects"],
  9760. createForOrg: ["POST /orgs/{org}/projects"],
  9761. createForRepo: ["POST /repos/{owner}/{repo}/projects"],
  9762. delete: ["DELETE /projects/{project_id}"],
  9763. deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
  9764. deleteColumn: ["DELETE /projects/columns/{column_id}"],
  9765. get: ["GET /projects/{project_id}"],
  9766. getCard: ["GET /projects/columns/cards/{card_id}"],
  9767. getColumn: ["GET /projects/columns/{column_id}"],
  9768. getPermissionForUser: [
  9769. "GET /projects/{project_id}/collaborators/{username}/permission"
  9770. ],
  9771. listCards: ["GET /projects/columns/{column_id}/cards"],
  9772. listCollaborators: ["GET /projects/{project_id}/collaborators"],
  9773. listColumns: ["GET /projects/{project_id}/columns"],
  9774. listForOrg: ["GET /orgs/{org}/projects"],
  9775. listForRepo: ["GET /repos/{owner}/{repo}/projects"],
  9776. listForUser: ["GET /users/{username}/projects"],
  9777. moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
  9778. moveColumn: ["POST /projects/columns/{column_id}/moves"],
  9779. removeCollaborator: [
  9780. "DELETE /projects/{project_id}/collaborators/{username}"
  9781. ],
  9782. update: ["PATCH /projects/{project_id}"],
  9783. updateCard: ["PATCH /projects/columns/cards/{card_id}"],
  9784. updateColumn: ["PATCH /projects/columns/{column_id}"]
  9785. },
  9786. pulls: {
  9787. checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9788. create: ["POST /repos/{owner}/{repo}/pulls"],
  9789. createReplyForReviewComment: [
  9790. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
  9791. ],
  9792. createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9793. createReviewComment: [
  9794. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9795. ],
  9796. deletePendingReview: [
  9797. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9798. ],
  9799. deleteReviewComment: [
  9800. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9801. ],
  9802. dismissReview: [
  9803. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
  9804. ],
  9805. get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
  9806. getReview: [
  9807. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9808. ],
  9809. getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
  9810. list: ["GET /repos/{owner}/{repo}/pulls"],
  9811. listCommentsForReview: [
  9812. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
  9813. ],
  9814. listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
  9815. listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
  9816. listRequestedReviewers: [
  9817. "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9818. ],
  9819. listReviewComments: [
  9820. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9821. ],
  9822. listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
  9823. listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9824. merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9825. removeRequestedReviewers: [
  9826. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9827. ],
  9828. requestReviewers: [
  9829. "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9830. ],
  9831. submitReview: [
  9832. "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
  9833. ],
  9834. update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
  9835. updateBranch: [
  9836. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
  9837. ],
  9838. updateReview: [
  9839. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9840. ],
  9841. updateReviewComment: [
  9842. "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9843. ]
  9844. },
  9845. rateLimit: { get: ["GET /rate_limit"] },
  9846. reactions: {
  9847. createForCommitComment: [
  9848. "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9849. ],
  9850. createForIssue: [
  9851. "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
  9852. ],
  9853. createForIssueComment: [
  9854. "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9855. ],
  9856. createForPullRequestReviewComment: [
  9857. "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9858. ],
  9859. createForRelease: [
  9860. "POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9861. ],
  9862. createForTeamDiscussionCommentInOrg: [
  9863. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9864. ],
  9865. createForTeamDiscussionInOrg: [
  9866. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9867. ],
  9868. deleteForCommitComment: [
  9869. "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
  9870. ],
  9871. deleteForIssue: [
  9872. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
  9873. ],
  9874. deleteForIssueComment: [
  9875. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
  9876. ],
  9877. deleteForPullRequestComment: [
  9878. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
  9879. ],
  9880. deleteForRelease: [
  9881. "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
  9882. ],
  9883. deleteForTeamDiscussion: [
  9884. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
  9885. ],
  9886. deleteForTeamDiscussionComment: [
  9887. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
  9888. ],
  9889. listForCommitComment: [
  9890. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9891. ],
  9892. listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
  9893. listForIssueComment: [
  9894. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9895. ],
  9896. listForPullRequestReviewComment: [
  9897. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9898. ],
  9899. listForRelease: [
  9900. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9901. ],
  9902. listForTeamDiscussionCommentInOrg: [
  9903. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9904. ],
  9905. listForTeamDiscussionInOrg: [
  9906. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9907. ]
  9908. },
  9909. repos: {
  9910. acceptInvitation: [
  9911. "PATCH /user/repository_invitations/{invitation_id}",
  9912. {},
  9913. { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
  9914. ],
  9915. acceptInvitationForAuthenticatedUser: [
  9916. "PATCH /user/repository_invitations/{invitation_id}"
  9917. ],
  9918. addAppAccessRestrictions: [
  9919. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9920. {},
  9921. { mapToData: "apps" }
  9922. ],
  9923. addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
  9924. addStatusCheckContexts: [
  9925. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9926. {},
  9927. { mapToData: "contexts" }
  9928. ],
  9929. addTeamAccessRestrictions: [
  9930. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9931. {},
  9932. { mapToData: "teams" }
  9933. ],
  9934. addUserAccessRestrictions: [
  9935. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9936. {},
  9937. { mapToData: "users" }
  9938. ],
  9939. cancelPagesDeployment: [
  9940. "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
  9941. ],
  9942. checkAutomatedSecurityFixes: [
  9943. "GET /repos/{owner}/{repo}/automated-security-fixes"
  9944. ],
  9945. checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
  9946. checkVulnerabilityAlerts: [
  9947. "GET /repos/{owner}/{repo}/vulnerability-alerts"
  9948. ],
  9949. codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
  9950. compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
  9951. compareCommitsWithBasehead: [
  9952. "GET /repos/{owner}/{repo}/compare/{basehead}"
  9953. ],
  9954. createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
  9955. createCommitComment: [
  9956. "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  9957. ],
  9958. createCommitSignatureProtection: [
  9959. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9960. ],
  9961. createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
  9962. createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
  9963. createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
  9964. createDeploymentBranchPolicy: [
  9965. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  9966. ],
  9967. createDeploymentProtectionRule: [
  9968. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  9969. ],
  9970. createDeploymentStatus: [
  9971. "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  9972. ],
  9973. createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
  9974. createForAuthenticatedUser: ["POST /user/repos"],
  9975. createFork: ["POST /repos/{owner}/{repo}/forks"],
  9976. createInOrg: ["POST /orgs/{org}/repos"],
  9977. createOrUpdateCustomPropertiesValues: [
  9978. "PATCH /repos/{owner}/{repo}/properties/values"
  9979. ],
  9980. createOrUpdateEnvironment: [
  9981. "PUT /repos/{owner}/{repo}/environments/{environment_name}"
  9982. ],
  9983. createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
  9984. createOrgRuleset: ["POST /orgs/{org}/rulesets"],
  9985. createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
  9986. createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
  9987. createRelease: ["POST /repos/{owner}/{repo}/releases"],
  9988. createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
  9989. createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
  9990. createUsingTemplate: [
  9991. "POST /repos/{template_owner}/{template_repo}/generate"
  9992. ],
  9993. createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
  9994. declineInvitation: [
  9995. "DELETE /user/repository_invitations/{invitation_id}",
  9996. {},
  9997. { renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
  9998. ],
  9999. declineInvitationForAuthenticatedUser: [
  10000. "DELETE /user/repository_invitations/{invitation_id}"
  10001. ],
  10002. delete: ["DELETE /repos/{owner}/{repo}"],
  10003. deleteAccessRestrictions: [
  10004. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  10005. ],
  10006. deleteAdminBranchProtection: [
  10007. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  10008. ],
  10009. deleteAnEnvironment: [
  10010. "DELETE /repos/{owner}/{repo}/environments/{environment_name}"
  10011. ],
  10012. deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  10013. deleteBranchProtection: [
  10014. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
  10015. ],
  10016. deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
  10017. deleteCommitSignatureProtection: [
  10018. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  10019. ],
  10020. deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
  10021. deleteDeployment: [
  10022. "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
  10023. ],
  10024. deleteDeploymentBranchPolicy: [
  10025. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10026. ],
  10027. deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
  10028. deleteInvitation: [
  10029. "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
  10030. ],
  10031. deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
  10032. deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
  10033. deletePullRequestReviewProtection: [
  10034. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10035. ],
  10036. deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
  10037. deleteReleaseAsset: [
  10038. "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
  10039. ],
  10040. deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10041. deleteTagProtection: [
  10042. "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
  10043. ],
  10044. deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
  10045. disableAutomatedSecurityFixes: [
  10046. "DELETE /repos/{owner}/{repo}/automated-security-fixes"
  10047. ],
  10048. disableDeploymentProtectionRule: [
  10049. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  10050. ],
  10051. disablePrivateVulnerabilityReporting: [
  10052. "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
  10053. ],
  10054. disableVulnerabilityAlerts: [
  10055. "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
  10056. ],
  10057. downloadArchive: [
  10058. "GET /repos/{owner}/{repo}/zipball/{ref}",
  10059. {},
  10060. { renamed: ["repos", "downloadZipballArchive"] }
  10061. ],
  10062. downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
  10063. downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
  10064. enableAutomatedSecurityFixes: [
  10065. "PUT /repos/{owner}/{repo}/automated-security-fixes"
  10066. ],
  10067. enablePrivateVulnerabilityReporting: [
  10068. "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
  10069. ],
  10070. enableVulnerabilityAlerts: [
  10071. "PUT /repos/{owner}/{repo}/vulnerability-alerts"
  10072. ],
  10073. generateReleaseNotes: [
  10074. "POST /repos/{owner}/{repo}/releases/generate-notes"
  10075. ],
  10076. get: ["GET /repos/{owner}/{repo}"],
  10077. getAccessRestrictions: [
  10078. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  10079. ],
  10080. getAdminBranchProtection: [
  10081. "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  10082. ],
  10083. getAllDeploymentProtectionRules: [
  10084. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  10085. ],
  10086. getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
  10087. getAllStatusCheckContexts: [
  10088. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
  10089. ],
  10090. getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
  10091. getAppsWithAccessToProtectedBranch: [
  10092. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
  10093. ],
  10094. getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  10095. getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
  10096. getBranchProtection: [
  10097. "GET /repos/{owner}/{repo}/branches/{branch}/protection"
  10098. ],
  10099. getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
  10100. getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
  10101. getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
  10102. getCollaboratorPermissionLevel: [
  10103. "GET /repos/{owner}/{repo}/collaborators/{username}/permission"
  10104. ],
  10105. getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
  10106. getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
  10107. getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
  10108. getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
  10109. getCommitSignatureProtection: [
  10110. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  10111. ],
  10112. getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
  10113. getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
  10114. getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
  10115. getCustomDeploymentProtectionRule: [
  10116. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  10117. ],
  10118. getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
  10119. getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
  10120. getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
  10121. getDeploymentBranchPolicy: [
  10122. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10123. ],
  10124. getDeploymentStatus: [
  10125. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
  10126. ],
  10127. getEnvironment: [
  10128. "GET /repos/{owner}/{repo}/environments/{environment_name}"
  10129. ],
  10130. getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
  10131. getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
  10132. getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
  10133. getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
  10134. getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
  10135. getOrgRulesets: ["GET /orgs/{org}/rulesets"],
  10136. getPages: ["GET /repos/{owner}/{repo}/pages"],
  10137. getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
  10138. getPagesDeployment: [
  10139. "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
  10140. ],
  10141. getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
  10142. getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
  10143. getPullRequestReviewProtection: [
  10144. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10145. ],
  10146. getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
  10147. getReadme: ["GET /repos/{owner}/{repo}/readme"],
  10148. getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
  10149. getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
  10150. getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
  10151. getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
  10152. getRepoRuleSuite: [
  10153. "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
  10154. ],
  10155. getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
  10156. getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10157. getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
  10158. getStatusChecksProtection: [
  10159. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10160. ],
  10161. getTeamsWithAccessToProtectedBranch: [
  10162. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
  10163. ],
  10164. getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
  10165. getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
  10166. getUsersWithAccessToProtectedBranch: [
  10167. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
  10168. ],
  10169. getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
  10170. getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
  10171. getWebhookConfigForRepo: [
  10172. "GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10173. ],
  10174. getWebhookDelivery: [
  10175. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
  10176. ],
  10177. listActivities: ["GET /repos/{owner}/{repo}/activity"],
  10178. listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
  10179. listBranches: ["GET /repos/{owner}/{repo}/branches"],
  10180. listBranchesForHeadCommit: [
  10181. "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
  10182. ],
  10183. listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
  10184. listCommentsForCommit: [
  10185. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  10186. ],
  10187. listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
  10188. listCommitStatusesForRef: [
  10189. "GET /repos/{owner}/{repo}/commits/{ref}/statuses"
  10190. ],
  10191. listCommits: ["GET /repos/{owner}/{repo}/commits"],
  10192. listContributors: ["GET /repos/{owner}/{repo}/contributors"],
  10193. listCustomDeploymentRuleIntegrations: [
  10194. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
  10195. ],
  10196. listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
  10197. listDeploymentBranchPolicies: [
  10198. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  10199. ],
  10200. listDeploymentStatuses: [
  10201. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  10202. ],
  10203. listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
  10204. listForAuthenticatedUser: ["GET /user/repos"],
  10205. listForOrg: ["GET /orgs/{org}/repos"],
  10206. listForUser: ["GET /users/{username}/repos"],
  10207. listForks: ["GET /repos/{owner}/{repo}/forks"],
  10208. listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
  10209. listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
  10210. listLanguages: ["GET /repos/{owner}/{repo}/languages"],
  10211. listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
  10212. listPublic: ["GET /repositories"],
  10213. listPullRequestsAssociatedWithCommit: [
  10214. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
  10215. ],
  10216. listReleaseAssets: [
  10217. "GET /repos/{owner}/{repo}/releases/{release_id}/assets"
  10218. ],
  10219. listReleases: ["GET /repos/{owner}/{repo}/releases"],
  10220. listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
  10221. listTags: ["GET /repos/{owner}/{repo}/tags"],
  10222. listTeams: ["GET /repos/{owner}/{repo}/teams"],
  10223. listWebhookDeliveries: [
  10224. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
  10225. ],
  10226. listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
  10227. merge: ["POST /repos/{owner}/{repo}/merges"],
  10228. mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
  10229. pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
  10230. redeliverWebhookDelivery: [
  10231. "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  10232. ],
  10233. removeAppAccessRestrictions: [
  10234. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  10235. {},
  10236. { mapToData: "apps" }
  10237. ],
  10238. removeCollaborator: [
  10239. "DELETE /repos/{owner}/{repo}/collaborators/{username}"
  10240. ],
  10241. removeStatusCheckContexts: [
  10242. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  10243. {},
  10244. { mapToData: "contexts" }
  10245. ],
  10246. removeStatusCheckProtection: [
  10247. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10248. ],
  10249. removeTeamAccessRestrictions: [
  10250. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  10251. {},
  10252. { mapToData: "teams" }
  10253. ],
  10254. removeUserAccessRestrictions: [
  10255. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  10256. {},
  10257. { mapToData: "users" }
  10258. ],
  10259. renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
  10260. replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
  10261. requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
  10262. setAdminBranchProtection: [
  10263. "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  10264. ],
  10265. setAppAccessRestrictions: [
  10266. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  10267. {},
  10268. { mapToData: "apps" }
  10269. ],
  10270. setStatusCheckContexts: [
  10271. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  10272. {},
  10273. { mapToData: "contexts" }
  10274. ],
  10275. setTeamAccessRestrictions: [
  10276. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  10277. {},
  10278. { mapToData: "teams" }
  10279. ],
  10280. setUserAccessRestrictions: [
  10281. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  10282. {},
  10283. { mapToData: "users" }
  10284. ],
  10285. testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
  10286. transfer: ["POST /repos/{owner}/{repo}/transfer"],
  10287. update: ["PATCH /repos/{owner}/{repo}"],
  10288. updateBranchProtection: [
  10289. "PUT /repos/{owner}/{repo}/branches/{branch}/protection"
  10290. ],
  10291. updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
  10292. updateDeploymentBranchPolicy: [
  10293. "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10294. ],
  10295. updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
  10296. updateInvitation: [
  10297. "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
  10298. ],
  10299. updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
  10300. updatePullRequestReviewProtection: [
  10301. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10302. ],
  10303. updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
  10304. updateReleaseAsset: [
  10305. "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
  10306. ],
  10307. updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10308. updateStatusCheckPotection: [
  10309. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
  10310. {},
  10311. { renamed: ["repos", "updateStatusCheckProtection"] }
  10312. ],
  10313. updateStatusCheckProtection: [
  10314. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10315. ],
  10316. updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
  10317. updateWebhookConfigForRepo: [
  10318. "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10319. ],
  10320. uploadReleaseAsset: [
  10321. "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
  10322. { baseUrl: "https://uploads.github.com" }
  10323. ]
  10324. },
  10325. search: {
  10326. code: ["GET /search/code"],
  10327. commits: ["GET /search/commits"],
  10328. issuesAndPullRequests: ["GET /search/issues"],
  10329. labels: ["GET /search/labels"],
  10330. repos: ["GET /search/repositories"],
  10331. topics: ["GET /search/topics"],
  10332. users: ["GET /search/users"]
  10333. },
  10334. secretScanning: {
  10335. getAlert: [
  10336. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10337. ],
  10338. listAlertsForEnterprise: [
  10339. "GET /enterprises/{enterprise}/secret-scanning/alerts"
  10340. ],
  10341. listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
  10342. listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
  10343. listLocationsForAlert: [
  10344. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
  10345. ],
  10346. updateAlert: [
  10347. "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10348. ]
  10349. },
  10350. securityAdvisories: {
  10351. createFork: [
  10352. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
  10353. ],
  10354. createPrivateVulnerabilityReport: [
  10355. "POST /repos/{owner}/{repo}/security-advisories/reports"
  10356. ],
  10357. createRepositoryAdvisory: [
  10358. "POST /repos/{owner}/{repo}/security-advisories"
  10359. ],
  10360. createRepositoryAdvisoryCveRequest: [
  10361. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
  10362. ],
  10363. getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
  10364. getRepositoryAdvisory: [
  10365. "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10366. ],
  10367. listGlobalAdvisories: ["GET /advisories"],
  10368. listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
  10369. listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
  10370. updateRepositoryAdvisory: [
  10371. "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10372. ]
  10373. },
  10374. teams: {
  10375. addOrUpdateMembershipForUserInOrg: [
  10376. "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10377. ],
  10378. addOrUpdateProjectPermissionsInOrg: [
  10379. "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10380. ],
  10381. addOrUpdateRepoPermissionsInOrg: [
  10382. "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10383. ],
  10384. checkPermissionsForProjectInOrg: [
  10385. "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10386. ],
  10387. checkPermissionsForRepoInOrg: [
  10388. "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10389. ],
  10390. create: ["POST /orgs/{org}/teams"],
  10391. createDiscussionCommentInOrg: [
  10392. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10393. ],
  10394. createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
  10395. deleteDiscussionCommentInOrg: [
  10396. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10397. ],
  10398. deleteDiscussionInOrg: [
  10399. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10400. ],
  10401. deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
  10402. getByName: ["GET /orgs/{org}/teams/{team_slug}"],
  10403. getDiscussionCommentInOrg: [
  10404. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10405. ],
  10406. getDiscussionInOrg: [
  10407. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10408. ],
  10409. getMembershipForUserInOrg: [
  10410. "GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10411. ],
  10412. list: ["GET /orgs/{org}/teams"],
  10413. listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
  10414. listDiscussionCommentsInOrg: [
  10415. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10416. ],
  10417. listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
  10418. listForAuthenticatedUser: ["GET /user/teams"],
  10419. listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
  10420. listPendingInvitationsInOrg: [
  10421. "GET /orgs/{org}/teams/{team_slug}/invitations"
  10422. ],
  10423. listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
  10424. listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
  10425. removeMembershipForUserInOrg: [
  10426. "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10427. ],
  10428. removeProjectInOrg: [
  10429. "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10430. ],
  10431. removeRepoInOrg: [
  10432. "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10433. ],
  10434. updateDiscussionCommentInOrg: [
  10435. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10436. ],
  10437. updateDiscussionInOrg: [
  10438. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10439. ],
  10440. updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
  10441. },
  10442. users: {
  10443. addEmailForAuthenticated: [
  10444. "POST /user/emails",
  10445. {},
  10446. { renamed: ["users", "addEmailForAuthenticatedUser"] }
  10447. ],
  10448. addEmailForAuthenticatedUser: ["POST /user/emails"],
  10449. addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
  10450. block: ["PUT /user/blocks/{username}"],
  10451. checkBlocked: ["GET /user/blocks/{username}"],
  10452. checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
  10453. checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
  10454. createGpgKeyForAuthenticated: [
  10455. "POST /user/gpg_keys",
  10456. {},
  10457. { renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
  10458. ],
  10459. createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
  10460. createPublicSshKeyForAuthenticated: [
  10461. "POST /user/keys",
  10462. {},
  10463. { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
  10464. ],
  10465. createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
  10466. createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
  10467. deleteEmailForAuthenticated: [
  10468. "DELETE /user/emails",
  10469. {},
  10470. { renamed: ["users", "deleteEmailForAuthenticatedUser"] }
  10471. ],
  10472. deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
  10473. deleteGpgKeyForAuthenticated: [
  10474. "DELETE /user/gpg_keys/{gpg_key_id}",
  10475. {},
  10476. { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
  10477. ],
  10478. deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
  10479. deletePublicSshKeyForAuthenticated: [
  10480. "DELETE /user/keys/{key_id}",
  10481. {},
  10482. { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
  10483. ],
  10484. deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
  10485. deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
  10486. deleteSshSigningKeyForAuthenticatedUser: [
  10487. "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
  10488. ],
  10489. follow: ["PUT /user/following/{username}"],
  10490. getAuthenticated: ["GET /user"],
  10491. getByUsername: ["GET /users/{username}"],
  10492. getContextForUser: ["GET /users/{username}/hovercard"],
  10493. getGpgKeyForAuthenticated: [
  10494. "GET /user/gpg_keys/{gpg_key_id}",
  10495. {},
  10496. { renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
  10497. ],
  10498. getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
  10499. getPublicSshKeyForAuthenticated: [
  10500. "GET /user/keys/{key_id}",
  10501. {},
  10502. { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
  10503. ],
  10504. getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
  10505. getSshSigningKeyForAuthenticatedUser: [
  10506. "GET /user/ssh_signing_keys/{ssh_signing_key_id}"
  10507. ],
  10508. list: ["GET /users"],
  10509. listBlockedByAuthenticated: [
  10510. "GET /user/blocks",
  10511. {},
  10512. { renamed: ["users", "listBlockedByAuthenticatedUser"] }
  10513. ],
  10514. listBlockedByAuthenticatedUser: ["GET /user/blocks"],
  10515. listEmailsForAuthenticated: [
  10516. "GET /user/emails",
  10517. {},
  10518. { renamed: ["users", "listEmailsForAuthenticatedUser"] }
  10519. ],
  10520. listEmailsForAuthenticatedUser: ["GET /user/emails"],
  10521. listFollowedByAuthenticated: [
  10522. "GET /user/following",
  10523. {},
  10524. { renamed: ["users", "listFollowedByAuthenticatedUser"] }
  10525. ],
  10526. listFollowedByAuthenticatedUser: ["GET /user/following"],
  10527. listFollowersForAuthenticatedUser: ["GET /user/followers"],
  10528. listFollowersForUser: ["GET /users/{username}/followers"],
  10529. listFollowingForUser: ["GET /users/{username}/following"],
  10530. listGpgKeysForAuthenticated: [
  10531. "GET /user/gpg_keys",
  10532. {},
  10533. { renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
  10534. ],
  10535. listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
  10536. listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
  10537. listPublicEmailsForAuthenticated: [
  10538. "GET /user/public_emails",
  10539. {},
  10540. { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
  10541. ],
  10542. listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
  10543. listPublicKeysForUser: ["GET /users/{username}/keys"],
  10544. listPublicSshKeysForAuthenticated: [
  10545. "GET /user/keys",
  10546. {},
  10547. { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
  10548. ],
  10549. listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
  10550. listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
  10551. listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
  10552. listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
  10553. listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
  10554. setPrimaryEmailVisibilityForAuthenticated: [
  10555. "PATCH /user/email/visibility",
  10556. {},
  10557. { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
  10558. ],
  10559. setPrimaryEmailVisibilityForAuthenticatedUser: [
  10560. "PATCH /user/email/visibility"
  10561. ],
  10562. unblock: ["DELETE /user/blocks/{username}"],
  10563. unfollow: ["DELETE /user/following/{username}"],
  10564. updateAuthenticated: ["PATCH /user"]
  10565. }
  10566. };
  10567. var endpoints_default = Endpoints;
  10568. // pkg/dist-src/endpoints-to-methods.js
  10569. var endpointMethodsMap = /* @__PURE__ */ new Map();
  10570. for (const [scope, endpoints] of Object.entries(endpoints_default)) {
  10571. for (const [methodName, endpoint] of Object.entries(endpoints)) {
  10572. const [route, defaults, decorations] = endpoint;
  10573. const [method, url] = route.split(/ /);
  10574. const endpointDefaults = Object.assign(
  10575. {
  10576. method,
  10577. url
  10578. },
  10579. defaults
  10580. );
  10581. if (!endpointMethodsMap.has(scope)) {
  10582. endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
  10583. }
  10584. endpointMethodsMap.get(scope).set(methodName, {
  10585. scope,
  10586. methodName,
  10587. endpointDefaults,
  10588. decorations
  10589. });
  10590. }
  10591. }
  10592. var handler = {
  10593. has({ scope }, methodName) {
  10594. return endpointMethodsMap.get(scope).has(methodName);
  10595. },
  10596. getOwnPropertyDescriptor(target, methodName) {
  10597. return {
  10598. value: this.get(target, methodName),
  10599. // ensures method is in the cache
  10600. configurable: true,
  10601. writable: true,
  10602. enumerable: true
  10603. };
  10604. },
  10605. defineProperty(target, methodName, descriptor) {
  10606. Object.defineProperty(target.cache, methodName, descriptor);
  10607. return true;
  10608. },
  10609. deleteProperty(target, methodName) {
  10610. delete target.cache[methodName];
  10611. return true;
  10612. },
  10613. ownKeys({ scope }) {
  10614. return [...endpointMethodsMap.get(scope).keys()];
  10615. },
  10616. set(target, methodName, value) {
  10617. return target.cache[methodName] = value;
  10618. },
  10619. get({ octokit, scope, cache }, methodName) {
  10620. if (cache[methodName]) {
  10621. return cache[methodName];
  10622. }
  10623. const method = endpointMethodsMap.get(scope).get(methodName);
  10624. if (!method) {
  10625. return void 0;
  10626. }
  10627. const { endpointDefaults, decorations } = method;
  10628. if (decorations) {
  10629. cache[methodName] = decorate(
  10630. octokit,
  10631. scope,
  10632. methodName,
  10633. endpointDefaults,
  10634. decorations
  10635. );
  10636. } else {
  10637. cache[methodName] = octokit.request.defaults(endpointDefaults);
  10638. }
  10639. return cache[methodName];
  10640. }
  10641. };
  10642. function endpointsToMethods(octokit) {
  10643. const newMethods = {};
  10644. for (const scope of endpointMethodsMap.keys()) {
  10645. newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
  10646. }
  10647. return newMethods;
  10648. }
  10649. function decorate(octokit, scope, methodName, defaults, decorations) {
  10650. const requestWithDefaults = octokit.request.defaults(defaults);
  10651. function withDecorations(...args) {
  10652. let options = requestWithDefaults.endpoint.merge(...args);
  10653. if (decorations.mapToData) {
  10654. options = Object.assign({}, options, {
  10655. data: options[decorations.mapToData],
  10656. [decorations.mapToData]: void 0
  10657. });
  10658. return requestWithDefaults(options);
  10659. }
  10660. if (decorations.renamed) {
  10661. const [newScope, newMethodName] = decorations.renamed;
  10662. octokit.log.warn(
  10663. `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
  10664. );
  10665. }
  10666. if (decorations.deprecated) {
  10667. octokit.log.warn(decorations.deprecated);
  10668. }
  10669. if (decorations.renamedParameters) {
  10670. const options2 = requestWithDefaults.endpoint.merge(...args);
  10671. for (const [name, alias] of Object.entries(
  10672. decorations.renamedParameters
  10673. )) {
  10674. if (name in options2) {
  10675. octokit.log.warn(
  10676. `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
  10677. );
  10678. if (!(alias in options2)) {
  10679. options2[alias] = options2[name];
  10680. }
  10681. delete options2[name];
  10682. }
  10683. }
  10684. return requestWithDefaults(options2);
  10685. }
  10686. return requestWithDefaults(...args);
  10687. }
  10688. return Object.assign(withDecorations, requestWithDefaults);
  10689. }
  10690. // pkg/dist-src/index.js
  10691. function restEndpointMethods(octokit) {
  10692. const api = endpointsToMethods(octokit);
  10693. return {
  10694. rest: api
  10695. };
  10696. }
  10697. restEndpointMethods.VERSION = VERSION;
  10698. function legacyRestEndpointMethods(octokit) {
  10699. const api = endpointsToMethods(octokit);
  10700. return {
  10701. ...api,
  10702. rest: api
  10703. };
  10704. }
  10705. legacyRestEndpointMethods.VERSION = VERSION;
  10706. // Annotate the CommonJS export names for ESM import in node:
  10707. 0 && (0);
  10708. /***/ }),
  10709. /***/ 537:
  10710. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10711. "use strict";
  10712. var __create = Object.create;
  10713. var __defProp = Object.defineProperty;
  10714. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10715. var __getOwnPropNames = Object.getOwnPropertyNames;
  10716. var __getProtoOf = Object.getPrototypeOf;
  10717. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10718. var __export = (target, all) => {
  10719. for (var name in all)
  10720. __defProp(target, name, { get: all[name], enumerable: true });
  10721. };
  10722. var __copyProps = (to, from, except, desc) => {
  10723. if (from && typeof from === "object" || typeof from === "function") {
  10724. for (let key of __getOwnPropNames(from))
  10725. if (!__hasOwnProp.call(to, key) && key !== except)
  10726. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10727. }
  10728. return to;
  10729. };
  10730. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  10731. // If the importer is in node compatibility mode or this is not an ESM
  10732. // file that has been converted to a CommonJS file using a Babel-
  10733. // compatible transform (i.e. "__esModule" has not been set), then set
  10734. // "default" to the CommonJS "module.exports" for node compatibility.
  10735. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  10736. mod
  10737. ));
  10738. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10739. // pkg/dist-src/index.js
  10740. var dist_src_exports = {};
  10741. __export(dist_src_exports, {
  10742. RequestError: () => RequestError
  10743. });
  10744. module.exports = __toCommonJS(dist_src_exports);
  10745. var import_deprecation = __nccwpck_require__(8932);
  10746. var import_once = __toESM(__nccwpck_require__(1223));
  10747. var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10748. var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10749. var RequestError = class extends Error {
  10750. constructor(message, statusCode, options) {
  10751. super(message);
  10752. if (Error.captureStackTrace) {
  10753. Error.captureStackTrace(this, this.constructor);
  10754. }
  10755. this.name = "HttpError";
  10756. this.status = statusCode;
  10757. let headers;
  10758. if ("headers" in options && typeof options.headers !== "undefined") {
  10759. headers = options.headers;
  10760. }
  10761. if ("response" in options) {
  10762. this.response = options.response;
  10763. headers = options.response.headers;
  10764. }
  10765. const requestCopy = Object.assign({}, options.request);
  10766. if (options.request.headers.authorization) {
  10767. requestCopy.headers = Object.assign({}, options.request.headers, {
  10768. authorization: options.request.headers.authorization.replace(
  10769. /(?<! ) .*$/,
  10770. " [REDACTED]"
  10771. )
  10772. });
  10773. }
  10774. requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  10775. this.request = requestCopy;
  10776. Object.defineProperty(this, "code", {
  10777. get() {
  10778. logOnceCode(
  10779. new import_deprecation.Deprecation(
  10780. "[@octokit/request-error] `error.code` is deprecated, use `error.status`."
  10781. )
  10782. );
  10783. return statusCode;
  10784. }
  10785. });
  10786. Object.defineProperty(this, "headers", {
  10787. get() {
  10788. logOnceHeaders(
  10789. new import_deprecation.Deprecation(
  10790. "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
  10791. )
  10792. );
  10793. return headers || {};
  10794. }
  10795. });
  10796. }
  10797. };
  10798. // Annotate the CommonJS export names for ESM import in node:
  10799. 0 && (0);
  10800. /***/ }),
  10801. /***/ 6234:
  10802. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10803. "use strict";
  10804. var __defProp = Object.defineProperty;
  10805. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10806. var __getOwnPropNames = Object.getOwnPropertyNames;
  10807. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10808. var __export = (target, all) => {
  10809. for (var name in all)
  10810. __defProp(target, name, { get: all[name], enumerable: true });
  10811. };
  10812. var __copyProps = (to, from, except, desc) => {
  10813. if (from && typeof from === "object" || typeof from === "function") {
  10814. for (let key of __getOwnPropNames(from))
  10815. if (!__hasOwnProp.call(to, key) && key !== except)
  10816. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10817. }
  10818. return to;
  10819. };
  10820. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10821. // pkg/dist-src/index.js
  10822. var dist_src_exports = {};
  10823. __export(dist_src_exports, {
  10824. request: () => request
  10825. });
  10826. module.exports = __toCommonJS(dist_src_exports);
  10827. var import_endpoint = __nccwpck_require__(9440);
  10828. var import_universal_user_agent = __nccwpck_require__(5030);
  10829. // pkg/dist-src/version.js
  10830. var VERSION = "8.4.1";
  10831. // pkg/dist-src/is-plain-object.js
  10832. function isPlainObject(value) {
  10833. if (typeof value !== "object" || value === null)
  10834. return false;
  10835. if (Object.prototype.toString.call(value) !== "[object Object]")
  10836. return false;
  10837. const proto = Object.getPrototypeOf(value);
  10838. if (proto === null)
  10839. return true;
  10840. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  10841. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  10842. }
  10843. // pkg/dist-src/fetch-wrapper.js
  10844. var import_request_error = __nccwpck_require__(537);
  10845. // pkg/dist-src/get-buffer-response.js
  10846. function getBufferResponse(response) {
  10847. return response.arrayBuffer();
  10848. }
  10849. // pkg/dist-src/fetch-wrapper.js
  10850. function fetchWrapper(requestOptions) {
  10851. var _a, _b, _c, _d;
  10852. const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
  10853. const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
  10854. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  10855. requestOptions.body = JSON.stringify(requestOptions.body);
  10856. }
  10857. let headers = {};
  10858. let status;
  10859. let url;
  10860. let { fetch } = globalThis;
  10861. if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) {
  10862. fetch = requestOptions.request.fetch;
  10863. }
  10864. if (!fetch) {
  10865. throw new Error(
  10866. "fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing"
  10867. );
  10868. }
  10869. return fetch(requestOptions.url, {
  10870. method: requestOptions.method,
  10871. body: requestOptions.body,
  10872. redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
  10873. headers: requestOptions.headers,
  10874. signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
  10875. // duplex must be set if request.body is ReadableStream or Async Iterables.
  10876. // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
  10877. ...requestOptions.body && { duplex: "half" }
  10878. }).then(async (response) => {
  10879. url = response.url;
  10880. status = response.status;
  10881. for (const keyAndValue of response.headers) {
  10882. headers[keyAndValue[0]] = keyAndValue[1];
  10883. }
  10884. if ("deprecation" in headers) {
  10885. const matches = headers.link && headers.link.match(/<([^<>]+)>; rel="deprecation"/);
  10886. const deprecationLink = matches && matches.pop();
  10887. log.warn(
  10888. `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
  10889. );
  10890. }
  10891. if (status === 204 || status === 205) {
  10892. return;
  10893. }
  10894. if (requestOptions.method === "HEAD") {
  10895. if (status < 400) {
  10896. return;
  10897. }
  10898. throw new import_request_error.RequestError(response.statusText, status, {
  10899. response: {
  10900. url,
  10901. status,
  10902. headers,
  10903. data: void 0
  10904. },
  10905. request: requestOptions
  10906. });
  10907. }
  10908. if (status === 304) {
  10909. throw new import_request_error.RequestError("Not modified", status, {
  10910. response: {
  10911. url,
  10912. status,
  10913. headers,
  10914. data: await getResponseData(response)
  10915. },
  10916. request: requestOptions
  10917. });
  10918. }
  10919. if (status >= 400) {
  10920. const data = await getResponseData(response);
  10921. const error = new import_request_error.RequestError(toErrorMessage(data), status, {
  10922. response: {
  10923. url,
  10924. status,
  10925. headers,
  10926. data
  10927. },
  10928. request: requestOptions
  10929. });
  10930. throw error;
  10931. }
  10932. return parseSuccessResponseBody ? await getResponseData(response) : response.body;
  10933. }).then((data) => {
  10934. return {
  10935. status,
  10936. url,
  10937. headers,
  10938. data
  10939. };
  10940. }).catch((error) => {
  10941. if (error instanceof import_request_error.RequestError)
  10942. throw error;
  10943. else if (error.name === "AbortError")
  10944. throw error;
  10945. let message = error.message;
  10946. if (error.name === "TypeError" && "cause" in error) {
  10947. if (error.cause instanceof Error) {
  10948. message = error.cause.message;
  10949. } else if (typeof error.cause === "string") {
  10950. message = error.cause;
  10951. }
  10952. }
  10953. throw new import_request_error.RequestError(message, 500, {
  10954. request: requestOptions
  10955. });
  10956. });
  10957. }
  10958. async function getResponseData(response) {
  10959. const contentType = response.headers.get("content-type");
  10960. if (/application\/json/.test(contentType)) {
  10961. return response.json().catch(() => response.text()).catch(() => "");
  10962. }
  10963. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  10964. return response.text();
  10965. }
  10966. return getBufferResponse(response);
  10967. }
  10968. function toErrorMessage(data) {
  10969. if (typeof data === "string")
  10970. return data;
  10971. let suffix;
  10972. if ("documentation_url" in data) {
  10973. suffix = ` - ${data.documentation_url}`;
  10974. } else {
  10975. suffix = "";
  10976. }
  10977. if ("message" in data) {
  10978. if (Array.isArray(data.errors)) {
  10979. return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
  10980. }
  10981. return `${data.message}${suffix}`;
  10982. }
  10983. return `Unknown error: ${JSON.stringify(data)}`;
  10984. }
  10985. // pkg/dist-src/with-defaults.js
  10986. function withDefaults(oldEndpoint, newDefaults) {
  10987. const endpoint2 = oldEndpoint.defaults(newDefaults);
  10988. const newApi = function(route, parameters) {
  10989. const endpointOptions = endpoint2.merge(route, parameters);
  10990. if (!endpointOptions.request || !endpointOptions.request.hook) {
  10991. return fetchWrapper(endpoint2.parse(endpointOptions));
  10992. }
  10993. const request2 = (route2, parameters2) => {
  10994. return fetchWrapper(
  10995. endpoint2.parse(endpoint2.merge(route2, parameters2))
  10996. );
  10997. };
  10998. Object.assign(request2, {
  10999. endpoint: endpoint2,
  11000. defaults: withDefaults.bind(null, endpoint2)
  11001. });
  11002. return endpointOptions.request.hook(request2, endpointOptions);
  11003. };
  11004. return Object.assign(newApi, {
  11005. endpoint: endpoint2,
  11006. defaults: withDefaults.bind(null, endpoint2)
  11007. });
  11008. }
  11009. // pkg/dist-src/index.js
  11010. var request = withDefaults(import_endpoint.endpoint, {
  11011. headers: {
  11012. "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  11013. }
  11014. });
  11015. // Annotate the CommonJS export names for ESM import in node:
  11016. 0 && (0);
  11017. /***/ }),
  11018. /***/ 3682:
  11019. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  11020. var register = __nccwpck_require__(4670);
  11021. var addHook = __nccwpck_require__(5549);
  11022. var removeHook = __nccwpck_require__(6819);
  11023. // bind with array of arguments: https://stackoverflow.com/a/21792913
  11024. var bind = Function.bind;
  11025. var bindable = bind.bind(bind);
  11026. function bindApi(hook, state, name) {
  11027. var removeHookRef = bindable(removeHook, null).apply(
  11028. null,
  11029. name ? [state, name] : [state]
  11030. );
  11031. hook.api = { remove: removeHookRef };
  11032. hook.remove = removeHookRef;
  11033. ["before", "error", "after", "wrap"].forEach(function (kind) {
  11034. var args = name ? [state, kind, name] : [state, kind];
  11035. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
  11036. });
  11037. }
  11038. function HookSingular() {
  11039. var singularHookName = "h";
  11040. var singularHookState = {
  11041. registry: {},
  11042. };
  11043. var singularHook = register.bind(null, singularHookState, singularHookName);
  11044. bindApi(singularHook, singularHookState, singularHookName);
  11045. return singularHook;
  11046. }
  11047. function HookCollection() {
  11048. var state = {
  11049. registry: {},
  11050. };
  11051. var hook = register.bind(null, state);
  11052. bindApi(hook, state);
  11053. return hook;
  11054. }
  11055. var collectionHookDeprecationMessageDisplayed = false;
  11056. function Hook() {
  11057. if (!collectionHookDeprecationMessageDisplayed) {
  11058. console.warn(
  11059. '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
  11060. );
  11061. collectionHookDeprecationMessageDisplayed = true;
  11062. }
  11063. return HookCollection();
  11064. }
  11065. Hook.Singular = HookSingular.bind();
  11066. Hook.Collection = HookCollection.bind();
  11067. module.exports = Hook;
  11068. // expose constructors as a named property for TypeScript
  11069. module.exports.Hook = Hook;
  11070. module.exports.Singular = Hook.Singular;
  11071. module.exports.Collection = Hook.Collection;
  11072. /***/ }),
  11073. /***/ 5549:
  11074. /***/ ((module) => {
  11075. module.exports = addHook;
  11076. function addHook(state, kind, name, hook) {
  11077. var orig = hook;
  11078. if (!state.registry[name]) {
  11079. state.registry[name] = [];
  11080. }
  11081. if (kind === "before") {
  11082. hook = function (method, options) {
  11083. return Promise.resolve()
  11084. .then(orig.bind(null, options))
  11085. .then(method.bind(null, options));
  11086. };
  11087. }
  11088. if (kind === "after") {
  11089. hook = function (method, options) {
  11090. var result;
  11091. return Promise.resolve()
  11092. .then(method.bind(null, options))
  11093. .then(function (result_) {
  11094. result = result_;
  11095. return orig(result, options);
  11096. })
  11097. .then(function () {
  11098. return result;
  11099. });
  11100. };
  11101. }
  11102. if (kind === "error") {
  11103. hook = function (method, options) {
  11104. return Promise.resolve()
  11105. .then(method.bind(null, options))
  11106. .catch(function (error) {
  11107. return orig(error, options);
  11108. });
  11109. };
  11110. }
  11111. state.registry[name].push({
  11112. hook: hook,
  11113. orig: orig,
  11114. });
  11115. }
  11116. /***/ }),
  11117. /***/ 4670:
  11118. /***/ ((module) => {
  11119. module.exports = register;
  11120. function register(state, name, method, options) {
  11121. if (typeof method !== "function") {
  11122. throw new Error("method for before hook must be a function");
  11123. }
  11124. if (!options) {
  11125. options = {};
  11126. }
  11127. if (Array.isArray(name)) {
  11128. return name.reverse().reduce(function (callback, name) {
  11129. return register.bind(null, state, name, callback, options);
  11130. }, method)();
  11131. }
  11132. return Promise.resolve().then(function () {
  11133. if (!state.registry[name]) {
  11134. return method(options);
  11135. }
  11136. return state.registry[name].reduce(function (method, registered) {
  11137. return registered.hook.bind(null, method, options);
  11138. }, method)();
  11139. });
  11140. }
  11141. /***/ }),
  11142. /***/ 6819:
  11143. /***/ ((module) => {
  11144. module.exports = removeHook;
  11145. function removeHook(state, name, method) {
  11146. if (!state.registry[name]) {
  11147. return;
  11148. }
  11149. var index = state.registry[name]
  11150. .map(function (registered) {
  11151. return registered.orig;
  11152. })
  11153. .indexOf(method);
  11154. if (index === -1) {
  11155. return;
  11156. }
  11157. state.registry[name].splice(index, 1);
  11158. }
  11159. /***/ }),
  11160. /***/ 8932:
  11161. /***/ ((__unused_webpack_module, exports) => {
  11162. "use strict";
  11163. Object.defineProperty(exports, "__esModule", ({ value: true }));
  11164. class Deprecation extends Error {
  11165. constructor(message) {
  11166. super(message); // Maintains proper stack trace (only available on V8)
  11167. /* istanbul ignore next */
  11168. if (Error.captureStackTrace) {
  11169. Error.captureStackTrace(this, this.constructor);
  11170. }
  11171. this.name = 'Deprecation';
  11172. }
  11173. }
  11174. exports.Deprecation = Deprecation;
  11175. /***/ }),
  11176. /***/ 1223:
  11177. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  11178. var wrappy = __nccwpck_require__(2940)
  11179. module.exports = wrappy(once)
  11180. module.exports.strict = wrappy(onceStrict)
  11181. once.proto = once(function () {
  11182. Object.defineProperty(Function.prototype, 'once', {
  11183. value: function () {
  11184. return once(this)
  11185. },
  11186. configurable: true
  11187. })
  11188. Object.defineProperty(Function.prototype, 'onceStrict', {
  11189. value: function () {
  11190. return onceStrict(this)
  11191. },
  11192. configurable: true
  11193. })
  11194. })
  11195. function once (fn) {
  11196. var f = function () {
  11197. if (f.called) return f.value
  11198. f.called = true
  11199. return f.value = fn.apply(this, arguments)
  11200. }
  11201. f.called = false
  11202. return f
  11203. }
  11204. function onceStrict (fn) {
  11205. var f = function () {
  11206. if (f.called)
  11207. throw new Error(f.onceError)
  11208. f.called = true
  11209. return f.value = fn.apply(this, arguments)
  11210. }
  11211. var name = fn.name || 'Function wrapped with `once`'
  11212. f.onceError = name + " shouldn't be called more than once"
  11213. f.called = false
  11214. return f
  11215. }
  11216. /***/ }),
  11217. /***/ 5911:
  11218. /***/ ((module, exports) => {
  11219. exports = module.exports = SemVer
  11220. var debug
  11221. /* istanbul ignore next */
  11222. if (typeof process === 'object' &&
  11223. process.env &&
  11224. process.env.NODE_DEBUG &&
  11225. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  11226. debug = function () {
  11227. var args = Array.prototype.slice.call(arguments, 0)
  11228. args.unshift('SEMVER')
  11229. console.log.apply(console, args)
  11230. }
  11231. } else {
  11232. debug = function () {}
  11233. }
  11234. // Note: this is the semver.org version of the spec that it implements
  11235. // Not necessarily the package version of this code.
  11236. exports.SEMVER_SPEC_VERSION = '2.0.0'
  11237. var MAX_LENGTH = 256
  11238. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  11239. /* istanbul ignore next */ 9007199254740991
  11240. // Max safe segment length for coercion.
  11241. var MAX_SAFE_COMPONENT_LENGTH = 16
  11242. var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
  11243. // The actual regexps go on exports.re
  11244. var re = exports.re = []
  11245. var safeRe = exports.safeRe = []
  11246. var src = exports.src = []
  11247. var t = exports.tokens = {}
  11248. var R = 0
  11249. function tok (n) {
  11250. t[n] = R++
  11251. }
  11252. var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
  11253. // Replace some greedy regex tokens to prevent regex dos issues. These regex are
  11254. // used internally via the safeRe object since all inputs in this library get
  11255. // normalized first to trim and collapse all extra whitespace. The original
  11256. // regexes are exported for userland consumption and lower level usage. A
  11257. // future breaking change could export the safer regex only with a note that
  11258. // all input should have extra whitespace removed.
  11259. var safeRegexReplacements = [
  11260. ['\\s', 1],
  11261. ['\\d', MAX_LENGTH],
  11262. [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
  11263. ]
  11264. function makeSafeRe (value) {
  11265. for (var i = 0; i < safeRegexReplacements.length; i++) {
  11266. var token = safeRegexReplacements[i][0]
  11267. var max = safeRegexReplacements[i][1]
  11268. value = value
  11269. .split(token + '*').join(token + '{0,' + max + '}')
  11270. .split(token + '+').join(token + '{1,' + max + '}')
  11271. }
  11272. return value
  11273. }
  11274. // The following Regular Expressions can be used for tokenizing,
  11275. // validating, and parsing SemVer version strings.
  11276. // ## Numeric Identifier
  11277. // A single `0`, or a non-zero digit followed by zero or more digits.
  11278. tok('NUMERICIDENTIFIER')
  11279. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  11280. tok('NUMERICIDENTIFIERLOOSE')
  11281. src[t.NUMERICIDENTIFIERLOOSE] = '\\d+'
  11282. // ## Non-numeric Identifier
  11283. // Zero or more digits, followed by a letter or hyphen, and then zero or
  11284. // more letters, digits, or hyphens.
  11285. tok('NONNUMERICIDENTIFIER')
  11286. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
  11287. // ## Main Version
  11288. // Three dot-separated numeric identifiers.
  11289. tok('MAINVERSION')
  11290. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  11291. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  11292. '(' + src[t.NUMERICIDENTIFIER] + ')'
  11293. tok('MAINVERSIONLOOSE')
  11294. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  11295. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  11296. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  11297. // ## Pre-release Version Identifier
  11298. // A numeric identifier, or a non-numeric identifier.
  11299. tok('PRERELEASEIDENTIFIER')
  11300. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  11301. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  11302. tok('PRERELEASEIDENTIFIERLOOSE')
  11303. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  11304. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  11305. // ## Pre-release Version
  11306. // Hyphen, followed by one or more dot-separated pre-release version
  11307. // identifiers.
  11308. tok('PRERELEASE')
  11309. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  11310. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  11311. tok('PRERELEASELOOSE')
  11312. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  11313. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  11314. // ## Build Metadata Identifier
  11315. // Any combination of digits, letters, or hyphens.
  11316. tok('BUILDIDENTIFIER')
  11317. src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
  11318. // ## Build Metadata
  11319. // Plus sign, followed by one or more period-separated build metadata
  11320. // identifiers.
  11321. tok('BUILD')
  11322. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  11323. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  11324. // ## Full Version String
  11325. // A main version, followed optionally by a pre-release version and
  11326. // build metadata.
  11327. // Note that the only major, minor, patch, and pre-release sections of
  11328. // the version string are capturing groups. The build metadata is not a
  11329. // capturing group, because it should not ever be used in version
  11330. // comparison.
  11331. tok('FULL')
  11332. tok('FULLPLAIN')
  11333. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  11334. src[t.PRERELEASE] + '?' +
  11335. src[t.BUILD] + '?'
  11336. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  11337. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  11338. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  11339. // common in the npm registry.
  11340. tok('LOOSEPLAIN')
  11341. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  11342. src[t.PRERELEASELOOSE] + '?' +
  11343. src[t.BUILD] + '?'
  11344. tok('LOOSE')
  11345. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  11346. tok('GTLT')
  11347. src[t.GTLT] = '((?:<|>)?=?)'
  11348. // Something like "2.*" or "1.2.x".
  11349. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  11350. // Only the first item is strictly required.
  11351. tok('XRANGEIDENTIFIERLOOSE')
  11352. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  11353. tok('XRANGEIDENTIFIER')
  11354. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  11355. tok('XRANGEPLAIN')
  11356. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  11357. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11358. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11359. '(?:' + src[t.PRERELEASE] + ')?' +
  11360. src[t.BUILD] + '?' +
  11361. ')?)?'
  11362. tok('XRANGEPLAINLOOSE')
  11363. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11364. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11365. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11366. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  11367. src[t.BUILD] + '?' +
  11368. ')?)?'
  11369. tok('XRANGE')
  11370. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  11371. tok('XRANGELOOSE')
  11372. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  11373. // Coercion.
  11374. // Extract anything that could conceivably be a part of a valid semver
  11375. tok('COERCE')
  11376. src[t.COERCE] = '(^|[^\\d])' +
  11377. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  11378. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11379. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11380. '(?:$|[^\\d])'
  11381. tok('COERCERTL')
  11382. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  11383. safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g')
  11384. // Tilde ranges.
  11385. // Meaning is "reasonably at or greater than"
  11386. tok('LONETILDE')
  11387. src[t.LONETILDE] = '(?:~>?)'
  11388. tok('TILDETRIM')
  11389. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  11390. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  11391. safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g')
  11392. var tildeTrimReplace = '$1~'
  11393. tok('TILDE')
  11394. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  11395. tok('TILDELOOSE')
  11396. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  11397. // Caret ranges.
  11398. // Meaning is "at least and backwards compatible with"
  11399. tok('LONECARET')
  11400. src[t.LONECARET] = '(?:\\^)'
  11401. tok('CARETTRIM')
  11402. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  11403. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  11404. safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g')
  11405. var caretTrimReplace = '$1^'
  11406. tok('CARET')
  11407. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  11408. tok('CARETLOOSE')
  11409. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  11410. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  11411. tok('COMPARATORLOOSE')
  11412. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  11413. tok('COMPARATOR')
  11414. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  11415. // An expression to strip any whitespace between the gtlt and the thing
  11416. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  11417. tok('COMPARATORTRIM')
  11418. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  11419. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  11420. // this one has to use the /g flag
  11421. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  11422. safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g')
  11423. var comparatorTrimReplace = '$1$2$3'
  11424. // Something like `1.2.3 - 1.2.4`
  11425. // Note that these all use the loose form, because they'll be
  11426. // checked against either the strict or loose comparator form
  11427. // later.
  11428. tok('HYPHENRANGE')
  11429. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  11430. '\\s+-\\s+' +
  11431. '(' + src[t.XRANGEPLAIN] + ')' +
  11432. '\\s*$'
  11433. tok('HYPHENRANGELOOSE')
  11434. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11435. '\\s+-\\s+' +
  11436. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11437. '\\s*$'
  11438. // Star ranges basically just allow anything at all.
  11439. tok('STAR')
  11440. src[t.STAR] = '(<|>)?=?\\s*\\*'
  11441. // Compile to actual regexp objects.
  11442. // All are flag-free, unless they were created above with a flag.
  11443. for (var i = 0; i < R; i++) {
  11444. debug(i, src[i])
  11445. if (!re[i]) {
  11446. re[i] = new RegExp(src[i])
  11447. // Replace all greedy whitespace to prevent regex dos issues. These regex are
  11448. // used internally via the safeRe object since all inputs in this library get
  11449. // normalized first to trim and collapse all extra whitespace. The original
  11450. // regexes are exported for userland consumption and lower level usage. A
  11451. // future breaking change could export the safer regex only with a note that
  11452. // all input should have extra whitespace removed.
  11453. safeRe[i] = new RegExp(makeSafeRe(src[i]))
  11454. }
  11455. }
  11456. exports.parse = parse
  11457. function parse (version, options) {
  11458. if (!options || typeof options !== 'object') {
  11459. options = {
  11460. loose: !!options,
  11461. includePrerelease: false
  11462. }
  11463. }
  11464. if (version instanceof SemVer) {
  11465. return version
  11466. }
  11467. if (typeof version !== 'string') {
  11468. return null
  11469. }
  11470. if (version.length > MAX_LENGTH) {
  11471. return null
  11472. }
  11473. var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]
  11474. if (!r.test(version)) {
  11475. return null
  11476. }
  11477. try {
  11478. return new SemVer(version, options)
  11479. } catch (er) {
  11480. return null
  11481. }
  11482. }
  11483. exports.valid = valid
  11484. function valid (version, options) {
  11485. var v = parse(version, options)
  11486. return v ? v.version : null
  11487. }
  11488. exports.clean = clean
  11489. function clean (version, options) {
  11490. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  11491. return s ? s.version : null
  11492. }
  11493. exports.SemVer = SemVer
  11494. function SemVer (version, options) {
  11495. if (!options || typeof options !== 'object') {
  11496. options = {
  11497. loose: !!options,
  11498. includePrerelease: false
  11499. }
  11500. }
  11501. if (version instanceof SemVer) {
  11502. if (version.loose === options.loose) {
  11503. return version
  11504. } else {
  11505. version = version.version
  11506. }
  11507. } else if (typeof version !== 'string') {
  11508. throw new TypeError('Invalid Version: ' + version)
  11509. }
  11510. if (version.length > MAX_LENGTH) {
  11511. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  11512. }
  11513. if (!(this instanceof SemVer)) {
  11514. return new SemVer(version, options)
  11515. }
  11516. debug('SemVer', version, options)
  11517. this.options = options
  11518. this.loose = !!options.loose
  11519. var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])
  11520. if (!m) {
  11521. throw new TypeError('Invalid Version: ' + version)
  11522. }
  11523. this.raw = version
  11524. // these are actually numbers
  11525. this.major = +m[1]
  11526. this.minor = +m[2]
  11527. this.patch = +m[3]
  11528. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  11529. throw new TypeError('Invalid major version')
  11530. }
  11531. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  11532. throw new TypeError('Invalid minor version')
  11533. }
  11534. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  11535. throw new TypeError('Invalid patch version')
  11536. }
  11537. // numberify any prerelease numeric ids
  11538. if (!m[4]) {
  11539. this.prerelease = []
  11540. } else {
  11541. this.prerelease = m[4].split('.').map(function (id) {
  11542. if (/^[0-9]+$/.test(id)) {
  11543. var num = +id
  11544. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  11545. return num
  11546. }
  11547. }
  11548. return id
  11549. })
  11550. }
  11551. this.build = m[5] ? m[5].split('.') : []
  11552. this.format()
  11553. }
  11554. SemVer.prototype.format = function () {
  11555. this.version = this.major + '.' + this.minor + '.' + this.patch
  11556. if (this.prerelease.length) {
  11557. this.version += '-' + this.prerelease.join('.')
  11558. }
  11559. return this.version
  11560. }
  11561. SemVer.prototype.toString = function () {
  11562. return this.version
  11563. }
  11564. SemVer.prototype.compare = function (other) {
  11565. debug('SemVer.compare', this.version, this.options, other)
  11566. if (!(other instanceof SemVer)) {
  11567. other = new SemVer(other, this.options)
  11568. }
  11569. return this.compareMain(other) || this.comparePre(other)
  11570. }
  11571. SemVer.prototype.compareMain = function (other) {
  11572. if (!(other instanceof SemVer)) {
  11573. other = new SemVer(other, this.options)
  11574. }
  11575. return compareIdentifiers(this.major, other.major) ||
  11576. compareIdentifiers(this.minor, other.minor) ||
  11577. compareIdentifiers(this.patch, other.patch)
  11578. }
  11579. SemVer.prototype.comparePre = function (other) {
  11580. if (!(other instanceof SemVer)) {
  11581. other = new SemVer(other, this.options)
  11582. }
  11583. // NOT having a prerelease is > having one
  11584. if (this.prerelease.length && !other.prerelease.length) {
  11585. return -1
  11586. } else if (!this.prerelease.length && other.prerelease.length) {
  11587. return 1
  11588. } else if (!this.prerelease.length && !other.prerelease.length) {
  11589. return 0
  11590. }
  11591. var i = 0
  11592. do {
  11593. var a = this.prerelease[i]
  11594. var b = other.prerelease[i]
  11595. debug('prerelease compare', i, a, b)
  11596. if (a === undefined && b === undefined) {
  11597. return 0
  11598. } else if (b === undefined) {
  11599. return 1
  11600. } else if (a === undefined) {
  11601. return -1
  11602. } else if (a === b) {
  11603. continue
  11604. } else {
  11605. return compareIdentifiers(a, b)
  11606. }
  11607. } while (++i)
  11608. }
  11609. SemVer.prototype.compareBuild = function (other) {
  11610. if (!(other instanceof SemVer)) {
  11611. other = new SemVer(other, this.options)
  11612. }
  11613. var i = 0
  11614. do {
  11615. var a = this.build[i]
  11616. var b = other.build[i]
  11617. debug('prerelease compare', i, a, b)
  11618. if (a === undefined && b === undefined) {
  11619. return 0
  11620. } else if (b === undefined) {
  11621. return 1
  11622. } else if (a === undefined) {
  11623. return -1
  11624. } else if (a === b) {
  11625. continue
  11626. } else {
  11627. return compareIdentifiers(a, b)
  11628. }
  11629. } while (++i)
  11630. }
  11631. // preminor will bump the version up to the next minor release, and immediately
  11632. // down to pre-release. premajor and prepatch work the same way.
  11633. SemVer.prototype.inc = function (release, identifier) {
  11634. switch (release) {
  11635. case 'premajor':
  11636. this.prerelease.length = 0
  11637. this.patch = 0
  11638. this.minor = 0
  11639. this.major++
  11640. this.inc('pre', identifier)
  11641. break
  11642. case 'preminor':
  11643. this.prerelease.length = 0
  11644. this.patch = 0
  11645. this.minor++
  11646. this.inc('pre', identifier)
  11647. break
  11648. case 'prepatch':
  11649. // If this is already a prerelease, it will bump to the next version
  11650. // drop any prereleases that might already exist, since they are not
  11651. // relevant at this point.
  11652. this.prerelease.length = 0
  11653. this.inc('patch', identifier)
  11654. this.inc('pre', identifier)
  11655. break
  11656. // If the input is a non-prerelease version, this acts the same as
  11657. // prepatch.
  11658. case 'prerelease':
  11659. if (this.prerelease.length === 0) {
  11660. this.inc('patch', identifier)
  11661. }
  11662. this.inc('pre', identifier)
  11663. break
  11664. case 'major':
  11665. // If this is a pre-major version, bump up to the same major version.
  11666. // Otherwise increment major.
  11667. // 1.0.0-5 bumps to 1.0.0
  11668. // 1.1.0 bumps to 2.0.0
  11669. if (this.minor !== 0 ||
  11670. this.patch !== 0 ||
  11671. this.prerelease.length === 0) {
  11672. this.major++
  11673. }
  11674. this.minor = 0
  11675. this.patch = 0
  11676. this.prerelease = []
  11677. break
  11678. case 'minor':
  11679. // If this is a pre-minor version, bump up to the same minor version.
  11680. // Otherwise increment minor.
  11681. // 1.2.0-5 bumps to 1.2.0
  11682. // 1.2.1 bumps to 1.3.0
  11683. if (this.patch !== 0 || this.prerelease.length === 0) {
  11684. this.minor++
  11685. }
  11686. this.patch = 0
  11687. this.prerelease = []
  11688. break
  11689. case 'patch':
  11690. // If this is not a pre-release version, it will increment the patch.
  11691. // If it is a pre-release it will bump up to the same patch version.
  11692. // 1.2.0-5 patches to 1.2.0
  11693. // 1.2.0 patches to 1.2.1
  11694. if (this.prerelease.length === 0) {
  11695. this.patch++
  11696. }
  11697. this.prerelease = []
  11698. break
  11699. // This probably shouldn't be used publicly.
  11700. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  11701. case 'pre':
  11702. if (this.prerelease.length === 0) {
  11703. this.prerelease = [0]
  11704. } else {
  11705. var i = this.prerelease.length
  11706. while (--i >= 0) {
  11707. if (typeof this.prerelease[i] === 'number') {
  11708. this.prerelease[i]++
  11709. i = -2
  11710. }
  11711. }
  11712. if (i === -1) {
  11713. // didn't increment anything
  11714. this.prerelease.push(0)
  11715. }
  11716. }
  11717. if (identifier) {
  11718. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  11719. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  11720. if (this.prerelease[0] === identifier) {
  11721. if (isNaN(this.prerelease[1])) {
  11722. this.prerelease = [identifier, 0]
  11723. }
  11724. } else {
  11725. this.prerelease = [identifier, 0]
  11726. }
  11727. }
  11728. break
  11729. default:
  11730. throw new Error('invalid increment argument: ' + release)
  11731. }
  11732. this.format()
  11733. this.raw = this.version
  11734. return this
  11735. }
  11736. exports.inc = inc
  11737. function inc (version, release, loose, identifier) {
  11738. if (typeof (loose) === 'string') {
  11739. identifier = loose
  11740. loose = undefined
  11741. }
  11742. try {
  11743. return new SemVer(version, loose).inc(release, identifier).version
  11744. } catch (er) {
  11745. return null
  11746. }
  11747. }
  11748. exports.diff = diff
  11749. function diff (version1, version2) {
  11750. if (eq(version1, version2)) {
  11751. return null
  11752. } else {
  11753. var v1 = parse(version1)
  11754. var v2 = parse(version2)
  11755. var prefix = ''
  11756. if (v1.prerelease.length || v2.prerelease.length) {
  11757. prefix = 'pre'
  11758. var defaultResult = 'prerelease'
  11759. }
  11760. for (var key in v1) {
  11761. if (key === 'major' || key === 'minor' || key === 'patch') {
  11762. if (v1[key] !== v2[key]) {
  11763. return prefix + key
  11764. }
  11765. }
  11766. }
  11767. return defaultResult // may be undefined
  11768. }
  11769. }
  11770. exports.compareIdentifiers = compareIdentifiers
  11771. var numeric = /^[0-9]+$/
  11772. function compareIdentifiers (a, b) {
  11773. var anum = numeric.test(a)
  11774. var bnum = numeric.test(b)
  11775. if (anum && bnum) {
  11776. a = +a
  11777. b = +b
  11778. }
  11779. return a === b ? 0
  11780. : (anum && !bnum) ? -1
  11781. : (bnum && !anum) ? 1
  11782. : a < b ? -1
  11783. : 1
  11784. }
  11785. exports.rcompareIdentifiers = rcompareIdentifiers
  11786. function rcompareIdentifiers (a, b) {
  11787. return compareIdentifiers(b, a)
  11788. }
  11789. exports.major = major
  11790. function major (a, loose) {
  11791. return new SemVer(a, loose).major
  11792. }
  11793. exports.minor = minor
  11794. function minor (a, loose) {
  11795. return new SemVer(a, loose).minor
  11796. }
  11797. exports.patch = patch
  11798. function patch (a, loose) {
  11799. return new SemVer(a, loose).patch
  11800. }
  11801. exports.compare = compare
  11802. function compare (a, b, loose) {
  11803. return new SemVer(a, loose).compare(new SemVer(b, loose))
  11804. }
  11805. exports.compareLoose = compareLoose
  11806. function compareLoose (a, b) {
  11807. return compare(a, b, true)
  11808. }
  11809. exports.compareBuild = compareBuild
  11810. function compareBuild (a, b, loose) {
  11811. var versionA = new SemVer(a, loose)
  11812. var versionB = new SemVer(b, loose)
  11813. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  11814. }
  11815. exports.rcompare = rcompare
  11816. function rcompare (a, b, loose) {
  11817. return compare(b, a, loose)
  11818. }
  11819. exports.sort = sort
  11820. function sort (list, loose) {
  11821. return list.sort(function (a, b) {
  11822. return exports.compareBuild(a, b, loose)
  11823. })
  11824. }
  11825. exports.rsort = rsort
  11826. function rsort (list, loose) {
  11827. return list.sort(function (a, b) {
  11828. return exports.compareBuild(b, a, loose)
  11829. })
  11830. }
  11831. exports.gt = gt
  11832. function gt (a, b, loose) {
  11833. return compare(a, b, loose) > 0
  11834. }
  11835. exports.lt = lt
  11836. function lt (a, b, loose) {
  11837. return compare(a, b, loose) < 0
  11838. }
  11839. exports.eq = eq
  11840. function eq (a, b, loose) {
  11841. return compare(a, b, loose) === 0
  11842. }
  11843. exports.neq = neq
  11844. function neq (a, b, loose) {
  11845. return compare(a, b, loose) !== 0
  11846. }
  11847. exports.gte = gte
  11848. function gte (a, b, loose) {
  11849. return compare(a, b, loose) >= 0
  11850. }
  11851. exports.lte = lte
  11852. function lte (a, b, loose) {
  11853. return compare(a, b, loose) <= 0
  11854. }
  11855. exports.cmp = cmp
  11856. function cmp (a, op, b, loose) {
  11857. switch (op) {
  11858. case '===':
  11859. if (typeof a === 'object')
  11860. a = a.version
  11861. if (typeof b === 'object')
  11862. b = b.version
  11863. return a === b
  11864. case '!==':
  11865. if (typeof a === 'object')
  11866. a = a.version
  11867. if (typeof b === 'object')
  11868. b = b.version
  11869. return a !== b
  11870. case '':
  11871. case '=':
  11872. case '==':
  11873. return eq(a, b, loose)
  11874. case '!=':
  11875. return neq(a, b, loose)
  11876. case '>':
  11877. return gt(a, b, loose)
  11878. case '>=':
  11879. return gte(a, b, loose)
  11880. case '<':
  11881. return lt(a, b, loose)
  11882. case '<=':
  11883. return lte(a, b, loose)
  11884. default:
  11885. throw new TypeError('Invalid operator: ' + op)
  11886. }
  11887. }
  11888. exports.Comparator = Comparator
  11889. function Comparator (comp, options) {
  11890. if (!options || typeof options !== 'object') {
  11891. options = {
  11892. loose: !!options,
  11893. includePrerelease: false
  11894. }
  11895. }
  11896. if (comp instanceof Comparator) {
  11897. if (comp.loose === !!options.loose) {
  11898. return comp
  11899. } else {
  11900. comp = comp.value
  11901. }
  11902. }
  11903. if (!(this instanceof Comparator)) {
  11904. return new Comparator(comp, options)
  11905. }
  11906. comp = comp.trim().split(/\s+/).join(' ')
  11907. debug('comparator', comp, options)
  11908. this.options = options
  11909. this.loose = !!options.loose
  11910. this.parse(comp)
  11911. if (this.semver === ANY) {
  11912. this.value = ''
  11913. } else {
  11914. this.value = this.operator + this.semver.version
  11915. }
  11916. debug('comp', this)
  11917. }
  11918. var ANY = {}
  11919. Comparator.prototype.parse = function (comp) {
  11920. var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  11921. var m = comp.match(r)
  11922. if (!m) {
  11923. throw new TypeError('Invalid comparator: ' + comp)
  11924. }
  11925. this.operator = m[1] !== undefined ? m[1] : ''
  11926. if (this.operator === '=') {
  11927. this.operator = ''
  11928. }
  11929. // if it literally is just '>' or '' then allow anything.
  11930. if (!m[2]) {
  11931. this.semver = ANY
  11932. } else {
  11933. this.semver = new SemVer(m[2], this.options.loose)
  11934. }
  11935. }
  11936. Comparator.prototype.toString = function () {
  11937. return this.value
  11938. }
  11939. Comparator.prototype.test = function (version) {
  11940. debug('Comparator.test', version, this.options.loose)
  11941. if (this.semver === ANY || version === ANY) {
  11942. return true
  11943. }
  11944. if (typeof version === 'string') {
  11945. try {
  11946. version = new SemVer(version, this.options)
  11947. } catch (er) {
  11948. return false
  11949. }
  11950. }
  11951. return cmp(version, this.operator, this.semver, this.options)
  11952. }
  11953. Comparator.prototype.intersects = function (comp, options) {
  11954. if (!(comp instanceof Comparator)) {
  11955. throw new TypeError('a Comparator is required')
  11956. }
  11957. if (!options || typeof options !== 'object') {
  11958. options = {
  11959. loose: !!options,
  11960. includePrerelease: false
  11961. }
  11962. }
  11963. var rangeTmp
  11964. if (this.operator === '') {
  11965. if (this.value === '') {
  11966. return true
  11967. }
  11968. rangeTmp = new Range(comp.value, options)
  11969. return satisfies(this.value, rangeTmp, options)
  11970. } else if (comp.operator === '') {
  11971. if (comp.value === '') {
  11972. return true
  11973. }
  11974. rangeTmp = new Range(this.value, options)
  11975. return satisfies(comp.semver, rangeTmp, options)
  11976. }
  11977. var sameDirectionIncreasing =
  11978. (this.operator === '>=' || this.operator === '>') &&
  11979. (comp.operator === '>=' || comp.operator === '>')
  11980. var sameDirectionDecreasing =
  11981. (this.operator === '<=' || this.operator === '<') &&
  11982. (comp.operator === '<=' || comp.operator === '<')
  11983. var sameSemVer = this.semver.version === comp.semver.version
  11984. var differentDirectionsInclusive =
  11985. (this.operator === '>=' || this.operator === '<=') &&
  11986. (comp.operator === '>=' || comp.operator === '<=')
  11987. var oppositeDirectionsLessThan =
  11988. cmp(this.semver, '<', comp.semver, options) &&
  11989. ((this.operator === '>=' || this.operator === '>') &&
  11990. (comp.operator === '<=' || comp.operator === '<'))
  11991. var oppositeDirectionsGreaterThan =
  11992. cmp(this.semver, '>', comp.semver, options) &&
  11993. ((this.operator === '<=' || this.operator === '<') &&
  11994. (comp.operator === '>=' || comp.operator === '>'))
  11995. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11996. (sameSemVer && differentDirectionsInclusive) ||
  11997. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11998. }
  11999. exports.Range = Range
  12000. function Range (range, options) {
  12001. if (!options || typeof options !== 'object') {
  12002. options = {
  12003. loose: !!options,
  12004. includePrerelease: false
  12005. }
  12006. }
  12007. if (range instanceof Range) {
  12008. if (range.loose === !!options.loose &&
  12009. range.includePrerelease === !!options.includePrerelease) {
  12010. return range
  12011. } else {
  12012. return new Range(range.raw, options)
  12013. }
  12014. }
  12015. if (range instanceof Comparator) {
  12016. return new Range(range.value, options)
  12017. }
  12018. if (!(this instanceof Range)) {
  12019. return new Range(range, options)
  12020. }
  12021. this.options = options
  12022. this.loose = !!options.loose
  12023. this.includePrerelease = !!options.includePrerelease
  12024. // First reduce all whitespace as much as possible so we do not have to rely
  12025. // on potentially slow regexes like \s*. This is then stored and used for
  12026. // future error messages as well.
  12027. this.raw = range
  12028. .trim()
  12029. .split(/\s+/)
  12030. .join(' ')
  12031. // First, split based on boolean or ||
  12032. this.set = this.raw.split('||').map(function (range) {
  12033. return this.parseRange(range.trim())
  12034. }, this).filter(function (c) {
  12035. // throw out any that are not relevant for whatever reason
  12036. return c.length
  12037. })
  12038. if (!this.set.length) {
  12039. throw new TypeError('Invalid SemVer Range: ' + this.raw)
  12040. }
  12041. this.format()
  12042. }
  12043. Range.prototype.format = function () {
  12044. this.range = this.set.map(function (comps) {
  12045. return comps.join(' ').trim()
  12046. }).join('||').trim()
  12047. return this.range
  12048. }
  12049. Range.prototype.toString = function () {
  12050. return this.range
  12051. }
  12052. Range.prototype.parseRange = function (range) {
  12053. var loose = this.options.loose
  12054. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  12055. var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]
  12056. range = range.replace(hr, hyphenReplace)
  12057. debug('hyphen replace', range)
  12058. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  12059. range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)
  12060. debug('comparator trim', range, safeRe[t.COMPARATORTRIM])
  12061. // `~ 1.2.3` => `~1.2.3`
  12062. range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)
  12063. // `^ 1.2.3` => `^1.2.3`
  12064. range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)
  12065. // normalize spaces
  12066. range = range.split(/\s+/).join(' ')
  12067. // At this point, the range is completely trimmed and
  12068. // ready to be split into comparators.
  12069. var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  12070. var set = range.split(' ').map(function (comp) {
  12071. return parseComparator(comp, this.options)
  12072. }, this).join(' ').split(/\s+/)
  12073. if (this.options.loose) {
  12074. // in loose mode, throw out any that are not valid comparators
  12075. set = set.filter(function (comp) {
  12076. return !!comp.match(compRe)
  12077. })
  12078. }
  12079. set = set.map(function (comp) {
  12080. return new Comparator(comp, this.options)
  12081. }, this)
  12082. return set
  12083. }
  12084. Range.prototype.intersects = function (range, options) {
  12085. if (!(range instanceof Range)) {
  12086. throw new TypeError('a Range is required')
  12087. }
  12088. return this.set.some(function (thisComparators) {
  12089. return (
  12090. isSatisfiable(thisComparators, options) &&
  12091. range.set.some(function (rangeComparators) {
  12092. return (
  12093. isSatisfiable(rangeComparators, options) &&
  12094. thisComparators.every(function (thisComparator) {
  12095. return rangeComparators.every(function (rangeComparator) {
  12096. return thisComparator.intersects(rangeComparator, options)
  12097. })
  12098. })
  12099. )
  12100. })
  12101. )
  12102. })
  12103. }
  12104. // take a set of comparators and determine whether there
  12105. // exists a version which can satisfy it
  12106. function isSatisfiable (comparators, options) {
  12107. var result = true
  12108. var remainingComparators = comparators.slice()
  12109. var testComparator = remainingComparators.pop()
  12110. while (result && remainingComparators.length) {
  12111. result = remainingComparators.every(function (otherComparator) {
  12112. return testComparator.intersects(otherComparator, options)
  12113. })
  12114. testComparator = remainingComparators.pop()
  12115. }
  12116. return result
  12117. }
  12118. // Mostly just for testing and legacy API reasons
  12119. exports.toComparators = toComparators
  12120. function toComparators (range, options) {
  12121. return new Range(range, options).set.map(function (comp) {
  12122. return comp.map(function (c) {
  12123. return c.value
  12124. }).join(' ').trim().split(' ')
  12125. })
  12126. }
  12127. // comprised of xranges, tildes, stars, and gtlt's at this point.
  12128. // already replaced the hyphen ranges
  12129. // turn into a set of JUST comparators.
  12130. function parseComparator (comp, options) {
  12131. debug('comp', comp, options)
  12132. comp = replaceCarets(comp, options)
  12133. debug('caret', comp)
  12134. comp = replaceTildes(comp, options)
  12135. debug('tildes', comp)
  12136. comp = replaceXRanges(comp, options)
  12137. debug('xrange', comp)
  12138. comp = replaceStars(comp, options)
  12139. debug('stars', comp)
  12140. return comp
  12141. }
  12142. function isX (id) {
  12143. return !id || id.toLowerCase() === 'x' || id === '*'
  12144. }
  12145. // ~, ~> --> * (any, kinda silly)
  12146. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  12147. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  12148. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  12149. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  12150. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  12151. function replaceTildes (comp, options) {
  12152. return comp.trim().split(/\s+/).map(function (comp) {
  12153. return replaceTilde(comp, options)
  12154. }).join(' ')
  12155. }
  12156. function replaceTilde (comp, options) {
  12157. var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]
  12158. return comp.replace(r, function (_, M, m, p, pr) {
  12159. debug('tilde', comp, _, M, m, p, pr)
  12160. var ret
  12161. if (isX(M)) {
  12162. ret = ''
  12163. } else if (isX(m)) {
  12164. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  12165. } else if (isX(p)) {
  12166. // ~1.2 == >=1.2.0 <1.3.0
  12167. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  12168. } else if (pr) {
  12169. debug('replaceTilde pr', pr)
  12170. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12171. ' <' + M + '.' + (+m + 1) + '.0'
  12172. } else {
  12173. // ~1.2.3 == >=1.2.3 <1.3.0
  12174. ret = '>=' + M + '.' + m + '.' + p +
  12175. ' <' + M + '.' + (+m + 1) + '.0'
  12176. }
  12177. debug('tilde return', ret)
  12178. return ret
  12179. })
  12180. }
  12181. // ^ --> * (any, kinda silly)
  12182. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  12183. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  12184. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  12185. // ^1.2.3 --> >=1.2.3 <2.0.0
  12186. // ^1.2.0 --> >=1.2.0 <2.0.0
  12187. function replaceCarets (comp, options) {
  12188. return comp.trim().split(/\s+/).map(function (comp) {
  12189. return replaceCaret(comp, options)
  12190. }).join(' ')
  12191. }
  12192. function replaceCaret (comp, options) {
  12193. debug('caret', comp, options)
  12194. var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]
  12195. return comp.replace(r, function (_, M, m, p, pr) {
  12196. debug('caret', comp, _, M, m, p, pr)
  12197. var ret
  12198. if (isX(M)) {
  12199. ret = ''
  12200. } else if (isX(m)) {
  12201. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  12202. } else if (isX(p)) {
  12203. if (M === '0') {
  12204. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  12205. } else {
  12206. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  12207. }
  12208. } else if (pr) {
  12209. debug('replaceCaret pr', pr)
  12210. if (M === '0') {
  12211. if (m === '0') {
  12212. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12213. ' <' + M + '.' + m + '.' + (+p + 1)
  12214. } else {
  12215. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12216. ' <' + M + '.' + (+m + 1) + '.0'
  12217. }
  12218. } else {
  12219. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12220. ' <' + (+M + 1) + '.0.0'
  12221. }
  12222. } else {
  12223. debug('no pr')
  12224. if (M === '0') {
  12225. if (m === '0') {
  12226. ret = '>=' + M + '.' + m + '.' + p +
  12227. ' <' + M + '.' + m + '.' + (+p + 1)
  12228. } else {
  12229. ret = '>=' + M + '.' + m + '.' + p +
  12230. ' <' + M + '.' + (+m + 1) + '.0'
  12231. }
  12232. } else {
  12233. ret = '>=' + M + '.' + m + '.' + p +
  12234. ' <' + (+M + 1) + '.0.0'
  12235. }
  12236. }
  12237. debug('caret return', ret)
  12238. return ret
  12239. })
  12240. }
  12241. function replaceXRanges (comp, options) {
  12242. debug('replaceXRanges', comp, options)
  12243. return comp.split(/\s+/).map(function (comp) {
  12244. return replaceXRange(comp, options)
  12245. }).join(' ')
  12246. }
  12247. function replaceXRange (comp, options) {
  12248. comp = comp.trim()
  12249. var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]
  12250. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  12251. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  12252. var xM = isX(M)
  12253. var xm = xM || isX(m)
  12254. var xp = xm || isX(p)
  12255. var anyX = xp
  12256. if (gtlt === '=' && anyX) {
  12257. gtlt = ''
  12258. }
  12259. // if we're including prereleases in the match, then we need
  12260. // to fix this to -0, the lowest possible prerelease value
  12261. pr = options.includePrerelease ? '-0' : ''
  12262. if (xM) {
  12263. if (gtlt === '>' || gtlt === '<') {
  12264. // nothing is allowed
  12265. ret = '<0.0.0-0'
  12266. } else {
  12267. // nothing is forbidden
  12268. ret = '*'
  12269. }
  12270. } else if (gtlt && anyX) {
  12271. // we know patch is an x, because we have any x at all.
  12272. // replace X with 0
  12273. if (xm) {
  12274. m = 0
  12275. }
  12276. p = 0
  12277. if (gtlt === '>') {
  12278. // >1 => >=2.0.0
  12279. // >1.2 => >=1.3.0
  12280. // >1.2.3 => >= 1.2.4
  12281. gtlt = '>='
  12282. if (xm) {
  12283. M = +M + 1
  12284. m = 0
  12285. p = 0
  12286. } else {
  12287. m = +m + 1
  12288. p = 0
  12289. }
  12290. } else if (gtlt === '<=') {
  12291. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  12292. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  12293. gtlt = '<'
  12294. if (xm) {
  12295. M = +M + 1
  12296. } else {
  12297. m = +m + 1
  12298. }
  12299. }
  12300. ret = gtlt + M + '.' + m + '.' + p + pr
  12301. } else if (xm) {
  12302. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  12303. } else if (xp) {
  12304. ret = '>=' + M + '.' + m + '.0' + pr +
  12305. ' <' + M + '.' + (+m + 1) + '.0' + pr
  12306. }
  12307. debug('xRange return', ret)
  12308. return ret
  12309. })
  12310. }
  12311. // Because * is AND-ed with everything else in the comparator,
  12312. // and '' means "any version", just remove the *s entirely.
  12313. function replaceStars (comp, options) {
  12314. debug('replaceStars', comp, options)
  12315. // Looseness is ignored here. star is always as loose as it gets!
  12316. return comp.trim().replace(safeRe[t.STAR], '')
  12317. }
  12318. // This function is passed to string.replace(re[t.HYPHENRANGE])
  12319. // M, m, patch, prerelease, build
  12320. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  12321. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  12322. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  12323. function hyphenReplace ($0,
  12324. from, fM, fm, fp, fpr, fb,
  12325. to, tM, tm, tp, tpr, tb) {
  12326. if (isX(fM)) {
  12327. from = ''
  12328. } else if (isX(fm)) {
  12329. from = '>=' + fM + '.0.0'
  12330. } else if (isX(fp)) {
  12331. from = '>=' + fM + '.' + fm + '.0'
  12332. } else {
  12333. from = '>=' + from
  12334. }
  12335. if (isX(tM)) {
  12336. to = ''
  12337. } else if (isX(tm)) {
  12338. to = '<' + (+tM + 1) + '.0.0'
  12339. } else if (isX(tp)) {
  12340. to = '<' + tM + '.' + (+tm + 1) + '.0'
  12341. } else if (tpr) {
  12342. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  12343. } else {
  12344. to = '<=' + to
  12345. }
  12346. return (from + ' ' + to).trim()
  12347. }
  12348. // if ANY of the sets match ALL of its comparators, then pass
  12349. Range.prototype.test = function (version) {
  12350. if (!version) {
  12351. return false
  12352. }
  12353. if (typeof version === 'string') {
  12354. try {
  12355. version = new SemVer(version, this.options)
  12356. } catch (er) {
  12357. return false
  12358. }
  12359. }
  12360. for (var i = 0; i < this.set.length; i++) {
  12361. if (testSet(this.set[i], version, this.options)) {
  12362. return true
  12363. }
  12364. }
  12365. return false
  12366. }
  12367. function testSet (set, version, options) {
  12368. for (var i = 0; i < set.length; i++) {
  12369. if (!set[i].test(version)) {
  12370. return false
  12371. }
  12372. }
  12373. if (version.prerelease.length && !options.includePrerelease) {
  12374. // Find the set of versions that are allowed to have prereleases
  12375. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  12376. // That should allow `1.2.3-pr.2` to pass.
  12377. // However, `1.2.4-alpha.notready` should NOT be allowed,
  12378. // even though it's within the range set by the comparators.
  12379. for (i = 0; i < set.length; i++) {
  12380. debug(set[i].semver)
  12381. if (set[i].semver === ANY) {
  12382. continue
  12383. }
  12384. if (set[i].semver.prerelease.length > 0) {
  12385. var allowed = set[i].semver
  12386. if (allowed.major === version.major &&
  12387. allowed.minor === version.minor &&
  12388. allowed.patch === version.patch) {
  12389. return true
  12390. }
  12391. }
  12392. }
  12393. // Version has a -pre, but it's not one of the ones we like.
  12394. return false
  12395. }
  12396. return true
  12397. }
  12398. exports.satisfies = satisfies
  12399. function satisfies (version, range, options) {
  12400. try {
  12401. range = new Range(range, options)
  12402. } catch (er) {
  12403. return false
  12404. }
  12405. return range.test(version)
  12406. }
  12407. exports.maxSatisfying = maxSatisfying
  12408. function maxSatisfying (versions, range, options) {
  12409. var max = null
  12410. var maxSV = null
  12411. try {
  12412. var rangeObj = new Range(range, options)
  12413. } catch (er) {
  12414. return null
  12415. }
  12416. versions.forEach(function (v) {
  12417. if (rangeObj.test(v)) {
  12418. // satisfies(v, range, options)
  12419. if (!max || maxSV.compare(v) === -1) {
  12420. // compare(max, v, true)
  12421. max = v
  12422. maxSV = new SemVer(max, options)
  12423. }
  12424. }
  12425. })
  12426. return max
  12427. }
  12428. exports.minSatisfying = minSatisfying
  12429. function minSatisfying (versions, range, options) {
  12430. var min = null
  12431. var minSV = null
  12432. try {
  12433. var rangeObj = new Range(range, options)
  12434. } catch (er) {
  12435. return null
  12436. }
  12437. versions.forEach(function (v) {
  12438. if (rangeObj.test(v)) {
  12439. // satisfies(v, range, options)
  12440. if (!min || minSV.compare(v) === 1) {
  12441. // compare(min, v, true)
  12442. min = v
  12443. minSV = new SemVer(min, options)
  12444. }
  12445. }
  12446. })
  12447. return min
  12448. }
  12449. exports.minVersion = minVersion
  12450. function minVersion (range, loose) {
  12451. range = new Range(range, loose)
  12452. var minver = new SemVer('0.0.0')
  12453. if (range.test(minver)) {
  12454. return minver
  12455. }
  12456. minver = new SemVer('0.0.0-0')
  12457. if (range.test(minver)) {
  12458. return minver
  12459. }
  12460. minver = null
  12461. for (var i = 0; i < range.set.length; ++i) {
  12462. var comparators = range.set[i]
  12463. comparators.forEach(function (comparator) {
  12464. // Clone to avoid manipulating the comparator's semver object.
  12465. var compver = new SemVer(comparator.semver.version)
  12466. switch (comparator.operator) {
  12467. case '>':
  12468. if (compver.prerelease.length === 0) {
  12469. compver.patch++
  12470. } else {
  12471. compver.prerelease.push(0)
  12472. }
  12473. compver.raw = compver.format()
  12474. /* fallthrough */
  12475. case '':
  12476. case '>=':
  12477. if (!minver || gt(minver, compver)) {
  12478. minver = compver
  12479. }
  12480. break
  12481. case '<':
  12482. case '<=':
  12483. /* Ignore maximum versions */
  12484. break
  12485. /* istanbul ignore next */
  12486. default:
  12487. throw new Error('Unexpected operation: ' + comparator.operator)
  12488. }
  12489. })
  12490. }
  12491. if (minver && range.test(minver)) {
  12492. return minver
  12493. }
  12494. return null
  12495. }
  12496. exports.validRange = validRange
  12497. function validRange (range, options) {
  12498. try {
  12499. // Return '*' instead of '' so that truthiness works.
  12500. // This will throw if it's invalid anyway
  12501. return new Range(range, options).range || '*'
  12502. } catch (er) {
  12503. return null
  12504. }
  12505. }
  12506. // Determine if version is less than all the versions possible in the range
  12507. exports.ltr = ltr
  12508. function ltr (version, range, options) {
  12509. return outside(version, range, '<', options)
  12510. }
  12511. // Determine if version is greater than all the versions possible in the range.
  12512. exports.gtr = gtr
  12513. function gtr (version, range, options) {
  12514. return outside(version, range, '>', options)
  12515. }
  12516. exports.outside = outside
  12517. function outside (version, range, hilo, options) {
  12518. version = new SemVer(version, options)
  12519. range = new Range(range, options)
  12520. var gtfn, ltefn, ltfn, comp, ecomp
  12521. switch (hilo) {
  12522. case '>':
  12523. gtfn = gt
  12524. ltefn = lte
  12525. ltfn = lt
  12526. comp = '>'
  12527. ecomp = '>='
  12528. break
  12529. case '<':
  12530. gtfn = lt
  12531. ltefn = gte
  12532. ltfn = gt
  12533. comp = '<'
  12534. ecomp = '<='
  12535. break
  12536. default:
  12537. throw new TypeError('Must provide a hilo val of "<" or ">"')
  12538. }
  12539. // If it satisifes the range it is not outside
  12540. if (satisfies(version, range, options)) {
  12541. return false
  12542. }
  12543. // From now on, variable terms are as if we're in "gtr" mode.
  12544. // but note that everything is flipped for the "ltr" function.
  12545. for (var i = 0; i < range.set.length; ++i) {
  12546. var comparators = range.set[i]
  12547. var high = null
  12548. var low = null
  12549. comparators.forEach(function (comparator) {
  12550. if (comparator.semver === ANY) {
  12551. comparator = new Comparator('>=0.0.0')
  12552. }
  12553. high = high || comparator
  12554. low = low || comparator
  12555. if (gtfn(comparator.semver, high.semver, options)) {
  12556. high = comparator
  12557. } else if (ltfn(comparator.semver, low.semver, options)) {
  12558. low = comparator
  12559. }
  12560. })
  12561. // If the edge version comparator has a operator then our version
  12562. // isn't outside it
  12563. if (high.operator === comp || high.operator === ecomp) {
  12564. return false
  12565. }
  12566. // If the lowest version comparator has an operator and our version
  12567. // is less than it then it isn't higher than the range
  12568. if ((!low.operator || low.operator === comp) &&
  12569. ltefn(version, low.semver)) {
  12570. return false
  12571. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  12572. return false
  12573. }
  12574. }
  12575. return true
  12576. }
  12577. exports.prerelease = prerelease
  12578. function prerelease (version, options) {
  12579. var parsed = parse(version, options)
  12580. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  12581. }
  12582. exports.intersects = intersects
  12583. function intersects (r1, r2, options) {
  12584. r1 = new Range(r1, options)
  12585. r2 = new Range(r2, options)
  12586. return r1.intersects(r2)
  12587. }
  12588. exports.coerce = coerce
  12589. function coerce (version, options) {
  12590. if (version instanceof SemVer) {
  12591. return version
  12592. }
  12593. if (typeof version === 'number') {
  12594. version = String(version)
  12595. }
  12596. if (typeof version !== 'string') {
  12597. return null
  12598. }
  12599. options = options || {}
  12600. var match = null
  12601. if (!options.rtl) {
  12602. match = version.match(safeRe[t.COERCE])
  12603. } else {
  12604. // Find the right-most coercible string that does not share
  12605. // a terminus with a more left-ward coercible string.
  12606. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  12607. //
  12608. // Walk through the string checking with a /g regexp
  12609. // Manually set the index so as to pick up overlapping matches.
  12610. // Stop when we get a match that ends at the string end, since no
  12611. // coercible string can be more right-ward without the same terminus.
  12612. var next
  12613. while ((next = safeRe[t.COERCERTL].exec(version)) &&
  12614. (!match || match.index + match[0].length !== version.length)
  12615. ) {
  12616. if (!match ||
  12617. next.index + next[0].length !== match.index + match[0].length) {
  12618. match = next
  12619. }
  12620. safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  12621. }
  12622. // leave it in a clean state
  12623. safeRe[t.COERCERTL].lastIndex = -1
  12624. }
  12625. if (match === null) {
  12626. return null
  12627. }
  12628. return parse(match[2] +
  12629. '.' + (match[3] || '0') +
  12630. '.' + (match[4] || '0'), options)
  12631. }
  12632. /***/ }),
  12633. /***/ 4294:
  12634. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12635. module.exports = __nccwpck_require__(4219);
  12636. /***/ }),
  12637. /***/ 4219:
  12638. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  12639. "use strict";
  12640. var net = __nccwpck_require__(1808);
  12641. var tls = __nccwpck_require__(4404);
  12642. var http = __nccwpck_require__(3685);
  12643. var https = __nccwpck_require__(5687);
  12644. var events = __nccwpck_require__(2361);
  12645. var assert = __nccwpck_require__(9491);
  12646. var util = __nccwpck_require__(3837);
  12647. exports.httpOverHttp = httpOverHttp;
  12648. exports.httpsOverHttp = httpsOverHttp;
  12649. exports.httpOverHttps = httpOverHttps;
  12650. exports.httpsOverHttps = httpsOverHttps;
  12651. function httpOverHttp(options) {
  12652. var agent = new TunnelingAgent(options);
  12653. agent.request = http.request;
  12654. return agent;
  12655. }
  12656. function httpsOverHttp(options) {
  12657. var agent = new TunnelingAgent(options);
  12658. agent.request = http.request;
  12659. agent.createSocket = createSecureSocket;
  12660. agent.defaultPort = 443;
  12661. return agent;
  12662. }
  12663. function httpOverHttps(options) {
  12664. var agent = new TunnelingAgent(options);
  12665. agent.request = https.request;
  12666. return agent;
  12667. }
  12668. function httpsOverHttps(options) {
  12669. var agent = new TunnelingAgent(options);
  12670. agent.request = https.request;
  12671. agent.createSocket = createSecureSocket;
  12672. agent.defaultPort = 443;
  12673. return agent;
  12674. }
  12675. function TunnelingAgent(options) {
  12676. var self = this;
  12677. self.options = options || {};
  12678. self.proxyOptions = self.options.proxy || {};
  12679. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  12680. self.requests = [];
  12681. self.sockets = [];
  12682. self.on('free', function onFree(socket, host, port, localAddress) {
  12683. var options = toOptions(host, port, localAddress);
  12684. for (var i = 0, len = self.requests.length; i < len; ++i) {
  12685. var pending = self.requests[i];
  12686. if (pending.host === options.host && pending.port === options.port) {
  12687. // Detect the request to connect same origin server,
  12688. // reuse the connection.
  12689. self.requests.splice(i, 1);
  12690. pending.request.onSocket(socket);
  12691. return;
  12692. }
  12693. }
  12694. socket.destroy();
  12695. self.removeSocket(socket);
  12696. });
  12697. }
  12698. util.inherits(TunnelingAgent, events.EventEmitter);
  12699. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  12700. var self = this;
  12701. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  12702. if (self.sockets.length >= this.maxSockets) {
  12703. // We are over limit so we'll add it to the queue.
  12704. self.requests.push(options);
  12705. return;
  12706. }
  12707. // If we are under maxSockets create a new one.
  12708. self.createSocket(options, function(socket) {
  12709. socket.on('free', onFree);
  12710. socket.on('close', onCloseOrRemove);
  12711. socket.on('agentRemove', onCloseOrRemove);
  12712. req.onSocket(socket);
  12713. function onFree() {
  12714. self.emit('free', socket, options);
  12715. }
  12716. function onCloseOrRemove(err) {
  12717. self.removeSocket(socket);
  12718. socket.removeListener('free', onFree);
  12719. socket.removeListener('close', onCloseOrRemove);
  12720. socket.removeListener('agentRemove', onCloseOrRemove);
  12721. }
  12722. });
  12723. };
  12724. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  12725. var self = this;
  12726. var placeholder = {};
  12727. self.sockets.push(placeholder);
  12728. var connectOptions = mergeOptions({}, self.proxyOptions, {
  12729. method: 'CONNECT',
  12730. path: options.host + ':' + options.port,
  12731. agent: false,
  12732. headers: {
  12733. host: options.host + ':' + options.port
  12734. }
  12735. });
  12736. if (options.localAddress) {
  12737. connectOptions.localAddress = options.localAddress;
  12738. }
  12739. if (connectOptions.proxyAuth) {
  12740. connectOptions.headers = connectOptions.headers || {};
  12741. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  12742. new Buffer(connectOptions.proxyAuth).toString('base64');
  12743. }
  12744. debug('making CONNECT request');
  12745. var connectReq = self.request(connectOptions);
  12746. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  12747. connectReq.once('response', onResponse); // for v0.6
  12748. connectReq.once('upgrade', onUpgrade); // for v0.6
  12749. connectReq.once('connect', onConnect); // for v0.7 or later
  12750. connectReq.once('error', onError);
  12751. connectReq.end();
  12752. function onResponse(res) {
  12753. // Very hacky. This is necessary to avoid http-parser leaks.
  12754. res.upgrade = true;
  12755. }
  12756. function onUpgrade(res, socket, head) {
  12757. // Hacky.
  12758. process.nextTick(function() {
  12759. onConnect(res, socket, head);
  12760. });
  12761. }
  12762. function onConnect(res, socket, head) {
  12763. connectReq.removeAllListeners();
  12764. socket.removeAllListeners();
  12765. if (res.statusCode !== 200) {
  12766. debug('tunneling socket could not be established, statusCode=%d',
  12767. res.statusCode);
  12768. socket.destroy();
  12769. var error = new Error('tunneling socket could not be established, ' +
  12770. 'statusCode=' + res.statusCode);
  12771. error.code = 'ECONNRESET';
  12772. options.request.emit('error', error);
  12773. self.removeSocket(placeholder);
  12774. return;
  12775. }
  12776. if (head.length > 0) {
  12777. debug('got illegal response body from proxy');
  12778. socket.destroy();
  12779. var error = new Error('got illegal response body from proxy');
  12780. error.code = 'ECONNRESET';
  12781. options.request.emit('error', error);
  12782. self.removeSocket(placeholder);
  12783. return;
  12784. }
  12785. debug('tunneling connection has established');
  12786. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  12787. return cb(socket);
  12788. }
  12789. function onError(cause) {
  12790. connectReq.removeAllListeners();
  12791. debug('tunneling socket could not be established, cause=%s\n',
  12792. cause.message, cause.stack);
  12793. var error = new Error('tunneling socket could not be established, ' +
  12794. 'cause=' + cause.message);
  12795. error.code = 'ECONNRESET';
  12796. options.request.emit('error', error);
  12797. self.removeSocket(placeholder);
  12798. }
  12799. };
  12800. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  12801. var pos = this.sockets.indexOf(socket)
  12802. if (pos === -1) {
  12803. return;
  12804. }
  12805. this.sockets.splice(pos, 1);
  12806. var pending = this.requests.shift();
  12807. if (pending) {
  12808. // If we have pending requests and a socket gets closed a new one
  12809. // needs to be created to take over in the pool for the one that closed.
  12810. this.createSocket(pending, function(socket) {
  12811. pending.request.onSocket(socket);
  12812. });
  12813. }
  12814. };
  12815. function createSecureSocket(options, cb) {
  12816. var self = this;
  12817. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  12818. var hostHeader = options.request.getHeader('host');
  12819. var tlsOptions = mergeOptions({}, self.options, {
  12820. socket: socket,
  12821. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  12822. });
  12823. // 0 is dummy port for v0.6
  12824. var secureSocket = tls.connect(0, tlsOptions);
  12825. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  12826. cb(secureSocket);
  12827. });
  12828. }
  12829. function toOptions(host, port, localAddress) {
  12830. if (typeof host === 'string') { // since v0.10
  12831. return {
  12832. host: host,
  12833. port: port,
  12834. localAddress: localAddress
  12835. };
  12836. }
  12837. return host; // for v0.11 or later
  12838. }
  12839. function mergeOptions(target) {
  12840. for (var i = 1, len = arguments.length; i < len; ++i) {
  12841. var overrides = arguments[i];
  12842. if (typeof overrides === 'object') {
  12843. var keys = Object.keys(overrides);
  12844. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  12845. var k = keys[j];
  12846. if (overrides[k] !== undefined) {
  12847. target[k] = overrides[k];
  12848. }
  12849. }
  12850. }
  12851. }
  12852. return target;
  12853. }
  12854. var debug;
  12855. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  12856. debug = function() {
  12857. var args = Array.prototype.slice.call(arguments);
  12858. if (typeof args[0] === 'string') {
  12859. args[0] = 'TUNNEL: ' + args[0];
  12860. } else {
  12861. args.unshift('TUNNEL:');
  12862. }
  12863. console.error.apply(console, args);
  12864. }
  12865. } else {
  12866. debug = function() {};
  12867. }
  12868. exports.debug = debug; // for test
  12869. /***/ }),
  12870. /***/ 1773:
  12871. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12872. "use strict";
  12873. const Client = __nccwpck_require__(3598)
  12874. const Dispatcher = __nccwpck_require__(412)
  12875. const errors = __nccwpck_require__(8045)
  12876. const Pool = __nccwpck_require__(4634)
  12877. const BalancedPool = __nccwpck_require__(7931)
  12878. const Agent = __nccwpck_require__(7890)
  12879. const util = __nccwpck_require__(3983)
  12880. const { InvalidArgumentError } = errors
  12881. const api = __nccwpck_require__(4059)
  12882. const buildConnector = __nccwpck_require__(2067)
  12883. const MockClient = __nccwpck_require__(8687)
  12884. const MockAgent = __nccwpck_require__(6771)
  12885. const MockPool = __nccwpck_require__(6193)
  12886. const mockErrors = __nccwpck_require__(888)
  12887. const ProxyAgent = __nccwpck_require__(7858)
  12888. const RetryHandler = __nccwpck_require__(2286)
  12889. const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1892)
  12890. const DecoratorHandler = __nccwpck_require__(6930)
  12891. const RedirectHandler = __nccwpck_require__(2860)
  12892. const createRedirectInterceptor = __nccwpck_require__(8861)
  12893. let hasCrypto
  12894. try {
  12895. __nccwpck_require__(6113)
  12896. hasCrypto = true
  12897. } catch {
  12898. hasCrypto = false
  12899. }
  12900. Object.assign(Dispatcher.prototype, api)
  12901. module.exports.Dispatcher = Dispatcher
  12902. module.exports.Client = Client
  12903. module.exports.Pool = Pool
  12904. module.exports.BalancedPool = BalancedPool
  12905. module.exports.Agent = Agent
  12906. module.exports.ProxyAgent = ProxyAgent
  12907. module.exports.RetryHandler = RetryHandler
  12908. module.exports.DecoratorHandler = DecoratorHandler
  12909. module.exports.RedirectHandler = RedirectHandler
  12910. module.exports.createRedirectInterceptor = createRedirectInterceptor
  12911. module.exports.buildConnector = buildConnector
  12912. module.exports.errors = errors
  12913. function makeDispatcher (fn) {
  12914. return (url, opts, handler) => {
  12915. if (typeof opts === 'function') {
  12916. handler = opts
  12917. opts = null
  12918. }
  12919. if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {
  12920. throw new InvalidArgumentError('invalid url')
  12921. }
  12922. if (opts != null && typeof opts !== 'object') {
  12923. throw new InvalidArgumentError('invalid opts')
  12924. }
  12925. if (opts && opts.path != null) {
  12926. if (typeof opts.path !== 'string') {
  12927. throw new InvalidArgumentError('invalid opts.path')
  12928. }
  12929. let path = opts.path
  12930. if (!opts.path.startsWith('/')) {
  12931. path = `/${path}`
  12932. }
  12933. url = new URL(util.parseOrigin(url).origin + path)
  12934. } else {
  12935. if (!opts) {
  12936. opts = typeof url === 'object' ? url : {}
  12937. }
  12938. url = util.parseURL(url)
  12939. }
  12940. const { agent, dispatcher = getGlobalDispatcher() } = opts
  12941. if (agent) {
  12942. throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
  12943. }
  12944. return fn.call(dispatcher, {
  12945. ...opts,
  12946. origin: url.origin,
  12947. path: url.search ? `${url.pathname}${url.search}` : url.pathname,
  12948. method: opts.method || (opts.body ? 'PUT' : 'GET')
  12949. }, handler)
  12950. }
  12951. }
  12952. module.exports.setGlobalDispatcher = setGlobalDispatcher
  12953. module.exports.getGlobalDispatcher = getGlobalDispatcher
  12954. if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {
  12955. let fetchImpl = null
  12956. module.exports.fetch = async function fetch (resource) {
  12957. if (!fetchImpl) {
  12958. fetchImpl = (__nccwpck_require__(4881).fetch)
  12959. }
  12960. try {
  12961. return await fetchImpl(...arguments)
  12962. } catch (err) {
  12963. if (typeof err === 'object') {
  12964. Error.captureStackTrace(err, this)
  12965. }
  12966. throw err
  12967. }
  12968. }
  12969. module.exports.Headers = __nccwpck_require__(554).Headers
  12970. module.exports.Response = __nccwpck_require__(7823).Response
  12971. module.exports.Request = __nccwpck_require__(8359).Request
  12972. module.exports.FormData = __nccwpck_require__(2015).FormData
  12973. module.exports.File = __nccwpck_require__(8511).File
  12974. module.exports.FileReader = __nccwpck_require__(1446).FileReader
  12975. const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(1246)
  12976. module.exports.setGlobalOrigin = setGlobalOrigin
  12977. module.exports.getGlobalOrigin = getGlobalOrigin
  12978. const { CacheStorage } = __nccwpck_require__(7907)
  12979. const { kConstruct } = __nccwpck_require__(9174)
  12980. // Cache & CacheStorage are tightly coupled with fetch. Even if it may run
  12981. // in an older version of Node, it doesn't have any use without fetch.
  12982. module.exports.caches = new CacheStorage(kConstruct)
  12983. }
  12984. if (util.nodeMajor >= 16) {
  12985. const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1724)
  12986. module.exports.deleteCookie = deleteCookie
  12987. module.exports.getCookies = getCookies
  12988. module.exports.getSetCookies = getSetCookies
  12989. module.exports.setCookie = setCookie
  12990. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  12991. module.exports.parseMIMEType = parseMIMEType
  12992. module.exports.serializeAMimeType = serializeAMimeType
  12993. }
  12994. if (util.nodeMajor >= 18 && hasCrypto) {
  12995. const { WebSocket } = __nccwpck_require__(4284)
  12996. module.exports.WebSocket = WebSocket
  12997. }
  12998. module.exports.request = makeDispatcher(api.request)
  12999. module.exports.stream = makeDispatcher(api.stream)
  13000. module.exports.pipeline = makeDispatcher(api.pipeline)
  13001. module.exports.connect = makeDispatcher(api.connect)
  13002. module.exports.upgrade = makeDispatcher(api.upgrade)
  13003. module.exports.MockClient = MockClient
  13004. module.exports.MockPool = MockPool
  13005. module.exports.MockAgent = MockAgent
  13006. module.exports.mockErrors = mockErrors
  13007. /***/ }),
  13008. /***/ 7890:
  13009. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13010. "use strict";
  13011. const { InvalidArgumentError } = __nccwpck_require__(8045)
  13012. const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  13013. const DispatcherBase = __nccwpck_require__(4839)
  13014. const Pool = __nccwpck_require__(4634)
  13015. const Client = __nccwpck_require__(3598)
  13016. const util = __nccwpck_require__(3983)
  13017. const createRedirectInterceptor = __nccwpck_require__(8861)
  13018. const { WeakRef, FinalizationRegistry } = __nccwpck_require__(6436)()
  13019. const kOnConnect = Symbol('onConnect')
  13020. const kOnDisconnect = Symbol('onDisconnect')
  13021. const kOnConnectionError = Symbol('onConnectionError')
  13022. const kMaxRedirections = Symbol('maxRedirections')
  13023. const kOnDrain = Symbol('onDrain')
  13024. const kFactory = Symbol('factory')
  13025. const kFinalizer = Symbol('finalizer')
  13026. const kOptions = Symbol('options')
  13027. function defaultFactory (origin, opts) {
  13028. return opts && opts.connections === 1
  13029. ? new Client(origin, opts)
  13030. : new Pool(origin, opts)
  13031. }
  13032. class Agent extends DispatcherBase {
  13033. constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
  13034. super()
  13035. if (typeof factory !== 'function') {
  13036. throw new InvalidArgumentError('factory must be a function.')
  13037. }
  13038. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  13039. throw new InvalidArgumentError('connect must be a function or an object')
  13040. }
  13041. if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
  13042. throw new InvalidArgumentError('maxRedirections must be a positive number')
  13043. }
  13044. if (connect && typeof connect !== 'function') {
  13045. connect = { ...connect }
  13046. }
  13047. this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent)
  13048. ? options.interceptors.Agent
  13049. : [createRedirectInterceptor({ maxRedirections })]
  13050. this[kOptions] = { ...util.deepClone(options), connect }
  13051. this[kOptions].interceptors = options.interceptors
  13052. ? { ...options.interceptors }
  13053. : undefined
  13054. this[kMaxRedirections] = maxRedirections
  13055. this[kFactory] = factory
  13056. this[kClients] = new Map()
  13057. this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => {
  13058. const ref = this[kClients].get(key)
  13059. if (ref !== undefined && ref.deref() === undefined) {
  13060. this[kClients].delete(key)
  13061. }
  13062. })
  13063. const agent = this
  13064. this[kOnDrain] = (origin, targets) => {
  13065. agent.emit('drain', origin, [agent, ...targets])
  13066. }
  13067. this[kOnConnect] = (origin, targets) => {
  13068. agent.emit('connect', origin, [agent, ...targets])
  13069. }
  13070. this[kOnDisconnect] = (origin, targets, err) => {
  13071. agent.emit('disconnect', origin, [agent, ...targets], err)
  13072. }
  13073. this[kOnConnectionError] = (origin, targets, err) => {
  13074. agent.emit('connectionError', origin, [agent, ...targets], err)
  13075. }
  13076. }
  13077. get [kRunning] () {
  13078. let ret = 0
  13079. for (const ref of this[kClients].values()) {
  13080. const client = ref.deref()
  13081. /* istanbul ignore next: gc is undeterministic */
  13082. if (client) {
  13083. ret += client[kRunning]
  13084. }
  13085. }
  13086. return ret
  13087. }
  13088. [kDispatch] (opts, handler) {
  13089. let key
  13090. if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {
  13091. key = String(opts.origin)
  13092. } else {
  13093. throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')
  13094. }
  13095. const ref = this[kClients].get(key)
  13096. let dispatcher = ref ? ref.deref() : null
  13097. if (!dispatcher) {
  13098. dispatcher = this[kFactory](opts.origin, this[kOptions])
  13099. .on('drain', this[kOnDrain])
  13100. .on('connect', this[kOnConnect])
  13101. .on('disconnect', this[kOnDisconnect])
  13102. .on('connectionError', this[kOnConnectionError])
  13103. this[kClients].set(key, new WeakRef(dispatcher))
  13104. this[kFinalizer].register(dispatcher, key)
  13105. }
  13106. return dispatcher.dispatch(opts, handler)
  13107. }
  13108. async [kClose] () {
  13109. const closePromises = []
  13110. for (const ref of this[kClients].values()) {
  13111. const client = ref.deref()
  13112. /* istanbul ignore else: gc is undeterministic */
  13113. if (client) {
  13114. closePromises.push(client.close())
  13115. }
  13116. }
  13117. await Promise.all(closePromises)
  13118. }
  13119. async [kDestroy] (err) {
  13120. const destroyPromises = []
  13121. for (const ref of this[kClients].values()) {
  13122. const client = ref.deref()
  13123. /* istanbul ignore else: gc is undeterministic */
  13124. if (client) {
  13125. destroyPromises.push(client.destroy(err))
  13126. }
  13127. }
  13128. await Promise.all(destroyPromises)
  13129. }
  13130. }
  13131. module.exports = Agent
  13132. /***/ }),
  13133. /***/ 7032:
  13134. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13135. const { addAbortListener } = __nccwpck_require__(3983)
  13136. const { RequestAbortedError } = __nccwpck_require__(8045)
  13137. const kListener = Symbol('kListener')
  13138. const kSignal = Symbol('kSignal')
  13139. function abort (self) {
  13140. if (self.abort) {
  13141. self.abort()
  13142. } else {
  13143. self.onError(new RequestAbortedError())
  13144. }
  13145. }
  13146. function addSignal (self, signal) {
  13147. self[kSignal] = null
  13148. self[kListener] = null
  13149. if (!signal) {
  13150. return
  13151. }
  13152. if (signal.aborted) {
  13153. abort(self)
  13154. return
  13155. }
  13156. self[kSignal] = signal
  13157. self[kListener] = () => {
  13158. abort(self)
  13159. }
  13160. addAbortListener(self[kSignal], self[kListener])
  13161. }
  13162. function removeSignal (self) {
  13163. if (!self[kSignal]) {
  13164. return
  13165. }
  13166. if ('removeEventListener' in self[kSignal]) {
  13167. self[kSignal].removeEventListener('abort', self[kListener])
  13168. } else {
  13169. self[kSignal].removeListener('abort', self[kListener])
  13170. }
  13171. self[kSignal] = null
  13172. self[kListener] = null
  13173. }
  13174. module.exports = {
  13175. addSignal,
  13176. removeSignal
  13177. }
  13178. /***/ }),
  13179. /***/ 9744:
  13180. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13181. "use strict";
  13182. const { AsyncResource } = __nccwpck_require__(852)
  13183. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13184. const util = __nccwpck_require__(3983)
  13185. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13186. class ConnectHandler extends AsyncResource {
  13187. constructor (opts, callback) {
  13188. if (!opts || typeof opts !== 'object') {
  13189. throw new InvalidArgumentError('invalid opts')
  13190. }
  13191. if (typeof callback !== 'function') {
  13192. throw new InvalidArgumentError('invalid callback')
  13193. }
  13194. const { signal, opaque, responseHeaders } = opts
  13195. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13196. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13197. }
  13198. super('UNDICI_CONNECT')
  13199. this.opaque = opaque || null
  13200. this.responseHeaders = responseHeaders || null
  13201. this.callback = callback
  13202. this.abort = null
  13203. addSignal(this, signal)
  13204. }
  13205. onConnect (abort, context) {
  13206. if (!this.callback) {
  13207. throw new RequestAbortedError()
  13208. }
  13209. this.abort = abort
  13210. this.context = context
  13211. }
  13212. onHeaders () {
  13213. throw new SocketError('bad connect', null)
  13214. }
  13215. onUpgrade (statusCode, rawHeaders, socket) {
  13216. const { callback, opaque, context } = this
  13217. removeSignal(this)
  13218. this.callback = null
  13219. let headers = rawHeaders
  13220. // Indicates is an HTTP2Session
  13221. if (headers != null) {
  13222. headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13223. }
  13224. this.runInAsyncScope(callback, null, null, {
  13225. statusCode,
  13226. headers,
  13227. socket,
  13228. opaque,
  13229. context
  13230. })
  13231. }
  13232. onError (err) {
  13233. const { callback, opaque } = this
  13234. removeSignal(this)
  13235. if (callback) {
  13236. this.callback = null
  13237. queueMicrotask(() => {
  13238. this.runInAsyncScope(callback, null, err, { opaque })
  13239. })
  13240. }
  13241. }
  13242. }
  13243. function connect (opts, callback) {
  13244. if (callback === undefined) {
  13245. return new Promise((resolve, reject) => {
  13246. connect.call(this, opts, (err, data) => {
  13247. return err ? reject(err) : resolve(data)
  13248. })
  13249. })
  13250. }
  13251. try {
  13252. const connectHandler = new ConnectHandler(opts, callback)
  13253. this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)
  13254. } catch (err) {
  13255. if (typeof callback !== 'function') {
  13256. throw err
  13257. }
  13258. const opaque = opts && opts.opaque
  13259. queueMicrotask(() => callback(err, { opaque }))
  13260. }
  13261. }
  13262. module.exports = connect
  13263. /***/ }),
  13264. /***/ 8752:
  13265. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13266. "use strict";
  13267. const {
  13268. Readable,
  13269. Duplex,
  13270. PassThrough
  13271. } = __nccwpck_require__(2781)
  13272. const {
  13273. InvalidArgumentError,
  13274. InvalidReturnValueError,
  13275. RequestAbortedError
  13276. } = __nccwpck_require__(8045)
  13277. const util = __nccwpck_require__(3983)
  13278. const { AsyncResource } = __nccwpck_require__(852)
  13279. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13280. const assert = __nccwpck_require__(9491)
  13281. const kResume = Symbol('resume')
  13282. class PipelineRequest extends Readable {
  13283. constructor () {
  13284. super({ autoDestroy: true })
  13285. this[kResume] = null
  13286. }
  13287. _read () {
  13288. const { [kResume]: resume } = this
  13289. if (resume) {
  13290. this[kResume] = null
  13291. resume()
  13292. }
  13293. }
  13294. _destroy (err, callback) {
  13295. this._read()
  13296. callback(err)
  13297. }
  13298. }
  13299. class PipelineResponse extends Readable {
  13300. constructor (resume) {
  13301. super({ autoDestroy: true })
  13302. this[kResume] = resume
  13303. }
  13304. _read () {
  13305. this[kResume]()
  13306. }
  13307. _destroy (err, callback) {
  13308. if (!err && !this._readableState.endEmitted) {
  13309. err = new RequestAbortedError()
  13310. }
  13311. callback(err)
  13312. }
  13313. }
  13314. class PipelineHandler extends AsyncResource {
  13315. constructor (opts, handler) {
  13316. if (!opts || typeof opts !== 'object') {
  13317. throw new InvalidArgumentError('invalid opts')
  13318. }
  13319. if (typeof handler !== 'function') {
  13320. throw new InvalidArgumentError('invalid handler')
  13321. }
  13322. const { signal, method, opaque, onInfo, responseHeaders } = opts
  13323. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13324. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13325. }
  13326. if (method === 'CONNECT') {
  13327. throw new InvalidArgumentError('invalid method')
  13328. }
  13329. if (onInfo && typeof onInfo !== 'function') {
  13330. throw new InvalidArgumentError('invalid onInfo callback')
  13331. }
  13332. super('UNDICI_PIPELINE')
  13333. this.opaque = opaque || null
  13334. this.responseHeaders = responseHeaders || null
  13335. this.handler = handler
  13336. this.abort = null
  13337. this.context = null
  13338. this.onInfo = onInfo || null
  13339. this.req = new PipelineRequest().on('error', util.nop)
  13340. this.ret = new Duplex({
  13341. readableObjectMode: opts.objectMode,
  13342. autoDestroy: true,
  13343. read: () => {
  13344. const { body } = this
  13345. if (body && body.resume) {
  13346. body.resume()
  13347. }
  13348. },
  13349. write: (chunk, encoding, callback) => {
  13350. const { req } = this
  13351. if (req.push(chunk, encoding) || req._readableState.destroyed) {
  13352. callback()
  13353. } else {
  13354. req[kResume] = callback
  13355. }
  13356. },
  13357. destroy: (err, callback) => {
  13358. const { body, req, res, ret, abort } = this
  13359. if (!err && !ret._readableState.endEmitted) {
  13360. err = new RequestAbortedError()
  13361. }
  13362. if (abort && err) {
  13363. abort()
  13364. }
  13365. util.destroy(body, err)
  13366. util.destroy(req, err)
  13367. util.destroy(res, err)
  13368. removeSignal(this)
  13369. callback(err)
  13370. }
  13371. }).on('prefinish', () => {
  13372. const { req } = this
  13373. // Node < 15 does not call _final in same tick.
  13374. req.push(null)
  13375. })
  13376. this.res = null
  13377. addSignal(this, signal)
  13378. }
  13379. onConnect (abort, context) {
  13380. const { ret, res } = this
  13381. assert(!res, 'pipeline cannot be retried')
  13382. if (ret.destroyed) {
  13383. throw new RequestAbortedError()
  13384. }
  13385. this.abort = abort
  13386. this.context = context
  13387. }
  13388. onHeaders (statusCode, rawHeaders, resume) {
  13389. const { opaque, handler, context } = this
  13390. if (statusCode < 200) {
  13391. if (this.onInfo) {
  13392. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13393. this.onInfo({ statusCode, headers })
  13394. }
  13395. return
  13396. }
  13397. this.res = new PipelineResponse(resume)
  13398. let body
  13399. try {
  13400. this.handler = null
  13401. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13402. body = this.runInAsyncScope(handler, null, {
  13403. statusCode,
  13404. headers,
  13405. opaque,
  13406. body: this.res,
  13407. context
  13408. })
  13409. } catch (err) {
  13410. this.res.on('error', util.nop)
  13411. throw err
  13412. }
  13413. if (!body || typeof body.on !== 'function') {
  13414. throw new InvalidReturnValueError('expected Readable')
  13415. }
  13416. body
  13417. .on('data', (chunk) => {
  13418. const { ret, body } = this
  13419. if (!ret.push(chunk) && body.pause) {
  13420. body.pause()
  13421. }
  13422. })
  13423. .on('error', (err) => {
  13424. const { ret } = this
  13425. util.destroy(ret, err)
  13426. })
  13427. .on('end', () => {
  13428. const { ret } = this
  13429. ret.push(null)
  13430. })
  13431. .on('close', () => {
  13432. const { ret } = this
  13433. if (!ret._readableState.ended) {
  13434. util.destroy(ret, new RequestAbortedError())
  13435. }
  13436. })
  13437. this.body = body
  13438. }
  13439. onData (chunk) {
  13440. const { res } = this
  13441. return res.push(chunk)
  13442. }
  13443. onComplete (trailers) {
  13444. const { res } = this
  13445. res.push(null)
  13446. }
  13447. onError (err) {
  13448. const { ret } = this
  13449. this.handler = null
  13450. util.destroy(ret, err)
  13451. }
  13452. }
  13453. function pipeline (opts, handler) {
  13454. try {
  13455. const pipelineHandler = new PipelineHandler(opts, handler)
  13456. this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)
  13457. return pipelineHandler.ret
  13458. } catch (err) {
  13459. return new PassThrough().destroy(err)
  13460. }
  13461. }
  13462. module.exports = pipeline
  13463. /***/ }),
  13464. /***/ 5448:
  13465. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13466. "use strict";
  13467. const Readable = __nccwpck_require__(3858)
  13468. const {
  13469. InvalidArgumentError,
  13470. RequestAbortedError
  13471. } = __nccwpck_require__(8045)
  13472. const util = __nccwpck_require__(3983)
  13473. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13474. const { AsyncResource } = __nccwpck_require__(852)
  13475. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13476. class RequestHandler extends AsyncResource {
  13477. constructor (opts, callback) {
  13478. if (!opts || typeof opts !== 'object') {
  13479. throw new InvalidArgumentError('invalid opts')
  13480. }
  13481. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts
  13482. try {
  13483. if (typeof callback !== 'function') {
  13484. throw new InvalidArgumentError('invalid callback')
  13485. }
  13486. if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
  13487. throw new InvalidArgumentError('invalid highWaterMark')
  13488. }
  13489. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13490. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13491. }
  13492. if (method === 'CONNECT') {
  13493. throw new InvalidArgumentError('invalid method')
  13494. }
  13495. if (onInfo && typeof onInfo !== 'function') {
  13496. throw new InvalidArgumentError('invalid onInfo callback')
  13497. }
  13498. super('UNDICI_REQUEST')
  13499. } catch (err) {
  13500. if (util.isStream(body)) {
  13501. util.destroy(body.on('error', util.nop), err)
  13502. }
  13503. throw err
  13504. }
  13505. this.responseHeaders = responseHeaders || null
  13506. this.opaque = opaque || null
  13507. this.callback = callback
  13508. this.res = null
  13509. this.abort = null
  13510. this.body = body
  13511. this.trailers = {}
  13512. this.context = null
  13513. this.onInfo = onInfo || null
  13514. this.throwOnError = throwOnError
  13515. this.highWaterMark = highWaterMark
  13516. if (util.isStream(body)) {
  13517. body.on('error', (err) => {
  13518. this.onError(err)
  13519. })
  13520. }
  13521. addSignal(this, signal)
  13522. }
  13523. onConnect (abort, context) {
  13524. if (!this.callback) {
  13525. throw new RequestAbortedError()
  13526. }
  13527. this.abort = abort
  13528. this.context = context
  13529. }
  13530. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13531. const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
  13532. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13533. if (statusCode < 200) {
  13534. if (this.onInfo) {
  13535. this.onInfo({ statusCode, headers })
  13536. }
  13537. return
  13538. }
  13539. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13540. const contentType = parsedHeaders['content-type']
  13541. const body = new Readable({ resume, abort, contentType, highWaterMark })
  13542. this.callback = null
  13543. this.res = body
  13544. if (callback !== null) {
  13545. if (this.throwOnError && statusCode >= 400) {
  13546. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13547. { callback, body, contentType, statusCode, statusMessage, headers }
  13548. )
  13549. } else {
  13550. this.runInAsyncScope(callback, null, null, {
  13551. statusCode,
  13552. headers,
  13553. trailers: this.trailers,
  13554. opaque,
  13555. body,
  13556. context
  13557. })
  13558. }
  13559. }
  13560. }
  13561. onData (chunk) {
  13562. const { res } = this
  13563. return res.push(chunk)
  13564. }
  13565. onComplete (trailers) {
  13566. const { res } = this
  13567. removeSignal(this)
  13568. util.parseHeaders(trailers, this.trailers)
  13569. res.push(null)
  13570. }
  13571. onError (err) {
  13572. const { res, callback, body, opaque } = this
  13573. removeSignal(this)
  13574. if (callback) {
  13575. // TODO: Does this need queueMicrotask?
  13576. this.callback = null
  13577. queueMicrotask(() => {
  13578. this.runInAsyncScope(callback, null, err, { opaque })
  13579. })
  13580. }
  13581. if (res) {
  13582. this.res = null
  13583. // Ensure all queued handlers are invoked before destroying res.
  13584. queueMicrotask(() => {
  13585. util.destroy(res, err)
  13586. })
  13587. }
  13588. if (body) {
  13589. this.body = null
  13590. util.destroy(body, err)
  13591. }
  13592. }
  13593. }
  13594. function request (opts, callback) {
  13595. if (callback === undefined) {
  13596. return new Promise((resolve, reject) => {
  13597. request.call(this, opts, (err, data) => {
  13598. return err ? reject(err) : resolve(data)
  13599. })
  13600. })
  13601. }
  13602. try {
  13603. this.dispatch(opts, new RequestHandler(opts, callback))
  13604. } catch (err) {
  13605. if (typeof callback !== 'function') {
  13606. throw err
  13607. }
  13608. const opaque = opts && opts.opaque
  13609. queueMicrotask(() => callback(err, { opaque }))
  13610. }
  13611. }
  13612. module.exports = request
  13613. module.exports.RequestHandler = RequestHandler
  13614. /***/ }),
  13615. /***/ 5395:
  13616. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13617. "use strict";
  13618. const { finished, PassThrough } = __nccwpck_require__(2781)
  13619. const {
  13620. InvalidArgumentError,
  13621. InvalidReturnValueError,
  13622. RequestAbortedError
  13623. } = __nccwpck_require__(8045)
  13624. const util = __nccwpck_require__(3983)
  13625. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13626. const { AsyncResource } = __nccwpck_require__(852)
  13627. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13628. class StreamHandler extends AsyncResource {
  13629. constructor (opts, factory, callback) {
  13630. if (!opts || typeof opts !== 'object') {
  13631. throw new InvalidArgumentError('invalid opts')
  13632. }
  13633. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts
  13634. try {
  13635. if (typeof callback !== 'function') {
  13636. throw new InvalidArgumentError('invalid callback')
  13637. }
  13638. if (typeof factory !== 'function') {
  13639. throw new InvalidArgumentError('invalid factory')
  13640. }
  13641. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13642. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13643. }
  13644. if (method === 'CONNECT') {
  13645. throw new InvalidArgumentError('invalid method')
  13646. }
  13647. if (onInfo && typeof onInfo !== 'function') {
  13648. throw new InvalidArgumentError('invalid onInfo callback')
  13649. }
  13650. super('UNDICI_STREAM')
  13651. } catch (err) {
  13652. if (util.isStream(body)) {
  13653. util.destroy(body.on('error', util.nop), err)
  13654. }
  13655. throw err
  13656. }
  13657. this.responseHeaders = responseHeaders || null
  13658. this.opaque = opaque || null
  13659. this.factory = factory
  13660. this.callback = callback
  13661. this.res = null
  13662. this.abort = null
  13663. this.context = null
  13664. this.trailers = null
  13665. this.body = body
  13666. this.onInfo = onInfo || null
  13667. this.throwOnError = throwOnError || false
  13668. if (util.isStream(body)) {
  13669. body.on('error', (err) => {
  13670. this.onError(err)
  13671. })
  13672. }
  13673. addSignal(this, signal)
  13674. }
  13675. onConnect (abort, context) {
  13676. if (!this.callback) {
  13677. throw new RequestAbortedError()
  13678. }
  13679. this.abort = abort
  13680. this.context = context
  13681. }
  13682. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13683. const { factory, opaque, context, callback, responseHeaders } = this
  13684. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13685. if (statusCode < 200) {
  13686. if (this.onInfo) {
  13687. this.onInfo({ statusCode, headers })
  13688. }
  13689. return
  13690. }
  13691. this.factory = null
  13692. let res
  13693. if (this.throwOnError && statusCode >= 400) {
  13694. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13695. const contentType = parsedHeaders['content-type']
  13696. res = new PassThrough()
  13697. this.callback = null
  13698. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13699. { callback, body: res, contentType, statusCode, statusMessage, headers }
  13700. )
  13701. } else {
  13702. if (factory === null) {
  13703. return
  13704. }
  13705. res = this.runInAsyncScope(factory, null, {
  13706. statusCode,
  13707. headers,
  13708. opaque,
  13709. context
  13710. })
  13711. if (
  13712. !res ||
  13713. typeof res.write !== 'function' ||
  13714. typeof res.end !== 'function' ||
  13715. typeof res.on !== 'function'
  13716. ) {
  13717. throw new InvalidReturnValueError('expected Writable')
  13718. }
  13719. // TODO: Avoid finished. It registers an unnecessary amount of listeners.
  13720. finished(res, { readable: false }, (err) => {
  13721. const { callback, res, opaque, trailers, abort } = this
  13722. this.res = null
  13723. if (err || !res.readable) {
  13724. util.destroy(res, err)
  13725. }
  13726. this.callback = null
  13727. this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
  13728. if (err) {
  13729. abort()
  13730. }
  13731. })
  13732. }
  13733. res.on('drain', resume)
  13734. this.res = res
  13735. const needDrain = res.writableNeedDrain !== undefined
  13736. ? res.writableNeedDrain
  13737. : res._writableState && res._writableState.needDrain
  13738. return needDrain !== true
  13739. }
  13740. onData (chunk) {
  13741. const { res } = this
  13742. return res ? res.write(chunk) : true
  13743. }
  13744. onComplete (trailers) {
  13745. const { res } = this
  13746. removeSignal(this)
  13747. if (!res) {
  13748. return
  13749. }
  13750. this.trailers = util.parseHeaders(trailers)
  13751. res.end()
  13752. }
  13753. onError (err) {
  13754. const { res, callback, opaque, body } = this
  13755. removeSignal(this)
  13756. this.factory = null
  13757. if (res) {
  13758. this.res = null
  13759. util.destroy(res, err)
  13760. } else if (callback) {
  13761. this.callback = null
  13762. queueMicrotask(() => {
  13763. this.runInAsyncScope(callback, null, err, { opaque })
  13764. })
  13765. }
  13766. if (body) {
  13767. this.body = null
  13768. util.destroy(body, err)
  13769. }
  13770. }
  13771. }
  13772. function stream (opts, factory, callback) {
  13773. if (callback === undefined) {
  13774. return new Promise((resolve, reject) => {
  13775. stream.call(this, opts, factory, (err, data) => {
  13776. return err ? reject(err) : resolve(data)
  13777. })
  13778. })
  13779. }
  13780. try {
  13781. this.dispatch(opts, new StreamHandler(opts, factory, callback))
  13782. } catch (err) {
  13783. if (typeof callback !== 'function') {
  13784. throw err
  13785. }
  13786. const opaque = opts && opts.opaque
  13787. queueMicrotask(() => callback(err, { opaque }))
  13788. }
  13789. }
  13790. module.exports = stream
  13791. /***/ }),
  13792. /***/ 6923:
  13793. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13794. "use strict";
  13795. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13796. const { AsyncResource } = __nccwpck_require__(852)
  13797. const util = __nccwpck_require__(3983)
  13798. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13799. const assert = __nccwpck_require__(9491)
  13800. class UpgradeHandler extends AsyncResource {
  13801. constructor (opts, callback) {
  13802. if (!opts || typeof opts !== 'object') {
  13803. throw new InvalidArgumentError('invalid opts')
  13804. }
  13805. if (typeof callback !== 'function') {
  13806. throw new InvalidArgumentError('invalid callback')
  13807. }
  13808. const { signal, opaque, responseHeaders } = opts
  13809. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13810. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13811. }
  13812. super('UNDICI_UPGRADE')
  13813. this.responseHeaders = responseHeaders || null
  13814. this.opaque = opaque || null
  13815. this.callback = callback
  13816. this.abort = null
  13817. this.context = null
  13818. addSignal(this, signal)
  13819. }
  13820. onConnect (abort, context) {
  13821. if (!this.callback) {
  13822. throw new RequestAbortedError()
  13823. }
  13824. this.abort = abort
  13825. this.context = null
  13826. }
  13827. onHeaders () {
  13828. throw new SocketError('bad upgrade', null)
  13829. }
  13830. onUpgrade (statusCode, rawHeaders, socket) {
  13831. const { callback, opaque, context } = this
  13832. assert.strictEqual(statusCode, 101)
  13833. removeSignal(this)
  13834. this.callback = null
  13835. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13836. this.runInAsyncScope(callback, null, null, {
  13837. headers,
  13838. socket,
  13839. opaque,
  13840. context
  13841. })
  13842. }
  13843. onError (err) {
  13844. const { callback, opaque } = this
  13845. removeSignal(this)
  13846. if (callback) {
  13847. this.callback = null
  13848. queueMicrotask(() => {
  13849. this.runInAsyncScope(callback, null, err, { opaque })
  13850. })
  13851. }
  13852. }
  13853. }
  13854. function upgrade (opts, callback) {
  13855. if (callback === undefined) {
  13856. return new Promise((resolve, reject) => {
  13857. upgrade.call(this, opts, (err, data) => {
  13858. return err ? reject(err) : resolve(data)
  13859. })
  13860. })
  13861. }
  13862. try {
  13863. const upgradeHandler = new UpgradeHandler(opts, callback)
  13864. this.dispatch({
  13865. ...opts,
  13866. method: opts.method || 'GET',
  13867. upgrade: opts.protocol || 'Websocket'
  13868. }, upgradeHandler)
  13869. } catch (err) {
  13870. if (typeof callback !== 'function') {
  13871. throw err
  13872. }
  13873. const opaque = opts && opts.opaque
  13874. queueMicrotask(() => callback(err, { opaque }))
  13875. }
  13876. }
  13877. module.exports = upgrade
  13878. /***/ }),
  13879. /***/ 4059:
  13880. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13881. "use strict";
  13882. module.exports.request = __nccwpck_require__(5448)
  13883. module.exports.stream = __nccwpck_require__(5395)
  13884. module.exports.pipeline = __nccwpck_require__(8752)
  13885. module.exports.upgrade = __nccwpck_require__(6923)
  13886. module.exports.connect = __nccwpck_require__(9744)
  13887. /***/ }),
  13888. /***/ 3858:
  13889. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13890. "use strict";
  13891. // Ported from https://github.com/nodejs/undici/pull/907
  13892. const assert = __nccwpck_require__(9491)
  13893. const { Readable } = __nccwpck_require__(2781)
  13894. const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(8045)
  13895. const util = __nccwpck_require__(3983)
  13896. const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(3983)
  13897. let Blob
  13898. const kConsume = Symbol('kConsume')
  13899. const kReading = Symbol('kReading')
  13900. const kBody = Symbol('kBody')
  13901. const kAbort = Symbol('abort')
  13902. const kContentType = Symbol('kContentType')
  13903. const noop = () => {}
  13904. module.exports = class BodyReadable extends Readable {
  13905. constructor ({
  13906. resume,
  13907. abort,
  13908. contentType = '',
  13909. highWaterMark = 64 * 1024 // Same as nodejs fs streams.
  13910. }) {
  13911. super({
  13912. autoDestroy: true,
  13913. read: resume,
  13914. highWaterMark
  13915. })
  13916. this._readableState.dataEmitted = false
  13917. this[kAbort] = abort
  13918. this[kConsume] = null
  13919. this[kBody] = null
  13920. this[kContentType] = contentType
  13921. // Is stream being consumed through Readable API?
  13922. // This is an optimization so that we avoid checking
  13923. // for 'data' and 'readable' listeners in the hot path
  13924. // inside push().
  13925. this[kReading] = false
  13926. }
  13927. destroy (err) {
  13928. if (this.destroyed) {
  13929. // Node < 16
  13930. return this
  13931. }
  13932. if (!err && !this._readableState.endEmitted) {
  13933. err = new RequestAbortedError()
  13934. }
  13935. if (err) {
  13936. this[kAbort]()
  13937. }
  13938. return super.destroy(err)
  13939. }
  13940. emit (ev, ...args) {
  13941. if (ev === 'data') {
  13942. // Node < 16.7
  13943. this._readableState.dataEmitted = true
  13944. } else if (ev === 'error') {
  13945. // Node < 16
  13946. this._readableState.errorEmitted = true
  13947. }
  13948. return super.emit(ev, ...args)
  13949. }
  13950. on (ev, ...args) {
  13951. if (ev === 'data' || ev === 'readable') {
  13952. this[kReading] = true
  13953. }
  13954. return super.on(ev, ...args)
  13955. }
  13956. addListener (ev, ...args) {
  13957. return this.on(ev, ...args)
  13958. }
  13959. off (ev, ...args) {
  13960. const ret = super.off(ev, ...args)
  13961. if (ev === 'data' || ev === 'readable') {
  13962. this[kReading] = (
  13963. this.listenerCount('data') > 0 ||
  13964. this.listenerCount('readable') > 0
  13965. )
  13966. }
  13967. return ret
  13968. }
  13969. removeListener (ev, ...args) {
  13970. return this.off(ev, ...args)
  13971. }
  13972. push (chunk) {
  13973. if (this[kConsume] && chunk !== null && this.readableLength === 0) {
  13974. consumePush(this[kConsume], chunk)
  13975. return this[kReading] ? super.push(chunk) : true
  13976. }
  13977. return super.push(chunk)
  13978. }
  13979. // https://fetch.spec.whatwg.org/#dom-body-text
  13980. async text () {
  13981. return consume(this, 'text')
  13982. }
  13983. // https://fetch.spec.whatwg.org/#dom-body-json
  13984. async json () {
  13985. return consume(this, 'json')
  13986. }
  13987. // https://fetch.spec.whatwg.org/#dom-body-blob
  13988. async blob () {
  13989. return consume(this, 'blob')
  13990. }
  13991. // https://fetch.spec.whatwg.org/#dom-body-arraybuffer
  13992. async arrayBuffer () {
  13993. return consume(this, 'arrayBuffer')
  13994. }
  13995. // https://fetch.spec.whatwg.org/#dom-body-formdata
  13996. async formData () {
  13997. // TODO: Implement.
  13998. throw new NotSupportedError()
  13999. }
  14000. // https://fetch.spec.whatwg.org/#dom-body-bodyused
  14001. get bodyUsed () {
  14002. return util.isDisturbed(this)
  14003. }
  14004. // https://fetch.spec.whatwg.org/#dom-body-body
  14005. get body () {
  14006. if (!this[kBody]) {
  14007. this[kBody] = ReadableStreamFrom(this)
  14008. if (this[kConsume]) {
  14009. // TODO: Is this the best way to force a lock?
  14010. this[kBody].getReader() // Ensure stream is locked.
  14011. assert(this[kBody].locked)
  14012. }
  14013. }
  14014. return this[kBody]
  14015. }
  14016. dump (opts) {
  14017. let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144
  14018. const signal = opts && opts.signal
  14019. if (signal) {
  14020. try {
  14021. if (typeof signal !== 'object' || !('aborted' in signal)) {
  14022. throw new InvalidArgumentError('signal must be an AbortSignal')
  14023. }
  14024. util.throwIfAborted(signal)
  14025. } catch (err) {
  14026. return Promise.reject(err)
  14027. }
  14028. }
  14029. if (this.closed) {
  14030. return Promise.resolve(null)
  14031. }
  14032. return new Promise((resolve, reject) => {
  14033. const signalListenerCleanup = signal
  14034. ? util.addAbortListener(signal, () => {
  14035. this.destroy()
  14036. })
  14037. : noop
  14038. this
  14039. .on('close', function () {
  14040. signalListenerCleanup()
  14041. if (signal && signal.aborted) {
  14042. reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))
  14043. } else {
  14044. resolve(null)
  14045. }
  14046. })
  14047. .on('error', noop)
  14048. .on('data', function (chunk) {
  14049. limit -= chunk.length
  14050. if (limit <= 0) {
  14051. this.destroy()
  14052. }
  14053. })
  14054. .resume()
  14055. })
  14056. }
  14057. }
  14058. // https://streams.spec.whatwg.org/#readablestream-locked
  14059. function isLocked (self) {
  14060. // Consume is an implicit lock.
  14061. return (self[kBody] && self[kBody].locked === true) || self[kConsume]
  14062. }
  14063. // https://fetch.spec.whatwg.org/#body-unusable
  14064. function isUnusable (self) {
  14065. return util.isDisturbed(self) || isLocked(self)
  14066. }
  14067. async function consume (stream, type) {
  14068. if (isUnusable(stream)) {
  14069. throw new TypeError('unusable')
  14070. }
  14071. assert(!stream[kConsume])
  14072. return new Promise((resolve, reject) => {
  14073. stream[kConsume] = {
  14074. type,
  14075. stream,
  14076. resolve,
  14077. reject,
  14078. length: 0,
  14079. body: []
  14080. }
  14081. stream
  14082. .on('error', function (err) {
  14083. consumeFinish(this[kConsume], err)
  14084. })
  14085. .on('close', function () {
  14086. if (this[kConsume].body !== null) {
  14087. consumeFinish(this[kConsume], new RequestAbortedError())
  14088. }
  14089. })
  14090. process.nextTick(consumeStart, stream[kConsume])
  14091. })
  14092. }
  14093. function consumeStart (consume) {
  14094. if (consume.body === null) {
  14095. return
  14096. }
  14097. const { _readableState: state } = consume.stream
  14098. for (const chunk of state.buffer) {
  14099. consumePush(consume, chunk)
  14100. }
  14101. if (state.endEmitted) {
  14102. consumeEnd(this[kConsume])
  14103. } else {
  14104. consume.stream.on('end', function () {
  14105. consumeEnd(this[kConsume])
  14106. })
  14107. }
  14108. consume.stream.resume()
  14109. while (consume.stream.read() != null) {
  14110. // Loop
  14111. }
  14112. }
  14113. function consumeEnd (consume) {
  14114. const { type, body, resolve, stream, length } = consume
  14115. try {
  14116. if (type === 'text') {
  14117. resolve(toUSVString(Buffer.concat(body)))
  14118. } else if (type === 'json') {
  14119. resolve(JSON.parse(Buffer.concat(body)))
  14120. } else if (type === 'arrayBuffer') {
  14121. const dst = new Uint8Array(length)
  14122. let pos = 0
  14123. for (const buf of body) {
  14124. dst.set(buf, pos)
  14125. pos += buf.byteLength
  14126. }
  14127. resolve(dst.buffer)
  14128. } else if (type === 'blob') {
  14129. if (!Blob) {
  14130. Blob = (__nccwpck_require__(4300).Blob)
  14131. }
  14132. resolve(new Blob(body, { type: stream[kContentType] }))
  14133. }
  14134. consumeFinish(consume)
  14135. } catch (err) {
  14136. stream.destroy(err)
  14137. }
  14138. }
  14139. function consumePush (consume, chunk) {
  14140. consume.length += chunk.length
  14141. consume.body.push(chunk)
  14142. }
  14143. function consumeFinish (consume, err) {
  14144. if (consume.body === null) {
  14145. return
  14146. }
  14147. if (err) {
  14148. consume.reject(err)
  14149. } else {
  14150. consume.resolve()
  14151. }
  14152. consume.type = null
  14153. consume.stream = null
  14154. consume.resolve = null
  14155. consume.reject = null
  14156. consume.length = 0
  14157. consume.body = null
  14158. }
  14159. /***/ }),
  14160. /***/ 7474:
  14161. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14162. const assert = __nccwpck_require__(9491)
  14163. const {
  14164. ResponseStatusCodeError
  14165. } = __nccwpck_require__(8045)
  14166. const { toUSVString } = __nccwpck_require__(3983)
  14167. async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
  14168. assert(body)
  14169. let chunks = []
  14170. let limit = 0
  14171. for await (const chunk of body) {
  14172. chunks.push(chunk)
  14173. limit += chunk.length
  14174. if (limit > 128 * 1024) {
  14175. chunks = null
  14176. break
  14177. }
  14178. }
  14179. if (statusCode === 204 || !contentType || !chunks) {
  14180. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  14181. return
  14182. }
  14183. try {
  14184. if (contentType.startsWith('application/json')) {
  14185. const payload = JSON.parse(toUSVString(Buffer.concat(chunks)))
  14186. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  14187. return
  14188. }
  14189. if (contentType.startsWith('text/')) {
  14190. const payload = toUSVString(Buffer.concat(chunks))
  14191. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  14192. return
  14193. }
  14194. } catch (err) {
  14195. // Process in a fallback if error
  14196. }
  14197. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  14198. }
  14199. module.exports = { getResolveErrorBodyCallback }
  14200. /***/ }),
  14201. /***/ 7931:
  14202. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14203. "use strict";
  14204. const {
  14205. BalancedPoolMissingUpstreamError,
  14206. InvalidArgumentError
  14207. } = __nccwpck_require__(8045)
  14208. const {
  14209. PoolBase,
  14210. kClients,
  14211. kNeedDrain,
  14212. kAddClient,
  14213. kRemoveClient,
  14214. kGetDispatcher
  14215. } = __nccwpck_require__(3198)
  14216. const Pool = __nccwpck_require__(4634)
  14217. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  14218. const { parseOrigin } = __nccwpck_require__(3983)
  14219. const kFactory = Symbol('factory')
  14220. const kOptions = Symbol('options')
  14221. const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')
  14222. const kCurrentWeight = Symbol('kCurrentWeight')
  14223. const kIndex = Symbol('kIndex')
  14224. const kWeight = Symbol('kWeight')
  14225. const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
  14226. const kErrorPenalty = Symbol('kErrorPenalty')
  14227. function getGreatestCommonDivisor (a, b) {
  14228. if (b === 0) return a
  14229. return getGreatestCommonDivisor(b, a % b)
  14230. }
  14231. function defaultFactory (origin, opts) {
  14232. return new Pool(origin, opts)
  14233. }
  14234. class BalancedPool extends PoolBase {
  14235. constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
  14236. super()
  14237. this[kOptions] = opts
  14238. this[kIndex] = -1
  14239. this[kCurrentWeight] = 0
  14240. this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100
  14241. this[kErrorPenalty] = this[kOptions].errorPenalty || 15
  14242. if (!Array.isArray(upstreams)) {
  14243. upstreams = [upstreams]
  14244. }
  14245. if (typeof factory !== 'function') {
  14246. throw new InvalidArgumentError('factory must be a function.')
  14247. }
  14248. this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
  14249. ? opts.interceptors.BalancedPool
  14250. : []
  14251. this[kFactory] = factory
  14252. for (const upstream of upstreams) {
  14253. this.addUpstream(upstream)
  14254. }
  14255. this._updateBalancedPoolStats()
  14256. }
  14257. addUpstream (upstream) {
  14258. const upstreamOrigin = parseOrigin(upstream).origin
  14259. if (this[kClients].find((pool) => (
  14260. pool[kUrl].origin === upstreamOrigin &&
  14261. pool.closed !== true &&
  14262. pool.destroyed !== true
  14263. ))) {
  14264. return this
  14265. }
  14266. const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
  14267. this[kAddClient](pool)
  14268. pool.on('connect', () => {
  14269. pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
  14270. })
  14271. pool.on('connectionError', () => {
  14272. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  14273. this._updateBalancedPoolStats()
  14274. })
  14275. pool.on('disconnect', (...args) => {
  14276. const err = args[2]
  14277. if (err && err.code === 'UND_ERR_SOCKET') {
  14278. // decrease the weight of the pool.
  14279. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  14280. this._updateBalancedPoolStats()
  14281. }
  14282. })
  14283. for (const client of this[kClients]) {
  14284. client[kWeight] = this[kMaxWeightPerServer]
  14285. }
  14286. this._updateBalancedPoolStats()
  14287. return this
  14288. }
  14289. _updateBalancedPoolStats () {
  14290. this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)
  14291. }
  14292. removeUpstream (upstream) {
  14293. const upstreamOrigin = parseOrigin(upstream).origin
  14294. const pool = this[kClients].find((pool) => (
  14295. pool[kUrl].origin === upstreamOrigin &&
  14296. pool.closed !== true &&
  14297. pool.destroyed !== true
  14298. ))
  14299. if (pool) {
  14300. this[kRemoveClient](pool)
  14301. }
  14302. return this
  14303. }
  14304. get upstreams () {
  14305. return this[kClients]
  14306. .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
  14307. .map((p) => p[kUrl].origin)
  14308. }
  14309. [kGetDispatcher] () {
  14310. // We validate that pools is greater than 0,
  14311. // otherwise we would have to wait until an upstream
  14312. // is added, which might never happen.
  14313. if (this[kClients].length === 0) {
  14314. throw new BalancedPoolMissingUpstreamError()
  14315. }
  14316. const dispatcher = this[kClients].find(dispatcher => (
  14317. !dispatcher[kNeedDrain] &&
  14318. dispatcher.closed !== true &&
  14319. dispatcher.destroyed !== true
  14320. ))
  14321. if (!dispatcher) {
  14322. return
  14323. }
  14324. const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
  14325. if (allClientsBusy) {
  14326. return
  14327. }
  14328. let counter = 0
  14329. let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
  14330. while (counter++ < this[kClients].length) {
  14331. this[kIndex] = (this[kIndex] + 1) % this[kClients].length
  14332. const pool = this[kClients][this[kIndex]]
  14333. // find pool index with the largest weight
  14334. if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
  14335. maxWeightIndex = this[kIndex]
  14336. }
  14337. // decrease the current weight every `this[kClients].length`.
  14338. if (this[kIndex] === 0) {
  14339. // Set the current weight to the next lower weight.
  14340. this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]
  14341. if (this[kCurrentWeight] <= 0) {
  14342. this[kCurrentWeight] = this[kMaxWeightPerServer]
  14343. }
  14344. }
  14345. if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
  14346. return pool
  14347. }
  14348. }
  14349. this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
  14350. this[kIndex] = maxWeightIndex
  14351. return this[kClients][maxWeightIndex]
  14352. }
  14353. }
  14354. module.exports = BalancedPool
  14355. /***/ }),
  14356. /***/ 6101:
  14357. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14358. "use strict";
  14359. const { kConstruct } = __nccwpck_require__(9174)
  14360. const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(2396)
  14361. const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3983)
  14362. const { kHeadersList } = __nccwpck_require__(2785)
  14363. const { webidl } = __nccwpck_require__(1744)
  14364. const { Response, cloneResponse } = __nccwpck_require__(7823)
  14365. const { Request } = __nccwpck_require__(8359)
  14366. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  14367. const { fetching } = __nccwpck_require__(4881)
  14368. const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(2538)
  14369. const assert = __nccwpck_require__(9491)
  14370. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  14371. /**
  14372. * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation
  14373. * @typedef {Object} CacheBatchOperation
  14374. * @property {'delete' | 'put'} type
  14375. * @property {any} request
  14376. * @property {any} response
  14377. * @property {import('../../types/cache').CacheQueryOptions} options
  14378. */
  14379. /**
  14380. * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list
  14381. * @typedef {[any, any][]} requestResponseList
  14382. */
  14383. class Cache {
  14384. /**
  14385. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
  14386. * @type {requestResponseList}
  14387. */
  14388. #relevantRequestResponseList
  14389. constructor () {
  14390. if (arguments[0] !== kConstruct) {
  14391. webidl.illegalConstructor()
  14392. }
  14393. this.#relevantRequestResponseList = arguments[1]
  14394. }
  14395. async match (request, options = {}) {
  14396. webidl.brandCheck(this, Cache)
  14397. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' })
  14398. request = webidl.converters.RequestInfo(request)
  14399. options = webidl.converters.CacheQueryOptions(options)
  14400. const p = await this.matchAll(request, options)
  14401. if (p.length === 0) {
  14402. return
  14403. }
  14404. return p[0]
  14405. }
  14406. async matchAll (request = undefined, options = {}) {
  14407. webidl.brandCheck(this, Cache)
  14408. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14409. options = webidl.converters.CacheQueryOptions(options)
  14410. // 1.
  14411. let r = null
  14412. // 2.
  14413. if (request !== undefined) {
  14414. if (request instanceof Request) {
  14415. // 2.1.1
  14416. r = request[kState]
  14417. // 2.1.2
  14418. if (r.method !== 'GET' && !options.ignoreMethod) {
  14419. return []
  14420. }
  14421. } else if (typeof request === 'string') {
  14422. // 2.2.1
  14423. r = new Request(request)[kState]
  14424. }
  14425. }
  14426. // 5.
  14427. // 5.1
  14428. const responses = []
  14429. // 5.2
  14430. if (request === undefined) {
  14431. // 5.2.1
  14432. for (const requestResponse of this.#relevantRequestResponseList) {
  14433. responses.push(requestResponse[1])
  14434. }
  14435. } else { // 5.3
  14436. // 5.3.1
  14437. const requestResponses = this.#queryCache(r, options)
  14438. // 5.3.2
  14439. for (const requestResponse of requestResponses) {
  14440. responses.push(requestResponse[1])
  14441. }
  14442. }
  14443. // 5.4
  14444. // We don't implement CORs so we don't need to loop over the responses, yay!
  14445. // 5.5.1
  14446. const responseList = []
  14447. // 5.5.2
  14448. for (const response of responses) {
  14449. // 5.5.2.1
  14450. const responseObject = new Response(response.body?.source ?? null)
  14451. const body = responseObject[kState].body
  14452. responseObject[kState] = response
  14453. responseObject[kState].body = body
  14454. responseObject[kHeaders][kHeadersList] = response.headersList
  14455. responseObject[kHeaders][kGuard] = 'immutable'
  14456. responseList.push(responseObject)
  14457. }
  14458. // 6.
  14459. return Object.freeze(responseList)
  14460. }
  14461. async add (request) {
  14462. webidl.brandCheck(this, Cache)
  14463. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })
  14464. request = webidl.converters.RequestInfo(request)
  14465. // 1.
  14466. const requests = [request]
  14467. // 2.
  14468. const responseArrayPromise = this.addAll(requests)
  14469. // 3.
  14470. return await responseArrayPromise
  14471. }
  14472. async addAll (requests) {
  14473. webidl.brandCheck(this, Cache)
  14474. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })
  14475. requests = webidl.converters['sequence<RequestInfo>'](requests)
  14476. // 1.
  14477. const responsePromises = []
  14478. // 2.
  14479. const requestList = []
  14480. // 3.
  14481. for (const request of requests) {
  14482. if (typeof request === 'string') {
  14483. continue
  14484. }
  14485. // 3.1
  14486. const r = request[kState]
  14487. // 3.2
  14488. if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {
  14489. throw webidl.errors.exception({
  14490. header: 'Cache.addAll',
  14491. message: 'Expected http/s scheme when method is not GET.'
  14492. })
  14493. }
  14494. }
  14495. // 4.
  14496. /** @type {ReturnType<typeof fetching>[]} */
  14497. const fetchControllers = []
  14498. // 5.
  14499. for (const request of requests) {
  14500. // 5.1
  14501. const r = new Request(request)[kState]
  14502. // 5.2
  14503. if (!urlIsHttpHttpsScheme(r.url)) {
  14504. throw webidl.errors.exception({
  14505. header: 'Cache.addAll',
  14506. message: 'Expected http/s scheme.'
  14507. })
  14508. }
  14509. // 5.4
  14510. r.initiator = 'fetch'
  14511. r.destination = 'subresource'
  14512. // 5.5
  14513. requestList.push(r)
  14514. // 5.6
  14515. const responsePromise = createDeferredPromise()
  14516. // 5.7
  14517. fetchControllers.push(fetching({
  14518. request: r,
  14519. dispatcher: getGlobalDispatcher(),
  14520. processResponse (response) {
  14521. // 1.
  14522. if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {
  14523. responsePromise.reject(webidl.errors.exception({
  14524. header: 'Cache.addAll',
  14525. message: 'Received an invalid status code or the request failed.'
  14526. }))
  14527. } else if (response.headersList.contains('vary')) { // 2.
  14528. // 2.1
  14529. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14530. // 2.2
  14531. for (const fieldValue of fieldValues) {
  14532. // 2.2.1
  14533. if (fieldValue === '*') {
  14534. responsePromise.reject(webidl.errors.exception({
  14535. header: 'Cache.addAll',
  14536. message: 'invalid vary field value'
  14537. }))
  14538. for (const controller of fetchControllers) {
  14539. controller.abort()
  14540. }
  14541. return
  14542. }
  14543. }
  14544. }
  14545. },
  14546. processResponseEndOfBody (response) {
  14547. // 1.
  14548. if (response.aborted) {
  14549. responsePromise.reject(new DOMException('aborted', 'AbortError'))
  14550. return
  14551. }
  14552. // 2.
  14553. responsePromise.resolve(response)
  14554. }
  14555. }))
  14556. // 5.8
  14557. responsePromises.push(responsePromise.promise)
  14558. }
  14559. // 6.
  14560. const p = Promise.all(responsePromises)
  14561. // 7.
  14562. const responses = await p
  14563. // 7.1
  14564. const operations = []
  14565. // 7.2
  14566. let index = 0
  14567. // 7.3
  14568. for (const response of responses) {
  14569. // 7.3.1
  14570. /** @type {CacheBatchOperation} */
  14571. const operation = {
  14572. type: 'put', // 7.3.2
  14573. request: requestList[index], // 7.3.3
  14574. response // 7.3.4
  14575. }
  14576. operations.push(operation) // 7.3.5
  14577. index++ // 7.3.6
  14578. }
  14579. // 7.5
  14580. const cacheJobPromise = createDeferredPromise()
  14581. // 7.6.1
  14582. let errorData = null
  14583. // 7.6.2
  14584. try {
  14585. this.#batchCacheOperations(operations)
  14586. } catch (e) {
  14587. errorData = e
  14588. }
  14589. // 7.6.3
  14590. queueMicrotask(() => {
  14591. // 7.6.3.1
  14592. if (errorData === null) {
  14593. cacheJobPromise.resolve(undefined)
  14594. } else {
  14595. // 7.6.3.2
  14596. cacheJobPromise.reject(errorData)
  14597. }
  14598. })
  14599. // 7.7
  14600. return cacheJobPromise.promise
  14601. }
  14602. async put (request, response) {
  14603. webidl.brandCheck(this, Cache)
  14604. webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })
  14605. request = webidl.converters.RequestInfo(request)
  14606. response = webidl.converters.Response(response)
  14607. // 1.
  14608. let innerRequest = null
  14609. // 2.
  14610. if (request instanceof Request) {
  14611. innerRequest = request[kState]
  14612. } else { // 3.
  14613. innerRequest = new Request(request)[kState]
  14614. }
  14615. // 4.
  14616. if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {
  14617. throw webidl.errors.exception({
  14618. header: 'Cache.put',
  14619. message: 'Expected an http/s scheme when method is not GET'
  14620. })
  14621. }
  14622. // 5.
  14623. const innerResponse = response[kState]
  14624. // 6.
  14625. if (innerResponse.status === 206) {
  14626. throw webidl.errors.exception({
  14627. header: 'Cache.put',
  14628. message: 'Got 206 status'
  14629. })
  14630. }
  14631. // 7.
  14632. if (innerResponse.headersList.contains('vary')) {
  14633. // 7.1.
  14634. const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))
  14635. // 7.2.
  14636. for (const fieldValue of fieldValues) {
  14637. // 7.2.1
  14638. if (fieldValue === '*') {
  14639. throw webidl.errors.exception({
  14640. header: 'Cache.put',
  14641. message: 'Got * vary field value'
  14642. })
  14643. }
  14644. }
  14645. }
  14646. // 8.
  14647. if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
  14648. throw webidl.errors.exception({
  14649. header: 'Cache.put',
  14650. message: 'Response body is locked or disturbed'
  14651. })
  14652. }
  14653. // 9.
  14654. const clonedResponse = cloneResponse(innerResponse)
  14655. // 10.
  14656. const bodyReadPromise = createDeferredPromise()
  14657. // 11.
  14658. if (innerResponse.body != null) {
  14659. // 11.1
  14660. const stream = innerResponse.body.stream
  14661. // 11.2
  14662. const reader = stream.getReader()
  14663. // 11.3
  14664. readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
  14665. } else {
  14666. bodyReadPromise.resolve(undefined)
  14667. }
  14668. // 12.
  14669. /** @type {CacheBatchOperation[]} */
  14670. const operations = []
  14671. // 13.
  14672. /** @type {CacheBatchOperation} */
  14673. const operation = {
  14674. type: 'put', // 14.
  14675. request: innerRequest, // 15.
  14676. response: clonedResponse // 16.
  14677. }
  14678. // 17.
  14679. operations.push(operation)
  14680. // 19.
  14681. const bytes = await bodyReadPromise.promise
  14682. if (clonedResponse.body != null) {
  14683. clonedResponse.body.source = bytes
  14684. }
  14685. // 19.1
  14686. const cacheJobPromise = createDeferredPromise()
  14687. // 19.2.1
  14688. let errorData = null
  14689. // 19.2.2
  14690. try {
  14691. this.#batchCacheOperations(operations)
  14692. } catch (e) {
  14693. errorData = e
  14694. }
  14695. // 19.2.3
  14696. queueMicrotask(() => {
  14697. // 19.2.3.1
  14698. if (errorData === null) {
  14699. cacheJobPromise.resolve()
  14700. } else { // 19.2.3.2
  14701. cacheJobPromise.reject(errorData)
  14702. }
  14703. })
  14704. return cacheJobPromise.promise
  14705. }
  14706. async delete (request, options = {}) {
  14707. webidl.brandCheck(this, Cache)
  14708. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' })
  14709. request = webidl.converters.RequestInfo(request)
  14710. options = webidl.converters.CacheQueryOptions(options)
  14711. /**
  14712. * @type {Request}
  14713. */
  14714. let r = null
  14715. if (request instanceof Request) {
  14716. r = request[kState]
  14717. if (r.method !== 'GET' && !options.ignoreMethod) {
  14718. return false
  14719. }
  14720. } else {
  14721. assert(typeof request === 'string')
  14722. r = new Request(request)[kState]
  14723. }
  14724. /** @type {CacheBatchOperation[]} */
  14725. const operations = []
  14726. /** @type {CacheBatchOperation} */
  14727. const operation = {
  14728. type: 'delete',
  14729. request: r,
  14730. options
  14731. }
  14732. operations.push(operation)
  14733. const cacheJobPromise = createDeferredPromise()
  14734. let errorData = null
  14735. let requestResponses
  14736. try {
  14737. requestResponses = this.#batchCacheOperations(operations)
  14738. } catch (e) {
  14739. errorData = e
  14740. }
  14741. queueMicrotask(() => {
  14742. if (errorData === null) {
  14743. cacheJobPromise.resolve(!!requestResponses?.length)
  14744. } else {
  14745. cacheJobPromise.reject(errorData)
  14746. }
  14747. })
  14748. return cacheJobPromise.promise
  14749. }
  14750. /**
  14751. * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
  14752. * @param {any} request
  14753. * @param {import('../../types/cache').CacheQueryOptions} options
  14754. * @returns {readonly Request[]}
  14755. */
  14756. async keys (request = undefined, options = {}) {
  14757. webidl.brandCheck(this, Cache)
  14758. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14759. options = webidl.converters.CacheQueryOptions(options)
  14760. // 1.
  14761. let r = null
  14762. // 2.
  14763. if (request !== undefined) {
  14764. // 2.1
  14765. if (request instanceof Request) {
  14766. // 2.1.1
  14767. r = request[kState]
  14768. // 2.1.2
  14769. if (r.method !== 'GET' && !options.ignoreMethod) {
  14770. return []
  14771. }
  14772. } else if (typeof request === 'string') { // 2.2
  14773. r = new Request(request)[kState]
  14774. }
  14775. }
  14776. // 4.
  14777. const promise = createDeferredPromise()
  14778. // 5.
  14779. // 5.1
  14780. const requests = []
  14781. // 5.2
  14782. if (request === undefined) {
  14783. // 5.2.1
  14784. for (const requestResponse of this.#relevantRequestResponseList) {
  14785. // 5.2.1.1
  14786. requests.push(requestResponse[0])
  14787. }
  14788. } else { // 5.3
  14789. // 5.3.1
  14790. const requestResponses = this.#queryCache(r, options)
  14791. // 5.3.2
  14792. for (const requestResponse of requestResponses) {
  14793. // 5.3.2.1
  14794. requests.push(requestResponse[0])
  14795. }
  14796. }
  14797. // 5.4
  14798. queueMicrotask(() => {
  14799. // 5.4.1
  14800. const requestList = []
  14801. // 5.4.2
  14802. for (const request of requests) {
  14803. const requestObject = new Request('https://a')
  14804. requestObject[kState] = request
  14805. requestObject[kHeaders][kHeadersList] = request.headersList
  14806. requestObject[kHeaders][kGuard] = 'immutable'
  14807. requestObject[kRealm] = request.client
  14808. // 5.4.2.1
  14809. requestList.push(requestObject)
  14810. }
  14811. // 5.4.3
  14812. promise.resolve(Object.freeze(requestList))
  14813. })
  14814. return promise.promise
  14815. }
  14816. /**
  14817. * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
  14818. * @param {CacheBatchOperation[]} operations
  14819. * @returns {requestResponseList}
  14820. */
  14821. #batchCacheOperations (operations) {
  14822. // 1.
  14823. const cache = this.#relevantRequestResponseList
  14824. // 2.
  14825. const backupCache = [...cache]
  14826. // 3.
  14827. const addedItems = []
  14828. // 4.1
  14829. const resultList = []
  14830. try {
  14831. // 4.2
  14832. for (const operation of operations) {
  14833. // 4.2.1
  14834. if (operation.type !== 'delete' && operation.type !== 'put') {
  14835. throw webidl.errors.exception({
  14836. header: 'Cache.#batchCacheOperations',
  14837. message: 'operation type does not match "delete" or "put"'
  14838. })
  14839. }
  14840. // 4.2.2
  14841. if (operation.type === 'delete' && operation.response != null) {
  14842. throw webidl.errors.exception({
  14843. header: 'Cache.#batchCacheOperations',
  14844. message: 'delete operation should not have an associated response'
  14845. })
  14846. }
  14847. // 4.2.3
  14848. if (this.#queryCache(operation.request, operation.options, addedItems).length) {
  14849. throw new DOMException('???', 'InvalidStateError')
  14850. }
  14851. // 4.2.4
  14852. let requestResponses
  14853. // 4.2.5
  14854. if (operation.type === 'delete') {
  14855. // 4.2.5.1
  14856. requestResponses = this.#queryCache(operation.request, operation.options)
  14857. // TODO: the spec is wrong, this is needed to pass WPTs
  14858. if (requestResponses.length === 0) {
  14859. return []
  14860. }
  14861. // 4.2.5.2
  14862. for (const requestResponse of requestResponses) {
  14863. const idx = cache.indexOf(requestResponse)
  14864. assert(idx !== -1)
  14865. // 4.2.5.2.1
  14866. cache.splice(idx, 1)
  14867. }
  14868. } else if (operation.type === 'put') { // 4.2.6
  14869. // 4.2.6.1
  14870. if (operation.response == null) {
  14871. throw webidl.errors.exception({
  14872. header: 'Cache.#batchCacheOperations',
  14873. message: 'put operation should have an associated response'
  14874. })
  14875. }
  14876. // 4.2.6.2
  14877. const r = operation.request
  14878. // 4.2.6.3
  14879. if (!urlIsHttpHttpsScheme(r.url)) {
  14880. throw webidl.errors.exception({
  14881. header: 'Cache.#batchCacheOperations',
  14882. message: 'expected http or https scheme'
  14883. })
  14884. }
  14885. // 4.2.6.4
  14886. if (r.method !== 'GET') {
  14887. throw webidl.errors.exception({
  14888. header: 'Cache.#batchCacheOperations',
  14889. message: 'not get method'
  14890. })
  14891. }
  14892. // 4.2.6.5
  14893. if (operation.options != null) {
  14894. throw webidl.errors.exception({
  14895. header: 'Cache.#batchCacheOperations',
  14896. message: 'options must not be defined'
  14897. })
  14898. }
  14899. // 4.2.6.6
  14900. requestResponses = this.#queryCache(operation.request)
  14901. // 4.2.6.7
  14902. for (const requestResponse of requestResponses) {
  14903. const idx = cache.indexOf(requestResponse)
  14904. assert(idx !== -1)
  14905. // 4.2.6.7.1
  14906. cache.splice(idx, 1)
  14907. }
  14908. // 4.2.6.8
  14909. cache.push([operation.request, operation.response])
  14910. // 4.2.6.10
  14911. addedItems.push([operation.request, operation.response])
  14912. }
  14913. // 4.2.7
  14914. resultList.push([operation.request, operation.response])
  14915. }
  14916. // 4.3
  14917. return resultList
  14918. } catch (e) { // 5.
  14919. // 5.1
  14920. this.#relevantRequestResponseList.length = 0
  14921. // 5.2
  14922. this.#relevantRequestResponseList = backupCache
  14923. // 5.3
  14924. throw e
  14925. }
  14926. }
  14927. /**
  14928. * @see https://w3c.github.io/ServiceWorker/#query-cache
  14929. * @param {any} requestQuery
  14930. * @param {import('../../types/cache').CacheQueryOptions} options
  14931. * @param {requestResponseList} targetStorage
  14932. * @returns {requestResponseList}
  14933. */
  14934. #queryCache (requestQuery, options, targetStorage) {
  14935. /** @type {requestResponseList} */
  14936. const resultList = []
  14937. const storage = targetStorage ?? this.#relevantRequestResponseList
  14938. for (const requestResponse of storage) {
  14939. const [cachedRequest, cachedResponse] = requestResponse
  14940. if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
  14941. resultList.push(requestResponse)
  14942. }
  14943. }
  14944. return resultList
  14945. }
  14946. /**
  14947. * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
  14948. * @param {any} requestQuery
  14949. * @param {any} request
  14950. * @param {any | null} response
  14951. * @param {import('../../types/cache').CacheQueryOptions | undefined} options
  14952. * @returns {boolean}
  14953. */
  14954. #requestMatchesCachedItem (requestQuery, request, response = null, options) {
  14955. // if (options?.ignoreMethod === false && request.method === 'GET') {
  14956. // return false
  14957. // }
  14958. const queryURL = new URL(requestQuery.url)
  14959. const cachedURL = new URL(request.url)
  14960. if (options?.ignoreSearch) {
  14961. cachedURL.search = ''
  14962. queryURL.search = ''
  14963. }
  14964. if (!urlEquals(queryURL, cachedURL, true)) {
  14965. return false
  14966. }
  14967. if (
  14968. response == null ||
  14969. options?.ignoreVary ||
  14970. !response.headersList.contains('vary')
  14971. ) {
  14972. return true
  14973. }
  14974. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14975. for (const fieldValue of fieldValues) {
  14976. if (fieldValue === '*') {
  14977. return false
  14978. }
  14979. const requestValue = request.headersList.get(fieldValue)
  14980. const queryValue = requestQuery.headersList.get(fieldValue)
  14981. // If one has the header and the other doesn't, or one has
  14982. // a different value than the other, return false
  14983. if (requestValue !== queryValue) {
  14984. return false
  14985. }
  14986. }
  14987. return true
  14988. }
  14989. }
  14990. Object.defineProperties(Cache.prototype, {
  14991. [Symbol.toStringTag]: {
  14992. value: 'Cache',
  14993. configurable: true
  14994. },
  14995. match: kEnumerableProperty,
  14996. matchAll: kEnumerableProperty,
  14997. add: kEnumerableProperty,
  14998. addAll: kEnumerableProperty,
  14999. put: kEnumerableProperty,
  15000. delete: kEnumerableProperty,
  15001. keys: kEnumerableProperty
  15002. })
  15003. const cacheQueryOptionConverters = [
  15004. {
  15005. key: 'ignoreSearch',
  15006. converter: webidl.converters.boolean,
  15007. defaultValue: false
  15008. },
  15009. {
  15010. key: 'ignoreMethod',
  15011. converter: webidl.converters.boolean,
  15012. defaultValue: false
  15013. },
  15014. {
  15015. key: 'ignoreVary',
  15016. converter: webidl.converters.boolean,
  15017. defaultValue: false
  15018. }
  15019. ]
  15020. webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)
  15021. webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
  15022. ...cacheQueryOptionConverters,
  15023. {
  15024. key: 'cacheName',
  15025. converter: webidl.converters.DOMString
  15026. }
  15027. ])
  15028. webidl.converters.Response = webidl.interfaceConverter(Response)
  15029. webidl.converters['sequence<RequestInfo>'] = webidl.sequenceConverter(
  15030. webidl.converters.RequestInfo
  15031. )
  15032. module.exports = {
  15033. Cache
  15034. }
  15035. /***/ }),
  15036. /***/ 7907:
  15037. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15038. "use strict";
  15039. const { kConstruct } = __nccwpck_require__(9174)
  15040. const { Cache } = __nccwpck_require__(6101)
  15041. const { webidl } = __nccwpck_require__(1744)
  15042. const { kEnumerableProperty } = __nccwpck_require__(3983)
  15043. class CacheStorage {
  15044. /**
  15045. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
  15046. * @type {Map<string, import('./cache').requestResponseList}
  15047. */
  15048. #caches = new Map()
  15049. constructor () {
  15050. if (arguments[0] !== kConstruct) {
  15051. webidl.illegalConstructor()
  15052. }
  15053. }
  15054. async match (request, options = {}) {
  15055. webidl.brandCheck(this, CacheStorage)
  15056. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.match' })
  15057. request = webidl.converters.RequestInfo(request)
  15058. options = webidl.converters.MultiCacheQueryOptions(options)
  15059. // 1.
  15060. if (options.cacheName != null) {
  15061. // 1.1.1.1
  15062. if (this.#caches.has(options.cacheName)) {
  15063. // 1.1.1.1.1
  15064. const cacheList = this.#caches.get(options.cacheName)
  15065. const cache = new Cache(kConstruct, cacheList)
  15066. return await cache.match(request, options)
  15067. }
  15068. } else { // 2.
  15069. // 2.2
  15070. for (const cacheList of this.#caches.values()) {
  15071. const cache = new Cache(kConstruct, cacheList)
  15072. // 2.2.1.2
  15073. const response = await cache.match(request, options)
  15074. if (response !== undefined) {
  15075. return response
  15076. }
  15077. }
  15078. }
  15079. }
  15080. /**
  15081. * @see https://w3c.github.io/ServiceWorker/#cache-storage-has
  15082. * @param {string} cacheName
  15083. * @returns {Promise<boolean>}
  15084. */
  15085. async has (cacheName) {
  15086. webidl.brandCheck(this, CacheStorage)
  15087. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' })
  15088. cacheName = webidl.converters.DOMString(cacheName)
  15089. // 2.1.1
  15090. // 2.2
  15091. return this.#caches.has(cacheName)
  15092. }
  15093. /**
  15094. * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
  15095. * @param {string} cacheName
  15096. * @returns {Promise<Cache>}
  15097. */
  15098. async open (cacheName) {
  15099. webidl.brandCheck(this, CacheStorage)
  15100. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' })
  15101. cacheName = webidl.converters.DOMString(cacheName)
  15102. // 2.1
  15103. if (this.#caches.has(cacheName)) {
  15104. // await caches.open('v1') !== await caches.open('v1')
  15105. // 2.1.1
  15106. const cache = this.#caches.get(cacheName)
  15107. // 2.1.1.1
  15108. return new Cache(kConstruct, cache)
  15109. }
  15110. // 2.2
  15111. const cache = []
  15112. // 2.3
  15113. this.#caches.set(cacheName, cache)
  15114. // 2.4
  15115. return new Cache(kConstruct, cache)
  15116. }
  15117. /**
  15118. * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
  15119. * @param {string} cacheName
  15120. * @returns {Promise<boolean>}
  15121. */
  15122. async delete (cacheName) {
  15123. webidl.brandCheck(this, CacheStorage)
  15124. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' })
  15125. cacheName = webidl.converters.DOMString(cacheName)
  15126. return this.#caches.delete(cacheName)
  15127. }
  15128. /**
  15129. * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
  15130. * @returns {string[]}
  15131. */
  15132. async keys () {
  15133. webidl.brandCheck(this, CacheStorage)
  15134. // 2.1
  15135. const keys = this.#caches.keys()
  15136. // 2.2
  15137. return [...keys]
  15138. }
  15139. }
  15140. Object.defineProperties(CacheStorage.prototype, {
  15141. [Symbol.toStringTag]: {
  15142. value: 'CacheStorage',
  15143. configurable: true
  15144. },
  15145. match: kEnumerableProperty,
  15146. has: kEnumerableProperty,
  15147. open: kEnumerableProperty,
  15148. delete: kEnumerableProperty,
  15149. keys: kEnumerableProperty
  15150. })
  15151. module.exports = {
  15152. CacheStorage
  15153. }
  15154. /***/ }),
  15155. /***/ 9174:
  15156. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15157. "use strict";
  15158. module.exports = {
  15159. kConstruct: (__nccwpck_require__(2785).kConstruct)
  15160. }
  15161. /***/ }),
  15162. /***/ 2396:
  15163. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15164. "use strict";
  15165. const assert = __nccwpck_require__(9491)
  15166. const { URLSerializer } = __nccwpck_require__(685)
  15167. const { isValidHeaderName } = __nccwpck_require__(2538)
  15168. /**
  15169. * @see https://url.spec.whatwg.org/#concept-url-equals
  15170. * @param {URL} A
  15171. * @param {URL} B
  15172. * @param {boolean | undefined} excludeFragment
  15173. * @returns {boolean}
  15174. */
  15175. function urlEquals (A, B, excludeFragment = false) {
  15176. const serializedA = URLSerializer(A, excludeFragment)
  15177. const serializedB = URLSerializer(B, excludeFragment)
  15178. return serializedA === serializedB
  15179. }
  15180. /**
  15181. * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
  15182. * @param {string} header
  15183. */
  15184. function fieldValues (header) {
  15185. assert(header !== null)
  15186. const values = []
  15187. for (let value of header.split(',')) {
  15188. value = value.trim()
  15189. if (!value.length) {
  15190. continue
  15191. } else if (!isValidHeaderName(value)) {
  15192. continue
  15193. }
  15194. values.push(value)
  15195. }
  15196. return values
  15197. }
  15198. module.exports = {
  15199. urlEquals,
  15200. fieldValues
  15201. }
  15202. /***/ }),
  15203. /***/ 3598:
  15204. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15205. "use strict";
  15206. // @ts-check
  15207. /* global WebAssembly */
  15208. const assert = __nccwpck_require__(9491)
  15209. const net = __nccwpck_require__(1808)
  15210. const http = __nccwpck_require__(3685)
  15211. const { pipeline } = __nccwpck_require__(2781)
  15212. const util = __nccwpck_require__(3983)
  15213. const timers = __nccwpck_require__(9459)
  15214. const Request = __nccwpck_require__(2905)
  15215. const DispatcherBase = __nccwpck_require__(4839)
  15216. const {
  15217. RequestContentLengthMismatchError,
  15218. ResponseContentLengthMismatchError,
  15219. InvalidArgumentError,
  15220. RequestAbortedError,
  15221. HeadersTimeoutError,
  15222. HeadersOverflowError,
  15223. SocketError,
  15224. InformationalError,
  15225. BodyTimeoutError,
  15226. HTTPParserError,
  15227. ResponseExceededMaxSizeError,
  15228. ClientDestroyedError
  15229. } = __nccwpck_require__(8045)
  15230. const buildConnector = __nccwpck_require__(2067)
  15231. const {
  15232. kUrl,
  15233. kReset,
  15234. kServerName,
  15235. kClient,
  15236. kBusy,
  15237. kParser,
  15238. kConnect,
  15239. kBlocking,
  15240. kResuming,
  15241. kRunning,
  15242. kPending,
  15243. kSize,
  15244. kWriting,
  15245. kQueue,
  15246. kConnected,
  15247. kConnecting,
  15248. kNeedDrain,
  15249. kNoRef,
  15250. kKeepAliveDefaultTimeout,
  15251. kHostHeader,
  15252. kPendingIdx,
  15253. kRunningIdx,
  15254. kError,
  15255. kPipelining,
  15256. kSocket,
  15257. kKeepAliveTimeoutValue,
  15258. kMaxHeadersSize,
  15259. kKeepAliveMaxTimeout,
  15260. kKeepAliveTimeoutThreshold,
  15261. kHeadersTimeout,
  15262. kBodyTimeout,
  15263. kStrictContentLength,
  15264. kConnector,
  15265. kMaxRedirections,
  15266. kMaxRequests,
  15267. kCounter,
  15268. kClose,
  15269. kDestroy,
  15270. kDispatch,
  15271. kInterceptors,
  15272. kLocalAddress,
  15273. kMaxResponseSize,
  15274. kHTTPConnVersion,
  15275. // HTTP2
  15276. kHost,
  15277. kHTTP2Session,
  15278. kHTTP2SessionState,
  15279. kHTTP2BuildRequest,
  15280. kHTTP2CopyHeaders,
  15281. kHTTP1BuildRequest
  15282. } = __nccwpck_require__(2785)
  15283. /** @type {import('http2')} */
  15284. let http2
  15285. try {
  15286. http2 = __nccwpck_require__(5158)
  15287. } catch {
  15288. // @ts-ignore
  15289. http2 = { constants: {} }
  15290. }
  15291. const {
  15292. constants: {
  15293. HTTP2_HEADER_AUTHORITY,
  15294. HTTP2_HEADER_METHOD,
  15295. HTTP2_HEADER_PATH,
  15296. HTTP2_HEADER_SCHEME,
  15297. HTTP2_HEADER_CONTENT_LENGTH,
  15298. HTTP2_HEADER_EXPECT,
  15299. HTTP2_HEADER_STATUS
  15300. }
  15301. } = http2
  15302. // Experimental
  15303. let h2ExperimentalWarned = false
  15304. const FastBuffer = Buffer[Symbol.species]
  15305. const kClosedResolve = Symbol('kClosedResolve')
  15306. const channels = {}
  15307. try {
  15308. const diagnosticsChannel = __nccwpck_require__(7643)
  15309. channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders')
  15310. channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect')
  15311. channels.connectError = diagnosticsChannel.channel('undici:client:connectError')
  15312. channels.connected = diagnosticsChannel.channel('undici:client:connected')
  15313. } catch {
  15314. channels.sendHeaders = { hasSubscribers: false }
  15315. channels.beforeConnect = { hasSubscribers: false }
  15316. channels.connectError = { hasSubscribers: false }
  15317. channels.connected = { hasSubscribers: false }
  15318. }
  15319. /**
  15320. * @type {import('../types/client').default}
  15321. */
  15322. class Client extends DispatcherBase {
  15323. /**
  15324. *
  15325. * @param {string|URL} url
  15326. * @param {import('../types/client').Client.Options} options
  15327. */
  15328. constructor (url, {
  15329. interceptors,
  15330. maxHeaderSize,
  15331. headersTimeout,
  15332. socketTimeout,
  15333. requestTimeout,
  15334. connectTimeout,
  15335. bodyTimeout,
  15336. idleTimeout,
  15337. keepAlive,
  15338. keepAliveTimeout,
  15339. maxKeepAliveTimeout,
  15340. keepAliveMaxTimeout,
  15341. keepAliveTimeoutThreshold,
  15342. socketPath,
  15343. pipelining,
  15344. tls,
  15345. strictContentLength,
  15346. maxCachedSessions,
  15347. maxRedirections,
  15348. connect,
  15349. maxRequestsPerClient,
  15350. localAddress,
  15351. maxResponseSize,
  15352. autoSelectFamily,
  15353. autoSelectFamilyAttemptTimeout,
  15354. // h2
  15355. allowH2,
  15356. maxConcurrentStreams
  15357. } = {}) {
  15358. super()
  15359. if (keepAlive !== undefined) {
  15360. throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
  15361. }
  15362. if (socketTimeout !== undefined) {
  15363. throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
  15364. }
  15365. if (requestTimeout !== undefined) {
  15366. throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
  15367. }
  15368. if (idleTimeout !== undefined) {
  15369. throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
  15370. }
  15371. if (maxKeepAliveTimeout !== undefined) {
  15372. throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
  15373. }
  15374. if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {
  15375. throw new InvalidArgumentError('invalid maxHeaderSize')
  15376. }
  15377. if (socketPath != null && typeof socketPath !== 'string') {
  15378. throw new InvalidArgumentError('invalid socketPath')
  15379. }
  15380. if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
  15381. throw new InvalidArgumentError('invalid connectTimeout')
  15382. }
  15383. if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
  15384. throw new InvalidArgumentError('invalid keepAliveTimeout')
  15385. }
  15386. if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
  15387. throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
  15388. }
  15389. if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
  15390. throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
  15391. }
  15392. if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
  15393. throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
  15394. }
  15395. if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
  15396. throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
  15397. }
  15398. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  15399. throw new InvalidArgumentError('connect must be a function or an object')
  15400. }
  15401. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  15402. throw new InvalidArgumentError('maxRedirections must be a positive number')
  15403. }
  15404. if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
  15405. throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
  15406. }
  15407. if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
  15408. throw new InvalidArgumentError('localAddress must be valid string IP address')
  15409. }
  15410. if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
  15411. throw new InvalidArgumentError('maxResponseSize must be a positive number')
  15412. }
  15413. if (
  15414. autoSelectFamilyAttemptTimeout != null &&
  15415. (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
  15416. ) {
  15417. throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
  15418. }
  15419. // h2
  15420. if (allowH2 != null && typeof allowH2 !== 'boolean') {
  15421. throw new InvalidArgumentError('allowH2 must be a valid boolean value')
  15422. }
  15423. if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
  15424. throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0')
  15425. }
  15426. if (typeof connect !== 'function') {
  15427. connect = buildConnector({
  15428. ...tls,
  15429. maxCachedSessions,
  15430. allowH2,
  15431. socketPath,
  15432. timeout: connectTimeout,
  15433. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  15434. ...connect
  15435. })
  15436. }
  15437. this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client)
  15438. ? interceptors.Client
  15439. : [createRedirectInterceptor({ maxRedirections })]
  15440. this[kUrl] = util.parseOrigin(url)
  15441. this[kConnector] = connect
  15442. this[kSocket] = null
  15443. this[kPipelining] = pipelining != null ? pipelining : 1
  15444. this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
  15445. this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
  15446. this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
  15447. this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold
  15448. this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
  15449. this[kServerName] = null
  15450. this[kLocalAddress] = localAddress != null ? localAddress : null
  15451. this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
  15452. this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
  15453. this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n`
  15454. this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
  15455. this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
  15456. this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
  15457. this[kMaxRedirections] = maxRedirections
  15458. this[kMaxRequests] = maxRequestsPerClient
  15459. this[kClosedResolve] = null
  15460. this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
  15461. this[kHTTPConnVersion] = 'h1'
  15462. // HTTP/2
  15463. this[kHTTP2Session] = null
  15464. this[kHTTP2SessionState] = !allowH2
  15465. ? null
  15466. : {
  15467. // streams: null, // Fixed queue of streams - For future support of `push`
  15468. openStreams: 0, // Keep track of them to decide wether or not unref the session
  15469. maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server
  15470. }
  15471. this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`
  15472. // kQueue is built up of 3 sections separated by
  15473. // the kRunningIdx and kPendingIdx indices.
  15474. // | complete | running | pending |
  15475. // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
  15476. // kRunningIdx points to the first running element.
  15477. // kPendingIdx points to the first pending element.
  15478. // This implements a fast queue with an amortized
  15479. // time of O(1).
  15480. this[kQueue] = []
  15481. this[kRunningIdx] = 0
  15482. this[kPendingIdx] = 0
  15483. }
  15484. get pipelining () {
  15485. return this[kPipelining]
  15486. }
  15487. set pipelining (value) {
  15488. this[kPipelining] = value
  15489. resume(this, true)
  15490. }
  15491. get [kPending] () {
  15492. return this[kQueue].length - this[kPendingIdx]
  15493. }
  15494. get [kRunning] () {
  15495. return this[kPendingIdx] - this[kRunningIdx]
  15496. }
  15497. get [kSize] () {
  15498. return this[kQueue].length - this[kRunningIdx]
  15499. }
  15500. get [kConnected] () {
  15501. return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed
  15502. }
  15503. get [kBusy] () {
  15504. const socket = this[kSocket]
  15505. return (
  15506. (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) ||
  15507. (this[kSize] >= (this[kPipelining] || 1)) ||
  15508. this[kPending] > 0
  15509. )
  15510. }
  15511. /* istanbul ignore: only used for test */
  15512. [kConnect] (cb) {
  15513. connect(this)
  15514. this.once('connect', cb)
  15515. }
  15516. [kDispatch] (opts, handler) {
  15517. const origin = opts.origin || this[kUrl].origin
  15518. const request = this[kHTTPConnVersion] === 'h2'
  15519. ? Request[kHTTP2BuildRequest](origin, opts, handler)
  15520. : Request[kHTTP1BuildRequest](origin, opts, handler)
  15521. this[kQueue].push(request)
  15522. if (this[kResuming]) {
  15523. // Do nothing.
  15524. } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
  15525. // Wait a tick in case stream/iterator is ended in the same tick.
  15526. this[kResuming] = 1
  15527. process.nextTick(resume, this)
  15528. } else {
  15529. resume(this, true)
  15530. }
  15531. if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
  15532. this[kNeedDrain] = 2
  15533. }
  15534. return this[kNeedDrain] < 2
  15535. }
  15536. async [kClose] () {
  15537. // TODO: for H2 we need to gracefully flush the remaining enqueued
  15538. // request and close each stream.
  15539. return new Promise((resolve) => {
  15540. if (!this[kSize]) {
  15541. resolve(null)
  15542. } else {
  15543. this[kClosedResolve] = resolve
  15544. }
  15545. })
  15546. }
  15547. async [kDestroy] (err) {
  15548. return new Promise((resolve) => {
  15549. const requests = this[kQueue].splice(this[kPendingIdx])
  15550. for (let i = 0; i < requests.length; i++) {
  15551. const request = requests[i]
  15552. errorRequest(this, request, err)
  15553. }
  15554. const callback = () => {
  15555. if (this[kClosedResolve]) {
  15556. // TODO (fix): Should we error here with ClientDestroyedError?
  15557. this[kClosedResolve]()
  15558. this[kClosedResolve] = null
  15559. }
  15560. resolve()
  15561. }
  15562. if (this[kHTTP2Session] != null) {
  15563. util.destroy(this[kHTTP2Session], err)
  15564. this[kHTTP2Session] = null
  15565. this[kHTTP2SessionState] = null
  15566. }
  15567. if (!this[kSocket]) {
  15568. queueMicrotask(callback)
  15569. } else {
  15570. util.destroy(this[kSocket].on('close', callback), err)
  15571. }
  15572. resume(this)
  15573. })
  15574. }
  15575. }
  15576. function onHttp2SessionError (err) {
  15577. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15578. this[kSocket][kError] = err
  15579. onError(this[kClient], err)
  15580. }
  15581. function onHttp2FrameError (type, code, id) {
  15582. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  15583. if (id === 0) {
  15584. this[kSocket][kError] = err
  15585. onError(this[kClient], err)
  15586. }
  15587. }
  15588. function onHttp2SessionEnd () {
  15589. util.destroy(this, new SocketError('other side closed'))
  15590. util.destroy(this[kSocket], new SocketError('other side closed'))
  15591. }
  15592. function onHTTP2GoAway (code) {
  15593. const client = this[kClient]
  15594. const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`)
  15595. client[kSocket] = null
  15596. client[kHTTP2Session] = null
  15597. if (client.destroyed) {
  15598. assert(this[kPending] === 0)
  15599. // Fail entire queue.
  15600. const requests = client[kQueue].splice(client[kRunningIdx])
  15601. for (let i = 0; i < requests.length; i++) {
  15602. const request = requests[i]
  15603. errorRequest(this, request, err)
  15604. }
  15605. } else if (client[kRunning] > 0) {
  15606. // Fail head of pipeline.
  15607. const request = client[kQueue][client[kRunningIdx]]
  15608. client[kQueue][client[kRunningIdx]++] = null
  15609. errorRequest(client, request, err)
  15610. }
  15611. client[kPendingIdx] = client[kRunningIdx]
  15612. assert(client[kRunning] === 0)
  15613. client.emit('disconnect',
  15614. client[kUrl],
  15615. [client],
  15616. err
  15617. )
  15618. resume(client)
  15619. }
  15620. const constants = __nccwpck_require__(953)
  15621. const createRedirectInterceptor = __nccwpck_require__(8861)
  15622. const EMPTY_BUF = Buffer.alloc(0)
  15623. async function lazyllhttp () {
  15624. const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(1145) : undefined
  15625. let mod
  15626. try {
  15627. mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(5627), 'base64'))
  15628. } catch (e) {
  15629. /* istanbul ignore next */
  15630. // We could check if the error was caused by the simd option not
  15631. // being enabled, but the occurring of this other error
  15632. // * https://github.com/emscripten-core/emscripten/issues/11495
  15633. // got me to remove that check to avoid breaking Node 12.
  15634. mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(1145), 'base64'))
  15635. }
  15636. return await WebAssembly.instantiate(mod, {
  15637. env: {
  15638. /* eslint-disable camelcase */
  15639. wasm_on_url: (p, at, len) => {
  15640. /* istanbul ignore next */
  15641. return 0
  15642. },
  15643. wasm_on_status: (p, at, len) => {
  15644. assert.strictEqual(currentParser.ptr, p)
  15645. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15646. return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15647. },
  15648. wasm_on_message_begin: (p) => {
  15649. assert.strictEqual(currentParser.ptr, p)
  15650. return currentParser.onMessageBegin() || 0
  15651. },
  15652. wasm_on_header_field: (p, at, len) => {
  15653. assert.strictEqual(currentParser.ptr, p)
  15654. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15655. return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15656. },
  15657. wasm_on_header_value: (p, at, len) => {
  15658. assert.strictEqual(currentParser.ptr, p)
  15659. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15660. return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15661. },
  15662. wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
  15663. assert.strictEqual(currentParser.ptr, p)
  15664. return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0
  15665. },
  15666. wasm_on_body: (p, at, len) => {
  15667. assert.strictEqual(currentParser.ptr, p)
  15668. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15669. return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15670. },
  15671. wasm_on_message_complete: (p) => {
  15672. assert.strictEqual(currentParser.ptr, p)
  15673. return currentParser.onMessageComplete() || 0
  15674. }
  15675. /* eslint-enable camelcase */
  15676. }
  15677. })
  15678. }
  15679. let llhttpInstance = null
  15680. let llhttpPromise = lazyllhttp()
  15681. llhttpPromise.catch()
  15682. let currentParser = null
  15683. let currentBufferRef = null
  15684. let currentBufferSize = 0
  15685. let currentBufferPtr = null
  15686. const TIMEOUT_HEADERS = 1
  15687. const TIMEOUT_BODY = 2
  15688. const TIMEOUT_IDLE = 3
  15689. class Parser {
  15690. constructor (client, socket, { exports }) {
  15691. assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)
  15692. this.llhttp = exports
  15693. this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
  15694. this.client = client
  15695. this.socket = socket
  15696. this.timeout = null
  15697. this.timeoutValue = null
  15698. this.timeoutType = null
  15699. this.statusCode = null
  15700. this.statusText = ''
  15701. this.upgrade = false
  15702. this.headers = []
  15703. this.headersSize = 0
  15704. this.headersMaxSize = client[kMaxHeadersSize]
  15705. this.shouldKeepAlive = false
  15706. this.paused = false
  15707. this.resume = this.resume.bind(this)
  15708. this.bytesRead = 0
  15709. this.keepAlive = ''
  15710. this.contentLength = ''
  15711. this.connection = ''
  15712. this.maxResponseSize = client[kMaxResponseSize]
  15713. }
  15714. setTimeout (value, type) {
  15715. this.timeoutType = type
  15716. if (value !== this.timeoutValue) {
  15717. timers.clearTimeout(this.timeout)
  15718. if (value) {
  15719. this.timeout = timers.setTimeout(onParserTimeout, value, this)
  15720. // istanbul ignore else: only for jest
  15721. if (this.timeout.unref) {
  15722. this.timeout.unref()
  15723. }
  15724. } else {
  15725. this.timeout = null
  15726. }
  15727. this.timeoutValue = value
  15728. } else if (this.timeout) {
  15729. // istanbul ignore else: only for jest
  15730. if (this.timeout.refresh) {
  15731. this.timeout.refresh()
  15732. }
  15733. }
  15734. }
  15735. resume () {
  15736. if (this.socket.destroyed || !this.paused) {
  15737. return
  15738. }
  15739. assert(this.ptr != null)
  15740. assert(currentParser == null)
  15741. this.llhttp.llhttp_resume(this.ptr)
  15742. assert(this.timeoutType === TIMEOUT_BODY)
  15743. if (this.timeout) {
  15744. // istanbul ignore else: only for jest
  15745. if (this.timeout.refresh) {
  15746. this.timeout.refresh()
  15747. }
  15748. }
  15749. this.paused = false
  15750. this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
  15751. this.readMore()
  15752. }
  15753. readMore () {
  15754. while (!this.paused && this.ptr) {
  15755. const chunk = this.socket.read()
  15756. if (chunk === null) {
  15757. break
  15758. }
  15759. this.execute(chunk)
  15760. }
  15761. }
  15762. execute (data) {
  15763. assert(this.ptr != null)
  15764. assert(currentParser == null)
  15765. assert(!this.paused)
  15766. const { socket, llhttp } = this
  15767. if (data.length > currentBufferSize) {
  15768. if (currentBufferPtr) {
  15769. llhttp.free(currentBufferPtr)
  15770. }
  15771. currentBufferSize = Math.ceil(data.length / 4096) * 4096
  15772. currentBufferPtr = llhttp.malloc(currentBufferSize)
  15773. }
  15774. new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)
  15775. // Call `execute` on the wasm parser.
  15776. // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
  15777. // and finally the length of bytes to parse.
  15778. // The return value is an error code or `constants.ERROR.OK`.
  15779. try {
  15780. let ret
  15781. try {
  15782. currentBufferRef = data
  15783. currentParser = this
  15784. ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)
  15785. /* eslint-disable-next-line no-useless-catch */
  15786. } catch (err) {
  15787. /* istanbul ignore next: difficult to make a test case for */
  15788. throw err
  15789. } finally {
  15790. currentParser = null
  15791. currentBufferRef = null
  15792. }
  15793. const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr
  15794. if (ret === constants.ERROR.PAUSED_UPGRADE) {
  15795. this.onUpgrade(data.slice(offset))
  15796. } else if (ret === constants.ERROR.PAUSED) {
  15797. this.paused = true
  15798. socket.unshift(data.slice(offset))
  15799. } else if (ret !== constants.ERROR.OK) {
  15800. const ptr = llhttp.llhttp_get_error_reason(this.ptr)
  15801. let message = ''
  15802. /* istanbul ignore else: difficult to make a test case for */
  15803. if (ptr) {
  15804. const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
  15805. message =
  15806. 'Response does not match the HTTP/1.1 protocol (' +
  15807. Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
  15808. ')'
  15809. }
  15810. throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))
  15811. }
  15812. } catch (err) {
  15813. util.destroy(socket, err)
  15814. }
  15815. }
  15816. destroy () {
  15817. assert(this.ptr != null)
  15818. assert(currentParser == null)
  15819. this.llhttp.llhttp_free(this.ptr)
  15820. this.ptr = null
  15821. timers.clearTimeout(this.timeout)
  15822. this.timeout = null
  15823. this.timeoutValue = null
  15824. this.timeoutType = null
  15825. this.paused = false
  15826. }
  15827. onStatus (buf) {
  15828. this.statusText = buf.toString()
  15829. }
  15830. onMessageBegin () {
  15831. const { socket, client } = this
  15832. /* istanbul ignore next: difficult to make a test case for */
  15833. if (socket.destroyed) {
  15834. return -1
  15835. }
  15836. const request = client[kQueue][client[kRunningIdx]]
  15837. if (!request) {
  15838. return -1
  15839. }
  15840. }
  15841. onHeaderField (buf) {
  15842. const len = this.headers.length
  15843. if ((len & 1) === 0) {
  15844. this.headers.push(buf)
  15845. } else {
  15846. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15847. }
  15848. this.trackHeader(buf.length)
  15849. }
  15850. onHeaderValue (buf) {
  15851. let len = this.headers.length
  15852. if ((len & 1) === 1) {
  15853. this.headers.push(buf)
  15854. len += 1
  15855. } else {
  15856. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15857. }
  15858. const key = this.headers[len - 2]
  15859. if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') {
  15860. this.keepAlive += buf.toString()
  15861. } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {
  15862. this.connection += buf.toString()
  15863. } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {
  15864. this.contentLength += buf.toString()
  15865. }
  15866. this.trackHeader(buf.length)
  15867. }
  15868. trackHeader (len) {
  15869. this.headersSize += len
  15870. if (this.headersSize >= this.headersMaxSize) {
  15871. util.destroy(this.socket, new HeadersOverflowError())
  15872. }
  15873. }
  15874. onUpgrade (head) {
  15875. const { upgrade, client, socket, headers, statusCode } = this
  15876. assert(upgrade)
  15877. const request = client[kQueue][client[kRunningIdx]]
  15878. assert(request)
  15879. assert(!socket.destroyed)
  15880. assert(socket === client[kSocket])
  15881. assert(!this.paused)
  15882. assert(request.upgrade || request.method === 'CONNECT')
  15883. this.statusCode = null
  15884. this.statusText = ''
  15885. this.shouldKeepAlive = null
  15886. assert(this.headers.length % 2 === 0)
  15887. this.headers = []
  15888. this.headersSize = 0
  15889. socket.unshift(head)
  15890. socket[kParser].destroy()
  15891. socket[kParser] = null
  15892. socket[kClient] = null
  15893. socket[kError] = null
  15894. socket
  15895. .removeListener('error', onSocketError)
  15896. .removeListener('readable', onSocketReadable)
  15897. .removeListener('end', onSocketEnd)
  15898. .removeListener('close', onSocketClose)
  15899. client[kSocket] = null
  15900. client[kQueue][client[kRunningIdx]++] = null
  15901. client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
  15902. try {
  15903. request.onUpgrade(statusCode, headers, socket)
  15904. } catch (err) {
  15905. util.destroy(socket, err)
  15906. }
  15907. resume(client)
  15908. }
  15909. onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
  15910. const { client, socket, headers, statusText } = this
  15911. /* istanbul ignore next: difficult to make a test case for */
  15912. if (socket.destroyed) {
  15913. return -1
  15914. }
  15915. const request = client[kQueue][client[kRunningIdx]]
  15916. /* istanbul ignore next: difficult to make a test case for */
  15917. if (!request) {
  15918. return -1
  15919. }
  15920. assert(!this.upgrade)
  15921. assert(this.statusCode < 200)
  15922. if (statusCode === 100) {
  15923. util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
  15924. return -1
  15925. }
  15926. /* this can only happen if server is misbehaving */
  15927. if (upgrade && !request.upgrade) {
  15928. util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
  15929. return -1
  15930. }
  15931. assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS)
  15932. this.statusCode = statusCode
  15933. this.shouldKeepAlive = (
  15934. shouldKeepAlive ||
  15935. // Override llhttp value which does not allow keepAlive for HEAD.
  15936. (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
  15937. )
  15938. if (this.statusCode >= 200) {
  15939. const bodyTimeout = request.bodyTimeout != null
  15940. ? request.bodyTimeout
  15941. : client[kBodyTimeout]
  15942. this.setTimeout(bodyTimeout, TIMEOUT_BODY)
  15943. } else if (this.timeout) {
  15944. // istanbul ignore else: only for jest
  15945. if (this.timeout.refresh) {
  15946. this.timeout.refresh()
  15947. }
  15948. }
  15949. if (request.method === 'CONNECT') {
  15950. assert(client[kRunning] === 1)
  15951. this.upgrade = true
  15952. return 2
  15953. }
  15954. if (upgrade) {
  15955. assert(client[kRunning] === 1)
  15956. this.upgrade = true
  15957. return 2
  15958. }
  15959. assert(this.headers.length % 2 === 0)
  15960. this.headers = []
  15961. this.headersSize = 0
  15962. if (this.shouldKeepAlive && client[kPipelining]) {
  15963. const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
  15964. if (keepAliveTimeout != null) {
  15965. const timeout = Math.min(
  15966. keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
  15967. client[kKeepAliveMaxTimeout]
  15968. )
  15969. if (timeout <= 0) {
  15970. socket[kReset] = true
  15971. } else {
  15972. client[kKeepAliveTimeoutValue] = timeout
  15973. }
  15974. } else {
  15975. client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
  15976. }
  15977. } else {
  15978. // Stop more requests from being dispatched.
  15979. socket[kReset] = true
  15980. }
  15981. const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
  15982. if (request.aborted) {
  15983. return -1
  15984. }
  15985. if (request.method === 'HEAD') {
  15986. return 1
  15987. }
  15988. if (statusCode < 200) {
  15989. return 1
  15990. }
  15991. if (socket[kBlocking]) {
  15992. socket[kBlocking] = false
  15993. resume(client)
  15994. }
  15995. return pause ? constants.ERROR.PAUSED : 0
  15996. }
  15997. onBody (buf) {
  15998. const { client, socket, statusCode, maxResponseSize } = this
  15999. if (socket.destroyed) {
  16000. return -1
  16001. }
  16002. const request = client[kQueue][client[kRunningIdx]]
  16003. assert(request)
  16004. assert.strictEqual(this.timeoutType, TIMEOUT_BODY)
  16005. if (this.timeout) {
  16006. // istanbul ignore else: only for jest
  16007. if (this.timeout.refresh) {
  16008. this.timeout.refresh()
  16009. }
  16010. }
  16011. assert(statusCode >= 200)
  16012. if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
  16013. util.destroy(socket, new ResponseExceededMaxSizeError())
  16014. return -1
  16015. }
  16016. this.bytesRead += buf.length
  16017. if (request.onData(buf) === false) {
  16018. return constants.ERROR.PAUSED
  16019. }
  16020. }
  16021. onMessageComplete () {
  16022. const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
  16023. if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
  16024. return -1
  16025. }
  16026. if (upgrade) {
  16027. return
  16028. }
  16029. const request = client[kQueue][client[kRunningIdx]]
  16030. assert(request)
  16031. assert(statusCode >= 100)
  16032. this.statusCode = null
  16033. this.statusText = ''
  16034. this.bytesRead = 0
  16035. this.contentLength = ''
  16036. this.keepAlive = ''
  16037. this.connection = ''
  16038. assert(this.headers.length % 2 === 0)
  16039. this.headers = []
  16040. this.headersSize = 0
  16041. if (statusCode < 200) {
  16042. return
  16043. }
  16044. /* istanbul ignore next: should be handled by llhttp? */
  16045. if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
  16046. util.destroy(socket, new ResponseContentLengthMismatchError())
  16047. return -1
  16048. }
  16049. request.onComplete(headers)
  16050. client[kQueue][client[kRunningIdx]++] = null
  16051. if (socket[kWriting]) {
  16052. assert.strictEqual(client[kRunning], 0)
  16053. // Response completed before request.
  16054. util.destroy(socket, new InformationalError('reset'))
  16055. return constants.ERROR.PAUSED
  16056. } else if (!shouldKeepAlive) {
  16057. util.destroy(socket, new InformationalError('reset'))
  16058. return constants.ERROR.PAUSED
  16059. } else if (socket[kReset] && client[kRunning] === 0) {
  16060. // Destroy socket once all requests have completed.
  16061. // The request at the tail of the pipeline is the one
  16062. // that requested reset and no further requests should
  16063. // have been queued since then.
  16064. util.destroy(socket, new InformationalError('reset'))
  16065. return constants.ERROR.PAUSED
  16066. } else if (client[kPipelining] === 1) {
  16067. // We must wait a full event loop cycle to reuse this socket to make sure
  16068. // that non-spec compliant servers are not closing the connection even if they
  16069. // said they won't.
  16070. setImmediate(resume, client)
  16071. } else {
  16072. resume(client)
  16073. }
  16074. }
  16075. }
  16076. function onParserTimeout (parser) {
  16077. const { socket, timeoutType, client } = parser
  16078. /* istanbul ignore else */
  16079. if (timeoutType === TIMEOUT_HEADERS) {
  16080. if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
  16081. assert(!parser.paused, 'cannot be paused while waiting for headers')
  16082. util.destroy(socket, new HeadersTimeoutError())
  16083. }
  16084. } else if (timeoutType === TIMEOUT_BODY) {
  16085. if (!parser.paused) {
  16086. util.destroy(socket, new BodyTimeoutError())
  16087. }
  16088. } else if (timeoutType === TIMEOUT_IDLE) {
  16089. assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
  16090. util.destroy(socket, new InformationalError('socket idle timeout'))
  16091. }
  16092. }
  16093. function onSocketReadable () {
  16094. const { [kParser]: parser } = this
  16095. if (parser) {
  16096. parser.readMore()
  16097. }
  16098. }
  16099. function onSocketError (err) {
  16100. const { [kClient]: client, [kParser]: parser } = this
  16101. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  16102. if (client[kHTTPConnVersion] !== 'h2') {
  16103. // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
  16104. // to the user.
  16105. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
  16106. // We treat all incoming data so for as a valid response.
  16107. parser.onMessageComplete()
  16108. return
  16109. }
  16110. }
  16111. this[kError] = err
  16112. onError(this[kClient], err)
  16113. }
  16114. function onError (client, err) {
  16115. if (
  16116. client[kRunning] === 0 &&
  16117. err.code !== 'UND_ERR_INFO' &&
  16118. err.code !== 'UND_ERR_SOCKET'
  16119. ) {
  16120. // Error is not caused by running request and not a recoverable
  16121. // socket error.
  16122. assert(client[kPendingIdx] === client[kRunningIdx])
  16123. const requests = client[kQueue].splice(client[kRunningIdx])
  16124. for (let i = 0; i < requests.length; i++) {
  16125. const request = requests[i]
  16126. errorRequest(client, request, err)
  16127. }
  16128. assert(client[kSize] === 0)
  16129. }
  16130. }
  16131. function onSocketEnd () {
  16132. const { [kParser]: parser, [kClient]: client } = this
  16133. if (client[kHTTPConnVersion] !== 'h2') {
  16134. if (parser.statusCode && !parser.shouldKeepAlive) {
  16135. // We treat all incoming data so far as a valid response.
  16136. parser.onMessageComplete()
  16137. return
  16138. }
  16139. }
  16140. util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
  16141. }
  16142. function onSocketClose () {
  16143. const { [kClient]: client, [kParser]: parser } = this
  16144. if (client[kHTTPConnVersion] === 'h1' && parser) {
  16145. if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
  16146. // We treat all incoming data so far as a valid response.
  16147. parser.onMessageComplete()
  16148. }
  16149. this[kParser].destroy()
  16150. this[kParser] = null
  16151. }
  16152. const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
  16153. client[kSocket] = null
  16154. if (client.destroyed) {
  16155. assert(client[kPending] === 0)
  16156. // Fail entire queue.
  16157. const requests = client[kQueue].splice(client[kRunningIdx])
  16158. for (let i = 0; i < requests.length; i++) {
  16159. const request = requests[i]
  16160. errorRequest(client, request, err)
  16161. }
  16162. } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
  16163. // Fail head of pipeline.
  16164. const request = client[kQueue][client[kRunningIdx]]
  16165. client[kQueue][client[kRunningIdx]++] = null
  16166. errorRequest(client, request, err)
  16167. }
  16168. client[kPendingIdx] = client[kRunningIdx]
  16169. assert(client[kRunning] === 0)
  16170. client.emit('disconnect', client[kUrl], [client], err)
  16171. resume(client)
  16172. }
  16173. async function connect (client) {
  16174. assert(!client[kConnecting])
  16175. assert(!client[kSocket])
  16176. let { host, hostname, protocol, port } = client[kUrl]
  16177. // Resolve ipv6
  16178. if (hostname[0] === '[') {
  16179. const idx = hostname.indexOf(']')
  16180. assert(idx !== -1)
  16181. const ip = hostname.substring(1, idx)
  16182. assert(net.isIP(ip))
  16183. hostname = ip
  16184. }
  16185. client[kConnecting] = true
  16186. if (channels.beforeConnect.hasSubscribers) {
  16187. channels.beforeConnect.publish({
  16188. connectParams: {
  16189. host,
  16190. hostname,
  16191. protocol,
  16192. port,
  16193. servername: client[kServerName],
  16194. localAddress: client[kLocalAddress]
  16195. },
  16196. connector: client[kConnector]
  16197. })
  16198. }
  16199. try {
  16200. const socket = await new Promise((resolve, reject) => {
  16201. client[kConnector]({
  16202. host,
  16203. hostname,
  16204. protocol,
  16205. port,
  16206. servername: client[kServerName],
  16207. localAddress: client[kLocalAddress]
  16208. }, (err, socket) => {
  16209. if (err) {
  16210. reject(err)
  16211. } else {
  16212. resolve(socket)
  16213. }
  16214. })
  16215. })
  16216. if (client.destroyed) {
  16217. util.destroy(socket.on('error', () => {}), new ClientDestroyedError())
  16218. return
  16219. }
  16220. client[kConnecting] = false
  16221. assert(socket)
  16222. const isH2 = socket.alpnProtocol === 'h2'
  16223. if (isH2) {
  16224. if (!h2ExperimentalWarned) {
  16225. h2ExperimentalWarned = true
  16226. process.emitWarning('H2 support is experimental, expect them to change at any time.', {
  16227. code: 'UNDICI-H2'
  16228. })
  16229. }
  16230. const session = http2.connect(client[kUrl], {
  16231. createConnection: () => socket,
  16232. peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams
  16233. })
  16234. client[kHTTPConnVersion] = 'h2'
  16235. session[kClient] = client
  16236. session[kSocket] = socket
  16237. session.on('error', onHttp2SessionError)
  16238. session.on('frameError', onHttp2FrameError)
  16239. session.on('end', onHttp2SessionEnd)
  16240. session.on('goaway', onHTTP2GoAway)
  16241. session.on('close', onSocketClose)
  16242. session.unref()
  16243. client[kHTTP2Session] = session
  16244. socket[kHTTP2Session] = session
  16245. } else {
  16246. if (!llhttpInstance) {
  16247. llhttpInstance = await llhttpPromise
  16248. llhttpPromise = null
  16249. }
  16250. socket[kNoRef] = false
  16251. socket[kWriting] = false
  16252. socket[kReset] = false
  16253. socket[kBlocking] = false
  16254. socket[kParser] = new Parser(client, socket, llhttpInstance)
  16255. }
  16256. socket[kCounter] = 0
  16257. socket[kMaxRequests] = client[kMaxRequests]
  16258. socket[kClient] = client
  16259. socket[kError] = null
  16260. socket
  16261. .on('error', onSocketError)
  16262. .on('readable', onSocketReadable)
  16263. .on('end', onSocketEnd)
  16264. .on('close', onSocketClose)
  16265. client[kSocket] = socket
  16266. if (channels.connected.hasSubscribers) {
  16267. channels.connected.publish({
  16268. connectParams: {
  16269. host,
  16270. hostname,
  16271. protocol,
  16272. port,
  16273. servername: client[kServerName],
  16274. localAddress: client[kLocalAddress]
  16275. },
  16276. connector: client[kConnector],
  16277. socket
  16278. })
  16279. }
  16280. client.emit('connect', client[kUrl], [client])
  16281. } catch (err) {
  16282. if (client.destroyed) {
  16283. return
  16284. }
  16285. client[kConnecting] = false
  16286. if (channels.connectError.hasSubscribers) {
  16287. channels.connectError.publish({
  16288. connectParams: {
  16289. host,
  16290. hostname,
  16291. protocol,
  16292. port,
  16293. servername: client[kServerName],
  16294. localAddress: client[kLocalAddress]
  16295. },
  16296. connector: client[kConnector],
  16297. error: err
  16298. })
  16299. }
  16300. if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
  16301. assert(client[kRunning] === 0)
  16302. while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
  16303. const request = client[kQueue][client[kPendingIdx]++]
  16304. errorRequest(client, request, err)
  16305. }
  16306. } else {
  16307. onError(client, err)
  16308. }
  16309. client.emit('connectionError', client[kUrl], [client], err)
  16310. }
  16311. resume(client)
  16312. }
  16313. function emitDrain (client) {
  16314. client[kNeedDrain] = 0
  16315. client.emit('drain', client[kUrl], [client])
  16316. }
  16317. function resume (client, sync) {
  16318. if (client[kResuming] === 2) {
  16319. return
  16320. }
  16321. client[kResuming] = 2
  16322. _resume(client, sync)
  16323. client[kResuming] = 0
  16324. if (client[kRunningIdx] > 256) {
  16325. client[kQueue].splice(0, client[kRunningIdx])
  16326. client[kPendingIdx] -= client[kRunningIdx]
  16327. client[kRunningIdx] = 0
  16328. }
  16329. }
  16330. function _resume (client, sync) {
  16331. while (true) {
  16332. if (client.destroyed) {
  16333. assert(client[kPending] === 0)
  16334. return
  16335. }
  16336. if (client[kClosedResolve] && !client[kSize]) {
  16337. client[kClosedResolve]()
  16338. client[kClosedResolve] = null
  16339. return
  16340. }
  16341. const socket = client[kSocket]
  16342. if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') {
  16343. if (client[kSize] === 0) {
  16344. if (!socket[kNoRef] && socket.unref) {
  16345. socket.unref()
  16346. socket[kNoRef] = true
  16347. }
  16348. } else if (socket[kNoRef] && socket.ref) {
  16349. socket.ref()
  16350. socket[kNoRef] = false
  16351. }
  16352. if (client[kSize] === 0) {
  16353. if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {
  16354. socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE)
  16355. }
  16356. } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
  16357. if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
  16358. const request = client[kQueue][client[kRunningIdx]]
  16359. const headersTimeout = request.headersTimeout != null
  16360. ? request.headersTimeout
  16361. : client[kHeadersTimeout]
  16362. socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
  16363. }
  16364. }
  16365. }
  16366. if (client[kBusy]) {
  16367. client[kNeedDrain] = 2
  16368. } else if (client[kNeedDrain] === 2) {
  16369. if (sync) {
  16370. client[kNeedDrain] = 1
  16371. process.nextTick(emitDrain, client)
  16372. } else {
  16373. emitDrain(client)
  16374. }
  16375. continue
  16376. }
  16377. if (client[kPending] === 0) {
  16378. return
  16379. }
  16380. if (client[kRunning] >= (client[kPipelining] || 1)) {
  16381. return
  16382. }
  16383. const request = client[kQueue][client[kPendingIdx]]
  16384. if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
  16385. if (client[kRunning] > 0) {
  16386. return
  16387. }
  16388. client[kServerName] = request.servername
  16389. if (socket && socket.servername !== request.servername) {
  16390. util.destroy(socket, new InformationalError('servername changed'))
  16391. return
  16392. }
  16393. }
  16394. if (client[kConnecting]) {
  16395. return
  16396. }
  16397. if (!socket && !client[kHTTP2Session]) {
  16398. connect(client)
  16399. return
  16400. }
  16401. if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {
  16402. return
  16403. }
  16404. if (client[kRunning] > 0 && !request.idempotent) {
  16405. // Non-idempotent request cannot be retried.
  16406. // Ensure that no other requests are inflight and
  16407. // could cause failure.
  16408. return
  16409. }
  16410. if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
  16411. // Don't dispatch an upgrade until all preceding requests have completed.
  16412. // A misbehaving server might upgrade the connection before all pipelined
  16413. // request has completed.
  16414. return
  16415. }
  16416. if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
  16417. (util.isStream(request.body) || util.isAsyncIterable(request.body))) {
  16418. // Request with stream or iterator body can error while other requests
  16419. // are inflight and indirectly error those as well.
  16420. // Ensure this doesn't happen by waiting for inflight
  16421. // to complete before dispatching.
  16422. // Request with stream or iterator body cannot be retried.
  16423. // Ensure that no other requests are inflight and
  16424. // could cause failure.
  16425. return
  16426. }
  16427. if (!request.aborted && write(client, request)) {
  16428. client[kPendingIdx]++
  16429. } else {
  16430. client[kQueue].splice(client[kPendingIdx], 1)
  16431. }
  16432. }
  16433. }
  16434. // https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
  16435. function shouldSendContentLength (method) {
  16436. return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
  16437. }
  16438. function write (client, request) {
  16439. if (client[kHTTPConnVersion] === 'h2') {
  16440. writeH2(client, client[kHTTP2Session], request)
  16441. return
  16442. }
  16443. const { body, method, path, host, upgrade, headers, blocking, reset } = request
  16444. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16445. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16446. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16447. // Sending a payload body on a request that does not
  16448. // expect it can cause undefined behavior on some
  16449. // servers and corrupt connection state. Do not
  16450. // re-use the connection for further requests.
  16451. const expectsPayload = (
  16452. method === 'PUT' ||
  16453. method === 'POST' ||
  16454. method === 'PATCH'
  16455. )
  16456. if (body && typeof body.read === 'function') {
  16457. // Try to read EOF in order to get length.
  16458. body.read(0)
  16459. }
  16460. const bodyLength = util.bodyLength(body)
  16461. let contentLength = bodyLength
  16462. if (contentLength === null) {
  16463. contentLength = request.contentLength
  16464. }
  16465. if (contentLength === 0 && !expectsPayload) {
  16466. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16467. // A user agent SHOULD NOT send a Content-Length header field when
  16468. // the request message does not contain a payload body and the method
  16469. // semantics do not anticipate such a body.
  16470. contentLength = null
  16471. }
  16472. // https://github.com/nodejs/undici/issues/2046
  16473. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16474. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
  16475. if (client[kStrictContentLength]) {
  16476. errorRequest(client, request, new RequestContentLengthMismatchError())
  16477. return false
  16478. }
  16479. process.emitWarning(new RequestContentLengthMismatchError())
  16480. }
  16481. const socket = client[kSocket]
  16482. try {
  16483. request.onConnect((err) => {
  16484. if (request.aborted || request.completed) {
  16485. return
  16486. }
  16487. errorRequest(client, request, err || new RequestAbortedError())
  16488. util.destroy(socket, new InformationalError('aborted'))
  16489. })
  16490. } catch (err) {
  16491. errorRequest(client, request, err)
  16492. }
  16493. if (request.aborted) {
  16494. return false
  16495. }
  16496. if (method === 'HEAD') {
  16497. // https://github.com/mcollina/undici/issues/258
  16498. // Close after a HEAD request to interop with misbehaving servers
  16499. // that may send a body in the response.
  16500. socket[kReset] = true
  16501. }
  16502. if (upgrade || method === 'CONNECT') {
  16503. // On CONNECT or upgrade, block pipeline from dispatching further
  16504. // requests on this connection.
  16505. socket[kReset] = true
  16506. }
  16507. if (reset != null) {
  16508. socket[kReset] = reset
  16509. }
  16510. if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
  16511. socket[kReset] = true
  16512. }
  16513. if (blocking) {
  16514. socket[kBlocking] = true
  16515. }
  16516. let header = `${method} ${path} HTTP/1.1\r\n`
  16517. if (typeof host === 'string') {
  16518. header += `host: ${host}\r\n`
  16519. } else {
  16520. header += client[kHostHeader]
  16521. }
  16522. if (upgrade) {
  16523. header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
  16524. } else if (client[kPipelining] && !socket[kReset]) {
  16525. header += 'connection: keep-alive\r\n'
  16526. } else {
  16527. header += 'connection: close\r\n'
  16528. }
  16529. if (headers) {
  16530. header += headers
  16531. }
  16532. if (channels.sendHeaders.hasSubscribers) {
  16533. channels.sendHeaders.publish({ request, headers: header, socket })
  16534. }
  16535. /* istanbul ignore else: assertion */
  16536. if (!body || bodyLength === 0) {
  16537. if (contentLength === 0) {
  16538. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16539. } else {
  16540. assert(contentLength === null, 'no body must not have content length')
  16541. socket.write(`${header}\r\n`, 'latin1')
  16542. }
  16543. request.onRequestSent()
  16544. } else if (util.isBuffer(body)) {
  16545. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16546. socket.cork()
  16547. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16548. socket.write(body)
  16549. socket.uncork()
  16550. request.onBodySent(body)
  16551. request.onRequestSent()
  16552. if (!expectsPayload) {
  16553. socket[kReset] = true
  16554. }
  16555. } else if (util.isBlobLike(body)) {
  16556. if (typeof body.stream === 'function') {
  16557. writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload })
  16558. } else {
  16559. writeBlob({ body, client, request, socket, contentLength, header, expectsPayload })
  16560. }
  16561. } else if (util.isStream(body)) {
  16562. writeStream({ body, client, request, socket, contentLength, header, expectsPayload })
  16563. } else if (util.isIterable(body)) {
  16564. writeIterable({ body, client, request, socket, contentLength, header, expectsPayload })
  16565. } else {
  16566. assert(false)
  16567. }
  16568. return true
  16569. }
  16570. function writeH2 (client, session, request) {
  16571. const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request
  16572. let headers
  16573. if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim())
  16574. else headers = reqHeaders
  16575. if (upgrade) {
  16576. errorRequest(client, request, new Error('Upgrade not supported for H2'))
  16577. return false
  16578. }
  16579. try {
  16580. // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event?
  16581. request.onConnect((err) => {
  16582. if (request.aborted || request.completed) {
  16583. return
  16584. }
  16585. errorRequest(client, request, err || new RequestAbortedError())
  16586. })
  16587. } catch (err) {
  16588. errorRequest(client, request, err)
  16589. }
  16590. if (request.aborted) {
  16591. return false
  16592. }
  16593. /** @type {import('node:http2').ClientHttp2Stream} */
  16594. let stream
  16595. const h2State = client[kHTTP2SessionState]
  16596. headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]
  16597. headers[HTTP2_HEADER_METHOD] = method
  16598. if (method === 'CONNECT') {
  16599. session.ref()
  16600. // we are already connected, streams are pending, first request
  16601. // will create a new stream. We trigger a request to create the stream and wait until
  16602. // `ready` event is triggered
  16603. // We disabled endStream to allow the user to write to the stream
  16604. stream = session.request(headers, { endStream: false, signal })
  16605. if (stream.id && !stream.pending) {
  16606. request.onUpgrade(null, null, stream)
  16607. ++h2State.openStreams
  16608. } else {
  16609. stream.once('ready', () => {
  16610. request.onUpgrade(null, null, stream)
  16611. ++h2State.openStreams
  16612. })
  16613. }
  16614. stream.once('close', () => {
  16615. h2State.openStreams -= 1
  16616. // TODO(HTTP/2): unref only if current streams count is 0
  16617. if (h2State.openStreams === 0) session.unref()
  16618. })
  16619. return true
  16620. }
  16621. // https://tools.ietf.org/html/rfc7540#section-8.3
  16622. // :path and :scheme headers must be omited when sending CONNECT
  16623. headers[HTTP2_HEADER_PATH] = path
  16624. headers[HTTP2_HEADER_SCHEME] = 'https'
  16625. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16626. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16627. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16628. // Sending a payload body on a request that does not
  16629. // expect it can cause undefined behavior on some
  16630. // servers and corrupt connection state. Do not
  16631. // re-use the connection for further requests.
  16632. const expectsPayload = (
  16633. method === 'PUT' ||
  16634. method === 'POST' ||
  16635. method === 'PATCH'
  16636. )
  16637. if (body && typeof body.read === 'function') {
  16638. // Try to read EOF in order to get length.
  16639. body.read(0)
  16640. }
  16641. let contentLength = util.bodyLength(body)
  16642. if (contentLength == null) {
  16643. contentLength = request.contentLength
  16644. }
  16645. if (contentLength === 0 || !expectsPayload) {
  16646. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16647. // A user agent SHOULD NOT send a Content-Length header field when
  16648. // the request message does not contain a payload body and the method
  16649. // semantics do not anticipate such a body.
  16650. contentLength = null
  16651. }
  16652. // https://github.com/nodejs/undici/issues/2046
  16653. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16654. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {
  16655. if (client[kStrictContentLength]) {
  16656. errorRequest(client, request, new RequestContentLengthMismatchError())
  16657. return false
  16658. }
  16659. process.emitWarning(new RequestContentLengthMismatchError())
  16660. }
  16661. if (contentLength != null) {
  16662. assert(body, 'no body must not have content length')
  16663. headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`
  16664. }
  16665. session.ref()
  16666. const shouldEndStream = method === 'GET' || method === 'HEAD'
  16667. if (expectContinue) {
  16668. headers[HTTP2_HEADER_EXPECT] = '100-continue'
  16669. stream = session.request(headers, { endStream: shouldEndStream, signal })
  16670. stream.once('continue', writeBodyH2)
  16671. } else {
  16672. stream = session.request(headers, {
  16673. endStream: shouldEndStream,
  16674. signal
  16675. })
  16676. writeBodyH2()
  16677. }
  16678. // Increment counter as we have new several streams open
  16679. ++h2State.openStreams
  16680. stream.once('response', headers => {
  16681. const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
  16682. if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) {
  16683. stream.pause()
  16684. }
  16685. })
  16686. stream.once('end', () => {
  16687. request.onComplete([])
  16688. })
  16689. stream.on('data', (chunk) => {
  16690. if (request.onData(chunk) === false) {
  16691. stream.pause()
  16692. }
  16693. })
  16694. stream.once('close', () => {
  16695. h2State.openStreams -= 1
  16696. // TODO(HTTP/2): unref only if current streams count is 0
  16697. if (h2State.openStreams === 0) {
  16698. session.unref()
  16699. }
  16700. })
  16701. stream.once('error', function (err) {
  16702. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16703. h2State.streams -= 1
  16704. util.destroy(stream, err)
  16705. }
  16706. })
  16707. stream.once('frameError', (type, code) => {
  16708. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  16709. errorRequest(client, request, err)
  16710. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16711. h2State.streams -= 1
  16712. util.destroy(stream, err)
  16713. }
  16714. })
  16715. // stream.on('aborted', () => {
  16716. // // TODO(HTTP/2): Support aborted
  16717. // })
  16718. // stream.on('timeout', () => {
  16719. // // TODO(HTTP/2): Support timeout
  16720. // })
  16721. // stream.on('push', headers => {
  16722. // // TODO(HTTP/2): Suppor push
  16723. // })
  16724. // stream.on('trailers', headers => {
  16725. // // TODO(HTTP/2): Support trailers
  16726. // })
  16727. return true
  16728. function writeBodyH2 () {
  16729. /* istanbul ignore else: assertion */
  16730. if (!body) {
  16731. request.onRequestSent()
  16732. } else if (util.isBuffer(body)) {
  16733. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16734. stream.cork()
  16735. stream.write(body)
  16736. stream.uncork()
  16737. stream.end()
  16738. request.onBodySent(body)
  16739. request.onRequestSent()
  16740. } else if (util.isBlobLike(body)) {
  16741. if (typeof body.stream === 'function') {
  16742. writeIterable({
  16743. client,
  16744. request,
  16745. contentLength,
  16746. h2stream: stream,
  16747. expectsPayload,
  16748. body: body.stream(),
  16749. socket: client[kSocket],
  16750. header: ''
  16751. })
  16752. } else {
  16753. writeBlob({
  16754. body,
  16755. client,
  16756. request,
  16757. contentLength,
  16758. expectsPayload,
  16759. h2stream: stream,
  16760. header: '',
  16761. socket: client[kSocket]
  16762. })
  16763. }
  16764. } else if (util.isStream(body)) {
  16765. writeStream({
  16766. body,
  16767. client,
  16768. request,
  16769. contentLength,
  16770. expectsPayload,
  16771. socket: client[kSocket],
  16772. h2stream: stream,
  16773. header: ''
  16774. })
  16775. } else if (util.isIterable(body)) {
  16776. writeIterable({
  16777. body,
  16778. client,
  16779. request,
  16780. contentLength,
  16781. expectsPayload,
  16782. header: '',
  16783. h2stream: stream,
  16784. socket: client[kSocket]
  16785. })
  16786. } else {
  16787. assert(false)
  16788. }
  16789. }
  16790. }
  16791. function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16792. assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
  16793. if (client[kHTTPConnVersion] === 'h2') {
  16794. // For HTTP/2, is enough to pipe the stream
  16795. const pipe = pipeline(
  16796. body,
  16797. h2stream,
  16798. (err) => {
  16799. if (err) {
  16800. util.destroy(body, err)
  16801. util.destroy(h2stream, err)
  16802. } else {
  16803. request.onRequestSent()
  16804. }
  16805. }
  16806. )
  16807. pipe.on('data', onPipeData)
  16808. pipe.once('end', () => {
  16809. pipe.removeListener('data', onPipeData)
  16810. util.destroy(pipe)
  16811. })
  16812. function onPipeData (chunk) {
  16813. request.onBodySent(chunk)
  16814. }
  16815. return
  16816. }
  16817. let finished = false
  16818. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16819. const onData = function (chunk) {
  16820. if (finished) {
  16821. return
  16822. }
  16823. try {
  16824. if (!writer.write(chunk) && this.pause) {
  16825. this.pause()
  16826. }
  16827. } catch (err) {
  16828. util.destroy(this, err)
  16829. }
  16830. }
  16831. const onDrain = function () {
  16832. if (finished) {
  16833. return
  16834. }
  16835. if (body.resume) {
  16836. body.resume()
  16837. }
  16838. }
  16839. const onAbort = function () {
  16840. if (finished) {
  16841. return
  16842. }
  16843. const err = new RequestAbortedError()
  16844. queueMicrotask(() => onFinished(err))
  16845. }
  16846. const onFinished = function (err) {
  16847. if (finished) {
  16848. return
  16849. }
  16850. finished = true
  16851. assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
  16852. socket
  16853. .off('drain', onDrain)
  16854. .off('error', onFinished)
  16855. body
  16856. .removeListener('data', onData)
  16857. .removeListener('end', onFinished)
  16858. .removeListener('error', onFinished)
  16859. .removeListener('close', onAbort)
  16860. if (!err) {
  16861. try {
  16862. writer.end()
  16863. } catch (er) {
  16864. err = er
  16865. }
  16866. }
  16867. writer.destroy(err)
  16868. if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
  16869. util.destroy(body, err)
  16870. } else {
  16871. util.destroy(body)
  16872. }
  16873. }
  16874. body
  16875. .on('data', onData)
  16876. .on('end', onFinished)
  16877. .on('error', onFinished)
  16878. .on('close', onAbort)
  16879. if (body.resume) {
  16880. body.resume()
  16881. }
  16882. socket
  16883. .on('drain', onDrain)
  16884. .on('error', onFinished)
  16885. }
  16886. async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16887. assert(contentLength === body.size, 'blob body must have content length')
  16888. const isH2 = client[kHTTPConnVersion] === 'h2'
  16889. try {
  16890. if (contentLength != null && contentLength !== body.size) {
  16891. throw new RequestContentLengthMismatchError()
  16892. }
  16893. const buffer = Buffer.from(await body.arrayBuffer())
  16894. if (isH2) {
  16895. h2stream.cork()
  16896. h2stream.write(buffer)
  16897. h2stream.uncork()
  16898. } else {
  16899. socket.cork()
  16900. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16901. socket.write(buffer)
  16902. socket.uncork()
  16903. }
  16904. request.onBodySent(buffer)
  16905. request.onRequestSent()
  16906. if (!expectsPayload) {
  16907. socket[kReset] = true
  16908. }
  16909. resume(client)
  16910. } catch (err) {
  16911. util.destroy(isH2 ? h2stream : socket, err)
  16912. }
  16913. }
  16914. async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16915. assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
  16916. let callback = null
  16917. function onDrain () {
  16918. if (callback) {
  16919. const cb = callback
  16920. callback = null
  16921. cb()
  16922. }
  16923. }
  16924. const waitForDrain = () => new Promise((resolve, reject) => {
  16925. assert(callback === null)
  16926. if (socket[kError]) {
  16927. reject(socket[kError])
  16928. } else {
  16929. callback = resolve
  16930. }
  16931. })
  16932. if (client[kHTTPConnVersion] === 'h2') {
  16933. h2stream
  16934. .on('close', onDrain)
  16935. .on('drain', onDrain)
  16936. try {
  16937. // It's up to the user to somehow abort the async iterable.
  16938. for await (const chunk of body) {
  16939. if (socket[kError]) {
  16940. throw socket[kError]
  16941. }
  16942. const res = h2stream.write(chunk)
  16943. request.onBodySent(chunk)
  16944. if (!res) {
  16945. await waitForDrain()
  16946. }
  16947. }
  16948. } catch (err) {
  16949. h2stream.destroy(err)
  16950. } finally {
  16951. request.onRequestSent()
  16952. h2stream.end()
  16953. h2stream
  16954. .off('close', onDrain)
  16955. .off('drain', onDrain)
  16956. }
  16957. return
  16958. }
  16959. socket
  16960. .on('close', onDrain)
  16961. .on('drain', onDrain)
  16962. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16963. try {
  16964. // It's up to the user to somehow abort the async iterable.
  16965. for await (const chunk of body) {
  16966. if (socket[kError]) {
  16967. throw socket[kError]
  16968. }
  16969. if (!writer.write(chunk)) {
  16970. await waitForDrain()
  16971. }
  16972. }
  16973. writer.end()
  16974. } catch (err) {
  16975. writer.destroy(err)
  16976. } finally {
  16977. socket
  16978. .off('close', onDrain)
  16979. .off('drain', onDrain)
  16980. }
  16981. }
  16982. class AsyncWriter {
  16983. constructor ({ socket, request, contentLength, client, expectsPayload, header }) {
  16984. this.socket = socket
  16985. this.request = request
  16986. this.contentLength = contentLength
  16987. this.client = client
  16988. this.bytesWritten = 0
  16989. this.expectsPayload = expectsPayload
  16990. this.header = header
  16991. socket[kWriting] = true
  16992. }
  16993. write (chunk) {
  16994. const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
  16995. if (socket[kError]) {
  16996. throw socket[kError]
  16997. }
  16998. if (socket.destroyed) {
  16999. return false
  17000. }
  17001. const len = Buffer.byteLength(chunk)
  17002. if (!len) {
  17003. return true
  17004. }
  17005. // We should defer writing chunks.
  17006. if (contentLength !== null && bytesWritten + len > contentLength) {
  17007. if (client[kStrictContentLength]) {
  17008. throw new RequestContentLengthMismatchError()
  17009. }
  17010. process.emitWarning(new RequestContentLengthMismatchError())
  17011. }
  17012. socket.cork()
  17013. if (bytesWritten === 0) {
  17014. if (!expectsPayload) {
  17015. socket[kReset] = true
  17016. }
  17017. if (contentLength === null) {
  17018. socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
  17019. } else {
  17020. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  17021. }
  17022. }
  17023. if (contentLength === null) {
  17024. socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
  17025. }
  17026. this.bytesWritten += len
  17027. const ret = socket.write(chunk)
  17028. socket.uncork()
  17029. request.onBodySent(chunk)
  17030. if (!ret) {
  17031. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  17032. // istanbul ignore else: only for jest
  17033. if (socket[kParser].timeout.refresh) {
  17034. socket[kParser].timeout.refresh()
  17035. }
  17036. }
  17037. }
  17038. return ret
  17039. }
  17040. end () {
  17041. const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
  17042. request.onRequestSent()
  17043. socket[kWriting] = false
  17044. if (socket[kError]) {
  17045. throw socket[kError]
  17046. }
  17047. if (socket.destroyed) {
  17048. return
  17049. }
  17050. if (bytesWritten === 0) {
  17051. if (expectsPayload) {
  17052. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  17053. // A user agent SHOULD send a Content-Length in a request message when
  17054. // no Transfer-Encoding is sent and the request method defines a meaning
  17055. // for an enclosed payload body.
  17056. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  17057. } else {
  17058. socket.write(`${header}\r\n`, 'latin1')
  17059. }
  17060. } else if (contentLength === null) {
  17061. socket.write('\r\n0\r\n\r\n', 'latin1')
  17062. }
  17063. if (contentLength !== null && bytesWritten !== contentLength) {
  17064. if (client[kStrictContentLength]) {
  17065. throw new RequestContentLengthMismatchError()
  17066. } else {
  17067. process.emitWarning(new RequestContentLengthMismatchError())
  17068. }
  17069. }
  17070. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  17071. // istanbul ignore else: only for jest
  17072. if (socket[kParser].timeout.refresh) {
  17073. socket[kParser].timeout.refresh()
  17074. }
  17075. }
  17076. resume(client)
  17077. }
  17078. destroy (err) {
  17079. const { socket, client } = this
  17080. socket[kWriting] = false
  17081. if (err) {
  17082. assert(client[kRunning] <= 1, 'pipeline should only contain this request')
  17083. util.destroy(socket, err)
  17084. }
  17085. }
  17086. }
  17087. function errorRequest (client, request, err) {
  17088. try {
  17089. request.onError(err)
  17090. assert(request.aborted)
  17091. } catch (err) {
  17092. client.emit('error', err)
  17093. }
  17094. }
  17095. module.exports = Client
  17096. /***/ }),
  17097. /***/ 6436:
  17098. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17099. "use strict";
  17100. /* istanbul ignore file: only for Node 12 */
  17101. const { kConnected, kSize } = __nccwpck_require__(2785)
  17102. class CompatWeakRef {
  17103. constructor (value) {
  17104. this.value = value
  17105. }
  17106. deref () {
  17107. return this.value[kConnected] === 0 && this.value[kSize] === 0
  17108. ? undefined
  17109. : this.value
  17110. }
  17111. }
  17112. class CompatFinalizer {
  17113. constructor (finalizer) {
  17114. this.finalizer = finalizer
  17115. }
  17116. register (dispatcher, key) {
  17117. if (dispatcher.on) {
  17118. dispatcher.on('disconnect', () => {
  17119. if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
  17120. this.finalizer(key)
  17121. }
  17122. })
  17123. }
  17124. }
  17125. }
  17126. module.exports = function () {
  17127. // FIXME: remove workaround when the Node bug is fixed
  17128. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17129. if (process.env.NODE_V8_COVERAGE) {
  17130. return {
  17131. WeakRef: CompatWeakRef,
  17132. FinalizationRegistry: CompatFinalizer
  17133. }
  17134. }
  17135. return {
  17136. WeakRef: global.WeakRef || CompatWeakRef,
  17137. FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer
  17138. }
  17139. }
  17140. /***/ }),
  17141. /***/ 663:
  17142. /***/ ((module) => {
  17143. "use strict";
  17144. // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size
  17145. const maxAttributeValueSize = 1024
  17146. // https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size
  17147. const maxNameValuePairSize = 4096
  17148. module.exports = {
  17149. maxAttributeValueSize,
  17150. maxNameValuePairSize
  17151. }
  17152. /***/ }),
  17153. /***/ 1724:
  17154. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17155. "use strict";
  17156. const { parseSetCookie } = __nccwpck_require__(4408)
  17157. const { stringify } = __nccwpck_require__(3121)
  17158. const { webidl } = __nccwpck_require__(1744)
  17159. const { Headers } = __nccwpck_require__(554)
  17160. /**
  17161. * @typedef {Object} Cookie
  17162. * @property {string} name
  17163. * @property {string} value
  17164. * @property {Date|number|undefined} expires
  17165. * @property {number|undefined} maxAge
  17166. * @property {string|undefined} domain
  17167. * @property {string|undefined} path
  17168. * @property {boolean|undefined} secure
  17169. * @property {boolean|undefined} httpOnly
  17170. * @property {'Strict'|'Lax'|'None'} sameSite
  17171. * @property {string[]} unparsed
  17172. */
  17173. /**
  17174. * @param {Headers} headers
  17175. * @returns {Record<string, string>}
  17176. */
  17177. function getCookies (headers) {
  17178. webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' })
  17179. webidl.brandCheck(headers, Headers, { strict: false })
  17180. const cookie = headers.get('cookie')
  17181. const out = {}
  17182. if (!cookie) {
  17183. return out
  17184. }
  17185. for (const piece of cookie.split(';')) {
  17186. const [name, ...value] = piece.split('=')
  17187. out[name.trim()] = value.join('=')
  17188. }
  17189. return out
  17190. }
  17191. /**
  17192. * @param {Headers} headers
  17193. * @param {string} name
  17194. * @param {{ path?: string, domain?: string }|undefined} attributes
  17195. * @returns {void}
  17196. */
  17197. function deleteCookie (headers, name, attributes) {
  17198. webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' })
  17199. webidl.brandCheck(headers, Headers, { strict: false })
  17200. name = webidl.converters.DOMString(name)
  17201. attributes = webidl.converters.DeleteCookieAttributes(attributes)
  17202. // Matches behavior of
  17203. // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
  17204. setCookie(headers, {
  17205. name,
  17206. value: '',
  17207. expires: new Date(0),
  17208. ...attributes
  17209. })
  17210. }
  17211. /**
  17212. * @param {Headers} headers
  17213. * @returns {Cookie[]}
  17214. */
  17215. function getSetCookies (headers) {
  17216. webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' })
  17217. webidl.brandCheck(headers, Headers, { strict: false })
  17218. const cookies = headers.getSetCookie()
  17219. if (!cookies) {
  17220. return []
  17221. }
  17222. return cookies.map((pair) => parseSetCookie(pair))
  17223. }
  17224. /**
  17225. * @param {Headers} headers
  17226. * @param {Cookie} cookie
  17227. * @returns {void}
  17228. */
  17229. function setCookie (headers, cookie) {
  17230. webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' })
  17231. webidl.brandCheck(headers, Headers, { strict: false })
  17232. cookie = webidl.converters.Cookie(cookie)
  17233. const str = stringify(cookie)
  17234. if (str) {
  17235. headers.append('Set-Cookie', stringify(cookie))
  17236. }
  17237. }
  17238. webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
  17239. {
  17240. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17241. key: 'path',
  17242. defaultValue: null
  17243. },
  17244. {
  17245. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17246. key: 'domain',
  17247. defaultValue: null
  17248. }
  17249. ])
  17250. webidl.converters.Cookie = webidl.dictionaryConverter([
  17251. {
  17252. converter: webidl.converters.DOMString,
  17253. key: 'name'
  17254. },
  17255. {
  17256. converter: webidl.converters.DOMString,
  17257. key: 'value'
  17258. },
  17259. {
  17260. converter: webidl.nullableConverter((value) => {
  17261. if (typeof value === 'number') {
  17262. return webidl.converters['unsigned long long'](value)
  17263. }
  17264. return new Date(value)
  17265. }),
  17266. key: 'expires',
  17267. defaultValue: null
  17268. },
  17269. {
  17270. converter: webidl.nullableConverter(webidl.converters['long long']),
  17271. key: 'maxAge',
  17272. defaultValue: null
  17273. },
  17274. {
  17275. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17276. key: 'domain',
  17277. defaultValue: null
  17278. },
  17279. {
  17280. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17281. key: 'path',
  17282. defaultValue: null
  17283. },
  17284. {
  17285. converter: webidl.nullableConverter(webidl.converters.boolean),
  17286. key: 'secure',
  17287. defaultValue: null
  17288. },
  17289. {
  17290. converter: webidl.nullableConverter(webidl.converters.boolean),
  17291. key: 'httpOnly',
  17292. defaultValue: null
  17293. },
  17294. {
  17295. converter: webidl.converters.USVString,
  17296. key: 'sameSite',
  17297. allowedValues: ['Strict', 'Lax', 'None']
  17298. },
  17299. {
  17300. converter: webidl.sequenceConverter(webidl.converters.DOMString),
  17301. key: 'unparsed',
  17302. defaultValue: []
  17303. }
  17304. ])
  17305. module.exports = {
  17306. getCookies,
  17307. deleteCookie,
  17308. getSetCookies,
  17309. setCookie
  17310. }
  17311. /***/ }),
  17312. /***/ 4408:
  17313. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17314. "use strict";
  17315. const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(663)
  17316. const { isCTLExcludingHtab } = __nccwpck_require__(3121)
  17317. const { collectASequenceOfCodePointsFast } = __nccwpck_require__(685)
  17318. const assert = __nccwpck_require__(9491)
  17319. /**
  17320. * @description Parses the field-value attributes of a set-cookie header string.
  17321. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17322. * @param {string} header
  17323. * @returns if the header is invalid, null will be returned
  17324. */
  17325. function parseSetCookie (header) {
  17326. // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
  17327. // character (CTL characters excluding HTAB): Abort these steps and
  17328. // ignore the set-cookie-string entirely.
  17329. if (isCTLExcludingHtab(header)) {
  17330. return null
  17331. }
  17332. let nameValuePair = ''
  17333. let unparsedAttributes = ''
  17334. let name = ''
  17335. let value = ''
  17336. // 2. If the set-cookie-string contains a %x3B (";") character:
  17337. if (header.includes(';')) {
  17338. // 1. The name-value-pair string consists of the characters up to,
  17339. // but not including, the first %x3B (";"), and the unparsed-
  17340. // attributes consist of the remainder of the set-cookie-string
  17341. // (including the %x3B (";") in question).
  17342. const position = { position: 0 }
  17343. nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
  17344. unparsedAttributes = header.slice(position.position)
  17345. } else {
  17346. // Otherwise:
  17347. // 1. The name-value-pair string consists of all the characters
  17348. // contained in the set-cookie-string, and the unparsed-
  17349. // attributes is the empty string.
  17350. nameValuePair = header
  17351. }
  17352. // 3. If the name-value-pair string lacks a %x3D ("=") character, then
  17353. // the name string is empty, and the value string is the value of
  17354. // name-value-pair.
  17355. if (!nameValuePair.includes('=')) {
  17356. value = nameValuePair
  17357. } else {
  17358. // Otherwise, the name string consists of the characters up to, but
  17359. // not including, the first %x3D ("=") character, and the (possibly
  17360. // empty) value string consists of the characters after the first
  17361. // %x3D ("=") character.
  17362. const position = { position: 0 }
  17363. name = collectASequenceOfCodePointsFast(
  17364. '=',
  17365. nameValuePair,
  17366. position
  17367. )
  17368. value = nameValuePair.slice(position.position + 1)
  17369. }
  17370. // 4. Remove any leading or trailing WSP characters from the name
  17371. // string and the value string.
  17372. name = name.trim()
  17373. value = value.trim()
  17374. // 5. If the sum of the lengths of the name string and the value string
  17375. // is more than 4096 octets, abort these steps and ignore the set-
  17376. // cookie-string entirely.
  17377. if (name.length + value.length > maxNameValuePairSize) {
  17378. return null
  17379. }
  17380. // 6. The cookie-name is the name string, and the cookie-value is the
  17381. // value string.
  17382. return {
  17383. name, value, ...parseUnparsedAttributes(unparsedAttributes)
  17384. }
  17385. }
  17386. /**
  17387. * Parses the remaining attributes of a set-cookie header
  17388. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17389. * @param {string} unparsedAttributes
  17390. * @param {[Object.<string, unknown>]={}} cookieAttributeList
  17391. */
  17392. function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
  17393. // 1. If the unparsed-attributes string is empty, skip the rest of
  17394. // these steps.
  17395. if (unparsedAttributes.length === 0) {
  17396. return cookieAttributeList
  17397. }
  17398. // 2. Discard the first character of the unparsed-attributes (which
  17399. // will be a %x3B (";") character).
  17400. assert(unparsedAttributes[0] === ';')
  17401. unparsedAttributes = unparsedAttributes.slice(1)
  17402. let cookieAv = ''
  17403. // 3. If the remaining unparsed-attributes contains a %x3B (";")
  17404. // character:
  17405. if (unparsedAttributes.includes(';')) {
  17406. // 1. Consume the characters of the unparsed-attributes up to, but
  17407. // not including, the first %x3B (";") character.
  17408. cookieAv = collectASequenceOfCodePointsFast(
  17409. ';',
  17410. unparsedAttributes,
  17411. { position: 0 }
  17412. )
  17413. unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
  17414. } else {
  17415. // Otherwise:
  17416. // 1. Consume the remainder of the unparsed-attributes.
  17417. cookieAv = unparsedAttributes
  17418. unparsedAttributes = ''
  17419. }
  17420. // Let the cookie-av string be the characters consumed in this step.
  17421. let attributeName = ''
  17422. let attributeValue = ''
  17423. // 4. If the cookie-av string contains a %x3D ("=") character:
  17424. if (cookieAv.includes('=')) {
  17425. // 1. The (possibly empty) attribute-name string consists of the
  17426. // characters up to, but not including, the first %x3D ("=")
  17427. // character, and the (possibly empty) attribute-value string
  17428. // consists of the characters after the first %x3D ("=")
  17429. // character.
  17430. const position = { position: 0 }
  17431. attributeName = collectASequenceOfCodePointsFast(
  17432. '=',
  17433. cookieAv,
  17434. position
  17435. )
  17436. attributeValue = cookieAv.slice(position.position + 1)
  17437. } else {
  17438. // Otherwise:
  17439. // 1. The attribute-name string consists of the entire cookie-av
  17440. // string, and the attribute-value string is empty.
  17441. attributeName = cookieAv
  17442. }
  17443. // 5. Remove any leading or trailing WSP characters from the attribute-
  17444. // name string and the attribute-value string.
  17445. attributeName = attributeName.trim()
  17446. attributeValue = attributeValue.trim()
  17447. // 6. If the attribute-value is longer than 1024 octets, ignore the
  17448. // cookie-av string and return to Step 1 of this algorithm.
  17449. if (attributeValue.length > maxAttributeValueSize) {
  17450. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17451. }
  17452. // 7. Process the attribute-name and attribute-value according to the
  17453. // requirements in the following subsections. (Notice that
  17454. // attributes with unrecognized attribute-names are ignored.)
  17455. const attributeNameLowercase = attributeName.toLowerCase()
  17456. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
  17457. // If the attribute-name case-insensitively matches the string
  17458. // "Expires", the user agent MUST process the cookie-av as follows.
  17459. if (attributeNameLowercase === 'expires') {
  17460. // 1. Let the expiry-time be the result of parsing the attribute-value
  17461. // as cookie-date (see Section 5.1.1).
  17462. const expiryTime = new Date(attributeValue)
  17463. // 2. If the attribute-value failed to parse as a cookie date, ignore
  17464. // the cookie-av.
  17465. cookieAttributeList.expires = expiryTime
  17466. } else if (attributeNameLowercase === 'max-age') {
  17467. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
  17468. // If the attribute-name case-insensitively matches the string "Max-
  17469. // Age", the user agent MUST process the cookie-av as follows.
  17470. // 1. If the first character of the attribute-value is not a DIGIT or a
  17471. // "-" character, ignore the cookie-av.
  17472. const charCode = attributeValue.charCodeAt(0)
  17473. if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
  17474. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17475. }
  17476. // 2. If the remainder of attribute-value contains a non-DIGIT
  17477. // character, ignore the cookie-av.
  17478. if (!/^\d+$/.test(attributeValue)) {
  17479. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17480. }
  17481. // 3. Let delta-seconds be the attribute-value converted to an integer.
  17482. const deltaSeconds = Number(attributeValue)
  17483. // 4. Let cookie-age-limit be the maximum age of the cookie (which
  17484. // SHOULD be 400 days or less, see Section 4.1.2.2).
  17485. // 5. Set delta-seconds to the smaller of its present value and cookie-
  17486. // age-limit.
  17487. // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
  17488. // 6. If delta-seconds is less than or equal to zero (0), let expiry-
  17489. // time be the earliest representable date and time. Otherwise, let
  17490. // the expiry-time be the current date and time plus delta-seconds
  17491. // seconds.
  17492. // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
  17493. // 7. Append an attribute to the cookie-attribute-list with an
  17494. // attribute-name of Max-Age and an attribute-value of expiry-time.
  17495. cookieAttributeList.maxAge = deltaSeconds
  17496. } else if (attributeNameLowercase === 'domain') {
  17497. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
  17498. // If the attribute-name case-insensitively matches the string "Domain",
  17499. // the user agent MUST process the cookie-av as follows.
  17500. // 1. Let cookie-domain be the attribute-value.
  17501. let cookieDomain = attributeValue
  17502. // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
  17503. // cookie-domain without its leading %x2E (".").
  17504. if (cookieDomain[0] === '.') {
  17505. cookieDomain = cookieDomain.slice(1)
  17506. }
  17507. // 3. Convert the cookie-domain to lower case.
  17508. cookieDomain = cookieDomain.toLowerCase()
  17509. // 4. Append an attribute to the cookie-attribute-list with an
  17510. // attribute-name of Domain and an attribute-value of cookie-domain.
  17511. cookieAttributeList.domain = cookieDomain
  17512. } else if (attributeNameLowercase === 'path') {
  17513. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
  17514. // If the attribute-name case-insensitively matches the string "Path",
  17515. // the user agent MUST process the cookie-av as follows.
  17516. // 1. If the attribute-value is empty or if the first character of the
  17517. // attribute-value is not %x2F ("/"):
  17518. let cookiePath = ''
  17519. if (attributeValue.length === 0 || attributeValue[0] !== '/') {
  17520. // 1. Let cookie-path be the default-path.
  17521. cookiePath = '/'
  17522. } else {
  17523. // Otherwise:
  17524. // 1. Let cookie-path be the attribute-value.
  17525. cookiePath = attributeValue
  17526. }
  17527. // 2. Append an attribute to the cookie-attribute-list with an
  17528. // attribute-name of Path and an attribute-value of cookie-path.
  17529. cookieAttributeList.path = cookiePath
  17530. } else if (attributeNameLowercase === 'secure') {
  17531. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
  17532. // If the attribute-name case-insensitively matches the string "Secure",
  17533. // the user agent MUST append an attribute to the cookie-attribute-list
  17534. // with an attribute-name of Secure and an empty attribute-value.
  17535. cookieAttributeList.secure = true
  17536. } else if (attributeNameLowercase === 'httponly') {
  17537. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
  17538. // If the attribute-name case-insensitively matches the string
  17539. // "HttpOnly", the user agent MUST append an attribute to the cookie-
  17540. // attribute-list with an attribute-name of HttpOnly and an empty
  17541. // attribute-value.
  17542. cookieAttributeList.httpOnly = true
  17543. } else if (attributeNameLowercase === 'samesite') {
  17544. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
  17545. // If the attribute-name case-insensitively matches the string
  17546. // "SameSite", the user agent MUST process the cookie-av as follows:
  17547. // 1. Let enforcement be "Default".
  17548. let enforcement = 'Default'
  17549. const attributeValueLowercase = attributeValue.toLowerCase()
  17550. // 2. If cookie-av's attribute-value is a case-insensitive match for
  17551. // "None", set enforcement to "None".
  17552. if (attributeValueLowercase.includes('none')) {
  17553. enforcement = 'None'
  17554. }
  17555. // 3. If cookie-av's attribute-value is a case-insensitive match for
  17556. // "Strict", set enforcement to "Strict".
  17557. if (attributeValueLowercase.includes('strict')) {
  17558. enforcement = 'Strict'
  17559. }
  17560. // 4. If cookie-av's attribute-value is a case-insensitive match for
  17561. // "Lax", set enforcement to "Lax".
  17562. if (attributeValueLowercase.includes('lax')) {
  17563. enforcement = 'Lax'
  17564. }
  17565. // 5. Append an attribute to the cookie-attribute-list with an
  17566. // attribute-name of "SameSite" and an attribute-value of
  17567. // enforcement.
  17568. cookieAttributeList.sameSite = enforcement
  17569. } else {
  17570. cookieAttributeList.unparsed ??= []
  17571. cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
  17572. }
  17573. // 8. Return to Step 1 of this algorithm.
  17574. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17575. }
  17576. module.exports = {
  17577. parseSetCookie,
  17578. parseUnparsedAttributes
  17579. }
  17580. /***/ }),
  17581. /***/ 3121:
  17582. /***/ ((module) => {
  17583. "use strict";
  17584. /**
  17585. * @param {string} value
  17586. * @returns {boolean}
  17587. */
  17588. function isCTLExcludingHtab (value) {
  17589. if (value.length === 0) {
  17590. return false
  17591. }
  17592. for (const char of value) {
  17593. const code = char.charCodeAt(0)
  17594. if (
  17595. (code >= 0x00 || code <= 0x08) ||
  17596. (code >= 0x0A || code <= 0x1F) ||
  17597. code === 0x7F
  17598. ) {
  17599. return false
  17600. }
  17601. }
  17602. }
  17603. /**
  17604. CHAR = <any US-ASCII character (octets 0 - 127)>
  17605. token = 1*<any CHAR except CTLs or separators>
  17606. separators = "(" | ")" | "<" | ">" | "@"
  17607. | "," | ";" | ":" | "\" | <">
  17608. | "/" | "[" | "]" | "?" | "="
  17609. | "{" | "}" | SP | HT
  17610. * @param {string} name
  17611. */
  17612. function validateCookieName (name) {
  17613. for (const char of name) {
  17614. const code = char.charCodeAt(0)
  17615. if (
  17616. (code <= 0x20 || code > 0x7F) ||
  17617. char === '(' ||
  17618. char === ')' ||
  17619. char === '>' ||
  17620. char === '<' ||
  17621. char === '@' ||
  17622. char === ',' ||
  17623. char === ';' ||
  17624. char === ':' ||
  17625. char === '\\' ||
  17626. char === '"' ||
  17627. char === '/' ||
  17628. char === '[' ||
  17629. char === ']' ||
  17630. char === '?' ||
  17631. char === '=' ||
  17632. char === '{' ||
  17633. char === '}'
  17634. ) {
  17635. throw new Error('Invalid cookie name')
  17636. }
  17637. }
  17638. }
  17639. /**
  17640. cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
  17641. cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
  17642. ; US-ASCII characters excluding CTLs,
  17643. ; whitespace DQUOTE, comma, semicolon,
  17644. ; and backslash
  17645. * @param {string} value
  17646. */
  17647. function validateCookieValue (value) {
  17648. for (const char of value) {
  17649. const code = char.charCodeAt(0)
  17650. if (
  17651. code < 0x21 || // exclude CTLs (0-31)
  17652. code === 0x22 ||
  17653. code === 0x2C ||
  17654. code === 0x3B ||
  17655. code === 0x5C ||
  17656. code > 0x7E // non-ascii
  17657. ) {
  17658. throw new Error('Invalid header value')
  17659. }
  17660. }
  17661. }
  17662. /**
  17663. * path-value = <any CHAR except CTLs or ";">
  17664. * @param {string} path
  17665. */
  17666. function validateCookiePath (path) {
  17667. for (const char of path) {
  17668. const code = char.charCodeAt(0)
  17669. if (code < 0x21 || char === ';') {
  17670. throw new Error('Invalid cookie path')
  17671. }
  17672. }
  17673. }
  17674. /**
  17675. * I have no idea why these values aren't allowed to be honest,
  17676. * but Deno tests these. - Khafra
  17677. * @param {string} domain
  17678. */
  17679. function validateCookieDomain (domain) {
  17680. if (
  17681. domain.startsWith('-') ||
  17682. domain.endsWith('.') ||
  17683. domain.endsWith('-')
  17684. ) {
  17685. throw new Error('Invalid cookie domain')
  17686. }
  17687. }
  17688. /**
  17689. * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
  17690. * @param {number|Date} date
  17691. IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
  17692. ; fixed length/zone/capitalization subset of the format
  17693. ; see Section 3.3 of [RFC5322]
  17694. day-name = %x4D.6F.6E ; "Mon", case-sensitive
  17695. / %x54.75.65 ; "Tue", case-sensitive
  17696. / %x57.65.64 ; "Wed", case-sensitive
  17697. / %x54.68.75 ; "Thu", case-sensitive
  17698. / %x46.72.69 ; "Fri", case-sensitive
  17699. / %x53.61.74 ; "Sat", case-sensitive
  17700. / %x53.75.6E ; "Sun", case-sensitive
  17701. date1 = day SP month SP year
  17702. ; e.g., 02 Jun 1982
  17703. day = 2DIGIT
  17704. month = %x4A.61.6E ; "Jan", case-sensitive
  17705. / %x46.65.62 ; "Feb", case-sensitive
  17706. / %x4D.61.72 ; "Mar", case-sensitive
  17707. / %x41.70.72 ; "Apr", case-sensitive
  17708. / %x4D.61.79 ; "May", case-sensitive
  17709. / %x4A.75.6E ; "Jun", case-sensitive
  17710. / %x4A.75.6C ; "Jul", case-sensitive
  17711. / %x41.75.67 ; "Aug", case-sensitive
  17712. / %x53.65.70 ; "Sep", case-sensitive
  17713. / %x4F.63.74 ; "Oct", case-sensitive
  17714. / %x4E.6F.76 ; "Nov", case-sensitive
  17715. / %x44.65.63 ; "Dec", case-sensitive
  17716. year = 4DIGIT
  17717. GMT = %x47.4D.54 ; "GMT", case-sensitive
  17718. time-of-day = hour ":" minute ":" second
  17719. ; 00:00:00 - 23:59:60 (leap second)
  17720. hour = 2DIGIT
  17721. minute = 2DIGIT
  17722. second = 2DIGIT
  17723. */
  17724. function toIMFDate (date) {
  17725. if (typeof date === 'number') {
  17726. date = new Date(date)
  17727. }
  17728. const days = [
  17729. 'Sun', 'Mon', 'Tue', 'Wed',
  17730. 'Thu', 'Fri', 'Sat'
  17731. ]
  17732. const months = [
  17733. 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  17734. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
  17735. ]
  17736. const dayName = days[date.getUTCDay()]
  17737. const day = date.getUTCDate().toString().padStart(2, '0')
  17738. const month = months[date.getUTCMonth()]
  17739. const year = date.getUTCFullYear()
  17740. const hour = date.getUTCHours().toString().padStart(2, '0')
  17741. const minute = date.getUTCMinutes().toString().padStart(2, '0')
  17742. const second = date.getUTCSeconds().toString().padStart(2, '0')
  17743. return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`
  17744. }
  17745. /**
  17746. max-age-av = "Max-Age=" non-zero-digit *DIGIT
  17747. ; In practice, both expires-av and max-age-av
  17748. ; are limited to dates representable by the
  17749. ; user agent.
  17750. * @param {number} maxAge
  17751. */
  17752. function validateCookieMaxAge (maxAge) {
  17753. if (maxAge < 0) {
  17754. throw new Error('Invalid cookie max-age')
  17755. }
  17756. }
  17757. /**
  17758. * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
  17759. * @param {import('./index').Cookie} cookie
  17760. */
  17761. function stringify (cookie) {
  17762. if (cookie.name.length === 0) {
  17763. return null
  17764. }
  17765. validateCookieName(cookie.name)
  17766. validateCookieValue(cookie.value)
  17767. const out = [`${cookie.name}=${cookie.value}`]
  17768. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
  17769. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
  17770. if (cookie.name.startsWith('__Secure-')) {
  17771. cookie.secure = true
  17772. }
  17773. if (cookie.name.startsWith('__Host-')) {
  17774. cookie.secure = true
  17775. cookie.domain = null
  17776. cookie.path = '/'
  17777. }
  17778. if (cookie.secure) {
  17779. out.push('Secure')
  17780. }
  17781. if (cookie.httpOnly) {
  17782. out.push('HttpOnly')
  17783. }
  17784. if (typeof cookie.maxAge === 'number') {
  17785. validateCookieMaxAge(cookie.maxAge)
  17786. out.push(`Max-Age=${cookie.maxAge}`)
  17787. }
  17788. if (cookie.domain) {
  17789. validateCookieDomain(cookie.domain)
  17790. out.push(`Domain=${cookie.domain}`)
  17791. }
  17792. if (cookie.path) {
  17793. validateCookiePath(cookie.path)
  17794. out.push(`Path=${cookie.path}`)
  17795. }
  17796. if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {
  17797. out.push(`Expires=${toIMFDate(cookie.expires)}`)
  17798. }
  17799. if (cookie.sameSite) {
  17800. out.push(`SameSite=${cookie.sameSite}`)
  17801. }
  17802. for (const part of cookie.unparsed) {
  17803. if (!part.includes('=')) {
  17804. throw new Error('Invalid unparsed')
  17805. }
  17806. const [key, ...value] = part.split('=')
  17807. out.push(`${key.trim()}=${value.join('=')}`)
  17808. }
  17809. return out.join('; ')
  17810. }
  17811. module.exports = {
  17812. isCTLExcludingHtab,
  17813. validateCookieName,
  17814. validateCookiePath,
  17815. validateCookieValue,
  17816. toIMFDate,
  17817. stringify
  17818. }
  17819. /***/ }),
  17820. /***/ 2067:
  17821. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17822. "use strict";
  17823. const net = __nccwpck_require__(1808)
  17824. const assert = __nccwpck_require__(9491)
  17825. const util = __nccwpck_require__(3983)
  17826. const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8045)
  17827. let tls // include tls conditionally since it is not always available
  17828. // TODO: session re-use does not wait for the first
  17829. // connection to resolve the session and might therefore
  17830. // resolve the same servername multiple times even when
  17831. // re-use is enabled.
  17832. let SessionCache
  17833. // FIXME: remove workaround when the Node bug is fixed
  17834. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17835. if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
  17836. SessionCache = class WeakSessionCache {
  17837. constructor (maxCachedSessions) {
  17838. this._maxCachedSessions = maxCachedSessions
  17839. this._sessionCache = new Map()
  17840. this._sessionRegistry = new global.FinalizationRegistry((key) => {
  17841. if (this._sessionCache.size < this._maxCachedSessions) {
  17842. return
  17843. }
  17844. const ref = this._sessionCache.get(key)
  17845. if (ref !== undefined && ref.deref() === undefined) {
  17846. this._sessionCache.delete(key)
  17847. }
  17848. })
  17849. }
  17850. get (sessionKey) {
  17851. const ref = this._sessionCache.get(sessionKey)
  17852. return ref ? ref.deref() : null
  17853. }
  17854. set (sessionKey, session) {
  17855. if (this._maxCachedSessions === 0) {
  17856. return
  17857. }
  17858. this._sessionCache.set(sessionKey, new WeakRef(session))
  17859. this._sessionRegistry.register(session, sessionKey)
  17860. }
  17861. }
  17862. } else {
  17863. SessionCache = class SimpleSessionCache {
  17864. constructor (maxCachedSessions) {
  17865. this._maxCachedSessions = maxCachedSessions
  17866. this._sessionCache = new Map()
  17867. }
  17868. get (sessionKey) {
  17869. return this._sessionCache.get(sessionKey)
  17870. }
  17871. set (sessionKey, session) {
  17872. if (this._maxCachedSessions === 0) {
  17873. return
  17874. }
  17875. if (this._sessionCache.size >= this._maxCachedSessions) {
  17876. // remove the oldest session
  17877. const { value: oldestKey } = this._sessionCache.keys().next()
  17878. this._sessionCache.delete(oldestKey)
  17879. }
  17880. this._sessionCache.set(sessionKey, session)
  17881. }
  17882. }
  17883. }
  17884. function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {
  17885. if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
  17886. throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')
  17887. }
  17888. const options = { path: socketPath, ...opts }
  17889. const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)
  17890. timeout = timeout == null ? 10e3 : timeout
  17891. allowH2 = allowH2 != null ? allowH2 : false
  17892. return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
  17893. let socket
  17894. if (protocol === 'https:') {
  17895. if (!tls) {
  17896. tls = __nccwpck_require__(4404)
  17897. }
  17898. servername = servername || options.servername || util.getServerName(host) || null
  17899. const sessionKey = servername || hostname
  17900. const session = sessionCache.get(sessionKey) || null
  17901. assert(sessionKey)
  17902. socket = tls.connect({
  17903. highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...
  17904. ...options,
  17905. servername,
  17906. session,
  17907. localAddress,
  17908. // TODO(HTTP/2): Add support for h2c
  17909. ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],
  17910. socket: httpSocket, // upgrade socket connection
  17911. port: port || 443,
  17912. host: hostname
  17913. })
  17914. socket
  17915. .on('session', function (session) {
  17916. // TODO (fix): Can a session become invalid once established? Don't think so?
  17917. sessionCache.set(sessionKey, session)
  17918. })
  17919. } else {
  17920. assert(!httpSocket, 'httpSocket can only be sent on TLS update')
  17921. socket = net.connect({
  17922. highWaterMark: 64 * 1024, // Same as nodejs fs streams.
  17923. ...options,
  17924. localAddress,
  17925. port: port || 80,
  17926. host: hostname
  17927. })
  17928. }
  17929. // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket
  17930. if (options.keepAlive == null || options.keepAlive) {
  17931. const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay
  17932. socket.setKeepAlive(true, keepAliveInitialDelay)
  17933. }
  17934. const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout)
  17935. socket
  17936. .setNoDelay(true)
  17937. .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {
  17938. cancelTimeout()
  17939. if (callback) {
  17940. const cb = callback
  17941. callback = null
  17942. cb(null, this)
  17943. }
  17944. })
  17945. .on('error', function (err) {
  17946. cancelTimeout()
  17947. if (callback) {
  17948. const cb = callback
  17949. callback = null
  17950. cb(err)
  17951. }
  17952. })
  17953. return socket
  17954. }
  17955. }
  17956. function setupTimeout (onConnectTimeout, timeout) {
  17957. if (!timeout) {
  17958. return () => {}
  17959. }
  17960. let s1 = null
  17961. let s2 = null
  17962. const timeoutId = setTimeout(() => {
  17963. // setImmediate is added to make sure that we priotorise socket error events over timeouts
  17964. s1 = setImmediate(() => {
  17965. if (process.platform === 'win32') {
  17966. // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
  17967. s2 = setImmediate(() => onConnectTimeout())
  17968. } else {
  17969. onConnectTimeout()
  17970. }
  17971. })
  17972. }, timeout)
  17973. return () => {
  17974. clearTimeout(timeoutId)
  17975. clearImmediate(s1)
  17976. clearImmediate(s2)
  17977. }
  17978. }
  17979. function onConnectTimeout (socket) {
  17980. util.destroy(socket, new ConnectTimeoutError())
  17981. }
  17982. module.exports = buildConnector
  17983. /***/ }),
  17984. /***/ 4462:
  17985. /***/ ((module) => {
  17986. "use strict";
  17987. /** @type {Record<string, string | undefined>} */
  17988. const headerNameLowerCasedRecord = {}
  17989. // https://developer.mozilla.org/docs/Web/HTTP/Headers
  17990. const wellknownHeaderNames = [
  17991. 'Accept',
  17992. 'Accept-Encoding',
  17993. 'Accept-Language',
  17994. 'Accept-Ranges',
  17995. 'Access-Control-Allow-Credentials',
  17996. 'Access-Control-Allow-Headers',
  17997. 'Access-Control-Allow-Methods',
  17998. 'Access-Control-Allow-Origin',
  17999. 'Access-Control-Expose-Headers',
  18000. 'Access-Control-Max-Age',
  18001. 'Access-Control-Request-Headers',
  18002. 'Access-Control-Request-Method',
  18003. 'Age',
  18004. 'Allow',
  18005. 'Alt-Svc',
  18006. 'Alt-Used',
  18007. 'Authorization',
  18008. 'Cache-Control',
  18009. 'Clear-Site-Data',
  18010. 'Connection',
  18011. 'Content-Disposition',
  18012. 'Content-Encoding',
  18013. 'Content-Language',
  18014. 'Content-Length',
  18015. 'Content-Location',
  18016. 'Content-Range',
  18017. 'Content-Security-Policy',
  18018. 'Content-Security-Policy-Report-Only',
  18019. 'Content-Type',
  18020. 'Cookie',
  18021. 'Cross-Origin-Embedder-Policy',
  18022. 'Cross-Origin-Opener-Policy',
  18023. 'Cross-Origin-Resource-Policy',
  18024. 'Date',
  18025. 'Device-Memory',
  18026. 'Downlink',
  18027. 'ECT',
  18028. 'ETag',
  18029. 'Expect',
  18030. 'Expect-CT',
  18031. 'Expires',
  18032. 'Forwarded',
  18033. 'From',
  18034. 'Host',
  18035. 'If-Match',
  18036. 'If-Modified-Since',
  18037. 'If-None-Match',
  18038. 'If-Range',
  18039. 'If-Unmodified-Since',
  18040. 'Keep-Alive',
  18041. 'Last-Modified',
  18042. 'Link',
  18043. 'Location',
  18044. 'Max-Forwards',
  18045. 'Origin',
  18046. 'Permissions-Policy',
  18047. 'Pragma',
  18048. 'Proxy-Authenticate',
  18049. 'Proxy-Authorization',
  18050. 'RTT',
  18051. 'Range',
  18052. 'Referer',
  18053. 'Referrer-Policy',
  18054. 'Refresh',
  18055. 'Retry-After',
  18056. 'Sec-WebSocket-Accept',
  18057. 'Sec-WebSocket-Extensions',
  18058. 'Sec-WebSocket-Key',
  18059. 'Sec-WebSocket-Protocol',
  18060. 'Sec-WebSocket-Version',
  18061. 'Server',
  18062. 'Server-Timing',
  18063. 'Service-Worker-Allowed',
  18064. 'Service-Worker-Navigation-Preload',
  18065. 'Set-Cookie',
  18066. 'SourceMap',
  18067. 'Strict-Transport-Security',
  18068. 'Supports-Loading-Mode',
  18069. 'TE',
  18070. 'Timing-Allow-Origin',
  18071. 'Trailer',
  18072. 'Transfer-Encoding',
  18073. 'Upgrade',
  18074. 'Upgrade-Insecure-Requests',
  18075. 'User-Agent',
  18076. 'Vary',
  18077. 'Via',
  18078. 'WWW-Authenticate',
  18079. 'X-Content-Type-Options',
  18080. 'X-DNS-Prefetch-Control',
  18081. 'X-Frame-Options',
  18082. 'X-Permitted-Cross-Domain-Policies',
  18083. 'X-Powered-By',
  18084. 'X-Requested-With',
  18085. 'X-XSS-Protection'
  18086. ]
  18087. for (let i = 0; i < wellknownHeaderNames.length; ++i) {
  18088. const key = wellknownHeaderNames[i]
  18089. const lowerCasedKey = key.toLowerCase()
  18090. headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
  18091. lowerCasedKey
  18092. }
  18093. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  18094. Object.setPrototypeOf(headerNameLowerCasedRecord, null)
  18095. module.exports = {
  18096. wellknownHeaderNames,
  18097. headerNameLowerCasedRecord
  18098. }
  18099. /***/ }),
  18100. /***/ 8045:
  18101. /***/ ((module) => {
  18102. "use strict";
  18103. class UndiciError extends Error {
  18104. constructor (message) {
  18105. super(message)
  18106. this.name = 'UndiciError'
  18107. this.code = 'UND_ERR'
  18108. }
  18109. }
  18110. class ConnectTimeoutError extends UndiciError {
  18111. constructor (message) {
  18112. super(message)
  18113. Error.captureStackTrace(this, ConnectTimeoutError)
  18114. this.name = 'ConnectTimeoutError'
  18115. this.message = message || 'Connect Timeout Error'
  18116. this.code = 'UND_ERR_CONNECT_TIMEOUT'
  18117. }
  18118. }
  18119. class HeadersTimeoutError extends UndiciError {
  18120. constructor (message) {
  18121. super(message)
  18122. Error.captureStackTrace(this, HeadersTimeoutError)
  18123. this.name = 'HeadersTimeoutError'
  18124. this.message = message || 'Headers Timeout Error'
  18125. this.code = 'UND_ERR_HEADERS_TIMEOUT'
  18126. }
  18127. }
  18128. class HeadersOverflowError extends UndiciError {
  18129. constructor (message) {
  18130. super(message)
  18131. Error.captureStackTrace(this, HeadersOverflowError)
  18132. this.name = 'HeadersOverflowError'
  18133. this.message = message || 'Headers Overflow Error'
  18134. this.code = 'UND_ERR_HEADERS_OVERFLOW'
  18135. }
  18136. }
  18137. class BodyTimeoutError extends UndiciError {
  18138. constructor (message) {
  18139. super(message)
  18140. Error.captureStackTrace(this, BodyTimeoutError)
  18141. this.name = 'BodyTimeoutError'
  18142. this.message = message || 'Body Timeout Error'
  18143. this.code = 'UND_ERR_BODY_TIMEOUT'
  18144. }
  18145. }
  18146. class ResponseStatusCodeError extends UndiciError {
  18147. constructor (message, statusCode, headers, body) {
  18148. super(message)
  18149. Error.captureStackTrace(this, ResponseStatusCodeError)
  18150. this.name = 'ResponseStatusCodeError'
  18151. this.message = message || 'Response Status Code Error'
  18152. this.code = 'UND_ERR_RESPONSE_STATUS_CODE'
  18153. this.body = body
  18154. this.status = statusCode
  18155. this.statusCode = statusCode
  18156. this.headers = headers
  18157. }
  18158. }
  18159. class InvalidArgumentError extends UndiciError {
  18160. constructor (message) {
  18161. super(message)
  18162. Error.captureStackTrace(this, InvalidArgumentError)
  18163. this.name = 'InvalidArgumentError'
  18164. this.message = message || 'Invalid Argument Error'
  18165. this.code = 'UND_ERR_INVALID_ARG'
  18166. }
  18167. }
  18168. class InvalidReturnValueError extends UndiciError {
  18169. constructor (message) {
  18170. super(message)
  18171. Error.captureStackTrace(this, InvalidReturnValueError)
  18172. this.name = 'InvalidReturnValueError'
  18173. this.message = message || 'Invalid Return Value Error'
  18174. this.code = 'UND_ERR_INVALID_RETURN_VALUE'
  18175. }
  18176. }
  18177. class RequestAbortedError extends UndiciError {
  18178. constructor (message) {
  18179. super(message)
  18180. Error.captureStackTrace(this, RequestAbortedError)
  18181. this.name = 'AbortError'
  18182. this.message = message || 'Request aborted'
  18183. this.code = 'UND_ERR_ABORTED'
  18184. }
  18185. }
  18186. class InformationalError extends UndiciError {
  18187. constructor (message) {
  18188. super(message)
  18189. Error.captureStackTrace(this, InformationalError)
  18190. this.name = 'InformationalError'
  18191. this.message = message || 'Request information'
  18192. this.code = 'UND_ERR_INFO'
  18193. }
  18194. }
  18195. class RequestContentLengthMismatchError extends UndiciError {
  18196. constructor (message) {
  18197. super(message)
  18198. Error.captureStackTrace(this, RequestContentLengthMismatchError)
  18199. this.name = 'RequestContentLengthMismatchError'
  18200. this.message = message || 'Request body length does not match content-length header'
  18201. this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
  18202. }
  18203. }
  18204. class ResponseContentLengthMismatchError extends UndiciError {
  18205. constructor (message) {
  18206. super(message)
  18207. Error.captureStackTrace(this, ResponseContentLengthMismatchError)
  18208. this.name = 'ResponseContentLengthMismatchError'
  18209. this.message = message || 'Response body length does not match content-length header'
  18210. this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
  18211. }
  18212. }
  18213. class ClientDestroyedError extends UndiciError {
  18214. constructor (message) {
  18215. super(message)
  18216. Error.captureStackTrace(this, ClientDestroyedError)
  18217. this.name = 'ClientDestroyedError'
  18218. this.message = message || 'The client is destroyed'
  18219. this.code = 'UND_ERR_DESTROYED'
  18220. }
  18221. }
  18222. class ClientClosedError extends UndiciError {
  18223. constructor (message) {
  18224. super(message)
  18225. Error.captureStackTrace(this, ClientClosedError)
  18226. this.name = 'ClientClosedError'
  18227. this.message = message || 'The client is closed'
  18228. this.code = 'UND_ERR_CLOSED'
  18229. }
  18230. }
  18231. class SocketError extends UndiciError {
  18232. constructor (message, socket) {
  18233. super(message)
  18234. Error.captureStackTrace(this, SocketError)
  18235. this.name = 'SocketError'
  18236. this.message = message || 'Socket error'
  18237. this.code = 'UND_ERR_SOCKET'
  18238. this.socket = socket
  18239. }
  18240. }
  18241. class NotSupportedError extends UndiciError {
  18242. constructor (message) {
  18243. super(message)
  18244. Error.captureStackTrace(this, NotSupportedError)
  18245. this.name = 'NotSupportedError'
  18246. this.message = message || 'Not supported error'
  18247. this.code = 'UND_ERR_NOT_SUPPORTED'
  18248. }
  18249. }
  18250. class BalancedPoolMissingUpstreamError extends UndiciError {
  18251. constructor (message) {
  18252. super(message)
  18253. Error.captureStackTrace(this, NotSupportedError)
  18254. this.name = 'MissingUpstreamError'
  18255. this.message = message || 'No upstream has been added to the BalancedPool'
  18256. this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'
  18257. }
  18258. }
  18259. class HTTPParserError extends Error {
  18260. constructor (message, code, data) {
  18261. super(message)
  18262. Error.captureStackTrace(this, HTTPParserError)
  18263. this.name = 'HTTPParserError'
  18264. this.code = code ? `HPE_${code}` : undefined
  18265. this.data = data ? data.toString() : undefined
  18266. }
  18267. }
  18268. class ResponseExceededMaxSizeError extends UndiciError {
  18269. constructor (message) {
  18270. super(message)
  18271. Error.captureStackTrace(this, ResponseExceededMaxSizeError)
  18272. this.name = 'ResponseExceededMaxSizeError'
  18273. this.message = message || 'Response content exceeded max size'
  18274. this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
  18275. }
  18276. }
  18277. class RequestRetryError extends UndiciError {
  18278. constructor (message, code, { headers, data }) {
  18279. super(message)
  18280. Error.captureStackTrace(this, RequestRetryError)
  18281. this.name = 'RequestRetryError'
  18282. this.message = message || 'Request retry error'
  18283. this.code = 'UND_ERR_REQ_RETRY'
  18284. this.statusCode = code
  18285. this.data = data
  18286. this.headers = headers
  18287. }
  18288. }
  18289. module.exports = {
  18290. HTTPParserError,
  18291. UndiciError,
  18292. HeadersTimeoutError,
  18293. HeadersOverflowError,
  18294. BodyTimeoutError,
  18295. RequestContentLengthMismatchError,
  18296. ConnectTimeoutError,
  18297. ResponseStatusCodeError,
  18298. InvalidArgumentError,
  18299. InvalidReturnValueError,
  18300. RequestAbortedError,
  18301. ClientDestroyedError,
  18302. ClientClosedError,
  18303. InformationalError,
  18304. SocketError,
  18305. NotSupportedError,
  18306. ResponseContentLengthMismatchError,
  18307. BalancedPoolMissingUpstreamError,
  18308. ResponseExceededMaxSizeError,
  18309. RequestRetryError
  18310. }
  18311. /***/ }),
  18312. /***/ 2905:
  18313. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18314. "use strict";
  18315. const {
  18316. InvalidArgumentError,
  18317. NotSupportedError
  18318. } = __nccwpck_require__(8045)
  18319. const assert = __nccwpck_require__(9491)
  18320. const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(2785)
  18321. const util = __nccwpck_require__(3983)
  18322. // tokenRegExp and headerCharRegex have been lifted from
  18323. // https://github.com/nodejs/node/blob/main/lib/_http_common.js
  18324. /**
  18325. * Verifies that the given val is a valid HTTP token
  18326. * per the rules defined in RFC 7230
  18327. * See https://tools.ietf.org/html/rfc7230#section-3.2.6
  18328. */
  18329. const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
  18330. /**
  18331. * Matches if val contains an invalid field-vchar
  18332. * field-value = *( field-content / obs-fold )
  18333. * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
  18334. * field-vchar = VCHAR / obs-text
  18335. */
  18336. const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
  18337. // Verifies that a given path is valid does not contain control chars \x00 to \x20
  18338. const invalidPathRegex = /[^\u0021-\u00ff]/
  18339. const kHandler = Symbol('handler')
  18340. const channels = {}
  18341. let extractBody
  18342. try {
  18343. const diagnosticsChannel = __nccwpck_require__(7643)
  18344. channels.create = diagnosticsChannel.channel('undici:request:create')
  18345. channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent')
  18346. channels.headers = diagnosticsChannel.channel('undici:request:headers')
  18347. channels.trailers = diagnosticsChannel.channel('undici:request:trailers')
  18348. channels.error = diagnosticsChannel.channel('undici:request:error')
  18349. } catch {
  18350. channels.create = { hasSubscribers: false }
  18351. channels.bodySent = { hasSubscribers: false }
  18352. channels.headers = { hasSubscribers: false }
  18353. channels.trailers = { hasSubscribers: false }
  18354. channels.error = { hasSubscribers: false }
  18355. }
  18356. class Request {
  18357. constructor (origin, {
  18358. path,
  18359. method,
  18360. body,
  18361. headers,
  18362. query,
  18363. idempotent,
  18364. blocking,
  18365. upgrade,
  18366. headersTimeout,
  18367. bodyTimeout,
  18368. reset,
  18369. throwOnError,
  18370. expectContinue
  18371. }, handler) {
  18372. if (typeof path !== 'string') {
  18373. throw new InvalidArgumentError('path must be a string')
  18374. } else if (
  18375. path[0] !== '/' &&
  18376. !(path.startsWith('http://') || path.startsWith('https://')) &&
  18377. method !== 'CONNECT'
  18378. ) {
  18379. throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
  18380. } else if (invalidPathRegex.exec(path) !== null) {
  18381. throw new InvalidArgumentError('invalid request path')
  18382. }
  18383. if (typeof method !== 'string') {
  18384. throw new InvalidArgumentError('method must be a string')
  18385. } else if (tokenRegExp.exec(method) === null) {
  18386. throw new InvalidArgumentError('invalid request method')
  18387. }
  18388. if (upgrade && typeof upgrade !== 'string') {
  18389. throw new InvalidArgumentError('upgrade must be a string')
  18390. }
  18391. if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
  18392. throw new InvalidArgumentError('invalid headersTimeout')
  18393. }
  18394. if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
  18395. throw new InvalidArgumentError('invalid bodyTimeout')
  18396. }
  18397. if (reset != null && typeof reset !== 'boolean') {
  18398. throw new InvalidArgumentError('invalid reset')
  18399. }
  18400. if (expectContinue != null && typeof expectContinue !== 'boolean') {
  18401. throw new InvalidArgumentError('invalid expectContinue')
  18402. }
  18403. this.headersTimeout = headersTimeout
  18404. this.bodyTimeout = bodyTimeout
  18405. this.throwOnError = throwOnError === true
  18406. this.method = method
  18407. this.abort = null
  18408. if (body == null) {
  18409. this.body = null
  18410. } else if (util.isStream(body)) {
  18411. this.body = body
  18412. const rState = this.body._readableState
  18413. if (!rState || !rState.autoDestroy) {
  18414. this.endHandler = function autoDestroy () {
  18415. util.destroy(this)
  18416. }
  18417. this.body.on('end', this.endHandler)
  18418. }
  18419. this.errorHandler = err => {
  18420. if (this.abort) {
  18421. this.abort(err)
  18422. } else {
  18423. this.error = err
  18424. }
  18425. }
  18426. this.body.on('error', this.errorHandler)
  18427. } else if (util.isBuffer(body)) {
  18428. this.body = body.byteLength ? body : null
  18429. } else if (ArrayBuffer.isView(body)) {
  18430. this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
  18431. } else if (body instanceof ArrayBuffer) {
  18432. this.body = body.byteLength ? Buffer.from(body) : null
  18433. } else if (typeof body === 'string') {
  18434. this.body = body.length ? Buffer.from(body) : null
  18435. } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {
  18436. this.body = body
  18437. } else {
  18438. throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
  18439. }
  18440. this.completed = false
  18441. this.aborted = false
  18442. this.upgrade = upgrade || null
  18443. this.path = query ? util.buildURL(path, query) : path
  18444. this.origin = origin
  18445. this.idempotent = idempotent == null
  18446. ? method === 'HEAD' || method === 'GET'
  18447. : idempotent
  18448. this.blocking = blocking == null ? false : blocking
  18449. this.reset = reset == null ? null : reset
  18450. this.host = null
  18451. this.contentLength = null
  18452. this.contentType = null
  18453. this.headers = ''
  18454. // Only for H2
  18455. this.expectContinue = expectContinue != null ? expectContinue : false
  18456. if (Array.isArray(headers)) {
  18457. if (headers.length % 2 !== 0) {
  18458. throw new InvalidArgumentError('headers array must be even')
  18459. }
  18460. for (let i = 0; i < headers.length; i += 2) {
  18461. processHeader(this, headers[i], headers[i + 1])
  18462. }
  18463. } else if (headers && typeof headers === 'object') {
  18464. const keys = Object.keys(headers)
  18465. for (let i = 0; i < keys.length; i++) {
  18466. const key = keys[i]
  18467. processHeader(this, key, headers[key])
  18468. }
  18469. } else if (headers != null) {
  18470. throw new InvalidArgumentError('headers must be an object or an array')
  18471. }
  18472. if (util.isFormDataLike(this.body)) {
  18473. if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {
  18474. throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')
  18475. }
  18476. if (!extractBody) {
  18477. extractBody = (__nccwpck_require__(9990).extractBody)
  18478. }
  18479. const [bodyStream, contentType] = extractBody(body)
  18480. if (this.contentType == null) {
  18481. this.contentType = contentType
  18482. this.headers += `content-type: ${contentType}\r\n`
  18483. }
  18484. this.body = bodyStream.stream
  18485. this.contentLength = bodyStream.length
  18486. } else if (util.isBlobLike(body) && this.contentType == null && body.type) {
  18487. this.contentType = body.type
  18488. this.headers += `content-type: ${body.type}\r\n`
  18489. }
  18490. util.validateHandler(handler, method, upgrade)
  18491. this.servername = util.getServerName(this.host)
  18492. this[kHandler] = handler
  18493. if (channels.create.hasSubscribers) {
  18494. channels.create.publish({ request: this })
  18495. }
  18496. }
  18497. onBodySent (chunk) {
  18498. if (this[kHandler].onBodySent) {
  18499. try {
  18500. return this[kHandler].onBodySent(chunk)
  18501. } catch (err) {
  18502. this.abort(err)
  18503. }
  18504. }
  18505. }
  18506. onRequestSent () {
  18507. if (channels.bodySent.hasSubscribers) {
  18508. channels.bodySent.publish({ request: this })
  18509. }
  18510. if (this[kHandler].onRequestSent) {
  18511. try {
  18512. return this[kHandler].onRequestSent()
  18513. } catch (err) {
  18514. this.abort(err)
  18515. }
  18516. }
  18517. }
  18518. onConnect (abort) {
  18519. assert(!this.aborted)
  18520. assert(!this.completed)
  18521. if (this.error) {
  18522. abort(this.error)
  18523. } else {
  18524. this.abort = abort
  18525. return this[kHandler].onConnect(abort)
  18526. }
  18527. }
  18528. onHeaders (statusCode, headers, resume, statusText) {
  18529. assert(!this.aborted)
  18530. assert(!this.completed)
  18531. if (channels.headers.hasSubscribers) {
  18532. channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
  18533. }
  18534. try {
  18535. return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
  18536. } catch (err) {
  18537. this.abort(err)
  18538. }
  18539. }
  18540. onData (chunk) {
  18541. assert(!this.aborted)
  18542. assert(!this.completed)
  18543. try {
  18544. return this[kHandler].onData(chunk)
  18545. } catch (err) {
  18546. this.abort(err)
  18547. return false
  18548. }
  18549. }
  18550. onUpgrade (statusCode, headers, socket) {
  18551. assert(!this.aborted)
  18552. assert(!this.completed)
  18553. return this[kHandler].onUpgrade(statusCode, headers, socket)
  18554. }
  18555. onComplete (trailers) {
  18556. this.onFinally()
  18557. assert(!this.aborted)
  18558. this.completed = true
  18559. if (channels.trailers.hasSubscribers) {
  18560. channels.trailers.publish({ request: this, trailers })
  18561. }
  18562. try {
  18563. return this[kHandler].onComplete(trailers)
  18564. } catch (err) {
  18565. // TODO (fix): This might be a bad idea?
  18566. this.onError(err)
  18567. }
  18568. }
  18569. onError (error) {
  18570. this.onFinally()
  18571. if (channels.error.hasSubscribers) {
  18572. channels.error.publish({ request: this, error })
  18573. }
  18574. if (this.aborted) {
  18575. return
  18576. }
  18577. this.aborted = true
  18578. return this[kHandler].onError(error)
  18579. }
  18580. onFinally () {
  18581. if (this.errorHandler) {
  18582. this.body.off('error', this.errorHandler)
  18583. this.errorHandler = null
  18584. }
  18585. if (this.endHandler) {
  18586. this.body.off('end', this.endHandler)
  18587. this.endHandler = null
  18588. }
  18589. }
  18590. // TODO: adjust to support H2
  18591. addHeader (key, value) {
  18592. processHeader(this, key, value)
  18593. return this
  18594. }
  18595. static [kHTTP1BuildRequest] (origin, opts, handler) {
  18596. // TODO: Migrate header parsing here, to make Requests
  18597. // HTTP agnostic
  18598. return new Request(origin, opts, handler)
  18599. }
  18600. static [kHTTP2BuildRequest] (origin, opts, handler) {
  18601. const headers = opts.headers
  18602. opts = { ...opts, headers: null }
  18603. const request = new Request(origin, opts, handler)
  18604. request.headers = {}
  18605. if (Array.isArray(headers)) {
  18606. if (headers.length % 2 !== 0) {
  18607. throw new InvalidArgumentError('headers array must be even')
  18608. }
  18609. for (let i = 0; i < headers.length; i += 2) {
  18610. processHeader(request, headers[i], headers[i + 1], true)
  18611. }
  18612. } else if (headers && typeof headers === 'object') {
  18613. const keys = Object.keys(headers)
  18614. for (let i = 0; i < keys.length; i++) {
  18615. const key = keys[i]
  18616. processHeader(request, key, headers[key], true)
  18617. }
  18618. } else if (headers != null) {
  18619. throw new InvalidArgumentError('headers must be an object or an array')
  18620. }
  18621. return request
  18622. }
  18623. static [kHTTP2CopyHeaders] (raw) {
  18624. const rawHeaders = raw.split('\r\n')
  18625. const headers = {}
  18626. for (const header of rawHeaders) {
  18627. const [key, value] = header.split(': ')
  18628. if (value == null || value.length === 0) continue
  18629. if (headers[key]) headers[key] += `,${value}`
  18630. else headers[key] = value
  18631. }
  18632. return headers
  18633. }
  18634. }
  18635. function processHeaderValue (key, val, skipAppend) {
  18636. if (val && typeof val === 'object') {
  18637. throw new InvalidArgumentError(`invalid ${key} header`)
  18638. }
  18639. val = val != null ? `${val}` : ''
  18640. if (headerCharRegex.exec(val) !== null) {
  18641. throw new InvalidArgumentError(`invalid ${key} header`)
  18642. }
  18643. return skipAppend ? val : `${key}: ${val}\r\n`
  18644. }
  18645. function processHeader (request, key, val, skipAppend = false) {
  18646. if (val && (typeof val === 'object' && !Array.isArray(val))) {
  18647. throw new InvalidArgumentError(`invalid ${key} header`)
  18648. } else if (val === undefined) {
  18649. return
  18650. }
  18651. if (
  18652. request.host === null &&
  18653. key.length === 4 &&
  18654. key.toLowerCase() === 'host'
  18655. ) {
  18656. if (headerCharRegex.exec(val) !== null) {
  18657. throw new InvalidArgumentError(`invalid ${key} header`)
  18658. }
  18659. // Consumed by Client
  18660. request.host = val
  18661. } else if (
  18662. request.contentLength === null &&
  18663. key.length === 14 &&
  18664. key.toLowerCase() === 'content-length'
  18665. ) {
  18666. request.contentLength = parseInt(val, 10)
  18667. if (!Number.isFinite(request.contentLength)) {
  18668. throw new InvalidArgumentError('invalid content-length header')
  18669. }
  18670. } else if (
  18671. request.contentType === null &&
  18672. key.length === 12 &&
  18673. key.toLowerCase() === 'content-type'
  18674. ) {
  18675. request.contentType = val
  18676. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18677. else request.headers += processHeaderValue(key, val)
  18678. } else if (
  18679. key.length === 17 &&
  18680. key.toLowerCase() === 'transfer-encoding'
  18681. ) {
  18682. throw new InvalidArgumentError('invalid transfer-encoding header')
  18683. } else if (
  18684. key.length === 10 &&
  18685. key.toLowerCase() === 'connection'
  18686. ) {
  18687. const value = typeof val === 'string' ? val.toLowerCase() : null
  18688. if (value !== 'close' && value !== 'keep-alive') {
  18689. throw new InvalidArgumentError('invalid connection header')
  18690. } else if (value === 'close') {
  18691. request.reset = true
  18692. }
  18693. } else if (
  18694. key.length === 10 &&
  18695. key.toLowerCase() === 'keep-alive'
  18696. ) {
  18697. throw new InvalidArgumentError('invalid keep-alive header')
  18698. } else if (
  18699. key.length === 7 &&
  18700. key.toLowerCase() === 'upgrade'
  18701. ) {
  18702. throw new InvalidArgumentError('invalid upgrade header')
  18703. } else if (
  18704. key.length === 6 &&
  18705. key.toLowerCase() === 'expect'
  18706. ) {
  18707. throw new NotSupportedError('expect header not supported')
  18708. } else if (tokenRegExp.exec(key) === null) {
  18709. throw new InvalidArgumentError('invalid header key')
  18710. } else {
  18711. if (Array.isArray(val)) {
  18712. for (let i = 0; i < val.length; i++) {
  18713. if (skipAppend) {
  18714. if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`
  18715. else request.headers[key] = processHeaderValue(key, val[i], skipAppend)
  18716. } else {
  18717. request.headers += processHeaderValue(key, val[i])
  18718. }
  18719. }
  18720. } else {
  18721. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18722. else request.headers += processHeaderValue(key, val)
  18723. }
  18724. }
  18725. }
  18726. module.exports = Request
  18727. /***/ }),
  18728. /***/ 2785:
  18729. /***/ ((module) => {
  18730. module.exports = {
  18731. kClose: Symbol('close'),
  18732. kDestroy: Symbol('destroy'),
  18733. kDispatch: Symbol('dispatch'),
  18734. kUrl: Symbol('url'),
  18735. kWriting: Symbol('writing'),
  18736. kResuming: Symbol('resuming'),
  18737. kQueue: Symbol('queue'),
  18738. kConnect: Symbol('connect'),
  18739. kConnecting: Symbol('connecting'),
  18740. kHeadersList: Symbol('headers list'),
  18741. kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),
  18742. kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),
  18743. kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),
  18744. kKeepAliveTimeoutValue: Symbol('keep alive timeout'),
  18745. kKeepAlive: Symbol('keep alive'),
  18746. kHeadersTimeout: Symbol('headers timeout'),
  18747. kBodyTimeout: Symbol('body timeout'),
  18748. kServerName: Symbol('server name'),
  18749. kLocalAddress: Symbol('local address'),
  18750. kHost: Symbol('host'),
  18751. kNoRef: Symbol('no ref'),
  18752. kBodyUsed: Symbol('used'),
  18753. kRunning: Symbol('running'),
  18754. kBlocking: Symbol('blocking'),
  18755. kPending: Symbol('pending'),
  18756. kSize: Symbol('size'),
  18757. kBusy: Symbol('busy'),
  18758. kQueued: Symbol('queued'),
  18759. kFree: Symbol('free'),
  18760. kConnected: Symbol('connected'),
  18761. kClosed: Symbol('closed'),
  18762. kNeedDrain: Symbol('need drain'),
  18763. kReset: Symbol('reset'),
  18764. kDestroyed: Symbol.for('nodejs.stream.destroyed'),
  18765. kMaxHeadersSize: Symbol('max headers size'),
  18766. kRunningIdx: Symbol('running index'),
  18767. kPendingIdx: Symbol('pending index'),
  18768. kError: Symbol('error'),
  18769. kClients: Symbol('clients'),
  18770. kClient: Symbol('client'),
  18771. kParser: Symbol('parser'),
  18772. kOnDestroyed: Symbol('destroy callbacks'),
  18773. kPipelining: Symbol('pipelining'),
  18774. kSocket: Symbol('socket'),
  18775. kHostHeader: Symbol('host header'),
  18776. kConnector: Symbol('connector'),
  18777. kStrictContentLength: Symbol('strict content length'),
  18778. kMaxRedirections: Symbol('maxRedirections'),
  18779. kMaxRequests: Symbol('maxRequestsPerClient'),
  18780. kProxy: Symbol('proxy agent options'),
  18781. kCounter: Symbol('socket request counter'),
  18782. kInterceptors: Symbol('dispatch interceptors'),
  18783. kMaxResponseSize: Symbol('max response size'),
  18784. kHTTP2Session: Symbol('http2Session'),
  18785. kHTTP2SessionState: Symbol('http2Session state'),
  18786. kHTTP2BuildRequest: Symbol('http2 build request'),
  18787. kHTTP1BuildRequest: Symbol('http1 build request'),
  18788. kHTTP2CopyHeaders: Symbol('http2 copy headers'),
  18789. kHTTPConnVersion: Symbol('http connection version'),
  18790. kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
  18791. kConstruct: Symbol('constructable')
  18792. }
  18793. /***/ }),
  18794. /***/ 3983:
  18795. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18796. "use strict";
  18797. const assert = __nccwpck_require__(9491)
  18798. const { kDestroyed, kBodyUsed } = __nccwpck_require__(2785)
  18799. const { IncomingMessage } = __nccwpck_require__(3685)
  18800. const stream = __nccwpck_require__(2781)
  18801. const net = __nccwpck_require__(1808)
  18802. const { InvalidArgumentError } = __nccwpck_require__(8045)
  18803. const { Blob } = __nccwpck_require__(4300)
  18804. const nodeUtil = __nccwpck_require__(3837)
  18805. const { stringify } = __nccwpck_require__(3477)
  18806. const { headerNameLowerCasedRecord } = __nccwpck_require__(4462)
  18807. const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
  18808. function nop () {}
  18809. function isStream (obj) {
  18810. return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
  18811. }
  18812. // based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
  18813. function isBlobLike (object) {
  18814. return (Blob && object instanceof Blob) || (
  18815. object &&
  18816. typeof object === 'object' &&
  18817. (typeof object.stream === 'function' ||
  18818. typeof object.arrayBuffer === 'function') &&
  18819. /^(Blob|File)$/.test(object[Symbol.toStringTag])
  18820. )
  18821. }
  18822. function buildURL (url, queryParams) {
  18823. if (url.includes('?') || url.includes('#')) {
  18824. throw new Error('Query params cannot be passed when url already contains "?" or "#".')
  18825. }
  18826. const stringified = stringify(queryParams)
  18827. if (stringified) {
  18828. url += '?' + stringified
  18829. }
  18830. return url
  18831. }
  18832. function parseURL (url) {
  18833. if (typeof url === 'string') {
  18834. url = new URL(url)
  18835. if (!/^https?:/.test(url.origin || url.protocol)) {
  18836. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18837. }
  18838. return url
  18839. }
  18840. if (!url || typeof url !== 'object') {
  18841. throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
  18842. }
  18843. if (!/^https?:/.test(url.origin || url.protocol)) {
  18844. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18845. }
  18846. if (!(url instanceof URL)) {
  18847. if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
  18848. throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
  18849. }
  18850. if (url.path != null && typeof url.path !== 'string') {
  18851. throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
  18852. }
  18853. if (url.pathname != null && typeof url.pathname !== 'string') {
  18854. throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
  18855. }
  18856. if (url.hostname != null && typeof url.hostname !== 'string') {
  18857. throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
  18858. }
  18859. if (url.origin != null && typeof url.origin !== 'string') {
  18860. throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
  18861. }
  18862. const port = url.port != null
  18863. ? url.port
  18864. : (url.protocol === 'https:' ? 443 : 80)
  18865. let origin = url.origin != null
  18866. ? url.origin
  18867. : `${url.protocol}//${url.hostname}:${port}`
  18868. let path = url.path != null
  18869. ? url.path
  18870. : `${url.pathname || ''}${url.search || ''}`
  18871. if (origin.endsWith('/')) {
  18872. origin = origin.substring(0, origin.length - 1)
  18873. }
  18874. if (path && !path.startsWith('/')) {
  18875. path = `/${path}`
  18876. }
  18877. // new URL(path, origin) is unsafe when `path` contains an absolute URL
  18878. // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
  18879. // If first parameter is a relative URL, second param is required, and will be used as the base URL.
  18880. // If first parameter is an absolute URL, a given second param will be ignored.
  18881. url = new URL(origin + path)
  18882. }
  18883. return url
  18884. }
  18885. function parseOrigin (url) {
  18886. url = parseURL(url)
  18887. if (url.pathname !== '/' || url.search || url.hash) {
  18888. throw new InvalidArgumentError('invalid url')
  18889. }
  18890. return url
  18891. }
  18892. function getHostname (host) {
  18893. if (host[0] === '[') {
  18894. const idx = host.indexOf(']')
  18895. assert(idx !== -1)
  18896. return host.substring(1, idx)
  18897. }
  18898. const idx = host.indexOf(':')
  18899. if (idx === -1) return host
  18900. return host.substring(0, idx)
  18901. }
  18902. // IP addresses are not valid server names per RFC6066
  18903. // > Currently, the only server names supported are DNS hostnames
  18904. function getServerName (host) {
  18905. if (!host) {
  18906. return null
  18907. }
  18908. assert.strictEqual(typeof host, 'string')
  18909. const servername = getHostname(host)
  18910. if (net.isIP(servername)) {
  18911. return ''
  18912. }
  18913. return servername
  18914. }
  18915. function deepClone (obj) {
  18916. return JSON.parse(JSON.stringify(obj))
  18917. }
  18918. function isAsyncIterable (obj) {
  18919. return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
  18920. }
  18921. function isIterable (obj) {
  18922. return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
  18923. }
  18924. function bodyLength (body) {
  18925. if (body == null) {
  18926. return 0
  18927. } else if (isStream(body)) {
  18928. const state = body._readableState
  18929. return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
  18930. ? state.length
  18931. : null
  18932. } else if (isBlobLike(body)) {
  18933. return body.size != null ? body.size : null
  18934. } else if (isBuffer(body)) {
  18935. return body.byteLength
  18936. }
  18937. return null
  18938. }
  18939. function isDestroyed (stream) {
  18940. return !stream || !!(stream.destroyed || stream[kDestroyed])
  18941. }
  18942. function isReadableAborted (stream) {
  18943. const state = stream && stream._readableState
  18944. return isDestroyed(stream) && state && !state.endEmitted
  18945. }
  18946. function destroy (stream, err) {
  18947. if (stream == null || !isStream(stream) || isDestroyed(stream)) {
  18948. return
  18949. }
  18950. if (typeof stream.destroy === 'function') {
  18951. if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
  18952. // See: https://github.com/nodejs/node/pull/38505/files
  18953. stream.socket = null
  18954. }
  18955. stream.destroy(err)
  18956. } else if (err) {
  18957. process.nextTick((stream, err) => {
  18958. stream.emit('error', err)
  18959. }, stream, err)
  18960. }
  18961. if (stream.destroyed !== true) {
  18962. stream[kDestroyed] = true
  18963. }
  18964. }
  18965. const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
  18966. function parseKeepAliveTimeout (val) {
  18967. const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
  18968. return m ? parseInt(m[1], 10) * 1000 : null
  18969. }
  18970. /**
  18971. * Retrieves a header name and returns its lowercase value.
  18972. * @param {string | Buffer} value Header name
  18973. * @returns {string}
  18974. */
  18975. function headerNameToString (value) {
  18976. return headerNameLowerCasedRecord[value] || value.toLowerCase()
  18977. }
  18978. function parseHeaders (headers, obj = {}) {
  18979. // For H2 support
  18980. if (!Array.isArray(headers)) return headers
  18981. for (let i = 0; i < headers.length; i += 2) {
  18982. const key = headers[i].toString().toLowerCase()
  18983. let val = obj[key]
  18984. if (!val) {
  18985. if (Array.isArray(headers[i + 1])) {
  18986. obj[key] = headers[i + 1].map(x => x.toString('utf8'))
  18987. } else {
  18988. obj[key] = headers[i + 1].toString('utf8')
  18989. }
  18990. } else {
  18991. if (!Array.isArray(val)) {
  18992. val = [val]
  18993. obj[key] = val
  18994. }
  18995. val.push(headers[i + 1].toString('utf8'))
  18996. }
  18997. }
  18998. // See https://github.com/nodejs/node/pull/46528
  18999. if ('content-length' in obj && 'content-disposition' in obj) {
  19000. obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
  19001. }
  19002. return obj
  19003. }
  19004. function parseRawHeaders (headers) {
  19005. const ret = []
  19006. let hasContentLength = false
  19007. let contentDispositionIdx = -1
  19008. for (let n = 0; n < headers.length; n += 2) {
  19009. const key = headers[n + 0].toString()
  19010. const val = headers[n + 1].toString('utf8')
  19011. if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
  19012. ret.push(key, val)
  19013. hasContentLength = true
  19014. } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
  19015. contentDispositionIdx = ret.push(key, val) - 1
  19016. } else {
  19017. ret.push(key, val)
  19018. }
  19019. }
  19020. // See https://github.com/nodejs/node/pull/46528
  19021. if (hasContentLength && contentDispositionIdx !== -1) {
  19022. ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
  19023. }
  19024. return ret
  19025. }
  19026. function isBuffer (buffer) {
  19027. // See, https://github.com/mcollina/undici/pull/319
  19028. return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
  19029. }
  19030. function validateHandler (handler, method, upgrade) {
  19031. if (!handler || typeof handler !== 'object') {
  19032. throw new InvalidArgumentError('handler must be an object')
  19033. }
  19034. if (typeof handler.onConnect !== 'function') {
  19035. throw new InvalidArgumentError('invalid onConnect method')
  19036. }
  19037. if (typeof handler.onError !== 'function') {
  19038. throw new InvalidArgumentError('invalid onError method')
  19039. }
  19040. if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
  19041. throw new InvalidArgumentError('invalid onBodySent method')
  19042. }
  19043. if (upgrade || method === 'CONNECT') {
  19044. if (typeof handler.onUpgrade !== 'function') {
  19045. throw new InvalidArgumentError('invalid onUpgrade method')
  19046. }
  19047. } else {
  19048. if (typeof handler.onHeaders !== 'function') {
  19049. throw new InvalidArgumentError('invalid onHeaders method')
  19050. }
  19051. if (typeof handler.onData !== 'function') {
  19052. throw new InvalidArgumentError('invalid onData method')
  19053. }
  19054. if (typeof handler.onComplete !== 'function') {
  19055. throw new InvalidArgumentError('invalid onComplete method')
  19056. }
  19057. }
  19058. }
  19059. // A body is disturbed if it has been read from and it cannot
  19060. // be re-used without losing state or data.
  19061. function isDisturbed (body) {
  19062. return !!(body && (
  19063. stream.isDisturbed
  19064. ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed?
  19065. : body[kBodyUsed] ||
  19066. body.readableDidRead ||
  19067. (body._readableState && body._readableState.dataEmitted) ||
  19068. isReadableAborted(body)
  19069. ))
  19070. }
  19071. function isErrored (body) {
  19072. return !!(body && (
  19073. stream.isErrored
  19074. ? stream.isErrored(body)
  19075. : /state: 'errored'/.test(nodeUtil.inspect(body)
  19076. )))
  19077. }
  19078. function isReadable (body) {
  19079. return !!(body && (
  19080. stream.isReadable
  19081. ? stream.isReadable(body)
  19082. : /state: 'readable'/.test(nodeUtil.inspect(body)
  19083. )))
  19084. }
  19085. function getSocketInfo (socket) {
  19086. return {
  19087. localAddress: socket.localAddress,
  19088. localPort: socket.localPort,
  19089. remoteAddress: socket.remoteAddress,
  19090. remotePort: socket.remotePort,
  19091. remoteFamily: socket.remoteFamily,
  19092. timeout: socket.timeout,
  19093. bytesWritten: socket.bytesWritten,
  19094. bytesRead: socket.bytesRead
  19095. }
  19096. }
  19097. async function * convertIterableToBuffer (iterable) {
  19098. for await (const chunk of iterable) {
  19099. yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)
  19100. }
  19101. }
  19102. let ReadableStream
  19103. function ReadableStreamFrom (iterable) {
  19104. if (!ReadableStream) {
  19105. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19106. }
  19107. if (ReadableStream.from) {
  19108. return ReadableStream.from(convertIterableToBuffer(iterable))
  19109. }
  19110. let iterator
  19111. return new ReadableStream(
  19112. {
  19113. async start () {
  19114. iterator = iterable[Symbol.asyncIterator]()
  19115. },
  19116. async pull (controller) {
  19117. const { done, value } = await iterator.next()
  19118. if (done) {
  19119. queueMicrotask(() => {
  19120. controller.close()
  19121. })
  19122. } else {
  19123. const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
  19124. controller.enqueue(new Uint8Array(buf))
  19125. }
  19126. return controller.desiredSize > 0
  19127. },
  19128. async cancel (reason) {
  19129. await iterator.return()
  19130. }
  19131. },
  19132. 0
  19133. )
  19134. }
  19135. // The chunk should be a FormData instance and contains
  19136. // all the required methods.
  19137. function isFormDataLike (object) {
  19138. return (
  19139. object &&
  19140. typeof object === 'object' &&
  19141. typeof object.append === 'function' &&
  19142. typeof object.delete === 'function' &&
  19143. typeof object.get === 'function' &&
  19144. typeof object.getAll === 'function' &&
  19145. typeof object.has === 'function' &&
  19146. typeof object.set === 'function' &&
  19147. object[Symbol.toStringTag] === 'FormData'
  19148. )
  19149. }
  19150. function throwIfAborted (signal) {
  19151. if (!signal) { return }
  19152. if (typeof signal.throwIfAborted === 'function') {
  19153. signal.throwIfAborted()
  19154. } else {
  19155. if (signal.aborted) {
  19156. // DOMException not available < v17.0.0
  19157. const err = new Error('The operation was aborted')
  19158. err.name = 'AbortError'
  19159. throw err
  19160. }
  19161. }
  19162. }
  19163. function addAbortListener (signal, listener) {
  19164. if ('addEventListener' in signal) {
  19165. signal.addEventListener('abort', listener, { once: true })
  19166. return () => signal.removeEventListener('abort', listener)
  19167. }
  19168. signal.addListener('abort', listener)
  19169. return () => signal.removeListener('abort', listener)
  19170. }
  19171. const hasToWellFormed = !!String.prototype.toWellFormed
  19172. /**
  19173. * @param {string} val
  19174. */
  19175. function toUSVString (val) {
  19176. if (hasToWellFormed) {
  19177. return `${val}`.toWellFormed()
  19178. } else if (nodeUtil.toUSVString) {
  19179. return nodeUtil.toUSVString(val)
  19180. }
  19181. return `${val}`
  19182. }
  19183. // Parsed accordingly to RFC 9110
  19184. // https://www.rfc-editor.org/rfc/rfc9110#field.content-range
  19185. function parseRangeHeader (range) {
  19186. if (range == null || range === '') return { start: 0, end: null, size: null }
  19187. const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
  19188. return m
  19189. ? {
  19190. start: parseInt(m[1]),
  19191. end: m[2] ? parseInt(m[2]) : null,
  19192. size: m[3] ? parseInt(m[3]) : null
  19193. }
  19194. : null
  19195. }
  19196. const kEnumerableProperty = Object.create(null)
  19197. kEnumerableProperty.enumerable = true
  19198. module.exports = {
  19199. kEnumerableProperty,
  19200. nop,
  19201. isDisturbed,
  19202. isErrored,
  19203. isReadable,
  19204. toUSVString,
  19205. isReadableAborted,
  19206. isBlobLike,
  19207. parseOrigin,
  19208. parseURL,
  19209. getServerName,
  19210. isStream,
  19211. isIterable,
  19212. isAsyncIterable,
  19213. isDestroyed,
  19214. headerNameToString,
  19215. parseRawHeaders,
  19216. parseHeaders,
  19217. parseKeepAliveTimeout,
  19218. destroy,
  19219. bodyLength,
  19220. deepClone,
  19221. ReadableStreamFrom,
  19222. isBuffer,
  19223. validateHandler,
  19224. getSocketInfo,
  19225. isFormDataLike,
  19226. buildURL,
  19227. throwIfAborted,
  19228. addAbortListener,
  19229. parseRangeHeader,
  19230. nodeMajor,
  19231. nodeMinor,
  19232. nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13),
  19233. safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19234. }
  19235. /***/ }),
  19236. /***/ 4839:
  19237. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19238. "use strict";
  19239. const Dispatcher = __nccwpck_require__(412)
  19240. const {
  19241. ClientDestroyedError,
  19242. ClientClosedError,
  19243. InvalidArgumentError
  19244. } = __nccwpck_require__(8045)
  19245. const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  19246. const kDestroyed = Symbol('destroyed')
  19247. const kClosed = Symbol('closed')
  19248. const kOnDestroyed = Symbol('onDestroyed')
  19249. const kOnClosed = Symbol('onClosed')
  19250. const kInterceptedDispatch = Symbol('Intercepted Dispatch')
  19251. class DispatcherBase extends Dispatcher {
  19252. constructor () {
  19253. super()
  19254. this[kDestroyed] = false
  19255. this[kOnDestroyed] = null
  19256. this[kClosed] = false
  19257. this[kOnClosed] = []
  19258. }
  19259. get destroyed () {
  19260. return this[kDestroyed]
  19261. }
  19262. get closed () {
  19263. return this[kClosed]
  19264. }
  19265. get interceptors () {
  19266. return this[kInterceptors]
  19267. }
  19268. set interceptors (newInterceptors) {
  19269. if (newInterceptors) {
  19270. for (let i = newInterceptors.length - 1; i >= 0; i--) {
  19271. const interceptor = this[kInterceptors][i]
  19272. if (typeof interceptor !== 'function') {
  19273. throw new InvalidArgumentError('interceptor must be an function')
  19274. }
  19275. }
  19276. }
  19277. this[kInterceptors] = newInterceptors
  19278. }
  19279. close (callback) {
  19280. if (callback === undefined) {
  19281. return new Promise((resolve, reject) => {
  19282. this.close((err, data) => {
  19283. return err ? reject(err) : resolve(data)
  19284. })
  19285. })
  19286. }
  19287. if (typeof callback !== 'function') {
  19288. throw new InvalidArgumentError('invalid callback')
  19289. }
  19290. if (this[kDestroyed]) {
  19291. queueMicrotask(() => callback(new ClientDestroyedError(), null))
  19292. return
  19293. }
  19294. if (this[kClosed]) {
  19295. if (this[kOnClosed]) {
  19296. this[kOnClosed].push(callback)
  19297. } else {
  19298. queueMicrotask(() => callback(null, null))
  19299. }
  19300. return
  19301. }
  19302. this[kClosed] = true
  19303. this[kOnClosed].push(callback)
  19304. const onClosed = () => {
  19305. const callbacks = this[kOnClosed]
  19306. this[kOnClosed] = null
  19307. for (let i = 0; i < callbacks.length; i++) {
  19308. callbacks[i](null, null)
  19309. }
  19310. }
  19311. // Should not error.
  19312. this[kClose]()
  19313. .then(() => this.destroy())
  19314. .then(() => {
  19315. queueMicrotask(onClosed)
  19316. })
  19317. }
  19318. destroy (err, callback) {
  19319. if (typeof err === 'function') {
  19320. callback = err
  19321. err = null
  19322. }
  19323. if (callback === undefined) {
  19324. return new Promise((resolve, reject) => {
  19325. this.destroy(err, (err, data) => {
  19326. return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)
  19327. })
  19328. })
  19329. }
  19330. if (typeof callback !== 'function') {
  19331. throw new InvalidArgumentError('invalid callback')
  19332. }
  19333. if (this[kDestroyed]) {
  19334. if (this[kOnDestroyed]) {
  19335. this[kOnDestroyed].push(callback)
  19336. } else {
  19337. queueMicrotask(() => callback(null, null))
  19338. }
  19339. return
  19340. }
  19341. if (!err) {
  19342. err = new ClientDestroyedError()
  19343. }
  19344. this[kDestroyed] = true
  19345. this[kOnDestroyed] = this[kOnDestroyed] || []
  19346. this[kOnDestroyed].push(callback)
  19347. const onDestroyed = () => {
  19348. const callbacks = this[kOnDestroyed]
  19349. this[kOnDestroyed] = null
  19350. for (let i = 0; i < callbacks.length; i++) {
  19351. callbacks[i](null, null)
  19352. }
  19353. }
  19354. // Should not error.
  19355. this[kDestroy](err).then(() => {
  19356. queueMicrotask(onDestroyed)
  19357. })
  19358. }
  19359. [kInterceptedDispatch] (opts, handler) {
  19360. if (!this[kInterceptors] || this[kInterceptors].length === 0) {
  19361. this[kInterceptedDispatch] = this[kDispatch]
  19362. return this[kDispatch](opts, handler)
  19363. }
  19364. let dispatch = this[kDispatch].bind(this)
  19365. for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
  19366. dispatch = this[kInterceptors][i](dispatch)
  19367. }
  19368. this[kInterceptedDispatch] = dispatch
  19369. return dispatch(opts, handler)
  19370. }
  19371. dispatch (opts, handler) {
  19372. if (!handler || typeof handler !== 'object') {
  19373. throw new InvalidArgumentError('handler must be an object')
  19374. }
  19375. try {
  19376. if (!opts || typeof opts !== 'object') {
  19377. throw new InvalidArgumentError('opts must be an object.')
  19378. }
  19379. if (this[kDestroyed] || this[kOnDestroyed]) {
  19380. throw new ClientDestroyedError()
  19381. }
  19382. if (this[kClosed]) {
  19383. throw new ClientClosedError()
  19384. }
  19385. return this[kInterceptedDispatch](opts, handler)
  19386. } catch (err) {
  19387. if (typeof handler.onError !== 'function') {
  19388. throw new InvalidArgumentError('invalid onError method')
  19389. }
  19390. handler.onError(err)
  19391. return false
  19392. }
  19393. }
  19394. }
  19395. module.exports = DispatcherBase
  19396. /***/ }),
  19397. /***/ 412:
  19398. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19399. "use strict";
  19400. const EventEmitter = __nccwpck_require__(2361)
  19401. class Dispatcher extends EventEmitter {
  19402. dispatch () {
  19403. throw new Error('not implemented')
  19404. }
  19405. close () {
  19406. throw new Error('not implemented')
  19407. }
  19408. destroy () {
  19409. throw new Error('not implemented')
  19410. }
  19411. }
  19412. module.exports = Dispatcher
  19413. /***/ }),
  19414. /***/ 9990:
  19415. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19416. "use strict";
  19417. const Busboy = __nccwpck_require__(727)
  19418. const util = __nccwpck_require__(3983)
  19419. const {
  19420. ReadableStreamFrom,
  19421. isBlobLike,
  19422. isReadableStreamLike,
  19423. readableStreamClose,
  19424. createDeferredPromise,
  19425. fullyReadBody
  19426. } = __nccwpck_require__(2538)
  19427. const { FormData } = __nccwpck_require__(2015)
  19428. const { kState } = __nccwpck_require__(5861)
  19429. const { webidl } = __nccwpck_require__(1744)
  19430. const { DOMException, structuredClone } = __nccwpck_require__(1037)
  19431. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  19432. const { kBodyUsed } = __nccwpck_require__(2785)
  19433. const assert = __nccwpck_require__(9491)
  19434. const { isErrored } = __nccwpck_require__(3983)
  19435. const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
  19436. const { File: UndiciFile } = __nccwpck_require__(8511)
  19437. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  19438. let random
  19439. try {
  19440. const crypto = __nccwpck_require__(6005)
  19441. random = (max) => crypto.randomInt(0, max)
  19442. } catch {
  19443. random = (max) => Math.floor(Math.random(max))
  19444. }
  19445. let ReadableStream = globalThis.ReadableStream
  19446. /** @type {globalThis['File']} */
  19447. const File = NativeFile ?? UndiciFile
  19448. const textEncoder = new TextEncoder()
  19449. const textDecoder = new TextDecoder()
  19450. // https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  19451. function extractBody (object, keepalive = false) {
  19452. if (!ReadableStream) {
  19453. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19454. }
  19455. // 1. Let stream be null.
  19456. let stream = null
  19457. // 2. If object is a ReadableStream object, then set stream to object.
  19458. if (object instanceof ReadableStream) {
  19459. stream = object
  19460. } else if (isBlobLike(object)) {
  19461. // 3. Otherwise, if object is a Blob object, set stream to the
  19462. // result of running object’s get stream.
  19463. stream = object.stream()
  19464. } else {
  19465. // 4. Otherwise, set stream to a new ReadableStream object, and set
  19466. // up stream.
  19467. stream = new ReadableStream({
  19468. async pull (controller) {
  19469. controller.enqueue(
  19470. typeof source === 'string' ? textEncoder.encode(source) : source
  19471. )
  19472. queueMicrotask(() => readableStreamClose(controller))
  19473. },
  19474. start () {},
  19475. type: undefined
  19476. })
  19477. }
  19478. // 5. Assert: stream is a ReadableStream object.
  19479. assert(isReadableStreamLike(stream))
  19480. // 6. Let action be null.
  19481. let action = null
  19482. // 7. Let source be null.
  19483. let source = null
  19484. // 8. Let length be null.
  19485. let length = null
  19486. // 9. Let type be null.
  19487. let type = null
  19488. // 10. Switch on object:
  19489. if (typeof object === 'string') {
  19490. // Set source to the UTF-8 encoding of object.
  19491. // Note: setting source to a Uint8Array here breaks some mocking assumptions.
  19492. source = object
  19493. // Set type to `text/plain;charset=UTF-8`.
  19494. type = 'text/plain;charset=UTF-8'
  19495. } else if (object instanceof URLSearchParams) {
  19496. // URLSearchParams
  19497. // spec says to run application/x-www-form-urlencoded on body.list
  19498. // this is implemented in Node.js as apart of an URLSearchParams instance toString method
  19499. // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490
  19500. // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100
  19501. // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.
  19502. source = object.toString()
  19503. // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.
  19504. type = 'application/x-www-form-urlencoded;charset=UTF-8'
  19505. } else if (isArrayBuffer(object)) {
  19506. // BufferSource/ArrayBuffer
  19507. // Set source to a copy of the bytes held by object.
  19508. source = new Uint8Array(object.slice())
  19509. } else if (ArrayBuffer.isView(object)) {
  19510. // BufferSource/ArrayBufferView
  19511. // Set source to a copy of the bytes held by object.
  19512. source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
  19513. } else if (util.isFormDataLike(object)) {
  19514. const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
  19515. const prefix = `--${boundary}\r\nContent-Disposition: form-data`
  19516. /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
  19517. const escape = (str) =>
  19518. str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22')
  19519. const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n')
  19520. // Set action to this step: run the multipart/form-data
  19521. // encoding algorithm, with object’s entry list and UTF-8.
  19522. // - This ensures that the body is immutable and can't be changed afterwords
  19523. // - That the content-length is calculated in advance.
  19524. // - And that all parts are pre-encoded and ready to be sent.
  19525. const blobParts = []
  19526. const rn = new Uint8Array([13, 10]) // '\r\n'
  19527. length = 0
  19528. let hasUnknownSizeValue = false
  19529. for (const [name, value] of object) {
  19530. if (typeof value === 'string') {
  19531. const chunk = textEncoder.encode(prefix +
  19532. `; name="${escape(normalizeLinefeeds(name))}"` +
  19533. `\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
  19534. blobParts.push(chunk)
  19535. length += chunk.byteLength
  19536. } else {
  19537. const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` +
  19538. (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' +
  19539. `Content-Type: ${
  19540. value.type || 'application/octet-stream'
  19541. }\r\n\r\n`)
  19542. blobParts.push(chunk, value, rn)
  19543. if (typeof value.size === 'number') {
  19544. length += chunk.byteLength + value.size + rn.byteLength
  19545. } else {
  19546. hasUnknownSizeValue = true
  19547. }
  19548. }
  19549. }
  19550. const chunk = textEncoder.encode(`--${boundary}--`)
  19551. blobParts.push(chunk)
  19552. length += chunk.byteLength
  19553. if (hasUnknownSizeValue) {
  19554. length = null
  19555. }
  19556. // Set source to object.
  19557. source = object
  19558. action = async function * () {
  19559. for (const part of blobParts) {
  19560. if (part.stream) {
  19561. yield * part.stream()
  19562. } else {
  19563. yield part
  19564. }
  19565. }
  19566. }
  19567. // Set type to `multipart/form-data; boundary=`,
  19568. // followed by the multipart/form-data boundary string generated
  19569. // by the multipart/form-data encoding algorithm.
  19570. type = 'multipart/form-data; boundary=' + boundary
  19571. } else if (isBlobLike(object)) {
  19572. // Blob
  19573. // Set source to object.
  19574. source = object
  19575. // Set length to object’s size.
  19576. length = object.size
  19577. // If object’s type attribute is not the empty byte sequence, set
  19578. // type to its value.
  19579. if (object.type) {
  19580. type = object.type
  19581. }
  19582. } else if (typeof object[Symbol.asyncIterator] === 'function') {
  19583. // If keepalive is true, then throw a TypeError.
  19584. if (keepalive) {
  19585. throw new TypeError('keepalive')
  19586. }
  19587. // If object is disturbed or locked, then throw a TypeError.
  19588. if (util.isDisturbed(object) || object.locked) {
  19589. throw new TypeError(
  19590. 'Response body object should not be disturbed or locked'
  19591. )
  19592. }
  19593. stream =
  19594. object instanceof ReadableStream ? object : ReadableStreamFrom(object)
  19595. }
  19596. // 11. If source is a byte sequence, then set action to a
  19597. // step that returns source and length to source’s length.
  19598. if (typeof source === 'string' || util.isBuffer(source)) {
  19599. length = Buffer.byteLength(source)
  19600. }
  19601. // 12. If action is non-null, then run these steps in in parallel:
  19602. if (action != null) {
  19603. // Run action.
  19604. let iterator
  19605. stream = new ReadableStream({
  19606. async start () {
  19607. iterator = action(object)[Symbol.asyncIterator]()
  19608. },
  19609. async pull (controller) {
  19610. const { value, done } = await iterator.next()
  19611. if (done) {
  19612. // When running action is done, close stream.
  19613. queueMicrotask(() => {
  19614. controller.close()
  19615. })
  19616. } else {
  19617. // Whenever one or more bytes are available and stream is not errored,
  19618. // enqueue a Uint8Array wrapping an ArrayBuffer containing the available
  19619. // bytes into stream.
  19620. if (!isErrored(stream)) {
  19621. controller.enqueue(new Uint8Array(value))
  19622. }
  19623. }
  19624. return controller.desiredSize > 0
  19625. },
  19626. async cancel (reason) {
  19627. await iterator.return()
  19628. },
  19629. type: undefined
  19630. })
  19631. }
  19632. // 13. Let body be a body whose stream is stream, source is source,
  19633. // and length is length.
  19634. const body = { stream, source, length }
  19635. // 14. Return (body, type).
  19636. return [body, type]
  19637. }
  19638. // https://fetch.spec.whatwg.org/#bodyinit-safely-extract
  19639. function safelyExtractBody (object, keepalive = false) {
  19640. if (!ReadableStream) {
  19641. // istanbul ignore next
  19642. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19643. }
  19644. // To safely extract a body and a `Content-Type` value from
  19645. // a byte sequence or BodyInit object object, run these steps:
  19646. // 1. If object is a ReadableStream object, then:
  19647. if (object instanceof ReadableStream) {
  19648. // Assert: object is neither disturbed nor locked.
  19649. // istanbul ignore next
  19650. assert(!util.isDisturbed(object), 'The body has already been consumed.')
  19651. // istanbul ignore next
  19652. assert(!object.locked, 'The stream is locked.')
  19653. }
  19654. // 2. Return the results of extracting object.
  19655. return extractBody(object, keepalive)
  19656. }
  19657. function cloneBody (body) {
  19658. // To clone a body body, run these steps:
  19659. // https://fetch.spec.whatwg.org/#concept-body-clone
  19660. // 1. Let « out1, out2 » be the result of teeing body’s stream.
  19661. const [out1, out2] = body.stream.tee()
  19662. const out2Clone = structuredClone(out2, { transfer: [out2] })
  19663. // This, for whatever reasons, unrefs out2Clone which allows
  19664. // the process to exit by itself.
  19665. const [, finalClone] = out2Clone.tee()
  19666. // 2. Set body’s stream to out1.
  19667. body.stream = out1
  19668. // 3. Return a body whose stream is out2 and other members are copied from body.
  19669. return {
  19670. stream: finalClone,
  19671. length: body.length,
  19672. source: body.source
  19673. }
  19674. }
  19675. async function * consumeBody (body) {
  19676. if (body) {
  19677. if (isUint8Array(body)) {
  19678. yield body
  19679. } else {
  19680. const stream = body.stream
  19681. if (util.isDisturbed(stream)) {
  19682. throw new TypeError('The body has already been consumed.')
  19683. }
  19684. if (stream.locked) {
  19685. throw new TypeError('The stream is locked.')
  19686. }
  19687. // Compat.
  19688. stream[kBodyUsed] = true
  19689. yield * stream
  19690. }
  19691. }
  19692. }
  19693. function throwIfAborted (state) {
  19694. if (state.aborted) {
  19695. throw new DOMException('The operation was aborted.', 'AbortError')
  19696. }
  19697. }
  19698. function bodyMixinMethods (instance) {
  19699. const methods = {
  19700. blob () {
  19701. // The blob() method steps are to return the result of
  19702. // running consume body with this and the following step
  19703. // given a byte sequence bytes: return a Blob whose
  19704. // contents are bytes and whose type attribute is this’s
  19705. // MIME type.
  19706. return specConsumeBody(this, (bytes) => {
  19707. let mimeType = bodyMimeType(this)
  19708. if (mimeType === 'failure') {
  19709. mimeType = ''
  19710. } else if (mimeType) {
  19711. mimeType = serializeAMimeType(mimeType)
  19712. }
  19713. // Return a Blob whose contents are bytes and type attribute
  19714. // is mimeType.
  19715. return new Blob([bytes], { type: mimeType })
  19716. }, instance)
  19717. },
  19718. arrayBuffer () {
  19719. // The arrayBuffer() method steps are to return the result
  19720. // of running consume body with this and the following step
  19721. // given a byte sequence bytes: return a new ArrayBuffer
  19722. // whose contents are bytes.
  19723. return specConsumeBody(this, (bytes) => {
  19724. return new Uint8Array(bytes).buffer
  19725. }, instance)
  19726. },
  19727. text () {
  19728. // The text() method steps are to return the result of running
  19729. // consume body with this and UTF-8 decode.
  19730. return specConsumeBody(this, utf8DecodeBytes, instance)
  19731. },
  19732. json () {
  19733. // The json() method steps are to return the result of running
  19734. // consume body with this and parse JSON from bytes.
  19735. return specConsumeBody(this, parseJSONFromBytes, instance)
  19736. },
  19737. async formData () {
  19738. webidl.brandCheck(this, instance)
  19739. throwIfAborted(this[kState])
  19740. const contentType = this.headers.get('Content-Type')
  19741. // If mimeType’s essence is "multipart/form-data", then:
  19742. if (/multipart\/form-data/.test(contentType)) {
  19743. const headers = {}
  19744. for (const [key, value] of this.headers) headers[key.toLowerCase()] = value
  19745. const responseFormData = new FormData()
  19746. let busboy
  19747. try {
  19748. busboy = new Busboy({
  19749. headers,
  19750. preservePath: true
  19751. })
  19752. } catch (err) {
  19753. throw new DOMException(`${err}`, 'AbortError')
  19754. }
  19755. busboy.on('field', (name, value) => {
  19756. responseFormData.append(name, value)
  19757. })
  19758. busboy.on('file', (name, value, filename, encoding, mimeType) => {
  19759. const chunks = []
  19760. if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {
  19761. let base64chunk = ''
  19762. value.on('data', (chunk) => {
  19763. base64chunk += chunk.toString().replace(/[\r\n]/gm, '')
  19764. const end = base64chunk.length - base64chunk.length % 4
  19765. chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64'))
  19766. base64chunk = base64chunk.slice(end)
  19767. })
  19768. value.on('end', () => {
  19769. chunks.push(Buffer.from(base64chunk, 'base64'))
  19770. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19771. })
  19772. } else {
  19773. value.on('data', (chunk) => {
  19774. chunks.push(chunk)
  19775. })
  19776. value.on('end', () => {
  19777. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19778. })
  19779. }
  19780. })
  19781. const busboyResolve = new Promise((resolve, reject) => {
  19782. busboy.on('finish', resolve)
  19783. busboy.on('error', (err) => reject(new TypeError(err)))
  19784. })
  19785. if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk)
  19786. busboy.end()
  19787. await busboyResolve
  19788. return responseFormData
  19789. } else if (/application\/x-www-form-urlencoded/.test(contentType)) {
  19790. // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then:
  19791. // 1. Let entries be the result of parsing bytes.
  19792. let entries
  19793. try {
  19794. let text = ''
  19795. // application/x-www-form-urlencoded parser will keep the BOM.
  19796. // https://url.spec.whatwg.org/#concept-urlencoded-parser
  19797. // Note that streaming decoder is stateful and cannot be reused
  19798. const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
  19799. for await (const chunk of consumeBody(this[kState].body)) {
  19800. if (!isUint8Array(chunk)) {
  19801. throw new TypeError('Expected Uint8Array chunk')
  19802. }
  19803. text += streamingDecoder.decode(chunk, { stream: true })
  19804. }
  19805. text += streamingDecoder.decode()
  19806. entries = new URLSearchParams(text)
  19807. } catch (err) {
  19808. // istanbul ignore next: Unclear when new URLSearchParams can fail on a string.
  19809. // 2. If entries is failure, then throw a TypeError.
  19810. throw Object.assign(new TypeError(), { cause: err })
  19811. }
  19812. // 3. Return a new FormData object whose entries are entries.
  19813. const formData = new FormData()
  19814. for (const [name, value] of entries) {
  19815. formData.append(name, value)
  19816. }
  19817. return formData
  19818. } else {
  19819. // Wait a tick before checking if the request has been aborted.
  19820. // Otherwise, a TypeError can be thrown when an AbortError should.
  19821. await Promise.resolve()
  19822. throwIfAborted(this[kState])
  19823. // Otherwise, throw a TypeError.
  19824. throw webidl.errors.exception({
  19825. header: `${instance.name}.formData`,
  19826. message: 'Could not parse content as FormData.'
  19827. })
  19828. }
  19829. }
  19830. }
  19831. return methods
  19832. }
  19833. function mixinBody (prototype) {
  19834. Object.assign(prototype.prototype, bodyMixinMethods(prototype))
  19835. }
  19836. /**
  19837. * @see https://fetch.spec.whatwg.org/#concept-body-consume-body
  19838. * @param {Response|Request} object
  19839. * @param {(value: unknown) => unknown} convertBytesToJSValue
  19840. * @param {Response|Request} instance
  19841. */
  19842. async function specConsumeBody (object, convertBytesToJSValue, instance) {
  19843. webidl.brandCheck(object, instance)
  19844. throwIfAborted(object[kState])
  19845. // 1. If object is unusable, then return a promise rejected
  19846. // with a TypeError.
  19847. if (bodyUnusable(object[kState].body)) {
  19848. throw new TypeError('Body is unusable')
  19849. }
  19850. // 2. Let promise be a new promise.
  19851. const promise = createDeferredPromise()
  19852. // 3. Let errorSteps given error be to reject promise with error.
  19853. const errorSteps = (error) => promise.reject(error)
  19854. // 4. Let successSteps given a byte sequence data be to resolve
  19855. // promise with the result of running convertBytesToJSValue
  19856. // with data. If that threw an exception, then run errorSteps
  19857. // with that exception.
  19858. const successSteps = (data) => {
  19859. try {
  19860. promise.resolve(convertBytesToJSValue(data))
  19861. } catch (e) {
  19862. errorSteps(e)
  19863. }
  19864. }
  19865. // 5. If object’s body is null, then run successSteps with an
  19866. // empty byte sequence.
  19867. if (object[kState].body == null) {
  19868. successSteps(new Uint8Array())
  19869. return promise.promise
  19870. }
  19871. // 6. Otherwise, fully read object’s body given successSteps,
  19872. // errorSteps, and object’s relevant global object.
  19873. await fullyReadBody(object[kState].body, successSteps, errorSteps)
  19874. // 7. Return promise.
  19875. return promise.promise
  19876. }
  19877. // https://fetch.spec.whatwg.org/#body-unusable
  19878. function bodyUnusable (body) {
  19879. // An object including the Body interface mixin is
  19880. // said to be unusable if its body is non-null and
  19881. // its body’s stream is disturbed or locked.
  19882. return body != null && (body.stream.locked || util.isDisturbed(body.stream))
  19883. }
  19884. /**
  19885. * @see https://encoding.spec.whatwg.org/#utf-8-decode
  19886. * @param {Buffer} buffer
  19887. */
  19888. function utf8DecodeBytes (buffer) {
  19889. if (buffer.length === 0) {
  19890. return ''
  19891. }
  19892. // 1. Let buffer be the result of peeking three bytes from
  19893. // ioQueue, converted to a byte sequence.
  19894. // 2. If buffer is 0xEF 0xBB 0xBF, then read three
  19895. // bytes from ioQueue. (Do nothing with those bytes.)
  19896. if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
  19897. buffer = buffer.subarray(3)
  19898. }
  19899. // 3. Process a queue with an instance of UTF-8’s
  19900. // decoder, ioQueue, output, and "replacement".
  19901. const output = textDecoder.decode(buffer)
  19902. // 4. Return output.
  19903. return output
  19904. }
  19905. /**
  19906. * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value
  19907. * @param {Uint8Array} bytes
  19908. */
  19909. function parseJSONFromBytes (bytes) {
  19910. return JSON.parse(utf8DecodeBytes(bytes))
  19911. }
  19912. /**
  19913. * @see https://fetch.spec.whatwg.org/#concept-body-mime-type
  19914. * @param {import('./response').Response|import('./request').Request} object
  19915. */
  19916. function bodyMimeType (object) {
  19917. const { headersList } = object[kState]
  19918. const contentType = headersList.get('content-type')
  19919. if (contentType === null) {
  19920. return 'failure'
  19921. }
  19922. return parseMIMEType(contentType)
  19923. }
  19924. module.exports = {
  19925. extractBody,
  19926. safelyExtractBody,
  19927. cloneBody,
  19928. mixinBody
  19929. }
  19930. /***/ }),
  19931. /***/ 1037:
  19932. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19933. "use strict";
  19934. const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267)
  19935. const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
  19936. const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
  19937. const nullBodyStatus = [101, 204, 205, 304]
  19938. const redirectStatus = [301, 302, 303, 307, 308]
  19939. const redirectStatusSet = new Set(redirectStatus)
  19940. // https://fetch.spec.whatwg.org/#block-bad-port
  19941. const badPorts = [
  19942. '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',
  19943. '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',
  19944. '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',
  19945. '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',
  19946. '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697',
  19947. '10080'
  19948. ]
  19949. const badPortsSet = new Set(badPorts)
  19950. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
  19951. const referrerPolicy = [
  19952. '',
  19953. 'no-referrer',
  19954. 'no-referrer-when-downgrade',
  19955. 'same-origin',
  19956. 'origin',
  19957. 'strict-origin',
  19958. 'origin-when-cross-origin',
  19959. 'strict-origin-when-cross-origin',
  19960. 'unsafe-url'
  19961. ]
  19962. const referrerPolicySet = new Set(referrerPolicy)
  19963. const requestRedirect = ['follow', 'manual', 'error']
  19964. const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19965. const safeMethodsSet = new Set(safeMethods)
  19966. const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
  19967. const requestCredentials = ['omit', 'same-origin', 'include']
  19968. const requestCache = [
  19969. 'default',
  19970. 'no-store',
  19971. 'reload',
  19972. 'no-cache',
  19973. 'force-cache',
  19974. 'only-if-cached'
  19975. ]
  19976. // https://fetch.spec.whatwg.org/#request-body-header-name
  19977. const requestBodyHeader = [
  19978. 'content-encoding',
  19979. 'content-language',
  19980. 'content-location',
  19981. 'content-type',
  19982. // See https://github.com/nodejs/undici/issues/2021
  19983. // 'Content-Length' is a forbidden header name, which is typically
  19984. // removed in the Headers implementation. However, undici doesn't
  19985. // filter out headers, so we add it here.
  19986. 'content-length'
  19987. ]
  19988. // https://fetch.spec.whatwg.org/#enumdef-requestduplex
  19989. const requestDuplex = [
  19990. 'half'
  19991. ]
  19992. // http://fetch.spec.whatwg.org/#forbidden-method
  19993. const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
  19994. const forbiddenMethodsSet = new Set(forbiddenMethods)
  19995. const subresource = [
  19996. 'audio',
  19997. 'audioworklet',
  19998. 'font',
  19999. 'image',
  20000. 'manifest',
  20001. 'paintworklet',
  20002. 'script',
  20003. 'style',
  20004. 'track',
  20005. 'video',
  20006. 'xslt',
  20007. ''
  20008. ]
  20009. const subresourceSet = new Set(subresource)
  20010. /** @type {globalThis['DOMException']} */
  20011. const DOMException = globalThis.DOMException ?? (() => {
  20012. // DOMException was only made a global in Node v17.0.0,
  20013. // but fetch supports >= v16.8.
  20014. try {
  20015. atob('~')
  20016. } catch (err) {
  20017. return Object.getPrototypeOf(err).constructor
  20018. }
  20019. })()
  20020. let channel
  20021. /** @type {globalThis['structuredClone']} */
  20022. const structuredClone =
  20023. globalThis.structuredClone ??
  20024. // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js
  20025. // structuredClone was added in v17.0.0, but fetch supports v16.8
  20026. function structuredClone (value, options = undefined) {
  20027. if (arguments.length === 0) {
  20028. throw new TypeError('missing argument')
  20029. }
  20030. if (!channel) {
  20031. channel = new MessageChannel()
  20032. }
  20033. channel.port1.unref()
  20034. channel.port2.unref()
  20035. channel.port1.postMessage(value, options?.transfer)
  20036. return receiveMessageOnPort(channel.port2).message
  20037. }
  20038. module.exports = {
  20039. DOMException,
  20040. structuredClone,
  20041. subresource,
  20042. forbiddenMethods,
  20043. requestBodyHeader,
  20044. referrerPolicy,
  20045. requestRedirect,
  20046. requestMode,
  20047. requestCredentials,
  20048. requestCache,
  20049. redirectStatus,
  20050. corsSafeListedMethods,
  20051. nullBodyStatus,
  20052. safeMethods,
  20053. badPorts,
  20054. requestDuplex,
  20055. subresourceSet,
  20056. badPortsSet,
  20057. redirectStatusSet,
  20058. corsSafeListedMethodsSet,
  20059. safeMethodsSet,
  20060. forbiddenMethodsSet,
  20061. referrerPolicySet
  20062. }
  20063. /***/ }),
  20064. /***/ 685:
  20065. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20066. const assert = __nccwpck_require__(9491)
  20067. const { atob } = __nccwpck_require__(4300)
  20068. const { isomorphicDecode } = __nccwpck_require__(2538)
  20069. const encoder = new TextEncoder()
  20070. /**
  20071. * @see https://mimesniff.spec.whatwg.org/#http-token-code-point
  20072. */
  20073. const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/
  20074. const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line
  20075. /**
  20076. * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point
  20077. */
  20078. const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line
  20079. // https://fetch.spec.whatwg.org/#data-url-processor
  20080. /** @param {URL} dataURL */
  20081. function dataURLProcessor (dataURL) {
  20082. // 1. Assert: dataURL’s scheme is "data".
  20083. assert(dataURL.protocol === 'data:')
  20084. // 2. Let input be the result of running the URL
  20085. // serializer on dataURL with exclude fragment
  20086. // set to true.
  20087. let input = URLSerializer(dataURL, true)
  20088. // 3. Remove the leading "data:" string from input.
  20089. input = input.slice(5)
  20090. // 4. Let position point at the start of input.
  20091. const position = { position: 0 }
  20092. // 5. Let mimeType be the result of collecting a
  20093. // sequence of code points that are not equal
  20094. // to U+002C (,), given position.
  20095. let mimeType = collectASequenceOfCodePointsFast(
  20096. ',',
  20097. input,
  20098. position
  20099. )
  20100. // 6. Strip leading and trailing ASCII whitespace
  20101. // from mimeType.
  20102. // Undici implementation note: we need to store the
  20103. // length because if the mimetype has spaces removed,
  20104. // the wrong amount will be sliced from the input in
  20105. // step #9
  20106. const mimeTypeLength = mimeType.length
  20107. mimeType = removeASCIIWhitespace(mimeType, true, true)
  20108. // 7. If position is past the end of input, then
  20109. // return failure
  20110. if (position.position >= input.length) {
  20111. return 'failure'
  20112. }
  20113. // 8. Advance position by 1.
  20114. position.position++
  20115. // 9. Let encodedBody be the remainder of input.
  20116. const encodedBody = input.slice(mimeTypeLength + 1)
  20117. // 10. Let body be the percent-decoding of encodedBody.
  20118. let body = stringPercentDecode(encodedBody)
  20119. // 11. If mimeType ends with U+003B (;), followed by
  20120. // zero or more U+0020 SPACE, followed by an ASCII
  20121. // case-insensitive match for "base64", then:
  20122. if (/;(\u0020){0,}base64$/i.test(mimeType)) {
  20123. // 1. Let stringBody be the isomorphic decode of body.
  20124. const stringBody = isomorphicDecode(body)
  20125. // 2. Set body to the forgiving-base64 decode of
  20126. // stringBody.
  20127. body = forgivingBase64(stringBody)
  20128. // 3. If body is failure, then return failure.
  20129. if (body === 'failure') {
  20130. return 'failure'
  20131. }
  20132. // 4. Remove the last 6 code points from mimeType.
  20133. mimeType = mimeType.slice(0, -6)
  20134. // 5. Remove trailing U+0020 SPACE code points from mimeType,
  20135. // if any.
  20136. mimeType = mimeType.replace(/(\u0020)+$/, '')
  20137. // 6. Remove the last U+003B (;) code point from mimeType.
  20138. mimeType = mimeType.slice(0, -1)
  20139. }
  20140. // 12. If mimeType starts with U+003B (;), then prepend
  20141. // "text/plain" to mimeType.
  20142. if (mimeType.startsWith(';')) {
  20143. mimeType = 'text/plain' + mimeType
  20144. }
  20145. // 13. Let mimeTypeRecord be the result of parsing
  20146. // mimeType.
  20147. let mimeTypeRecord = parseMIMEType(mimeType)
  20148. // 14. If mimeTypeRecord is failure, then set
  20149. // mimeTypeRecord to text/plain;charset=US-ASCII.
  20150. if (mimeTypeRecord === 'failure') {
  20151. mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')
  20152. }
  20153. // 15. Return a new data: URL struct whose MIME
  20154. // type is mimeTypeRecord and body is body.
  20155. // https://fetch.spec.whatwg.org/#data-url-struct
  20156. return { mimeType: mimeTypeRecord, body }
  20157. }
  20158. // https://url.spec.whatwg.org/#concept-url-serializer
  20159. /**
  20160. * @param {URL} url
  20161. * @param {boolean} excludeFragment
  20162. */
  20163. function URLSerializer (url, excludeFragment = false) {
  20164. if (!excludeFragment) {
  20165. return url.href
  20166. }
  20167. const href = url.href
  20168. const hashLength = url.hash.length
  20169. return hashLength === 0 ? href : href.substring(0, href.length - hashLength)
  20170. }
  20171. // https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points
  20172. /**
  20173. * @param {(char: string) => boolean} condition
  20174. * @param {string} input
  20175. * @param {{ position: number }} position
  20176. */
  20177. function collectASequenceOfCodePoints (condition, input, position) {
  20178. // 1. Let result be the empty string.
  20179. let result = ''
  20180. // 2. While position doesn’t point past the end of input and the
  20181. // code point at position within input meets the condition condition:
  20182. while (position.position < input.length && condition(input[position.position])) {
  20183. // 1. Append that code point to the end of result.
  20184. result += input[position.position]
  20185. // 2. Advance position by 1.
  20186. position.position++
  20187. }
  20188. // 3. Return result.
  20189. return result
  20190. }
  20191. /**
  20192. * A faster collectASequenceOfCodePoints that only works when comparing a single character.
  20193. * @param {string} char
  20194. * @param {string} input
  20195. * @param {{ position: number }} position
  20196. */
  20197. function collectASequenceOfCodePointsFast (char, input, position) {
  20198. const idx = input.indexOf(char, position.position)
  20199. const start = position.position
  20200. if (idx === -1) {
  20201. position.position = input.length
  20202. return input.slice(start)
  20203. }
  20204. position.position = idx
  20205. return input.slice(start, position.position)
  20206. }
  20207. // https://url.spec.whatwg.org/#string-percent-decode
  20208. /** @param {string} input */
  20209. function stringPercentDecode (input) {
  20210. // 1. Let bytes be the UTF-8 encoding of input.
  20211. const bytes = encoder.encode(input)
  20212. // 2. Return the percent-decoding of bytes.
  20213. return percentDecode(bytes)
  20214. }
  20215. // https://url.spec.whatwg.org/#percent-decode
  20216. /** @param {Uint8Array} input */
  20217. function percentDecode (input) {
  20218. // 1. Let output be an empty byte sequence.
  20219. /** @type {number[]} */
  20220. const output = []
  20221. // 2. For each byte byte in input:
  20222. for (let i = 0; i < input.length; i++) {
  20223. const byte = input[i]
  20224. // 1. If byte is not 0x25 (%), then append byte to output.
  20225. if (byte !== 0x25) {
  20226. output.push(byte)
  20227. // 2. Otherwise, if byte is 0x25 (%) and the next two bytes
  20228. // after byte in input are not in the ranges
  20229. // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),
  20230. // and 0x61 (a) to 0x66 (f), all inclusive, append byte
  20231. // to output.
  20232. } else if (
  20233. byte === 0x25 &&
  20234. !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))
  20235. ) {
  20236. output.push(0x25)
  20237. // 3. Otherwise:
  20238. } else {
  20239. // 1. Let bytePoint be the two bytes after byte in input,
  20240. // decoded, and then interpreted as hexadecimal number.
  20241. const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2])
  20242. const bytePoint = Number.parseInt(nextTwoBytes, 16)
  20243. // 2. Append a byte whose value is bytePoint to output.
  20244. output.push(bytePoint)
  20245. // 3. Skip the next two bytes in input.
  20246. i += 2
  20247. }
  20248. }
  20249. // 3. Return output.
  20250. return Uint8Array.from(output)
  20251. }
  20252. // https://mimesniff.spec.whatwg.org/#parse-a-mime-type
  20253. /** @param {string} input */
  20254. function parseMIMEType (input) {
  20255. // 1. Remove any leading and trailing HTTP whitespace
  20256. // from input.
  20257. input = removeHTTPWhitespace(input, true, true)
  20258. // 2. Let position be a position variable for input,
  20259. // initially pointing at the start of input.
  20260. const position = { position: 0 }
  20261. // 3. Let type be the result of collecting a sequence
  20262. // of code points that are not U+002F (/) from
  20263. // input, given position.
  20264. const type = collectASequenceOfCodePointsFast(
  20265. '/',
  20266. input,
  20267. position
  20268. )
  20269. // 4. If type is the empty string or does not solely
  20270. // contain HTTP token code points, then return failure.
  20271. // https://mimesniff.spec.whatwg.org/#http-token-code-point
  20272. if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {
  20273. return 'failure'
  20274. }
  20275. // 5. If position is past the end of input, then return
  20276. // failure
  20277. if (position.position > input.length) {
  20278. return 'failure'
  20279. }
  20280. // 6. Advance position by 1. (This skips past U+002F (/).)
  20281. position.position++
  20282. // 7. Let subtype be the result of collecting a sequence of
  20283. // code points that are not U+003B (;) from input, given
  20284. // position.
  20285. let subtype = collectASequenceOfCodePointsFast(
  20286. ';',
  20287. input,
  20288. position
  20289. )
  20290. // 8. Remove any trailing HTTP whitespace from subtype.
  20291. subtype = removeHTTPWhitespace(subtype, false, true)
  20292. // 9. If subtype is the empty string or does not solely
  20293. // contain HTTP token code points, then return failure.
  20294. if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {
  20295. return 'failure'
  20296. }
  20297. const typeLowercase = type.toLowerCase()
  20298. const subtypeLowercase = subtype.toLowerCase()
  20299. // 10. Let mimeType be a new MIME type record whose type
  20300. // is type, in ASCII lowercase, and subtype is subtype,
  20301. // in ASCII lowercase.
  20302. // https://mimesniff.spec.whatwg.org/#mime-type
  20303. const mimeType = {
  20304. type: typeLowercase,
  20305. subtype: subtypeLowercase,
  20306. /** @type {Map<string, string>} */
  20307. parameters: new Map(),
  20308. // https://mimesniff.spec.whatwg.org/#mime-type-essence
  20309. essence: `${typeLowercase}/${subtypeLowercase}`
  20310. }
  20311. // 11. While position is not past the end of input:
  20312. while (position.position < input.length) {
  20313. // 1. Advance position by 1. (This skips past U+003B (;).)
  20314. position.position++
  20315. // 2. Collect a sequence of code points that are HTTP
  20316. // whitespace from input given position.
  20317. collectASequenceOfCodePoints(
  20318. // https://fetch.spec.whatwg.org/#http-whitespace
  20319. char => HTTP_WHITESPACE_REGEX.test(char),
  20320. input,
  20321. position
  20322. )
  20323. // 3. Let parameterName be the result of collecting a
  20324. // sequence of code points that are not U+003B (;)
  20325. // or U+003D (=) from input, given position.
  20326. let parameterName = collectASequenceOfCodePoints(
  20327. (char) => char !== ';' && char !== '=',
  20328. input,
  20329. position
  20330. )
  20331. // 4. Set parameterName to parameterName, in ASCII
  20332. // lowercase.
  20333. parameterName = parameterName.toLowerCase()
  20334. // 5. If position is not past the end of input, then:
  20335. if (position.position < input.length) {
  20336. // 1. If the code point at position within input is
  20337. // U+003B (;), then continue.
  20338. if (input[position.position] === ';') {
  20339. continue
  20340. }
  20341. // 2. Advance position by 1. (This skips past U+003D (=).)
  20342. position.position++
  20343. }
  20344. // 6. If position is past the end of input, then break.
  20345. if (position.position > input.length) {
  20346. break
  20347. }
  20348. // 7. Let parameterValue be null.
  20349. let parameterValue = null
  20350. // 8. If the code point at position within input is
  20351. // U+0022 ("), then:
  20352. if (input[position.position] === '"') {
  20353. // 1. Set parameterValue to the result of collecting
  20354. // an HTTP quoted string from input, given position
  20355. // and the extract-value flag.
  20356. parameterValue = collectAnHTTPQuotedString(input, position, true)
  20357. // 2. Collect a sequence of code points that are not
  20358. // U+003B (;) from input, given position.
  20359. collectASequenceOfCodePointsFast(
  20360. ';',
  20361. input,
  20362. position
  20363. )
  20364. // 9. Otherwise:
  20365. } else {
  20366. // 1. Set parameterValue to the result of collecting
  20367. // a sequence of code points that are not U+003B (;)
  20368. // from input, given position.
  20369. parameterValue = collectASequenceOfCodePointsFast(
  20370. ';',
  20371. input,
  20372. position
  20373. )
  20374. // 2. Remove any trailing HTTP whitespace from parameterValue.
  20375. parameterValue = removeHTTPWhitespace(parameterValue, false, true)
  20376. // 3. If parameterValue is the empty string, then continue.
  20377. if (parameterValue.length === 0) {
  20378. continue
  20379. }
  20380. }
  20381. // 10. If all of the following are true
  20382. // - parameterName is not the empty string
  20383. // - parameterName solely contains HTTP token code points
  20384. // - parameterValue solely contains HTTP quoted-string token code points
  20385. // - mimeType’s parameters[parameterName] does not exist
  20386. // then set mimeType’s parameters[parameterName] to parameterValue.
  20387. if (
  20388. parameterName.length !== 0 &&
  20389. HTTP_TOKEN_CODEPOINTS.test(parameterName) &&
  20390. (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&
  20391. !mimeType.parameters.has(parameterName)
  20392. ) {
  20393. mimeType.parameters.set(parameterName, parameterValue)
  20394. }
  20395. }
  20396. // 12. Return mimeType.
  20397. return mimeType
  20398. }
  20399. // https://infra.spec.whatwg.org/#forgiving-base64-decode
  20400. /** @param {string} data */
  20401. function forgivingBase64 (data) {
  20402. // 1. Remove all ASCII whitespace from data.
  20403. data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line
  20404. // 2. If data’s code point length divides by 4 leaving
  20405. // no remainder, then:
  20406. if (data.length % 4 === 0) {
  20407. // 1. If data ends with one or two U+003D (=) code points,
  20408. // then remove them from data.
  20409. data = data.replace(/=?=$/, '')
  20410. }
  20411. // 3. If data’s code point length divides by 4 leaving
  20412. // a remainder of 1, then return failure.
  20413. if (data.length % 4 === 1) {
  20414. return 'failure'
  20415. }
  20416. // 4. If data contains a code point that is not one of
  20417. // U+002B (+)
  20418. // U+002F (/)
  20419. // ASCII alphanumeric
  20420. // then return failure.
  20421. if (/[^+/0-9A-Za-z]/.test(data)) {
  20422. return 'failure'
  20423. }
  20424. const binary = atob(data)
  20425. const bytes = new Uint8Array(binary.length)
  20426. for (let byte = 0; byte < binary.length; byte++) {
  20427. bytes[byte] = binary.charCodeAt(byte)
  20428. }
  20429. return bytes
  20430. }
  20431. // https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
  20432. // tests: https://fetch.spec.whatwg.org/#example-http-quoted-string
  20433. /**
  20434. * @param {string} input
  20435. * @param {{ position: number }} position
  20436. * @param {boolean?} extractValue
  20437. */
  20438. function collectAnHTTPQuotedString (input, position, extractValue) {
  20439. // 1. Let positionStart be position.
  20440. const positionStart = position.position
  20441. // 2. Let value be the empty string.
  20442. let value = ''
  20443. // 3. Assert: the code point at position within input
  20444. // is U+0022 (").
  20445. assert(input[position.position] === '"')
  20446. // 4. Advance position by 1.
  20447. position.position++
  20448. // 5. While true:
  20449. while (true) {
  20450. // 1. Append the result of collecting a sequence of code points
  20451. // that are not U+0022 (") or U+005C (\) from input, given
  20452. // position, to value.
  20453. value += collectASequenceOfCodePoints(
  20454. (char) => char !== '"' && char !== '\\',
  20455. input,
  20456. position
  20457. )
  20458. // 2. If position is past the end of input, then break.
  20459. if (position.position >= input.length) {
  20460. break
  20461. }
  20462. // 3. Let quoteOrBackslash be the code point at position within
  20463. // input.
  20464. const quoteOrBackslash = input[position.position]
  20465. // 4. Advance position by 1.
  20466. position.position++
  20467. // 5. If quoteOrBackslash is U+005C (\), then:
  20468. if (quoteOrBackslash === '\\') {
  20469. // 1. If position is past the end of input, then append
  20470. // U+005C (\) to value and break.
  20471. if (position.position >= input.length) {
  20472. value += '\\'
  20473. break
  20474. }
  20475. // 2. Append the code point at position within input to value.
  20476. value += input[position.position]
  20477. // 3. Advance position by 1.
  20478. position.position++
  20479. // 6. Otherwise:
  20480. } else {
  20481. // 1. Assert: quoteOrBackslash is U+0022 (").
  20482. assert(quoteOrBackslash === '"')
  20483. // 2. Break.
  20484. break
  20485. }
  20486. }
  20487. // 6. If the extract-value flag is set, then return value.
  20488. if (extractValue) {
  20489. return value
  20490. }
  20491. // 7. Return the code points from positionStart to position,
  20492. // inclusive, within input.
  20493. return input.slice(positionStart, position.position)
  20494. }
  20495. /**
  20496. * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
  20497. */
  20498. function serializeAMimeType (mimeType) {
  20499. assert(mimeType !== 'failure')
  20500. const { parameters, essence } = mimeType
  20501. // 1. Let serialization be the concatenation of mimeType’s
  20502. // type, U+002F (/), and mimeType’s subtype.
  20503. let serialization = essence
  20504. // 2. For each name → value of mimeType’s parameters:
  20505. for (let [name, value] of parameters.entries()) {
  20506. // 1. Append U+003B (;) to serialization.
  20507. serialization += ';'
  20508. // 2. Append name to serialization.
  20509. serialization += name
  20510. // 3. Append U+003D (=) to serialization.
  20511. serialization += '='
  20512. // 4. If value does not solely contain HTTP token code
  20513. // points or value is the empty string, then:
  20514. if (!HTTP_TOKEN_CODEPOINTS.test(value)) {
  20515. // 1. Precede each occurence of U+0022 (") or
  20516. // U+005C (\) in value with U+005C (\).
  20517. value = value.replace(/(\\|")/g, '\\$1')
  20518. // 2. Prepend U+0022 (") to value.
  20519. value = '"' + value
  20520. // 3. Append U+0022 (") to value.
  20521. value += '"'
  20522. }
  20523. // 5. Append value to serialization.
  20524. serialization += value
  20525. }
  20526. // 3. Return serialization.
  20527. return serialization
  20528. }
  20529. /**
  20530. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20531. * @param {string} char
  20532. */
  20533. function isHTTPWhiteSpace (char) {
  20534. return char === '\r' || char === '\n' || char === '\t' || char === ' '
  20535. }
  20536. /**
  20537. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20538. * @param {string} str
  20539. */
  20540. function removeHTTPWhitespace (str, leading = true, trailing = true) {
  20541. let lead = 0
  20542. let trail = str.length - 1
  20543. if (leading) {
  20544. for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++);
  20545. }
  20546. if (trailing) {
  20547. for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--);
  20548. }
  20549. return str.slice(lead, trail + 1)
  20550. }
  20551. /**
  20552. * @see https://infra.spec.whatwg.org/#ascii-whitespace
  20553. * @param {string} char
  20554. */
  20555. function isASCIIWhitespace (char) {
  20556. return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' '
  20557. }
  20558. /**
  20559. * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace
  20560. */
  20561. function removeASCIIWhitespace (str, leading = true, trailing = true) {
  20562. let lead = 0
  20563. let trail = str.length - 1
  20564. if (leading) {
  20565. for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++);
  20566. }
  20567. if (trailing) {
  20568. for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--);
  20569. }
  20570. return str.slice(lead, trail + 1)
  20571. }
  20572. module.exports = {
  20573. dataURLProcessor,
  20574. URLSerializer,
  20575. collectASequenceOfCodePoints,
  20576. collectASequenceOfCodePointsFast,
  20577. stringPercentDecode,
  20578. parseMIMEType,
  20579. collectAnHTTPQuotedString,
  20580. serializeAMimeType
  20581. }
  20582. /***/ }),
  20583. /***/ 8511:
  20584. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20585. "use strict";
  20586. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20587. const { types } = __nccwpck_require__(3837)
  20588. const { kState } = __nccwpck_require__(5861)
  20589. const { isBlobLike } = __nccwpck_require__(2538)
  20590. const { webidl } = __nccwpck_require__(1744)
  20591. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  20592. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20593. const encoder = new TextEncoder()
  20594. class File extends Blob {
  20595. constructor (fileBits, fileName, options = {}) {
  20596. // The File constructor is invoked with two or three parameters, depending
  20597. // on whether the optional dictionary parameter is used. When the File()
  20598. // constructor is invoked, user agents must run the following steps:
  20599. webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' })
  20600. fileBits = webidl.converters['sequence<BlobPart>'](fileBits)
  20601. fileName = webidl.converters.USVString(fileName)
  20602. options = webidl.converters.FilePropertyBag(options)
  20603. // 1. Let bytes be the result of processing blob parts given fileBits and
  20604. // options.
  20605. // Note: Blob handles this for us
  20606. // 2. Let n be the fileName argument to the constructor.
  20607. const n = fileName
  20608. // 3. Process FilePropertyBag dictionary argument by running the following
  20609. // substeps:
  20610. // 1. If the type member is provided and is not the empty string, let t
  20611. // be set to the type dictionary member. If t contains any characters
  20612. // outside the range U+0020 to U+007E, then set t to the empty string
  20613. // and return from these substeps.
  20614. // 2. Convert every character in t to ASCII lowercase.
  20615. let t = options.type
  20616. let d
  20617. // eslint-disable-next-line no-labels
  20618. substep: {
  20619. if (t) {
  20620. t = parseMIMEType(t)
  20621. if (t === 'failure') {
  20622. t = ''
  20623. // eslint-disable-next-line no-labels
  20624. break substep
  20625. }
  20626. t = serializeAMimeType(t).toLowerCase()
  20627. }
  20628. // 3. If the lastModified member is provided, let d be set to the
  20629. // lastModified dictionary member. If it is not provided, set d to the
  20630. // current date and time represented as the number of milliseconds since
  20631. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20632. d = options.lastModified
  20633. }
  20634. // 4. Return a new File object F such that:
  20635. // F refers to the bytes byte sequence.
  20636. // F.size is set to the number of total bytes in bytes.
  20637. // F.name is set to n.
  20638. // F.type is set to t.
  20639. // F.lastModified is set to d.
  20640. super(processBlobParts(fileBits, options), { type: t })
  20641. this[kState] = {
  20642. name: n,
  20643. lastModified: d,
  20644. type: t
  20645. }
  20646. }
  20647. get name () {
  20648. webidl.brandCheck(this, File)
  20649. return this[kState].name
  20650. }
  20651. get lastModified () {
  20652. webidl.brandCheck(this, File)
  20653. return this[kState].lastModified
  20654. }
  20655. get type () {
  20656. webidl.brandCheck(this, File)
  20657. return this[kState].type
  20658. }
  20659. }
  20660. class FileLike {
  20661. constructor (blobLike, fileName, options = {}) {
  20662. // TODO: argument idl type check
  20663. // The File constructor is invoked with two or three parameters, depending
  20664. // on whether the optional dictionary parameter is used. When the File()
  20665. // constructor is invoked, user agents must run the following steps:
  20666. // 1. Let bytes be the result of processing blob parts given fileBits and
  20667. // options.
  20668. // 2. Let n be the fileName argument to the constructor.
  20669. const n = fileName
  20670. // 3. Process FilePropertyBag dictionary argument by running the following
  20671. // substeps:
  20672. // 1. If the type member is provided and is not the empty string, let t
  20673. // be set to the type dictionary member. If t contains any characters
  20674. // outside the range U+0020 to U+007E, then set t to the empty string
  20675. // and return from these substeps.
  20676. // TODO
  20677. const t = options.type
  20678. // 2. Convert every character in t to ASCII lowercase.
  20679. // TODO
  20680. // 3. If the lastModified member is provided, let d be set to the
  20681. // lastModified dictionary member. If it is not provided, set d to the
  20682. // current date and time represented as the number of milliseconds since
  20683. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20684. const d = options.lastModified ?? Date.now()
  20685. // 4. Return a new File object F such that:
  20686. // F refers to the bytes byte sequence.
  20687. // F.size is set to the number of total bytes in bytes.
  20688. // F.name is set to n.
  20689. // F.type is set to t.
  20690. // F.lastModified is set to d.
  20691. this[kState] = {
  20692. blobLike,
  20693. name: n,
  20694. type: t,
  20695. lastModified: d
  20696. }
  20697. }
  20698. stream (...args) {
  20699. webidl.brandCheck(this, FileLike)
  20700. return this[kState].blobLike.stream(...args)
  20701. }
  20702. arrayBuffer (...args) {
  20703. webidl.brandCheck(this, FileLike)
  20704. return this[kState].blobLike.arrayBuffer(...args)
  20705. }
  20706. slice (...args) {
  20707. webidl.brandCheck(this, FileLike)
  20708. return this[kState].blobLike.slice(...args)
  20709. }
  20710. text (...args) {
  20711. webidl.brandCheck(this, FileLike)
  20712. return this[kState].blobLike.text(...args)
  20713. }
  20714. get size () {
  20715. webidl.brandCheck(this, FileLike)
  20716. return this[kState].blobLike.size
  20717. }
  20718. get type () {
  20719. webidl.brandCheck(this, FileLike)
  20720. return this[kState].blobLike.type
  20721. }
  20722. get name () {
  20723. webidl.brandCheck(this, FileLike)
  20724. return this[kState].name
  20725. }
  20726. get lastModified () {
  20727. webidl.brandCheck(this, FileLike)
  20728. return this[kState].lastModified
  20729. }
  20730. get [Symbol.toStringTag] () {
  20731. return 'File'
  20732. }
  20733. }
  20734. Object.defineProperties(File.prototype, {
  20735. [Symbol.toStringTag]: {
  20736. value: 'File',
  20737. configurable: true
  20738. },
  20739. name: kEnumerableProperty,
  20740. lastModified: kEnumerableProperty
  20741. })
  20742. webidl.converters.Blob = webidl.interfaceConverter(Blob)
  20743. webidl.converters.BlobPart = function (V, opts) {
  20744. if (webidl.util.Type(V) === 'Object') {
  20745. if (isBlobLike(V)) {
  20746. return webidl.converters.Blob(V, { strict: false })
  20747. }
  20748. if (
  20749. ArrayBuffer.isView(V) ||
  20750. types.isAnyArrayBuffer(V)
  20751. ) {
  20752. return webidl.converters.BufferSource(V, opts)
  20753. }
  20754. }
  20755. return webidl.converters.USVString(V, opts)
  20756. }
  20757. webidl.converters['sequence<BlobPart>'] = webidl.sequenceConverter(
  20758. webidl.converters.BlobPart
  20759. )
  20760. // https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag
  20761. webidl.converters.FilePropertyBag = webidl.dictionaryConverter([
  20762. {
  20763. key: 'lastModified',
  20764. converter: webidl.converters['long long'],
  20765. get defaultValue () {
  20766. return Date.now()
  20767. }
  20768. },
  20769. {
  20770. key: 'type',
  20771. converter: webidl.converters.DOMString,
  20772. defaultValue: ''
  20773. },
  20774. {
  20775. key: 'endings',
  20776. converter: (value) => {
  20777. value = webidl.converters.DOMString(value)
  20778. value = value.toLowerCase()
  20779. if (value !== 'native') {
  20780. value = 'transparent'
  20781. }
  20782. return value
  20783. },
  20784. defaultValue: 'transparent'
  20785. }
  20786. ])
  20787. /**
  20788. * @see https://www.w3.org/TR/FileAPI/#process-blob-parts
  20789. * @param {(NodeJS.TypedArray|Blob|string)[]} parts
  20790. * @param {{ type: string, endings: string }} options
  20791. */
  20792. function processBlobParts (parts, options) {
  20793. // 1. Let bytes be an empty sequence of bytes.
  20794. /** @type {NodeJS.TypedArray[]} */
  20795. const bytes = []
  20796. // 2. For each element in parts:
  20797. for (const element of parts) {
  20798. // 1. If element is a USVString, run the following substeps:
  20799. if (typeof element === 'string') {
  20800. // 1. Let s be element.
  20801. let s = element
  20802. // 2. If the endings member of options is "native", set s
  20803. // to the result of converting line endings to native
  20804. // of element.
  20805. if (options.endings === 'native') {
  20806. s = convertLineEndingsNative(s)
  20807. }
  20808. // 3. Append the result of UTF-8 encoding s to bytes.
  20809. bytes.push(encoder.encode(s))
  20810. } else if (
  20811. types.isAnyArrayBuffer(element) ||
  20812. types.isTypedArray(element)
  20813. ) {
  20814. // 2. If element is a BufferSource, get a copy of the
  20815. // bytes held by the buffer source, and append those
  20816. // bytes to bytes.
  20817. if (!element.buffer) { // ArrayBuffer
  20818. bytes.push(new Uint8Array(element))
  20819. } else {
  20820. bytes.push(
  20821. new Uint8Array(element.buffer, element.byteOffset, element.byteLength)
  20822. )
  20823. }
  20824. } else if (isBlobLike(element)) {
  20825. // 3. If element is a Blob, append the bytes it represents
  20826. // to bytes.
  20827. bytes.push(element)
  20828. }
  20829. }
  20830. // 3. Return bytes.
  20831. return bytes
  20832. }
  20833. /**
  20834. * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native
  20835. * @param {string} s
  20836. */
  20837. function convertLineEndingsNative (s) {
  20838. // 1. Let native line ending be be the code point U+000A LF.
  20839. let nativeLineEnding = '\n'
  20840. // 2. If the underlying platform’s conventions are to
  20841. // represent newlines as a carriage return and line feed
  20842. // sequence, set native line ending to the code point
  20843. // U+000D CR followed by the code point U+000A LF.
  20844. if (process.platform === 'win32') {
  20845. nativeLineEnding = '\r\n'
  20846. }
  20847. return s.replace(/\r?\n/g, nativeLineEnding)
  20848. }
  20849. // If this function is moved to ./util.js, some tools (such as
  20850. // rollup) will warn about circular dependencies. See:
  20851. // https://github.com/nodejs/undici/issues/1629
  20852. function isFileLike (object) {
  20853. return (
  20854. (NativeFile && object instanceof NativeFile) ||
  20855. object instanceof File || (
  20856. object &&
  20857. (typeof object.stream === 'function' ||
  20858. typeof object.arrayBuffer === 'function') &&
  20859. object[Symbol.toStringTag] === 'File'
  20860. )
  20861. )
  20862. }
  20863. module.exports = { File, FileLike, isFileLike }
  20864. /***/ }),
  20865. /***/ 2015:
  20866. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20867. "use strict";
  20868. const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(2538)
  20869. const { kState } = __nccwpck_require__(5861)
  20870. const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(8511)
  20871. const { webidl } = __nccwpck_require__(1744)
  20872. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20873. /** @type {globalThis['File']} */
  20874. const File = NativeFile ?? UndiciFile
  20875. // https://xhr.spec.whatwg.org/#formdata
  20876. class FormData {
  20877. constructor (form) {
  20878. if (form !== undefined) {
  20879. throw webidl.errors.conversionFailed({
  20880. prefix: 'FormData constructor',
  20881. argument: 'Argument 1',
  20882. types: ['undefined']
  20883. })
  20884. }
  20885. this[kState] = []
  20886. }
  20887. append (name, value, filename = undefined) {
  20888. webidl.brandCheck(this, FormData)
  20889. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' })
  20890. if (arguments.length === 3 && !isBlobLike(value)) {
  20891. throw new TypeError(
  20892. "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'"
  20893. )
  20894. }
  20895. // 1. Let value be value if given; otherwise blobValue.
  20896. name = webidl.converters.USVString(name)
  20897. value = isBlobLike(value)
  20898. ? webidl.converters.Blob(value, { strict: false })
  20899. : webidl.converters.USVString(value)
  20900. filename = arguments.length === 3
  20901. ? webidl.converters.USVString(filename)
  20902. : undefined
  20903. // 2. Let entry be the result of creating an entry with
  20904. // name, value, and filename if given.
  20905. const entry = makeEntry(name, value, filename)
  20906. // 3. Append entry to this’s entry list.
  20907. this[kState].push(entry)
  20908. }
  20909. delete (name) {
  20910. webidl.brandCheck(this, FormData)
  20911. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' })
  20912. name = webidl.converters.USVString(name)
  20913. // The delete(name) method steps are to remove all entries whose name
  20914. // is name from this’s entry list.
  20915. this[kState] = this[kState].filter(entry => entry.name !== name)
  20916. }
  20917. get (name) {
  20918. webidl.brandCheck(this, FormData)
  20919. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' })
  20920. name = webidl.converters.USVString(name)
  20921. // 1. If there is no entry whose name is name in this’s entry list,
  20922. // then return null.
  20923. const idx = this[kState].findIndex((entry) => entry.name === name)
  20924. if (idx === -1) {
  20925. return null
  20926. }
  20927. // 2. Return the value of the first entry whose name is name from
  20928. // this’s entry list.
  20929. return this[kState][idx].value
  20930. }
  20931. getAll (name) {
  20932. webidl.brandCheck(this, FormData)
  20933. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' })
  20934. name = webidl.converters.USVString(name)
  20935. // 1. If there is no entry whose name is name in this’s entry list,
  20936. // then return the empty list.
  20937. // 2. Return the values of all entries whose name is name, in order,
  20938. // from this’s entry list.
  20939. return this[kState]
  20940. .filter((entry) => entry.name === name)
  20941. .map((entry) => entry.value)
  20942. }
  20943. has (name) {
  20944. webidl.brandCheck(this, FormData)
  20945. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' })
  20946. name = webidl.converters.USVString(name)
  20947. // The has(name) method steps are to return true if there is an entry
  20948. // whose name is name in this’s entry list; otherwise false.
  20949. return this[kState].findIndex((entry) => entry.name === name) !== -1
  20950. }
  20951. set (name, value, filename = undefined) {
  20952. webidl.brandCheck(this, FormData)
  20953. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' })
  20954. if (arguments.length === 3 && !isBlobLike(value)) {
  20955. throw new TypeError(
  20956. "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'"
  20957. )
  20958. }
  20959. // The set(name, value) and set(name, blobValue, filename) method steps
  20960. // are:
  20961. // 1. Let value be value if given; otherwise blobValue.
  20962. name = webidl.converters.USVString(name)
  20963. value = isBlobLike(value)
  20964. ? webidl.converters.Blob(value, { strict: false })
  20965. : webidl.converters.USVString(value)
  20966. filename = arguments.length === 3
  20967. ? toUSVString(filename)
  20968. : undefined
  20969. // 2. Let entry be the result of creating an entry with name, value, and
  20970. // filename if given.
  20971. const entry = makeEntry(name, value, filename)
  20972. // 3. If there are entries in this’s entry list whose name is name, then
  20973. // replace the first such entry with entry and remove the others.
  20974. const idx = this[kState].findIndex((entry) => entry.name === name)
  20975. if (idx !== -1) {
  20976. this[kState] = [
  20977. ...this[kState].slice(0, idx),
  20978. entry,
  20979. ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)
  20980. ]
  20981. } else {
  20982. // 4. Otherwise, append entry to this’s entry list.
  20983. this[kState].push(entry)
  20984. }
  20985. }
  20986. entries () {
  20987. webidl.brandCheck(this, FormData)
  20988. return makeIterator(
  20989. () => this[kState].map(pair => [pair.name, pair.value]),
  20990. 'FormData',
  20991. 'key+value'
  20992. )
  20993. }
  20994. keys () {
  20995. webidl.brandCheck(this, FormData)
  20996. return makeIterator(
  20997. () => this[kState].map(pair => [pair.name, pair.value]),
  20998. 'FormData',
  20999. 'key'
  21000. )
  21001. }
  21002. values () {
  21003. webidl.brandCheck(this, FormData)
  21004. return makeIterator(
  21005. () => this[kState].map(pair => [pair.name, pair.value]),
  21006. 'FormData',
  21007. 'value'
  21008. )
  21009. }
  21010. /**
  21011. * @param {(value: string, key: string, self: FormData) => void} callbackFn
  21012. * @param {unknown} thisArg
  21013. */
  21014. forEach (callbackFn, thisArg = globalThis) {
  21015. webidl.brandCheck(this, FormData)
  21016. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' })
  21017. if (typeof callbackFn !== 'function') {
  21018. throw new TypeError(
  21019. "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'."
  21020. )
  21021. }
  21022. for (const [key, value] of this) {
  21023. callbackFn.apply(thisArg, [value, key, this])
  21024. }
  21025. }
  21026. }
  21027. FormData.prototype[Symbol.iterator] = FormData.prototype.entries
  21028. Object.defineProperties(FormData.prototype, {
  21029. [Symbol.toStringTag]: {
  21030. value: 'FormData',
  21031. configurable: true
  21032. }
  21033. })
  21034. /**
  21035. * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry
  21036. * @param {string} name
  21037. * @param {string|Blob} value
  21038. * @param {?string} filename
  21039. * @returns
  21040. */
  21041. function makeEntry (name, value, filename) {
  21042. // 1. Set name to the result of converting name into a scalar value string.
  21043. // "To convert a string into a scalar value string, replace any surrogates
  21044. // with U+FFFD."
  21045. // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end
  21046. name = Buffer.from(name).toString('utf8')
  21047. // 2. If value is a string, then set value to the result of converting
  21048. // value into a scalar value string.
  21049. if (typeof value === 'string') {
  21050. value = Buffer.from(value).toString('utf8')
  21051. } else {
  21052. // 3. Otherwise:
  21053. // 1. If value is not a File object, then set value to a new File object,
  21054. // representing the same bytes, whose name attribute value is "blob"
  21055. if (!isFileLike(value)) {
  21056. value = value instanceof Blob
  21057. ? new File([value], 'blob', { type: value.type })
  21058. : new FileLike(value, 'blob', { type: value.type })
  21059. }
  21060. // 2. If filename is given, then set value to a new File object,
  21061. // representing the same bytes, whose name attribute is filename.
  21062. if (filename !== undefined) {
  21063. /** @type {FilePropertyBag} */
  21064. const options = {
  21065. type: value.type,
  21066. lastModified: value.lastModified
  21067. }
  21068. value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile
  21069. ? new File([value], filename, options)
  21070. : new FileLike(value, filename, options)
  21071. }
  21072. }
  21073. // 4. Return an entry whose name is name and whose value is value.
  21074. return { name, value }
  21075. }
  21076. module.exports = { FormData }
  21077. /***/ }),
  21078. /***/ 1246:
  21079. /***/ ((module) => {
  21080. "use strict";
  21081. // In case of breaking changes, increase the version
  21082. // number to avoid conflicts.
  21083. const globalOrigin = Symbol.for('undici.globalOrigin.1')
  21084. function getGlobalOrigin () {
  21085. return globalThis[globalOrigin]
  21086. }
  21087. function setGlobalOrigin (newOrigin) {
  21088. if (newOrigin === undefined) {
  21089. Object.defineProperty(globalThis, globalOrigin, {
  21090. value: undefined,
  21091. writable: true,
  21092. enumerable: false,
  21093. configurable: false
  21094. })
  21095. return
  21096. }
  21097. const parsedURL = new URL(newOrigin)
  21098. if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {
  21099. throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)
  21100. }
  21101. Object.defineProperty(globalThis, globalOrigin, {
  21102. value: parsedURL,
  21103. writable: true,
  21104. enumerable: false,
  21105. configurable: false
  21106. })
  21107. }
  21108. module.exports = {
  21109. getGlobalOrigin,
  21110. setGlobalOrigin
  21111. }
  21112. /***/ }),
  21113. /***/ 554:
  21114. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21115. "use strict";
  21116. // https://github.com/Ethan-Arrowood/undici-fetch
  21117. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  21118. const { kGuard } = __nccwpck_require__(5861)
  21119. const { kEnumerableProperty } = __nccwpck_require__(3983)
  21120. const {
  21121. makeIterator,
  21122. isValidHeaderName,
  21123. isValidHeaderValue
  21124. } = __nccwpck_require__(2538)
  21125. const util = __nccwpck_require__(3837)
  21126. const { webidl } = __nccwpck_require__(1744)
  21127. const assert = __nccwpck_require__(9491)
  21128. const kHeadersMap = Symbol('headers map')
  21129. const kHeadersSortedMap = Symbol('headers map sorted')
  21130. /**
  21131. * @param {number} code
  21132. */
  21133. function isHTTPWhiteSpaceCharCode (code) {
  21134. return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020
  21135. }
  21136. /**
  21137. * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize
  21138. * @param {string} potentialValue
  21139. */
  21140. function headerValueNormalize (potentialValue) {
  21141. // To normalize a byte sequence potentialValue, remove
  21142. // any leading and trailing HTTP whitespace bytes from
  21143. // potentialValue.
  21144. let i = 0; let j = potentialValue.length
  21145. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j
  21146. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i
  21147. return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)
  21148. }
  21149. function fill (headers, object) {
  21150. // To fill a Headers object headers with a given object object, run these steps:
  21151. // 1. If object is a sequence, then for each header in object:
  21152. // Note: webidl conversion to array has already been done.
  21153. if (Array.isArray(object)) {
  21154. for (let i = 0; i < object.length; ++i) {
  21155. const header = object[i]
  21156. // 1. If header does not contain exactly two items, then throw a TypeError.
  21157. if (header.length !== 2) {
  21158. throw webidl.errors.exception({
  21159. header: 'Headers constructor',
  21160. message: `expected name/value pair to be length 2, found ${header.length}.`
  21161. })
  21162. }
  21163. // 2. Append (header’s first item, header’s second item) to headers.
  21164. appendHeader(headers, header[0], header[1])
  21165. }
  21166. } else if (typeof object === 'object' && object !== null) {
  21167. // Note: null should throw
  21168. // 2. Otherwise, object is a record, then for each key → value in object,
  21169. // append (key, value) to headers
  21170. const keys = Object.keys(object)
  21171. for (let i = 0; i < keys.length; ++i) {
  21172. appendHeader(headers, keys[i], object[keys[i]])
  21173. }
  21174. } else {
  21175. throw webidl.errors.conversionFailed({
  21176. prefix: 'Headers constructor',
  21177. argument: 'Argument 1',
  21178. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21179. })
  21180. }
  21181. }
  21182. /**
  21183. * @see https://fetch.spec.whatwg.org/#concept-headers-append
  21184. */
  21185. function appendHeader (headers, name, value) {
  21186. // 1. Normalize value.
  21187. value = headerValueNormalize(value)
  21188. // 2. If name is not a header name or value is not a
  21189. // header value, then throw a TypeError.
  21190. if (!isValidHeaderName(name)) {
  21191. throw webidl.errors.invalidArgument({
  21192. prefix: 'Headers.append',
  21193. value: name,
  21194. type: 'header name'
  21195. })
  21196. } else if (!isValidHeaderValue(value)) {
  21197. throw webidl.errors.invalidArgument({
  21198. prefix: 'Headers.append',
  21199. value,
  21200. type: 'header value'
  21201. })
  21202. }
  21203. // 3. If headers’s guard is "immutable", then throw a TypeError.
  21204. // 4. Otherwise, if headers’s guard is "request" and name is a
  21205. // forbidden header name, return.
  21206. // Note: undici does not implement forbidden header names
  21207. if (headers[kGuard] === 'immutable') {
  21208. throw new TypeError('immutable')
  21209. } else if (headers[kGuard] === 'request-no-cors') {
  21210. // 5. Otherwise, if headers’s guard is "request-no-cors":
  21211. // TODO
  21212. }
  21213. // 6. Otherwise, if headers’s guard is "response" and name is a
  21214. // forbidden response-header name, return.
  21215. // 7. Append (name, value) to headers’s header list.
  21216. return headers[kHeadersList].append(name, value)
  21217. // 8. If headers’s guard is "request-no-cors", then remove
  21218. // privileged no-CORS request headers from headers
  21219. }
  21220. class HeadersList {
  21221. /** @type {[string, string][]|null} */
  21222. cookies = null
  21223. constructor (init) {
  21224. if (init instanceof HeadersList) {
  21225. this[kHeadersMap] = new Map(init[kHeadersMap])
  21226. this[kHeadersSortedMap] = init[kHeadersSortedMap]
  21227. this.cookies = init.cookies === null ? null : [...init.cookies]
  21228. } else {
  21229. this[kHeadersMap] = new Map(init)
  21230. this[kHeadersSortedMap] = null
  21231. }
  21232. }
  21233. // https://fetch.spec.whatwg.org/#header-list-contains
  21234. contains (name) {
  21235. // A header list list contains a header name name if list
  21236. // contains a header whose name is a byte-case-insensitive
  21237. // match for name.
  21238. name = name.toLowerCase()
  21239. return this[kHeadersMap].has(name)
  21240. }
  21241. clear () {
  21242. this[kHeadersMap].clear()
  21243. this[kHeadersSortedMap] = null
  21244. this.cookies = null
  21245. }
  21246. // https://fetch.spec.whatwg.org/#concept-header-list-append
  21247. append (name, value) {
  21248. this[kHeadersSortedMap] = null
  21249. // 1. If list contains name, then set name to the first such
  21250. // header’s name.
  21251. const lowercaseName = name.toLowerCase()
  21252. const exists = this[kHeadersMap].get(lowercaseName)
  21253. // 2. Append (name, value) to list.
  21254. if (exists) {
  21255. const delimiter = lowercaseName === 'cookie' ? '; ' : ', '
  21256. this[kHeadersMap].set(lowercaseName, {
  21257. name: exists.name,
  21258. value: `${exists.value}${delimiter}${value}`
  21259. })
  21260. } else {
  21261. this[kHeadersMap].set(lowercaseName, { name, value })
  21262. }
  21263. if (lowercaseName === 'set-cookie') {
  21264. this.cookies ??= []
  21265. this.cookies.push(value)
  21266. }
  21267. }
  21268. // https://fetch.spec.whatwg.org/#concept-header-list-set
  21269. set (name, value) {
  21270. this[kHeadersSortedMap] = null
  21271. const lowercaseName = name.toLowerCase()
  21272. if (lowercaseName === 'set-cookie') {
  21273. this.cookies = [value]
  21274. }
  21275. // 1. If list contains name, then set the value of
  21276. // the first such header to value and remove the
  21277. // others.
  21278. // 2. Otherwise, append header (name, value) to list.
  21279. this[kHeadersMap].set(lowercaseName, { name, value })
  21280. }
  21281. // https://fetch.spec.whatwg.org/#concept-header-list-delete
  21282. delete (name) {
  21283. this[kHeadersSortedMap] = null
  21284. name = name.toLowerCase()
  21285. if (name === 'set-cookie') {
  21286. this.cookies = null
  21287. }
  21288. this[kHeadersMap].delete(name)
  21289. }
  21290. // https://fetch.spec.whatwg.org/#concept-header-list-get
  21291. get (name) {
  21292. const value = this[kHeadersMap].get(name.toLowerCase())
  21293. // 1. If list does not contain name, then return null.
  21294. // 2. Return the values of all headers in list whose name
  21295. // is a byte-case-insensitive match for name,
  21296. // separated from each other by 0x2C 0x20, in order.
  21297. return value === undefined ? null : value.value
  21298. }
  21299. * [Symbol.iterator] () {
  21300. // use the lowercased name
  21301. for (const [name, { value }] of this[kHeadersMap]) {
  21302. yield [name, value]
  21303. }
  21304. }
  21305. get entries () {
  21306. const headers = {}
  21307. if (this[kHeadersMap].size) {
  21308. for (const { name, value } of this[kHeadersMap].values()) {
  21309. headers[name] = value
  21310. }
  21311. }
  21312. return headers
  21313. }
  21314. }
  21315. // https://fetch.spec.whatwg.org/#headers-class
  21316. class Headers {
  21317. constructor (init = undefined) {
  21318. if (init === kConstruct) {
  21319. return
  21320. }
  21321. this[kHeadersList] = new HeadersList()
  21322. // The new Headers(init) constructor steps are:
  21323. // 1. Set this’s guard to "none".
  21324. this[kGuard] = 'none'
  21325. // 2. If init is given, then fill this with init.
  21326. if (init !== undefined) {
  21327. init = webidl.converters.HeadersInit(init)
  21328. fill(this, init)
  21329. }
  21330. }
  21331. // https://fetch.spec.whatwg.org/#dom-headers-append
  21332. append (name, value) {
  21333. webidl.brandCheck(this, Headers)
  21334. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' })
  21335. name = webidl.converters.ByteString(name)
  21336. value = webidl.converters.ByteString(value)
  21337. return appendHeader(this, name, value)
  21338. }
  21339. // https://fetch.spec.whatwg.org/#dom-headers-delete
  21340. delete (name) {
  21341. webidl.brandCheck(this, Headers)
  21342. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' })
  21343. name = webidl.converters.ByteString(name)
  21344. // 1. If name is not a header name, then throw a TypeError.
  21345. if (!isValidHeaderName(name)) {
  21346. throw webidl.errors.invalidArgument({
  21347. prefix: 'Headers.delete',
  21348. value: name,
  21349. type: 'header name'
  21350. })
  21351. }
  21352. // 2. If this’s guard is "immutable", then throw a TypeError.
  21353. // 3. Otherwise, if this’s guard is "request" and name is a
  21354. // forbidden header name, return.
  21355. // 4. Otherwise, if this’s guard is "request-no-cors", name
  21356. // is not a no-CORS-safelisted request-header name, and
  21357. // name is not a privileged no-CORS request-header name,
  21358. // return.
  21359. // 5. Otherwise, if this’s guard is "response" and name is
  21360. // a forbidden response-header name, return.
  21361. // Note: undici does not implement forbidden header names
  21362. if (this[kGuard] === 'immutable') {
  21363. throw new TypeError('immutable')
  21364. } else if (this[kGuard] === 'request-no-cors') {
  21365. // TODO
  21366. }
  21367. // 6. If this’s header list does not contain name, then
  21368. // return.
  21369. if (!this[kHeadersList].contains(name)) {
  21370. return
  21371. }
  21372. // 7. Delete name from this’s header list.
  21373. // 8. If this’s guard is "request-no-cors", then remove
  21374. // privileged no-CORS request headers from this.
  21375. this[kHeadersList].delete(name)
  21376. }
  21377. // https://fetch.spec.whatwg.org/#dom-headers-get
  21378. get (name) {
  21379. webidl.brandCheck(this, Headers)
  21380. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' })
  21381. name = webidl.converters.ByteString(name)
  21382. // 1. If name is not a header name, then throw a TypeError.
  21383. if (!isValidHeaderName(name)) {
  21384. throw webidl.errors.invalidArgument({
  21385. prefix: 'Headers.get',
  21386. value: name,
  21387. type: 'header name'
  21388. })
  21389. }
  21390. // 2. Return the result of getting name from this’s header
  21391. // list.
  21392. return this[kHeadersList].get(name)
  21393. }
  21394. // https://fetch.spec.whatwg.org/#dom-headers-has
  21395. has (name) {
  21396. webidl.brandCheck(this, Headers)
  21397. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' })
  21398. name = webidl.converters.ByteString(name)
  21399. // 1. If name is not a header name, then throw a TypeError.
  21400. if (!isValidHeaderName(name)) {
  21401. throw webidl.errors.invalidArgument({
  21402. prefix: 'Headers.has',
  21403. value: name,
  21404. type: 'header name'
  21405. })
  21406. }
  21407. // 2. Return true if this’s header list contains name;
  21408. // otherwise false.
  21409. return this[kHeadersList].contains(name)
  21410. }
  21411. // https://fetch.spec.whatwg.org/#dom-headers-set
  21412. set (name, value) {
  21413. webidl.brandCheck(this, Headers)
  21414. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' })
  21415. name = webidl.converters.ByteString(name)
  21416. value = webidl.converters.ByteString(value)
  21417. // 1. Normalize value.
  21418. value = headerValueNormalize(value)
  21419. // 2. If name is not a header name or value is not a
  21420. // header value, then throw a TypeError.
  21421. if (!isValidHeaderName(name)) {
  21422. throw webidl.errors.invalidArgument({
  21423. prefix: 'Headers.set',
  21424. value: name,
  21425. type: 'header name'
  21426. })
  21427. } else if (!isValidHeaderValue(value)) {
  21428. throw webidl.errors.invalidArgument({
  21429. prefix: 'Headers.set',
  21430. value,
  21431. type: 'header value'
  21432. })
  21433. }
  21434. // 3. If this’s guard is "immutable", then throw a TypeError.
  21435. // 4. Otherwise, if this’s guard is "request" and name is a
  21436. // forbidden header name, return.
  21437. // 5. Otherwise, if this’s guard is "request-no-cors" and
  21438. // name/value is not a no-CORS-safelisted request-header,
  21439. // return.
  21440. // 6. Otherwise, if this’s guard is "response" and name is a
  21441. // forbidden response-header name, return.
  21442. // Note: undici does not implement forbidden header names
  21443. if (this[kGuard] === 'immutable') {
  21444. throw new TypeError('immutable')
  21445. } else if (this[kGuard] === 'request-no-cors') {
  21446. // TODO
  21447. }
  21448. // 7. Set (name, value) in this’s header list.
  21449. // 8. If this’s guard is "request-no-cors", then remove
  21450. // privileged no-CORS request headers from this
  21451. this[kHeadersList].set(name, value)
  21452. }
  21453. // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
  21454. getSetCookie () {
  21455. webidl.brandCheck(this, Headers)
  21456. // 1. If this’s header list does not contain `Set-Cookie`, then return « ».
  21457. // 2. Return the values of all headers in this’s header list whose name is
  21458. // a byte-case-insensitive match for `Set-Cookie`, in order.
  21459. const list = this[kHeadersList].cookies
  21460. if (list) {
  21461. return [...list]
  21462. }
  21463. return []
  21464. }
  21465. // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
  21466. get [kHeadersSortedMap] () {
  21467. if (this[kHeadersList][kHeadersSortedMap]) {
  21468. return this[kHeadersList][kHeadersSortedMap]
  21469. }
  21470. // 1. Let headers be an empty list of headers with the key being the name
  21471. // and value the value.
  21472. const headers = []
  21473. // 2. Let names be the result of convert header names to a sorted-lowercase
  21474. // set with all the names of the headers in list.
  21475. const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)
  21476. const cookies = this[kHeadersList].cookies
  21477. // 3. For each name of names:
  21478. for (let i = 0; i < names.length; ++i) {
  21479. const [name, value] = names[i]
  21480. // 1. If name is `set-cookie`, then:
  21481. if (name === 'set-cookie') {
  21482. // 1. Let values be a list of all values of headers in list whose name
  21483. // is a byte-case-insensitive match for name, in order.
  21484. // 2. For each value of values:
  21485. // 1. Append (name, value) to headers.
  21486. for (let j = 0; j < cookies.length; ++j) {
  21487. headers.push([name, cookies[j]])
  21488. }
  21489. } else {
  21490. // 2. Otherwise:
  21491. // 1. Let value be the result of getting name from list.
  21492. // 2. Assert: value is non-null.
  21493. assert(value !== null)
  21494. // 3. Append (name, value) to headers.
  21495. headers.push([name, value])
  21496. }
  21497. }
  21498. this[kHeadersList][kHeadersSortedMap] = headers
  21499. // 4. Return headers.
  21500. return headers
  21501. }
  21502. keys () {
  21503. webidl.brandCheck(this, Headers)
  21504. if (this[kGuard] === 'immutable') {
  21505. const value = this[kHeadersSortedMap]
  21506. return makeIterator(() => value, 'Headers',
  21507. 'key')
  21508. }
  21509. return makeIterator(
  21510. () => [...this[kHeadersSortedMap].values()],
  21511. 'Headers',
  21512. 'key'
  21513. )
  21514. }
  21515. values () {
  21516. webidl.brandCheck(this, Headers)
  21517. if (this[kGuard] === 'immutable') {
  21518. const value = this[kHeadersSortedMap]
  21519. return makeIterator(() => value, 'Headers',
  21520. 'value')
  21521. }
  21522. return makeIterator(
  21523. () => [...this[kHeadersSortedMap].values()],
  21524. 'Headers',
  21525. 'value'
  21526. )
  21527. }
  21528. entries () {
  21529. webidl.brandCheck(this, Headers)
  21530. if (this[kGuard] === 'immutable') {
  21531. const value = this[kHeadersSortedMap]
  21532. return makeIterator(() => value, 'Headers',
  21533. 'key+value')
  21534. }
  21535. return makeIterator(
  21536. () => [...this[kHeadersSortedMap].values()],
  21537. 'Headers',
  21538. 'key+value'
  21539. )
  21540. }
  21541. /**
  21542. * @param {(value: string, key: string, self: Headers) => void} callbackFn
  21543. * @param {unknown} thisArg
  21544. */
  21545. forEach (callbackFn, thisArg = globalThis) {
  21546. webidl.brandCheck(this, Headers)
  21547. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })
  21548. if (typeof callbackFn !== 'function') {
  21549. throw new TypeError(
  21550. "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'."
  21551. )
  21552. }
  21553. for (const [key, value] of this) {
  21554. callbackFn.apply(thisArg, [value, key, this])
  21555. }
  21556. }
  21557. [Symbol.for('nodejs.util.inspect.custom')] () {
  21558. webidl.brandCheck(this, Headers)
  21559. return this[kHeadersList]
  21560. }
  21561. }
  21562. Headers.prototype[Symbol.iterator] = Headers.prototype.entries
  21563. Object.defineProperties(Headers.prototype, {
  21564. append: kEnumerableProperty,
  21565. delete: kEnumerableProperty,
  21566. get: kEnumerableProperty,
  21567. has: kEnumerableProperty,
  21568. set: kEnumerableProperty,
  21569. getSetCookie: kEnumerableProperty,
  21570. keys: kEnumerableProperty,
  21571. values: kEnumerableProperty,
  21572. entries: kEnumerableProperty,
  21573. forEach: kEnumerableProperty,
  21574. [Symbol.iterator]: { enumerable: false },
  21575. [Symbol.toStringTag]: {
  21576. value: 'Headers',
  21577. configurable: true
  21578. },
  21579. [util.inspect.custom]: {
  21580. enumerable: false
  21581. }
  21582. })
  21583. webidl.converters.HeadersInit = function (V) {
  21584. if (webidl.util.Type(V) === 'Object') {
  21585. if (V[Symbol.iterator]) {
  21586. return webidl.converters['sequence<sequence<ByteString>>'](V)
  21587. }
  21588. return webidl.converters['record<ByteString, ByteString>'](V)
  21589. }
  21590. throw webidl.errors.conversionFailed({
  21591. prefix: 'Headers constructor',
  21592. argument: 'Argument 1',
  21593. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21594. })
  21595. }
  21596. module.exports = {
  21597. fill,
  21598. Headers,
  21599. HeadersList
  21600. }
  21601. /***/ }),
  21602. /***/ 4881:
  21603. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21604. "use strict";
  21605. // https://github.com/Ethan-Arrowood/undici-fetch
  21606. const {
  21607. Response,
  21608. makeNetworkError,
  21609. makeAppropriateNetworkError,
  21610. filterResponse,
  21611. makeResponse
  21612. } = __nccwpck_require__(7823)
  21613. const { Headers } = __nccwpck_require__(554)
  21614. const { Request, makeRequest } = __nccwpck_require__(8359)
  21615. const zlib = __nccwpck_require__(9796)
  21616. const {
  21617. bytesMatch,
  21618. makePolicyContainer,
  21619. clonePolicyContainer,
  21620. requestBadPort,
  21621. TAOCheck,
  21622. appendRequestOriginHeader,
  21623. responseLocationURL,
  21624. requestCurrentURL,
  21625. setRequestReferrerPolicyOnRedirect,
  21626. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  21627. createOpaqueTimingInfo,
  21628. appendFetchMetadata,
  21629. corsCheck,
  21630. crossOriginResourcePolicyCheck,
  21631. determineRequestsReferrer,
  21632. coarsenedSharedCurrentTime,
  21633. createDeferredPromise,
  21634. isBlobLike,
  21635. sameOrigin,
  21636. isCancelled,
  21637. isAborted,
  21638. isErrorLike,
  21639. fullyReadBody,
  21640. readableStreamClose,
  21641. isomorphicEncode,
  21642. urlIsLocal,
  21643. urlIsHttpHttpsScheme,
  21644. urlHasHttpsScheme
  21645. } = __nccwpck_require__(2538)
  21646. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  21647. const assert = __nccwpck_require__(9491)
  21648. const { safelyExtractBody } = __nccwpck_require__(9990)
  21649. const {
  21650. redirectStatusSet,
  21651. nullBodyStatus,
  21652. safeMethodsSet,
  21653. requestBodyHeader,
  21654. subresourceSet,
  21655. DOMException
  21656. } = __nccwpck_require__(1037)
  21657. const { kHeadersList } = __nccwpck_require__(2785)
  21658. const EE = __nccwpck_require__(2361)
  21659. const { Readable, pipeline } = __nccwpck_require__(2781)
  21660. const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(3983)
  21661. const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(685)
  21662. const { TransformStream } = __nccwpck_require__(5356)
  21663. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  21664. const { webidl } = __nccwpck_require__(1744)
  21665. const { STATUS_CODES } = __nccwpck_require__(3685)
  21666. const GET_OR_HEAD = ['GET', 'HEAD']
  21667. /** @type {import('buffer').resolveObjectURL} */
  21668. let resolveObjectURL
  21669. let ReadableStream = globalThis.ReadableStream
  21670. class Fetch extends EE {
  21671. constructor (dispatcher) {
  21672. super()
  21673. this.dispatcher = dispatcher
  21674. this.connection = null
  21675. this.dump = false
  21676. this.state = 'ongoing'
  21677. // 2 terminated listeners get added per request,
  21678. // but only 1 gets removed. If there are 20 redirects,
  21679. // 21 listeners will be added.
  21680. // See https://github.com/nodejs/undici/issues/1711
  21681. // TODO (fix): Find and fix root cause for leaked listener.
  21682. this.setMaxListeners(21)
  21683. }
  21684. terminate (reason) {
  21685. if (this.state !== 'ongoing') {
  21686. return
  21687. }
  21688. this.state = 'terminated'
  21689. this.connection?.destroy(reason)
  21690. this.emit('terminated', reason)
  21691. }
  21692. // https://fetch.spec.whatwg.org/#fetch-controller-abort
  21693. abort (error) {
  21694. if (this.state !== 'ongoing') {
  21695. return
  21696. }
  21697. // 1. Set controller’s state to "aborted".
  21698. this.state = 'aborted'
  21699. // 2. Let fallbackError be an "AbortError" DOMException.
  21700. // 3. Set error to fallbackError if it is not given.
  21701. if (!error) {
  21702. error = new DOMException('The operation was aborted.', 'AbortError')
  21703. }
  21704. // 4. Let serializedError be StructuredSerialize(error).
  21705. // If that threw an exception, catch it, and let
  21706. // serializedError be StructuredSerialize(fallbackError).
  21707. // 5. Set controller’s serialized abort reason to serializedError.
  21708. this.serializedAbortReason = error
  21709. this.connection?.destroy(error)
  21710. this.emit('terminated', error)
  21711. }
  21712. }
  21713. // https://fetch.spec.whatwg.org/#fetch-method
  21714. function fetch (input, init = {}) {
  21715. webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })
  21716. // 1. Let p be a new promise.
  21717. const p = createDeferredPromise()
  21718. // 2. Let requestObject be the result of invoking the initial value of
  21719. // Request as constructor with input and init as arguments. If this throws
  21720. // an exception, reject p with it and return p.
  21721. let requestObject
  21722. try {
  21723. requestObject = new Request(input, init)
  21724. } catch (e) {
  21725. p.reject(e)
  21726. return p.promise
  21727. }
  21728. // 3. Let request be requestObject’s request.
  21729. const request = requestObject[kState]
  21730. // 4. If requestObject’s signal’s aborted flag is set, then:
  21731. if (requestObject.signal.aborted) {
  21732. // 1. Abort the fetch() call with p, request, null, and
  21733. // requestObject’s signal’s abort reason.
  21734. abortFetch(p, request, null, requestObject.signal.reason)
  21735. // 2. Return p.
  21736. return p.promise
  21737. }
  21738. // 5. Let globalObject be request’s client’s global object.
  21739. const globalObject = request.client.globalObject
  21740. // 6. If globalObject is a ServiceWorkerGlobalScope object, then set
  21741. // request’s service-workers mode to "none".
  21742. if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {
  21743. request.serviceWorkers = 'none'
  21744. }
  21745. // 7. Let responseObject be null.
  21746. let responseObject = null
  21747. // 8. Let relevantRealm be this’s relevant Realm.
  21748. const relevantRealm = null
  21749. // 9. Let locallyAborted be false.
  21750. let locallyAborted = false
  21751. // 10. Let controller be null.
  21752. let controller = null
  21753. // 11. Add the following abort steps to requestObject’s signal:
  21754. addAbortListener(
  21755. requestObject.signal,
  21756. () => {
  21757. // 1. Set locallyAborted to true.
  21758. locallyAborted = true
  21759. // 2. Assert: controller is non-null.
  21760. assert(controller != null)
  21761. // 3. Abort controller with requestObject’s signal’s abort reason.
  21762. controller.abort(requestObject.signal.reason)
  21763. // 4. Abort the fetch() call with p, request, responseObject,
  21764. // and requestObject’s signal’s abort reason.
  21765. abortFetch(p, request, responseObject, requestObject.signal.reason)
  21766. }
  21767. )
  21768. // 12. Let handleFetchDone given response response be to finalize and
  21769. // report timing with response, globalObject, and "fetch".
  21770. const handleFetchDone = (response) =>
  21771. finalizeAndReportTiming(response, 'fetch')
  21772. // 13. Set controller to the result of calling fetch given request,
  21773. // with processResponseEndOfBody set to handleFetchDone, and processResponse
  21774. // given response being these substeps:
  21775. const processResponse = (response) => {
  21776. // 1. If locallyAborted is true, terminate these substeps.
  21777. if (locallyAborted) {
  21778. return Promise.resolve()
  21779. }
  21780. // 2. If response’s aborted flag is set, then:
  21781. if (response.aborted) {
  21782. // 1. Let deserializedError be the result of deserialize a serialized
  21783. // abort reason given controller’s serialized abort reason and
  21784. // relevantRealm.
  21785. // 2. Abort the fetch() call with p, request, responseObject, and
  21786. // deserializedError.
  21787. abortFetch(p, request, responseObject, controller.serializedAbortReason)
  21788. return Promise.resolve()
  21789. }
  21790. // 3. If response is a network error, then reject p with a TypeError
  21791. // and terminate these substeps.
  21792. if (response.type === 'error') {
  21793. p.reject(
  21794. Object.assign(new TypeError('fetch failed'), { cause: response.error })
  21795. )
  21796. return Promise.resolve()
  21797. }
  21798. // 4. Set responseObject to the result of creating a Response object,
  21799. // given response, "immutable", and relevantRealm.
  21800. responseObject = new Response()
  21801. responseObject[kState] = response
  21802. responseObject[kRealm] = relevantRealm
  21803. responseObject[kHeaders][kHeadersList] = response.headersList
  21804. responseObject[kHeaders][kGuard] = 'immutable'
  21805. responseObject[kHeaders][kRealm] = relevantRealm
  21806. // 5. Resolve p with responseObject.
  21807. p.resolve(responseObject)
  21808. }
  21809. controller = fetching({
  21810. request,
  21811. processResponseEndOfBody: handleFetchDone,
  21812. processResponse,
  21813. dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici
  21814. })
  21815. // 14. Return p.
  21816. return p.promise
  21817. }
  21818. // https://fetch.spec.whatwg.org/#finalize-and-report-timing
  21819. function finalizeAndReportTiming (response, initiatorType = 'other') {
  21820. // 1. If response is an aborted network error, then return.
  21821. if (response.type === 'error' && response.aborted) {
  21822. return
  21823. }
  21824. // 2. If response’s URL list is null or empty, then return.
  21825. if (!response.urlList?.length) {
  21826. return
  21827. }
  21828. // 3. Let originalURL be response’s URL list[0].
  21829. const originalURL = response.urlList[0]
  21830. // 4. Let timingInfo be response’s timing info.
  21831. let timingInfo = response.timingInfo
  21832. // 5. Let cacheState be response’s cache state.
  21833. let cacheState = response.cacheState
  21834. // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.
  21835. if (!urlIsHttpHttpsScheme(originalURL)) {
  21836. return
  21837. }
  21838. // 7. If timingInfo is null, then return.
  21839. if (timingInfo === null) {
  21840. return
  21841. }
  21842. // 8. If response’s timing allow passed flag is not set, then:
  21843. if (!response.timingAllowPassed) {
  21844. // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.
  21845. timingInfo = createOpaqueTimingInfo({
  21846. startTime: timingInfo.startTime
  21847. })
  21848. // 2. Set cacheState to the empty string.
  21849. cacheState = ''
  21850. }
  21851. // 9. Set timingInfo’s end time to the coarsened shared current time
  21852. // given global’s relevant settings object’s cross-origin isolated
  21853. // capability.
  21854. // TODO: given global’s relevant settings object’s cross-origin isolated
  21855. // capability?
  21856. timingInfo.endTime = coarsenedSharedCurrentTime()
  21857. // 10. Set response’s timing info to timingInfo.
  21858. response.timingInfo = timingInfo
  21859. // 11. Mark resource timing for timingInfo, originalURL, initiatorType,
  21860. // global, and cacheState.
  21861. markResourceTiming(
  21862. timingInfo,
  21863. originalURL,
  21864. initiatorType,
  21865. globalThis,
  21866. cacheState
  21867. )
  21868. }
  21869. // https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
  21870. function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {
  21871. if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {
  21872. performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
  21873. }
  21874. }
  21875. // https://fetch.spec.whatwg.org/#abort-fetch
  21876. function abortFetch (p, request, responseObject, error) {
  21877. // Note: AbortSignal.reason was added in node v17.2.0
  21878. // which would give us an undefined error to reject with.
  21879. // Remove this once node v16 is no longer supported.
  21880. if (!error) {
  21881. error = new DOMException('The operation was aborted.', 'AbortError')
  21882. }
  21883. // 1. Reject promise with error.
  21884. p.reject(error)
  21885. // 2. If request’s body is not null and is readable, then cancel request’s
  21886. // body with error.
  21887. if (request.body != null && isReadable(request.body?.stream)) {
  21888. request.body.stream.cancel(error).catch((err) => {
  21889. if (err.code === 'ERR_INVALID_STATE') {
  21890. // Node bug?
  21891. return
  21892. }
  21893. throw err
  21894. })
  21895. }
  21896. // 3. If responseObject is null, then return.
  21897. if (responseObject == null) {
  21898. return
  21899. }
  21900. // 4. Let response be responseObject’s response.
  21901. const response = responseObject[kState]
  21902. // 5. If response’s body is not null and is readable, then error response’s
  21903. // body with error.
  21904. if (response.body != null && isReadable(response.body?.stream)) {
  21905. response.body.stream.cancel(error).catch((err) => {
  21906. if (err.code === 'ERR_INVALID_STATE') {
  21907. // Node bug?
  21908. return
  21909. }
  21910. throw err
  21911. })
  21912. }
  21913. }
  21914. // https://fetch.spec.whatwg.org/#fetching
  21915. function fetching ({
  21916. request,
  21917. processRequestBodyChunkLength,
  21918. processRequestEndOfBody,
  21919. processResponse,
  21920. processResponseEndOfBody,
  21921. processResponseConsumeBody,
  21922. useParallelQueue = false,
  21923. dispatcher // undici
  21924. }) {
  21925. // 1. Let taskDestination be null.
  21926. let taskDestination = null
  21927. // 2. Let crossOriginIsolatedCapability be false.
  21928. let crossOriginIsolatedCapability = false
  21929. // 3. If request’s client is non-null, then:
  21930. if (request.client != null) {
  21931. // 1. Set taskDestination to request’s client’s global object.
  21932. taskDestination = request.client.globalObject
  21933. // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin
  21934. // isolated capability.
  21935. crossOriginIsolatedCapability =
  21936. request.client.crossOriginIsolatedCapability
  21937. }
  21938. // 4. If useParallelQueue is true, then set taskDestination to the result of
  21939. // starting a new parallel queue.
  21940. // TODO
  21941. // 5. Let timingInfo be a new fetch timing info whose start time and
  21942. // post-redirect start time are the coarsened shared current time given
  21943. // crossOriginIsolatedCapability.
  21944. const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)
  21945. const timingInfo = createOpaqueTimingInfo({
  21946. startTime: currenTime
  21947. })
  21948. // 6. Let fetchParams be a new fetch params whose
  21949. // request is request,
  21950. // timing info is timingInfo,
  21951. // process request body chunk length is processRequestBodyChunkLength,
  21952. // process request end-of-body is processRequestEndOfBody,
  21953. // process response is processResponse,
  21954. // process response consume body is processResponseConsumeBody,
  21955. // process response end-of-body is processResponseEndOfBody,
  21956. // task destination is taskDestination,
  21957. // and cross-origin isolated capability is crossOriginIsolatedCapability.
  21958. const fetchParams = {
  21959. controller: new Fetch(dispatcher),
  21960. request,
  21961. timingInfo,
  21962. processRequestBodyChunkLength,
  21963. processRequestEndOfBody,
  21964. processResponse,
  21965. processResponseConsumeBody,
  21966. processResponseEndOfBody,
  21967. taskDestination,
  21968. crossOriginIsolatedCapability
  21969. }
  21970. // 7. If request’s body is a byte sequence, then set request’s body to
  21971. // request’s body as a body.
  21972. // NOTE: Since fetching is only called from fetch, body should already be
  21973. // extracted.
  21974. assert(!request.body || request.body.stream)
  21975. // 8. If request’s window is "client", then set request’s window to request’s
  21976. // client, if request’s client’s global object is a Window object; otherwise
  21977. // "no-window".
  21978. if (request.window === 'client') {
  21979. // TODO: What if request.client is null?
  21980. request.window =
  21981. request.client?.globalObject?.constructor?.name === 'Window'
  21982. ? request.client
  21983. : 'no-window'
  21984. }
  21985. // 9. If request’s origin is "client", then set request’s origin to request’s
  21986. // client’s origin.
  21987. if (request.origin === 'client') {
  21988. // TODO: What if request.client is null?
  21989. request.origin = request.client?.origin
  21990. }
  21991. // 10. If all of the following conditions are true:
  21992. // TODO
  21993. // 11. If request’s policy container is "client", then:
  21994. if (request.policyContainer === 'client') {
  21995. // 1. If request’s client is non-null, then set request’s policy
  21996. // container to a clone of request’s client’s policy container. [HTML]
  21997. if (request.client != null) {
  21998. request.policyContainer = clonePolicyContainer(
  21999. request.client.policyContainer
  22000. )
  22001. } else {
  22002. // 2. Otherwise, set request’s policy container to a new policy
  22003. // container.
  22004. request.policyContainer = makePolicyContainer()
  22005. }
  22006. }
  22007. // 12. If request’s header list does not contain `Accept`, then:
  22008. if (!request.headersList.contains('accept')) {
  22009. // 1. Let value be `*/*`.
  22010. const value = '*/*'
  22011. // 2. A user agent should set value to the first matching statement, if
  22012. // any, switching on request’s destination:
  22013. // "document"
  22014. // "frame"
  22015. // "iframe"
  22016. // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`
  22017. // "image"
  22018. // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`
  22019. // "style"
  22020. // `text/css,*/*;q=0.1`
  22021. // TODO
  22022. // 3. Append `Accept`/value to request’s header list.
  22023. request.headersList.append('accept', value)
  22024. }
  22025. // 13. If request’s header list does not contain `Accept-Language`, then
  22026. // user agents should append `Accept-Language`/an appropriate value to
  22027. // request’s header list.
  22028. if (!request.headersList.contains('accept-language')) {
  22029. request.headersList.append('accept-language', '*')
  22030. }
  22031. // 14. If request’s priority is null, then use request’s initiator and
  22032. // destination appropriately in setting request’s priority to a
  22033. // user-agent-defined object.
  22034. if (request.priority === null) {
  22035. // TODO
  22036. }
  22037. // 15. If request is a subresource request, then:
  22038. if (subresourceSet.has(request.destination)) {
  22039. // TODO
  22040. }
  22041. // 16. Run main fetch given fetchParams.
  22042. mainFetch(fetchParams)
  22043. .catch(err => {
  22044. fetchParams.controller.terminate(err)
  22045. })
  22046. // 17. Return fetchParam's controller
  22047. return fetchParams.controller
  22048. }
  22049. // https://fetch.spec.whatwg.org/#concept-main-fetch
  22050. async function mainFetch (fetchParams, recursive = false) {
  22051. // 1. Let request be fetchParams’s request.
  22052. const request = fetchParams.request
  22053. // 2. Let response be null.
  22054. let response = null
  22055. // 3. If request’s local-URLs-only flag is set and request’s current URL is
  22056. // not local, then set response to a network error.
  22057. if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {
  22058. response = makeNetworkError('local URLs only')
  22059. }
  22060. // 4. Run report Content Security Policy violations for request.
  22061. // TODO
  22062. // 5. Upgrade request to a potentially trustworthy URL, if appropriate.
  22063. tryUpgradeRequestToAPotentiallyTrustworthyURL(request)
  22064. // 6. If should request be blocked due to a bad port, should fetching request
  22065. // be blocked as mixed content, or should request be blocked by Content
  22066. // Security Policy returns blocked, then set response to a network error.
  22067. if (requestBadPort(request) === 'blocked') {
  22068. response = makeNetworkError('bad port')
  22069. }
  22070. // TODO: should fetching request be blocked as mixed content?
  22071. // TODO: should request be blocked by Content Security Policy?
  22072. // 7. If request’s referrer policy is the empty string, then set request’s
  22073. // referrer policy to request’s policy container’s referrer policy.
  22074. if (request.referrerPolicy === '') {
  22075. request.referrerPolicy = request.policyContainer.referrerPolicy
  22076. }
  22077. // 8. If request’s referrer is not "no-referrer", then set request’s
  22078. // referrer to the result of invoking determine request’s referrer.
  22079. if (request.referrer !== 'no-referrer') {
  22080. request.referrer = determineRequestsReferrer(request)
  22081. }
  22082. // 9. Set request’s current URL’s scheme to "https" if all of the following
  22083. // conditions are true:
  22084. // - request’s current URL’s scheme is "http"
  22085. // - request’s current URL’s host is a domain
  22086. // - Matching request’s current URL’s host per Known HSTS Host Domain Name
  22087. // Matching results in either a superdomain match with an asserted
  22088. // includeSubDomains directive or a congruent match (with or without an
  22089. // asserted includeSubDomains directive). [HSTS]
  22090. // TODO
  22091. // 10. If recursive is false, then run the remaining steps in parallel.
  22092. // TODO
  22093. // 11. If response is null, then set response to the result of running
  22094. // the steps corresponding to the first matching statement:
  22095. if (response === null) {
  22096. response = await (async () => {
  22097. const currentURL = requestCurrentURL(request)
  22098. if (
  22099. // - request’s current URL’s origin is same origin with request’s origin,
  22100. // and request’s response tainting is "basic"
  22101. (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||
  22102. // request’s current URL’s scheme is "data"
  22103. (currentURL.protocol === 'data:') ||
  22104. // - request’s mode is "navigate" or "websocket"
  22105. (request.mode === 'navigate' || request.mode === 'websocket')
  22106. ) {
  22107. // 1. Set request’s response tainting to "basic".
  22108. request.responseTainting = 'basic'
  22109. // 2. Return the result of running scheme fetch given fetchParams.
  22110. return await schemeFetch(fetchParams)
  22111. }
  22112. // request’s mode is "same-origin"
  22113. if (request.mode === 'same-origin') {
  22114. // 1. Return a network error.
  22115. return makeNetworkError('request mode cannot be "same-origin"')
  22116. }
  22117. // request’s mode is "no-cors"
  22118. if (request.mode === 'no-cors') {
  22119. // 1. If request’s redirect mode is not "follow", then return a network
  22120. // error.
  22121. if (request.redirect !== 'follow') {
  22122. return makeNetworkError(
  22123. 'redirect mode cannot be "follow" for "no-cors" request'
  22124. )
  22125. }
  22126. // 2. Set request’s response tainting to "opaque".
  22127. request.responseTainting = 'opaque'
  22128. // 3. Return the result of running scheme fetch given fetchParams.
  22129. return await schemeFetch(fetchParams)
  22130. }
  22131. // request’s current URL’s scheme is not an HTTP(S) scheme
  22132. if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {
  22133. // Return a network error.
  22134. return makeNetworkError('URL scheme must be a HTTP(S) scheme')
  22135. }
  22136. // - request’s use-CORS-preflight flag is set
  22137. // - request’s unsafe-request flag is set and either request’s method is
  22138. // not a CORS-safelisted method or CORS-unsafe request-header names with
  22139. // request’s header list is not empty
  22140. // 1. Set request’s response tainting to "cors".
  22141. // 2. Let corsWithPreflightResponse be the result of running HTTP fetch
  22142. // given fetchParams and true.
  22143. // 3. If corsWithPreflightResponse is a network error, then clear cache
  22144. // entries using request.
  22145. // 4. Return corsWithPreflightResponse.
  22146. // TODO
  22147. // Otherwise
  22148. // 1. Set request’s response tainting to "cors".
  22149. request.responseTainting = 'cors'
  22150. // 2. Return the result of running HTTP fetch given fetchParams.
  22151. return await httpFetch(fetchParams)
  22152. })()
  22153. }
  22154. // 12. If recursive is true, then return response.
  22155. if (recursive) {
  22156. return response
  22157. }
  22158. // 13. If response is not a network error and response is not a filtered
  22159. // response, then:
  22160. if (response.status !== 0 && !response.internalResponse) {
  22161. // If request’s response tainting is "cors", then:
  22162. if (request.responseTainting === 'cors') {
  22163. // 1. Let headerNames be the result of extracting header list values
  22164. // given `Access-Control-Expose-Headers` and response’s header list.
  22165. // TODO
  22166. // 2. If request’s credentials mode is not "include" and headerNames
  22167. // contains `*`, then set response’s CORS-exposed header-name list to
  22168. // all unique header names in response’s header list.
  22169. // TODO
  22170. // 3. Otherwise, if headerNames is not null or failure, then set
  22171. // response’s CORS-exposed header-name list to headerNames.
  22172. // TODO
  22173. }
  22174. // Set response to the following filtered response with response as its
  22175. // internal response, depending on request’s response tainting:
  22176. if (request.responseTainting === 'basic') {
  22177. response = filterResponse(response, 'basic')
  22178. } else if (request.responseTainting === 'cors') {
  22179. response = filterResponse(response, 'cors')
  22180. } else if (request.responseTainting === 'opaque') {
  22181. response = filterResponse(response, 'opaque')
  22182. } else {
  22183. assert(false)
  22184. }
  22185. }
  22186. // 14. Let internalResponse be response, if response is a network error,
  22187. // and response’s internal response otherwise.
  22188. let internalResponse =
  22189. response.status === 0 ? response : response.internalResponse
  22190. // 15. If internalResponse’s URL list is empty, then set it to a clone of
  22191. // request’s URL list.
  22192. if (internalResponse.urlList.length === 0) {
  22193. internalResponse.urlList.push(...request.urlList)
  22194. }
  22195. // 16. If request’s timing allow failed flag is unset, then set
  22196. // internalResponse’s timing allow passed flag.
  22197. if (!request.timingAllowFailed) {
  22198. response.timingAllowPassed = true
  22199. }
  22200. // 17. If response is not a network error and any of the following returns
  22201. // blocked
  22202. // - should internalResponse to request be blocked as mixed content
  22203. // - should internalResponse to request be blocked by Content Security Policy
  22204. // - should internalResponse to request be blocked due to its MIME type
  22205. // - should internalResponse to request be blocked due to nosniff
  22206. // TODO
  22207. // 18. If response’s type is "opaque", internalResponse’s status is 206,
  22208. // internalResponse’s range-requested flag is set, and request’s header
  22209. // list does not contain `Range`, then set response and internalResponse
  22210. // to a network error.
  22211. if (
  22212. response.type === 'opaque' &&
  22213. internalResponse.status === 206 &&
  22214. internalResponse.rangeRequested &&
  22215. !request.headers.contains('range')
  22216. ) {
  22217. response = internalResponse = makeNetworkError()
  22218. }
  22219. // 19. If response is not a network error and either request’s method is
  22220. // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,
  22221. // set internalResponse’s body to null and disregard any enqueuing toward
  22222. // it (if any).
  22223. if (
  22224. response.status !== 0 &&
  22225. (request.method === 'HEAD' ||
  22226. request.method === 'CONNECT' ||
  22227. nullBodyStatus.includes(internalResponse.status))
  22228. ) {
  22229. internalResponse.body = null
  22230. fetchParams.controller.dump = true
  22231. }
  22232. // 20. If request’s integrity metadata is not the empty string, then:
  22233. if (request.integrity) {
  22234. // 1. Let processBodyError be this step: run fetch finale given fetchParams
  22235. // and a network error.
  22236. const processBodyError = (reason) =>
  22237. fetchFinale(fetchParams, makeNetworkError(reason))
  22238. // 2. If request’s response tainting is "opaque", or response’s body is null,
  22239. // then run processBodyError and abort these steps.
  22240. if (request.responseTainting === 'opaque' || response.body == null) {
  22241. processBodyError(response.error)
  22242. return
  22243. }
  22244. // 3. Let processBody given bytes be these steps:
  22245. const processBody = (bytes) => {
  22246. // 1. If bytes do not match request’s integrity metadata,
  22247. // then run processBodyError and abort these steps. [SRI]
  22248. if (!bytesMatch(bytes, request.integrity)) {
  22249. processBodyError('integrity mismatch')
  22250. return
  22251. }
  22252. // 2. Set response’s body to bytes as a body.
  22253. response.body = safelyExtractBody(bytes)[0]
  22254. // 3. Run fetch finale given fetchParams and response.
  22255. fetchFinale(fetchParams, response)
  22256. }
  22257. // 4. Fully read response’s body given processBody and processBodyError.
  22258. await fullyReadBody(response.body, processBody, processBodyError)
  22259. } else {
  22260. // 21. Otherwise, run fetch finale given fetchParams and response.
  22261. fetchFinale(fetchParams, response)
  22262. }
  22263. }
  22264. // https://fetch.spec.whatwg.org/#concept-scheme-fetch
  22265. // given a fetch params fetchParams
  22266. function schemeFetch (fetchParams) {
  22267. // Note: since the connection is destroyed on redirect, which sets fetchParams to a
  22268. // cancelled state, we do not want this condition to trigger *unless* there have been
  22269. // no redirects. See https://github.com/nodejs/undici/issues/1776
  22270. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22271. if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
  22272. return Promise.resolve(makeAppropriateNetworkError(fetchParams))
  22273. }
  22274. // 2. Let request be fetchParams’s request.
  22275. const { request } = fetchParams
  22276. const { protocol: scheme } = requestCurrentURL(request)
  22277. // 3. Switch on request’s current URL’s scheme and run the associated steps:
  22278. switch (scheme) {
  22279. case 'about:': {
  22280. // If request’s current URL’s path is the string "blank", then return a new response
  22281. // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,
  22282. // and body is the empty byte sequence as a body.
  22283. // Otherwise, return a network error.
  22284. return Promise.resolve(makeNetworkError('about scheme is not supported'))
  22285. }
  22286. case 'blob:': {
  22287. if (!resolveObjectURL) {
  22288. resolveObjectURL = (__nccwpck_require__(4300).resolveObjectURL)
  22289. }
  22290. // 1. Let blobURLEntry be request’s current URL’s blob URL entry.
  22291. const blobURLEntry = requestCurrentURL(request)
  22292. // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56
  22293. // Buffer.resolveObjectURL does not ignore URL queries.
  22294. if (blobURLEntry.search.length !== 0) {
  22295. return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))
  22296. }
  22297. const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())
  22298. // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
  22299. // object is not a Blob object, then return a network error.
  22300. if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {
  22301. return Promise.resolve(makeNetworkError('invalid method'))
  22302. }
  22303. // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.
  22304. const bodyWithType = safelyExtractBody(blobURLEntryObject)
  22305. // 4. Let body be bodyWithType’s body.
  22306. const body = bodyWithType[0]
  22307. // 5. Let length be body’s length, serialized and isomorphic encoded.
  22308. const length = isomorphicEncode(`${body.length}`)
  22309. // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence.
  22310. const type = bodyWithType[1] ?? ''
  22311. // 7. Return a new response whose status message is `OK`, header list is
  22312. // « (`Content-Length`, length), (`Content-Type`, type) », and body is body.
  22313. const response = makeResponse({
  22314. statusText: 'OK',
  22315. headersList: [
  22316. ['content-length', { name: 'Content-Length', value: length }],
  22317. ['content-type', { name: 'Content-Type', value: type }]
  22318. ]
  22319. })
  22320. response.body = body
  22321. return Promise.resolve(response)
  22322. }
  22323. case 'data:': {
  22324. // 1. Let dataURLStruct be the result of running the
  22325. // data: URL processor on request’s current URL.
  22326. const currentURL = requestCurrentURL(request)
  22327. const dataURLStruct = dataURLProcessor(currentURL)
  22328. // 2. If dataURLStruct is failure, then return a
  22329. // network error.
  22330. if (dataURLStruct === 'failure') {
  22331. return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
  22332. }
  22333. // 3. Let mimeType be dataURLStruct’s MIME type, serialized.
  22334. const mimeType = serializeAMimeType(dataURLStruct.mimeType)
  22335. // 4. Return a response whose status message is `OK`,
  22336. // header list is « (`Content-Type`, mimeType) »,
  22337. // and body is dataURLStruct’s body as a body.
  22338. return Promise.resolve(makeResponse({
  22339. statusText: 'OK',
  22340. headersList: [
  22341. ['content-type', { name: 'Content-Type', value: mimeType }]
  22342. ],
  22343. body: safelyExtractBody(dataURLStruct.body)[0]
  22344. }))
  22345. }
  22346. case 'file:': {
  22347. // For now, unfortunate as it is, file URLs are left as an exercise for the reader.
  22348. // When in doubt, return a network error.
  22349. return Promise.resolve(makeNetworkError('not implemented... yet...'))
  22350. }
  22351. case 'http:':
  22352. case 'https:': {
  22353. // Return the result of running HTTP fetch given fetchParams.
  22354. return httpFetch(fetchParams)
  22355. .catch((err) => makeNetworkError(err))
  22356. }
  22357. default: {
  22358. return Promise.resolve(makeNetworkError('unknown scheme'))
  22359. }
  22360. }
  22361. }
  22362. // https://fetch.spec.whatwg.org/#finalize-response
  22363. function finalizeResponse (fetchParams, response) {
  22364. // 1. Set fetchParams’s request’s done flag.
  22365. fetchParams.request.done = true
  22366. // 2, If fetchParams’s process response done is not null, then queue a fetch
  22367. // task to run fetchParams’s process response done given response, with
  22368. // fetchParams’s task destination.
  22369. if (fetchParams.processResponseDone != null) {
  22370. queueMicrotask(() => fetchParams.processResponseDone(response))
  22371. }
  22372. }
  22373. // https://fetch.spec.whatwg.org/#fetch-finale
  22374. function fetchFinale (fetchParams, response) {
  22375. // 1. If response is a network error, then:
  22376. if (response.type === 'error') {
  22377. // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».
  22378. response.urlList = [fetchParams.request.urlList[0]]
  22379. // 2. Set response’s timing info to the result of creating an opaque timing
  22380. // info for fetchParams’s timing info.
  22381. response.timingInfo = createOpaqueTimingInfo({
  22382. startTime: fetchParams.timingInfo.startTime
  22383. })
  22384. }
  22385. // 2. Let processResponseEndOfBody be the following steps:
  22386. const processResponseEndOfBody = () => {
  22387. // 1. Set fetchParams’s request’s done flag.
  22388. fetchParams.request.done = true
  22389. // If fetchParams’s process response end-of-body is not null,
  22390. // then queue a fetch task to run fetchParams’s process response
  22391. // end-of-body given response with fetchParams’s task destination.
  22392. if (fetchParams.processResponseEndOfBody != null) {
  22393. queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
  22394. }
  22395. }
  22396. // 3. If fetchParams’s process response is non-null, then queue a fetch task
  22397. // to run fetchParams’s process response given response, with fetchParams’s
  22398. // task destination.
  22399. if (fetchParams.processResponse != null) {
  22400. queueMicrotask(() => fetchParams.processResponse(response))
  22401. }
  22402. // 4. If response’s body is null, then run processResponseEndOfBody.
  22403. if (response.body == null) {
  22404. processResponseEndOfBody()
  22405. } else {
  22406. // 5. Otherwise:
  22407. // 1. Let transformStream be a new a TransformStream.
  22408. // 2. Let identityTransformAlgorithm be an algorithm which, given chunk,
  22409. // enqueues chunk in transformStream.
  22410. const identityTransformAlgorithm = (chunk, controller) => {
  22411. controller.enqueue(chunk)
  22412. }
  22413. // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm
  22414. // and flushAlgorithm set to processResponseEndOfBody.
  22415. const transformStream = new TransformStream({
  22416. start () {},
  22417. transform: identityTransformAlgorithm,
  22418. flush: processResponseEndOfBody
  22419. }, {
  22420. size () {
  22421. return 1
  22422. }
  22423. }, {
  22424. size () {
  22425. return 1
  22426. }
  22427. })
  22428. // 4. Set response’s body to the result of piping response’s body through transformStream.
  22429. response.body = { stream: response.body.stream.pipeThrough(transformStream) }
  22430. }
  22431. // 6. If fetchParams’s process response consume body is non-null, then:
  22432. if (fetchParams.processResponseConsumeBody != null) {
  22433. // 1. Let processBody given nullOrBytes be this step: run fetchParams’s
  22434. // process response consume body given response and nullOrBytes.
  22435. const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)
  22436. // 2. Let processBodyError be this step: run fetchParams’s process
  22437. // response consume body given response and failure.
  22438. const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure)
  22439. // 3. If response’s body is null, then queue a fetch task to run processBody
  22440. // given null, with fetchParams’s task destination.
  22441. if (response.body == null) {
  22442. queueMicrotask(() => processBody(null))
  22443. } else {
  22444. // 4. Otherwise, fully read response’s body given processBody, processBodyError,
  22445. // and fetchParams’s task destination.
  22446. return fullyReadBody(response.body, processBody, processBodyError)
  22447. }
  22448. return Promise.resolve()
  22449. }
  22450. }
  22451. // https://fetch.spec.whatwg.org/#http-fetch
  22452. async function httpFetch (fetchParams) {
  22453. // 1. Let request be fetchParams’s request.
  22454. const request = fetchParams.request
  22455. // 2. Let response be null.
  22456. let response = null
  22457. // 3. Let actualResponse be null.
  22458. let actualResponse = null
  22459. // 4. Let timingInfo be fetchParams’s timing info.
  22460. const timingInfo = fetchParams.timingInfo
  22461. // 5. If request’s service-workers mode is "all", then:
  22462. if (request.serviceWorkers === 'all') {
  22463. // TODO
  22464. }
  22465. // 6. If response is null, then:
  22466. if (response === null) {
  22467. // 1. If makeCORSPreflight is true and one of these conditions is true:
  22468. // TODO
  22469. // 2. If request’s redirect mode is "follow", then set request’s
  22470. // service-workers mode to "none".
  22471. if (request.redirect === 'follow') {
  22472. request.serviceWorkers = 'none'
  22473. }
  22474. // 3. Set response and actualResponse to the result of running
  22475. // HTTP-network-or-cache fetch given fetchParams.
  22476. actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)
  22477. // 4. If request’s response tainting is "cors" and a CORS check
  22478. // for request and response returns failure, then return a network error.
  22479. if (
  22480. request.responseTainting === 'cors' &&
  22481. corsCheck(request, response) === 'failure'
  22482. ) {
  22483. return makeNetworkError('cors failure')
  22484. }
  22485. // 5. If the TAO check for request and response returns failure, then set
  22486. // request’s timing allow failed flag.
  22487. if (TAOCheck(request, response) === 'failure') {
  22488. request.timingAllowFailed = true
  22489. }
  22490. }
  22491. // 7. If either request’s response tainting or response’s type
  22492. // is "opaque", and the cross-origin resource policy check with
  22493. // request’s origin, request’s client, request’s destination,
  22494. // and actualResponse returns blocked, then return a network error.
  22495. if (
  22496. (request.responseTainting === 'opaque' || response.type === 'opaque') &&
  22497. crossOriginResourcePolicyCheck(
  22498. request.origin,
  22499. request.client,
  22500. request.destination,
  22501. actualResponse
  22502. ) === 'blocked'
  22503. ) {
  22504. return makeNetworkError('blocked')
  22505. }
  22506. // 8. If actualResponse’s status is a redirect status, then:
  22507. if (redirectStatusSet.has(actualResponse.status)) {
  22508. // 1. If actualResponse’s status is not 303, request’s body is not null,
  22509. // and the connection uses HTTP/2, then user agents may, and are even
  22510. // encouraged to, transmit an RST_STREAM frame.
  22511. // See, https://github.com/whatwg/fetch/issues/1288
  22512. if (request.redirect !== 'manual') {
  22513. fetchParams.controller.connection.destroy()
  22514. }
  22515. // 2. Switch on request’s redirect mode:
  22516. if (request.redirect === 'error') {
  22517. // Set response to a network error.
  22518. response = makeNetworkError('unexpected redirect')
  22519. } else if (request.redirect === 'manual') {
  22520. // Set response to an opaque-redirect filtered response whose internal
  22521. // response is actualResponse.
  22522. // NOTE(spec): On the web this would return an `opaqueredirect` response,
  22523. // but that doesn't make sense server side.
  22524. // See https://github.com/nodejs/undici/issues/1193.
  22525. response = actualResponse
  22526. } else if (request.redirect === 'follow') {
  22527. // Set response to the result of running HTTP-redirect fetch given
  22528. // fetchParams and response.
  22529. response = await httpRedirectFetch(fetchParams, response)
  22530. } else {
  22531. assert(false)
  22532. }
  22533. }
  22534. // 9. Set response’s timing info to timingInfo.
  22535. response.timingInfo = timingInfo
  22536. // 10. Return response.
  22537. return response
  22538. }
  22539. // https://fetch.spec.whatwg.org/#http-redirect-fetch
  22540. function httpRedirectFetch (fetchParams, response) {
  22541. // 1. Let request be fetchParams’s request.
  22542. const request = fetchParams.request
  22543. // 2. Let actualResponse be response, if response is not a filtered response,
  22544. // and response’s internal response otherwise.
  22545. const actualResponse = response.internalResponse
  22546. ? response.internalResponse
  22547. : response
  22548. // 3. Let locationURL be actualResponse’s location URL given request’s current
  22549. // URL’s fragment.
  22550. let locationURL
  22551. try {
  22552. locationURL = responseLocationURL(
  22553. actualResponse,
  22554. requestCurrentURL(request).hash
  22555. )
  22556. // 4. If locationURL is null, then return response.
  22557. if (locationURL == null) {
  22558. return response
  22559. }
  22560. } catch (err) {
  22561. // 5. If locationURL is failure, then return a network error.
  22562. return Promise.resolve(makeNetworkError(err))
  22563. }
  22564. // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network
  22565. // error.
  22566. if (!urlIsHttpHttpsScheme(locationURL)) {
  22567. return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))
  22568. }
  22569. // 7. If request’s redirect count is 20, then return a network error.
  22570. if (request.redirectCount === 20) {
  22571. return Promise.resolve(makeNetworkError('redirect count exceeded'))
  22572. }
  22573. // 8. Increase request’s redirect count by 1.
  22574. request.redirectCount += 1
  22575. // 9. If request’s mode is "cors", locationURL includes credentials, and
  22576. // request’s origin is not same origin with locationURL’s origin, then return
  22577. // a network error.
  22578. if (
  22579. request.mode === 'cors' &&
  22580. (locationURL.username || locationURL.password) &&
  22581. !sameOrigin(request, locationURL)
  22582. ) {
  22583. return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"'))
  22584. }
  22585. // 10. If request’s response tainting is "cors" and locationURL includes
  22586. // credentials, then return a network error.
  22587. if (
  22588. request.responseTainting === 'cors' &&
  22589. (locationURL.username || locationURL.password)
  22590. ) {
  22591. return Promise.resolve(makeNetworkError(
  22592. 'URL cannot contain credentials for request mode "cors"'
  22593. ))
  22594. }
  22595. // 11. If actualResponse’s status is not 303, request’s body is non-null,
  22596. // and request’s body’s source is null, then return a network error.
  22597. if (
  22598. actualResponse.status !== 303 &&
  22599. request.body != null &&
  22600. request.body.source == null
  22601. ) {
  22602. return Promise.resolve(makeNetworkError())
  22603. }
  22604. // 12. If one of the following is true
  22605. // - actualResponse’s status is 301 or 302 and request’s method is `POST`
  22606. // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`
  22607. if (
  22608. ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||
  22609. (actualResponse.status === 303 &&
  22610. !GET_OR_HEAD.includes(request.method))
  22611. ) {
  22612. // then:
  22613. // 1. Set request’s method to `GET` and request’s body to null.
  22614. request.method = 'GET'
  22615. request.body = null
  22616. // 2. For each headerName of request-body-header name, delete headerName from
  22617. // request’s header list.
  22618. for (const headerName of requestBodyHeader) {
  22619. request.headersList.delete(headerName)
  22620. }
  22621. }
  22622. // 13. If request’s current URL’s origin is not same origin with locationURL’s
  22623. // origin, then for each headerName of CORS non-wildcard request-header name,
  22624. // delete headerName from request’s header list.
  22625. if (!sameOrigin(requestCurrentURL(request), locationURL)) {
  22626. // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
  22627. request.headersList.delete('authorization')
  22628. // https://fetch.spec.whatwg.org/#authentication-entries
  22629. request.headersList.delete('proxy-authorization', true)
  22630. // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
  22631. request.headersList.delete('cookie')
  22632. request.headersList.delete('host')
  22633. }
  22634. // 14. If request’s body is non-null, then set request’s body to the first return
  22635. // value of safely extracting request’s body’s source.
  22636. if (request.body != null) {
  22637. assert(request.body.source != null)
  22638. request.body = safelyExtractBody(request.body.source)[0]
  22639. }
  22640. // 15. Let timingInfo be fetchParams’s timing info.
  22641. const timingInfo = fetchParams.timingInfo
  22642. // 16. Set timingInfo’s redirect end time and post-redirect start time to the
  22643. // coarsened shared current time given fetchParams’s cross-origin isolated
  22644. // capability.
  22645. timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =
  22646. coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
  22647. // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s
  22648. // redirect start time to timingInfo’s start time.
  22649. if (timingInfo.redirectStartTime === 0) {
  22650. timingInfo.redirectStartTime = timingInfo.startTime
  22651. }
  22652. // 18. Append locationURL to request’s URL list.
  22653. request.urlList.push(locationURL)
  22654. // 19. Invoke set request’s referrer policy on redirect on request and
  22655. // actualResponse.
  22656. setRequestReferrerPolicyOnRedirect(request, actualResponse)
  22657. // 20. Return the result of running main fetch given fetchParams and true.
  22658. return mainFetch(fetchParams, true)
  22659. }
  22660. // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
  22661. async function httpNetworkOrCacheFetch (
  22662. fetchParams,
  22663. isAuthenticationFetch = false,
  22664. isNewConnectionFetch = false
  22665. ) {
  22666. // 1. Let request be fetchParams’s request.
  22667. const request = fetchParams.request
  22668. // 2. Let httpFetchParams be null.
  22669. let httpFetchParams = null
  22670. // 3. Let httpRequest be null.
  22671. let httpRequest = null
  22672. // 4. Let response be null.
  22673. let response = null
  22674. // 5. Let storedResponse be null.
  22675. // TODO: cache
  22676. // 6. Let httpCache be null.
  22677. const httpCache = null
  22678. // 7. Let the revalidatingFlag be unset.
  22679. const revalidatingFlag = false
  22680. // 8. Run these steps, but abort when the ongoing fetch is terminated:
  22681. // 1. If request’s window is "no-window" and request’s redirect mode is
  22682. // "error", then set httpFetchParams to fetchParams and httpRequest to
  22683. // request.
  22684. if (request.window === 'no-window' && request.redirect === 'error') {
  22685. httpFetchParams = fetchParams
  22686. httpRequest = request
  22687. } else {
  22688. // Otherwise:
  22689. // 1. Set httpRequest to a clone of request.
  22690. httpRequest = makeRequest(request)
  22691. // 2. Set httpFetchParams to a copy of fetchParams.
  22692. httpFetchParams = { ...fetchParams }
  22693. // 3. Set httpFetchParams’s request to httpRequest.
  22694. httpFetchParams.request = httpRequest
  22695. }
  22696. // 3. Let includeCredentials be true if one of
  22697. const includeCredentials =
  22698. request.credentials === 'include' ||
  22699. (request.credentials === 'same-origin' &&
  22700. request.responseTainting === 'basic')
  22701. // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s
  22702. // body is non-null; otherwise null.
  22703. const contentLength = httpRequest.body ? httpRequest.body.length : null
  22704. // 5. Let contentLengthHeaderValue be null.
  22705. let contentLengthHeaderValue = null
  22706. // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or
  22707. // `PUT`, then set contentLengthHeaderValue to `0`.
  22708. if (
  22709. httpRequest.body == null &&
  22710. ['POST', 'PUT'].includes(httpRequest.method)
  22711. ) {
  22712. contentLengthHeaderValue = '0'
  22713. }
  22714. // 7. If contentLength is non-null, then set contentLengthHeaderValue to
  22715. // contentLength, serialized and isomorphic encoded.
  22716. if (contentLength != null) {
  22717. contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)
  22718. }
  22719. // 8. If contentLengthHeaderValue is non-null, then append
  22720. // `Content-Length`/contentLengthHeaderValue to httpRequest’s header
  22721. // list.
  22722. if (contentLengthHeaderValue != null) {
  22723. httpRequest.headersList.append('content-length', contentLengthHeaderValue)
  22724. }
  22725. // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,
  22726. // contentLengthHeaderValue) to httpRequest’s header list.
  22727. // 10. If contentLength is non-null and httpRequest’s keepalive is true,
  22728. // then:
  22729. if (contentLength != null && httpRequest.keepalive) {
  22730. // NOTE: keepalive is a noop outside of browser context.
  22731. }
  22732. // 11. If httpRequest’s referrer is a URL, then append
  22733. // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,
  22734. // to httpRequest’s header list.
  22735. if (httpRequest.referrer instanceof URL) {
  22736. httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href))
  22737. }
  22738. // 12. Append a request `Origin` header for httpRequest.
  22739. appendRequestOriginHeader(httpRequest)
  22740. // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]
  22741. appendFetchMetadata(httpRequest)
  22742. // 14. If httpRequest’s header list does not contain `User-Agent`, then
  22743. // user agents should append `User-Agent`/default `User-Agent` value to
  22744. // httpRequest’s header list.
  22745. if (!httpRequest.headersList.contains('user-agent')) {
  22746. httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')
  22747. }
  22748. // 15. If httpRequest’s cache mode is "default" and httpRequest’s header
  22749. // list contains `If-Modified-Since`, `If-None-Match`,
  22750. // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set
  22751. // httpRequest’s cache mode to "no-store".
  22752. if (
  22753. httpRequest.cache === 'default' &&
  22754. (httpRequest.headersList.contains('if-modified-since') ||
  22755. httpRequest.headersList.contains('if-none-match') ||
  22756. httpRequest.headersList.contains('if-unmodified-since') ||
  22757. httpRequest.headersList.contains('if-match') ||
  22758. httpRequest.headersList.contains('if-range'))
  22759. ) {
  22760. httpRequest.cache = 'no-store'
  22761. }
  22762. // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent
  22763. // no-cache cache-control header modification flag is unset, and
  22764. // httpRequest’s header list does not contain `Cache-Control`, then append
  22765. // `Cache-Control`/`max-age=0` to httpRequest’s header list.
  22766. if (
  22767. httpRequest.cache === 'no-cache' &&
  22768. !httpRequest.preventNoCacheCacheControlHeaderModification &&
  22769. !httpRequest.headersList.contains('cache-control')
  22770. ) {
  22771. httpRequest.headersList.append('cache-control', 'max-age=0')
  22772. }
  22773. // 17. If httpRequest’s cache mode is "no-store" or "reload", then:
  22774. if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {
  22775. // 1. If httpRequest’s header list does not contain `Pragma`, then append
  22776. // `Pragma`/`no-cache` to httpRequest’s header list.
  22777. if (!httpRequest.headersList.contains('pragma')) {
  22778. httpRequest.headersList.append('pragma', 'no-cache')
  22779. }
  22780. // 2. If httpRequest’s header list does not contain `Cache-Control`,
  22781. // then append `Cache-Control`/`no-cache` to httpRequest’s header list.
  22782. if (!httpRequest.headersList.contains('cache-control')) {
  22783. httpRequest.headersList.append('cache-control', 'no-cache')
  22784. }
  22785. }
  22786. // 18. If httpRequest’s header list contains `Range`, then append
  22787. // `Accept-Encoding`/`identity` to httpRequest’s header list.
  22788. if (httpRequest.headersList.contains('range')) {
  22789. httpRequest.headersList.append('accept-encoding', 'identity')
  22790. }
  22791. // 19. Modify httpRequest’s header list per HTTP. Do not append a given
  22792. // header if httpRequest’s header list contains that header’s name.
  22793. // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
  22794. if (!httpRequest.headersList.contains('accept-encoding')) {
  22795. if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
  22796. httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate')
  22797. } else {
  22798. httpRequest.headersList.append('accept-encoding', 'gzip, deflate')
  22799. }
  22800. }
  22801. httpRequest.headersList.delete('host')
  22802. // 20. If includeCredentials is true, then:
  22803. if (includeCredentials) {
  22804. // 1. If the user agent is not configured to block cookies for httpRequest
  22805. // (see section 7 of [COOKIES]), then:
  22806. // TODO: credentials
  22807. // 2. If httpRequest’s header list does not contain `Authorization`, then:
  22808. // TODO: credentials
  22809. }
  22810. // 21. If there’s a proxy-authentication entry, use it as appropriate.
  22811. // TODO: proxy-authentication
  22812. // 22. Set httpCache to the result of determining the HTTP cache
  22813. // partition, given httpRequest.
  22814. // TODO: cache
  22815. // 23. If httpCache is null, then set httpRequest’s cache mode to
  22816. // "no-store".
  22817. if (httpCache == null) {
  22818. httpRequest.cache = 'no-store'
  22819. }
  22820. // 24. If httpRequest’s cache mode is neither "no-store" nor "reload",
  22821. // then:
  22822. if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {
  22823. // TODO: cache
  22824. }
  22825. // 9. If aborted, then return the appropriate network error for fetchParams.
  22826. // TODO
  22827. // 10. If response is null, then:
  22828. if (response == null) {
  22829. // 1. If httpRequest’s cache mode is "only-if-cached", then return a
  22830. // network error.
  22831. if (httpRequest.mode === 'only-if-cached') {
  22832. return makeNetworkError('only if cached')
  22833. }
  22834. // 2. Let forwardResponse be the result of running HTTP-network fetch
  22835. // given httpFetchParams, includeCredentials, and isNewConnectionFetch.
  22836. const forwardResponse = await httpNetworkFetch(
  22837. httpFetchParams,
  22838. includeCredentials,
  22839. isNewConnectionFetch
  22840. )
  22841. // 3. If httpRequest’s method is unsafe and forwardResponse’s status is
  22842. // in the range 200 to 399, inclusive, invalidate appropriate stored
  22843. // responses in httpCache, as per the "Invalidation" chapter of HTTP
  22844. // Caching, and set storedResponse to null. [HTTP-CACHING]
  22845. if (
  22846. !safeMethodsSet.has(httpRequest.method) &&
  22847. forwardResponse.status >= 200 &&
  22848. forwardResponse.status <= 399
  22849. ) {
  22850. // TODO: cache
  22851. }
  22852. // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,
  22853. // then:
  22854. if (revalidatingFlag && forwardResponse.status === 304) {
  22855. // TODO: cache
  22856. }
  22857. // 5. If response is null, then:
  22858. if (response == null) {
  22859. // 1. Set response to forwardResponse.
  22860. response = forwardResponse
  22861. // 2. Store httpRequest and forwardResponse in httpCache, as per the
  22862. // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING]
  22863. // TODO: cache
  22864. }
  22865. }
  22866. // 11. Set response’s URL list to a clone of httpRequest’s URL list.
  22867. response.urlList = [...httpRequest.urlList]
  22868. // 12. If httpRequest’s header list contains `Range`, then set response’s
  22869. // range-requested flag.
  22870. if (httpRequest.headersList.contains('range')) {
  22871. response.rangeRequested = true
  22872. }
  22873. // 13. Set response’s request-includes-credentials to includeCredentials.
  22874. response.requestIncludesCredentials = includeCredentials
  22875. // 14. If response’s status is 401, httpRequest’s response tainting is not
  22876. // "cors", includeCredentials is true, and request’s window is an environment
  22877. // settings object, then:
  22878. // TODO
  22879. // 15. If response’s status is 407, then:
  22880. if (response.status === 407) {
  22881. // 1. If request’s window is "no-window", then return a network error.
  22882. if (request.window === 'no-window') {
  22883. return makeNetworkError()
  22884. }
  22885. // 2. ???
  22886. // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22887. if (isCancelled(fetchParams)) {
  22888. return makeAppropriateNetworkError(fetchParams)
  22889. }
  22890. // 4. Prompt the end user as appropriate in request’s window and store
  22891. // the result as a proxy-authentication entry. [HTTP-AUTH]
  22892. // TODO: Invoke some kind of callback?
  22893. // 5. Set response to the result of running HTTP-network-or-cache fetch given
  22894. // fetchParams.
  22895. // TODO
  22896. return makeNetworkError('proxy authentication required')
  22897. }
  22898. // 16. If all of the following are true
  22899. if (
  22900. // response’s status is 421
  22901. response.status === 421 &&
  22902. // isNewConnectionFetch is false
  22903. !isNewConnectionFetch &&
  22904. // request’s body is null, or request’s body is non-null and request’s body’s source is non-null
  22905. (request.body == null || request.body.source != null)
  22906. ) {
  22907. // then:
  22908. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22909. if (isCancelled(fetchParams)) {
  22910. return makeAppropriateNetworkError(fetchParams)
  22911. }
  22912. // 2. Set response to the result of running HTTP-network-or-cache
  22913. // fetch given fetchParams, isAuthenticationFetch, and true.
  22914. // TODO (spec): The spec doesn't specify this but we need to cancel
  22915. // the active response before we can start a new one.
  22916. // https://github.com/whatwg/fetch/issues/1293
  22917. fetchParams.controller.connection.destroy()
  22918. response = await httpNetworkOrCacheFetch(
  22919. fetchParams,
  22920. isAuthenticationFetch,
  22921. true
  22922. )
  22923. }
  22924. // 17. If isAuthenticationFetch is true, then create an authentication entry
  22925. if (isAuthenticationFetch) {
  22926. // TODO
  22927. }
  22928. // 18. Return response.
  22929. return response
  22930. }
  22931. // https://fetch.spec.whatwg.org/#http-network-fetch
  22932. async function httpNetworkFetch (
  22933. fetchParams,
  22934. includeCredentials = false,
  22935. forceNewConnection = false
  22936. ) {
  22937. assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)
  22938. fetchParams.controller.connection = {
  22939. abort: null,
  22940. destroyed: false,
  22941. destroy (err) {
  22942. if (!this.destroyed) {
  22943. this.destroyed = true
  22944. this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
  22945. }
  22946. }
  22947. }
  22948. // 1. Let request be fetchParams’s request.
  22949. const request = fetchParams.request
  22950. // 2. Let response be null.
  22951. let response = null
  22952. // 3. Let timingInfo be fetchParams’s timing info.
  22953. const timingInfo = fetchParams.timingInfo
  22954. // 4. Let httpCache be the result of determining the HTTP cache partition,
  22955. // given request.
  22956. // TODO: cache
  22957. const httpCache = null
  22958. // 5. If httpCache is null, then set request’s cache mode to "no-store".
  22959. if (httpCache == null) {
  22960. request.cache = 'no-store'
  22961. }
  22962. // 6. Let networkPartitionKey be the result of determining the network
  22963. // partition key given request.
  22964. // TODO
  22965. // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise
  22966. // "no".
  22967. const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars
  22968. // 8. Switch on request’s mode:
  22969. if (request.mode === 'websocket') {
  22970. // Let connection be the result of obtaining a WebSocket connection,
  22971. // given request’s current URL.
  22972. // TODO
  22973. } else {
  22974. // Let connection be the result of obtaining a connection, given
  22975. // networkPartitionKey, request’s current URL’s origin,
  22976. // includeCredentials, and forceNewConnection.
  22977. // TODO
  22978. }
  22979. // 9. Run these steps, but abort when the ongoing fetch is terminated:
  22980. // 1. If connection is failure, then return a network error.
  22981. // 2. Set timingInfo’s final connection timing info to the result of
  22982. // calling clamp and coarsen connection timing info with connection’s
  22983. // timing info, timingInfo’s post-redirect start time, and fetchParams’s
  22984. // cross-origin isolated capability.
  22985. // 3. If connection is not an HTTP/2 connection, request’s body is non-null,
  22986. // and request’s body’s source is null, then append (`Transfer-Encoding`,
  22987. // `chunked`) to request’s header list.
  22988. // 4. Set timingInfo’s final network-request start time to the coarsened
  22989. // shared current time given fetchParams’s cross-origin isolated
  22990. // capability.
  22991. // 5. Set response to the result of making an HTTP request over connection
  22992. // using request with the following caveats:
  22993. // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]
  22994. // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]
  22995. // - If request’s body is non-null, and request’s body’s source is null,
  22996. // then the user agent may have a buffer of up to 64 kibibytes and store
  22997. // a part of request’s body in that buffer. If the user agent reads from
  22998. // request’s body beyond that buffer’s size and the user agent needs to
  22999. // resend request, then instead return a network error.
  23000. // - Set timingInfo’s final network-response start time to the coarsened
  23001. // shared current time given fetchParams’s cross-origin isolated capability,
  23002. // immediately after the user agent’s HTTP parser receives the first byte
  23003. // of the response (e.g., frame header bytes for HTTP/2 or response status
  23004. // line for HTTP/1.x).
  23005. // - Wait until all the headers are transmitted.
  23006. // - Any responses whose status is in the range 100 to 199, inclusive,
  23007. // and is not 101, are to be ignored, except for the purposes of setting
  23008. // timingInfo’s final network-response start time above.
  23009. // - If request’s header list contains `Transfer-Encoding`/`chunked` and
  23010. // response is transferred via HTTP/1.0 or older, then return a network
  23011. // error.
  23012. // - If the HTTP request results in a TLS client certificate dialog, then:
  23013. // 1. If request’s window is an environment settings object, make the
  23014. // dialog available in request’s window.
  23015. // 2. Otherwise, return a network error.
  23016. // To transmit request’s body body, run these steps:
  23017. let requestBody = null
  23018. // 1. If body is null and fetchParams’s process request end-of-body is
  23019. // non-null, then queue a fetch task given fetchParams’s process request
  23020. // end-of-body and fetchParams’s task destination.
  23021. if (request.body == null && fetchParams.processRequestEndOfBody) {
  23022. queueMicrotask(() => fetchParams.processRequestEndOfBody())
  23023. } else if (request.body != null) {
  23024. // 2. Otherwise, if body is non-null:
  23025. // 1. Let processBodyChunk given bytes be these steps:
  23026. const processBodyChunk = async function * (bytes) {
  23027. // 1. If the ongoing fetch is terminated, then abort these steps.
  23028. if (isCancelled(fetchParams)) {
  23029. return
  23030. }
  23031. // 2. Run this step in parallel: transmit bytes.
  23032. yield bytes
  23033. // 3. If fetchParams’s process request body is non-null, then run
  23034. // fetchParams’s process request body given bytes’s length.
  23035. fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)
  23036. }
  23037. // 2. Let processEndOfBody be these steps:
  23038. const processEndOfBody = () => {
  23039. // 1. If fetchParams is canceled, then abort these steps.
  23040. if (isCancelled(fetchParams)) {
  23041. return
  23042. }
  23043. // 2. If fetchParams’s process request end-of-body is non-null,
  23044. // then run fetchParams’s process request end-of-body.
  23045. if (fetchParams.processRequestEndOfBody) {
  23046. fetchParams.processRequestEndOfBody()
  23047. }
  23048. }
  23049. // 3. Let processBodyError given e be these steps:
  23050. const processBodyError = (e) => {
  23051. // 1. If fetchParams is canceled, then abort these steps.
  23052. if (isCancelled(fetchParams)) {
  23053. return
  23054. }
  23055. // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller.
  23056. if (e.name === 'AbortError') {
  23057. fetchParams.controller.abort()
  23058. } else {
  23059. fetchParams.controller.terminate(e)
  23060. }
  23061. }
  23062. // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,
  23063. // processBodyError, and fetchParams’s task destination.
  23064. requestBody = (async function * () {
  23065. try {
  23066. for await (const bytes of request.body.stream) {
  23067. yield * processBodyChunk(bytes)
  23068. }
  23069. processEndOfBody()
  23070. } catch (err) {
  23071. processBodyError(err)
  23072. }
  23073. })()
  23074. }
  23075. try {
  23076. // socket is only provided for websockets
  23077. const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })
  23078. if (socket) {
  23079. response = makeResponse({ status, statusText, headersList, socket })
  23080. } else {
  23081. const iterator = body[Symbol.asyncIterator]()
  23082. fetchParams.controller.next = () => iterator.next()
  23083. response = makeResponse({ status, statusText, headersList })
  23084. }
  23085. } catch (err) {
  23086. // 10. If aborted, then:
  23087. if (err.name === 'AbortError') {
  23088. // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  23089. fetchParams.controller.connection.destroy()
  23090. // 2. Return the appropriate network error for fetchParams.
  23091. return makeAppropriateNetworkError(fetchParams, err)
  23092. }
  23093. return makeNetworkError(err)
  23094. }
  23095. // 11. Let pullAlgorithm be an action that resumes the ongoing fetch
  23096. // if it is suspended.
  23097. const pullAlgorithm = () => {
  23098. fetchParams.controller.resume()
  23099. }
  23100. // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
  23101. // controller with reason, given reason.
  23102. const cancelAlgorithm = (reason) => {
  23103. fetchParams.controller.abort(reason)
  23104. }
  23105. // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by
  23106. // the user agent.
  23107. // TODO
  23108. // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object
  23109. // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.
  23110. // TODO
  23111. // 15. Let stream be a new ReadableStream.
  23112. // 16. Set up stream with pullAlgorithm set to pullAlgorithm,
  23113. // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to
  23114. // highWaterMark, and sizeAlgorithm set to sizeAlgorithm.
  23115. if (!ReadableStream) {
  23116. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  23117. }
  23118. const stream = new ReadableStream(
  23119. {
  23120. async start (controller) {
  23121. fetchParams.controller.controller = controller
  23122. },
  23123. async pull (controller) {
  23124. await pullAlgorithm(controller)
  23125. },
  23126. async cancel (reason) {
  23127. await cancelAlgorithm(reason)
  23128. }
  23129. },
  23130. {
  23131. highWaterMark: 0,
  23132. size () {
  23133. return 1
  23134. }
  23135. }
  23136. )
  23137. // 17. Run these steps, but abort when the ongoing fetch is terminated:
  23138. // 1. Set response’s body to a new body whose stream is stream.
  23139. response.body = { stream }
  23140. // 2. If response is not a network error and request’s cache mode is
  23141. // not "no-store", then update response in httpCache for request.
  23142. // TODO
  23143. // 3. If includeCredentials is true and the user agent is not configured
  23144. // to block cookies for request (see section 7 of [COOKIES]), then run the
  23145. // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on
  23146. // the value of each header whose name is a byte-case-insensitive match for
  23147. // `Set-Cookie` in response’s header list, if any, and request’s current URL.
  23148. // TODO
  23149. // 18. If aborted, then:
  23150. // TODO
  23151. // 19. Run these steps in parallel:
  23152. // 1. Run these steps, but abort when fetchParams is canceled:
  23153. fetchParams.controller.on('terminated', onAborted)
  23154. fetchParams.controller.resume = async () => {
  23155. // 1. While true
  23156. while (true) {
  23157. // 1-3. See onData...
  23158. // 4. Set bytes to the result of handling content codings given
  23159. // codings and bytes.
  23160. let bytes
  23161. let isFailure
  23162. try {
  23163. const { done, value } = await fetchParams.controller.next()
  23164. if (isAborted(fetchParams)) {
  23165. break
  23166. }
  23167. bytes = done ? undefined : value
  23168. } catch (err) {
  23169. if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {
  23170. // zlib doesn't like empty streams.
  23171. bytes = undefined
  23172. } else {
  23173. bytes = err
  23174. // err may be propagated from the result of calling readablestream.cancel,
  23175. // which might not be an error. https://github.com/nodejs/undici/issues/2009
  23176. isFailure = true
  23177. }
  23178. }
  23179. if (bytes === undefined) {
  23180. // 2. Otherwise, if the bytes transmission for response’s message
  23181. // body is done normally and stream is readable, then close
  23182. // stream, finalize response for fetchParams and response, and
  23183. // abort these in-parallel steps.
  23184. readableStreamClose(fetchParams.controller.controller)
  23185. finalizeResponse(fetchParams, response)
  23186. return
  23187. }
  23188. // 5. Increase timingInfo’s decoded body size by bytes’s length.
  23189. timingInfo.decodedBodySize += bytes?.byteLength ?? 0
  23190. // 6. If bytes is failure, then terminate fetchParams’s controller.
  23191. if (isFailure) {
  23192. fetchParams.controller.terminate(bytes)
  23193. return
  23194. }
  23195. // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes
  23196. // into stream.
  23197. fetchParams.controller.controller.enqueue(new Uint8Array(bytes))
  23198. // 8. If stream is errored, then terminate the ongoing fetch.
  23199. if (isErrored(stream)) {
  23200. fetchParams.controller.terminate()
  23201. return
  23202. }
  23203. // 9. If stream doesn’t need more data ask the user agent to suspend
  23204. // the ongoing fetch.
  23205. if (!fetchParams.controller.controller.desiredSize) {
  23206. return
  23207. }
  23208. }
  23209. }
  23210. // 2. If aborted, then:
  23211. function onAborted (reason) {
  23212. // 2. If fetchParams is aborted, then:
  23213. if (isAborted(fetchParams)) {
  23214. // 1. Set response’s aborted flag.
  23215. response.aborted = true
  23216. // 2. If stream is readable, then error stream with the result of
  23217. // deserialize a serialized abort reason given fetchParams’s
  23218. // controller’s serialized abort reason and an
  23219. // implementation-defined realm.
  23220. if (isReadable(stream)) {
  23221. fetchParams.controller.controller.error(
  23222. fetchParams.controller.serializedAbortReason
  23223. )
  23224. }
  23225. } else {
  23226. // 3. Otherwise, if stream is readable, error stream with a TypeError.
  23227. if (isReadable(stream)) {
  23228. fetchParams.controller.controller.error(new TypeError('terminated', {
  23229. cause: isErrorLike(reason) ? reason : undefined
  23230. }))
  23231. }
  23232. }
  23233. // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  23234. // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.
  23235. fetchParams.controller.connection.destroy()
  23236. }
  23237. // 20. Return response.
  23238. return response
  23239. async function dispatch ({ body }) {
  23240. const url = requestCurrentURL(request)
  23241. /** @type {import('../..').Agent} */
  23242. const agent = fetchParams.controller.dispatcher
  23243. return new Promise((resolve, reject) => agent.dispatch(
  23244. {
  23245. path: url.pathname + url.search,
  23246. origin: url.origin,
  23247. method: request.method,
  23248. body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
  23249. headers: request.headersList.entries,
  23250. maxRedirections: 0,
  23251. upgrade: request.mode === 'websocket' ? 'websocket' : undefined
  23252. },
  23253. {
  23254. body: null,
  23255. abort: null,
  23256. onConnect (abort) {
  23257. // TODO (fix): Do we need connection here?
  23258. const { connection } = fetchParams.controller
  23259. if (connection.destroyed) {
  23260. abort(new DOMException('The operation was aborted.', 'AbortError'))
  23261. } else {
  23262. fetchParams.controller.on('terminated', abort)
  23263. this.abort = connection.abort = abort
  23264. }
  23265. },
  23266. onHeaders (status, headersList, resume, statusText) {
  23267. if (status < 200) {
  23268. return
  23269. }
  23270. let codings = []
  23271. let location = ''
  23272. const headers = new Headers()
  23273. // For H2, the headers are a plain JS object
  23274. // We distinguish between them and iterate accordingly
  23275. if (Array.isArray(headersList)) {
  23276. for (let n = 0; n < headersList.length; n += 2) {
  23277. const key = headersList[n + 0].toString('latin1')
  23278. const val = headersList[n + 1].toString('latin1')
  23279. if (key.toLowerCase() === 'content-encoding') {
  23280. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  23281. // "All content-coding values are case-insensitive..."
  23282. codings = val.toLowerCase().split(',').map((x) => x.trim())
  23283. } else if (key.toLowerCase() === 'location') {
  23284. location = val
  23285. }
  23286. headers[kHeadersList].append(key, val)
  23287. }
  23288. } else {
  23289. const keys = Object.keys(headersList)
  23290. for (const key of keys) {
  23291. const val = headersList[key]
  23292. if (key.toLowerCase() === 'content-encoding') {
  23293. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  23294. // "All content-coding values are case-insensitive..."
  23295. codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()
  23296. } else if (key.toLowerCase() === 'location') {
  23297. location = val
  23298. }
  23299. headers[kHeadersList].append(key, val)
  23300. }
  23301. }
  23302. this.body = new Readable({ read: resume })
  23303. const decoders = []
  23304. const willFollow = request.redirect === 'follow' &&
  23305. location &&
  23306. redirectStatusSet.has(status)
  23307. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
  23308. if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
  23309. for (const coding of codings) {
  23310. // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
  23311. if (coding === 'x-gzip' || coding === 'gzip') {
  23312. decoders.push(zlib.createGunzip({
  23313. // Be less strict when decoding compressed responses, since sometimes
  23314. // servers send slightly invalid responses that are still accepted
  23315. // by common browsers.
  23316. // Always using Z_SYNC_FLUSH is what cURL does.
  23317. flush: zlib.constants.Z_SYNC_FLUSH,
  23318. finishFlush: zlib.constants.Z_SYNC_FLUSH
  23319. }))
  23320. } else if (coding === 'deflate') {
  23321. decoders.push(zlib.createInflate())
  23322. } else if (coding === 'br') {
  23323. decoders.push(zlib.createBrotliDecompress())
  23324. } else {
  23325. decoders.length = 0
  23326. break
  23327. }
  23328. }
  23329. }
  23330. resolve({
  23331. status,
  23332. statusText,
  23333. headersList: headers[kHeadersList],
  23334. body: decoders.length
  23335. ? pipeline(this.body, ...decoders, () => { })
  23336. : this.body.on('error', () => {})
  23337. })
  23338. return true
  23339. },
  23340. onData (chunk) {
  23341. if (fetchParams.controller.dump) {
  23342. return
  23343. }
  23344. // 1. If one or more bytes have been transmitted from response’s
  23345. // message body, then:
  23346. // 1. Let bytes be the transmitted bytes.
  23347. const bytes = chunk
  23348. // 2. Let codings be the result of extracting header list values
  23349. // given `Content-Encoding` and response’s header list.
  23350. // See pullAlgorithm.
  23351. // 3. Increase timingInfo’s encoded body size by bytes’s length.
  23352. timingInfo.encodedBodySize += bytes.byteLength
  23353. // 4. See pullAlgorithm...
  23354. return this.body.push(bytes)
  23355. },
  23356. onComplete () {
  23357. if (this.abort) {
  23358. fetchParams.controller.off('terminated', this.abort)
  23359. }
  23360. fetchParams.controller.ended = true
  23361. this.body.push(null)
  23362. },
  23363. onError (error) {
  23364. if (this.abort) {
  23365. fetchParams.controller.off('terminated', this.abort)
  23366. }
  23367. this.body?.destroy(error)
  23368. fetchParams.controller.terminate(error)
  23369. reject(error)
  23370. },
  23371. onUpgrade (status, headersList, socket) {
  23372. if (status !== 101) {
  23373. return
  23374. }
  23375. const headers = new Headers()
  23376. for (let n = 0; n < headersList.length; n += 2) {
  23377. const key = headersList[n + 0].toString('latin1')
  23378. const val = headersList[n + 1].toString('latin1')
  23379. headers[kHeadersList].append(key, val)
  23380. }
  23381. resolve({
  23382. status,
  23383. statusText: STATUS_CODES[status],
  23384. headersList: headers[kHeadersList],
  23385. socket
  23386. })
  23387. return true
  23388. }
  23389. }
  23390. ))
  23391. }
  23392. }
  23393. module.exports = {
  23394. fetch,
  23395. Fetch,
  23396. fetching,
  23397. finalizeAndReportTiming
  23398. }
  23399. /***/ }),
  23400. /***/ 8359:
  23401. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23402. "use strict";
  23403. /* globals AbortController */
  23404. const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(9990)
  23405. const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(554)
  23406. const { FinalizationRegistry } = __nccwpck_require__(6436)()
  23407. const util = __nccwpck_require__(3983)
  23408. const {
  23409. isValidHTTPToken,
  23410. sameOrigin,
  23411. normalizeMethod,
  23412. makePolicyContainer,
  23413. normalizeMethodRecord
  23414. } = __nccwpck_require__(2538)
  23415. const {
  23416. forbiddenMethodsSet,
  23417. corsSafeListedMethodsSet,
  23418. referrerPolicy,
  23419. requestRedirect,
  23420. requestMode,
  23421. requestCredentials,
  23422. requestCache,
  23423. requestDuplex
  23424. } = __nccwpck_require__(1037)
  23425. const { kEnumerableProperty } = util
  23426. const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(5861)
  23427. const { webidl } = __nccwpck_require__(1744)
  23428. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23429. const { URLSerializer } = __nccwpck_require__(685)
  23430. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23431. const assert = __nccwpck_require__(9491)
  23432. const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(2361)
  23433. let TransformStream = globalThis.TransformStream
  23434. const kAbortController = Symbol('abortController')
  23435. const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
  23436. signal.removeEventListener('abort', abort)
  23437. })
  23438. // https://fetch.spec.whatwg.org/#request-class
  23439. class Request {
  23440. // https://fetch.spec.whatwg.org/#dom-request
  23441. constructor (input, init = {}) {
  23442. if (input === kConstruct) {
  23443. return
  23444. }
  23445. webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' })
  23446. input = webidl.converters.RequestInfo(input)
  23447. init = webidl.converters.RequestInit(init)
  23448. // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
  23449. this[kRealm] = {
  23450. settingsObject: {
  23451. baseUrl: getGlobalOrigin(),
  23452. get origin () {
  23453. return this.baseUrl?.origin
  23454. },
  23455. policyContainer: makePolicyContainer()
  23456. }
  23457. }
  23458. // 1. Let request be null.
  23459. let request = null
  23460. // 2. Let fallbackMode be null.
  23461. let fallbackMode = null
  23462. // 3. Let baseURL be this’s relevant settings object’s API base URL.
  23463. const baseUrl = this[kRealm].settingsObject.baseUrl
  23464. // 4. Let signal be null.
  23465. let signal = null
  23466. // 5. If input is a string, then:
  23467. if (typeof input === 'string') {
  23468. // 1. Let parsedURL be the result of parsing input with baseURL.
  23469. // 2. If parsedURL is failure, then throw a TypeError.
  23470. let parsedURL
  23471. try {
  23472. parsedURL = new URL(input, baseUrl)
  23473. } catch (err) {
  23474. throw new TypeError('Failed to parse URL from ' + input, { cause: err })
  23475. }
  23476. // 3. If parsedURL includes credentials, then throw a TypeError.
  23477. if (parsedURL.username || parsedURL.password) {
  23478. throw new TypeError(
  23479. 'Request cannot be constructed from a URL that includes credentials: ' +
  23480. input
  23481. )
  23482. }
  23483. // 4. Set request to a new request whose URL is parsedURL.
  23484. request = makeRequest({ urlList: [parsedURL] })
  23485. // 5. Set fallbackMode to "cors".
  23486. fallbackMode = 'cors'
  23487. } else {
  23488. // 6. Otherwise:
  23489. // 7. Assert: input is a Request object.
  23490. assert(input instanceof Request)
  23491. // 8. Set request to input’s request.
  23492. request = input[kState]
  23493. // 9. Set signal to input’s signal.
  23494. signal = input[kSignal]
  23495. }
  23496. // 7. Let origin be this’s relevant settings object’s origin.
  23497. const origin = this[kRealm].settingsObject.origin
  23498. // 8. Let window be "client".
  23499. let window = 'client'
  23500. // 9. If request’s window is an environment settings object and its origin
  23501. // is same origin with origin, then set window to request’s window.
  23502. if (
  23503. request.window?.constructor?.name === 'EnvironmentSettingsObject' &&
  23504. sameOrigin(request.window, origin)
  23505. ) {
  23506. window = request.window
  23507. }
  23508. // 10. If init["window"] exists and is non-null, then throw a TypeError.
  23509. if (init.window != null) {
  23510. throw new TypeError(`'window' option '${window}' must be null`)
  23511. }
  23512. // 11. If init["window"] exists, then set window to "no-window".
  23513. if ('window' in init) {
  23514. window = 'no-window'
  23515. }
  23516. // 12. Set request to a new request with the following properties:
  23517. request = makeRequest({
  23518. // URL request’s URL.
  23519. // undici implementation note: this is set as the first item in request's urlList in makeRequest
  23520. // method request’s method.
  23521. method: request.method,
  23522. // header list A copy of request’s header list.
  23523. // undici implementation note: headersList is cloned in makeRequest
  23524. headersList: request.headersList,
  23525. // unsafe-request flag Set.
  23526. unsafeRequest: request.unsafeRequest,
  23527. // client This’s relevant settings object.
  23528. client: this[kRealm].settingsObject,
  23529. // window window.
  23530. window,
  23531. // priority request’s priority.
  23532. priority: request.priority,
  23533. // origin request’s origin. The propagation of the origin is only significant for navigation requests
  23534. // being handled by a service worker. In this scenario a request can have an origin that is different
  23535. // from the current client.
  23536. origin: request.origin,
  23537. // referrer request’s referrer.
  23538. referrer: request.referrer,
  23539. // referrer policy request’s referrer policy.
  23540. referrerPolicy: request.referrerPolicy,
  23541. // mode request’s mode.
  23542. mode: request.mode,
  23543. // credentials mode request’s credentials mode.
  23544. credentials: request.credentials,
  23545. // cache mode request’s cache mode.
  23546. cache: request.cache,
  23547. // redirect mode request’s redirect mode.
  23548. redirect: request.redirect,
  23549. // integrity metadata request’s integrity metadata.
  23550. integrity: request.integrity,
  23551. // keepalive request’s keepalive.
  23552. keepalive: request.keepalive,
  23553. // reload-navigation flag request’s reload-navigation flag.
  23554. reloadNavigation: request.reloadNavigation,
  23555. // history-navigation flag request’s history-navigation flag.
  23556. historyNavigation: request.historyNavigation,
  23557. // URL list A clone of request’s URL list.
  23558. urlList: [...request.urlList]
  23559. })
  23560. const initHasKey = Object.keys(init).length !== 0
  23561. // 13. If init is not empty, then:
  23562. if (initHasKey) {
  23563. // 1. If request’s mode is "navigate", then set it to "same-origin".
  23564. if (request.mode === 'navigate') {
  23565. request.mode = 'same-origin'
  23566. }
  23567. // 2. Unset request’s reload-navigation flag.
  23568. request.reloadNavigation = false
  23569. // 3. Unset request’s history-navigation flag.
  23570. request.historyNavigation = false
  23571. // 4. Set request’s origin to "client".
  23572. request.origin = 'client'
  23573. // 5. Set request’s referrer to "client"
  23574. request.referrer = 'client'
  23575. // 6. Set request’s referrer policy to the empty string.
  23576. request.referrerPolicy = ''
  23577. // 7. Set request’s URL to request’s current URL.
  23578. request.url = request.urlList[request.urlList.length - 1]
  23579. // 8. Set request’s URL list to « request’s URL ».
  23580. request.urlList = [request.url]
  23581. }
  23582. // 14. If init["referrer"] exists, then:
  23583. if (init.referrer !== undefined) {
  23584. // 1. Let referrer be init["referrer"].
  23585. const referrer = init.referrer
  23586. // 2. If referrer is the empty string, then set request’s referrer to "no-referrer".
  23587. if (referrer === '') {
  23588. request.referrer = 'no-referrer'
  23589. } else {
  23590. // 1. Let parsedReferrer be the result of parsing referrer with
  23591. // baseURL.
  23592. // 2. If parsedReferrer is failure, then throw a TypeError.
  23593. let parsedReferrer
  23594. try {
  23595. parsedReferrer = new URL(referrer, baseUrl)
  23596. } catch (err) {
  23597. throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err })
  23598. }
  23599. // 3. If one of the following is true
  23600. // - parsedReferrer’s scheme is "about" and path is the string "client"
  23601. // - parsedReferrer’s origin is not same origin with origin
  23602. // then set request’s referrer to "client".
  23603. if (
  23604. (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||
  23605. (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl))
  23606. ) {
  23607. request.referrer = 'client'
  23608. } else {
  23609. // 4. Otherwise, set request’s referrer to parsedReferrer.
  23610. request.referrer = parsedReferrer
  23611. }
  23612. }
  23613. }
  23614. // 15. If init["referrerPolicy"] exists, then set request’s referrer policy
  23615. // to it.
  23616. if (init.referrerPolicy !== undefined) {
  23617. request.referrerPolicy = init.referrerPolicy
  23618. }
  23619. // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise.
  23620. let mode
  23621. if (init.mode !== undefined) {
  23622. mode = init.mode
  23623. } else {
  23624. mode = fallbackMode
  23625. }
  23626. // 17. If mode is "navigate", then throw a TypeError.
  23627. if (mode === 'navigate') {
  23628. throw webidl.errors.exception({
  23629. header: 'Request constructor',
  23630. message: 'invalid request mode navigate.'
  23631. })
  23632. }
  23633. // 18. If mode is non-null, set request’s mode to mode.
  23634. if (mode != null) {
  23635. request.mode = mode
  23636. }
  23637. // 19. If init["credentials"] exists, then set request’s credentials mode
  23638. // to it.
  23639. if (init.credentials !== undefined) {
  23640. request.credentials = init.credentials
  23641. }
  23642. // 18. If init["cache"] exists, then set request’s cache mode to it.
  23643. if (init.cache !== undefined) {
  23644. request.cache = init.cache
  23645. }
  23646. // 21. If request’s cache mode is "only-if-cached" and request’s mode is
  23647. // not "same-origin", then throw a TypeError.
  23648. if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
  23649. throw new TypeError(
  23650. "'only-if-cached' can be set only with 'same-origin' mode"
  23651. )
  23652. }
  23653. // 22. If init["redirect"] exists, then set request’s redirect mode to it.
  23654. if (init.redirect !== undefined) {
  23655. request.redirect = init.redirect
  23656. }
  23657. // 23. If init["integrity"] exists, then set request’s integrity metadata to it.
  23658. if (init.integrity != null) {
  23659. request.integrity = String(init.integrity)
  23660. }
  23661. // 24. If init["keepalive"] exists, then set request’s keepalive to it.
  23662. if (init.keepalive !== undefined) {
  23663. request.keepalive = Boolean(init.keepalive)
  23664. }
  23665. // 25. If init["method"] exists, then:
  23666. if (init.method !== undefined) {
  23667. // 1. Let method be init["method"].
  23668. let method = init.method
  23669. // 2. If method is not a method or method is a forbidden method, then
  23670. // throw a TypeError.
  23671. if (!isValidHTTPToken(method)) {
  23672. throw new TypeError(`'${method}' is not a valid HTTP method.`)
  23673. }
  23674. if (forbiddenMethodsSet.has(method.toUpperCase())) {
  23675. throw new TypeError(`'${method}' HTTP method is unsupported.`)
  23676. }
  23677. // 3. Normalize method.
  23678. method = normalizeMethodRecord[method] ?? normalizeMethod(method)
  23679. // 4. Set request’s method to method.
  23680. request.method = method
  23681. }
  23682. // 26. If init["signal"] exists, then set signal to it.
  23683. if (init.signal !== undefined) {
  23684. signal = init.signal
  23685. }
  23686. // 27. Set this’s request to request.
  23687. this[kState] = request
  23688. // 28. Set this’s signal to a new AbortSignal object with this’s relevant
  23689. // Realm.
  23690. // TODO: could this be simplified with AbortSignal.any
  23691. // (https://dom.spec.whatwg.org/#dom-abortsignal-any)
  23692. const ac = new AbortController()
  23693. this[kSignal] = ac.signal
  23694. this[kSignal][kRealm] = this[kRealm]
  23695. // 29. If signal is not null, then make this’s signal follow signal.
  23696. if (signal != null) {
  23697. if (
  23698. !signal ||
  23699. typeof signal.aborted !== 'boolean' ||
  23700. typeof signal.addEventListener !== 'function'
  23701. ) {
  23702. throw new TypeError(
  23703. "Failed to construct 'Request': member signal is not of type AbortSignal."
  23704. )
  23705. }
  23706. if (signal.aborted) {
  23707. ac.abort(signal.reason)
  23708. } else {
  23709. // Keep a strong ref to ac while request object
  23710. // is alive. This is needed to prevent AbortController
  23711. // from being prematurely garbage collected.
  23712. // See, https://github.com/nodejs/undici/issues/1926.
  23713. this[kAbortController] = ac
  23714. const acRef = new WeakRef(ac)
  23715. const abort = function () {
  23716. const ac = acRef.deref()
  23717. if (ac !== undefined) {
  23718. ac.abort(this.reason)
  23719. }
  23720. }
  23721. // Third-party AbortControllers may not work with these.
  23722. // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.
  23723. try {
  23724. // If the max amount of listeners is equal to the default, increase it
  23725. // This is only available in node >= v19.9.0
  23726. if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {
  23727. setMaxListeners(100, signal)
  23728. } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {
  23729. setMaxListeners(100, signal)
  23730. }
  23731. } catch {}
  23732. util.addAbortListener(signal, abort)
  23733. requestFinalizer.register(ac, { signal, abort })
  23734. }
  23735. }
  23736. // 30. Set this’s headers to a new Headers object with this’s relevant
  23737. // Realm, whose header list is request’s header list and guard is
  23738. // "request".
  23739. this[kHeaders] = new Headers(kConstruct)
  23740. this[kHeaders][kHeadersList] = request.headersList
  23741. this[kHeaders][kGuard] = 'request'
  23742. this[kHeaders][kRealm] = this[kRealm]
  23743. // 31. If this’s request’s mode is "no-cors", then:
  23744. if (mode === 'no-cors') {
  23745. // 1. If this’s request’s method is not a CORS-safelisted method,
  23746. // then throw a TypeError.
  23747. if (!corsSafeListedMethodsSet.has(request.method)) {
  23748. throw new TypeError(
  23749. `'${request.method} is unsupported in no-cors mode.`
  23750. )
  23751. }
  23752. // 2. Set this’s headers’s guard to "request-no-cors".
  23753. this[kHeaders][kGuard] = 'request-no-cors'
  23754. }
  23755. // 32. If init is not empty, then:
  23756. if (initHasKey) {
  23757. /** @type {HeadersList} */
  23758. const headersList = this[kHeaders][kHeadersList]
  23759. // 1. Let headers be a copy of this’s headers and its associated header
  23760. // list.
  23761. // 2. If init["headers"] exists, then set headers to init["headers"].
  23762. const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)
  23763. // 3. Empty this’s headers’s header list.
  23764. headersList.clear()
  23765. // 4. If headers is a Headers object, then for each header in its header
  23766. // list, append header’s name/header’s value to this’s headers.
  23767. if (headers instanceof HeadersList) {
  23768. for (const [key, val] of headers) {
  23769. headersList.append(key, val)
  23770. }
  23771. // Note: Copy the `set-cookie` meta-data.
  23772. headersList.cookies = headers.cookies
  23773. } else {
  23774. // 5. Otherwise, fill this’s headers with headers.
  23775. fillHeaders(this[kHeaders], headers)
  23776. }
  23777. }
  23778. // 33. Let inputBody be input’s request’s body if input is a Request
  23779. // object; otherwise null.
  23780. const inputBody = input instanceof Request ? input[kState].body : null
  23781. // 34. If either init["body"] exists and is non-null or inputBody is
  23782. // non-null, and request’s method is `GET` or `HEAD`, then throw a
  23783. // TypeError.
  23784. if (
  23785. (init.body != null || inputBody != null) &&
  23786. (request.method === 'GET' || request.method === 'HEAD')
  23787. ) {
  23788. throw new TypeError('Request with GET/HEAD method cannot have body.')
  23789. }
  23790. // 35. Let initBody be null.
  23791. let initBody = null
  23792. // 36. If init["body"] exists and is non-null, then:
  23793. if (init.body != null) {
  23794. // 1. Let Content-Type be null.
  23795. // 2. Set initBody and Content-Type to the result of extracting
  23796. // init["body"], with keepalive set to request’s keepalive.
  23797. const [extractedBody, contentType] = extractBody(
  23798. init.body,
  23799. request.keepalive
  23800. )
  23801. initBody = extractedBody
  23802. // 3, If Content-Type is non-null and this’s headers’s header list does
  23803. // not contain `Content-Type`, then append `Content-Type`/Content-Type to
  23804. // this’s headers.
  23805. if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) {
  23806. this[kHeaders].append('content-type', contentType)
  23807. }
  23808. }
  23809. // 37. Let inputOrInitBody be initBody if it is non-null; otherwise
  23810. // inputBody.
  23811. const inputOrInitBody = initBody ?? inputBody
  23812. // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is
  23813. // null, then:
  23814. if (inputOrInitBody != null && inputOrInitBody.source == null) {
  23815. // 1. If initBody is non-null and init["duplex"] does not exist,
  23816. // then throw a TypeError.
  23817. if (initBody != null && init.duplex == null) {
  23818. throw new TypeError('RequestInit: duplex option is required when sending a body.')
  23819. }
  23820. // 2. If this’s request’s mode is neither "same-origin" nor "cors",
  23821. // then throw a TypeError.
  23822. if (request.mode !== 'same-origin' && request.mode !== 'cors') {
  23823. throw new TypeError(
  23824. 'If request is made from ReadableStream, mode should be "same-origin" or "cors"'
  23825. )
  23826. }
  23827. // 3. Set this’s request’s use-CORS-preflight flag.
  23828. request.useCORSPreflightFlag = true
  23829. }
  23830. // 39. Let finalBody be inputOrInitBody.
  23831. let finalBody = inputOrInitBody
  23832. // 40. If initBody is null and inputBody is non-null, then:
  23833. if (initBody == null && inputBody != null) {
  23834. // 1. If input is unusable, then throw a TypeError.
  23835. if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
  23836. throw new TypeError(
  23837. 'Cannot construct a Request with a Request object that has already been used.'
  23838. )
  23839. }
  23840. // 2. Set finalBody to the result of creating a proxy for inputBody.
  23841. if (!TransformStream) {
  23842. TransformStream = (__nccwpck_require__(5356).TransformStream)
  23843. }
  23844. // https://streams.spec.whatwg.org/#readablestream-create-a-proxy
  23845. const identityTransform = new TransformStream()
  23846. inputBody.stream.pipeThrough(identityTransform)
  23847. finalBody = {
  23848. source: inputBody.source,
  23849. length: inputBody.length,
  23850. stream: identityTransform.readable
  23851. }
  23852. }
  23853. // 41. Set this’s request’s body to finalBody.
  23854. this[kState].body = finalBody
  23855. }
  23856. // Returns request’s HTTP method, which is "GET" by default.
  23857. get method () {
  23858. webidl.brandCheck(this, Request)
  23859. // The method getter steps are to return this’s request’s method.
  23860. return this[kState].method
  23861. }
  23862. // Returns the URL of request as a string.
  23863. get url () {
  23864. webidl.brandCheck(this, Request)
  23865. // The url getter steps are to return this’s request’s URL, serialized.
  23866. return URLSerializer(this[kState].url)
  23867. }
  23868. // Returns a Headers object consisting of the headers associated with request.
  23869. // Note that headers added in the network layer by the user agent will not
  23870. // be accounted for in this object, e.g., the "Host" header.
  23871. get headers () {
  23872. webidl.brandCheck(this, Request)
  23873. // The headers getter steps are to return this’s headers.
  23874. return this[kHeaders]
  23875. }
  23876. // Returns the kind of resource requested by request, e.g., "document"
  23877. // or "script".
  23878. get destination () {
  23879. webidl.brandCheck(this, Request)
  23880. // The destination getter are to return this’s request’s destination.
  23881. return this[kState].destination
  23882. }
  23883. // Returns the referrer of request. Its value can be a same-origin URL if
  23884. // explicitly set in init, the empty string to indicate no referrer, and
  23885. // "about:client" when defaulting to the global’s default. This is used
  23886. // during fetching to determine the value of the `Referer` header of the
  23887. // request being made.
  23888. get referrer () {
  23889. webidl.brandCheck(this, Request)
  23890. // 1. If this’s request’s referrer is "no-referrer", then return the
  23891. // empty string.
  23892. if (this[kState].referrer === 'no-referrer') {
  23893. return ''
  23894. }
  23895. // 2. If this’s request’s referrer is "client", then return
  23896. // "about:client".
  23897. if (this[kState].referrer === 'client') {
  23898. return 'about:client'
  23899. }
  23900. // Return this’s request’s referrer, serialized.
  23901. return this[kState].referrer.toString()
  23902. }
  23903. // Returns the referrer policy associated with request.
  23904. // This is used during fetching to compute the value of the request’s
  23905. // referrer.
  23906. get referrerPolicy () {
  23907. webidl.brandCheck(this, Request)
  23908. // The referrerPolicy getter steps are to return this’s request’s referrer policy.
  23909. return this[kState].referrerPolicy
  23910. }
  23911. // Returns the mode associated with request, which is a string indicating
  23912. // whether the request will use CORS, or will be restricted to same-origin
  23913. // URLs.
  23914. get mode () {
  23915. webidl.brandCheck(this, Request)
  23916. // The mode getter steps are to return this’s request’s mode.
  23917. return this[kState].mode
  23918. }
  23919. // Returns the credentials mode associated with request,
  23920. // which is a string indicating whether credentials will be sent with the
  23921. // request always, never, or only when sent to a same-origin URL.
  23922. get credentials () {
  23923. // The credentials getter steps are to return this’s request’s credentials mode.
  23924. return this[kState].credentials
  23925. }
  23926. // Returns the cache mode associated with request,
  23927. // which is a string indicating how the request will
  23928. // interact with the browser’s cache when fetching.
  23929. get cache () {
  23930. webidl.brandCheck(this, Request)
  23931. // The cache getter steps are to return this’s request’s cache mode.
  23932. return this[kState].cache
  23933. }
  23934. // Returns the redirect mode associated with request,
  23935. // which is a string indicating how redirects for the
  23936. // request will be handled during fetching. A request
  23937. // will follow redirects by default.
  23938. get redirect () {
  23939. webidl.brandCheck(this, Request)
  23940. // The redirect getter steps are to return this’s request’s redirect mode.
  23941. return this[kState].redirect
  23942. }
  23943. // Returns request’s subresource integrity metadata, which is a
  23944. // cryptographic hash of the resource being fetched. Its value
  23945. // consists of multiple hashes separated by whitespace. [SRI]
  23946. get integrity () {
  23947. webidl.brandCheck(this, Request)
  23948. // The integrity getter steps are to return this’s request’s integrity
  23949. // metadata.
  23950. return this[kState].integrity
  23951. }
  23952. // Returns a boolean indicating whether or not request can outlive the
  23953. // global in which it was created.
  23954. get keepalive () {
  23955. webidl.brandCheck(this, Request)
  23956. // The keepalive getter steps are to return this’s request’s keepalive.
  23957. return this[kState].keepalive
  23958. }
  23959. // Returns a boolean indicating whether or not request is for a reload
  23960. // navigation.
  23961. get isReloadNavigation () {
  23962. webidl.brandCheck(this, Request)
  23963. // The isReloadNavigation getter steps are to return true if this’s
  23964. // request’s reload-navigation flag is set; otherwise false.
  23965. return this[kState].reloadNavigation
  23966. }
  23967. // Returns a boolean indicating whether or not request is for a history
  23968. // navigation (a.k.a. back-foward navigation).
  23969. get isHistoryNavigation () {
  23970. webidl.brandCheck(this, Request)
  23971. // The isHistoryNavigation getter steps are to return true if this’s request’s
  23972. // history-navigation flag is set; otherwise false.
  23973. return this[kState].historyNavigation
  23974. }
  23975. // Returns the signal associated with request, which is an AbortSignal
  23976. // object indicating whether or not request has been aborted, and its
  23977. // abort event handler.
  23978. get signal () {
  23979. webidl.brandCheck(this, Request)
  23980. // The signal getter steps are to return this’s signal.
  23981. return this[kSignal]
  23982. }
  23983. get body () {
  23984. webidl.brandCheck(this, Request)
  23985. return this[kState].body ? this[kState].body.stream : null
  23986. }
  23987. get bodyUsed () {
  23988. webidl.brandCheck(this, Request)
  23989. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  23990. }
  23991. get duplex () {
  23992. webidl.brandCheck(this, Request)
  23993. return 'half'
  23994. }
  23995. // Returns a clone of request.
  23996. clone () {
  23997. webidl.brandCheck(this, Request)
  23998. // 1. If this is unusable, then throw a TypeError.
  23999. if (this.bodyUsed || this.body?.locked) {
  24000. throw new TypeError('unusable')
  24001. }
  24002. // 2. Let clonedRequest be the result of cloning this’s request.
  24003. const clonedRequest = cloneRequest(this[kState])
  24004. // 3. Let clonedRequestObject be the result of creating a Request object,
  24005. // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.
  24006. const clonedRequestObject = new Request(kConstruct)
  24007. clonedRequestObject[kState] = clonedRequest
  24008. clonedRequestObject[kRealm] = this[kRealm]
  24009. clonedRequestObject[kHeaders] = new Headers(kConstruct)
  24010. clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList
  24011. clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  24012. clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  24013. // 4. Make clonedRequestObject’s signal follow this’s signal.
  24014. const ac = new AbortController()
  24015. if (this.signal.aborted) {
  24016. ac.abort(this.signal.reason)
  24017. } else {
  24018. util.addAbortListener(
  24019. this.signal,
  24020. () => {
  24021. ac.abort(this.signal.reason)
  24022. }
  24023. )
  24024. }
  24025. clonedRequestObject[kSignal] = ac.signal
  24026. // 4. Return clonedRequestObject.
  24027. return clonedRequestObject
  24028. }
  24029. }
  24030. mixinBody(Request)
  24031. function makeRequest (init) {
  24032. // https://fetch.spec.whatwg.org/#requests
  24033. const request = {
  24034. method: 'GET',
  24035. localURLsOnly: false,
  24036. unsafeRequest: false,
  24037. body: null,
  24038. client: null,
  24039. reservedClient: null,
  24040. replacesClientId: '',
  24041. window: 'client',
  24042. keepalive: false,
  24043. serviceWorkers: 'all',
  24044. initiator: '',
  24045. destination: '',
  24046. priority: null,
  24047. origin: 'client',
  24048. policyContainer: 'client',
  24049. referrer: 'client',
  24050. referrerPolicy: '',
  24051. mode: 'no-cors',
  24052. useCORSPreflightFlag: false,
  24053. credentials: 'same-origin',
  24054. useCredentials: false,
  24055. cache: 'default',
  24056. redirect: 'follow',
  24057. integrity: '',
  24058. cryptoGraphicsNonceMetadata: '',
  24059. parserMetadata: '',
  24060. reloadNavigation: false,
  24061. historyNavigation: false,
  24062. userActivation: false,
  24063. taintedOrigin: false,
  24064. redirectCount: 0,
  24065. responseTainting: 'basic',
  24066. preventNoCacheCacheControlHeaderModification: false,
  24067. done: false,
  24068. timingAllowFailed: false,
  24069. ...init,
  24070. headersList: init.headersList
  24071. ? new HeadersList(init.headersList)
  24072. : new HeadersList()
  24073. }
  24074. request.url = request.urlList[0]
  24075. return request
  24076. }
  24077. // https://fetch.spec.whatwg.org/#concept-request-clone
  24078. function cloneRequest (request) {
  24079. // To clone a request request, run these steps:
  24080. // 1. Let newRequest be a copy of request, except for its body.
  24081. const newRequest = makeRequest({ ...request, body: null })
  24082. // 2. If request’s body is non-null, set newRequest’s body to the
  24083. // result of cloning request’s body.
  24084. if (request.body != null) {
  24085. newRequest.body = cloneBody(request.body)
  24086. }
  24087. // 3. Return newRequest.
  24088. return newRequest
  24089. }
  24090. Object.defineProperties(Request.prototype, {
  24091. method: kEnumerableProperty,
  24092. url: kEnumerableProperty,
  24093. headers: kEnumerableProperty,
  24094. redirect: kEnumerableProperty,
  24095. clone: kEnumerableProperty,
  24096. signal: kEnumerableProperty,
  24097. duplex: kEnumerableProperty,
  24098. destination: kEnumerableProperty,
  24099. body: kEnumerableProperty,
  24100. bodyUsed: kEnumerableProperty,
  24101. isHistoryNavigation: kEnumerableProperty,
  24102. isReloadNavigation: kEnumerableProperty,
  24103. keepalive: kEnumerableProperty,
  24104. integrity: kEnumerableProperty,
  24105. cache: kEnumerableProperty,
  24106. credentials: kEnumerableProperty,
  24107. attribute: kEnumerableProperty,
  24108. referrerPolicy: kEnumerableProperty,
  24109. referrer: kEnumerableProperty,
  24110. mode: kEnumerableProperty,
  24111. [Symbol.toStringTag]: {
  24112. value: 'Request',
  24113. configurable: true
  24114. }
  24115. })
  24116. webidl.converters.Request = webidl.interfaceConverter(
  24117. Request
  24118. )
  24119. // https://fetch.spec.whatwg.org/#requestinfo
  24120. webidl.converters.RequestInfo = function (V) {
  24121. if (typeof V === 'string') {
  24122. return webidl.converters.USVString(V)
  24123. }
  24124. if (V instanceof Request) {
  24125. return webidl.converters.Request(V)
  24126. }
  24127. return webidl.converters.USVString(V)
  24128. }
  24129. webidl.converters.AbortSignal = webidl.interfaceConverter(
  24130. AbortSignal
  24131. )
  24132. // https://fetch.spec.whatwg.org/#requestinit
  24133. webidl.converters.RequestInit = webidl.dictionaryConverter([
  24134. {
  24135. key: 'method',
  24136. converter: webidl.converters.ByteString
  24137. },
  24138. {
  24139. key: 'headers',
  24140. converter: webidl.converters.HeadersInit
  24141. },
  24142. {
  24143. key: 'body',
  24144. converter: webidl.nullableConverter(
  24145. webidl.converters.BodyInit
  24146. )
  24147. },
  24148. {
  24149. key: 'referrer',
  24150. converter: webidl.converters.USVString
  24151. },
  24152. {
  24153. key: 'referrerPolicy',
  24154. converter: webidl.converters.DOMString,
  24155. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy
  24156. allowedValues: referrerPolicy
  24157. },
  24158. {
  24159. key: 'mode',
  24160. converter: webidl.converters.DOMString,
  24161. // https://fetch.spec.whatwg.org/#concept-request-mode
  24162. allowedValues: requestMode
  24163. },
  24164. {
  24165. key: 'credentials',
  24166. converter: webidl.converters.DOMString,
  24167. // https://fetch.spec.whatwg.org/#requestcredentials
  24168. allowedValues: requestCredentials
  24169. },
  24170. {
  24171. key: 'cache',
  24172. converter: webidl.converters.DOMString,
  24173. // https://fetch.spec.whatwg.org/#requestcache
  24174. allowedValues: requestCache
  24175. },
  24176. {
  24177. key: 'redirect',
  24178. converter: webidl.converters.DOMString,
  24179. // https://fetch.spec.whatwg.org/#requestredirect
  24180. allowedValues: requestRedirect
  24181. },
  24182. {
  24183. key: 'integrity',
  24184. converter: webidl.converters.DOMString
  24185. },
  24186. {
  24187. key: 'keepalive',
  24188. converter: webidl.converters.boolean
  24189. },
  24190. {
  24191. key: 'signal',
  24192. converter: webidl.nullableConverter(
  24193. (signal) => webidl.converters.AbortSignal(
  24194. signal,
  24195. { strict: false }
  24196. )
  24197. )
  24198. },
  24199. {
  24200. key: 'window',
  24201. converter: webidl.converters.any
  24202. },
  24203. {
  24204. key: 'duplex',
  24205. converter: webidl.converters.DOMString,
  24206. allowedValues: requestDuplex
  24207. }
  24208. ])
  24209. module.exports = { Request, makeRequest }
  24210. /***/ }),
  24211. /***/ 7823:
  24212. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24213. "use strict";
  24214. const { Headers, HeadersList, fill } = __nccwpck_require__(554)
  24215. const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(9990)
  24216. const util = __nccwpck_require__(3983)
  24217. const { kEnumerableProperty } = util
  24218. const {
  24219. isValidReasonPhrase,
  24220. isCancelled,
  24221. isAborted,
  24222. isBlobLike,
  24223. serializeJavascriptValueToJSONString,
  24224. isErrorLike,
  24225. isomorphicEncode
  24226. } = __nccwpck_require__(2538)
  24227. const {
  24228. redirectStatusSet,
  24229. nullBodyStatus,
  24230. DOMException
  24231. } = __nccwpck_require__(1037)
  24232. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  24233. const { webidl } = __nccwpck_require__(1744)
  24234. const { FormData } = __nccwpck_require__(2015)
  24235. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24236. const { URLSerializer } = __nccwpck_require__(685)
  24237. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  24238. const assert = __nccwpck_require__(9491)
  24239. const { types } = __nccwpck_require__(3837)
  24240. const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream)
  24241. const textEncoder = new TextEncoder('utf-8')
  24242. // https://fetch.spec.whatwg.org/#response-class
  24243. class Response {
  24244. // Creates network error Response.
  24245. static error () {
  24246. // TODO
  24247. const relevantRealm = { settingsObject: {} }
  24248. // The static error() method steps are to return the result of creating a
  24249. // Response object, given a new network error, "immutable", and this’s
  24250. // relevant Realm.
  24251. const responseObject = new Response()
  24252. responseObject[kState] = makeNetworkError()
  24253. responseObject[kRealm] = relevantRealm
  24254. responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList
  24255. responseObject[kHeaders][kGuard] = 'immutable'
  24256. responseObject[kHeaders][kRealm] = relevantRealm
  24257. return responseObject
  24258. }
  24259. // https://fetch.spec.whatwg.org/#dom-response-json
  24260. static json (data, init = {}) {
  24261. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' })
  24262. if (init !== null) {
  24263. init = webidl.converters.ResponseInit(init)
  24264. }
  24265. // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
  24266. const bytes = textEncoder.encode(
  24267. serializeJavascriptValueToJSONString(data)
  24268. )
  24269. // 2. Let body be the result of extracting bytes.
  24270. const body = extractBody(bytes)
  24271. // 3. Let responseObject be the result of creating a Response object, given a new response,
  24272. // "response", and this’s relevant Realm.
  24273. const relevantRealm = { settingsObject: {} }
  24274. const responseObject = new Response()
  24275. responseObject[kRealm] = relevantRealm
  24276. responseObject[kHeaders][kGuard] = 'response'
  24277. responseObject[kHeaders][kRealm] = relevantRealm
  24278. // 4. Perform initialize a response given responseObject, init, and (body, "application/json").
  24279. initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })
  24280. // 5. Return responseObject.
  24281. return responseObject
  24282. }
  24283. // Creates a redirect Response that redirects to url with status status.
  24284. static redirect (url, status = 302) {
  24285. const relevantRealm = { settingsObject: {} }
  24286. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' })
  24287. url = webidl.converters.USVString(url)
  24288. status = webidl.converters['unsigned short'](status)
  24289. // 1. Let parsedURL be the result of parsing url with current settings
  24290. // object’s API base URL.
  24291. // 2. If parsedURL is failure, then throw a TypeError.
  24292. // TODO: base-URL?
  24293. let parsedURL
  24294. try {
  24295. parsedURL = new URL(url, getGlobalOrigin())
  24296. } catch (err) {
  24297. throw Object.assign(new TypeError('Failed to parse URL from ' + url), {
  24298. cause: err
  24299. })
  24300. }
  24301. // 3. If status is not a redirect status, then throw a RangeError.
  24302. if (!redirectStatusSet.has(status)) {
  24303. throw new RangeError('Invalid status code ' + status)
  24304. }
  24305. // 4. Let responseObject be the result of creating a Response object,
  24306. // given a new response, "immutable", and this’s relevant Realm.
  24307. const responseObject = new Response()
  24308. responseObject[kRealm] = relevantRealm
  24309. responseObject[kHeaders][kGuard] = 'immutable'
  24310. responseObject[kHeaders][kRealm] = relevantRealm
  24311. // 5. Set responseObject’s response’s status to status.
  24312. responseObject[kState].status = status
  24313. // 6. Let value be parsedURL, serialized and isomorphic encoded.
  24314. const value = isomorphicEncode(URLSerializer(parsedURL))
  24315. // 7. Append `Location`/value to responseObject’s response’s header list.
  24316. responseObject[kState].headersList.append('location', value)
  24317. // 8. Return responseObject.
  24318. return responseObject
  24319. }
  24320. // https://fetch.spec.whatwg.org/#dom-response
  24321. constructor (body = null, init = {}) {
  24322. if (body !== null) {
  24323. body = webidl.converters.BodyInit(body)
  24324. }
  24325. init = webidl.converters.ResponseInit(init)
  24326. // TODO
  24327. this[kRealm] = { settingsObject: {} }
  24328. // 1. Set this’s response to a new response.
  24329. this[kState] = makeResponse({})
  24330. // 2. Set this’s headers to a new Headers object with this’s relevant
  24331. // Realm, whose header list is this’s response’s header list and guard
  24332. // is "response".
  24333. this[kHeaders] = new Headers(kConstruct)
  24334. this[kHeaders][kGuard] = 'response'
  24335. this[kHeaders][kHeadersList] = this[kState].headersList
  24336. this[kHeaders][kRealm] = this[kRealm]
  24337. // 3. Let bodyWithType be null.
  24338. let bodyWithType = null
  24339. // 4. If body is non-null, then set bodyWithType to the result of extracting body.
  24340. if (body != null) {
  24341. const [extractedBody, type] = extractBody(body)
  24342. bodyWithType = { body: extractedBody, type }
  24343. }
  24344. // 5. Perform initialize a response given this, init, and bodyWithType.
  24345. initializeResponse(this, init, bodyWithType)
  24346. }
  24347. // Returns response’s type, e.g., "cors".
  24348. get type () {
  24349. webidl.brandCheck(this, Response)
  24350. // The type getter steps are to return this’s response’s type.
  24351. return this[kState].type
  24352. }
  24353. // Returns response’s URL, if it has one; otherwise the empty string.
  24354. get url () {
  24355. webidl.brandCheck(this, Response)
  24356. const urlList = this[kState].urlList
  24357. // The url getter steps are to return the empty string if this’s
  24358. // response’s URL is null; otherwise this’s response’s URL,
  24359. // serialized with exclude fragment set to true.
  24360. const url = urlList[urlList.length - 1] ?? null
  24361. if (url === null) {
  24362. return ''
  24363. }
  24364. return URLSerializer(url, true)
  24365. }
  24366. // Returns whether response was obtained through a redirect.
  24367. get redirected () {
  24368. webidl.brandCheck(this, Response)
  24369. // The redirected getter steps are to return true if this’s response’s URL
  24370. // list has more than one item; otherwise false.
  24371. return this[kState].urlList.length > 1
  24372. }
  24373. // Returns response’s status.
  24374. get status () {
  24375. webidl.brandCheck(this, Response)
  24376. // The status getter steps are to return this’s response’s status.
  24377. return this[kState].status
  24378. }
  24379. // Returns whether response’s status is an ok status.
  24380. get ok () {
  24381. webidl.brandCheck(this, Response)
  24382. // The ok getter steps are to return true if this’s response’s status is an
  24383. // ok status; otherwise false.
  24384. return this[kState].status >= 200 && this[kState].status <= 299
  24385. }
  24386. // Returns response’s status message.
  24387. get statusText () {
  24388. webidl.brandCheck(this, Response)
  24389. // The statusText getter steps are to return this’s response’s status
  24390. // message.
  24391. return this[kState].statusText
  24392. }
  24393. // Returns response’s headers as Headers.
  24394. get headers () {
  24395. webidl.brandCheck(this, Response)
  24396. // The headers getter steps are to return this’s headers.
  24397. return this[kHeaders]
  24398. }
  24399. get body () {
  24400. webidl.brandCheck(this, Response)
  24401. return this[kState].body ? this[kState].body.stream : null
  24402. }
  24403. get bodyUsed () {
  24404. webidl.brandCheck(this, Response)
  24405. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  24406. }
  24407. // Returns a clone of response.
  24408. clone () {
  24409. webidl.brandCheck(this, Response)
  24410. // 1. If this is unusable, then throw a TypeError.
  24411. if (this.bodyUsed || (this.body && this.body.locked)) {
  24412. throw webidl.errors.exception({
  24413. header: 'Response.clone',
  24414. message: 'Body has already been consumed.'
  24415. })
  24416. }
  24417. // 2. Let clonedResponse be the result of cloning this’s response.
  24418. const clonedResponse = cloneResponse(this[kState])
  24419. // 3. Return the result of creating a Response object, given
  24420. // clonedResponse, this’s headers’s guard, and this’s relevant Realm.
  24421. const clonedResponseObject = new Response()
  24422. clonedResponseObject[kState] = clonedResponse
  24423. clonedResponseObject[kRealm] = this[kRealm]
  24424. clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList
  24425. clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  24426. clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  24427. return clonedResponseObject
  24428. }
  24429. }
  24430. mixinBody(Response)
  24431. Object.defineProperties(Response.prototype, {
  24432. type: kEnumerableProperty,
  24433. url: kEnumerableProperty,
  24434. status: kEnumerableProperty,
  24435. ok: kEnumerableProperty,
  24436. redirected: kEnumerableProperty,
  24437. statusText: kEnumerableProperty,
  24438. headers: kEnumerableProperty,
  24439. clone: kEnumerableProperty,
  24440. body: kEnumerableProperty,
  24441. bodyUsed: kEnumerableProperty,
  24442. [Symbol.toStringTag]: {
  24443. value: 'Response',
  24444. configurable: true
  24445. }
  24446. })
  24447. Object.defineProperties(Response, {
  24448. json: kEnumerableProperty,
  24449. redirect: kEnumerableProperty,
  24450. error: kEnumerableProperty
  24451. })
  24452. // https://fetch.spec.whatwg.org/#concept-response-clone
  24453. function cloneResponse (response) {
  24454. // To clone a response response, run these steps:
  24455. // 1. If response is a filtered response, then return a new identical
  24456. // filtered response whose internal response is a clone of response’s
  24457. // internal response.
  24458. if (response.internalResponse) {
  24459. return filterResponse(
  24460. cloneResponse(response.internalResponse),
  24461. response.type
  24462. )
  24463. }
  24464. // 2. Let newResponse be a copy of response, except for its body.
  24465. const newResponse = makeResponse({ ...response, body: null })
  24466. // 3. If response’s body is non-null, then set newResponse’s body to the
  24467. // result of cloning response’s body.
  24468. if (response.body != null) {
  24469. newResponse.body = cloneBody(response.body)
  24470. }
  24471. // 4. Return newResponse.
  24472. return newResponse
  24473. }
  24474. function makeResponse (init) {
  24475. return {
  24476. aborted: false,
  24477. rangeRequested: false,
  24478. timingAllowPassed: false,
  24479. requestIncludesCredentials: false,
  24480. type: 'default',
  24481. status: 200,
  24482. timingInfo: null,
  24483. cacheState: '',
  24484. statusText: '',
  24485. ...init,
  24486. headersList: init.headersList
  24487. ? new HeadersList(init.headersList)
  24488. : new HeadersList(),
  24489. urlList: init.urlList ? [...init.urlList] : []
  24490. }
  24491. }
  24492. function makeNetworkError (reason) {
  24493. const isError = isErrorLike(reason)
  24494. return makeResponse({
  24495. type: 'error',
  24496. status: 0,
  24497. error: isError
  24498. ? reason
  24499. : new Error(reason ? String(reason) : reason),
  24500. aborted: reason && reason.name === 'AbortError'
  24501. })
  24502. }
  24503. function makeFilteredResponse (response, state) {
  24504. state = {
  24505. internalResponse: response,
  24506. ...state
  24507. }
  24508. return new Proxy(response, {
  24509. get (target, p) {
  24510. return p in state ? state[p] : target[p]
  24511. },
  24512. set (target, p, value) {
  24513. assert(!(p in state))
  24514. target[p] = value
  24515. return true
  24516. }
  24517. })
  24518. }
  24519. // https://fetch.spec.whatwg.org/#concept-filtered-response
  24520. function filterResponse (response, type) {
  24521. // Set response to the following filtered response with response as its
  24522. // internal response, depending on request’s response tainting:
  24523. if (type === 'basic') {
  24524. // A basic filtered response is a filtered response whose type is "basic"
  24525. // and header list excludes any headers in internal response’s header list
  24526. // whose name is a forbidden response-header name.
  24527. // Note: undici does not implement forbidden response-header names
  24528. return makeFilteredResponse(response, {
  24529. type: 'basic',
  24530. headersList: response.headersList
  24531. })
  24532. } else if (type === 'cors') {
  24533. // A CORS filtered response is a filtered response whose type is "cors"
  24534. // and header list excludes any headers in internal response’s header
  24535. // list whose name is not a CORS-safelisted response-header name, given
  24536. // internal response’s CORS-exposed header-name list.
  24537. // Note: undici does not implement CORS-safelisted response-header names
  24538. return makeFilteredResponse(response, {
  24539. type: 'cors',
  24540. headersList: response.headersList
  24541. })
  24542. } else if (type === 'opaque') {
  24543. // An opaque filtered response is a filtered response whose type is
  24544. // "opaque", URL list is the empty list, status is 0, status message
  24545. // is the empty byte sequence, header list is empty, and body is null.
  24546. return makeFilteredResponse(response, {
  24547. type: 'opaque',
  24548. urlList: Object.freeze([]),
  24549. status: 0,
  24550. statusText: '',
  24551. body: null
  24552. })
  24553. } else if (type === 'opaqueredirect') {
  24554. // An opaque-redirect filtered response is a filtered response whose type
  24555. // is "opaqueredirect", status is 0, status message is the empty byte
  24556. // sequence, header list is empty, and body is null.
  24557. return makeFilteredResponse(response, {
  24558. type: 'opaqueredirect',
  24559. status: 0,
  24560. statusText: '',
  24561. headersList: [],
  24562. body: null
  24563. })
  24564. } else {
  24565. assert(false)
  24566. }
  24567. }
  24568. // https://fetch.spec.whatwg.org/#appropriate-network-error
  24569. function makeAppropriateNetworkError (fetchParams, err = null) {
  24570. // 1. Assert: fetchParams is canceled.
  24571. assert(isCancelled(fetchParams))
  24572. // 2. Return an aborted network error if fetchParams is aborted;
  24573. // otherwise return a network error.
  24574. return isAborted(fetchParams)
  24575. ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))
  24576. : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))
  24577. }
  24578. // https://whatpr.org/fetch/1392.html#initialize-a-response
  24579. function initializeResponse (response, init, body) {
  24580. // 1. If init["status"] is not in the range 200 to 599, inclusive, then
  24581. // throw a RangeError.
  24582. if (init.status !== null && (init.status < 200 || init.status > 599)) {
  24583. throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')
  24584. }
  24585. // 2. If init["statusText"] does not match the reason-phrase token production,
  24586. // then throw a TypeError.
  24587. if ('statusText' in init && init.statusText != null) {
  24588. // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:
  24589. // reason-phrase = *( HTAB / SP / VCHAR / obs-text )
  24590. if (!isValidReasonPhrase(String(init.statusText))) {
  24591. throw new TypeError('Invalid statusText')
  24592. }
  24593. }
  24594. // 3. Set response’s response’s status to init["status"].
  24595. if ('status' in init && init.status != null) {
  24596. response[kState].status = init.status
  24597. }
  24598. // 4. Set response’s response’s status message to init["statusText"].
  24599. if ('statusText' in init && init.statusText != null) {
  24600. response[kState].statusText = init.statusText
  24601. }
  24602. // 5. If init["headers"] exists, then fill response’s headers with init["headers"].
  24603. if ('headers' in init && init.headers != null) {
  24604. fill(response[kHeaders], init.headers)
  24605. }
  24606. // 6. If body was given, then:
  24607. if (body) {
  24608. // 1. If response's status is a null body status, then throw a TypeError.
  24609. if (nullBodyStatus.includes(response.status)) {
  24610. throw webidl.errors.exception({
  24611. header: 'Response constructor',
  24612. message: 'Invalid response status code ' + response.status
  24613. })
  24614. }
  24615. // 2. Set response's body to body's body.
  24616. response[kState].body = body.body
  24617. // 3. If body's type is non-null and response's header list does not contain
  24618. // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.
  24619. if (body.type != null && !response[kState].headersList.contains('Content-Type')) {
  24620. response[kState].headersList.append('content-type', body.type)
  24621. }
  24622. }
  24623. }
  24624. webidl.converters.ReadableStream = webidl.interfaceConverter(
  24625. ReadableStream
  24626. )
  24627. webidl.converters.FormData = webidl.interfaceConverter(
  24628. FormData
  24629. )
  24630. webidl.converters.URLSearchParams = webidl.interfaceConverter(
  24631. URLSearchParams
  24632. )
  24633. // https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
  24634. webidl.converters.XMLHttpRequestBodyInit = function (V) {
  24635. if (typeof V === 'string') {
  24636. return webidl.converters.USVString(V)
  24637. }
  24638. if (isBlobLike(V)) {
  24639. return webidl.converters.Blob(V, { strict: false })
  24640. }
  24641. if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) {
  24642. return webidl.converters.BufferSource(V)
  24643. }
  24644. if (util.isFormDataLike(V)) {
  24645. return webidl.converters.FormData(V, { strict: false })
  24646. }
  24647. if (V instanceof URLSearchParams) {
  24648. return webidl.converters.URLSearchParams(V)
  24649. }
  24650. return webidl.converters.DOMString(V)
  24651. }
  24652. // https://fetch.spec.whatwg.org/#bodyinit
  24653. webidl.converters.BodyInit = function (V) {
  24654. if (V instanceof ReadableStream) {
  24655. return webidl.converters.ReadableStream(V)
  24656. }
  24657. // Note: the spec doesn't include async iterables,
  24658. // this is an undici extension.
  24659. if (V?.[Symbol.asyncIterator]) {
  24660. return V
  24661. }
  24662. return webidl.converters.XMLHttpRequestBodyInit(V)
  24663. }
  24664. webidl.converters.ResponseInit = webidl.dictionaryConverter([
  24665. {
  24666. key: 'status',
  24667. converter: webidl.converters['unsigned short'],
  24668. defaultValue: 200
  24669. },
  24670. {
  24671. key: 'statusText',
  24672. converter: webidl.converters.ByteString,
  24673. defaultValue: ''
  24674. },
  24675. {
  24676. key: 'headers',
  24677. converter: webidl.converters.HeadersInit
  24678. }
  24679. ])
  24680. module.exports = {
  24681. makeNetworkError,
  24682. makeResponse,
  24683. makeAppropriateNetworkError,
  24684. filterResponse,
  24685. Response,
  24686. cloneResponse
  24687. }
  24688. /***/ }),
  24689. /***/ 5861:
  24690. /***/ ((module) => {
  24691. "use strict";
  24692. module.exports = {
  24693. kUrl: Symbol('url'),
  24694. kHeaders: Symbol('headers'),
  24695. kSignal: Symbol('signal'),
  24696. kState: Symbol('state'),
  24697. kGuard: Symbol('guard'),
  24698. kRealm: Symbol('realm')
  24699. }
  24700. /***/ }),
  24701. /***/ 2538:
  24702. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24703. "use strict";
  24704. const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037)
  24705. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24706. const { performance } = __nccwpck_require__(4074)
  24707. const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983)
  24708. const assert = __nccwpck_require__(9491)
  24709. const { isUint8Array } = __nccwpck_require__(9830)
  24710. let supportedHashes = []
  24711. // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable
  24712. /** @type {import('crypto')|undefined} */
  24713. let crypto
  24714. try {
  24715. crypto = __nccwpck_require__(6113)
  24716. const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']
  24717. supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))
  24718. /* c8 ignore next 3 */
  24719. } catch {
  24720. }
  24721. function responseURL (response) {
  24722. // https://fetch.spec.whatwg.org/#responses
  24723. // A response has an associated URL. It is a pointer to the last URL
  24724. // in response’s URL list and null if response’s URL list is empty.
  24725. const urlList = response.urlList
  24726. const length = urlList.length
  24727. return length === 0 ? null : urlList[length - 1].toString()
  24728. }
  24729. // https://fetch.spec.whatwg.org/#concept-response-location-url
  24730. function responseLocationURL (response, requestFragment) {
  24731. // 1. If response’s status is not a redirect status, then return null.
  24732. if (!redirectStatusSet.has(response.status)) {
  24733. return null
  24734. }
  24735. // 2. Let location be the result of extracting header list values given
  24736. // `Location` and response’s header list.
  24737. let location = response.headersList.get('location')
  24738. // 3. If location is a header value, then set location to the result of
  24739. // parsing location with response’s URL.
  24740. if (location !== null && isValidHeaderValue(location)) {
  24741. location = new URL(location, responseURL(response))
  24742. }
  24743. // 4. If location is a URL whose fragment is null, then set location’s
  24744. // fragment to requestFragment.
  24745. if (location && !location.hash) {
  24746. location.hash = requestFragment
  24747. }
  24748. // 5. Return location.
  24749. return location
  24750. }
  24751. /** @returns {URL} */
  24752. function requestCurrentURL (request) {
  24753. return request.urlList[request.urlList.length - 1]
  24754. }
  24755. function requestBadPort (request) {
  24756. // 1. Let url be request’s current URL.
  24757. const url = requestCurrentURL(request)
  24758. // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,
  24759. // then return blocked.
  24760. if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {
  24761. return 'blocked'
  24762. }
  24763. // 3. Return allowed.
  24764. return 'allowed'
  24765. }
  24766. function isErrorLike (object) {
  24767. return object instanceof Error || (
  24768. object?.constructor?.name === 'Error' ||
  24769. object?.constructor?.name === 'DOMException'
  24770. )
  24771. }
  24772. // Check whether |statusText| is a ByteString and
  24773. // matches the Reason-Phrase token production.
  24774. // RFC 2616: https://tools.ietf.org/html/rfc2616
  24775. // RFC 7230: https://tools.ietf.org/html/rfc7230
  24776. // "reason-phrase = *( HTAB / SP / VCHAR / obs-text )"
  24777. // https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116
  24778. function isValidReasonPhrase (statusText) {
  24779. for (let i = 0; i < statusText.length; ++i) {
  24780. const c = statusText.charCodeAt(i)
  24781. if (
  24782. !(
  24783. (
  24784. c === 0x09 || // HTAB
  24785. (c >= 0x20 && c <= 0x7e) || // SP / VCHAR
  24786. (c >= 0x80 && c <= 0xff)
  24787. ) // obs-text
  24788. )
  24789. ) {
  24790. return false
  24791. }
  24792. }
  24793. return true
  24794. }
  24795. /**
  24796. * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
  24797. * @param {number} c
  24798. */
  24799. function isTokenCharCode (c) {
  24800. switch (c) {
  24801. case 0x22:
  24802. case 0x28:
  24803. case 0x29:
  24804. case 0x2c:
  24805. case 0x2f:
  24806. case 0x3a:
  24807. case 0x3b:
  24808. case 0x3c:
  24809. case 0x3d:
  24810. case 0x3e:
  24811. case 0x3f:
  24812. case 0x40:
  24813. case 0x5b:
  24814. case 0x5c:
  24815. case 0x5d:
  24816. case 0x7b:
  24817. case 0x7d:
  24818. // DQUOTE and "(),/:;<=>?@[\]{}"
  24819. return false
  24820. default:
  24821. // VCHAR %x21-7E
  24822. return c >= 0x21 && c <= 0x7e
  24823. }
  24824. }
  24825. /**
  24826. * @param {string} characters
  24827. */
  24828. function isValidHTTPToken (characters) {
  24829. if (characters.length === 0) {
  24830. return false
  24831. }
  24832. for (let i = 0; i < characters.length; ++i) {
  24833. if (!isTokenCharCode(characters.charCodeAt(i))) {
  24834. return false
  24835. }
  24836. }
  24837. return true
  24838. }
  24839. /**
  24840. * @see https://fetch.spec.whatwg.org/#header-name
  24841. * @param {string} potentialValue
  24842. */
  24843. function isValidHeaderName (potentialValue) {
  24844. return isValidHTTPToken(potentialValue)
  24845. }
  24846. /**
  24847. * @see https://fetch.spec.whatwg.org/#header-value
  24848. * @param {string} potentialValue
  24849. */
  24850. function isValidHeaderValue (potentialValue) {
  24851. // - Has no leading or trailing HTTP tab or space bytes.
  24852. // - Contains no 0x00 (NUL) or HTTP newline bytes.
  24853. if (
  24854. potentialValue.startsWith('\t') ||
  24855. potentialValue.startsWith(' ') ||
  24856. potentialValue.endsWith('\t') ||
  24857. potentialValue.endsWith(' ')
  24858. ) {
  24859. return false
  24860. }
  24861. if (
  24862. potentialValue.includes('\0') ||
  24863. potentialValue.includes('\r') ||
  24864. potentialValue.includes('\n')
  24865. ) {
  24866. return false
  24867. }
  24868. return true
  24869. }
  24870. // https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect
  24871. function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
  24872. // Given a request request and a response actualResponse, this algorithm
  24873. // updates request’s referrer policy according to the Referrer-Policy
  24874. // header (if any) in actualResponse.
  24875. // 1. Let policy be the result of executing § 8.1 Parse a referrer policy
  24876. // from a Referrer-Policy header on actualResponse.
  24877. // 8.1 Parse a referrer policy from a Referrer-Policy header
  24878. // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.
  24879. const { headersList } = actualResponse
  24880. // 2. Let policy be the empty string.
  24881. // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token.
  24882. // 4. Return policy.
  24883. const policyHeader = (headersList.get('referrer-policy') ?? '').split(',')
  24884. // Note: As the referrer-policy can contain multiple policies
  24885. // separated by comma, we need to loop through all of them
  24886. // and pick the first valid one.
  24887. // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy
  24888. let policy = ''
  24889. if (policyHeader.length > 0) {
  24890. // The right-most policy takes precedence.
  24891. // The left-most policy is the fallback.
  24892. for (let i = policyHeader.length; i !== 0; i--) {
  24893. const token = policyHeader[i - 1].trim()
  24894. if (referrerPolicyTokens.has(token)) {
  24895. policy = token
  24896. break
  24897. }
  24898. }
  24899. }
  24900. // 2. If policy is not the empty string, then set request’s referrer policy to policy.
  24901. if (policy !== '') {
  24902. request.referrerPolicy = policy
  24903. }
  24904. }
  24905. // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check
  24906. function crossOriginResourcePolicyCheck () {
  24907. // TODO
  24908. return 'allowed'
  24909. }
  24910. // https://fetch.spec.whatwg.org/#concept-cors-check
  24911. function corsCheck () {
  24912. // TODO
  24913. return 'success'
  24914. }
  24915. // https://fetch.spec.whatwg.org/#concept-tao-check
  24916. function TAOCheck () {
  24917. // TODO
  24918. return 'success'
  24919. }
  24920. function appendFetchMetadata (httpRequest) {
  24921. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header
  24922. // TODO
  24923. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header
  24924. // 1. Assert: r’s url is a potentially trustworthy URL.
  24925. // TODO
  24926. // 2. Let header be a Structured Header whose value is a token.
  24927. let header = null
  24928. // 3. Set header’s value to r’s mode.
  24929. header = httpRequest.mode
  24930. // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.
  24931. httpRequest.headersList.set('sec-fetch-mode', header)
  24932. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header
  24933. // TODO
  24934. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header
  24935. // TODO
  24936. }
  24937. // https://fetch.spec.whatwg.org/#append-a-request-origin-header
  24938. function appendRequestOriginHeader (request) {
  24939. // 1. Let serializedOrigin be the result of byte-serializing a request origin with request.
  24940. let serializedOrigin = request.origin
  24941. // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list.
  24942. if (request.responseTainting === 'cors' || request.mode === 'websocket') {
  24943. if (serializedOrigin) {
  24944. request.headersList.append('origin', serializedOrigin)
  24945. }
  24946. // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:
  24947. } else if (request.method !== 'GET' && request.method !== 'HEAD') {
  24948. // 1. Switch on request’s referrer policy:
  24949. switch (request.referrerPolicy) {
  24950. case 'no-referrer':
  24951. // Set serializedOrigin to `null`.
  24952. serializedOrigin = null
  24953. break
  24954. case 'no-referrer-when-downgrade':
  24955. case 'strict-origin':
  24956. case 'strict-origin-when-cross-origin':
  24957. // If request’s origin is a tuple origin, its scheme is "https", and request’s current URL’s scheme is not "https", then set serializedOrigin to `null`.
  24958. if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {
  24959. serializedOrigin = null
  24960. }
  24961. break
  24962. case 'same-origin':
  24963. // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`.
  24964. if (!sameOrigin(request, requestCurrentURL(request))) {
  24965. serializedOrigin = null
  24966. }
  24967. break
  24968. default:
  24969. // Do nothing.
  24970. }
  24971. if (serializedOrigin) {
  24972. // 2. Append (`Origin`, serializedOrigin) to request’s header list.
  24973. request.headersList.append('origin', serializedOrigin)
  24974. }
  24975. }
  24976. }
  24977. function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
  24978. // TODO
  24979. return performance.now()
  24980. }
  24981. // https://fetch.spec.whatwg.org/#create-an-opaque-timing-info
  24982. function createOpaqueTimingInfo (timingInfo) {
  24983. return {
  24984. startTime: timingInfo.startTime ?? 0,
  24985. redirectStartTime: 0,
  24986. redirectEndTime: 0,
  24987. postRedirectStartTime: timingInfo.startTime ?? 0,
  24988. finalServiceWorkerStartTime: 0,
  24989. finalNetworkResponseStartTime: 0,
  24990. finalNetworkRequestStartTime: 0,
  24991. endTime: 0,
  24992. encodedBodySize: 0,
  24993. decodedBodySize: 0,
  24994. finalConnectionTimingInfo: null
  24995. }
  24996. }
  24997. // https://html.spec.whatwg.org/multipage/origin.html#policy-container
  24998. function makePolicyContainer () {
  24999. // Note: the fetch spec doesn't make use of embedder policy or CSP list
  25000. return {
  25001. referrerPolicy: 'strict-origin-when-cross-origin'
  25002. }
  25003. }
  25004. // https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container
  25005. function clonePolicyContainer (policyContainer) {
  25006. return {
  25007. referrerPolicy: policyContainer.referrerPolicy
  25008. }
  25009. }
  25010. // https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
  25011. function determineRequestsReferrer (request) {
  25012. // 1. Let policy be request's referrer policy.
  25013. const policy = request.referrerPolicy
  25014. // Note: policy cannot (shouldn't) be null or an empty string.
  25015. assert(policy)
  25016. // 2. Let environment be request’s client.
  25017. let referrerSource = null
  25018. // 3. Switch on request’s referrer:
  25019. if (request.referrer === 'client') {
  25020. // Note: node isn't a browser and doesn't implement document/iframes,
  25021. // so we bypass this step and replace it with our own.
  25022. const globalOrigin = getGlobalOrigin()
  25023. if (!globalOrigin || globalOrigin.origin === 'null') {
  25024. return 'no-referrer'
  25025. }
  25026. // note: we need to clone it as it's mutated
  25027. referrerSource = new URL(globalOrigin)
  25028. } else if (request.referrer instanceof URL) {
  25029. // Let referrerSource be request’s referrer.
  25030. referrerSource = request.referrer
  25031. }
  25032. // 4. Let request’s referrerURL be the result of stripping referrerSource for
  25033. // use as a referrer.
  25034. let referrerURL = stripURLForReferrer(referrerSource)
  25035. // 5. Let referrerOrigin be the result of stripping referrerSource for use as
  25036. // a referrer, with the origin-only flag set to true.
  25037. const referrerOrigin = stripURLForReferrer(referrerSource, true)
  25038. // 6. If the result of serializing referrerURL is a string whose length is
  25039. // greater than 4096, set referrerURL to referrerOrigin.
  25040. if (referrerURL.toString().length > 4096) {
  25041. referrerURL = referrerOrigin
  25042. }
  25043. const areSameOrigin = sameOrigin(request, referrerURL)
  25044. const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&
  25045. !isURLPotentiallyTrustworthy(request.url)
  25046. // 8. Execute the switch statements corresponding to the value of policy:
  25047. switch (policy) {
  25048. case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)
  25049. case 'unsafe-url': return referrerURL
  25050. case 'same-origin':
  25051. return areSameOrigin ? referrerOrigin : 'no-referrer'
  25052. case 'origin-when-cross-origin':
  25053. return areSameOrigin ? referrerURL : referrerOrigin
  25054. case 'strict-origin-when-cross-origin': {
  25055. const currentURL = requestCurrentURL(request)
  25056. // 1. If the origin of referrerURL and the origin of request’s current
  25057. // URL are the same, then return referrerURL.
  25058. if (sameOrigin(referrerURL, currentURL)) {
  25059. return referrerURL
  25060. }
  25061. // 2. If referrerURL is a potentially trustworthy URL and request’s
  25062. // current URL is not a potentially trustworthy URL, then return no
  25063. // referrer.
  25064. if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
  25065. return 'no-referrer'
  25066. }
  25067. // 3. Return referrerOrigin.
  25068. return referrerOrigin
  25069. }
  25070. case 'strict-origin': // eslint-disable-line
  25071. /**
  25072. * 1. If referrerURL is a potentially trustworthy URL and
  25073. * request’s current URL is not a potentially trustworthy URL,
  25074. * then return no referrer.
  25075. * 2. Return referrerOrigin
  25076. */
  25077. case 'no-referrer-when-downgrade': // eslint-disable-line
  25078. /**
  25079. * 1. If referrerURL is a potentially trustworthy URL and
  25080. * request’s current URL is not a potentially trustworthy URL,
  25081. * then return no referrer.
  25082. * 2. Return referrerOrigin
  25083. */
  25084. default: // eslint-disable-line
  25085. return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin
  25086. }
  25087. }
  25088. /**
  25089. * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url
  25090. * @param {URL} url
  25091. * @param {boolean|undefined} originOnly
  25092. */
  25093. function stripURLForReferrer (url, originOnly) {
  25094. // 1. Assert: url is a URL.
  25095. assert(url instanceof URL)
  25096. // 2. If url’s scheme is a local scheme, then return no referrer.
  25097. if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {
  25098. return 'no-referrer'
  25099. }
  25100. // 3. Set url’s username to the empty string.
  25101. url.username = ''
  25102. // 4. Set url’s password to the empty string.
  25103. url.password = ''
  25104. // 5. Set url’s fragment to null.
  25105. url.hash = ''
  25106. // 6. If the origin-only flag is true, then:
  25107. if (originOnly) {
  25108. // 1. Set url’s path to « the empty string ».
  25109. url.pathname = ''
  25110. // 2. Set url’s query to null.
  25111. url.search = ''
  25112. }
  25113. // 7. Return url.
  25114. return url
  25115. }
  25116. function isURLPotentiallyTrustworthy (url) {
  25117. if (!(url instanceof URL)) {
  25118. return false
  25119. }
  25120. // If child of about, return true
  25121. if (url.href === 'about:blank' || url.href === 'about:srcdoc') {
  25122. return true
  25123. }
  25124. // If scheme is data, return true
  25125. if (url.protocol === 'data:') return true
  25126. // If file, return true
  25127. if (url.protocol === 'file:') return true
  25128. return isOriginPotentiallyTrustworthy(url.origin)
  25129. function isOriginPotentiallyTrustworthy (origin) {
  25130. // If origin is explicitly null, return false
  25131. if (origin == null || origin === 'null') return false
  25132. const originAsURL = new URL(origin)
  25133. // If secure, return true
  25134. if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {
  25135. return true
  25136. }
  25137. // If localhost or variants, return true
  25138. if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) ||
  25139. (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||
  25140. (originAsURL.hostname.endsWith('.localhost'))) {
  25141. return true
  25142. }
  25143. // If any other, return false
  25144. return false
  25145. }
  25146. }
  25147. /**
  25148. * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist
  25149. * @param {Uint8Array} bytes
  25150. * @param {string} metadataList
  25151. */
  25152. function bytesMatch (bytes, metadataList) {
  25153. // If node is not built with OpenSSL support, we cannot check
  25154. // a request's integrity, so allow it by default (the spec will
  25155. // allow requests if an invalid hash is given, as precedence).
  25156. /* istanbul ignore if: only if node is built with --without-ssl */
  25157. if (crypto === undefined) {
  25158. return true
  25159. }
  25160. // 1. Let parsedMetadata be the result of parsing metadataList.
  25161. const parsedMetadata = parseMetadata(metadataList)
  25162. // 2. If parsedMetadata is no metadata, return true.
  25163. if (parsedMetadata === 'no metadata') {
  25164. return true
  25165. }
  25166. // 3. If response is not eligible for integrity validation, return false.
  25167. // TODO
  25168. // 4. If parsedMetadata is the empty set, return true.
  25169. if (parsedMetadata.length === 0) {
  25170. return true
  25171. }
  25172. // 5. Let metadata be the result of getting the strongest
  25173. // metadata from parsedMetadata.
  25174. const strongest = getStrongestMetadata(parsedMetadata)
  25175. const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)
  25176. // 6. For each item in metadata:
  25177. for (const item of metadata) {
  25178. // 1. Let algorithm be the alg component of item.
  25179. const algorithm = item.algo
  25180. // 2. Let expectedValue be the val component of item.
  25181. const expectedValue = item.hash
  25182. // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e
  25183. // "be liberal with padding". This is annoying, and it's not even in the spec.
  25184. // 3. Let actualValue be the result of applying algorithm to bytes.
  25185. let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')
  25186. if (actualValue[actualValue.length - 1] === '=') {
  25187. if (actualValue[actualValue.length - 2] === '=') {
  25188. actualValue = actualValue.slice(0, -2)
  25189. } else {
  25190. actualValue = actualValue.slice(0, -1)
  25191. }
  25192. }
  25193. // 4. If actualValue is a case-sensitive match for expectedValue,
  25194. // return true.
  25195. if (compareBase64Mixed(actualValue, expectedValue)) {
  25196. return true
  25197. }
  25198. }
  25199. // 7. Return false.
  25200. return false
  25201. }
  25202. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options
  25203. // https://www.w3.org/TR/CSP2/#source-list-syntax
  25204. // https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1
  25205. const parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i
  25206. /**
  25207. * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
  25208. * @param {string} metadata
  25209. */
  25210. function parseMetadata (metadata) {
  25211. // 1. Let result be the empty set.
  25212. /** @type {{ algo: string, hash: string }[]} */
  25213. const result = []
  25214. // 2. Let empty be equal to true.
  25215. let empty = true
  25216. // 3. For each token returned by splitting metadata on spaces:
  25217. for (const token of metadata.split(' ')) {
  25218. // 1. Set empty to false.
  25219. empty = false
  25220. // 2. Parse token as a hash-with-options.
  25221. const parsedToken = parseHashWithOptions.exec(token)
  25222. // 3. If token does not parse, continue to the next token.
  25223. if (
  25224. parsedToken === null ||
  25225. parsedToken.groups === undefined ||
  25226. parsedToken.groups.algo === undefined
  25227. ) {
  25228. // Note: Chromium blocks the request at this point, but Firefox
  25229. // gives a warning that an invalid integrity was given. The
  25230. // correct behavior is to ignore these, and subsequently not
  25231. // check the integrity of the resource.
  25232. continue
  25233. }
  25234. // 4. Let algorithm be the hash-algo component of token.
  25235. const algorithm = parsedToken.groups.algo.toLowerCase()
  25236. // 5. If algorithm is a hash function recognized by the user
  25237. // agent, add the parsed token to result.
  25238. if (supportedHashes.includes(algorithm)) {
  25239. result.push(parsedToken.groups)
  25240. }
  25241. }
  25242. // 4. Return no metadata if empty is true, otherwise return result.
  25243. if (empty === true) {
  25244. return 'no metadata'
  25245. }
  25246. return result
  25247. }
  25248. /**
  25249. * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList
  25250. */
  25251. function getStrongestMetadata (metadataList) {
  25252. // Let algorithm be the algo component of the first item in metadataList.
  25253. // Can be sha256
  25254. let algorithm = metadataList[0].algo
  25255. // If the algorithm is sha512, then it is the strongest
  25256. // and we can return immediately
  25257. if (algorithm[3] === '5') {
  25258. return algorithm
  25259. }
  25260. for (let i = 1; i < metadataList.length; ++i) {
  25261. const metadata = metadataList[i]
  25262. // If the algorithm is sha512, then it is the strongest
  25263. // and we can break the loop immediately
  25264. if (metadata.algo[3] === '5') {
  25265. algorithm = 'sha512'
  25266. break
  25267. // If the algorithm is sha384, then a potential sha256 or sha384 is ignored
  25268. } else if (algorithm[3] === '3') {
  25269. continue
  25270. // algorithm is sha256, check if algorithm is sha384 and if so, set it as
  25271. // the strongest
  25272. } else if (metadata.algo[3] === '3') {
  25273. algorithm = 'sha384'
  25274. }
  25275. }
  25276. return algorithm
  25277. }
  25278. function filterMetadataListByAlgorithm (metadataList, algorithm) {
  25279. if (metadataList.length === 1) {
  25280. return metadataList
  25281. }
  25282. let pos = 0
  25283. for (let i = 0; i < metadataList.length; ++i) {
  25284. if (metadataList[i].algo === algorithm) {
  25285. metadataList[pos++] = metadataList[i]
  25286. }
  25287. }
  25288. metadataList.length = pos
  25289. return metadataList
  25290. }
  25291. /**
  25292. * Compares two base64 strings, allowing for base64url
  25293. * in the second string.
  25294. *
  25295. * @param {string} actualValue always base64
  25296. * @param {string} expectedValue base64 or base64url
  25297. * @returns {boolean}
  25298. */
  25299. function compareBase64Mixed (actualValue, expectedValue) {
  25300. if (actualValue.length !== expectedValue.length) {
  25301. return false
  25302. }
  25303. for (let i = 0; i < actualValue.length; ++i) {
  25304. if (actualValue[i] !== expectedValue[i]) {
  25305. if (
  25306. (actualValue[i] === '+' && expectedValue[i] === '-') ||
  25307. (actualValue[i] === '/' && expectedValue[i] === '_')
  25308. ) {
  25309. continue
  25310. }
  25311. return false
  25312. }
  25313. }
  25314. return true
  25315. }
  25316. // https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request
  25317. function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
  25318. // TODO
  25319. }
  25320. /**
  25321. * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}
  25322. * @param {URL} A
  25323. * @param {URL} B
  25324. */
  25325. function sameOrigin (A, B) {
  25326. // 1. If A and B are the same opaque origin, then return true.
  25327. if (A.origin === B.origin && A.origin === 'null') {
  25328. return true
  25329. }
  25330. // 2. If A and B are both tuple origins and their schemes,
  25331. // hosts, and port are identical, then return true.
  25332. if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {
  25333. return true
  25334. }
  25335. // 3. Return false.
  25336. return false
  25337. }
  25338. function createDeferredPromise () {
  25339. let res
  25340. let rej
  25341. const promise = new Promise((resolve, reject) => {
  25342. res = resolve
  25343. rej = reject
  25344. })
  25345. return { promise, resolve: res, reject: rej }
  25346. }
  25347. function isAborted (fetchParams) {
  25348. return fetchParams.controller.state === 'aborted'
  25349. }
  25350. function isCancelled (fetchParams) {
  25351. return fetchParams.controller.state === 'aborted' ||
  25352. fetchParams.controller.state === 'terminated'
  25353. }
  25354. const normalizeMethodRecord = {
  25355. delete: 'DELETE',
  25356. DELETE: 'DELETE',
  25357. get: 'GET',
  25358. GET: 'GET',
  25359. head: 'HEAD',
  25360. HEAD: 'HEAD',
  25361. options: 'OPTIONS',
  25362. OPTIONS: 'OPTIONS',
  25363. post: 'POST',
  25364. POST: 'POST',
  25365. put: 'PUT',
  25366. PUT: 'PUT'
  25367. }
  25368. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  25369. Object.setPrototypeOf(normalizeMethodRecord, null)
  25370. /**
  25371. * @see https://fetch.spec.whatwg.org/#concept-method-normalize
  25372. * @param {string} method
  25373. */
  25374. function normalizeMethod (method) {
  25375. return normalizeMethodRecord[method.toLowerCase()] ?? method
  25376. }
  25377. // https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
  25378. function serializeJavascriptValueToJSONString (value) {
  25379. // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).
  25380. const result = JSON.stringify(value)
  25381. // 2. If result is undefined, then throw a TypeError.
  25382. if (result === undefined) {
  25383. throw new TypeError('Value is not JSON serializable')
  25384. }
  25385. // 3. Assert: result is a string.
  25386. assert(typeof result === 'string')
  25387. // 4. Return result.
  25388. return result
  25389. }
  25390. // https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object
  25391. const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
  25392. /**
  25393. * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
  25394. * @param {() => unknown[]} iterator
  25395. * @param {string} name name of the instance
  25396. * @param {'key'|'value'|'key+value'} kind
  25397. */
  25398. function makeIterator (iterator, name, kind) {
  25399. const object = {
  25400. index: 0,
  25401. kind,
  25402. target: iterator
  25403. }
  25404. const i = {
  25405. next () {
  25406. // 1. Let interface be the interface for which the iterator prototype object exists.
  25407. // 2. Let thisValue be the this value.
  25408. // 3. Let object be ? ToObject(thisValue).
  25409. // 4. If object is a platform object, then perform a security
  25410. // check, passing:
  25411. // 5. If object is not a default iterator object for interface,
  25412. // then throw a TypeError.
  25413. if (Object.getPrototypeOf(this) !== i) {
  25414. throw new TypeError(
  25415. `'next' called on an object that does not implement interface ${name} Iterator.`
  25416. )
  25417. }
  25418. // 6. Let index be object’s index.
  25419. // 7. Let kind be object’s kind.
  25420. // 8. Let values be object’s target's value pairs to iterate over.
  25421. const { index, kind, target } = object
  25422. const values = target()
  25423. // 9. Let len be the length of values.
  25424. const len = values.length
  25425. // 10. If index is greater than or equal to len, then return
  25426. // CreateIterResultObject(undefined, true).
  25427. if (index >= len) {
  25428. return { value: undefined, done: true }
  25429. }
  25430. // 11. Let pair be the entry in values at index index.
  25431. const pair = values[index]
  25432. // 12. Set object’s index to index + 1.
  25433. object.index = index + 1
  25434. // 13. Return the iterator result for pair and kind.
  25435. return iteratorResult(pair, kind)
  25436. },
  25437. // The class string of an iterator prototype object for a given interface is the
  25438. // result of concatenating the identifier of the interface and the string " Iterator".
  25439. [Symbol.toStringTag]: `${name} Iterator`
  25440. }
  25441. // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%.
  25442. Object.setPrototypeOf(i, esIteratorPrototype)
  25443. // esIteratorPrototype needs to be the prototype of i
  25444. // which is the prototype of an empty object. Yes, it's confusing.
  25445. return Object.setPrototypeOf({}, i)
  25446. }
  25447. // https://webidl.spec.whatwg.org/#iterator-result
  25448. function iteratorResult (pair, kind) {
  25449. let result
  25450. // 1. Let result be a value determined by the value of kind:
  25451. switch (kind) {
  25452. case 'key': {
  25453. // 1. Let idlKey be pair’s key.
  25454. // 2. Let key be the result of converting idlKey to an
  25455. // ECMAScript value.
  25456. // 3. result is key.
  25457. result = pair[0]
  25458. break
  25459. }
  25460. case 'value': {
  25461. // 1. Let idlValue be pair’s value.
  25462. // 2. Let value be the result of converting idlValue to
  25463. // an ECMAScript value.
  25464. // 3. result is value.
  25465. result = pair[1]
  25466. break
  25467. }
  25468. case 'key+value': {
  25469. // 1. Let idlKey be pair’s key.
  25470. // 2. Let idlValue be pair’s value.
  25471. // 3. Let key be the result of converting idlKey to an
  25472. // ECMAScript value.
  25473. // 4. Let value be the result of converting idlValue to
  25474. // an ECMAScript value.
  25475. // 5. Let array be ! ArrayCreate(2).
  25476. // 6. Call ! CreateDataProperty(array, "0", key).
  25477. // 7. Call ! CreateDataProperty(array, "1", value).
  25478. // 8. result is array.
  25479. result = pair
  25480. break
  25481. }
  25482. }
  25483. // 2. Return CreateIterResultObject(result, false).
  25484. return { value: result, done: false }
  25485. }
  25486. /**
  25487. * @see https://fetch.spec.whatwg.org/#body-fully-read
  25488. */
  25489. async function fullyReadBody (body, processBody, processBodyError) {
  25490. // 1. If taskDestination is null, then set taskDestination to
  25491. // the result of starting a new parallel queue.
  25492. // 2. Let successSteps given a byte sequence bytes be to queue a
  25493. // fetch task to run processBody given bytes, with taskDestination.
  25494. const successSteps = processBody
  25495. // 3. Let errorSteps be to queue a fetch task to run processBodyError,
  25496. // with taskDestination.
  25497. const errorSteps = processBodyError
  25498. // 4. Let reader be the result of getting a reader for body’s stream.
  25499. // If that threw an exception, then run errorSteps with that
  25500. // exception and return.
  25501. let reader
  25502. try {
  25503. reader = body.stream.getReader()
  25504. } catch (e) {
  25505. errorSteps(e)
  25506. return
  25507. }
  25508. // 5. Read all bytes from reader, given successSteps and errorSteps.
  25509. try {
  25510. const result = await readAllBytes(reader)
  25511. successSteps(result)
  25512. } catch (e) {
  25513. errorSteps(e)
  25514. }
  25515. }
  25516. /** @type {ReadableStream} */
  25517. let ReadableStream = globalThis.ReadableStream
  25518. function isReadableStreamLike (stream) {
  25519. if (!ReadableStream) {
  25520. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  25521. }
  25522. return stream instanceof ReadableStream || (
  25523. stream[Symbol.toStringTag] === 'ReadableStream' &&
  25524. typeof stream.tee === 'function'
  25525. )
  25526. }
  25527. const MAXIMUM_ARGUMENT_LENGTH = 65535
  25528. /**
  25529. * @see https://infra.spec.whatwg.org/#isomorphic-decode
  25530. * @param {number[]|Uint8Array} input
  25531. */
  25532. function isomorphicDecode (input) {
  25533. // 1. To isomorphic decode a byte sequence input, return a string whose code point
  25534. // length is equal to input’s length and whose code points have the same values
  25535. // as the values of input’s bytes, in the same order.
  25536. if (input.length < MAXIMUM_ARGUMENT_LENGTH) {
  25537. return String.fromCharCode(...input)
  25538. }
  25539. return input.reduce((previous, current) => previous + String.fromCharCode(current), '')
  25540. }
  25541. /**
  25542. * @param {ReadableStreamController<Uint8Array>} controller
  25543. */
  25544. function readableStreamClose (controller) {
  25545. try {
  25546. controller.close()
  25547. } catch (err) {
  25548. // TODO: add comment explaining why this error occurs.
  25549. if (!err.message.includes('Controller is already closed')) {
  25550. throw err
  25551. }
  25552. }
  25553. }
  25554. /**
  25555. * @see https://infra.spec.whatwg.org/#isomorphic-encode
  25556. * @param {string} input
  25557. */
  25558. function isomorphicEncode (input) {
  25559. // 1. Assert: input contains no code points greater than U+00FF.
  25560. for (let i = 0; i < input.length; i++) {
  25561. assert(input.charCodeAt(i) <= 0xFF)
  25562. }
  25563. // 2. Return a byte sequence whose length is equal to input’s code
  25564. // point length and whose bytes have the same values as the
  25565. // values of input’s code points, in the same order
  25566. return input
  25567. }
  25568. /**
  25569. * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
  25570. * @see https://streams.spec.whatwg.org/#read-loop
  25571. * @param {ReadableStreamDefaultReader} reader
  25572. */
  25573. async function readAllBytes (reader) {
  25574. const bytes = []
  25575. let byteLength = 0
  25576. while (true) {
  25577. const { done, value: chunk } = await reader.read()
  25578. if (done) {
  25579. // 1. Call successSteps with bytes.
  25580. return Buffer.concat(bytes, byteLength)
  25581. }
  25582. // 1. If chunk is not a Uint8Array object, call failureSteps
  25583. // with a TypeError and abort these steps.
  25584. if (!isUint8Array(chunk)) {
  25585. throw new TypeError('Received non-Uint8Array chunk')
  25586. }
  25587. // 2. Append the bytes represented by chunk to bytes.
  25588. bytes.push(chunk)
  25589. byteLength += chunk.length
  25590. // 3. Read-loop given reader, bytes, successSteps, and failureSteps.
  25591. }
  25592. }
  25593. /**
  25594. * @see https://fetch.spec.whatwg.org/#is-local
  25595. * @param {URL} url
  25596. */
  25597. function urlIsLocal (url) {
  25598. assert('protocol' in url) // ensure it's a url object
  25599. const protocol = url.protocol
  25600. return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'
  25601. }
  25602. /**
  25603. * @param {string|URL} url
  25604. */
  25605. function urlHasHttpsScheme (url) {
  25606. if (typeof url === 'string') {
  25607. return url.startsWith('https:')
  25608. }
  25609. return url.protocol === 'https:'
  25610. }
  25611. /**
  25612. * @see https://fetch.spec.whatwg.org/#http-scheme
  25613. * @param {URL} url
  25614. */
  25615. function urlIsHttpHttpsScheme (url) {
  25616. assert('protocol' in url) // ensure it's a url object
  25617. const protocol = url.protocol
  25618. return protocol === 'http:' || protocol === 'https:'
  25619. }
  25620. /**
  25621. * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.
  25622. */
  25623. const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key))
  25624. module.exports = {
  25625. isAborted,
  25626. isCancelled,
  25627. createDeferredPromise,
  25628. ReadableStreamFrom,
  25629. toUSVString,
  25630. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  25631. coarsenedSharedCurrentTime,
  25632. determineRequestsReferrer,
  25633. makePolicyContainer,
  25634. clonePolicyContainer,
  25635. appendFetchMetadata,
  25636. appendRequestOriginHeader,
  25637. TAOCheck,
  25638. corsCheck,
  25639. crossOriginResourcePolicyCheck,
  25640. createOpaqueTimingInfo,
  25641. setRequestReferrerPolicyOnRedirect,
  25642. isValidHTTPToken,
  25643. requestBadPort,
  25644. requestCurrentURL,
  25645. responseURL,
  25646. responseLocationURL,
  25647. isBlobLike,
  25648. isURLPotentiallyTrustworthy,
  25649. isValidReasonPhrase,
  25650. sameOrigin,
  25651. normalizeMethod,
  25652. serializeJavascriptValueToJSONString,
  25653. makeIterator,
  25654. isValidHeaderName,
  25655. isValidHeaderValue,
  25656. hasOwn,
  25657. isErrorLike,
  25658. fullyReadBody,
  25659. bytesMatch,
  25660. isReadableStreamLike,
  25661. readableStreamClose,
  25662. isomorphicEncode,
  25663. isomorphicDecode,
  25664. urlIsLocal,
  25665. urlHasHttpsScheme,
  25666. urlIsHttpHttpsScheme,
  25667. readAllBytes,
  25668. normalizeMethodRecord,
  25669. parseMetadata
  25670. }
  25671. /***/ }),
  25672. /***/ 1744:
  25673. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  25674. "use strict";
  25675. const { types } = __nccwpck_require__(3837)
  25676. const { hasOwn, toUSVString } = __nccwpck_require__(2538)
  25677. /** @type {import('../../types/webidl').Webidl} */
  25678. const webidl = {}
  25679. webidl.converters = {}
  25680. webidl.util = {}
  25681. webidl.errors = {}
  25682. webidl.errors.exception = function (message) {
  25683. return new TypeError(`${message.header}: ${message.message}`)
  25684. }
  25685. webidl.errors.conversionFailed = function (context) {
  25686. const plural = context.types.length === 1 ? '' : ' one of'
  25687. const message =
  25688. `${context.argument} could not be converted to` +
  25689. `${plural}: ${context.types.join(', ')}.`
  25690. return webidl.errors.exception({
  25691. header: context.prefix,
  25692. message
  25693. })
  25694. }
  25695. webidl.errors.invalidArgument = function (context) {
  25696. return webidl.errors.exception({
  25697. header: context.prefix,
  25698. message: `"${context.value}" is an invalid ${context.type}.`
  25699. })
  25700. }
  25701. // https://webidl.spec.whatwg.org/#implements
  25702. webidl.brandCheck = function (V, I, opts = undefined) {
  25703. if (opts?.strict !== false && !(V instanceof I)) {
  25704. throw new TypeError('Illegal invocation')
  25705. } else {
  25706. return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]
  25707. }
  25708. }
  25709. webidl.argumentLengthCheck = function ({ length }, min, ctx) {
  25710. if (length < min) {
  25711. throw webidl.errors.exception({
  25712. message: `${min} argument${min !== 1 ? 's' : ''} required, ` +
  25713. `but${length ? ' only' : ''} ${length} found.`,
  25714. ...ctx
  25715. })
  25716. }
  25717. }
  25718. webidl.illegalConstructor = function () {
  25719. throw webidl.errors.exception({
  25720. header: 'TypeError',
  25721. message: 'Illegal constructor'
  25722. })
  25723. }
  25724. // https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
  25725. webidl.util.Type = function (V) {
  25726. switch (typeof V) {
  25727. case 'undefined': return 'Undefined'
  25728. case 'boolean': return 'Boolean'
  25729. case 'string': return 'String'
  25730. case 'symbol': return 'Symbol'
  25731. case 'number': return 'Number'
  25732. case 'bigint': return 'BigInt'
  25733. case 'function':
  25734. case 'object': {
  25735. if (V === null) {
  25736. return 'Null'
  25737. }
  25738. return 'Object'
  25739. }
  25740. }
  25741. }
  25742. // https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
  25743. webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
  25744. let upperBound
  25745. let lowerBound
  25746. // 1. If bitLength is 64, then:
  25747. if (bitLength === 64) {
  25748. // 1. Let upperBound be 2^53 − 1.
  25749. upperBound = Math.pow(2, 53) - 1
  25750. // 2. If signedness is "unsigned", then let lowerBound be 0.
  25751. if (signedness === 'unsigned') {
  25752. lowerBound = 0
  25753. } else {
  25754. // 3. Otherwise let lowerBound be −2^53 + 1.
  25755. lowerBound = Math.pow(-2, 53) + 1
  25756. }
  25757. } else if (signedness === 'unsigned') {
  25758. // 2. Otherwise, if signedness is "unsigned", then:
  25759. // 1. Let lowerBound be 0.
  25760. lowerBound = 0
  25761. // 2. Let upperBound be 2^bitLength − 1.
  25762. upperBound = Math.pow(2, bitLength) - 1
  25763. } else {
  25764. // 3. Otherwise:
  25765. // 1. Let lowerBound be -2^bitLength − 1.
  25766. lowerBound = Math.pow(-2, bitLength) - 1
  25767. // 2. Let upperBound be 2^bitLength − 1 − 1.
  25768. upperBound = Math.pow(2, bitLength - 1) - 1
  25769. }
  25770. // 4. Let x be ? ToNumber(V).
  25771. let x = Number(V)
  25772. // 5. If x is −0, then set x to +0.
  25773. if (x === 0) {
  25774. x = 0
  25775. }
  25776. // 6. If the conversion is to an IDL type associated
  25777. // with the [EnforceRange] extended attribute, then:
  25778. if (opts.enforceRange === true) {
  25779. // 1. If x is NaN, +∞, or −∞, then throw a TypeError.
  25780. if (
  25781. Number.isNaN(x) ||
  25782. x === Number.POSITIVE_INFINITY ||
  25783. x === Number.NEGATIVE_INFINITY
  25784. ) {
  25785. throw webidl.errors.exception({
  25786. header: 'Integer conversion',
  25787. message: `Could not convert ${V} to an integer.`
  25788. })
  25789. }
  25790. // 2. Set x to IntegerPart(x).
  25791. x = webidl.util.IntegerPart(x)
  25792. // 3. If x < lowerBound or x > upperBound, then
  25793. // throw a TypeError.
  25794. if (x < lowerBound || x > upperBound) {
  25795. throw webidl.errors.exception({
  25796. header: 'Integer conversion',
  25797. message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`
  25798. })
  25799. }
  25800. // 4. Return x.
  25801. return x
  25802. }
  25803. // 7. If x is not NaN and the conversion is to an IDL
  25804. // type associated with the [Clamp] extended
  25805. // attribute, then:
  25806. if (!Number.isNaN(x) && opts.clamp === true) {
  25807. // 1. Set x to min(max(x, lowerBound), upperBound).
  25808. x = Math.min(Math.max(x, lowerBound), upperBound)
  25809. // 2. Round x to the nearest integer, choosing the
  25810. // even integer if it lies halfway between two,
  25811. // and choosing +0 rather than −0.
  25812. if (Math.floor(x) % 2 === 0) {
  25813. x = Math.floor(x)
  25814. } else {
  25815. x = Math.ceil(x)
  25816. }
  25817. // 3. Return x.
  25818. return x
  25819. }
  25820. // 8. If x is NaN, +0, +∞, or −∞, then return +0.
  25821. if (
  25822. Number.isNaN(x) ||
  25823. (x === 0 && Object.is(0, x)) ||
  25824. x === Number.POSITIVE_INFINITY ||
  25825. x === Number.NEGATIVE_INFINITY
  25826. ) {
  25827. return 0
  25828. }
  25829. // 9. Set x to IntegerPart(x).
  25830. x = webidl.util.IntegerPart(x)
  25831. // 10. Set x to x modulo 2^bitLength.
  25832. x = x % Math.pow(2, bitLength)
  25833. // 11. If signedness is "signed" and x ≥ 2^bitLength − 1,
  25834. // then return x − 2^bitLength.
  25835. if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {
  25836. return x - Math.pow(2, bitLength)
  25837. }
  25838. // 12. Otherwise, return x.
  25839. return x
  25840. }
  25841. // https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
  25842. webidl.util.IntegerPart = function (n) {
  25843. // 1. Let r be floor(abs(n)).
  25844. const r = Math.floor(Math.abs(n))
  25845. // 2. If n < 0, then return -1 × r.
  25846. if (n < 0) {
  25847. return -1 * r
  25848. }
  25849. // 3. Otherwise, return r.
  25850. return r
  25851. }
  25852. // https://webidl.spec.whatwg.org/#es-sequence
  25853. webidl.sequenceConverter = function (converter) {
  25854. return (V) => {
  25855. // 1. If Type(V) is not Object, throw a TypeError.
  25856. if (webidl.util.Type(V) !== 'Object') {
  25857. throw webidl.errors.exception({
  25858. header: 'Sequence',
  25859. message: `Value of type ${webidl.util.Type(V)} is not an Object.`
  25860. })
  25861. }
  25862. // 2. Let method be ? GetMethod(V, @@iterator).
  25863. /** @type {Generator} */
  25864. const method = V?.[Symbol.iterator]?.()
  25865. const seq = []
  25866. // 3. If method is undefined, throw a TypeError.
  25867. if (
  25868. method === undefined ||
  25869. typeof method.next !== 'function'
  25870. ) {
  25871. throw webidl.errors.exception({
  25872. header: 'Sequence',
  25873. message: 'Object is not an iterator.'
  25874. })
  25875. }
  25876. // https://webidl.spec.whatwg.org/#create-sequence-from-iterable
  25877. while (true) {
  25878. const { done, value } = method.next()
  25879. if (done) {
  25880. break
  25881. }
  25882. seq.push(converter(value))
  25883. }
  25884. return seq
  25885. }
  25886. }
  25887. // https://webidl.spec.whatwg.org/#es-to-record
  25888. webidl.recordConverter = function (keyConverter, valueConverter) {
  25889. return (O) => {
  25890. // 1. If Type(O) is not Object, throw a TypeError.
  25891. if (webidl.util.Type(O) !== 'Object') {
  25892. throw webidl.errors.exception({
  25893. header: 'Record',
  25894. message: `Value of type ${webidl.util.Type(O)} is not an Object.`
  25895. })
  25896. }
  25897. // 2. Let result be a new empty instance of record<K, V>.
  25898. const result = {}
  25899. if (!types.isProxy(O)) {
  25900. // Object.keys only returns enumerable properties
  25901. const keys = Object.keys(O)
  25902. for (const key of keys) {
  25903. // 1. Let typedKey be key converted to an IDL value of type K.
  25904. const typedKey = keyConverter(key)
  25905. // 2. Let value be ? Get(O, key).
  25906. // 3. Let typedValue be value converted to an IDL value of type V.
  25907. const typedValue = valueConverter(O[key])
  25908. // 4. Set result[typedKey] to typedValue.
  25909. result[typedKey] = typedValue
  25910. }
  25911. // 5. Return result.
  25912. return result
  25913. }
  25914. // 3. Let keys be ? O.[[OwnPropertyKeys]]().
  25915. const keys = Reflect.ownKeys(O)
  25916. // 4. For each key of keys.
  25917. for (const key of keys) {
  25918. // 1. Let desc be ? O.[[GetOwnProperty]](key).
  25919. const desc = Reflect.getOwnPropertyDescriptor(O, key)
  25920. // 2. If desc is not undefined and desc.[[Enumerable]] is true:
  25921. if (desc?.enumerable) {
  25922. // 1. Let typedKey be key converted to an IDL value of type K.
  25923. const typedKey = keyConverter(key)
  25924. // 2. Let value be ? Get(O, key).
  25925. // 3. Let typedValue be value converted to an IDL value of type V.
  25926. const typedValue = valueConverter(O[key])
  25927. // 4. Set result[typedKey] to typedValue.
  25928. result[typedKey] = typedValue
  25929. }
  25930. }
  25931. // 5. Return result.
  25932. return result
  25933. }
  25934. }
  25935. webidl.interfaceConverter = function (i) {
  25936. return (V, opts = {}) => {
  25937. if (opts.strict !== false && !(V instanceof i)) {
  25938. throw webidl.errors.exception({
  25939. header: i.name,
  25940. message: `Expected ${V} to be an instance of ${i.name}.`
  25941. })
  25942. }
  25943. return V
  25944. }
  25945. }
  25946. webidl.dictionaryConverter = function (converters) {
  25947. return (dictionary) => {
  25948. const type = webidl.util.Type(dictionary)
  25949. const dict = {}
  25950. if (type === 'Null' || type === 'Undefined') {
  25951. return dict
  25952. } else if (type !== 'Object') {
  25953. throw webidl.errors.exception({
  25954. header: 'Dictionary',
  25955. message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
  25956. })
  25957. }
  25958. for (const options of converters) {
  25959. const { key, defaultValue, required, converter } = options
  25960. if (required === true) {
  25961. if (!hasOwn(dictionary, key)) {
  25962. throw webidl.errors.exception({
  25963. header: 'Dictionary',
  25964. message: `Missing required key "${key}".`
  25965. })
  25966. }
  25967. }
  25968. let value = dictionary[key]
  25969. const hasDefault = hasOwn(options, 'defaultValue')
  25970. // Only use defaultValue if value is undefined and
  25971. // a defaultValue options was provided.
  25972. if (hasDefault && value !== null) {
  25973. value = value ?? defaultValue
  25974. }
  25975. // A key can be optional and have no default value.
  25976. // When this happens, do not perform a conversion,
  25977. // and do not assign the key a value.
  25978. if (required || hasDefault || value !== undefined) {
  25979. value = converter(value)
  25980. if (
  25981. options.allowedValues &&
  25982. !options.allowedValues.includes(value)
  25983. ) {
  25984. throw webidl.errors.exception({
  25985. header: 'Dictionary',
  25986. message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`
  25987. })
  25988. }
  25989. dict[key] = value
  25990. }
  25991. }
  25992. return dict
  25993. }
  25994. }
  25995. webidl.nullableConverter = function (converter) {
  25996. return (V) => {
  25997. if (V === null) {
  25998. return V
  25999. }
  26000. return converter(V)
  26001. }
  26002. }
  26003. // https://webidl.spec.whatwg.org/#es-DOMString
  26004. webidl.converters.DOMString = function (V, opts = {}) {
  26005. // 1. If V is null and the conversion is to an IDL type
  26006. // associated with the [LegacyNullToEmptyString]
  26007. // extended attribute, then return the DOMString value
  26008. // that represents the empty string.
  26009. if (V === null && opts.legacyNullToEmptyString) {
  26010. return ''
  26011. }
  26012. // 2. Let x be ? ToString(V).
  26013. if (typeof V === 'symbol') {
  26014. throw new TypeError('Could not convert argument of type symbol to string.')
  26015. }
  26016. // 3. Return the IDL DOMString value that represents the
  26017. // same sequence of code units as the one the
  26018. // ECMAScript String value x represents.
  26019. return String(V)
  26020. }
  26021. // https://webidl.spec.whatwg.org/#es-ByteString
  26022. webidl.converters.ByteString = function (V) {
  26023. // 1. Let x be ? ToString(V).
  26024. // Note: DOMString converter perform ? ToString(V)
  26025. const x = webidl.converters.DOMString(V)
  26026. // 2. If the value of any element of x is greater than
  26027. // 255, then throw a TypeError.
  26028. for (let index = 0; index < x.length; index++) {
  26029. if (x.charCodeAt(index) > 255) {
  26030. throw new TypeError(
  26031. 'Cannot convert argument to a ByteString because the character at ' +
  26032. `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`
  26033. )
  26034. }
  26035. }
  26036. // 3. Return an IDL ByteString value whose length is the
  26037. // length of x, and where the value of each element is
  26038. // the value of the corresponding element of x.
  26039. return x
  26040. }
  26041. // https://webidl.spec.whatwg.org/#es-USVString
  26042. webidl.converters.USVString = toUSVString
  26043. // https://webidl.spec.whatwg.org/#es-boolean
  26044. webidl.converters.boolean = function (V) {
  26045. // 1. Let x be the result of computing ToBoolean(V).
  26046. const x = Boolean(V)
  26047. // 2. Return the IDL boolean value that is the one that represents
  26048. // the same truth value as the ECMAScript Boolean value x.
  26049. return x
  26050. }
  26051. // https://webidl.spec.whatwg.org/#es-any
  26052. webidl.converters.any = function (V) {
  26053. return V
  26054. }
  26055. // https://webidl.spec.whatwg.org/#es-long-long
  26056. webidl.converters['long long'] = function (V) {
  26057. // 1. Let x be ? ConvertToInt(V, 64, "signed").
  26058. const x = webidl.util.ConvertToInt(V, 64, 'signed')
  26059. // 2. Return the IDL long long value that represents
  26060. // the same numeric value as x.
  26061. return x
  26062. }
  26063. // https://webidl.spec.whatwg.org/#es-unsigned-long-long
  26064. webidl.converters['unsigned long long'] = function (V) {
  26065. // 1. Let x be ? ConvertToInt(V, 64, "unsigned").
  26066. const x = webidl.util.ConvertToInt(V, 64, 'unsigned')
  26067. // 2. Return the IDL unsigned long long value that
  26068. // represents the same numeric value as x.
  26069. return x
  26070. }
  26071. // https://webidl.spec.whatwg.org/#es-unsigned-long
  26072. webidl.converters['unsigned long'] = function (V) {
  26073. // 1. Let x be ? ConvertToInt(V, 32, "unsigned").
  26074. const x = webidl.util.ConvertToInt(V, 32, 'unsigned')
  26075. // 2. Return the IDL unsigned long value that
  26076. // represents the same numeric value as x.
  26077. return x
  26078. }
  26079. // https://webidl.spec.whatwg.org/#es-unsigned-short
  26080. webidl.converters['unsigned short'] = function (V, opts) {
  26081. // 1. Let x be ? ConvertToInt(V, 16, "unsigned").
  26082. const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts)
  26083. // 2. Return the IDL unsigned short value that represents
  26084. // the same numeric value as x.
  26085. return x
  26086. }
  26087. // https://webidl.spec.whatwg.org/#idl-ArrayBuffer
  26088. webidl.converters.ArrayBuffer = function (V, opts = {}) {
  26089. // 1. If Type(V) is not Object, or V does not have an
  26090. // [[ArrayBufferData]] internal slot, then throw a
  26091. // TypeError.
  26092. // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances
  26093. // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances
  26094. if (
  26095. webidl.util.Type(V) !== 'Object' ||
  26096. !types.isAnyArrayBuffer(V)
  26097. ) {
  26098. throw webidl.errors.conversionFailed({
  26099. prefix: `${V}`,
  26100. argument: `${V}`,
  26101. types: ['ArrayBuffer']
  26102. })
  26103. }
  26104. // 2. If the conversion is not to an IDL type associated
  26105. // with the [AllowShared] extended attribute, and
  26106. // IsSharedArrayBuffer(V) is true, then throw a
  26107. // TypeError.
  26108. if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {
  26109. throw webidl.errors.exception({
  26110. header: 'ArrayBuffer',
  26111. message: 'SharedArrayBuffer is not allowed.'
  26112. })
  26113. }
  26114. // 3. If the conversion is not to an IDL type associated
  26115. // with the [AllowResizable] extended attribute, and
  26116. // IsResizableArrayBuffer(V) is true, then throw a
  26117. // TypeError.
  26118. // Note: resizable ArrayBuffers are currently a proposal.
  26119. // 4. Return the IDL ArrayBuffer value that is a
  26120. // reference to the same object as V.
  26121. return V
  26122. }
  26123. webidl.converters.TypedArray = function (V, T, opts = {}) {
  26124. // 1. Let T be the IDL type V is being converted to.
  26125. // 2. If Type(V) is not Object, or V does not have a
  26126. // [[TypedArrayName]] internal slot with a value
  26127. // equal to T’s name, then throw a TypeError.
  26128. if (
  26129. webidl.util.Type(V) !== 'Object' ||
  26130. !types.isTypedArray(V) ||
  26131. V.constructor.name !== T.name
  26132. ) {
  26133. throw webidl.errors.conversionFailed({
  26134. prefix: `${T.name}`,
  26135. argument: `${V}`,
  26136. types: [T.name]
  26137. })
  26138. }
  26139. // 3. If the conversion is not to an IDL type associated
  26140. // with the [AllowShared] extended attribute, and
  26141. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26142. // true, then throw a TypeError.
  26143. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  26144. throw webidl.errors.exception({
  26145. header: 'ArrayBuffer',
  26146. message: 'SharedArrayBuffer is not allowed.'
  26147. })
  26148. }
  26149. // 4. If the conversion is not to an IDL type associated
  26150. // with the [AllowResizable] extended attribute, and
  26151. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26152. // true, then throw a TypeError.
  26153. // Note: resizable array buffers are currently a proposal
  26154. // 5. Return the IDL value of type T that is a reference
  26155. // to the same object as V.
  26156. return V
  26157. }
  26158. webidl.converters.DataView = function (V, opts = {}) {
  26159. // 1. If Type(V) is not Object, or V does not have a
  26160. // [[DataView]] internal slot, then throw a TypeError.
  26161. if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {
  26162. throw webidl.errors.exception({
  26163. header: 'DataView',
  26164. message: 'Object is not a DataView.'
  26165. })
  26166. }
  26167. // 2. If the conversion is not to an IDL type associated
  26168. // with the [AllowShared] extended attribute, and
  26169. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,
  26170. // then throw a TypeError.
  26171. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  26172. throw webidl.errors.exception({
  26173. header: 'ArrayBuffer',
  26174. message: 'SharedArrayBuffer is not allowed.'
  26175. })
  26176. }
  26177. // 3. If the conversion is not to an IDL type associated
  26178. // with the [AllowResizable] extended attribute, and
  26179. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26180. // true, then throw a TypeError.
  26181. // Note: resizable ArrayBuffers are currently a proposal
  26182. // 4. Return the IDL DataView value that is a reference
  26183. // to the same object as V.
  26184. return V
  26185. }
  26186. // https://webidl.spec.whatwg.org/#BufferSource
  26187. webidl.converters.BufferSource = function (V, opts = {}) {
  26188. if (types.isAnyArrayBuffer(V)) {
  26189. return webidl.converters.ArrayBuffer(V, opts)
  26190. }
  26191. if (types.isTypedArray(V)) {
  26192. return webidl.converters.TypedArray(V, V.constructor)
  26193. }
  26194. if (types.isDataView(V)) {
  26195. return webidl.converters.DataView(V, opts)
  26196. }
  26197. throw new TypeError(`Could not convert ${V} to a BufferSource.`)
  26198. }
  26199. webidl.converters['sequence<ByteString>'] = webidl.sequenceConverter(
  26200. webidl.converters.ByteString
  26201. )
  26202. webidl.converters['sequence<sequence<ByteString>>'] = webidl.sequenceConverter(
  26203. webidl.converters['sequence<ByteString>']
  26204. )
  26205. webidl.converters['record<ByteString, ByteString>'] = webidl.recordConverter(
  26206. webidl.converters.ByteString,
  26207. webidl.converters.ByteString
  26208. )
  26209. module.exports = {
  26210. webidl
  26211. }
  26212. /***/ }),
  26213. /***/ 4854:
  26214. /***/ ((module) => {
  26215. "use strict";
  26216. /**
  26217. * @see https://encoding.spec.whatwg.org/#concept-encoding-get
  26218. * @param {string|undefined} label
  26219. */
  26220. function getEncoding (label) {
  26221. if (!label) {
  26222. return 'failure'
  26223. }
  26224. // 1. Remove any leading and trailing ASCII whitespace from label.
  26225. // 2. If label is an ASCII case-insensitive match for any of the
  26226. // labels listed in the table below, then return the
  26227. // corresponding encoding; otherwise return failure.
  26228. switch (label.trim().toLowerCase()) {
  26229. case 'unicode-1-1-utf-8':
  26230. case 'unicode11utf8':
  26231. case 'unicode20utf8':
  26232. case 'utf-8':
  26233. case 'utf8':
  26234. case 'x-unicode20utf8':
  26235. return 'UTF-8'
  26236. case '866':
  26237. case 'cp866':
  26238. case 'csibm866':
  26239. case 'ibm866':
  26240. return 'IBM866'
  26241. case 'csisolatin2':
  26242. case 'iso-8859-2':
  26243. case 'iso-ir-101':
  26244. case 'iso8859-2':
  26245. case 'iso88592':
  26246. case 'iso_8859-2':
  26247. case 'iso_8859-2:1987':
  26248. case 'l2':
  26249. case 'latin2':
  26250. return 'ISO-8859-2'
  26251. case 'csisolatin3':
  26252. case 'iso-8859-3':
  26253. case 'iso-ir-109':
  26254. case 'iso8859-3':
  26255. case 'iso88593':
  26256. case 'iso_8859-3':
  26257. case 'iso_8859-3:1988':
  26258. case 'l3':
  26259. case 'latin3':
  26260. return 'ISO-8859-3'
  26261. case 'csisolatin4':
  26262. case 'iso-8859-4':
  26263. case 'iso-ir-110':
  26264. case 'iso8859-4':
  26265. case 'iso88594':
  26266. case 'iso_8859-4':
  26267. case 'iso_8859-4:1988':
  26268. case 'l4':
  26269. case 'latin4':
  26270. return 'ISO-8859-4'
  26271. case 'csisolatincyrillic':
  26272. case 'cyrillic':
  26273. case 'iso-8859-5':
  26274. case 'iso-ir-144':
  26275. case 'iso8859-5':
  26276. case 'iso88595':
  26277. case 'iso_8859-5':
  26278. case 'iso_8859-5:1988':
  26279. return 'ISO-8859-5'
  26280. case 'arabic':
  26281. case 'asmo-708':
  26282. case 'csiso88596e':
  26283. case 'csiso88596i':
  26284. case 'csisolatinarabic':
  26285. case 'ecma-114':
  26286. case 'iso-8859-6':
  26287. case 'iso-8859-6-e':
  26288. case 'iso-8859-6-i':
  26289. case 'iso-ir-127':
  26290. case 'iso8859-6':
  26291. case 'iso88596':
  26292. case 'iso_8859-6':
  26293. case 'iso_8859-6:1987':
  26294. return 'ISO-8859-6'
  26295. case 'csisolatingreek':
  26296. case 'ecma-118':
  26297. case 'elot_928':
  26298. case 'greek':
  26299. case 'greek8':
  26300. case 'iso-8859-7':
  26301. case 'iso-ir-126':
  26302. case 'iso8859-7':
  26303. case 'iso88597':
  26304. case 'iso_8859-7':
  26305. case 'iso_8859-7:1987':
  26306. case 'sun_eu_greek':
  26307. return 'ISO-8859-7'
  26308. case 'csiso88598e':
  26309. case 'csisolatinhebrew':
  26310. case 'hebrew':
  26311. case 'iso-8859-8':
  26312. case 'iso-8859-8-e':
  26313. case 'iso-ir-138':
  26314. case 'iso8859-8':
  26315. case 'iso88598':
  26316. case 'iso_8859-8':
  26317. case 'iso_8859-8:1988':
  26318. case 'visual':
  26319. return 'ISO-8859-8'
  26320. case 'csiso88598i':
  26321. case 'iso-8859-8-i':
  26322. case 'logical':
  26323. return 'ISO-8859-8-I'
  26324. case 'csisolatin6':
  26325. case 'iso-8859-10':
  26326. case 'iso-ir-157':
  26327. case 'iso8859-10':
  26328. case 'iso885910':
  26329. case 'l6':
  26330. case 'latin6':
  26331. return 'ISO-8859-10'
  26332. case 'iso-8859-13':
  26333. case 'iso8859-13':
  26334. case 'iso885913':
  26335. return 'ISO-8859-13'
  26336. case 'iso-8859-14':
  26337. case 'iso8859-14':
  26338. case 'iso885914':
  26339. return 'ISO-8859-14'
  26340. case 'csisolatin9':
  26341. case 'iso-8859-15':
  26342. case 'iso8859-15':
  26343. case 'iso885915':
  26344. case 'iso_8859-15':
  26345. case 'l9':
  26346. return 'ISO-8859-15'
  26347. case 'iso-8859-16':
  26348. return 'ISO-8859-16'
  26349. case 'cskoi8r':
  26350. case 'koi':
  26351. case 'koi8':
  26352. case 'koi8-r':
  26353. case 'koi8_r':
  26354. return 'KOI8-R'
  26355. case 'koi8-ru':
  26356. case 'koi8-u':
  26357. return 'KOI8-U'
  26358. case 'csmacintosh':
  26359. case 'mac':
  26360. case 'macintosh':
  26361. case 'x-mac-roman':
  26362. return 'macintosh'
  26363. case 'iso-8859-11':
  26364. case 'iso8859-11':
  26365. case 'iso885911':
  26366. case 'tis-620':
  26367. case 'windows-874':
  26368. return 'windows-874'
  26369. case 'cp1250':
  26370. case 'windows-1250':
  26371. case 'x-cp1250':
  26372. return 'windows-1250'
  26373. case 'cp1251':
  26374. case 'windows-1251':
  26375. case 'x-cp1251':
  26376. return 'windows-1251'
  26377. case 'ansi_x3.4-1968':
  26378. case 'ascii':
  26379. case 'cp1252':
  26380. case 'cp819':
  26381. case 'csisolatin1':
  26382. case 'ibm819':
  26383. case 'iso-8859-1':
  26384. case 'iso-ir-100':
  26385. case 'iso8859-1':
  26386. case 'iso88591':
  26387. case 'iso_8859-1':
  26388. case 'iso_8859-1:1987':
  26389. case 'l1':
  26390. case 'latin1':
  26391. case 'us-ascii':
  26392. case 'windows-1252':
  26393. case 'x-cp1252':
  26394. return 'windows-1252'
  26395. case 'cp1253':
  26396. case 'windows-1253':
  26397. case 'x-cp1253':
  26398. return 'windows-1253'
  26399. case 'cp1254':
  26400. case 'csisolatin5':
  26401. case 'iso-8859-9':
  26402. case 'iso-ir-148':
  26403. case 'iso8859-9':
  26404. case 'iso88599':
  26405. case 'iso_8859-9':
  26406. case 'iso_8859-9:1989':
  26407. case 'l5':
  26408. case 'latin5':
  26409. case 'windows-1254':
  26410. case 'x-cp1254':
  26411. return 'windows-1254'
  26412. case 'cp1255':
  26413. case 'windows-1255':
  26414. case 'x-cp1255':
  26415. return 'windows-1255'
  26416. case 'cp1256':
  26417. case 'windows-1256':
  26418. case 'x-cp1256':
  26419. return 'windows-1256'
  26420. case 'cp1257':
  26421. case 'windows-1257':
  26422. case 'x-cp1257':
  26423. return 'windows-1257'
  26424. case 'cp1258':
  26425. case 'windows-1258':
  26426. case 'x-cp1258':
  26427. return 'windows-1258'
  26428. case 'x-mac-cyrillic':
  26429. case 'x-mac-ukrainian':
  26430. return 'x-mac-cyrillic'
  26431. case 'chinese':
  26432. case 'csgb2312':
  26433. case 'csiso58gb231280':
  26434. case 'gb2312':
  26435. case 'gb_2312':
  26436. case 'gb_2312-80':
  26437. case 'gbk':
  26438. case 'iso-ir-58':
  26439. case 'x-gbk':
  26440. return 'GBK'
  26441. case 'gb18030':
  26442. return 'gb18030'
  26443. case 'big5':
  26444. case 'big5-hkscs':
  26445. case 'cn-big5':
  26446. case 'csbig5':
  26447. case 'x-x-big5':
  26448. return 'Big5'
  26449. case 'cseucpkdfmtjapanese':
  26450. case 'euc-jp':
  26451. case 'x-euc-jp':
  26452. return 'EUC-JP'
  26453. case 'csiso2022jp':
  26454. case 'iso-2022-jp':
  26455. return 'ISO-2022-JP'
  26456. case 'csshiftjis':
  26457. case 'ms932':
  26458. case 'ms_kanji':
  26459. case 'shift-jis':
  26460. case 'shift_jis':
  26461. case 'sjis':
  26462. case 'windows-31j':
  26463. case 'x-sjis':
  26464. return 'Shift_JIS'
  26465. case 'cseuckr':
  26466. case 'csksc56011987':
  26467. case 'euc-kr':
  26468. case 'iso-ir-149':
  26469. case 'korean':
  26470. case 'ks_c_5601-1987':
  26471. case 'ks_c_5601-1989':
  26472. case 'ksc5601':
  26473. case 'ksc_5601':
  26474. case 'windows-949':
  26475. return 'EUC-KR'
  26476. case 'csiso2022kr':
  26477. case 'hz-gb-2312':
  26478. case 'iso-2022-cn':
  26479. case 'iso-2022-cn-ext':
  26480. case 'iso-2022-kr':
  26481. case 'replacement':
  26482. return 'replacement'
  26483. case 'unicodefffe':
  26484. case 'utf-16be':
  26485. return 'UTF-16BE'
  26486. case 'csunicode':
  26487. case 'iso-10646-ucs-2':
  26488. case 'ucs-2':
  26489. case 'unicode':
  26490. case 'unicodefeff':
  26491. case 'utf-16':
  26492. case 'utf-16le':
  26493. return 'UTF-16LE'
  26494. case 'x-user-defined':
  26495. return 'x-user-defined'
  26496. default: return 'failure'
  26497. }
  26498. }
  26499. module.exports = {
  26500. getEncoding
  26501. }
  26502. /***/ }),
  26503. /***/ 1446:
  26504. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26505. "use strict";
  26506. const {
  26507. staticPropertyDescriptors,
  26508. readOperation,
  26509. fireAProgressEvent
  26510. } = __nccwpck_require__(7530)
  26511. const {
  26512. kState,
  26513. kError,
  26514. kResult,
  26515. kEvents,
  26516. kAborted
  26517. } = __nccwpck_require__(9054)
  26518. const { webidl } = __nccwpck_require__(1744)
  26519. const { kEnumerableProperty } = __nccwpck_require__(3983)
  26520. class FileReader extends EventTarget {
  26521. constructor () {
  26522. super()
  26523. this[kState] = 'empty'
  26524. this[kResult] = null
  26525. this[kError] = null
  26526. this[kEvents] = {
  26527. loadend: null,
  26528. error: null,
  26529. abort: null,
  26530. load: null,
  26531. progress: null,
  26532. loadstart: null
  26533. }
  26534. }
  26535. /**
  26536. * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer
  26537. * @param {import('buffer').Blob} blob
  26538. */
  26539. readAsArrayBuffer (blob) {
  26540. webidl.brandCheck(this, FileReader)
  26541. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })
  26542. blob = webidl.converters.Blob(blob, { strict: false })
  26543. // The readAsArrayBuffer(blob) method, when invoked,
  26544. // must initiate a read operation for blob with ArrayBuffer.
  26545. readOperation(this, blob, 'ArrayBuffer')
  26546. }
  26547. /**
  26548. * @see https://w3c.github.io/FileAPI/#readAsBinaryString
  26549. * @param {import('buffer').Blob} blob
  26550. */
  26551. readAsBinaryString (blob) {
  26552. webidl.brandCheck(this, FileReader)
  26553. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })
  26554. blob = webidl.converters.Blob(blob, { strict: false })
  26555. // The readAsBinaryString(blob) method, when invoked,
  26556. // must initiate a read operation for blob with BinaryString.
  26557. readOperation(this, blob, 'BinaryString')
  26558. }
  26559. /**
  26560. * @see https://w3c.github.io/FileAPI/#readAsDataText
  26561. * @param {import('buffer').Blob} blob
  26562. * @param {string?} encoding
  26563. */
  26564. readAsText (blob, encoding = undefined) {
  26565. webidl.brandCheck(this, FileReader)
  26566. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })
  26567. blob = webidl.converters.Blob(blob, { strict: false })
  26568. if (encoding !== undefined) {
  26569. encoding = webidl.converters.DOMString(encoding)
  26570. }
  26571. // The readAsText(blob, encoding) method, when invoked,
  26572. // must initiate a read operation for blob with Text and encoding.
  26573. readOperation(this, blob, 'Text', encoding)
  26574. }
  26575. /**
  26576. * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL
  26577. * @param {import('buffer').Blob} blob
  26578. */
  26579. readAsDataURL (blob) {
  26580. webidl.brandCheck(this, FileReader)
  26581. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })
  26582. blob = webidl.converters.Blob(blob, { strict: false })
  26583. // The readAsDataURL(blob) method, when invoked, must
  26584. // initiate a read operation for blob with DataURL.
  26585. readOperation(this, blob, 'DataURL')
  26586. }
  26587. /**
  26588. * @see https://w3c.github.io/FileAPI/#dfn-abort
  26589. */
  26590. abort () {
  26591. // 1. If this's state is "empty" or if this's state is
  26592. // "done" set this's result to null and terminate
  26593. // this algorithm.
  26594. if (this[kState] === 'empty' || this[kState] === 'done') {
  26595. this[kResult] = null
  26596. return
  26597. }
  26598. // 2. If this's state is "loading" set this's state to
  26599. // "done" and set this's result to null.
  26600. if (this[kState] === 'loading') {
  26601. this[kState] = 'done'
  26602. this[kResult] = null
  26603. }
  26604. // 3. If there are any tasks from this on the file reading
  26605. // task source in an affiliated task queue, then remove
  26606. // those tasks from that task queue.
  26607. this[kAborted] = true
  26608. // 4. Terminate the algorithm for the read method being processed.
  26609. // TODO
  26610. // 5. Fire a progress event called abort at this.
  26611. fireAProgressEvent('abort', this)
  26612. // 6. If this's state is not "loading", fire a progress
  26613. // event called loadend at this.
  26614. if (this[kState] !== 'loading') {
  26615. fireAProgressEvent('loadend', this)
  26616. }
  26617. }
  26618. /**
  26619. * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate
  26620. */
  26621. get readyState () {
  26622. webidl.brandCheck(this, FileReader)
  26623. switch (this[kState]) {
  26624. case 'empty': return this.EMPTY
  26625. case 'loading': return this.LOADING
  26626. case 'done': return this.DONE
  26627. }
  26628. }
  26629. /**
  26630. * @see https://w3c.github.io/FileAPI/#dom-filereader-result
  26631. */
  26632. get result () {
  26633. webidl.brandCheck(this, FileReader)
  26634. // The result attribute’s getter, when invoked, must return
  26635. // this's result.
  26636. return this[kResult]
  26637. }
  26638. /**
  26639. * @see https://w3c.github.io/FileAPI/#dom-filereader-error
  26640. */
  26641. get error () {
  26642. webidl.brandCheck(this, FileReader)
  26643. // The error attribute’s getter, when invoked, must return
  26644. // this's error.
  26645. return this[kError]
  26646. }
  26647. get onloadend () {
  26648. webidl.brandCheck(this, FileReader)
  26649. return this[kEvents].loadend
  26650. }
  26651. set onloadend (fn) {
  26652. webidl.brandCheck(this, FileReader)
  26653. if (this[kEvents].loadend) {
  26654. this.removeEventListener('loadend', this[kEvents].loadend)
  26655. }
  26656. if (typeof fn === 'function') {
  26657. this[kEvents].loadend = fn
  26658. this.addEventListener('loadend', fn)
  26659. } else {
  26660. this[kEvents].loadend = null
  26661. }
  26662. }
  26663. get onerror () {
  26664. webidl.brandCheck(this, FileReader)
  26665. return this[kEvents].error
  26666. }
  26667. set onerror (fn) {
  26668. webidl.brandCheck(this, FileReader)
  26669. if (this[kEvents].error) {
  26670. this.removeEventListener('error', this[kEvents].error)
  26671. }
  26672. if (typeof fn === 'function') {
  26673. this[kEvents].error = fn
  26674. this.addEventListener('error', fn)
  26675. } else {
  26676. this[kEvents].error = null
  26677. }
  26678. }
  26679. get onloadstart () {
  26680. webidl.brandCheck(this, FileReader)
  26681. return this[kEvents].loadstart
  26682. }
  26683. set onloadstart (fn) {
  26684. webidl.brandCheck(this, FileReader)
  26685. if (this[kEvents].loadstart) {
  26686. this.removeEventListener('loadstart', this[kEvents].loadstart)
  26687. }
  26688. if (typeof fn === 'function') {
  26689. this[kEvents].loadstart = fn
  26690. this.addEventListener('loadstart', fn)
  26691. } else {
  26692. this[kEvents].loadstart = null
  26693. }
  26694. }
  26695. get onprogress () {
  26696. webidl.brandCheck(this, FileReader)
  26697. return this[kEvents].progress
  26698. }
  26699. set onprogress (fn) {
  26700. webidl.brandCheck(this, FileReader)
  26701. if (this[kEvents].progress) {
  26702. this.removeEventListener('progress', this[kEvents].progress)
  26703. }
  26704. if (typeof fn === 'function') {
  26705. this[kEvents].progress = fn
  26706. this.addEventListener('progress', fn)
  26707. } else {
  26708. this[kEvents].progress = null
  26709. }
  26710. }
  26711. get onload () {
  26712. webidl.brandCheck(this, FileReader)
  26713. return this[kEvents].load
  26714. }
  26715. set onload (fn) {
  26716. webidl.brandCheck(this, FileReader)
  26717. if (this[kEvents].load) {
  26718. this.removeEventListener('load', this[kEvents].load)
  26719. }
  26720. if (typeof fn === 'function') {
  26721. this[kEvents].load = fn
  26722. this.addEventListener('load', fn)
  26723. } else {
  26724. this[kEvents].load = null
  26725. }
  26726. }
  26727. get onabort () {
  26728. webidl.brandCheck(this, FileReader)
  26729. return this[kEvents].abort
  26730. }
  26731. set onabort (fn) {
  26732. webidl.brandCheck(this, FileReader)
  26733. if (this[kEvents].abort) {
  26734. this.removeEventListener('abort', this[kEvents].abort)
  26735. }
  26736. if (typeof fn === 'function') {
  26737. this[kEvents].abort = fn
  26738. this.addEventListener('abort', fn)
  26739. } else {
  26740. this[kEvents].abort = null
  26741. }
  26742. }
  26743. }
  26744. // https://w3c.github.io/FileAPI/#dom-filereader-empty
  26745. FileReader.EMPTY = FileReader.prototype.EMPTY = 0
  26746. // https://w3c.github.io/FileAPI/#dom-filereader-loading
  26747. FileReader.LOADING = FileReader.prototype.LOADING = 1
  26748. // https://w3c.github.io/FileAPI/#dom-filereader-done
  26749. FileReader.DONE = FileReader.prototype.DONE = 2
  26750. Object.defineProperties(FileReader.prototype, {
  26751. EMPTY: staticPropertyDescriptors,
  26752. LOADING: staticPropertyDescriptors,
  26753. DONE: staticPropertyDescriptors,
  26754. readAsArrayBuffer: kEnumerableProperty,
  26755. readAsBinaryString: kEnumerableProperty,
  26756. readAsText: kEnumerableProperty,
  26757. readAsDataURL: kEnumerableProperty,
  26758. abort: kEnumerableProperty,
  26759. readyState: kEnumerableProperty,
  26760. result: kEnumerableProperty,
  26761. error: kEnumerableProperty,
  26762. onloadstart: kEnumerableProperty,
  26763. onprogress: kEnumerableProperty,
  26764. onload: kEnumerableProperty,
  26765. onabort: kEnumerableProperty,
  26766. onerror: kEnumerableProperty,
  26767. onloadend: kEnumerableProperty,
  26768. [Symbol.toStringTag]: {
  26769. value: 'FileReader',
  26770. writable: false,
  26771. enumerable: false,
  26772. configurable: true
  26773. }
  26774. })
  26775. Object.defineProperties(FileReader, {
  26776. EMPTY: staticPropertyDescriptors,
  26777. LOADING: staticPropertyDescriptors,
  26778. DONE: staticPropertyDescriptors
  26779. })
  26780. module.exports = {
  26781. FileReader
  26782. }
  26783. /***/ }),
  26784. /***/ 5504:
  26785. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26786. "use strict";
  26787. const { webidl } = __nccwpck_require__(1744)
  26788. const kState = Symbol('ProgressEvent state')
  26789. /**
  26790. * @see https://xhr.spec.whatwg.org/#progressevent
  26791. */
  26792. class ProgressEvent extends Event {
  26793. constructor (type, eventInitDict = {}) {
  26794. type = webidl.converters.DOMString(type)
  26795. eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
  26796. super(type, eventInitDict)
  26797. this[kState] = {
  26798. lengthComputable: eventInitDict.lengthComputable,
  26799. loaded: eventInitDict.loaded,
  26800. total: eventInitDict.total
  26801. }
  26802. }
  26803. get lengthComputable () {
  26804. webidl.brandCheck(this, ProgressEvent)
  26805. return this[kState].lengthComputable
  26806. }
  26807. get loaded () {
  26808. webidl.brandCheck(this, ProgressEvent)
  26809. return this[kState].loaded
  26810. }
  26811. get total () {
  26812. webidl.brandCheck(this, ProgressEvent)
  26813. return this[kState].total
  26814. }
  26815. }
  26816. webidl.converters.ProgressEventInit = webidl.dictionaryConverter([
  26817. {
  26818. key: 'lengthComputable',
  26819. converter: webidl.converters.boolean,
  26820. defaultValue: false
  26821. },
  26822. {
  26823. key: 'loaded',
  26824. converter: webidl.converters['unsigned long long'],
  26825. defaultValue: 0
  26826. },
  26827. {
  26828. key: 'total',
  26829. converter: webidl.converters['unsigned long long'],
  26830. defaultValue: 0
  26831. },
  26832. {
  26833. key: 'bubbles',
  26834. converter: webidl.converters.boolean,
  26835. defaultValue: false
  26836. },
  26837. {
  26838. key: 'cancelable',
  26839. converter: webidl.converters.boolean,
  26840. defaultValue: false
  26841. },
  26842. {
  26843. key: 'composed',
  26844. converter: webidl.converters.boolean,
  26845. defaultValue: false
  26846. }
  26847. ])
  26848. module.exports = {
  26849. ProgressEvent
  26850. }
  26851. /***/ }),
  26852. /***/ 9054:
  26853. /***/ ((module) => {
  26854. "use strict";
  26855. module.exports = {
  26856. kState: Symbol('FileReader state'),
  26857. kResult: Symbol('FileReader result'),
  26858. kError: Symbol('FileReader error'),
  26859. kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),
  26860. kEvents: Symbol('FileReader events'),
  26861. kAborted: Symbol('FileReader aborted')
  26862. }
  26863. /***/ }),
  26864. /***/ 7530:
  26865. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26866. "use strict";
  26867. const {
  26868. kState,
  26869. kError,
  26870. kResult,
  26871. kAborted,
  26872. kLastProgressEventFired
  26873. } = __nccwpck_require__(9054)
  26874. const { ProgressEvent } = __nccwpck_require__(5504)
  26875. const { getEncoding } = __nccwpck_require__(4854)
  26876. const { DOMException } = __nccwpck_require__(1037)
  26877. const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(685)
  26878. const { types } = __nccwpck_require__(3837)
  26879. const { StringDecoder } = __nccwpck_require__(1576)
  26880. const { btoa } = __nccwpck_require__(4300)
  26881. /** @type {PropertyDescriptor} */
  26882. const staticPropertyDescriptors = {
  26883. enumerable: true,
  26884. writable: false,
  26885. configurable: false
  26886. }
  26887. /**
  26888. * @see https://w3c.github.io/FileAPI/#readOperation
  26889. * @param {import('./filereader').FileReader} fr
  26890. * @param {import('buffer').Blob} blob
  26891. * @param {string} type
  26892. * @param {string?} encodingName
  26893. */
  26894. function readOperation (fr, blob, type, encodingName) {
  26895. // 1. If fr’s state is "loading", throw an InvalidStateError
  26896. // DOMException.
  26897. if (fr[kState] === 'loading') {
  26898. throw new DOMException('Invalid state', 'InvalidStateError')
  26899. }
  26900. // 2. Set fr’s state to "loading".
  26901. fr[kState] = 'loading'
  26902. // 3. Set fr’s result to null.
  26903. fr[kResult] = null
  26904. // 4. Set fr’s error to null.
  26905. fr[kError] = null
  26906. // 5. Let stream be the result of calling get stream on blob.
  26907. /** @type {import('stream/web').ReadableStream} */
  26908. const stream = blob.stream()
  26909. // 6. Let reader be the result of getting a reader from stream.
  26910. const reader = stream.getReader()
  26911. // 7. Let bytes be an empty byte sequence.
  26912. /** @type {Uint8Array[]} */
  26913. const bytes = []
  26914. // 8. Let chunkPromise be the result of reading a chunk from
  26915. // stream with reader.
  26916. let chunkPromise = reader.read()
  26917. // 9. Let isFirstChunk be true.
  26918. let isFirstChunk = true
  26919. // 10. In parallel, while true:
  26920. // Note: "In parallel" just means non-blocking
  26921. // Note 2: readOperation itself cannot be async as double
  26922. // reading the body would then reject the promise, instead
  26923. // of throwing an error.
  26924. ;(async () => {
  26925. while (!fr[kAborted]) {
  26926. // 1. Wait for chunkPromise to be fulfilled or rejected.
  26927. try {
  26928. const { done, value } = await chunkPromise
  26929. // 2. If chunkPromise is fulfilled, and isFirstChunk is
  26930. // true, queue a task to fire a progress event called
  26931. // loadstart at fr.
  26932. if (isFirstChunk && !fr[kAborted]) {
  26933. queueMicrotask(() => {
  26934. fireAProgressEvent('loadstart', fr)
  26935. })
  26936. }
  26937. // 3. Set isFirstChunk to false.
  26938. isFirstChunk = false
  26939. // 4. If chunkPromise is fulfilled with an object whose
  26940. // done property is false and whose value property is
  26941. // a Uint8Array object, run these steps:
  26942. if (!done && types.isUint8Array(value)) {
  26943. // 1. Let bs be the byte sequence represented by the
  26944. // Uint8Array object.
  26945. // 2. Append bs to bytes.
  26946. bytes.push(value)
  26947. // 3. If roughly 50ms have passed since these steps
  26948. // were last invoked, queue a task to fire a
  26949. // progress event called progress at fr.
  26950. if (
  26951. (
  26952. fr[kLastProgressEventFired] === undefined ||
  26953. Date.now() - fr[kLastProgressEventFired] >= 50
  26954. ) &&
  26955. !fr[kAborted]
  26956. ) {
  26957. fr[kLastProgressEventFired] = Date.now()
  26958. queueMicrotask(() => {
  26959. fireAProgressEvent('progress', fr)
  26960. })
  26961. }
  26962. // 4. Set chunkPromise to the result of reading a
  26963. // chunk from stream with reader.
  26964. chunkPromise = reader.read()
  26965. } else if (done) {
  26966. // 5. Otherwise, if chunkPromise is fulfilled with an
  26967. // object whose done property is true, queue a task
  26968. // to run the following steps and abort this algorithm:
  26969. queueMicrotask(() => {
  26970. // 1. Set fr’s state to "done".
  26971. fr[kState] = 'done'
  26972. // 2. Let result be the result of package data given
  26973. // bytes, type, blob’s type, and encodingName.
  26974. try {
  26975. const result = packageData(bytes, type, blob.type, encodingName)
  26976. // 4. Else:
  26977. if (fr[kAborted]) {
  26978. return
  26979. }
  26980. // 1. Set fr’s result to result.
  26981. fr[kResult] = result
  26982. // 2. Fire a progress event called load at the fr.
  26983. fireAProgressEvent('load', fr)
  26984. } catch (error) {
  26985. // 3. If package data threw an exception error:
  26986. // 1. Set fr’s error to error.
  26987. fr[kError] = error
  26988. // 2. Fire a progress event called error at fr.
  26989. fireAProgressEvent('error', fr)
  26990. }
  26991. // 5. If fr’s state is not "loading", fire a progress
  26992. // event called loadend at the fr.
  26993. if (fr[kState] !== 'loading') {
  26994. fireAProgressEvent('loadend', fr)
  26995. }
  26996. })
  26997. break
  26998. }
  26999. } catch (error) {
  27000. if (fr[kAborted]) {
  27001. return
  27002. }
  27003. // 6. Otherwise, if chunkPromise is rejected with an
  27004. // error error, queue a task to run the following
  27005. // steps and abort this algorithm:
  27006. queueMicrotask(() => {
  27007. // 1. Set fr’s state to "done".
  27008. fr[kState] = 'done'
  27009. // 2. Set fr’s error to error.
  27010. fr[kError] = error
  27011. // 3. Fire a progress event called error at fr.
  27012. fireAProgressEvent('error', fr)
  27013. // 4. If fr’s state is not "loading", fire a progress
  27014. // event called loadend at fr.
  27015. if (fr[kState] !== 'loading') {
  27016. fireAProgressEvent('loadend', fr)
  27017. }
  27018. })
  27019. break
  27020. }
  27021. }
  27022. })()
  27023. }
  27024. /**
  27025. * @see https://w3c.github.io/FileAPI/#fire-a-progress-event
  27026. * @see https://dom.spec.whatwg.org/#concept-event-fire
  27027. * @param {string} e The name of the event
  27028. * @param {import('./filereader').FileReader} reader
  27029. */
  27030. function fireAProgressEvent (e, reader) {
  27031. // The progress event e does not bubble. e.bubbles must be false
  27032. // The progress event e is NOT cancelable. e.cancelable must be false
  27033. const event = new ProgressEvent(e, {
  27034. bubbles: false,
  27035. cancelable: false
  27036. })
  27037. reader.dispatchEvent(event)
  27038. }
  27039. /**
  27040. * @see https://w3c.github.io/FileAPI/#blob-package-data
  27041. * @param {Uint8Array[]} bytes
  27042. * @param {string} type
  27043. * @param {string?} mimeType
  27044. * @param {string?} encodingName
  27045. */
  27046. function packageData (bytes, type, mimeType, encodingName) {
  27047. // 1. A Blob has an associated package data algorithm, given
  27048. // bytes, a type, a optional mimeType, and a optional
  27049. // encodingName, which switches on type and runs the
  27050. // associated steps:
  27051. switch (type) {
  27052. case 'DataURL': {
  27053. // 1. Return bytes as a DataURL [RFC2397] subject to
  27054. // the considerations below:
  27055. // * Use mimeType as part of the Data URL if it is
  27056. // available in keeping with the Data URL
  27057. // specification [RFC2397].
  27058. // * If mimeType is not available return a Data URL
  27059. // without a media-type. [RFC2397].
  27060. // https://datatracker.ietf.org/doc/html/rfc2397#section-3
  27061. // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
  27062. // mediatype := [ type "/" subtype ] *( ";" parameter )
  27063. // data := *urlchar
  27064. // parameter := attribute "=" value
  27065. let dataURL = 'data:'
  27066. const parsed = parseMIMEType(mimeType || 'application/octet-stream')
  27067. if (parsed !== 'failure') {
  27068. dataURL += serializeAMimeType(parsed)
  27069. }
  27070. dataURL += ';base64,'
  27071. const decoder = new StringDecoder('latin1')
  27072. for (const chunk of bytes) {
  27073. dataURL += btoa(decoder.write(chunk))
  27074. }
  27075. dataURL += btoa(decoder.end())
  27076. return dataURL
  27077. }
  27078. case 'Text': {
  27079. // 1. Let encoding be failure
  27080. let encoding = 'failure'
  27081. // 2. If the encodingName is present, set encoding to the
  27082. // result of getting an encoding from encodingName.
  27083. if (encodingName) {
  27084. encoding = getEncoding(encodingName)
  27085. }
  27086. // 3. If encoding is failure, and mimeType is present:
  27087. if (encoding === 'failure' && mimeType) {
  27088. // 1. Let type be the result of parse a MIME type
  27089. // given mimeType.
  27090. const type = parseMIMEType(mimeType)
  27091. // 2. If type is not failure, set encoding to the result
  27092. // of getting an encoding from type’s parameters["charset"].
  27093. if (type !== 'failure') {
  27094. encoding = getEncoding(type.parameters.get('charset'))
  27095. }
  27096. }
  27097. // 4. If encoding is failure, then set encoding to UTF-8.
  27098. if (encoding === 'failure') {
  27099. encoding = 'UTF-8'
  27100. }
  27101. // 5. Decode bytes using fallback encoding encoding, and
  27102. // return the result.
  27103. return decode(bytes, encoding)
  27104. }
  27105. case 'ArrayBuffer': {
  27106. // Return a new ArrayBuffer whose contents are bytes.
  27107. const sequence = combineByteSequences(bytes)
  27108. return sequence.buffer
  27109. }
  27110. case 'BinaryString': {
  27111. // Return bytes as a binary string, in which every byte
  27112. // is represented by a code unit of equal value [0..255].
  27113. let binaryString = ''
  27114. const decoder = new StringDecoder('latin1')
  27115. for (const chunk of bytes) {
  27116. binaryString += decoder.write(chunk)
  27117. }
  27118. binaryString += decoder.end()
  27119. return binaryString
  27120. }
  27121. }
  27122. }
  27123. /**
  27124. * @see https://encoding.spec.whatwg.org/#decode
  27125. * @param {Uint8Array[]} ioQueue
  27126. * @param {string} encoding
  27127. */
  27128. function decode (ioQueue, encoding) {
  27129. const bytes = combineByteSequences(ioQueue)
  27130. // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.
  27131. const BOMEncoding = BOMSniffing(bytes)
  27132. let slice = 0
  27133. // 2. If BOMEncoding is non-null:
  27134. if (BOMEncoding !== null) {
  27135. // 1. Set encoding to BOMEncoding.
  27136. encoding = BOMEncoding
  27137. // 2. Read three bytes from ioQueue, if BOMEncoding is
  27138. // UTF-8; otherwise read two bytes.
  27139. // (Do nothing with those bytes.)
  27140. slice = BOMEncoding === 'UTF-8' ? 3 : 2
  27141. }
  27142. // 3. Process a queue with an instance of encoding’s
  27143. // decoder, ioQueue, output, and "replacement".
  27144. // 4. Return output.
  27145. const sliced = bytes.slice(slice)
  27146. return new TextDecoder(encoding).decode(sliced)
  27147. }
  27148. /**
  27149. * @see https://encoding.spec.whatwg.org/#bom-sniff
  27150. * @param {Uint8Array} ioQueue
  27151. */
  27152. function BOMSniffing (ioQueue) {
  27153. // 1. Let BOM be the result of peeking 3 bytes from ioQueue,
  27154. // converted to a byte sequence.
  27155. const [a, b, c] = ioQueue
  27156. // 2. For each of the rows in the table below, starting with
  27157. // the first one and going down, if BOM starts with the
  27158. // bytes given in the first column, then return the
  27159. // encoding given in the cell in the second column of that
  27160. // row. Otherwise, return null.
  27161. if (a === 0xEF && b === 0xBB && c === 0xBF) {
  27162. return 'UTF-8'
  27163. } else if (a === 0xFE && b === 0xFF) {
  27164. return 'UTF-16BE'
  27165. } else if (a === 0xFF && b === 0xFE) {
  27166. return 'UTF-16LE'
  27167. }
  27168. return null
  27169. }
  27170. /**
  27171. * @param {Uint8Array[]} sequences
  27172. */
  27173. function combineByteSequences (sequences) {
  27174. const size = sequences.reduce((a, b) => {
  27175. return a + b.byteLength
  27176. }, 0)
  27177. let offset = 0
  27178. return sequences.reduce((a, b) => {
  27179. a.set(b, offset)
  27180. offset += b.byteLength
  27181. return a
  27182. }, new Uint8Array(size))
  27183. }
  27184. module.exports = {
  27185. staticPropertyDescriptors,
  27186. readOperation,
  27187. fireAProgressEvent
  27188. }
  27189. /***/ }),
  27190. /***/ 1892:
  27191. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27192. "use strict";
  27193. // We include a version number for the Dispatcher API. In case of breaking changes,
  27194. // this version number must be increased to avoid conflicts.
  27195. const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
  27196. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27197. const Agent = __nccwpck_require__(7890)
  27198. if (getGlobalDispatcher() === undefined) {
  27199. setGlobalDispatcher(new Agent())
  27200. }
  27201. function setGlobalDispatcher (agent) {
  27202. if (!agent || typeof agent.dispatch !== 'function') {
  27203. throw new InvalidArgumentError('Argument agent must implement Agent')
  27204. }
  27205. Object.defineProperty(globalThis, globalDispatcher, {
  27206. value: agent,
  27207. writable: true,
  27208. enumerable: false,
  27209. configurable: false
  27210. })
  27211. }
  27212. function getGlobalDispatcher () {
  27213. return globalThis[globalDispatcher]
  27214. }
  27215. module.exports = {
  27216. setGlobalDispatcher,
  27217. getGlobalDispatcher
  27218. }
  27219. /***/ }),
  27220. /***/ 6930:
  27221. /***/ ((module) => {
  27222. "use strict";
  27223. module.exports = class DecoratorHandler {
  27224. constructor (handler) {
  27225. this.handler = handler
  27226. }
  27227. onConnect (...args) {
  27228. return this.handler.onConnect(...args)
  27229. }
  27230. onError (...args) {
  27231. return this.handler.onError(...args)
  27232. }
  27233. onUpgrade (...args) {
  27234. return this.handler.onUpgrade(...args)
  27235. }
  27236. onHeaders (...args) {
  27237. return this.handler.onHeaders(...args)
  27238. }
  27239. onData (...args) {
  27240. return this.handler.onData(...args)
  27241. }
  27242. onComplete (...args) {
  27243. return this.handler.onComplete(...args)
  27244. }
  27245. onBodySent (...args) {
  27246. return this.handler.onBodySent(...args)
  27247. }
  27248. }
  27249. /***/ }),
  27250. /***/ 2860:
  27251. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27252. "use strict";
  27253. const util = __nccwpck_require__(3983)
  27254. const { kBodyUsed } = __nccwpck_require__(2785)
  27255. const assert = __nccwpck_require__(9491)
  27256. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27257. const EE = __nccwpck_require__(2361)
  27258. const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
  27259. const kBody = Symbol('body')
  27260. class BodyAsyncIterable {
  27261. constructor (body) {
  27262. this[kBody] = body
  27263. this[kBodyUsed] = false
  27264. }
  27265. async * [Symbol.asyncIterator] () {
  27266. assert(!this[kBodyUsed], 'disturbed')
  27267. this[kBodyUsed] = true
  27268. yield * this[kBody]
  27269. }
  27270. }
  27271. class RedirectHandler {
  27272. constructor (dispatch, maxRedirections, opts, handler) {
  27273. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  27274. throw new InvalidArgumentError('maxRedirections must be a positive number')
  27275. }
  27276. util.validateHandler(handler, opts.method, opts.upgrade)
  27277. this.dispatch = dispatch
  27278. this.location = null
  27279. this.abort = null
  27280. this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy
  27281. this.maxRedirections = maxRedirections
  27282. this.handler = handler
  27283. this.history = []
  27284. if (util.isStream(this.opts.body)) {
  27285. // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
  27286. // so that it can be dispatched again?
  27287. // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
  27288. if (util.bodyLength(this.opts.body) === 0) {
  27289. this.opts.body
  27290. .on('data', function () {
  27291. assert(false)
  27292. })
  27293. }
  27294. if (typeof this.opts.body.readableDidRead !== 'boolean') {
  27295. this.opts.body[kBodyUsed] = false
  27296. EE.prototype.on.call(this.opts.body, 'data', function () {
  27297. this[kBodyUsed] = true
  27298. })
  27299. }
  27300. } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {
  27301. // TODO (fix): We can't access ReadableStream internal state
  27302. // to determine whether or not it has been disturbed. This is just
  27303. // a workaround.
  27304. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27305. } else if (
  27306. this.opts.body &&
  27307. typeof this.opts.body !== 'string' &&
  27308. !ArrayBuffer.isView(this.opts.body) &&
  27309. util.isIterable(this.opts.body)
  27310. ) {
  27311. // TODO: Should we allow re-using iterable if !this.opts.idempotent
  27312. // or through some other flag?
  27313. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27314. }
  27315. }
  27316. onConnect (abort) {
  27317. this.abort = abort
  27318. this.handler.onConnect(abort, { history: this.history })
  27319. }
  27320. onUpgrade (statusCode, headers, socket) {
  27321. this.handler.onUpgrade(statusCode, headers, socket)
  27322. }
  27323. onError (error) {
  27324. this.handler.onError(error)
  27325. }
  27326. onHeaders (statusCode, headers, resume, statusText) {
  27327. this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
  27328. ? null
  27329. : parseLocation(statusCode, headers)
  27330. if (this.opts.origin) {
  27331. this.history.push(new URL(this.opts.path, this.opts.origin))
  27332. }
  27333. if (!this.location) {
  27334. return this.handler.onHeaders(statusCode, headers, resume, statusText)
  27335. }
  27336. const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))
  27337. const path = search ? `${pathname}${search}` : pathname
  27338. // Remove headers referring to the original URL.
  27339. // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.
  27340. // https://tools.ietf.org/html/rfc7231#section-6.4
  27341. this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)
  27342. this.opts.path = path
  27343. this.opts.origin = origin
  27344. this.opts.maxRedirections = 0
  27345. this.opts.query = null
  27346. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27347. // In case of HTTP 303, always replace method to be either HEAD or GET
  27348. if (statusCode === 303 && this.opts.method !== 'HEAD') {
  27349. this.opts.method = 'GET'
  27350. this.opts.body = null
  27351. }
  27352. }
  27353. onData (chunk) {
  27354. if (this.location) {
  27355. /*
  27356. https://tools.ietf.org/html/rfc7231#section-6.4
  27357. TLDR: undici always ignores 3xx response bodies.
  27358. Redirection is used to serve the requested resource from another URL, so it is assumes that
  27359. no body is generated (and thus can be ignored). Even though generating a body is not prohibited.
  27360. For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually
  27361. (which means it's optional and not mandated) contain just an hyperlink to the value of
  27362. the Location response header, so the body can be ignored safely.
  27363. For status 300, which is "Multiple Choices", the spec mentions both generating a Location
  27364. response header AND a response body with the other possible location to follow.
  27365. Since the spec explicitily chooses not to specify a format for such body and leave it to
  27366. servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.
  27367. */
  27368. } else {
  27369. return this.handler.onData(chunk)
  27370. }
  27371. }
  27372. onComplete (trailers) {
  27373. if (this.location) {
  27374. /*
  27375. https://tools.ietf.org/html/rfc7231#section-6.4
  27376. TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections
  27377. and neither are useful if present.
  27378. See comment on onData method above for more detailed informations.
  27379. */
  27380. this.location = null
  27381. this.abort = null
  27382. this.dispatch(this.opts, this)
  27383. } else {
  27384. this.handler.onComplete(trailers)
  27385. }
  27386. }
  27387. onBodySent (chunk) {
  27388. if (this.handler.onBodySent) {
  27389. this.handler.onBodySent(chunk)
  27390. }
  27391. }
  27392. }
  27393. function parseLocation (statusCode, headers) {
  27394. if (redirectableStatusCodes.indexOf(statusCode) === -1) {
  27395. return null
  27396. }
  27397. for (let i = 0; i < headers.length; i += 2) {
  27398. if (headers[i].toString().toLowerCase() === 'location') {
  27399. return headers[i + 1]
  27400. }
  27401. }
  27402. }
  27403. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27404. function shouldRemoveHeader (header, removeContent, unknownOrigin) {
  27405. if (header.length === 4) {
  27406. return util.headerNameToString(header) === 'host'
  27407. }
  27408. if (removeContent && util.headerNameToString(header).startsWith('content-')) {
  27409. return true
  27410. }
  27411. if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
  27412. const name = util.headerNameToString(header)
  27413. return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
  27414. }
  27415. return false
  27416. }
  27417. // https://tools.ietf.org/html/rfc7231#section-6.4
  27418. function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
  27419. const ret = []
  27420. if (Array.isArray(headers)) {
  27421. for (let i = 0; i < headers.length; i += 2) {
  27422. if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {
  27423. ret.push(headers[i], headers[i + 1])
  27424. }
  27425. }
  27426. } else if (headers && typeof headers === 'object') {
  27427. for (const key of Object.keys(headers)) {
  27428. if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
  27429. ret.push(key, headers[key])
  27430. }
  27431. }
  27432. } else {
  27433. assert(headers == null, 'headers must be an object or an array')
  27434. }
  27435. return ret
  27436. }
  27437. module.exports = RedirectHandler
  27438. /***/ }),
  27439. /***/ 2286:
  27440. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27441. const assert = __nccwpck_require__(9491)
  27442. const { kRetryHandlerDefaultRetry } = __nccwpck_require__(2785)
  27443. const { RequestRetryError } = __nccwpck_require__(8045)
  27444. const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3983)
  27445. function calculateRetryAfterHeader (retryAfter) {
  27446. const current = Date.now()
  27447. const diff = new Date(retryAfter).getTime() - current
  27448. return diff
  27449. }
  27450. class RetryHandler {
  27451. constructor (opts, handlers) {
  27452. const { retryOptions, ...dispatchOpts } = opts
  27453. const {
  27454. // Retry scoped
  27455. retry: retryFn,
  27456. maxRetries,
  27457. maxTimeout,
  27458. minTimeout,
  27459. timeoutFactor,
  27460. // Response scoped
  27461. methods,
  27462. errorCodes,
  27463. retryAfter,
  27464. statusCodes
  27465. } = retryOptions ?? {}
  27466. this.dispatch = handlers.dispatch
  27467. this.handler = handlers.handler
  27468. this.opts = dispatchOpts
  27469. this.abort = null
  27470. this.aborted = false
  27471. this.retryOpts = {
  27472. retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],
  27473. retryAfter: retryAfter ?? true,
  27474. maxTimeout: maxTimeout ?? 30 * 1000, // 30s,
  27475. timeout: minTimeout ?? 500, // .5s
  27476. timeoutFactor: timeoutFactor ?? 2,
  27477. maxRetries: maxRetries ?? 5,
  27478. // What errors we should retry
  27479. methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
  27480. // Indicates which errors to retry
  27481. statusCodes: statusCodes ?? [500, 502, 503, 504, 429],
  27482. // List of errors to retry
  27483. errorCodes: errorCodes ?? [
  27484. 'ECONNRESET',
  27485. 'ECONNREFUSED',
  27486. 'ENOTFOUND',
  27487. 'ENETDOWN',
  27488. 'ENETUNREACH',
  27489. 'EHOSTDOWN',
  27490. 'EHOSTUNREACH',
  27491. 'EPIPE'
  27492. ]
  27493. }
  27494. this.retryCount = 0
  27495. this.start = 0
  27496. this.end = null
  27497. this.etag = null
  27498. this.resume = null
  27499. // Handle possible onConnect duplication
  27500. this.handler.onConnect(reason => {
  27501. this.aborted = true
  27502. if (this.abort) {
  27503. this.abort(reason)
  27504. } else {
  27505. this.reason = reason
  27506. }
  27507. })
  27508. }
  27509. onRequestSent () {
  27510. if (this.handler.onRequestSent) {
  27511. this.handler.onRequestSent()
  27512. }
  27513. }
  27514. onUpgrade (statusCode, headers, socket) {
  27515. if (this.handler.onUpgrade) {
  27516. this.handler.onUpgrade(statusCode, headers, socket)
  27517. }
  27518. }
  27519. onConnect (abort) {
  27520. if (this.aborted) {
  27521. abort(this.reason)
  27522. } else {
  27523. this.abort = abort
  27524. }
  27525. }
  27526. onBodySent (chunk) {
  27527. if (this.handler.onBodySent) return this.handler.onBodySent(chunk)
  27528. }
  27529. static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
  27530. const { statusCode, code, headers } = err
  27531. const { method, retryOptions } = opts
  27532. const {
  27533. maxRetries,
  27534. timeout,
  27535. maxTimeout,
  27536. timeoutFactor,
  27537. statusCodes,
  27538. errorCodes,
  27539. methods
  27540. } = retryOptions
  27541. let { counter, currentTimeout } = state
  27542. currentTimeout =
  27543. currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout
  27544. // Any code that is not a Undici's originated and allowed to retry
  27545. if (
  27546. code &&
  27547. code !== 'UND_ERR_REQ_RETRY' &&
  27548. code !== 'UND_ERR_SOCKET' &&
  27549. !errorCodes.includes(code)
  27550. ) {
  27551. cb(err)
  27552. return
  27553. }
  27554. // If a set of method are provided and the current method is not in the list
  27555. if (Array.isArray(methods) && !methods.includes(method)) {
  27556. cb(err)
  27557. return
  27558. }
  27559. // If a set of status code are provided and the current status code is not in the list
  27560. if (
  27561. statusCode != null &&
  27562. Array.isArray(statusCodes) &&
  27563. !statusCodes.includes(statusCode)
  27564. ) {
  27565. cb(err)
  27566. return
  27567. }
  27568. // If we reached the max number of retries
  27569. if (counter > maxRetries) {
  27570. cb(err)
  27571. return
  27572. }
  27573. let retryAfterHeader = headers != null && headers['retry-after']
  27574. if (retryAfterHeader) {
  27575. retryAfterHeader = Number(retryAfterHeader)
  27576. retryAfterHeader = isNaN(retryAfterHeader)
  27577. ? calculateRetryAfterHeader(retryAfterHeader)
  27578. : retryAfterHeader * 1e3 // Retry-After is in seconds
  27579. }
  27580. const retryTimeout =
  27581. retryAfterHeader > 0
  27582. ? Math.min(retryAfterHeader, maxTimeout)
  27583. : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout)
  27584. state.currentTimeout = retryTimeout
  27585. setTimeout(() => cb(null), retryTimeout)
  27586. }
  27587. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  27588. const headers = parseHeaders(rawHeaders)
  27589. this.retryCount += 1
  27590. if (statusCode >= 300) {
  27591. this.abort(
  27592. new RequestRetryError('Request failed', statusCode, {
  27593. headers,
  27594. count: this.retryCount
  27595. })
  27596. )
  27597. return false
  27598. }
  27599. // Checkpoint for resume from where we left it
  27600. if (this.resume != null) {
  27601. this.resume = null
  27602. if (statusCode !== 206) {
  27603. return true
  27604. }
  27605. const contentRange = parseRangeHeader(headers['content-range'])
  27606. // If no content range
  27607. if (!contentRange) {
  27608. this.abort(
  27609. new RequestRetryError('Content-Range mismatch', statusCode, {
  27610. headers,
  27611. count: this.retryCount
  27612. })
  27613. )
  27614. return false
  27615. }
  27616. // Let's start with a weak etag check
  27617. if (this.etag != null && this.etag !== headers.etag) {
  27618. this.abort(
  27619. new RequestRetryError('ETag mismatch', statusCode, {
  27620. headers,
  27621. count: this.retryCount
  27622. })
  27623. )
  27624. return false
  27625. }
  27626. const { start, size, end = size } = contentRange
  27627. assert(this.start === start, 'content-range mismatch')
  27628. assert(this.end == null || this.end === end, 'content-range mismatch')
  27629. this.resume = resume
  27630. return true
  27631. }
  27632. if (this.end == null) {
  27633. if (statusCode === 206) {
  27634. // First time we receive 206
  27635. const range = parseRangeHeader(headers['content-range'])
  27636. if (range == null) {
  27637. return this.handler.onHeaders(
  27638. statusCode,
  27639. rawHeaders,
  27640. resume,
  27641. statusMessage
  27642. )
  27643. }
  27644. const { start, size, end = size } = range
  27645. assert(
  27646. start != null && Number.isFinite(start) && this.start !== start,
  27647. 'content-range mismatch'
  27648. )
  27649. assert(Number.isFinite(start))
  27650. assert(
  27651. end != null && Number.isFinite(end) && this.end !== end,
  27652. 'invalid content-length'
  27653. )
  27654. this.start = start
  27655. this.end = end
  27656. }
  27657. // We make our best to checkpoint the body for further range headers
  27658. if (this.end == null) {
  27659. const contentLength = headers['content-length']
  27660. this.end = contentLength != null ? Number(contentLength) : null
  27661. }
  27662. assert(Number.isFinite(this.start))
  27663. assert(
  27664. this.end == null || Number.isFinite(this.end),
  27665. 'invalid content-length'
  27666. )
  27667. this.resume = resume
  27668. this.etag = headers.etag != null ? headers.etag : null
  27669. return this.handler.onHeaders(
  27670. statusCode,
  27671. rawHeaders,
  27672. resume,
  27673. statusMessage
  27674. )
  27675. }
  27676. const err = new RequestRetryError('Request failed', statusCode, {
  27677. headers,
  27678. count: this.retryCount
  27679. })
  27680. this.abort(err)
  27681. return false
  27682. }
  27683. onData (chunk) {
  27684. this.start += chunk.length
  27685. return this.handler.onData(chunk)
  27686. }
  27687. onComplete (rawTrailers) {
  27688. this.retryCount = 0
  27689. return this.handler.onComplete(rawTrailers)
  27690. }
  27691. onError (err) {
  27692. if (this.aborted || isDisturbed(this.opts.body)) {
  27693. return this.handler.onError(err)
  27694. }
  27695. this.retryOpts.retry(
  27696. err,
  27697. {
  27698. state: { counter: this.retryCount++, currentTimeout: this.retryAfter },
  27699. opts: { retryOptions: this.retryOpts, ...this.opts }
  27700. },
  27701. onRetry.bind(this)
  27702. )
  27703. function onRetry (err) {
  27704. if (err != null || this.aborted || isDisturbed(this.opts.body)) {
  27705. return this.handler.onError(err)
  27706. }
  27707. if (this.start !== 0) {
  27708. this.opts = {
  27709. ...this.opts,
  27710. headers: {
  27711. ...this.opts.headers,
  27712. range: `bytes=${this.start}-${this.end ?? ''}`
  27713. }
  27714. }
  27715. }
  27716. try {
  27717. this.dispatch(this.opts, this)
  27718. } catch (err) {
  27719. this.handler.onError(err)
  27720. }
  27721. }
  27722. }
  27723. }
  27724. module.exports = RetryHandler
  27725. /***/ }),
  27726. /***/ 8861:
  27727. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27728. "use strict";
  27729. const RedirectHandler = __nccwpck_require__(2860)
  27730. function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
  27731. return (dispatch) => {
  27732. return function Intercept (opts, handler) {
  27733. const { maxRedirections = defaultMaxRedirections } = opts
  27734. if (!maxRedirections) {
  27735. return dispatch(opts, handler)
  27736. }
  27737. const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
  27738. opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
  27739. return dispatch(opts, redirectHandler)
  27740. }
  27741. }
  27742. }
  27743. module.exports = createRedirectInterceptor
  27744. /***/ }),
  27745. /***/ 953:
  27746. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  27747. "use strict";
  27748. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27749. exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;
  27750. const utils_1 = __nccwpck_require__(1891);
  27751. // C headers
  27752. var ERROR;
  27753. (function (ERROR) {
  27754. ERROR[ERROR["OK"] = 0] = "OK";
  27755. ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
  27756. ERROR[ERROR["STRICT"] = 2] = "STRICT";
  27757. ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
  27758. ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
  27759. ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
  27760. ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
  27761. ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
  27762. ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
  27763. ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
  27764. ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
  27765. ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
  27766. ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
  27767. ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
  27768. ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
  27769. ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
  27770. ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
  27771. ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
  27772. ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
  27773. ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
  27774. ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
  27775. ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
  27776. ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
  27777. ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
  27778. ERROR[ERROR["USER"] = 24] = "USER";
  27779. })(ERROR = exports.ERROR || (exports.ERROR = {}));
  27780. var TYPE;
  27781. (function (TYPE) {
  27782. TYPE[TYPE["BOTH"] = 0] = "BOTH";
  27783. TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
  27784. TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
  27785. })(TYPE = exports.TYPE || (exports.TYPE = {}));
  27786. var FLAGS;
  27787. (function (FLAGS) {
  27788. FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
  27789. FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
  27790. FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
  27791. FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
  27792. FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
  27793. FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
  27794. FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
  27795. FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
  27796. // 1 << 8 is unused
  27797. FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
  27798. })(FLAGS = exports.FLAGS || (exports.FLAGS = {}));
  27799. var LENIENT_FLAGS;
  27800. (function (LENIENT_FLAGS) {
  27801. LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
  27802. LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
  27803. LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
  27804. })(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
  27805. var METHODS;
  27806. (function (METHODS) {
  27807. METHODS[METHODS["DELETE"] = 0] = "DELETE";
  27808. METHODS[METHODS["GET"] = 1] = "GET";
  27809. METHODS[METHODS["HEAD"] = 2] = "HEAD";
  27810. METHODS[METHODS["POST"] = 3] = "POST";
  27811. METHODS[METHODS["PUT"] = 4] = "PUT";
  27812. /* pathological */
  27813. METHODS[METHODS["CONNECT"] = 5] = "CONNECT";
  27814. METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS";
  27815. METHODS[METHODS["TRACE"] = 7] = "TRACE";
  27816. /* WebDAV */
  27817. METHODS[METHODS["COPY"] = 8] = "COPY";
  27818. METHODS[METHODS["LOCK"] = 9] = "LOCK";
  27819. METHODS[METHODS["MKCOL"] = 10] = "MKCOL";
  27820. METHODS[METHODS["MOVE"] = 11] = "MOVE";
  27821. METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND";
  27822. METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH";
  27823. METHODS[METHODS["SEARCH"] = 14] = "SEARCH";
  27824. METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK";
  27825. METHODS[METHODS["BIND"] = 16] = "BIND";
  27826. METHODS[METHODS["REBIND"] = 17] = "REBIND";
  27827. METHODS[METHODS["UNBIND"] = 18] = "UNBIND";
  27828. METHODS[METHODS["ACL"] = 19] = "ACL";
  27829. /* subversion */
  27830. METHODS[METHODS["REPORT"] = 20] = "REPORT";
  27831. METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY";
  27832. METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT";
  27833. METHODS[METHODS["MERGE"] = 23] = "MERGE";
  27834. /* upnp */
  27835. METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH";
  27836. METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY";
  27837. METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE";
  27838. METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
  27839. /* RFC-5789 */
  27840. METHODS[METHODS["PATCH"] = 28] = "PATCH";
  27841. METHODS[METHODS["PURGE"] = 29] = "PURGE";
  27842. /* CalDAV */
  27843. METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR";
  27844. /* RFC-2068, section 19.6.1.2 */
  27845. METHODS[METHODS["LINK"] = 31] = "LINK";
  27846. METHODS[METHODS["UNLINK"] = 32] = "UNLINK";
  27847. /* icecast */
  27848. METHODS[METHODS["SOURCE"] = 33] = "SOURCE";
  27849. /* RFC-7540, section 11.6 */
  27850. METHODS[METHODS["PRI"] = 34] = "PRI";
  27851. /* RFC-2326 RTSP */
  27852. METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE";
  27853. METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE";
  27854. METHODS[METHODS["SETUP"] = 37] = "SETUP";
  27855. METHODS[METHODS["PLAY"] = 38] = "PLAY";
  27856. METHODS[METHODS["PAUSE"] = 39] = "PAUSE";
  27857. METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN";
  27858. METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER";
  27859. METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER";
  27860. METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT";
  27861. METHODS[METHODS["RECORD"] = 44] = "RECORD";
  27862. /* RAOP */
  27863. METHODS[METHODS["FLUSH"] = 45] = "FLUSH";
  27864. })(METHODS = exports.METHODS || (exports.METHODS = {}));
  27865. exports.METHODS_HTTP = [
  27866. METHODS.DELETE,
  27867. METHODS.GET,
  27868. METHODS.HEAD,
  27869. METHODS.POST,
  27870. METHODS.PUT,
  27871. METHODS.CONNECT,
  27872. METHODS.OPTIONS,
  27873. METHODS.TRACE,
  27874. METHODS.COPY,
  27875. METHODS.LOCK,
  27876. METHODS.MKCOL,
  27877. METHODS.MOVE,
  27878. METHODS.PROPFIND,
  27879. METHODS.PROPPATCH,
  27880. METHODS.SEARCH,
  27881. METHODS.UNLOCK,
  27882. METHODS.BIND,
  27883. METHODS.REBIND,
  27884. METHODS.UNBIND,
  27885. METHODS.ACL,
  27886. METHODS.REPORT,
  27887. METHODS.MKACTIVITY,
  27888. METHODS.CHECKOUT,
  27889. METHODS.MERGE,
  27890. METHODS['M-SEARCH'],
  27891. METHODS.NOTIFY,
  27892. METHODS.SUBSCRIBE,
  27893. METHODS.UNSUBSCRIBE,
  27894. METHODS.PATCH,
  27895. METHODS.PURGE,
  27896. METHODS.MKCALENDAR,
  27897. METHODS.LINK,
  27898. METHODS.UNLINK,
  27899. METHODS.PRI,
  27900. // TODO(indutny): should we allow it with HTTP?
  27901. METHODS.SOURCE,
  27902. ];
  27903. exports.METHODS_ICE = [
  27904. METHODS.SOURCE,
  27905. ];
  27906. exports.METHODS_RTSP = [
  27907. METHODS.OPTIONS,
  27908. METHODS.DESCRIBE,
  27909. METHODS.ANNOUNCE,
  27910. METHODS.SETUP,
  27911. METHODS.PLAY,
  27912. METHODS.PAUSE,
  27913. METHODS.TEARDOWN,
  27914. METHODS.GET_PARAMETER,
  27915. METHODS.SET_PARAMETER,
  27916. METHODS.REDIRECT,
  27917. METHODS.RECORD,
  27918. METHODS.FLUSH,
  27919. // For AirPlay
  27920. METHODS.GET,
  27921. METHODS.POST,
  27922. ];
  27923. exports.METHOD_MAP = utils_1.enumToMap(METHODS);
  27924. exports.H_METHOD_MAP = {};
  27925. Object.keys(exports.METHOD_MAP).forEach((key) => {
  27926. if (/^H/.test(key)) {
  27927. exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
  27928. }
  27929. });
  27930. var FINISH;
  27931. (function (FINISH) {
  27932. FINISH[FINISH["SAFE"] = 0] = "SAFE";
  27933. FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
  27934. FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
  27935. })(FINISH = exports.FINISH || (exports.FINISH = {}));
  27936. exports.ALPHA = [];
  27937. for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
  27938. // Upper case
  27939. exports.ALPHA.push(String.fromCharCode(i));
  27940. // Lower case
  27941. exports.ALPHA.push(String.fromCharCode(i + 0x20));
  27942. }
  27943. exports.NUM_MAP = {
  27944. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27945. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27946. };
  27947. exports.HEX_MAP = {
  27948. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27949. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27950. A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
  27951. a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
  27952. };
  27953. exports.NUM = [
  27954. '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  27955. ];
  27956. exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
  27957. exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')'];
  27958. exports.USERINFO_CHARS = exports.ALPHANUM
  27959. .concat(exports.MARK)
  27960. .concat(['%', ';', ':', '&', '=', '+', '$', ',']);
  27961. // TODO(indutny): use RFC
  27962. exports.STRICT_URL_CHAR = [
  27963. '!', '"', '$', '%', '&', '\'',
  27964. '(', ')', '*', '+', ',', '-', '.', '/',
  27965. ':', ';', '<', '=', '>',
  27966. '@', '[', '\\', ']', '^', '_',
  27967. '`',
  27968. '{', '|', '}', '~',
  27969. ].concat(exports.ALPHANUM);
  27970. exports.URL_CHAR = exports.STRICT_URL_CHAR
  27971. .concat(['\t', '\f']);
  27972. // All characters with 0x80 bit set to 1
  27973. for (let i = 0x80; i <= 0xff; i++) {
  27974. exports.URL_CHAR.push(i);
  27975. }
  27976. exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);
  27977. /* Tokens as defined by rfc 2616. Also lowercases them.
  27978. * token = 1*<any CHAR except CTLs or separators>
  27979. * separators = "(" | ")" | "<" | ">" | "@"
  27980. * | "," | ";" | ":" | "\" | <">
  27981. * | "/" | "[" | "]" | "?" | "="
  27982. * | "{" | "}" | SP | HT
  27983. */
  27984. exports.STRICT_TOKEN = [
  27985. '!', '#', '$', '%', '&', '\'',
  27986. '*', '+', '-', '.',
  27987. '^', '_', '`',
  27988. '|', '~',
  27989. ].concat(exports.ALPHANUM);
  27990. exports.TOKEN = exports.STRICT_TOKEN.concat([' ']);
  27991. /*
  27992. * Verify that a char is a valid visible (printable) US-ASCII
  27993. * character or %x80-FF
  27994. */
  27995. exports.HEADER_CHARS = ['\t'];
  27996. for (let i = 32; i <= 255; i++) {
  27997. if (i !== 127) {
  27998. exports.HEADER_CHARS.push(i);
  27999. }
  28000. }
  28001. // ',' = \x44
  28002. exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
  28003. exports.MAJOR = exports.NUM_MAP;
  28004. exports.MINOR = exports.MAJOR;
  28005. var HEADER_STATE;
  28006. (function (HEADER_STATE) {
  28007. HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL";
  28008. HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION";
  28009. HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
  28010. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
  28011. HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE";
  28012. HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
  28013. HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
  28014. HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
  28015. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
  28016. })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
  28017. exports.SPECIAL_HEADERS = {
  28018. 'connection': HEADER_STATE.CONNECTION,
  28019. 'content-length': HEADER_STATE.CONTENT_LENGTH,
  28020. 'proxy-connection': HEADER_STATE.CONNECTION,
  28021. 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
  28022. 'upgrade': HEADER_STATE.UPGRADE,
  28023. };
  28024. //# sourceMappingURL=constants.js.map
  28025. /***/ }),
  28026. /***/ 1145:
  28027. /***/ ((module) => {
  28028. module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh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AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgACgCHCIQQX9qDt0B2gEB2QECAwQFBgcICQoLDA0O2AEPENcBERLWARMUFRYXGBkaG+AB3wEcHR7VAR8gISIjJCXUASYnKCkqKyzTAdIBLS7RAdABLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVG2wFHSElKzwHOAUvNAUzMAU1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vc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BrwEhEAwUC0GwASEQDBMLQbEBIRAMEgtBswEhEAwRC0GyASEQDBALQbQBIRAMDwtBtQEhEAwOC0G2ASEQDA0LQbcBIRAMDAtBuAEhEAwLC0G5ASEQDAoLQboBIRAMCQtBuwEhEAwIC0HGASEQDAcLQbwBIRAMBgtBvQEhEAwFC0G+ASEQDAQLQb8BIRAMAwtBwAEhEAwCC0HCASEQDAELQcEBIRALA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ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gIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAUNgIUIAAgATYCDEEAIRAMogELIABBADYCHCAAIBQ2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKEBCyAAQQA2AhwgACABNgIUIABBw4+AgAA2AhAgAEEHNgIMQQAhEAygAQtBACEQIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgwMnwELIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgxBACEQDJ4BCyAAQQA2AhwgACAUNgIUIABB/pGAgAA2AhAgAEEHNgIMQQAhEAydAQsgAEEANgIcIAAgATYCFCAAQY6bgIAANgIQIABBBjYCDEEAIRAMnAELIBBBFUYNVyAAQQA2AhwgACABNgIUIABBzI6AgAA2AhAgAEEgNgIMQQAhEAybAQsgAEEANgIAIBBBAWohAUEkIRALIAAgEDoAKSAAKAIEIRAg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AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAOxwEAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB4fICEjJSg/QEFERUZHSElKS0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AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDKwBCyAAQQA2AhwgACABNgIUIABB3IiAgAA2AhAgAEEHNgIMQQAhEAyrAQsgEEE/Rw0BIAFBAWohAQtBBSEQDJABC0EAIRAgAEEANgIcIAAgATYCFCAAQf2SgIAANgIQIABBBzYCDAyoAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAynAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAymAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMRgsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAylAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMPwsgAEHSADYCHCAAIBQ2AhQgACABN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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAgAAAAACAAAAAAAAAAAAAAAAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=='
  28033. /***/ }),
  28034. /***/ 1891:
  28035. /***/ ((__unused_webpack_module, exports) => {
  28036. "use strict";
  28037. Object.defineProperty(exports, "__esModule", ({ value: true }));
  28038. exports.enumToMap = void 0;
  28039. function enumToMap(obj) {
  28040. const res = {};
  28041. Object.keys(obj).forEach((key) => {
  28042. const value = obj[key];
  28043. if (typeof value === 'number') {
  28044. res[key] = value;
  28045. }
  28046. });
  28047. return res;
  28048. }
  28049. exports.enumToMap = enumToMap;
  28050. //# sourceMappingURL=utils.js.map
  28051. /***/ }),
  28052. /***/ 6771:
  28053. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28054. "use strict";
  28055. const { kClients } = __nccwpck_require__(2785)
  28056. const Agent = __nccwpck_require__(7890)
  28057. const {
  28058. kAgent,
  28059. kMockAgentSet,
  28060. kMockAgentGet,
  28061. kDispatches,
  28062. kIsMockActive,
  28063. kNetConnect,
  28064. kGetNetConnect,
  28065. kOptions,
  28066. kFactory
  28067. } = __nccwpck_require__(4347)
  28068. const MockClient = __nccwpck_require__(8687)
  28069. const MockPool = __nccwpck_require__(6193)
  28070. const { matchValue, buildMockOptions } = __nccwpck_require__(9323)
  28071. const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8045)
  28072. const Dispatcher = __nccwpck_require__(412)
  28073. const Pluralizer = __nccwpck_require__(8891)
  28074. const PendingInterceptorsFormatter = __nccwpck_require__(6823)
  28075. class FakeWeakRef {
  28076. constructor (value) {
  28077. this.value = value
  28078. }
  28079. deref () {
  28080. return this.value
  28081. }
  28082. }
  28083. class MockAgent extends Dispatcher {
  28084. constructor (opts) {
  28085. super(opts)
  28086. this[kNetConnect] = true
  28087. this[kIsMockActive] = true
  28088. // Instantiate Agent and encapsulate
  28089. if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {
  28090. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28091. }
  28092. const agent = opts && opts.agent ? opts.agent : new Agent(opts)
  28093. this[kAgent] = agent
  28094. this[kClients] = agent[kClients]
  28095. this[kOptions] = buildMockOptions(opts)
  28096. }
  28097. get (origin) {
  28098. let dispatcher = this[kMockAgentGet](origin)
  28099. if (!dispatcher) {
  28100. dispatcher = this[kFactory](origin)
  28101. this[kMockAgentSet](origin, dispatcher)
  28102. }
  28103. return dispatcher
  28104. }
  28105. dispatch (opts, handler) {
  28106. // Call MockAgent.get to perform additional setup before dispatching as normal
  28107. this.get(opts.origin)
  28108. return this[kAgent].dispatch(opts, handler)
  28109. }
  28110. async close () {
  28111. await this[kAgent].close()
  28112. this[kClients].clear()
  28113. }
  28114. deactivate () {
  28115. this[kIsMockActive] = false
  28116. }
  28117. activate () {
  28118. this[kIsMockActive] = true
  28119. }
  28120. enableNetConnect (matcher) {
  28121. if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
  28122. if (Array.isArray(this[kNetConnect])) {
  28123. this[kNetConnect].push(matcher)
  28124. } else {
  28125. this[kNetConnect] = [matcher]
  28126. }
  28127. } else if (typeof matcher === 'undefined') {
  28128. this[kNetConnect] = true
  28129. } else {
  28130. throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
  28131. }
  28132. }
  28133. disableNetConnect () {
  28134. this[kNetConnect] = false
  28135. }
  28136. // This is required to bypass issues caused by using global symbols - see:
  28137. // https://github.com/nodejs/undici/issues/1447
  28138. get isMockActive () {
  28139. return this[kIsMockActive]
  28140. }
  28141. [kMockAgentSet] (origin, dispatcher) {
  28142. this[kClients].set(origin, new FakeWeakRef(dispatcher))
  28143. }
  28144. [kFactory] (origin) {
  28145. const mockOptions = Object.assign({ agent: this }, this[kOptions])
  28146. return this[kOptions] && this[kOptions].connections === 1
  28147. ? new MockClient(origin, mockOptions)
  28148. : new MockPool(origin, mockOptions)
  28149. }
  28150. [kMockAgentGet] (origin) {
  28151. // First check if we can immediately find it
  28152. const ref = this[kClients].get(origin)
  28153. if (ref) {
  28154. return ref.deref()
  28155. }
  28156. // If the origin is not a string create a dummy parent pool and return to user
  28157. if (typeof origin !== 'string') {
  28158. const dispatcher = this[kFactory]('http://localhost:9999')
  28159. this[kMockAgentSet](origin, dispatcher)
  28160. return dispatcher
  28161. }
  28162. // If we match, create a pool and assign the same dispatches
  28163. for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {
  28164. const nonExplicitDispatcher = nonExplicitRef.deref()
  28165. if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
  28166. const dispatcher = this[kFactory](origin)
  28167. this[kMockAgentSet](origin, dispatcher)
  28168. dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]
  28169. return dispatcher
  28170. }
  28171. }
  28172. }
  28173. [kGetNetConnect] () {
  28174. return this[kNetConnect]
  28175. }
  28176. pendingInterceptors () {
  28177. const mockAgentClients = this[kClients]
  28178. return Array.from(mockAgentClients.entries())
  28179. .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))
  28180. .filter(({ pending }) => pending)
  28181. }
  28182. assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
  28183. const pending = this.pendingInterceptors()
  28184. if (pending.length === 0) {
  28185. return
  28186. }
  28187. const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)
  28188. throw new UndiciError(`
  28189. ${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
  28190. ${pendingInterceptorsFormatter.format(pending)}
  28191. `.trim())
  28192. }
  28193. }
  28194. module.exports = MockAgent
  28195. /***/ }),
  28196. /***/ 8687:
  28197. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28198. "use strict";
  28199. const { promisify } = __nccwpck_require__(3837)
  28200. const Client = __nccwpck_require__(3598)
  28201. const { buildMockDispatch } = __nccwpck_require__(9323)
  28202. const {
  28203. kDispatches,
  28204. kMockAgent,
  28205. kClose,
  28206. kOriginalClose,
  28207. kOrigin,
  28208. kOriginalDispatch,
  28209. kConnected
  28210. } = __nccwpck_require__(4347)
  28211. const { MockInterceptor } = __nccwpck_require__(410)
  28212. const Symbols = __nccwpck_require__(2785)
  28213. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28214. /**
  28215. * MockClient provides an API that extends the Client to influence the mockDispatches.
  28216. */
  28217. class MockClient extends Client {
  28218. constructor (origin, opts) {
  28219. super(origin, opts)
  28220. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28221. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28222. }
  28223. this[kMockAgent] = opts.agent
  28224. this[kOrigin] = origin
  28225. this[kDispatches] = []
  28226. this[kConnected] = 1
  28227. this[kOriginalDispatch] = this.dispatch
  28228. this[kOriginalClose] = this.close.bind(this)
  28229. this.dispatch = buildMockDispatch.call(this)
  28230. this.close = this[kClose]
  28231. }
  28232. get [Symbols.kConnected] () {
  28233. return this[kConnected]
  28234. }
  28235. /**
  28236. * Sets up the base interceptor for mocking replies from undici.
  28237. */
  28238. intercept (opts) {
  28239. return new MockInterceptor(opts, this[kDispatches])
  28240. }
  28241. async [kClose] () {
  28242. await promisify(this[kOriginalClose])()
  28243. this[kConnected] = 0
  28244. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28245. }
  28246. }
  28247. module.exports = MockClient
  28248. /***/ }),
  28249. /***/ 888:
  28250. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28251. "use strict";
  28252. const { UndiciError } = __nccwpck_require__(8045)
  28253. class MockNotMatchedError extends UndiciError {
  28254. constructor (message) {
  28255. super(message)
  28256. Error.captureStackTrace(this, MockNotMatchedError)
  28257. this.name = 'MockNotMatchedError'
  28258. this.message = message || 'The request does not match any registered mock dispatches'
  28259. this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
  28260. }
  28261. }
  28262. module.exports = {
  28263. MockNotMatchedError
  28264. }
  28265. /***/ }),
  28266. /***/ 410:
  28267. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28268. "use strict";
  28269. const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(9323)
  28270. const {
  28271. kDispatches,
  28272. kDispatchKey,
  28273. kDefaultHeaders,
  28274. kDefaultTrailers,
  28275. kContentLength,
  28276. kMockDispatch
  28277. } = __nccwpck_require__(4347)
  28278. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28279. const { buildURL } = __nccwpck_require__(3983)
  28280. /**
  28281. * Defines the scope API for an interceptor reply
  28282. */
  28283. class MockScope {
  28284. constructor (mockDispatch) {
  28285. this[kMockDispatch] = mockDispatch
  28286. }
  28287. /**
  28288. * Delay a reply by a set amount in ms.
  28289. */
  28290. delay (waitInMs) {
  28291. if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
  28292. throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
  28293. }
  28294. this[kMockDispatch].delay = waitInMs
  28295. return this
  28296. }
  28297. /**
  28298. * For a defined reply, never mark as consumed.
  28299. */
  28300. persist () {
  28301. this[kMockDispatch].persist = true
  28302. return this
  28303. }
  28304. /**
  28305. * Allow one to define a reply for a set amount of matching requests.
  28306. */
  28307. times (repeatTimes) {
  28308. if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
  28309. throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
  28310. }
  28311. this[kMockDispatch].times = repeatTimes
  28312. return this
  28313. }
  28314. }
  28315. /**
  28316. * Defines an interceptor for a Mock
  28317. */
  28318. class MockInterceptor {
  28319. constructor (opts, mockDispatches) {
  28320. if (typeof opts !== 'object') {
  28321. throw new InvalidArgumentError('opts must be an object')
  28322. }
  28323. if (typeof opts.path === 'undefined') {
  28324. throw new InvalidArgumentError('opts.path must be defined')
  28325. }
  28326. if (typeof opts.method === 'undefined') {
  28327. opts.method = 'GET'
  28328. }
  28329. // See https://github.com/nodejs/undici/issues/1245
  28330. // As per RFC 3986, clients are not supposed to send URI
  28331. // fragments to servers when they retrieve a document,
  28332. if (typeof opts.path === 'string') {
  28333. if (opts.query) {
  28334. opts.path = buildURL(opts.path, opts.query)
  28335. } else {
  28336. // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811
  28337. const parsedURL = new URL(opts.path, 'data://')
  28338. opts.path = parsedURL.pathname + parsedURL.search
  28339. }
  28340. }
  28341. if (typeof opts.method === 'string') {
  28342. opts.method = opts.method.toUpperCase()
  28343. }
  28344. this[kDispatchKey] = buildKey(opts)
  28345. this[kDispatches] = mockDispatches
  28346. this[kDefaultHeaders] = {}
  28347. this[kDefaultTrailers] = {}
  28348. this[kContentLength] = false
  28349. }
  28350. createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
  28351. const responseData = getResponseData(data)
  28352. const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
  28353. const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
  28354. const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }
  28355. return { statusCode, data, headers, trailers }
  28356. }
  28357. validateReplyParameters (statusCode, data, responseOptions) {
  28358. if (typeof statusCode === 'undefined') {
  28359. throw new InvalidArgumentError('statusCode must be defined')
  28360. }
  28361. if (typeof data === 'undefined') {
  28362. throw new InvalidArgumentError('data must be defined')
  28363. }
  28364. if (typeof responseOptions !== 'object') {
  28365. throw new InvalidArgumentError('responseOptions must be an object')
  28366. }
  28367. }
  28368. /**
  28369. * Mock an undici request with a defined reply.
  28370. */
  28371. reply (replyData) {
  28372. // Values of reply aren't available right now as they
  28373. // can only be available when the reply callback is invoked.
  28374. if (typeof replyData === 'function') {
  28375. // We'll first wrap the provided callback in another function,
  28376. // this function will properly resolve the data from the callback
  28377. // when invoked.
  28378. const wrappedDefaultsCallback = (opts) => {
  28379. // Our reply options callback contains the parameter for statusCode, data and options.
  28380. const resolvedData = replyData(opts)
  28381. // Check if it is in the right format
  28382. if (typeof resolvedData !== 'object') {
  28383. throw new InvalidArgumentError('reply options callback must return an object')
  28384. }
  28385. const { statusCode, data = '', responseOptions = {} } = resolvedData
  28386. this.validateReplyParameters(statusCode, data, responseOptions)
  28387. // Since the values can be obtained immediately we return them
  28388. // from this higher order function that will be resolved later.
  28389. return {
  28390. ...this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28391. }
  28392. }
  28393. // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
  28394. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)
  28395. return new MockScope(newMockDispatch)
  28396. }
  28397. // We can have either one or three parameters, if we get here,
  28398. // we should have 1-3 parameters. So we spread the arguments of
  28399. // this function to obtain the parameters, since replyData will always
  28400. // just be the statusCode.
  28401. const [statusCode, data = '', responseOptions = {}] = [...arguments]
  28402. this.validateReplyParameters(statusCode, data, responseOptions)
  28403. // Send in-already provided data like usual
  28404. const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28405. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)
  28406. return new MockScope(newMockDispatch)
  28407. }
  28408. /**
  28409. * Mock an undici request with a defined error.
  28410. */
  28411. replyWithError (error) {
  28412. if (typeof error === 'undefined') {
  28413. throw new InvalidArgumentError('error must be defined')
  28414. }
  28415. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })
  28416. return new MockScope(newMockDispatch)
  28417. }
  28418. /**
  28419. * Set default reply headers on the interceptor for subsequent replies
  28420. */
  28421. defaultReplyHeaders (headers) {
  28422. if (typeof headers === 'undefined') {
  28423. throw new InvalidArgumentError('headers must be defined')
  28424. }
  28425. this[kDefaultHeaders] = headers
  28426. return this
  28427. }
  28428. /**
  28429. * Set default reply trailers on the interceptor for subsequent replies
  28430. */
  28431. defaultReplyTrailers (trailers) {
  28432. if (typeof trailers === 'undefined') {
  28433. throw new InvalidArgumentError('trailers must be defined')
  28434. }
  28435. this[kDefaultTrailers] = trailers
  28436. return this
  28437. }
  28438. /**
  28439. * Set reply content length header for replies on the interceptor
  28440. */
  28441. replyContentLength () {
  28442. this[kContentLength] = true
  28443. return this
  28444. }
  28445. }
  28446. module.exports.MockInterceptor = MockInterceptor
  28447. module.exports.MockScope = MockScope
  28448. /***/ }),
  28449. /***/ 6193:
  28450. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28451. "use strict";
  28452. const { promisify } = __nccwpck_require__(3837)
  28453. const Pool = __nccwpck_require__(4634)
  28454. const { buildMockDispatch } = __nccwpck_require__(9323)
  28455. const {
  28456. kDispatches,
  28457. kMockAgent,
  28458. kClose,
  28459. kOriginalClose,
  28460. kOrigin,
  28461. kOriginalDispatch,
  28462. kConnected
  28463. } = __nccwpck_require__(4347)
  28464. const { MockInterceptor } = __nccwpck_require__(410)
  28465. const Symbols = __nccwpck_require__(2785)
  28466. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28467. /**
  28468. * MockPool provides an API that extends the Pool to influence the mockDispatches.
  28469. */
  28470. class MockPool extends Pool {
  28471. constructor (origin, opts) {
  28472. super(origin, opts)
  28473. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28474. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28475. }
  28476. this[kMockAgent] = opts.agent
  28477. this[kOrigin] = origin
  28478. this[kDispatches] = []
  28479. this[kConnected] = 1
  28480. this[kOriginalDispatch] = this.dispatch
  28481. this[kOriginalClose] = this.close.bind(this)
  28482. this.dispatch = buildMockDispatch.call(this)
  28483. this.close = this[kClose]
  28484. }
  28485. get [Symbols.kConnected] () {
  28486. return this[kConnected]
  28487. }
  28488. /**
  28489. * Sets up the base interceptor for mocking replies from undici.
  28490. */
  28491. intercept (opts) {
  28492. return new MockInterceptor(opts, this[kDispatches])
  28493. }
  28494. async [kClose] () {
  28495. await promisify(this[kOriginalClose])()
  28496. this[kConnected] = 0
  28497. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28498. }
  28499. }
  28500. module.exports = MockPool
  28501. /***/ }),
  28502. /***/ 4347:
  28503. /***/ ((module) => {
  28504. "use strict";
  28505. module.exports = {
  28506. kAgent: Symbol('agent'),
  28507. kOptions: Symbol('options'),
  28508. kFactory: Symbol('factory'),
  28509. kDispatches: Symbol('dispatches'),
  28510. kDispatchKey: Symbol('dispatch key'),
  28511. kDefaultHeaders: Symbol('default headers'),
  28512. kDefaultTrailers: Symbol('default trailers'),
  28513. kContentLength: Symbol('content length'),
  28514. kMockAgent: Symbol('mock agent'),
  28515. kMockAgentSet: Symbol('mock agent set'),
  28516. kMockAgentGet: Symbol('mock agent get'),
  28517. kMockDispatch: Symbol('mock dispatch'),
  28518. kClose: Symbol('close'),
  28519. kOriginalClose: Symbol('original agent close'),
  28520. kOrigin: Symbol('origin'),
  28521. kIsMockActive: Symbol('is mock active'),
  28522. kNetConnect: Symbol('net connect'),
  28523. kGetNetConnect: Symbol('get net connect'),
  28524. kConnected: Symbol('connected')
  28525. }
  28526. /***/ }),
  28527. /***/ 9323:
  28528. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28529. "use strict";
  28530. const { MockNotMatchedError } = __nccwpck_require__(888)
  28531. const {
  28532. kDispatches,
  28533. kMockAgent,
  28534. kOriginalDispatch,
  28535. kOrigin,
  28536. kGetNetConnect
  28537. } = __nccwpck_require__(4347)
  28538. const { buildURL, nop } = __nccwpck_require__(3983)
  28539. const { STATUS_CODES } = __nccwpck_require__(3685)
  28540. const {
  28541. types: {
  28542. isPromise
  28543. }
  28544. } = __nccwpck_require__(3837)
  28545. function matchValue (match, value) {
  28546. if (typeof match === 'string') {
  28547. return match === value
  28548. }
  28549. if (match instanceof RegExp) {
  28550. return match.test(value)
  28551. }
  28552. if (typeof match === 'function') {
  28553. return match(value) === true
  28554. }
  28555. return false
  28556. }
  28557. function lowerCaseEntries (headers) {
  28558. return Object.fromEntries(
  28559. Object.entries(headers).map(([headerName, headerValue]) => {
  28560. return [headerName.toLocaleLowerCase(), headerValue]
  28561. })
  28562. )
  28563. }
  28564. /**
  28565. * @param {import('../../index').Headers|string[]|Record<string, string>} headers
  28566. * @param {string} key
  28567. */
  28568. function getHeaderByName (headers, key) {
  28569. if (Array.isArray(headers)) {
  28570. for (let i = 0; i < headers.length; i += 2) {
  28571. if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
  28572. return headers[i + 1]
  28573. }
  28574. }
  28575. return undefined
  28576. } else if (typeof headers.get === 'function') {
  28577. return headers.get(key)
  28578. } else {
  28579. return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
  28580. }
  28581. }
  28582. /** @param {string[]} headers */
  28583. function buildHeadersFromArray (headers) { // fetch HeadersList
  28584. const clone = headers.slice()
  28585. const entries = []
  28586. for (let index = 0; index < clone.length; index += 2) {
  28587. entries.push([clone[index], clone[index + 1]])
  28588. }
  28589. return Object.fromEntries(entries)
  28590. }
  28591. function matchHeaders (mockDispatch, headers) {
  28592. if (typeof mockDispatch.headers === 'function') {
  28593. if (Array.isArray(headers)) { // fetch HeadersList
  28594. headers = buildHeadersFromArray(headers)
  28595. }
  28596. return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
  28597. }
  28598. if (typeof mockDispatch.headers === 'undefined') {
  28599. return true
  28600. }
  28601. if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
  28602. return false
  28603. }
  28604. for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
  28605. const headerValue = getHeaderByName(headers, matchHeaderName)
  28606. if (!matchValue(matchHeaderValue, headerValue)) {
  28607. return false
  28608. }
  28609. }
  28610. return true
  28611. }
  28612. function safeUrl (path) {
  28613. if (typeof path !== 'string') {
  28614. return path
  28615. }
  28616. const pathSegments = path.split('?')
  28617. if (pathSegments.length !== 2) {
  28618. return path
  28619. }
  28620. const qp = new URLSearchParams(pathSegments.pop())
  28621. qp.sort()
  28622. return [...pathSegments, qp.toString()].join('?')
  28623. }
  28624. function matchKey (mockDispatch, { path, method, body, headers }) {
  28625. const pathMatch = matchValue(mockDispatch.path, path)
  28626. const methodMatch = matchValue(mockDispatch.method, method)
  28627. const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
  28628. const headersMatch = matchHeaders(mockDispatch, headers)
  28629. return pathMatch && methodMatch && bodyMatch && headersMatch
  28630. }
  28631. function getResponseData (data) {
  28632. if (Buffer.isBuffer(data)) {
  28633. return data
  28634. } else if (typeof data === 'object') {
  28635. return JSON.stringify(data)
  28636. } else {
  28637. return data.toString()
  28638. }
  28639. }
  28640. function getMockDispatch (mockDispatches, key) {
  28641. const basePath = key.query ? buildURL(key.path, key.query) : key.path
  28642. const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
  28643. // Match path
  28644. let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))
  28645. if (matchedMockDispatches.length === 0) {
  28646. throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
  28647. }
  28648. // Match method
  28649. matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
  28650. if (matchedMockDispatches.length === 0) {
  28651. throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`)
  28652. }
  28653. // Match body
  28654. matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
  28655. if (matchedMockDispatches.length === 0) {
  28656. throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`)
  28657. }
  28658. // Match headers
  28659. matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
  28660. if (matchedMockDispatches.length === 0) {
  28661. throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`)
  28662. }
  28663. return matchedMockDispatches[0]
  28664. }
  28665. function addMockDispatch (mockDispatches, key, data) {
  28666. const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
  28667. const replyData = typeof data === 'function' ? { callback: data } : { ...data }
  28668. const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
  28669. mockDispatches.push(newMockDispatch)
  28670. return newMockDispatch
  28671. }
  28672. function deleteMockDispatch (mockDispatches, key) {
  28673. const index = mockDispatches.findIndex(dispatch => {
  28674. if (!dispatch.consumed) {
  28675. return false
  28676. }
  28677. return matchKey(dispatch, key)
  28678. })
  28679. if (index !== -1) {
  28680. mockDispatches.splice(index, 1)
  28681. }
  28682. }
  28683. function buildKey (opts) {
  28684. const { path, method, body, headers, query } = opts
  28685. return {
  28686. path,
  28687. method,
  28688. body,
  28689. headers,
  28690. query
  28691. }
  28692. }
  28693. function generateKeyValues (data) {
  28694. return Object.entries(data).reduce((keyValuePairs, [key, value]) => [
  28695. ...keyValuePairs,
  28696. Buffer.from(`${key}`),
  28697. Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)
  28698. ], [])
  28699. }
  28700. /**
  28701. * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
  28702. * @param {number} statusCode
  28703. */
  28704. function getStatusText (statusCode) {
  28705. return STATUS_CODES[statusCode] || 'unknown'
  28706. }
  28707. async function getResponse (body) {
  28708. const buffers = []
  28709. for await (const data of body) {
  28710. buffers.push(data)
  28711. }
  28712. return Buffer.concat(buffers).toString('utf8')
  28713. }
  28714. /**
  28715. * Mock dispatch function used to simulate undici dispatches
  28716. */
  28717. function mockDispatch (opts, handler) {
  28718. // Get mock dispatch from built key
  28719. const key = buildKey(opts)
  28720. const mockDispatch = getMockDispatch(this[kDispatches], key)
  28721. mockDispatch.timesInvoked++
  28722. // Here's where we resolve a callback if a callback is present for the dispatch data.
  28723. if (mockDispatch.data.callback) {
  28724. mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
  28725. }
  28726. // Parse mockDispatch data
  28727. const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
  28728. const { timesInvoked, times } = mockDispatch
  28729. // If it's used up and not persistent, mark as consumed
  28730. mockDispatch.consumed = !persist && timesInvoked >= times
  28731. mockDispatch.pending = timesInvoked < times
  28732. // If specified, trigger dispatch error
  28733. if (error !== null) {
  28734. deleteMockDispatch(this[kDispatches], key)
  28735. handler.onError(error)
  28736. return true
  28737. }
  28738. // Handle the request with a delay if necessary
  28739. if (typeof delay === 'number' && delay > 0) {
  28740. setTimeout(() => {
  28741. handleReply(this[kDispatches])
  28742. }, delay)
  28743. } else {
  28744. handleReply(this[kDispatches])
  28745. }
  28746. function handleReply (mockDispatches, _data = data) {
  28747. // fetch's HeadersList is a 1D string array
  28748. const optsHeaders = Array.isArray(opts.headers)
  28749. ? buildHeadersFromArray(opts.headers)
  28750. : opts.headers
  28751. const body = typeof _data === 'function'
  28752. ? _data({ ...opts, headers: optsHeaders })
  28753. : _data
  28754. // util.types.isPromise is likely needed for jest.
  28755. if (isPromise(body)) {
  28756. // If handleReply is asynchronous, throwing an error
  28757. // in the callback will reject the promise, rather than
  28758. // synchronously throw the error, which breaks some tests.
  28759. // Rather, we wait for the callback to resolve if it is a
  28760. // promise, and then re-run handleReply with the new body.
  28761. body.then((newData) => handleReply(mockDispatches, newData))
  28762. return
  28763. }
  28764. const responseData = getResponseData(body)
  28765. const responseHeaders = generateKeyValues(headers)
  28766. const responseTrailers = generateKeyValues(trailers)
  28767. handler.abort = nop
  28768. handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode))
  28769. handler.onData(Buffer.from(responseData))
  28770. handler.onComplete(responseTrailers)
  28771. deleteMockDispatch(mockDispatches, key)
  28772. }
  28773. function resume () {}
  28774. return true
  28775. }
  28776. function buildMockDispatch () {
  28777. const agent = this[kMockAgent]
  28778. const origin = this[kOrigin]
  28779. const originalDispatch = this[kOriginalDispatch]
  28780. return function dispatch (opts, handler) {
  28781. if (agent.isMockActive) {
  28782. try {
  28783. mockDispatch.call(this, opts, handler)
  28784. } catch (error) {
  28785. if (error instanceof MockNotMatchedError) {
  28786. const netConnect = agent[kGetNetConnect]()
  28787. if (netConnect === false) {
  28788. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
  28789. }
  28790. if (checkNetConnect(netConnect, origin)) {
  28791. originalDispatch.call(this, opts, handler)
  28792. } else {
  28793. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
  28794. }
  28795. } else {
  28796. throw error
  28797. }
  28798. }
  28799. } else {
  28800. originalDispatch.call(this, opts, handler)
  28801. }
  28802. }
  28803. }
  28804. function checkNetConnect (netConnect, origin) {
  28805. const url = new URL(origin)
  28806. if (netConnect === true) {
  28807. return true
  28808. } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
  28809. return true
  28810. }
  28811. return false
  28812. }
  28813. function buildMockOptions (opts) {
  28814. if (opts) {
  28815. const { agent, ...mockOptions } = opts
  28816. return mockOptions
  28817. }
  28818. }
  28819. module.exports = {
  28820. getResponseData,
  28821. getMockDispatch,
  28822. addMockDispatch,
  28823. deleteMockDispatch,
  28824. buildKey,
  28825. generateKeyValues,
  28826. matchValue,
  28827. getResponse,
  28828. getStatusText,
  28829. mockDispatch,
  28830. buildMockDispatch,
  28831. checkNetConnect,
  28832. buildMockOptions,
  28833. getHeaderByName
  28834. }
  28835. /***/ }),
  28836. /***/ 6823:
  28837. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28838. "use strict";
  28839. const { Transform } = __nccwpck_require__(2781)
  28840. const { Console } = __nccwpck_require__(6206)
  28841. /**
  28842. * Gets the output of `console.table(…)` as a string.
  28843. */
  28844. module.exports = class PendingInterceptorsFormatter {
  28845. constructor ({ disableColors } = {}) {
  28846. this.transform = new Transform({
  28847. transform (chunk, _enc, cb) {
  28848. cb(null, chunk)
  28849. }
  28850. })
  28851. this.logger = new Console({
  28852. stdout: this.transform,
  28853. inspectOptions: {
  28854. colors: !disableColors && !process.env.CI
  28855. }
  28856. })
  28857. }
  28858. format (pendingInterceptors) {
  28859. const withPrettyHeaders = pendingInterceptors.map(
  28860. ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
  28861. Method: method,
  28862. Origin: origin,
  28863. Path: path,
  28864. 'Status code': statusCode,
  28865. Persistent: persist ? '✅' : '❌',
  28866. Invocations: timesInvoked,
  28867. Remaining: persist ? Infinity : times - timesInvoked
  28868. }))
  28869. this.logger.table(withPrettyHeaders)
  28870. return this.transform.read().toString()
  28871. }
  28872. }
  28873. /***/ }),
  28874. /***/ 8891:
  28875. /***/ ((module) => {
  28876. "use strict";
  28877. const singulars = {
  28878. pronoun: 'it',
  28879. is: 'is',
  28880. was: 'was',
  28881. this: 'this'
  28882. }
  28883. const plurals = {
  28884. pronoun: 'they',
  28885. is: 'are',
  28886. was: 'were',
  28887. this: 'these'
  28888. }
  28889. module.exports = class Pluralizer {
  28890. constructor (singular, plural) {
  28891. this.singular = singular
  28892. this.plural = plural
  28893. }
  28894. pluralize (count) {
  28895. const one = count === 1
  28896. const keys = one ? singulars : plurals
  28897. const noun = one ? this.singular : this.plural
  28898. return { ...keys, count, noun }
  28899. }
  28900. }
  28901. /***/ }),
  28902. /***/ 8266:
  28903. /***/ ((module) => {
  28904. "use strict";
  28905. /* eslint-disable */
  28906. // Extracted from node/lib/internal/fixed_queue.js
  28907. // Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
  28908. const kSize = 2048;
  28909. const kMask = kSize - 1;
  28910. // The FixedQueue is implemented as a singly-linked list of fixed-size
  28911. // circular buffers. It looks something like this:
  28912. //
  28913. // head tail
  28914. // | |
  28915. // v v
  28916. // +-----------+ <-----\ +-----------+ <------\ +-----------+
  28917. // | [null] | \----- | next | \------- | next |
  28918. // +-----------+ +-----------+ +-----------+
  28919. // | item | <-- bottom | item | <-- bottom | [empty] |
  28920. // | item | | item | | [empty] |
  28921. // | item | | item | | [empty] |
  28922. // | item | | item | | [empty] |
  28923. // | item | | item | bottom --> | item |
  28924. // | item | | item | | item |
  28925. // | ... | | ... | | ... |
  28926. // | item | | item | | item |
  28927. // | item | | item | | item |
  28928. // | [empty] | <-- top | item | | item |
  28929. // | [empty] | | item | | item |
  28930. // | [empty] | | [empty] | <-- top top --> | [empty] |
  28931. // +-----------+ +-----------+ +-----------+
  28932. //
  28933. // Or, if there is only one circular buffer, it looks something
  28934. // like either of these:
  28935. //
  28936. // head tail head tail
  28937. // | | | |
  28938. // v v v v
  28939. // +-----------+ +-----------+
  28940. // | [null] | | [null] |
  28941. // +-----------+ +-----------+
  28942. // | [empty] | | item |
  28943. // | [empty] | | item |
  28944. // | item | <-- bottom top --> | [empty] |
  28945. // | item | | [empty] |
  28946. // | [empty] | <-- top bottom --> | item |
  28947. // | [empty] | | item |
  28948. // +-----------+ +-----------+
  28949. //
  28950. // Adding a value means moving `top` forward by one, removing means
  28951. // moving `bottom` forward by one. After reaching the end, the queue
  28952. // wraps around.
  28953. //
  28954. // When `top === bottom` the current queue is empty and when
  28955. // `top + 1 === bottom` it's full. This wastes a single space of storage
  28956. // but allows much quicker checks.
  28957. class FixedCircularBuffer {
  28958. constructor() {
  28959. this.bottom = 0;
  28960. this.top = 0;
  28961. this.list = new Array(kSize);
  28962. this.next = null;
  28963. }
  28964. isEmpty() {
  28965. return this.top === this.bottom;
  28966. }
  28967. isFull() {
  28968. return ((this.top + 1) & kMask) === this.bottom;
  28969. }
  28970. push(data) {
  28971. this.list[this.top] = data;
  28972. this.top = (this.top + 1) & kMask;
  28973. }
  28974. shift() {
  28975. const nextItem = this.list[this.bottom];
  28976. if (nextItem === undefined)
  28977. return null;
  28978. this.list[this.bottom] = undefined;
  28979. this.bottom = (this.bottom + 1) & kMask;
  28980. return nextItem;
  28981. }
  28982. }
  28983. module.exports = class FixedQueue {
  28984. constructor() {
  28985. this.head = this.tail = new FixedCircularBuffer();
  28986. }
  28987. isEmpty() {
  28988. return this.head.isEmpty();
  28989. }
  28990. push(data) {
  28991. if (this.head.isFull()) {
  28992. // Head is full: Creates a new queue, sets the old queue's `.next` to it,
  28993. // and sets it as the new main queue.
  28994. this.head = this.head.next = new FixedCircularBuffer();
  28995. }
  28996. this.head.push(data);
  28997. }
  28998. shift() {
  28999. const tail = this.tail;
  29000. const next = tail.shift();
  29001. if (tail.isEmpty() && tail.next !== null) {
  29002. // If there is another queue, it forms the new tail.
  29003. this.tail = tail.next;
  29004. }
  29005. return next;
  29006. }
  29007. };
  29008. /***/ }),
  29009. /***/ 3198:
  29010. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29011. "use strict";
  29012. const DispatcherBase = __nccwpck_require__(4839)
  29013. const FixedQueue = __nccwpck_require__(8266)
  29014. const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(2785)
  29015. const PoolStats = __nccwpck_require__(9689)
  29016. const kClients = Symbol('clients')
  29017. const kNeedDrain = Symbol('needDrain')
  29018. const kQueue = Symbol('queue')
  29019. const kClosedResolve = Symbol('closed resolve')
  29020. const kOnDrain = Symbol('onDrain')
  29021. const kOnConnect = Symbol('onConnect')
  29022. const kOnDisconnect = Symbol('onDisconnect')
  29023. const kOnConnectionError = Symbol('onConnectionError')
  29024. const kGetDispatcher = Symbol('get dispatcher')
  29025. const kAddClient = Symbol('add client')
  29026. const kRemoveClient = Symbol('remove client')
  29027. const kStats = Symbol('stats')
  29028. class PoolBase extends DispatcherBase {
  29029. constructor () {
  29030. super()
  29031. this[kQueue] = new FixedQueue()
  29032. this[kClients] = []
  29033. this[kQueued] = 0
  29034. const pool = this
  29035. this[kOnDrain] = function onDrain (origin, targets) {
  29036. const queue = pool[kQueue]
  29037. let needDrain = false
  29038. while (!needDrain) {
  29039. const item = queue.shift()
  29040. if (!item) {
  29041. break
  29042. }
  29043. pool[kQueued]--
  29044. needDrain = !this.dispatch(item.opts, item.handler)
  29045. }
  29046. this[kNeedDrain] = needDrain
  29047. if (!this[kNeedDrain] && pool[kNeedDrain]) {
  29048. pool[kNeedDrain] = false
  29049. pool.emit('drain', origin, [pool, ...targets])
  29050. }
  29051. if (pool[kClosedResolve] && queue.isEmpty()) {
  29052. Promise
  29053. .all(pool[kClients].map(c => c.close()))
  29054. .then(pool[kClosedResolve])
  29055. }
  29056. }
  29057. this[kOnConnect] = (origin, targets) => {
  29058. pool.emit('connect', origin, [pool, ...targets])
  29059. }
  29060. this[kOnDisconnect] = (origin, targets, err) => {
  29061. pool.emit('disconnect', origin, [pool, ...targets], err)
  29062. }
  29063. this[kOnConnectionError] = (origin, targets, err) => {
  29064. pool.emit('connectionError', origin, [pool, ...targets], err)
  29065. }
  29066. this[kStats] = new PoolStats(this)
  29067. }
  29068. get [kBusy] () {
  29069. return this[kNeedDrain]
  29070. }
  29071. get [kConnected] () {
  29072. return this[kClients].filter(client => client[kConnected]).length
  29073. }
  29074. get [kFree] () {
  29075. return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
  29076. }
  29077. get [kPending] () {
  29078. let ret = this[kQueued]
  29079. for (const { [kPending]: pending } of this[kClients]) {
  29080. ret += pending
  29081. }
  29082. return ret
  29083. }
  29084. get [kRunning] () {
  29085. let ret = 0
  29086. for (const { [kRunning]: running } of this[kClients]) {
  29087. ret += running
  29088. }
  29089. return ret
  29090. }
  29091. get [kSize] () {
  29092. let ret = this[kQueued]
  29093. for (const { [kSize]: size } of this[kClients]) {
  29094. ret += size
  29095. }
  29096. return ret
  29097. }
  29098. get stats () {
  29099. return this[kStats]
  29100. }
  29101. async [kClose] () {
  29102. if (this[kQueue].isEmpty()) {
  29103. return Promise.all(this[kClients].map(c => c.close()))
  29104. } else {
  29105. return new Promise((resolve) => {
  29106. this[kClosedResolve] = resolve
  29107. })
  29108. }
  29109. }
  29110. async [kDestroy] (err) {
  29111. while (true) {
  29112. const item = this[kQueue].shift()
  29113. if (!item) {
  29114. break
  29115. }
  29116. item.handler.onError(err)
  29117. }
  29118. return Promise.all(this[kClients].map(c => c.destroy(err)))
  29119. }
  29120. [kDispatch] (opts, handler) {
  29121. const dispatcher = this[kGetDispatcher]()
  29122. if (!dispatcher) {
  29123. this[kNeedDrain] = true
  29124. this[kQueue].push({ opts, handler })
  29125. this[kQueued]++
  29126. } else if (!dispatcher.dispatch(opts, handler)) {
  29127. dispatcher[kNeedDrain] = true
  29128. this[kNeedDrain] = !this[kGetDispatcher]()
  29129. }
  29130. return !this[kNeedDrain]
  29131. }
  29132. [kAddClient] (client) {
  29133. client
  29134. .on('drain', this[kOnDrain])
  29135. .on('connect', this[kOnConnect])
  29136. .on('disconnect', this[kOnDisconnect])
  29137. .on('connectionError', this[kOnConnectionError])
  29138. this[kClients].push(client)
  29139. if (this[kNeedDrain]) {
  29140. process.nextTick(() => {
  29141. if (this[kNeedDrain]) {
  29142. this[kOnDrain](client[kUrl], [this, client])
  29143. }
  29144. })
  29145. }
  29146. return this
  29147. }
  29148. [kRemoveClient] (client) {
  29149. client.close(() => {
  29150. const idx = this[kClients].indexOf(client)
  29151. if (idx !== -1) {
  29152. this[kClients].splice(idx, 1)
  29153. }
  29154. })
  29155. this[kNeedDrain] = this[kClients].some(dispatcher => (
  29156. !dispatcher[kNeedDrain] &&
  29157. dispatcher.closed !== true &&
  29158. dispatcher.destroyed !== true
  29159. ))
  29160. }
  29161. }
  29162. module.exports = {
  29163. PoolBase,
  29164. kClients,
  29165. kNeedDrain,
  29166. kAddClient,
  29167. kRemoveClient,
  29168. kGetDispatcher
  29169. }
  29170. /***/ }),
  29171. /***/ 9689:
  29172. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29173. const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(2785)
  29174. const kPool = Symbol('pool')
  29175. class PoolStats {
  29176. constructor (pool) {
  29177. this[kPool] = pool
  29178. }
  29179. get connected () {
  29180. return this[kPool][kConnected]
  29181. }
  29182. get free () {
  29183. return this[kPool][kFree]
  29184. }
  29185. get pending () {
  29186. return this[kPool][kPending]
  29187. }
  29188. get queued () {
  29189. return this[kPool][kQueued]
  29190. }
  29191. get running () {
  29192. return this[kPool][kRunning]
  29193. }
  29194. get size () {
  29195. return this[kPool][kSize]
  29196. }
  29197. }
  29198. module.exports = PoolStats
  29199. /***/ }),
  29200. /***/ 4634:
  29201. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29202. "use strict";
  29203. const {
  29204. PoolBase,
  29205. kClients,
  29206. kNeedDrain,
  29207. kAddClient,
  29208. kGetDispatcher
  29209. } = __nccwpck_require__(3198)
  29210. const Client = __nccwpck_require__(3598)
  29211. const {
  29212. InvalidArgumentError
  29213. } = __nccwpck_require__(8045)
  29214. const util = __nccwpck_require__(3983)
  29215. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  29216. const buildConnector = __nccwpck_require__(2067)
  29217. const kOptions = Symbol('options')
  29218. const kConnections = Symbol('connections')
  29219. const kFactory = Symbol('factory')
  29220. function defaultFactory (origin, opts) {
  29221. return new Client(origin, opts)
  29222. }
  29223. class Pool extends PoolBase {
  29224. constructor (origin, {
  29225. connections,
  29226. factory = defaultFactory,
  29227. connect,
  29228. connectTimeout,
  29229. tls,
  29230. maxCachedSessions,
  29231. socketPath,
  29232. autoSelectFamily,
  29233. autoSelectFamilyAttemptTimeout,
  29234. allowH2,
  29235. ...options
  29236. } = {}) {
  29237. super()
  29238. if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
  29239. throw new InvalidArgumentError('invalid connections')
  29240. }
  29241. if (typeof factory !== 'function') {
  29242. throw new InvalidArgumentError('factory must be a function.')
  29243. }
  29244. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  29245. throw new InvalidArgumentError('connect must be a function or an object')
  29246. }
  29247. if (typeof connect !== 'function') {
  29248. connect = buildConnector({
  29249. ...tls,
  29250. maxCachedSessions,
  29251. allowH2,
  29252. socketPath,
  29253. timeout: connectTimeout,
  29254. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  29255. ...connect
  29256. })
  29257. }
  29258. this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool)
  29259. ? options.interceptors.Pool
  29260. : []
  29261. this[kConnections] = connections || null
  29262. this[kUrl] = util.parseOrigin(origin)
  29263. this[kOptions] = { ...util.deepClone(options), connect, allowH2 }
  29264. this[kOptions].interceptors = options.interceptors
  29265. ? { ...options.interceptors }
  29266. : undefined
  29267. this[kFactory] = factory
  29268. this.on('connectionError', (origin, targets, error) => {
  29269. // If a connection error occurs, we remove the client from the pool,
  29270. // and emit a connectionError event. They will not be re-used.
  29271. // Fixes https://github.com/nodejs/undici/issues/3895
  29272. for (const target of targets) {
  29273. // Do not use kRemoveClient here, as it will close the client,
  29274. // but the client cannot be closed in this state.
  29275. const idx = this[kClients].indexOf(target)
  29276. if (idx !== -1) {
  29277. this[kClients].splice(idx, 1)
  29278. }
  29279. }
  29280. })
  29281. }
  29282. [kGetDispatcher] () {
  29283. let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain])
  29284. if (dispatcher) {
  29285. return dispatcher
  29286. }
  29287. if (!this[kConnections] || this[kClients].length < this[kConnections]) {
  29288. dispatcher = this[kFactory](this[kUrl], this[kOptions])
  29289. this[kAddClient](dispatcher)
  29290. }
  29291. return dispatcher
  29292. }
  29293. }
  29294. module.exports = Pool
  29295. /***/ }),
  29296. /***/ 7858:
  29297. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29298. "use strict";
  29299. const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(2785)
  29300. const { URL } = __nccwpck_require__(7310)
  29301. const Agent = __nccwpck_require__(7890)
  29302. const Pool = __nccwpck_require__(4634)
  29303. const DispatcherBase = __nccwpck_require__(4839)
  29304. const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8045)
  29305. const buildConnector = __nccwpck_require__(2067)
  29306. const kAgent = Symbol('proxy agent')
  29307. const kClient = Symbol('proxy client')
  29308. const kProxyHeaders = Symbol('proxy headers')
  29309. const kRequestTls = Symbol('request tls settings')
  29310. const kProxyTls = Symbol('proxy tls settings')
  29311. const kConnectEndpoint = Symbol('connect endpoint function')
  29312. function defaultProtocolPort (protocol) {
  29313. return protocol === 'https:' ? 443 : 80
  29314. }
  29315. function buildProxyOptions (opts) {
  29316. if (typeof opts === 'string') {
  29317. opts = { uri: opts }
  29318. }
  29319. if (!opts || !opts.uri) {
  29320. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29321. }
  29322. return {
  29323. uri: opts.uri,
  29324. protocol: opts.protocol || 'https'
  29325. }
  29326. }
  29327. function defaultFactory (origin, opts) {
  29328. return new Pool(origin, opts)
  29329. }
  29330. class ProxyAgent extends DispatcherBase {
  29331. constructor (opts) {
  29332. super(opts)
  29333. this[kProxy] = buildProxyOptions(opts)
  29334. this[kAgent] = new Agent(opts)
  29335. this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)
  29336. ? opts.interceptors.ProxyAgent
  29337. : []
  29338. if (typeof opts === 'string') {
  29339. opts = { uri: opts }
  29340. }
  29341. if (!opts || !opts.uri) {
  29342. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29343. }
  29344. const { clientFactory = defaultFactory } = opts
  29345. if (typeof clientFactory !== 'function') {
  29346. throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
  29347. }
  29348. this[kRequestTls] = opts.requestTls
  29349. this[kProxyTls] = opts.proxyTls
  29350. this[kProxyHeaders] = opts.headers || {}
  29351. const resolvedUrl = new URL(opts.uri)
  29352. const { origin, port, host, username, password } = resolvedUrl
  29353. if (opts.auth && opts.token) {
  29354. throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')
  29355. } else if (opts.auth) {
  29356. /* @deprecated in favour of opts.token */
  29357. this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`
  29358. } else if (opts.token) {
  29359. this[kProxyHeaders]['proxy-authorization'] = opts.token
  29360. } else if (username && password) {
  29361. this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`
  29362. }
  29363. const connect = buildConnector({ ...opts.proxyTls })
  29364. this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })
  29365. this[kClient] = clientFactory(resolvedUrl, { connect })
  29366. this[kAgent] = new Agent({
  29367. ...opts,
  29368. connect: async (opts, callback) => {
  29369. let requestedHost = opts.host
  29370. if (!opts.port) {
  29371. requestedHost += `:${defaultProtocolPort(opts.protocol)}`
  29372. }
  29373. try {
  29374. const { socket, statusCode } = await this[kClient].connect({
  29375. origin,
  29376. port,
  29377. path: requestedHost,
  29378. signal: opts.signal,
  29379. headers: {
  29380. ...this[kProxyHeaders],
  29381. host
  29382. }
  29383. })
  29384. if (statusCode !== 200) {
  29385. socket.on('error', () => {}).destroy()
  29386. callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))
  29387. }
  29388. if (opts.protocol !== 'https:') {
  29389. callback(null, socket)
  29390. return
  29391. }
  29392. let servername
  29393. if (this[kRequestTls]) {
  29394. servername = this[kRequestTls].servername
  29395. } else {
  29396. servername = opts.servername
  29397. }
  29398. this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
  29399. } catch (err) {
  29400. callback(err)
  29401. }
  29402. }
  29403. })
  29404. }
  29405. dispatch (opts, handler) {
  29406. const { host } = new URL(opts.origin)
  29407. const headers = buildHeaders(opts.headers)
  29408. throwIfProxyAuthIsSent(headers)
  29409. return this[kAgent].dispatch(
  29410. {
  29411. ...opts,
  29412. headers: {
  29413. ...headers,
  29414. host
  29415. }
  29416. },
  29417. handler
  29418. )
  29419. }
  29420. async [kClose] () {
  29421. await this[kAgent].close()
  29422. await this[kClient].close()
  29423. }
  29424. async [kDestroy] () {
  29425. await this[kAgent].destroy()
  29426. await this[kClient].destroy()
  29427. }
  29428. }
  29429. /**
  29430. * @param {string[] | Record<string, string>} headers
  29431. * @returns {Record<string, string>}
  29432. */
  29433. function buildHeaders (headers) {
  29434. // When using undici.fetch, the headers list is stored
  29435. // as an array.
  29436. if (Array.isArray(headers)) {
  29437. /** @type {Record<string, string>} */
  29438. const headersPair = {}
  29439. for (let i = 0; i < headers.length; i += 2) {
  29440. headersPair[headers[i]] = headers[i + 1]
  29441. }
  29442. return headersPair
  29443. }
  29444. return headers
  29445. }
  29446. /**
  29447. * @param {Record<string, string>} headers
  29448. *
  29449. * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers
  29450. * Nevertheless, it was changed and to avoid a security vulnerability by end users
  29451. * this check was created.
  29452. * It should be removed in the next major version for performance reasons
  29453. */
  29454. function throwIfProxyAuthIsSent (headers) {
  29455. const existProxyAuth = headers && Object.keys(headers)
  29456. .find((key) => key.toLowerCase() === 'proxy-authorization')
  29457. if (existProxyAuth) {
  29458. throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')
  29459. }
  29460. }
  29461. module.exports = ProxyAgent
  29462. /***/ }),
  29463. /***/ 9459:
  29464. /***/ ((module) => {
  29465. "use strict";
  29466. let fastNow = Date.now()
  29467. let fastNowTimeout
  29468. const fastTimers = []
  29469. function onTimeout () {
  29470. fastNow = Date.now()
  29471. let len = fastTimers.length
  29472. let idx = 0
  29473. while (idx < len) {
  29474. const timer = fastTimers[idx]
  29475. if (timer.state === 0) {
  29476. timer.state = fastNow + timer.delay
  29477. } else if (timer.state > 0 && fastNow >= timer.state) {
  29478. timer.state = -1
  29479. timer.callback(timer.opaque)
  29480. }
  29481. if (timer.state === -1) {
  29482. timer.state = -2
  29483. if (idx !== len - 1) {
  29484. fastTimers[idx] = fastTimers.pop()
  29485. } else {
  29486. fastTimers.pop()
  29487. }
  29488. len -= 1
  29489. } else {
  29490. idx += 1
  29491. }
  29492. }
  29493. if (fastTimers.length > 0) {
  29494. refreshTimeout()
  29495. }
  29496. }
  29497. function refreshTimeout () {
  29498. if (fastNowTimeout && fastNowTimeout.refresh) {
  29499. fastNowTimeout.refresh()
  29500. } else {
  29501. clearTimeout(fastNowTimeout)
  29502. fastNowTimeout = setTimeout(onTimeout, 1e3)
  29503. if (fastNowTimeout.unref) {
  29504. fastNowTimeout.unref()
  29505. }
  29506. }
  29507. }
  29508. class Timeout {
  29509. constructor (callback, delay, opaque) {
  29510. this.callback = callback
  29511. this.delay = delay
  29512. this.opaque = opaque
  29513. // -2 not in timer list
  29514. // -1 in timer list but inactive
  29515. // 0 in timer list waiting for time
  29516. // > 0 in timer list waiting for time to expire
  29517. this.state = -2
  29518. this.refresh()
  29519. }
  29520. refresh () {
  29521. if (this.state === -2) {
  29522. fastTimers.push(this)
  29523. if (!fastNowTimeout || fastTimers.length === 1) {
  29524. refreshTimeout()
  29525. }
  29526. }
  29527. this.state = 0
  29528. }
  29529. clear () {
  29530. this.state = -1
  29531. }
  29532. }
  29533. module.exports = {
  29534. setTimeout (callback, delay, opaque) {
  29535. return delay < 1e3
  29536. ? setTimeout(callback, delay, opaque)
  29537. : new Timeout(callback, delay, opaque)
  29538. },
  29539. clearTimeout (timeout) {
  29540. if (timeout instanceof Timeout) {
  29541. timeout.clear()
  29542. } else {
  29543. clearTimeout(timeout)
  29544. }
  29545. }
  29546. }
  29547. /***/ }),
  29548. /***/ 5354:
  29549. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29550. "use strict";
  29551. const diagnosticsChannel = __nccwpck_require__(7643)
  29552. const { uid, states } = __nccwpck_require__(9188)
  29553. const {
  29554. kReadyState,
  29555. kSentClose,
  29556. kByteParser,
  29557. kReceivedClose
  29558. } = __nccwpck_require__(7578)
  29559. const { fireEvent, failWebsocketConnection } = __nccwpck_require__(5515)
  29560. const { CloseEvent } = __nccwpck_require__(2611)
  29561. const { makeRequest } = __nccwpck_require__(8359)
  29562. const { fetching } = __nccwpck_require__(4881)
  29563. const { Headers } = __nccwpck_require__(554)
  29564. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  29565. const { kHeadersList } = __nccwpck_require__(2785)
  29566. const channels = {}
  29567. channels.open = diagnosticsChannel.channel('undici:websocket:open')
  29568. channels.close = diagnosticsChannel.channel('undici:websocket:close')
  29569. channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error')
  29570. /** @type {import('crypto')} */
  29571. let crypto
  29572. try {
  29573. crypto = __nccwpck_require__(6113)
  29574. } catch {
  29575. }
  29576. /**
  29577. * @see https://websockets.spec.whatwg.org/#concept-websocket-establish
  29578. * @param {URL} url
  29579. * @param {string|string[]} protocols
  29580. * @param {import('./websocket').WebSocket} ws
  29581. * @param {(response: any) => void} onEstablish
  29582. * @param {Partial<import('../../types/websocket').WebSocketInit>} options
  29583. */
  29584. function establishWebSocketConnection (url, protocols, ws, onEstablish, options) {
  29585. // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
  29586. // scheme is "ws", and to "https" otherwise.
  29587. const requestURL = url
  29588. requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
  29589. // 2. Let request be a new request, whose URL is requestURL, client is client,
  29590. // service-workers mode is "none", referrer is "no-referrer", mode is
  29591. // "websocket", credentials mode is "include", cache mode is "no-store" ,
  29592. // and redirect mode is "error".
  29593. const request = makeRequest({
  29594. urlList: [requestURL],
  29595. serviceWorkers: 'none',
  29596. referrer: 'no-referrer',
  29597. mode: 'websocket',
  29598. credentials: 'include',
  29599. cache: 'no-store',
  29600. redirect: 'error'
  29601. })
  29602. // Note: undici extension, allow setting custom headers.
  29603. if (options.headers) {
  29604. const headersList = new Headers(options.headers)[kHeadersList]
  29605. request.headersList = headersList
  29606. }
  29607. // 3. Append (`Upgrade`, `websocket`) to request’s header list.
  29608. // 4. Append (`Connection`, `Upgrade`) to request’s header list.
  29609. // Note: both of these are handled by undici currently.
  29610. // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397
  29611. // 5. Let keyValue be a nonce consisting of a randomly selected
  29612. // 16-byte value that has been forgiving-base64-encoded and
  29613. // isomorphic encoded.
  29614. const keyValue = crypto.randomBytes(16).toString('base64')
  29615. // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
  29616. // header list.
  29617. request.headersList.append('sec-websocket-key', keyValue)
  29618. // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
  29619. // header list.
  29620. request.headersList.append('sec-websocket-version', '13')
  29621. // 8. For each protocol in protocols, combine
  29622. // (`Sec-WebSocket-Protocol`, protocol) in request’s header
  29623. // list.
  29624. for (const protocol of protocols) {
  29625. request.headersList.append('sec-websocket-protocol', protocol)
  29626. }
  29627. // 9. Let permessageDeflate be a user-agent defined
  29628. // "permessage-deflate" extension header value.
  29629. // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673
  29630. // TODO: enable once permessage-deflate is supported
  29631. const permessageDeflate = '' // 'permessage-deflate; 15'
  29632. // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
  29633. // request’s header list.
  29634. // request.headersList.append('sec-websocket-extensions', permessageDeflate)
  29635. // 11. Fetch request with useParallelQueue set to true, and
  29636. // processResponse given response being these steps:
  29637. const controller = fetching({
  29638. request,
  29639. useParallelQueue: true,
  29640. dispatcher: options.dispatcher ?? getGlobalDispatcher(),
  29641. processResponse (response) {
  29642. // 1. If response is a network error or its status is not 101,
  29643. // fail the WebSocket connection.
  29644. if (response.type === 'error' || response.status !== 101) {
  29645. failWebsocketConnection(ws, 'Received network error or non-101 status code.')
  29646. return
  29647. }
  29648. // 2. If protocols is not the empty list and extracting header
  29649. // list values given `Sec-WebSocket-Protocol` and response’s
  29650. // header list results in null, failure, or the empty byte
  29651. // sequence, then fail the WebSocket connection.
  29652. if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {
  29653. failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
  29654. return
  29655. }
  29656. // 3. Follow the requirements stated step 2 to step 6, inclusive,
  29657. // of the last set of steps in section 4.1 of The WebSocket
  29658. // Protocol to validate response. This either results in fail
  29659. // the WebSocket connection or the WebSocket connection is
  29660. // established.
  29661. // 2. If the response lacks an |Upgrade| header field or the |Upgrade|
  29662. // header field contains a value that is not an ASCII case-
  29663. // insensitive match for the value "websocket", the client MUST
  29664. // _Fail the WebSocket Connection_.
  29665. if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {
  29666. failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
  29667. return
  29668. }
  29669. // 3. If the response lacks a |Connection| header field or the
  29670. // |Connection| header field doesn't contain a token that is an
  29671. // ASCII case-insensitive match for the value "Upgrade", the client
  29672. // MUST _Fail the WebSocket Connection_.
  29673. if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {
  29674. failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
  29675. return
  29676. }
  29677. // 4. If the response lacks a |Sec-WebSocket-Accept| header field or
  29678. // the |Sec-WebSocket-Accept| contains a value other than the
  29679. // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-
  29680. // Key| (as a string, not base64-decoded) with the string "258EAFA5-
  29681. // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and
  29682. // trailing whitespace, the client MUST _Fail the WebSocket
  29683. // Connection_.
  29684. const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')
  29685. const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')
  29686. if (secWSAccept !== digest) {
  29687. failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
  29688. return
  29689. }
  29690. // 5. If the response includes a |Sec-WebSocket-Extensions| header
  29691. // field and this header field indicates the use of an extension
  29692. // that was not present in the client's handshake (the server has
  29693. // indicated an extension not requested by the client), the client
  29694. // MUST _Fail the WebSocket Connection_. (The parsing of this
  29695. // header field to determine which extensions are requested is
  29696. // discussed in Section 9.1.)
  29697. const secExtension = response.headersList.get('Sec-WebSocket-Extensions')
  29698. if (secExtension !== null && secExtension !== permessageDeflate) {
  29699. failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')
  29700. return
  29701. }
  29702. // 6. If the response includes a |Sec-WebSocket-Protocol| header field
  29703. // and this header field indicates the use of a subprotocol that was
  29704. // not present in the client's handshake (the server has indicated a
  29705. // subprotocol not requested by the client), the client MUST _Fail
  29706. // the WebSocket Connection_.
  29707. const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')
  29708. if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) {
  29709. failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
  29710. return
  29711. }
  29712. response.socket.on('data', onSocketData)
  29713. response.socket.on('close', onSocketClose)
  29714. response.socket.on('error', onSocketError)
  29715. if (channels.open.hasSubscribers) {
  29716. channels.open.publish({
  29717. address: response.socket.address(),
  29718. protocol: secProtocol,
  29719. extensions: secExtension
  29720. })
  29721. }
  29722. onEstablish(response)
  29723. }
  29724. })
  29725. return controller
  29726. }
  29727. /**
  29728. * @param {Buffer} chunk
  29729. */
  29730. function onSocketData (chunk) {
  29731. if (!this.ws[kByteParser].write(chunk)) {
  29732. this.pause()
  29733. }
  29734. }
  29735. /**
  29736. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  29737. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
  29738. */
  29739. function onSocketClose () {
  29740. const { ws } = this
  29741. // If the TCP connection was closed after the
  29742. // WebSocket closing handshake was completed, the WebSocket connection
  29743. // is said to have been closed _cleanly_.
  29744. const wasClean = ws[kSentClose] && ws[kReceivedClose]
  29745. let code = 1005
  29746. let reason = ''
  29747. const result = ws[kByteParser].closingInfo
  29748. if (result) {
  29749. code = result.code ?? 1005
  29750. reason = result.reason
  29751. } else if (!ws[kSentClose]) {
  29752. // If _The WebSocket
  29753. // Connection is Closed_ and no Close control frame was received by the
  29754. // endpoint (such as could occur if the underlying transport connection
  29755. // is lost), _The WebSocket Connection Close Code_ is considered to be
  29756. // 1006.
  29757. code = 1006
  29758. }
  29759. // 1. Change the ready state to CLOSED (3).
  29760. ws[kReadyState] = states.CLOSED
  29761. // 2. If the user agent was required to fail the WebSocket
  29762. // connection, or if the WebSocket connection was closed
  29763. // after being flagged as full, fire an event named error
  29764. // at the WebSocket object.
  29765. // TODO
  29766. // 3. Fire an event named close at the WebSocket object,
  29767. // using CloseEvent, with the wasClean attribute
  29768. // initialized to true if the connection closed cleanly
  29769. // and false otherwise, the code attribute initialized to
  29770. // the WebSocket connection close code, and the reason
  29771. // attribute initialized to the result of applying UTF-8
  29772. // decode without BOM to the WebSocket connection close
  29773. // reason.
  29774. fireEvent('close', ws, CloseEvent, {
  29775. wasClean, code, reason
  29776. })
  29777. if (channels.close.hasSubscribers) {
  29778. channels.close.publish({
  29779. websocket: ws,
  29780. code,
  29781. reason
  29782. })
  29783. }
  29784. }
  29785. function onSocketError (error) {
  29786. const { ws } = this
  29787. ws[kReadyState] = states.CLOSING
  29788. if (channels.socketError.hasSubscribers) {
  29789. channels.socketError.publish(error)
  29790. }
  29791. this.destroy()
  29792. }
  29793. module.exports = {
  29794. establishWebSocketConnection
  29795. }
  29796. /***/ }),
  29797. /***/ 9188:
  29798. /***/ ((module) => {
  29799. "use strict";
  29800. // This is a Globally Unique Identifier unique used
  29801. // to validate that the endpoint accepts websocket
  29802. // connections.
  29803. // See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
  29804. const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
  29805. /** @type {PropertyDescriptor} */
  29806. const staticPropertyDescriptors = {
  29807. enumerable: true,
  29808. writable: false,
  29809. configurable: false
  29810. }
  29811. const states = {
  29812. CONNECTING: 0,
  29813. OPEN: 1,
  29814. CLOSING: 2,
  29815. CLOSED: 3
  29816. }
  29817. const opcodes = {
  29818. CONTINUATION: 0x0,
  29819. TEXT: 0x1,
  29820. BINARY: 0x2,
  29821. CLOSE: 0x8,
  29822. PING: 0x9,
  29823. PONG: 0xA
  29824. }
  29825. const maxUnsigned16Bit = 2 ** 16 - 1 // 65535
  29826. const parserStates = {
  29827. INFO: 0,
  29828. PAYLOADLENGTH_16: 2,
  29829. PAYLOADLENGTH_64: 3,
  29830. READ_DATA: 4
  29831. }
  29832. const emptyBuffer = Buffer.allocUnsafe(0)
  29833. module.exports = {
  29834. uid,
  29835. staticPropertyDescriptors,
  29836. states,
  29837. opcodes,
  29838. maxUnsigned16Bit,
  29839. parserStates,
  29840. emptyBuffer
  29841. }
  29842. /***/ }),
  29843. /***/ 2611:
  29844. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29845. "use strict";
  29846. const { webidl } = __nccwpck_require__(1744)
  29847. const { kEnumerableProperty } = __nccwpck_require__(3983)
  29848. const { MessagePort } = __nccwpck_require__(1267)
  29849. /**
  29850. * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
  29851. */
  29852. class MessageEvent extends Event {
  29853. #eventInit
  29854. constructor (type, eventInitDict = {}) {
  29855. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })
  29856. type = webidl.converters.DOMString(type)
  29857. eventInitDict = webidl.converters.MessageEventInit(eventInitDict)
  29858. super(type, eventInitDict)
  29859. this.#eventInit = eventInitDict
  29860. }
  29861. get data () {
  29862. webidl.brandCheck(this, MessageEvent)
  29863. return this.#eventInit.data
  29864. }
  29865. get origin () {
  29866. webidl.brandCheck(this, MessageEvent)
  29867. return this.#eventInit.origin
  29868. }
  29869. get lastEventId () {
  29870. webidl.brandCheck(this, MessageEvent)
  29871. return this.#eventInit.lastEventId
  29872. }
  29873. get source () {
  29874. webidl.brandCheck(this, MessageEvent)
  29875. return this.#eventInit.source
  29876. }
  29877. get ports () {
  29878. webidl.brandCheck(this, MessageEvent)
  29879. if (!Object.isFrozen(this.#eventInit.ports)) {
  29880. Object.freeze(this.#eventInit.ports)
  29881. }
  29882. return this.#eventInit.ports
  29883. }
  29884. initMessageEvent (
  29885. type,
  29886. bubbles = false,
  29887. cancelable = false,
  29888. data = null,
  29889. origin = '',
  29890. lastEventId = '',
  29891. source = null,
  29892. ports = []
  29893. ) {
  29894. webidl.brandCheck(this, MessageEvent)
  29895. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })
  29896. return new MessageEvent(type, {
  29897. bubbles, cancelable, data, origin, lastEventId, source, ports
  29898. })
  29899. }
  29900. }
  29901. /**
  29902. * @see https://websockets.spec.whatwg.org/#the-closeevent-interface
  29903. */
  29904. class CloseEvent extends Event {
  29905. #eventInit
  29906. constructor (type, eventInitDict = {}) {
  29907. webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })
  29908. type = webidl.converters.DOMString(type)
  29909. eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
  29910. super(type, eventInitDict)
  29911. this.#eventInit = eventInitDict
  29912. }
  29913. get wasClean () {
  29914. webidl.brandCheck(this, CloseEvent)
  29915. return this.#eventInit.wasClean
  29916. }
  29917. get code () {
  29918. webidl.brandCheck(this, CloseEvent)
  29919. return this.#eventInit.code
  29920. }
  29921. get reason () {
  29922. webidl.brandCheck(this, CloseEvent)
  29923. return this.#eventInit.reason
  29924. }
  29925. }
  29926. // https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
  29927. class ErrorEvent extends Event {
  29928. #eventInit
  29929. constructor (type, eventInitDict) {
  29930. webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })
  29931. super(type, eventInitDict)
  29932. type = webidl.converters.DOMString(type)
  29933. eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
  29934. this.#eventInit = eventInitDict
  29935. }
  29936. get message () {
  29937. webidl.brandCheck(this, ErrorEvent)
  29938. return this.#eventInit.message
  29939. }
  29940. get filename () {
  29941. webidl.brandCheck(this, ErrorEvent)
  29942. return this.#eventInit.filename
  29943. }
  29944. get lineno () {
  29945. webidl.brandCheck(this, ErrorEvent)
  29946. return this.#eventInit.lineno
  29947. }
  29948. get colno () {
  29949. webidl.brandCheck(this, ErrorEvent)
  29950. return this.#eventInit.colno
  29951. }
  29952. get error () {
  29953. webidl.brandCheck(this, ErrorEvent)
  29954. return this.#eventInit.error
  29955. }
  29956. }
  29957. Object.defineProperties(MessageEvent.prototype, {
  29958. [Symbol.toStringTag]: {
  29959. value: 'MessageEvent',
  29960. configurable: true
  29961. },
  29962. data: kEnumerableProperty,
  29963. origin: kEnumerableProperty,
  29964. lastEventId: kEnumerableProperty,
  29965. source: kEnumerableProperty,
  29966. ports: kEnumerableProperty,
  29967. initMessageEvent: kEnumerableProperty
  29968. })
  29969. Object.defineProperties(CloseEvent.prototype, {
  29970. [Symbol.toStringTag]: {
  29971. value: 'CloseEvent',
  29972. configurable: true
  29973. },
  29974. reason: kEnumerableProperty,
  29975. code: kEnumerableProperty,
  29976. wasClean: kEnumerableProperty
  29977. })
  29978. Object.defineProperties(ErrorEvent.prototype, {
  29979. [Symbol.toStringTag]: {
  29980. value: 'ErrorEvent',
  29981. configurable: true
  29982. },
  29983. message: kEnumerableProperty,
  29984. filename: kEnumerableProperty,
  29985. lineno: kEnumerableProperty,
  29986. colno: kEnumerableProperty,
  29987. error: kEnumerableProperty
  29988. })
  29989. webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)
  29990. webidl.converters['sequence<MessagePort>'] = webidl.sequenceConverter(
  29991. webidl.converters.MessagePort
  29992. )
  29993. const eventInit = [
  29994. {
  29995. key: 'bubbles',
  29996. converter: webidl.converters.boolean,
  29997. defaultValue: false
  29998. },
  29999. {
  30000. key: 'cancelable',
  30001. converter: webidl.converters.boolean,
  30002. defaultValue: false
  30003. },
  30004. {
  30005. key: 'composed',
  30006. converter: webidl.converters.boolean,
  30007. defaultValue: false
  30008. }
  30009. ]
  30010. webidl.converters.MessageEventInit = webidl.dictionaryConverter([
  30011. ...eventInit,
  30012. {
  30013. key: 'data',
  30014. converter: webidl.converters.any,
  30015. defaultValue: null
  30016. },
  30017. {
  30018. key: 'origin',
  30019. converter: webidl.converters.USVString,
  30020. defaultValue: ''
  30021. },
  30022. {
  30023. key: 'lastEventId',
  30024. converter: webidl.converters.DOMString,
  30025. defaultValue: ''
  30026. },
  30027. {
  30028. key: 'source',
  30029. // Node doesn't implement WindowProxy or ServiceWorker, so the only
  30030. // valid value for source is a MessagePort.
  30031. converter: webidl.nullableConverter(webidl.converters.MessagePort),
  30032. defaultValue: null
  30033. },
  30034. {
  30035. key: 'ports',
  30036. converter: webidl.converters['sequence<MessagePort>'],
  30037. get defaultValue () {
  30038. return []
  30039. }
  30040. }
  30041. ])
  30042. webidl.converters.CloseEventInit = webidl.dictionaryConverter([
  30043. ...eventInit,
  30044. {
  30045. key: 'wasClean',
  30046. converter: webidl.converters.boolean,
  30047. defaultValue: false
  30048. },
  30049. {
  30050. key: 'code',
  30051. converter: webidl.converters['unsigned short'],
  30052. defaultValue: 0
  30053. },
  30054. {
  30055. key: 'reason',
  30056. converter: webidl.converters.USVString,
  30057. defaultValue: ''
  30058. }
  30059. ])
  30060. webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
  30061. ...eventInit,
  30062. {
  30063. key: 'message',
  30064. converter: webidl.converters.DOMString,
  30065. defaultValue: ''
  30066. },
  30067. {
  30068. key: 'filename',
  30069. converter: webidl.converters.USVString,
  30070. defaultValue: ''
  30071. },
  30072. {
  30073. key: 'lineno',
  30074. converter: webidl.converters['unsigned long'],
  30075. defaultValue: 0
  30076. },
  30077. {
  30078. key: 'colno',
  30079. converter: webidl.converters['unsigned long'],
  30080. defaultValue: 0
  30081. },
  30082. {
  30083. key: 'error',
  30084. converter: webidl.converters.any
  30085. }
  30086. ])
  30087. module.exports = {
  30088. MessageEvent,
  30089. CloseEvent,
  30090. ErrorEvent
  30091. }
  30092. /***/ }),
  30093. /***/ 5444:
  30094. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30095. "use strict";
  30096. const { maxUnsigned16Bit } = __nccwpck_require__(9188)
  30097. /** @type {import('crypto')} */
  30098. let crypto
  30099. try {
  30100. crypto = __nccwpck_require__(6113)
  30101. } catch {
  30102. }
  30103. class WebsocketFrameSend {
  30104. /**
  30105. * @param {Buffer|undefined} data
  30106. */
  30107. constructor (data) {
  30108. this.frameData = data
  30109. this.maskKey = crypto.randomBytes(4)
  30110. }
  30111. createFrame (opcode) {
  30112. const bodyLength = this.frameData?.byteLength ?? 0
  30113. /** @type {number} */
  30114. let payloadLength = bodyLength // 0-125
  30115. let offset = 6
  30116. if (bodyLength > maxUnsigned16Bit) {
  30117. offset += 8 // payload length is next 8 bytes
  30118. payloadLength = 127
  30119. } else if (bodyLength > 125) {
  30120. offset += 2 // payload length is next 2 bytes
  30121. payloadLength = 126
  30122. }
  30123. const buffer = Buffer.allocUnsafe(bodyLength + offset)
  30124. // Clear first 2 bytes, everything else is overwritten
  30125. buffer[0] = buffer[1] = 0
  30126. buffer[0] |= 0x80 // FIN
  30127. buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
  30128. /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
  30129. buffer[offset - 4] = this.maskKey[0]
  30130. buffer[offset - 3] = this.maskKey[1]
  30131. buffer[offset - 2] = this.maskKey[2]
  30132. buffer[offset - 1] = this.maskKey[3]
  30133. buffer[1] = payloadLength
  30134. if (payloadLength === 126) {
  30135. buffer.writeUInt16BE(bodyLength, 2)
  30136. } else if (payloadLength === 127) {
  30137. // Clear extended payload length
  30138. buffer[2] = buffer[3] = 0
  30139. buffer.writeUIntBE(bodyLength, 4, 6)
  30140. }
  30141. buffer[1] |= 0x80 // MASK
  30142. // mask body
  30143. for (let i = 0; i < bodyLength; i++) {
  30144. buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]
  30145. }
  30146. return buffer
  30147. }
  30148. }
  30149. module.exports = {
  30150. WebsocketFrameSend
  30151. }
  30152. /***/ }),
  30153. /***/ 1688:
  30154. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30155. "use strict";
  30156. const { Writable } = __nccwpck_require__(2781)
  30157. const diagnosticsChannel = __nccwpck_require__(7643)
  30158. const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(9188)
  30159. const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(7578)
  30160. const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(5515)
  30161. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30162. // This code was influenced by ws released under the MIT license.
  30163. // Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
  30164. // Copyright (c) 2013 Arnout Kazemier and contributors
  30165. // Copyright (c) 2016 Luigi Pinca and contributors
  30166. const channels = {}
  30167. channels.ping = diagnosticsChannel.channel('undici:websocket:ping')
  30168. channels.pong = diagnosticsChannel.channel('undici:websocket:pong')
  30169. class ByteParser extends Writable {
  30170. #buffers = []
  30171. #byteOffset = 0
  30172. #state = parserStates.INFO
  30173. #info = {}
  30174. #fragments = []
  30175. constructor (ws) {
  30176. super()
  30177. this.ws = ws
  30178. }
  30179. /**
  30180. * @param {Buffer} chunk
  30181. * @param {() => void} callback
  30182. */
  30183. _write (chunk, _, callback) {
  30184. this.#buffers.push(chunk)
  30185. this.#byteOffset += chunk.length
  30186. this.run(callback)
  30187. }
  30188. /**
  30189. * Runs whenever a new chunk is received.
  30190. * Callback is called whenever there are no more chunks buffering,
  30191. * or not enough bytes are buffered to parse.
  30192. */
  30193. run (callback) {
  30194. while (true) {
  30195. if (this.#state === parserStates.INFO) {
  30196. // If there aren't enough bytes to parse the payload length, etc.
  30197. if (this.#byteOffset < 2) {
  30198. return callback()
  30199. }
  30200. const buffer = this.consume(2)
  30201. this.#info.fin = (buffer[0] & 0x80) !== 0
  30202. this.#info.opcode = buffer[0] & 0x0F
  30203. // If we receive a fragmented message, we use the type of the first
  30204. // frame to parse the full message as binary/text, when it's terminated
  30205. this.#info.originalOpcode ??= this.#info.opcode
  30206. this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION
  30207. if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {
  30208. // Only text and binary frames can be fragmented
  30209. failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')
  30210. return
  30211. }
  30212. const payloadLength = buffer[1] & 0x7F
  30213. if (payloadLength <= 125) {
  30214. this.#info.payloadLength = payloadLength
  30215. this.#state = parserStates.READ_DATA
  30216. } else if (payloadLength === 126) {
  30217. this.#state = parserStates.PAYLOADLENGTH_16
  30218. } else if (payloadLength === 127) {
  30219. this.#state = parserStates.PAYLOADLENGTH_64
  30220. }
  30221. if (this.#info.fragmented && payloadLength > 125) {
  30222. // A fragmented frame can't be fragmented itself
  30223. failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')
  30224. return
  30225. } else if (
  30226. (this.#info.opcode === opcodes.PING ||
  30227. this.#info.opcode === opcodes.PONG ||
  30228. this.#info.opcode === opcodes.CLOSE) &&
  30229. payloadLength > 125
  30230. ) {
  30231. // Control frames can have a payload length of 125 bytes MAX
  30232. failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')
  30233. return
  30234. } else if (this.#info.opcode === opcodes.CLOSE) {
  30235. if (payloadLength === 1) {
  30236. failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')
  30237. return
  30238. }
  30239. const body = this.consume(payloadLength)
  30240. this.#info.closeInfo = this.parseCloseBody(false, body)
  30241. if (!this.ws[kSentClose]) {
  30242. // If an endpoint receives a Close frame and did not previously send a
  30243. // Close frame, the endpoint MUST send a Close frame in response. (When
  30244. // sending a Close frame in response, the endpoint typically echos the
  30245. // status code it received.)
  30246. const body = Buffer.allocUnsafe(2)
  30247. body.writeUInt16BE(this.#info.closeInfo.code, 0)
  30248. const closeFrame = new WebsocketFrameSend(body)
  30249. this.ws[kResponse].socket.write(
  30250. closeFrame.createFrame(opcodes.CLOSE),
  30251. (err) => {
  30252. if (!err) {
  30253. this.ws[kSentClose] = true
  30254. }
  30255. }
  30256. )
  30257. }
  30258. // Upon either sending or receiving a Close control frame, it is said
  30259. // that _The WebSocket Closing Handshake is Started_ and that the
  30260. // WebSocket connection is in the CLOSING state.
  30261. this.ws[kReadyState] = states.CLOSING
  30262. this.ws[kReceivedClose] = true
  30263. this.end()
  30264. return
  30265. } else if (this.#info.opcode === opcodes.PING) {
  30266. // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
  30267. // response, unless it already received a Close frame.
  30268. // A Pong frame sent in response to a Ping frame must have identical
  30269. // "Application data"
  30270. const body = this.consume(payloadLength)
  30271. if (!this.ws[kReceivedClose]) {
  30272. const frame = new WebsocketFrameSend(body)
  30273. this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))
  30274. if (channels.ping.hasSubscribers) {
  30275. channels.ping.publish({
  30276. payload: body
  30277. })
  30278. }
  30279. }
  30280. this.#state = parserStates.INFO
  30281. if (this.#byteOffset > 0) {
  30282. continue
  30283. } else {
  30284. callback()
  30285. return
  30286. }
  30287. } else if (this.#info.opcode === opcodes.PONG) {
  30288. // A Pong frame MAY be sent unsolicited. This serves as a
  30289. // unidirectional heartbeat. A response to an unsolicited Pong frame is
  30290. // not expected.
  30291. const body = this.consume(payloadLength)
  30292. if (channels.pong.hasSubscribers) {
  30293. channels.pong.publish({
  30294. payload: body
  30295. })
  30296. }
  30297. if (this.#byteOffset > 0) {
  30298. continue
  30299. } else {
  30300. callback()
  30301. return
  30302. }
  30303. }
  30304. } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
  30305. if (this.#byteOffset < 2) {
  30306. return callback()
  30307. }
  30308. const buffer = this.consume(2)
  30309. this.#info.payloadLength = buffer.readUInt16BE(0)
  30310. this.#state = parserStates.READ_DATA
  30311. } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
  30312. if (this.#byteOffset < 8) {
  30313. return callback()
  30314. }
  30315. const buffer = this.consume(8)
  30316. const upper = buffer.readUInt32BE(0)
  30317. // 2^31 is the maxinimum bytes an arraybuffer can contain
  30318. // on 32-bit systems. Although, on 64-bit systems, this is
  30319. // 2^53-1 bytes.
  30320. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
  30321. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
  30322. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
  30323. if (upper > 2 ** 31 - 1) {
  30324. failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')
  30325. return
  30326. }
  30327. const lower = buffer.readUInt32BE(4)
  30328. this.#info.payloadLength = (upper << 8) + lower
  30329. this.#state = parserStates.READ_DATA
  30330. } else if (this.#state === parserStates.READ_DATA) {
  30331. if (this.#byteOffset < this.#info.payloadLength) {
  30332. // If there is still more data in this chunk that needs to be read
  30333. return callback()
  30334. } else if (this.#byteOffset >= this.#info.payloadLength) {
  30335. // If the server sent multiple frames in a single chunk
  30336. const body = this.consume(this.#info.payloadLength)
  30337. this.#fragments.push(body)
  30338. // If the frame is unfragmented, or a fragmented frame was terminated,
  30339. // a message was received
  30340. if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {
  30341. const fullMessage = Buffer.concat(this.#fragments)
  30342. websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)
  30343. this.#info = {}
  30344. this.#fragments.length = 0
  30345. }
  30346. this.#state = parserStates.INFO
  30347. }
  30348. }
  30349. if (this.#byteOffset > 0) {
  30350. continue
  30351. } else {
  30352. callback()
  30353. break
  30354. }
  30355. }
  30356. }
  30357. /**
  30358. * Take n bytes from the buffered Buffers
  30359. * @param {number} n
  30360. * @returns {Buffer|null}
  30361. */
  30362. consume (n) {
  30363. if (n > this.#byteOffset) {
  30364. return null
  30365. } else if (n === 0) {
  30366. return emptyBuffer
  30367. }
  30368. if (this.#buffers[0].length === n) {
  30369. this.#byteOffset -= this.#buffers[0].length
  30370. return this.#buffers.shift()
  30371. }
  30372. const buffer = Buffer.allocUnsafe(n)
  30373. let offset = 0
  30374. while (offset !== n) {
  30375. const next = this.#buffers[0]
  30376. const { length } = next
  30377. if (length + offset === n) {
  30378. buffer.set(this.#buffers.shift(), offset)
  30379. break
  30380. } else if (length + offset > n) {
  30381. buffer.set(next.subarray(0, n - offset), offset)
  30382. this.#buffers[0] = next.subarray(n - offset)
  30383. break
  30384. } else {
  30385. buffer.set(this.#buffers.shift(), offset)
  30386. offset += next.length
  30387. }
  30388. }
  30389. this.#byteOffset -= n
  30390. return buffer
  30391. }
  30392. parseCloseBody (onlyCode, data) {
  30393. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
  30394. /** @type {number|undefined} */
  30395. let code
  30396. if (data.length >= 2) {
  30397. // _The WebSocket Connection Close Code_ is
  30398. // defined as the status code (Section 7.4) contained in the first Close
  30399. // control frame received by the application
  30400. code = data.readUInt16BE(0)
  30401. }
  30402. if (onlyCode) {
  30403. if (!isValidStatusCode(code)) {
  30404. return null
  30405. }
  30406. return { code }
  30407. }
  30408. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
  30409. /** @type {Buffer} */
  30410. let reason = data.subarray(2)
  30411. // Remove BOM
  30412. if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
  30413. reason = reason.subarray(3)
  30414. }
  30415. if (code !== undefined && !isValidStatusCode(code)) {
  30416. return null
  30417. }
  30418. try {
  30419. // TODO: optimize this
  30420. reason = new TextDecoder('utf-8', { fatal: true }).decode(reason)
  30421. } catch {
  30422. return null
  30423. }
  30424. return { code, reason }
  30425. }
  30426. get closingInfo () {
  30427. return this.#info.closeInfo
  30428. }
  30429. }
  30430. module.exports = {
  30431. ByteParser
  30432. }
  30433. /***/ }),
  30434. /***/ 7578:
  30435. /***/ ((module) => {
  30436. "use strict";
  30437. module.exports = {
  30438. kWebSocketURL: Symbol('url'),
  30439. kReadyState: Symbol('ready state'),
  30440. kController: Symbol('controller'),
  30441. kResponse: Symbol('response'),
  30442. kBinaryType: Symbol('binary type'),
  30443. kSentClose: Symbol('sent close'),
  30444. kReceivedClose: Symbol('received close'),
  30445. kByteParser: Symbol('byte parser')
  30446. }
  30447. /***/ }),
  30448. /***/ 5515:
  30449. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30450. "use strict";
  30451. const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7578)
  30452. const { states, opcodes } = __nccwpck_require__(9188)
  30453. const { MessageEvent, ErrorEvent } = __nccwpck_require__(2611)
  30454. /* globals Blob */
  30455. /**
  30456. * @param {import('./websocket').WebSocket} ws
  30457. */
  30458. function isEstablished (ws) {
  30459. // If the server's response is validated as provided for above, it is
  30460. // said that _The WebSocket Connection is Established_ and that the
  30461. // WebSocket Connection is in the OPEN state.
  30462. return ws[kReadyState] === states.OPEN
  30463. }
  30464. /**
  30465. * @param {import('./websocket').WebSocket} ws
  30466. */
  30467. function isClosing (ws) {
  30468. // Upon either sending or receiving a Close control frame, it is said
  30469. // that _The WebSocket Closing Handshake is Started_ and that the
  30470. // WebSocket connection is in the CLOSING state.
  30471. return ws[kReadyState] === states.CLOSING
  30472. }
  30473. /**
  30474. * @param {import('./websocket').WebSocket} ws
  30475. */
  30476. function isClosed (ws) {
  30477. return ws[kReadyState] === states.CLOSED
  30478. }
  30479. /**
  30480. * @see https://dom.spec.whatwg.org/#concept-event-fire
  30481. * @param {string} e
  30482. * @param {EventTarget} target
  30483. * @param {EventInit | undefined} eventInitDict
  30484. */
  30485. function fireEvent (e, target, eventConstructor = Event, eventInitDict) {
  30486. // 1. If eventConstructor is not given, then let eventConstructor be Event.
  30487. // 2. Let event be the result of creating an event given eventConstructor,
  30488. // in the relevant realm of target.
  30489. // 3. Initialize event’s type attribute to e.
  30490. const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap
  30491. // 4. Initialize any other IDL attributes of event as described in the
  30492. // invocation of this algorithm.
  30493. // 5. Return the result of dispatching event at target, with legacy target
  30494. // override flag set if set.
  30495. target.dispatchEvent(event)
  30496. }
  30497. /**
  30498. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30499. * @param {import('./websocket').WebSocket} ws
  30500. * @param {number} type Opcode
  30501. * @param {Buffer} data application data
  30502. */
  30503. function websocketMessageReceived (ws, type, data) {
  30504. // 1. If ready state is not OPEN (1), then return.
  30505. if (ws[kReadyState] !== states.OPEN) {
  30506. return
  30507. }
  30508. // 2. Let dataForEvent be determined by switching on type and binary type:
  30509. let dataForEvent
  30510. if (type === opcodes.TEXT) {
  30511. // -> type indicates that the data is Text
  30512. // a new DOMString containing data
  30513. try {
  30514. dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data)
  30515. } catch {
  30516. failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')
  30517. return
  30518. }
  30519. } else if (type === opcodes.BINARY) {
  30520. if (ws[kBinaryType] === 'blob') {
  30521. // -> type indicates that the data is Binary and binary type is "blob"
  30522. // a new Blob object, created in the relevant Realm of the WebSocket
  30523. // object, that represents data as its raw data
  30524. dataForEvent = new Blob([data])
  30525. } else {
  30526. // -> type indicates that the data is Binary and binary type is "arraybuffer"
  30527. // a new ArrayBuffer object, created in the relevant Realm of the
  30528. // WebSocket object, whose contents are data
  30529. dataForEvent = new Uint8Array(data).buffer
  30530. }
  30531. }
  30532. // 3. Fire an event named message at the WebSocket object, using MessageEvent,
  30533. // with the origin attribute initialized to the serialization of the WebSocket
  30534. // object’s url's origin, and the data attribute initialized to dataForEvent.
  30535. fireEvent('message', ws, MessageEvent, {
  30536. origin: ws[kWebSocketURL].origin,
  30537. data: dataForEvent
  30538. })
  30539. }
  30540. /**
  30541. * @see https://datatracker.ietf.org/doc/html/rfc6455
  30542. * @see https://datatracker.ietf.org/doc/html/rfc2616
  30543. * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407
  30544. * @param {string} protocol
  30545. */
  30546. function isValidSubprotocol (protocol) {
  30547. // If present, this value indicates one
  30548. // or more comma-separated subprotocol the client wishes to speak,
  30549. // ordered by preference. The elements that comprise this value
  30550. // MUST be non-empty strings with characters in the range U+0021 to
  30551. // U+007E not including separator characters as defined in
  30552. // [RFC2616] and MUST all be unique strings.
  30553. if (protocol.length === 0) {
  30554. return false
  30555. }
  30556. for (const char of protocol) {
  30557. const code = char.charCodeAt(0)
  30558. if (
  30559. code < 0x21 ||
  30560. code > 0x7E ||
  30561. char === '(' ||
  30562. char === ')' ||
  30563. char === '<' ||
  30564. char === '>' ||
  30565. char === '@' ||
  30566. char === ',' ||
  30567. char === ';' ||
  30568. char === ':' ||
  30569. char === '\\' ||
  30570. char === '"' ||
  30571. char === '/' ||
  30572. char === '[' ||
  30573. char === ']' ||
  30574. char === '?' ||
  30575. char === '=' ||
  30576. char === '{' ||
  30577. char === '}' ||
  30578. code === 32 || // SP
  30579. code === 9 // HT
  30580. ) {
  30581. return false
  30582. }
  30583. }
  30584. return true
  30585. }
  30586. /**
  30587. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4
  30588. * @param {number} code
  30589. */
  30590. function isValidStatusCode (code) {
  30591. if (code >= 1000 && code < 1015) {
  30592. return (
  30593. code !== 1004 && // reserved
  30594. code !== 1005 && // "MUST NOT be set as a status code"
  30595. code !== 1006 // "MUST NOT be set as a status code"
  30596. )
  30597. }
  30598. return code >= 3000 && code <= 4999
  30599. }
  30600. /**
  30601. * @param {import('./websocket').WebSocket} ws
  30602. * @param {string|undefined} reason
  30603. */
  30604. function failWebsocketConnection (ws, reason) {
  30605. const { [kController]: controller, [kResponse]: response } = ws
  30606. controller.abort()
  30607. if (response?.socket && !response.socket.destroyed) {
  30608. response.socket.destroy()
  30609. }
  30610. if (reason) {
  30611. fireEvent('error', ws, ErrorEvent, {
  30612. error: new Error(reason)
  30613. })
  30614. }
  30615. }
  30616. module.exports = {
  30617. isEstablished,
  30618. isClosing,
  30619. isClosed,
  30620. fireEvent,
  30621. isValidSubprotocol,
  30622. isValidStatusCode,
  30623. failWebsocketConnection,
  30624. websocketMessageReceived
  30625. }
  30626. /***/ }),
  30627. /***/ 4284:
  30628. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30629. "use strict";
  30630. const { webidl } = __nccwpck_require__(1744)
  30631. const { DOMException } = __nccwpck_require__(1037)
  30632. const { URLSerializer } = __nccwpck_require__(685)
  30633. const { getGlobalOrigin } = __nccwpck_require__(1246)
  30634. const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(9188)
  30635. const {
  30636. kWebSocketURL,
  30637. kReadyState,
  30638. kController,
  30639. kBinaryType,
  30640. kResponse,
  30641. kSentClose,
  30642. kByteParser
  30643. } = __nccwpck_require__(7578)
  30644. const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(5515)
  30645. const { establishWebSocketConnection } = __nccwpck_require__(5354)
  30646. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30647. const { ByteParser } = __nccwpck_require__(1688)
  30648. const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3983)
  30649. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  30650. const { types } = __nccwpck_require__(3837)
  30651. let experimentalWarned = false
  30652. // https://websockets.spec.whatwg.org/#interface-definition
  30653. class WebSocket extends EventTarget {
  30654. #events = {
  30655. open: null,
  30656. error: null,
  30657. close: null,
  30658. message: null
  30659. }
  30660. #bufferedAmount = 0
  30661. #protocol = ''
  30662. #extensions = ''
  30663. /**
  30664. * @param {string} url
  30665. * @param {string|string[]} protocols
  30666. */
  30667. constructor (url, protocols = []) {
  30668. super()
  30669. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' })
  30670. if (!experimentalWarned) {
  30671. experimentalWarned = true
  30672. process.emitWarning('WebSockets are experimental, expect them to change at any time.', {
  30673. code: 'UNDICI-WS'
  30674. })
  30675. }
  30676. const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols)
  30677. url = webidl.converters.USVString(url)
  30678. protocols = options.protocols
  30679. // 1. Let baseURL be this's relevant settings object's API base URL.
  30680. const baseURL = getGlobalOrigin()
  30681. // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.
  30682. let urlRecord
  30683. try {
  30684. urlRecord = new URL(url, baseURL)
  30685. } catch (e) {
  30686. // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException.
  30687. throw new DOMException(e, 'SyntaxError')
  30688. }
  30689. // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
  30690. if (urlRecord.protocol === 'http:') {
  30691. urlRecord.protocol = 'ws:'
  30692. } else if (urlRecord.protocol === 'https:') {
  30693. // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
  30694. urlRecord.protocol = 'wss:'
  30695. }
  30696. // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
  30697. if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {
  30698. throw new DOMException(
  30699. `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,
  30700. 'SyntaxError'
  30701. )
  30702. }
  30703. // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError"
  30704. // DOMException.
  30705. if (urlRecord.hash || urlRecord.href.endsWith('#')) {
  30706. throw new DOMException('Got fragment', 'SyntaxError')
  30707. }
  30708. // 8. If protocols is a string, set protocols to a sequence consisting
  30709. // of just that string.
  30710. if (typeof protocols === 'string') {
  30711. protocols = [protocols]
  30712. }
  30713. // 9. If any of the values in protocols occur more than once or otherwise
  30714. // fail to match the requirements for elements that comprise the value
  30715. // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
  30716. // protocol, then throw a "SyntaxError" DOMException.
  30717. if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
  30718. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30719. }
  30720. if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
  30721. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30722. }
  30723. // 10. Set this's url to urlRecord.
  30724. this[kWebSocketURL] = new URL(urlRecord.href)
  30725. // 11. Let client be this's relevant settings object.
  30726. // 12. Run this step in parallel:
  30727. // 1. Establish a WebSocket connection given urlRecord, protocols,
  30728. // and client.
  30729. this[kController] = establishWebSocketConnection(
  30730. urlRecord,
  30731. protocols,
  30732. this,
  30733. (response) => this.#onConnectionEstablished(response),
  30734. options
  30735. )
  30736. // Each WebSocket object has an associated ready state, which is a
  30737. // number representing the state of the connection. Initially it must
  30738. // be CONNECTING (0).
  30739. this[kReadyState] = WebSocket.CONNECTING
  30740. // The extensions attribute must initially return the empty string.
  30741. // The protocol attribute must initially return the empty string.
  30742. // Each WebSocket object has an associated binary type, which is a
  30743. // BinaryType. Initially it must be "blob".
  30744. this[kBinaryType] = 'blob'
  30745. }
  30746. /**
  30747. * @see https://websockets.spec.whatwg.org/#dom-websocket-close
  30748. * @param {number|undefined} code
  30749. * @param {string|undefined} reason
  30750. */
  30751. close (code = undefined, reason = undefined) {
  30752. webidl.brandCheck(this, WebSocket)
  30753. if (code !== undefined) {
  30754. code = webidl.converters['unsigned short'](code, { clamp: true })
  30755. }
  30756. if (reason !== undefined) {
  30757. reason = webidl.converters.USVString(reason)
  30758. }
  30759. // 1. If code is present, but is neither an integer equal to 1000 nor an
  30760. // integer in the range 3000 to 4999, inclusive, throw an
  30761. // "InvalidAccessError" DOMException.
  30762. if (code !== undefined) {
  30763. if (code !== 1000 && (code < 3000 || code > 4999)) {
  30764. throw new DOMException('invalid code', 'InvalidAccessError')
  30765. }
  30766. }
  30767. let reasonByteLength = 0
  30768. // 2. If reason is present, then run these substeps:
  30769. if (reason !== undefined) {
  30770. // 1. Let reasonBytes be the result of encoding reason.
  30771. // 2. If reasonBytes is longer than 123 bytes, then throw a
  30772. // "SyntaxError" DOMException.
  30773. reasonByteLength = Buffer.byteLength(reason)
  30774. if (reasonByteLength > 123) {
  30775. throw new DOMException(
  30776. `Reason must be less than 123 bytes; received ${reasonByteLength}`,
  30777. 'SyntaxError'
  30778. )
  30779. }
  30780. }
  30781. // 3. Run the first matching steps from the following list:
  30782. if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) {
  30783. // If this's ready state is CLOSING (2) or CLOSED (3)
  30784. // Do nothing.
  30785. } else if (!isEstablished(this)) {
  30786. // If the WebSocket connection is not yet established
  30787. // Fail the WebSocket connection and set this's ready state
  30788. // to CLOSING (2).
  30789. failWebsocketConnection(this, 'Connection was closed before it was established.')
  30790. this[kReadyState] = WebSocket.CLOSING
  30791. } else if (!isClosing(this)) {
  30792. // If the WebSocket closing handshake has not yet been started
  30793. // Start the WebSocket closing handshake and set this's ready
  30794. // state to CLOSING (2).
  30795. // - If neither code nor reason is present, the WebSocket Close
  30796. // message must not have a body.
  30797. // - If code is present, then the status code to use in the
  30798. // WebSocket Close message must be the integer given by code.
  30799. // - If reason is also present, then reasonBytes must be
  30800. // provided in the Close message after the status code.
  30801. const frame = new WebsocketFrameSend()
  30802. // If neither code nor reason is present, the WebSocket Close
  30803. // message must not have a body.
  30804. // If code is present, then the status code to use in the
  30805. // WebSocket Close message must be the integer given by code.
  30806. if (code !== undefined && reason === undefined) {
  30807. frame.frameData = Buffer.allocUnsafe(2)
  30808. frame.frameData.writeUInt16BE(code, 0)
  30809. } else if (code !== undefined && reason !== undefined) {
  30810. // If reason is also present, then reasonBytes must be
  30811. // provided in the Close message after the status code.
  30812. frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)
  30813. frame.frameData.writeUInt16BE(code, 0)
  30814. // the body MAY contain UTF-8-encoded data with value /reason/
  30815. frame.frameData.write(reason, 2, 'utf-8')
  30816. } else {
  30817. frame.frameData = emptyBuffer
  30818. }
  30819. /** @type {import('stream').Duplex} */
  30820. const socket = this[kResponse].socket
  30821. socket.write(frame.createFrame(opcodes.CLOSE), (err) => {
  30822. if (!err) {
  30823. this[kSentClose] = true
  30824. }
  30825. })
  30826. // Upon either sending or receiving a Close control frame, it is said
  30827. // that _The WebSocket Closing Handshake is Started_ and that the
  30828. // WebSocket connection is in the CLOSING state.
  30829. this[kReadyState] = states.CLOSING
  30830. } else {
  30831. // Otherwise
  30832. // Set this's ready state to CLOSING (2).
  30833. this[kReadyState] = WebSocket.CLOSING
  30834. }
  30835. }
  30836. /**
  30837. * @see https://websockets.spec.whatwg.org/#dom-websocket-send
  30838. * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
  30839. */
  30840. send (data) {
  30841. webidl.brandCheck(this, WebSocket)
  30842. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' })
  30843. data = webidl.converters.WebSocketSendData(data)
  30844. // 1. If this's ready state is CONNECTING, then throw an
  30845. // "InvalidStateError" DOMException.
  30846. if (this[kReadyState] === WebSocket.CONNECTING) {
  30847. throw new DOMException('Sent before connected.', 'InvalidStateError')
  30848. }
  30849. // 2. Run the appropriate set of steps from the following list:
  30850. // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
  30851. // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
  30852. if (!isEstablished(this) || isClosing(this)) {
  30853. return
  30854. }
  30855. /** @type {import('stream').Duplex} */
  30856. const socket = this[kResponse].socket
  30857. // If data is a string
  30858. if (typeof data === 'string') {
  30859. // If the WebSocket connection is established and the WebSocket
  30860. // closing handshake has not yet started, then the user agent
  30861. // must send a WebSocket Message comprised of the data argument
  30862. // using a text frame opcode; if the data cannot be sent, e.g.
  30863. // because it would need to be buffered but the buffer is full,
  30864. // the user agent must flag the WebSocket as full and then close
  30865. // the WebSocket connection. Any invocation of this method with a
  30866. // string argument that does not throw an exception must increase
  30867. // the bufferedAmount attribute by the number of bytes needed to
  30868. // express the argument as UTF-8.
  30869. const value = Buffer.from(data)
  30870. const frame = new WebsocketFrameSend(value)
  30871. const buffer = frame.createFrame(opcodes.TEXT)
  30872. this.#bufferedAmount += value.byteLength
  30873. socket.write(buffer, () => {
  30874. this.#bufferedAmount -= value.byteLength
  30875. })
  30876. } else if (types.isArrayBuffer(data)) {
  30877. // If the WebSocket connection is established, and the WebSocket
  30878. // closing handshake has not yet started, then the user agent must
  30879. // send a WebSocket Message comprised of data using a binary frame
  30880. // opcode; if the data cannot be sent, e.g. because it would need
  30881. // to be buffered but the buffer is full, the user agent must flag
  30882. // the WebSocket as full and then close the WebSocket connection.
  30883. // The data to be sent is the data stored in the buffer described
  30884. // by the ArrayBuffer object. Any invocation of this method with an
  30885. // ArrayBuffer argument that does not throw an exception must
  30886. // increase the bufferedAmount attribute by the length of the
  30887. // ArrayBuffer in bytes.
  30888. const value = Buffer.from(data)
  30889. const frame = new WebsocketFrameSend(value)
  30890. const buffer = frame.createFrame(opcodes.BINARY)
  30891. this.#bufferedAmount += value.byteLength
  30892. socket.write(buffer, () => {
  30893. this.#bufferedAmount -= value.byteLength
  30894. })
  30895. } else if (ArrayBuffer.isView(data)) {
  30896. // If the WebSocket connection is established, and the WebSocket
  30897. // closing handshake has not yet started, then the user agent must
  30898. // send a WebSocket Message comprised of data using a binary frame
  30899. // opcode; if the data cannot be sent, e.g. because it would need to
  30900. // be buffered but the buffer is full, the user agent must flag the
  30901. // WebSocket as full and then close the WebSocket connection. The
  30902. // data to be sent is the data stored in the section of the buffer
  30903. // described by the ArrayBuffer object that data references. Any
  30904. // invocation of this method with this kind of argument that does
  30905. // not throw an exception must increase the bufferedAmount attribute
  30906. // by the length of data’s buffer in bytes.
  30907. const ab = Buffer.from(data, data.byteOffset, data.byteLength)
  30908. const frame = new WebsocketFrameSend(ab)
  30909. const buffer = frame.createFrame(opcodes.BINARY)
  30910. this.#bufferedAmount += ab.byteLength
  30911. socket.write(buffer, () => {
  30912. this.#bufferedAmount -= ab.byteLength
  30913. })
  30914. } else if (isBlobLike(data)) {
  30915. // If the WebSocket connection is established, and the WebSocket
  30916. // closing handshake has not yet started, then the user agent must
  30917. // send a WebSocket Message comprised of data using a binary frame
  30918. // opcode; if the data cannot be sent, e.g. because it would need to
  30919. // be buffered but the buffer is full, the user agent must flag the
  30920. // WebSocket as full and then close the WebSocket connection. The data
  30921. // to be sent is the raw data represented by the Blob object. Any
  30922. // invocation of this method with a Blob argument that does not throw
  30923. // an exception must increase the bufferedAmount attribute by the size
  30924. // of the Blob object’s raw data, in bytes.
  30925. const frame = new WebsocketFrameSend()
  30926. data.arrayBuffer().then((ab) => {
  30927. const value = Buffer.from(ab)
  30928. frame.frameData = value
  30929. const buffer = frame.createFrame(opcodes.BINARY)
  30930. this.#bufferedAmount += value.byteLength
  30931. socket.write(buffer, () => {
  30932. this.#bufferedAmount -= value.byteLength
  30933. })
  30934. })
  30935. }
  30936. }
  30937. get readyState () {
  30938. webidl.brandCheck(this, WebSocket)
  30939. // The readyState getter steps are to return this's ready state.
  30940. return this[kReadyState]
  30941. }
  30942. get bufferedAmount () {
  30943. webidl.brandCheck(this, WebSocket)
  30944. return this.#bufferedAmount
  30945. }
  30946. get url () {
  30947. webidl.brandCheck(this, WebSocket)
  30948. // The url getter steps are to return this's url, serialized.
  30949. return URLSerializer(this[kWebSocketURL])
  30950. }
  30951. get extensions () {
  30952. webidl.brandCheck(this, WebSocket)
  30953. return this.#extensions
  30954. }
  30955. get protocol () {
  30956. webidl.brandCheck(this, WebSocket)
  30957. return this.#protocol
  30958. }
  30959. get onopen () {
  30960. webidl.brandCheck(this, WebSocket)
  30961. return this.#events.open
  30962. }
  30963. set onopen (fn) {
  30964. webidl.brandCheck(this, WebSocket)
  30965. if (this.#events.open) {
  30966. this.removeEventListener('open', this.#events.open)
  30967. }
  30968. if (typeof fn === 'function') {
  30969. this.#events.open = fn
  30970. this.addEventListener('open', fn)
  30971. } else {
  30972. this.#events.open = null
  30973. }
  30974. }
  30975. get onerror () {
  30976. webidl.brandCheck(this, WebSocket)
  30977. return this.#events.error
  30978. }
  30979. set onerror (fn) {
  30980. webidl.brandCheck(this, WebSocket)
  30981. if (this.#events.error) {
  30982. this.removeEventListener('error', this.#events.error)
  30983. }
  30984. if (typeof fn === 'function') {
  30985. this.#events.error = fn
  30986. this.addEventListener('error', fn)
  30987. } else {
  30988. this.#events.error = null
  30989. }
  30990. }
  30991. get onclose () {
  30992. webidl.brandCheck(this, WebSocket)
  30993. return this.#events.close
  30994. }
  30995. set onclose (fn) {
  30996. webidl.brandCheck(this, WebSocket)
  30997. if (this.#events.close) {
  30998. this.removeEventListener('close', this.#events.close)
  30999. }
  31000. if (typeof fn === 'function') {
  31001. this.#events.close = fn
  31002. this.addEventListener('close', fn)
  31003. } else {
  31004. this.#events.close = null
  31005. }
  31006. }
  31007. get onmessage () {
  31008. webidl.brandCheck(this, WebSocket)
  31009. return this.#events.message
  31010. }
  31011. set onmessage (fn) {
  31012. webidl.brandCheck(this, WebSocket)
  31013. if (this.#events.message) {
  31014. this.removeEventListener('message', this.#events.message)
  31015. }
  31016. if (typeof fn === 'function') {
  31017. this.#events.message = fn
  31018. this.addEventListener('message', fn)
  31019. } else {
  31020. this.#events.message = null
  31021. }
  31022. }
  31023. get binaryType () {
  31024. webidl.brandCheck(this, WebSocket)
  31025. return this[kBinaryType]
  31026. }
  31027. set binaryType (type) {
  31028. webidl.brandCheck(this, WebSocket)
  31029. if (type !== 'blob' && type !== 'arraybuffer') {
  31030. this[kBinaryType] = 'blob'
  31031. } else {
  31032. this[kBinaryType] = type
  31033. }
  31034. }
  31035. /**
  31036. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  31037. */
  31038. #onConnectionEstablished (response) {
  31039. // processResponse is called when the "response’s header list has been received and initialized."
  31040. // once this happens, the connection is open
  31041. this[kResponse] = response
  31042. const parser = new ByteParser(this)
  31043. parser.on('drain', function onParserDrain () {
  31044. this.ws[kResponse].socket.resume()
  31045. })
  31046. response.socket.ws = this
  31047. this[kByteParser] = parser
  31048. // 1. Change the ready state to OPEN (1).
  31049. this[kReadyState] = states.OPEN
  31050. // 2. Change the extensions attribute’s value to the extensions in use, if
  31051. // it is not the null value.
  31052. // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
  31053. const extensions = response.headersList.get('sec-websocket-extensions')
  31054. if (extensions !== null) {
  31055. this.#extensions = extensions
  31056. }
  31057. // 3. Change the protocol attribute’s value to the subprotocol in use, if
  31058. // it is not the null value.
  31059. // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
  31060. const protocol = response.headersList.get('sec-websocket-protocol')
  31061. if (protocol !== null) {
  31062. this.#protocol = protocol
  31063. }
  31064. // 4. Fire an event named open at the WebSocket object.
  31065. fireEvent('open', this)
  31066. }
  31067. }
  31068. // https://websockets.spec.whatwg.org/#dom-websocket-connecting
  31069. WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
  31070. // https://websockets.spec.whatwg.org/#dom-websocket-open
  31071. WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
  31072. // https://websockets.spec.whatwg.org/#dom-websocket-closing
  31073. WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
  31074. // https://websockets.spec.whatwg.org/#dom-websocket-closed
  31075. WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
  31076. Object.defineProperties(WebSocket.prototype, {
  31077. CONNECTING: staticPropertyDescriptors,
  31078. OPEN: staticPropertyDescriptors,
  31079. CLOSING: staticPropertyDescriptors,
  31080. CLOSED: staticPropertyDescriptors,
  31081. url: kEnumerableProperty,
  31082. readyState: kEnumerableProperty,
  31083. bufferedAmount: kEnumerableProperty,
  31084. onopen: kEnumerableProperty,
  31085. onerror: kEnumerableProperty,
  31086. onclose: kEnumerableProperty,
  31087. close: kEnumerableProperty,
  31088. onmessage: kEnumerableProperty,
  31089. binaryType: kEnumerableProperty,
  31090. send: kEnumerableProperty,
  31091. extensions: kEnumerableProperty,
  31092. protocol: kEnumerableProperty,
  31093. [Symbol.toStringTag]: {
  31094. value: 'WebSocket',
  31095. writable: false,
  31096. enumerable: false,
  31097. configurable: true
  31098. }
  31099. })
  31100. Object.defineProperties(WebSocket, {
  31101. CONNECTING: staticPropertyDescriptors,
  31102. OPEN: staticPropertyDescriptors,
  31103. CLOSING: staticPropertyDescriptors,
  31104. CLOSED: staticPropertyDescriptors
  31105. })
  31106. webidl.converters['sequence<DOMString>'] = webidl.sequenceConverter(
  31107. webidl.converters.DOMString
  31108. )
  31109. webidl.converters['DOMString or sequence<DOMString>'] = function (V) {
  31110. if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {
  31111. return webidl.converters['sequence<DOMString>'](V)
  31112. }
  31113. return webidl.converters.DOMString(V)
  31114. }
  31115. // This implements the propsal made in https://github.com/whatwg/websockets/issues/42
  31116. webidl.converters.WebSocketInit = webidl.dictionaryConverter([
  31117. {
  31118. key: 'protocols',
  31119. converter: webidl.converters['DOMString or sequence<DOMString>'],
  31120. get defaultValue () {
  31121. return []
  31122. }
  31123. },
  31124. {
  31125. key: 'dispatcher',
  31126. converter: (V) => V,
  31127. get defaultValue () {
  31128. return getGlobalDispatcher()
  31129. }
  31130. },
  31131. {
  31132. key: 'headers',
  31133. converter: webidl.nullableConverter(webidl.converters.HeadersInit)
  31134. }
  31135. ])
  31136. webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'] = function (V) {
  31137. if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {
  31138. return webidl.converters.WebSocketInit(V)
  31139. }
  31140. return { protocols: webidl.converters['DOMString or sequence<DOMString>'](V) }
  31141. }
  31142. webidl.converters.WebSocketSendData = function (V) {
  31143. if (webidl.util.Type(V) === 'Object') {
  31144. if (isBlobLike(V)) {
  31145. return webidl.converters.Blob(V, { strict: false })
  31146. }
  31147. if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {
  31148. return webidl.converters.BufferSource(V)
  31149. }
  31150. }
  31151. return webidl.converters.USVString(V)
  31152. }
  31153. module.exports = {
  31154. WebSocket
  31155. }
  31156. /***/ }),
  31157. /***/ 5030:
  31158. /***/ ((__unused_webpack_module, exports) => {
  31159. "use strict";
  31160. Object.defineProperty(exports, "__esModule", ({ value: true }));
  31161. function getUserAgent() {
  31162. if (typeof navigator === "object" && "userAgent" in navigator) {
  31163. return navigator.userAgent;
  31164. }
  31165. if (typeof process === "object" && process.version !== undefined) {
  31166. return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
  31167. }
  31168. return "<environment undetectable>";
  31169. }
  31170. exports.getUserAgent = getUserAgent;
  31171. //# sourceMappingURL=index.js.map
  31172. /***/ }),
  31173. /***/ 5840:
  31174. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31175. "use strict";
  31176. Object.defineProperty(exports, "__esModule", ({
  31177. value: true
  31178. }));
  31179. Object.defineProperty(exports, "NIL", ({
  31180. enumerable: true,
  31181. get: function () {
  31182. return _nil.default;
  31183. }
  31184. }));
  31185. Object.defineProperty(exports, "parse", ({
  31186. enumerable: true,
  31187. get: function () {
  31188. return _parse.default;
  31189. }
  31190. }));
  31191. Object.defineProperty(exports, "stringify", ({
  31192. enumerable: true,
  31193. get: function () {
  31194. return _stringify.default;
  31195. }
  31196. }));
  31197. Object.defineProperty(exports, "v1", ({
  31198. enumerable: true,
  31199. get: function () {
  31200. return _v.default;
  31201. }
  31202. }));
  31203. Object.defineProperty(exports, "v3", ({
  31204. enumerable: true,
  31205. get: function () {
  31206. return _v2.default;
  31207. }
  31208. }));
  31209. Object.defineProperty(exports, "v4", ({
  31210. enumerable: true,
  31211. get: function () {
  31212. return _v3.default;
  31213. }
  31214. }));
  31215. Object.defineProperty(exports, "v5", ({
  31216. enumerable: true,
  31217. get: function () {
  31218. return _v4.default;
  31219. }
  31220. }));
  31221. Object.defineProperty(exports, "validate", ({
  31222. enumerable: true,
  31223. get: function () {
  31224. return _validate.default;
  31225. }
  31226. }));
  31227. Object.defineProperty(exports, "version", ({
  31228. enumerable: true,
  31229. get: function () {
  31230. return _version.default;
  31231. }
  31232. }));
  31233. var _v = _interopRequireDefault(__nccwpck_require__(8628));
  31234. var _v2 = _interopRequireDefault(__nccwpck_require__(6409));
  31235. var _v3 = _interopRequireDefault(__nccwpck_require__(5122));
  31236. var _v4 = _interopRequireDefault(__nccwpck_require__(9120));
  31237. var _nil = _interopRequireDefault(__nccwpck_require__(5332));
  31238. var _version = _interopRequireDefault(__nccwpck_require__(2414));
  31239. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31240. var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
  31241. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31242. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31243. /***/ }),
  31244. /***/ 4569:
  31245. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31246. "use strict";
  31247. Object.defineProperty(exports, "__esModule", ({
  31248. value: true
  31249. }));
  31250. exports["default"] = void 0;
  31251. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31252. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31253. function md5(bytes) {
  31254. if (Array.isArray(bytes)) {
  31255. bytes = Buffer.from(bytes);
  31256. } else if (typeof bytes === 'string') {
  31257. bytes = Buffer.from(bytes, 'utf8');
  31258. }
  31259. return _crypto.default.createHash('md5').update(bytes).digest();
  31260. }
  31261. var _default = md5;
  31262. exports["default"] = _default;
  31263. /***/ }),
  31264. /***/ 2054:
  31265. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31266. "use strict";
  31267. Object.defineProperty(exports, "__esModule", ({
  31268. value: true
  31269. }));
  31270. exports["default"] = void 0;
  31271. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31272. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31273. var _default = {
  31274. randomUUID: _crypto.default.randomUUID
  31275. };
  31276. exports["default"] = _default;
  31277. /***/ }),
  31278. /***/ 5332:
  31279. /***/ ((__unused_webpack_module, exports) => {
  31280. "use strict";
  31281. Object.defineProperty(exports, "__esModule", ({
  31282. value: true
  31283. }));
  31284. exports["default"] = void 0;
  31285. var _default = '00000000-0000-0000-0000-000000000000';
  31286. exports["default"] = _default;
  31287. /***/ }),
  31288. /***/ 2746:
  31289. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31290. "use strict";
  31291. Object.defineProperty(exports, "__esModule", ({
  31292. value: true
  31293. }));
  31294. exports["default"] = void 0;
  31295. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31296. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31297. function parse(uuid) {
  31298. if (!(0, _validate.default)(uuid)) {
  31299. throw TypeError('Invalid UUID');
  31300. }
  31301. let v;
  31302. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  31303. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  31304. arr[1] = v >>> 16 & 0xff;
  31305. arr[2] = v >>> 8 & 0xff;
  31306. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  31307. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  31308. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  31309. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  31310. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  31311. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  31312. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  31313. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  31314. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  31315. arr[11] = v / 0x100000000 & 0xff;
  31316. arr[12] = v >>> 24 & 0xff;
  31317. arr[13] = v >>> 16 & 0xff;
  31318. arr[14] = v >>> 8 & 0xff;
  31319. arr[15] = v & 0xff;
  31320. return arr;
  31321. }
  31322. var _default = parse;
  31323. exports["default"] = _default;
  31324. /***/ }),
  31325. /***/ 814:
  31326. /***/ ((__unused_webpack_module, exports) => {
  31327. "use strict";
  31328. Object.defineProperty(exports, "__esModule", ({
  31329. value: true
  31330. }));
  31331. exports["default"] = void 0;
  31332. var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
  31333. exports["default"] = _default;
  31334. /***/ }),
  31335. /***/ 807:
  31336. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31337. "use strict";
  31338. Object.defineProperty(exports, "__esModule", ({
  31339. value: true
  31340. }));
  31341. exports["default"] = rng;
  31342. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31343. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31344. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  31345. let poolPtr = rnds8Pool.length;
  31346. function rng() {
  31347. if (poolPtr > rnds8Pool.length - 16) {
  31348. _crypto.default.randomFillSync(rnds8Pool);
  31349. poolPtr = 0;
  31350. }
  31351. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  31352. }
  31353. /***/ }),
  31354. /***/ 5274:
  31355. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31356. "use strict";
  31357. Object.defineProperty(exports, "__esModule", ({
  31358. value: true
  31359. }));
  31360. exports["default"] = void 0;
  31361. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31362. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31363. function sha1(bytes) {
  31364. if (Array.isArray(bytes)) {
  31365. bytes = Buffer.from(bytes);
  31366. } else if (typeof bytes === 'string') {
  31367. bytes = Buffer.from(bytes, 'utf8');
  31368. }
  31369. return _crypto.default.createHash('sha1').update(bytes).digest();
  31370. }
  31371. var _default = sha1;
  31372. exports["default"] = _default;
  31373. /***/ }),
  31374. /***/ 8950:
  31375. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31376. "use strict";
  31377. Object.defineProperty(exports, "__esModule", ({
  31378. value: true
  31379. }));
  31380. exports["default"] = void 0;
  31381. exports.unsafeStringify = unsafeStringify;
  31382. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31383. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31384. /**
  31385. * Convert array of 16 byte values to UUID string format of the form:
  31386. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  31387. */
  31388. const byteToHex = [];
  31389. for (let i = 0; i < 256; ++i) {
  31390. byteToHex.push((i + 0x100).toString(16).slice(1));
  31391. }
  31392. function unsafeStringify(arr, offset = 0) {
  31393. // Note: Be careful editing this code! It's been tuned for performance
  31394. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  31395. return 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]];
  31396. }
  31397. function stringify(arr, offset = 0) {
  31398. const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
  31399. // of the following:
  31400. // - One or more input array values don't map to a hex octet (leading to
  31401. // "undefined" in the uuid)
  31402. // - Invalid input values for the RFC `version` or `variant` fields
  31403. if (!(0, _validate.default)(uuid)) {
  31404. throw TypeError('Stringified UUID is invalid');
  31405. }
  31406. return uuid;
  31407. }
  31408. var _default = stringify;
  31409. exports["default"] = _default;
  31410. /***/ }),
  31411. /***/ 8628:
  31412. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31413. "use strict";
  31414. Object.defineProperty(exports, "__esModule", ({
  31415. value: true
  31416. }));
  31417. exports["default"] = void 0;
  31418. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31419. var _stringify = __nccwpck_require__(8950);
  31420. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31421. // **`v1()` - Generate time-based UUID**
  31422. //
  31423. // Inspired by https://github.com/LiosK/UUID.js
  31424. // and http://docs.python.org/library/uuid.html
  31425. let _nodeId;
  31426. let _clockseq; // Previous uuid creation time
  31427. let _lastMSecs = 0;
  31428. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  31429. function v1(options, buf, offset) {
  31430. let i = buf && offset || 0;
  31431. const b = buf || new Array(16);
  31432. options = options || {};
  31433. let node = options.node || _nodeId;
  31434. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  31435. // specified. We do this lazily to minimize issues related to insufficient
  31436. // system entropy. See #189
  31437. if (node == null || clockseq == null) {
  31438. const seedBytes = options.random || (options.rng || _rng.default)();
  31439. if (node == null) {
  31440. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  31441. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  31442. }
  31443. if (clockseq == null) {
  31444. // Per 4.2.2, randomize (14 bit) clockseq
  31445. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  31446. }
  31447. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  31448. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  31449. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  31450. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  31451. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  31452. // cycle to simulate higher resolution clock
  31453. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  31454. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  31455. if (dt < 0 && options.clockseq === undefined) {
  31456. clockseq = clockseq + 1 & 0x3fff;
  31457. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  31458. // time interval
  31459. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  31460. nsecs = 0;
  31461. } // Per 4.2.1.2 Throw error if too many uuids are requested
  31462. if (nsecs >= 10000) {
  31463. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  31464. }
  31465. _lastMSecs = msecs;
  31466. _lastNSecs = nsecs;
  31467. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  31468. msecs += 12219292800000; // `time_low`
  31469. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  31470. b[i++] = tl >>> 24 & 0xff;
  31471. b[i++] = tl >>> 16 & 0xff;
  31472. b[i++] = tl >>> 8 & 0xff;
  31473. b[i++] = tl & 0xff; // `time_mid`
  31474. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  31475. b[i++] = tmh >>> 8 & 0xff;
  31476. b[i++] = tmh & 0xff; // `time_high_and_version`
  31477. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  31478. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  31479. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  31480. b[i++] = clockseq & 0xff; // `node`
  31481. for (let n = 0; n < 6; ++n) {
  31482. b[i + n] = node[n];
  31483. }
  31484. return buf || (0, _stringify.unsafeStringify)(b);
  31485. }
  31486. var _default = v1;
  31487. exports["default"] = _default;
  31488. /***/ }),
  31489. /***/ 6409:
  31490. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31491. "use strict";
  31492. Object.defineProperty(exports, "__esModule", ({
  31493. value: true
  31494. }));
  31495. exports["default"] = void 0;
  31496. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31497. var _md = _interopRequireDefault(__nccwpck_require__(4569));
  31498. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31499. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  31500. var _default = v3;
  31501. exports["default"] = _default;
  31502. /***/ }),
  31503. /***/ 5998:
  31504. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31505. "use strict";
  31506. Object.defineProperty(exports, "__esModule", ({
  31507. value: true
  31508. }));
  31509. exports.URL = exports.DNS = void 0;
  31510. exports["default"] = v35;
  31511. var _stringify = __nccwpck_require__(8950);
  31512. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31513. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31514. function stringToBytes(str) {
  31515. str = unescape(encodeURIComponent(str)); // UTF8 escape
  31516. const bytes = [];
  31517. for (let i = 0; i < str.length; ++i) {
  31518. bytes.push(str.charCodeAt(i));
  31519. }
  31520. return bytes;
  31521. }
  31522. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  31523. exports.DNS = DNS;
  31524. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  31525. exports.URL = URL;
  31526. function v35(name, version, hashfunc) {
  31527. function generateUUID(value, namespace, buf, offset) {
  31528. var _namespace;
  31529. if (typeof value === 'string') {
  31530. value = stringToBytes(value);
  31531. }
  31532. if (typeof namespace === 'string') {
  31533. namespace = (0, _parse.default)(namespace);
  31534. }
  31535. if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
  31536. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  31537. } // Compute hash of namespace and value, Per 4.3
  31538. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  31539. // hashfunc([...namespace, ... value])`
  31540. let bytes = new Uint8Array(16 + value.length);
  31541. bytes.set(namespace);
  31542. bytes.set(value, namespace.length);
  31543. bytes = hashfunc(bytes);
  31544. bytes[6] = bytes[6] & 0x0f | version;
  31545. bytes[8] = bytes[8] & 0x3f | 0x80;
  31546. if (buf) {
  31547. offset = offset || 0;
  31548. for (let i = 0; i < 16; ++i) {
  31549. buf[offset + i] = bytes[i];
  31550. }
  31551. return buf;
  31552. }
  31553. return (0, _stringify.unsafeStringify)(bytes);
  31554. } // Function#name is not settable on some platforms (#270)
  31555. try {
  31556. generateUUID.name = name; // eslint-disable-next-line no-empty
  31557. } catch (err) {} // For CommonJS default export support
  31558. generateUUID.DNS = DNS;
  31559. generateUUID.URL = URL;
  31560. return generateUUID;
  31561. }
  31562. /***/ }),
  31563. /***/ 5122:
  31564. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31565. "use strict";
  31566. Object.defineProperty(exports, "__esModule", ({
  31567. value: true
  31568. }));
  31569. exports["default"] = void 0;
  31570. var _native = _interopRequireDefault(__nccwpck_require__(2054));
  31571. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31572. var _stringify = __nccwpck_require__(8950);
  31573. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31574. function v4(options, buf, offset) {
  31575. if (_native.default.randomUUID && !buf && !options) {
  31576. return _native.default.randomUUID();
  31577. }
  31578. options = options || {};
  31579. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  31580. rnds[6] = rnds[6] & 0x0f | 0x40;
  31581. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  31582. if (buf) {
  31583. offset = offset || 0;
  31584. for (let i = 0; i < 16; ++i) {
  31585. buf[offset + i] = rnds[i];
  31586. }
  31587. return buf;
  31588. }
  31589. return (0, _stringify.unsafeStringify)(rnds);
  31590. }
  31591. var _default = v4;
  31592. exports["default"] = _default;
  31593. /***/ }),
  31594. /***/ 9120:
  31595. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31596. "use strict";
  31597. Object.defineProperty(exports, "__esModule", ({
  31598. value: true
  31599. }));
  31600. exports["default"] = void 0;
  31601. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31602. var _sha = _interopRequireDefault(__nccwpck_require__(5274));
  31603. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31604. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  31605. var _default = v5;
  31606. exports["default"] = _default;
  31607. /***/ }),
  31608. /***/ 6900:
  31609. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31610. "use strict";
  31611. Object.defineProperty(exports, "__esModule", ({
  31612. value: true
  31613. }));
  31614. exports["default"] = void 0;
  31615. var _regex = _interopRequireDefault(__nccwpck_require__(814));
  31616. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31617. function validate(uuid) {
  31618. return typeof uuid === 'string' && _regex.default.test(uuid);
  31619. }
  31620. var _default = validate;
  31621. exports["default"] = _default;
  31622. /***/ }),
  31623. /***/ 2414:
  31624. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31625. "use strict";
  31626. Object.defineProperty(exports, "__esModule", ({
  31627. value: true
  31628. }));
  31629. exports["default"] = void 0;
  31630. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31631. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31632. function version(uuid) {
  31633. if (!(0, _validate.default)(uuid)) {
  31634. throw TypeError('Invalid UUID');
  31635. }
  31636. return parseInt(uuid.slice(14, 15), 16);
  31637. }
  31638. var _default = version;
  31639. exports["default"] = _default;
  31640. /***/ }),
  31641. /***/ 2940:
  31642. /***/ ((module) => {
  31643. // Returns a wrapper function that returns a wrapped callback
  31644. // The wrapper function should do some stuff, and return a
  31645. // presumably different callback function.
  31646. // This makes sure that own properties are retained, so that
  31647. // decorations and such are not lost along the way.
  31648. module.exports = wrappy
  31649. function wrappy (fn, cb) {
  31650. if (fn && cb) return wrappy(fn)(cb)
  31651. if (typeof fn !== 'function')
  31652. throw new TypeError('need wrapper function')
  31653. Object.keys(fn).forEach(function (k) {
  31654. wrapper[k] = fn[k]
  31655. })
  31656. return wrapper
  31657. function wrapper() {
  31658. var args = new Array(arguments.length)
  31659. for (var i = 0; i < args.length; i++) {
  31660. args[i] = arguments[i]
  31661. }
  31662. var ret = fn.apply(this, args)
  31663. var cb = args[args.length-1]
  31664. if (typeof ret === 'function' && ret !== cb) {
  31665. Object.keys(cb).forEach(function (k) {
  31666. ret[k] = cb[k]
  31667. })
  31668. }
  31669. return ret
  31670. }
  31671. }
  31672. /***/ }),
  31673. /***/ 9491:
  31674. /***/ ((module) => {
  31675. "use strict";
  31676. module.exports = require("assert");
  31677. /***/ }),
  31678. /***/ 852:
  31679. /***/ ((module) => {
  31680. "use strict";
  31681. module.exports = require("async_hooks");
  31682. /***/ }),
  31683. /***/ 4300:
  31684. /***/ ((module) => {
  31685. "use strict";
  31686. module.exports = require("buffer");
  31687. /***/ }),
  31688. /***/ 2081:
  31689. /***/ ((module) => {
  31690. "use strict";
  31691. module.exports = require("child_process");
  31692. /***/ }),
  31693. /***/ 6206:
  31694. /***/ ((module) => {
  31695. "use strict";
  31696. module.exports = require("console");
  31697. /***/ }),
  31698. /***/ 6113:
  31699. /***/ ((module) => {
  31700. "use strict";
  31701. module.exports = require("crypto");
  31702. /***/ }),
  31703. /***/ 7643:
  31704. /***/ ((module) => {
  31705. "use strict";
  31706. module.exports = require("diagnostics_channel");
  31707. /***/ }),
  31708. /***/ 2361:
  31709. /***/ ((module) => {
  31710. "use strict";
  31711. module.exports = require("events");
  31712. /***/ }),
  31713. /***/ 7147:
  31714. /***/ ((module) => {
  31715. "use strict";
  31716. module.exports = require("fs");
  31717. /***/ }),
  31718. /***/ 3685:
  31719. /***/ ((module) => {
  31720. "use strict";
  31721. module.exports = require("http");
  31722. /***/ }),
  31723. /***/ 5158:
  31724. /***/ ((module) => {
  31725. "use strict";
  31726. module.exports = require("http2");
  31727. /***/ }),
  31728. /***/ 5687:
  31729. /***/ ((module) => {
  31730. "use strict";
  31731. module.exports = require("https");
  31732. /***/ }),
  31733. /***/ 1808:
  31734. /***/ ((module) => {
  31735. "use strict";
  31736. module.exports = require("net");
  31737. /***/ }),
  31738. /***/ 6005:
  31739. /***/ ((module) => {
  31740. "use strict";
  31741. module.exports = require("node:crypto");
  31742. /***/ }),
  31743. /***/ 5673:
  31744. /***/ ((module) => {
  31745. "use strict";
  31746. module.exports = require("node:events");
  31747. /***/ }),
  31748. /***/ 4492:
  31749. /***/ ((module) => {
  31750. "use strict";
  31751. module.exports = require("node:stream");
  31752. /***/ }),
  31753. /***/ 7261:
  31754. /***/ ((module) => {
  31755. "use strict";
  31756. module.exports = require("node:util");
  31757. /***/ }),
  31758. /***/ 2037:
  31759. /***/ ((module) => {
  31760. "use strict";
  31761. module.exports = require("os");
  31762. /***/ }),
  31763. /***/ 1017:
  31764. /***/ ((module) => {
  31765. "use strict";
  31766. module.exports = require("path");
  31767. /***/ }),
  31768. /***/ 4074:
  31769. /***/ ((module) => {
  31770. "use strict";
  31771. module.exports = require("perf_hooks");
  31772. /***/ }),
  31773. /***/ 3477:
  31774. /***/ ((module) => {
  31775. "use strict";
  31776. module.exports = require("querystring");
  31777. /***/ }),
  31778. /***/ 2781:
  31779. /***/ ((module) => {
  31780. "use strict";
  31781. module.exports = require("stream");
  31782. /***/ }),
  31783. /***/ 5356:
  31784. /***/ ((module) => {
  31785. "use strict";
  31786. module.exports = require("stream/web");
  31787. /***/ }),
  31788. /***/ 1576:
  31789. /***/ ((module) => {
  31790. "use strict";
  31791. module.exports = require("string_decoder");
  31792. /***/ }),
  31793. /***/ 9512:
  31794. /***/ ((module) => {
  31795. "use strict";
  31796. module.exports = require("timers");
  31797. /***/ }),
  31798. /***/ 4404:
  31799. /***/ ((module) => {
  31800. "use strict";
  31801. module.exports = require("tls");
  31802. /***/ }),
  31803. /***/ 7310:
  31804. /***/ ((module) => {
  31805. "use strict";
  31806. module.exports = require("url");
  31807. /***/ }),
  31808. /***/ 3837:
  31809. /***/ ((module) => {
  31810. "use strict";
  31811. module.exports = require("util");
  31812. /***/ }),
  31813. /***/ 9830:
  31814. /***/ ((module) => {
  31815. "use strict";
  31816. module.exports = require("util/types");
  31817. /***/ }),
  31818. /***/ 1267:
  31819. /***/ ((module) => {
  31820. "use strict";
  31821. module.exports = require("worker_threads");
  31822. /***/ }),
  31823. /***/ 9796:
  31824. /***/ ((module) => {
  31825. "use strict";
  31826. module.exports = require("zlib");
  31827. /***/ }),
  31828. /***/ 2960:
  31829. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31830. "use strict";
  31831. const WritableStream = (__nccwpck_require__(4492).Writable)
  31832. const inherits = (__nccwpck_require__(7261).inherits)
  31833. const StreamSearch = __nccwpck_require__(1142)
  31834. const PartStream = __nccwpck_require__(1620)
  31835. const HeaderParser = __nccwpck_require__(2032)
  31836. const DASH = 45
  31837. const B_ONEDASH = Buffer.from('-')
  31838. const B_CRLF = Buffer.from('\r\n')
  31839. const EMPTY_FN = function () {}
  31840. function Dicer (cfg) {
  31841. if (!(this instanceof Dicer)) { return new Dicer(cfg) }
  31842. WritableStream.call(this, cfg)
  31843. if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') }
  31844. if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined }
  31845. this._headerFirst = cfg.headerFirst
  31846. this._dashes = 0
  31847. this._parts = 0
  31848. this._finished = false
  31849. this._realFinish = false
  31850. this._isPreamble = true
  31851. this._justMatched = false
  31852. this._firstWrite = true
  31853. this._inHeader = true
  31854. this._part = undefined
  31855. this._cb = undefined
  31856. this._ignoreData = false
  31857. this._partOpts = { highWaterMark: cfg.partHwm }
  31858. this._pause = false
  31859. const self = this
  31860. this._hparser = new HeaderParser(cfg)
  31861. this._hparser.on('header', function (header) {
  31862. self._inHeader = false
  31863. self._part.emit('header', header)
  31864. })
  31865. }
  31866. inherits(Dicer, WritableStream)
  31867. Dicer.prototype.emit = function (ev) {
  31868. if (ev === 'finish' && !this._realFinish) {
  31869. if (!this._finished) {
  31870. const self = this
  31871. process.nextTick(function () {
  31872. self.emit('error', new Error('Unexpected end of multipart data'))
  31873. if (self._part && !self._ignoreData) {
  31874. const type = (self._isPreamble ? 'Preamble' : 'Part')
  31875. self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data'))
  31876. self._part.push(null)
  31877. process.nextTick(function () {
  31878. self._realFinish = true
  31879. self.emit('finish')
  31880. self._realFinish = false
  31881. })
  31882. return
  31883. }
  31884. self._realFinish = true
  31885. self.emit('finish')
  31886. self._realFinish = false
  31887. })
  31888. }
  31889. } else { WritableStream.prototype.emit.apply(this, arguments) }
  31890. }
  31891. Dicer.prototype._write = function (data, encoding, cb) {
  31892. // ignore unexpected data (e.g. extra trailer data after finished)
  31893. if (!this._hparser && !this._bparser) { return cb() }
  31894. if (this._headerFirst && this._isPreamble) {
  31895. if (!this._part) {
  31896. this._part = new PartStream(this._partOpts)
  31897. if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() }
  31898. }
  31899. const r = this._hparser.push(data)
  31900. if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }
  31901. }
  31902. // allows for "easier" testing
  31903. if (this._firstWrite) {
  31904. this._bparser.push(B_CRLF)
  31905. this._firstWrite = false
  31906. }
  31907. this._bparser.push(data)
  31908. if (this._pause) { this._cb = cb } else { cb() }
  31909. }
  31910. Dicer.prototype.reset = function () {
  31911. this._part = undefined
  31912. this._bparser = undefined
  31913. this._hparser = undefined
  31914. }
  31915. Dicer.prototype.setBoundary = function (boundary) {
  31916. const self = this
  31917. this._bparser = new StreamSearch('\r\n--' + boundary)
  31918. this._bparser.on('info', function (isMatch, data, start, end) {
  31919. self._oninfo(isMatch, data, start, end)
  31920. })
  31921. }
  31922. Dicer.prototype._ignore = function () {
  31923. if (this._part && !this._ignoreData) {
  31924. this._ignoreData = true
  31925. this._part.on('error', EMPTY_FN)
  31926. // we must perform some kind of read on the stream even though we are
  31927. // ignoring the data, otherwise node's Readable stream will not emit 'end'
  31928. // after pushing null to the stream
  31929. this._part.resume()
  31930. }
  31931. }
  31932. Dicer.prototype._oninfo = function (isMatch, data, start, end) {
  31933. let buf; const self = this; let i = 0; let r; let shouldWriteMore = true
  31934. if (!this._part && this._justMatched && data) {
  31935. while (this._dashes < 2 && (start + i) < end) {
  31936. if (data[start + i] === DASH) {
  31937. ++i
  31938. ++this._dashes
  31939. } else {
  31940. if (this._dashes) { buf = B_ONEDASH }
  31941. this._dashes = 0
  31942. break
  31943. }
  31944. }
  31945. if (this._dashes === 2) {
  31946. if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) }
  31947. this.reset()
  31948. this._finished = true
  31949. // no more parts will be added
  31950. if (self._parts === 0) {
  31951. self._realFinish = true
  31952. self.emit('finish')
  31953. self._realFinish = false
  31954. }
  31955. }
  31956. if (this._dashes) { return }
  31957. }
  31958. if (this._justMatched) { this._justMatched = false }
  31959. if (!this._part) {
  31960. this._part = new PartStream(this._partOpts)
  31961. this._part._read = function (n) {
  31962. self._unpause()
  31963. }
  31964. if (this._isPreamble && this.listenerCount('preamble') !== 0) {
  31965. this.emit('preamble', this._part)
  31966. } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) {
  31967. this.emit('part', this._part)
  31968. } else {
  31969. this._ignore()
  31970. }
  31971. if (!this._isPreamble) { this._inHeader = true }
  31972. }
  31973. if (data && start < end && !this._ignoreData) {
  31974. if (this._isPreamble || !this._inHeader) {
  31975. if (buf) { shouldWriteMore = this._part.push(buf) }
  31976. shouldWriteMore = this._part.push(data.slice(start, end))
  31977. if (!shouldWriteMore) { this._pause = true }
  31978. } else if (!this._isPreamble && this._inHeader) {
  31979. if (buf) { this._hparser.push(buf) }
  31980. r = this._hparser.push(data.slice(start, end))
  31981. if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) }
  31982. }
  31983. }
  31984. if (isMatch) {
  31985. this._hparser.reset()
  31986. if (this._isPreamble) { this._isPreamble = false } else {
  31987. if (start !== end) {
  31988. ++this._parts
  31989. this._part.on('end', function () {
  31990. if (--self._parts === 0) {
  31991. if (self._finished) {
  31992. self._realFinish = true
  31993. self.emit('finish')
  31994. self._realFinish = false
  31995. } else {
  31996. self._unpause()
  31997. }
  31998. }
  31999. })
  32000. }
  32001. }
  32002. this._part.push(null)
  32003. this._part = undefined
  32004. this._ignoreData = false
  32005. this._justMatched = true
  32006. this._dashes = 0
  32007. }
  32008. }
  32009. Dicer.prototype._unpause = function () {
  32010. if (!this._pause) { return }
  32011. this._pause = false
  32012. if (this._cb) {
  32013. const cb = this._cb
  32014. this._cb = undefined
  32015. cb()
  32016. }
  32017. }
  32018. module.exports = Dicer
  32019. /***/ }),
  32020. /***/ 2032:
  32021. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32022. "use strict";
  32023. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  32024. const inherits = (__nccwpck_require__(7261).inherits)
  32025. const getLimit = __nccwpck_require__(1467)
  32026. const StreamSearch = __nccwpck_require__(1142)
  32027. const B_DCRLF = Buffer.from('\r\n\r\n')
  32028. const RE_CRLF = /\r\n/g
  32029. const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex
  32030. function HeaderParser (cfg) {
  32031. EventEmitter.call(this)
  32032. cfg = cfg || {}
  32033. const self = this
  32034. this.nread = 0
  32035. this.maxed = false
  32036. this.npairs = 0
  32037. this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000)
  32038. this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024)
  32039. this.buffer = ''
  32040. this.header = {}
  32041. this.finished = false
  32042. this.ss = new StreamSearch(B_DCRLF)
  32043. this.ss.on('info', function (isMatch, data, start, end) {
  32044. if (data && !self.maxed) {
  32045. if (self.nread + end - start >= self.maxHeaderSize) {
  32046. end = self.maxHeaderSize - self.nread + start
  32047. self.nread = self.maxHeaderSize
  32048. self.maxed = true
  32049. } else { self.nread += (end - start) }
  32050. self.buffer += data.toString('binary', start, end)
  32051. }
  32052. if (isMatch) { self._finish() }
  32053. })
  32054. }
  32055. inherits(HeaderParser, EventEmitter)
  32056. HeaderParser.prototype.push = function (data) {
  32057. const r = this.ss.push(data)
  32058. if (this.finished) { return r }
  32059. }
  32060. HeaderParser.prototype.reset = function () {
  32061. this.finished = false
  32062. this.buffer = ''
  32063. this.header = {}
  32064. this.ss.reset()
  32065. }
  32066. HeaderParser.prototype._finish = function () {
  32067. if (this.buffer) { this._parseHeader() }
  32068. this.ss.matches = this.ss.maxMatches
  32069. const header = this.header
  32070. this.header = {}
  32071. this.buffer = ''
  32072. this.finished = true
  32073. this.nread = this.npairs = 0
  32074. this.maxed = false
  32075. this.emit('header', header)
  32076. }
  32077. HeaderParser.prototype._parseHeader = function () {
  32078. if (this.npairs === this.maxHeaderPairs) { return }
  32079. const lines = this.buffer.split(RE_CRLF)
  32080. const len = lines.length
  32081. let m, h
  32082. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32083. if (lines[i].length === 0) { continue }
  32084. if (lines[i][0] === '\t' || lines[i][0] === ' ') {
  32085. // folded header content
  32086. // RFC2822 says to just remove the CRLF and not the whitespace following
  32087. // it, so we follow the RFC and include the leading whitespace ...
  32088. if (h) {
  32089. this.header[h][this.header[h].length - 1] += lines[i]
  32090. continue
  32091. }
  32092. }
  32093. const posColon = lines[i].indexOf(':')
  32094. if (
  32095. posColon === -1 ||
  32096. posColon === 0
  32097. ) {
  32098. return
  32099. }
  32100. m = RE_HDR.exec(lines[i])
  32101. h = m[1].toLowerCase()
  32102. this.header[h] = this.header[h] || []
  32103. this.header[h].push((m[2] || ''))
  32104. if (++this.npairs === this.maxHeaderPairs) { break }
  32105. }
  32106. }
  32107. module.exports = HeaderParser
  32108. /***/ }),
  32109. /***/ 1620:
  32110. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32111. "use strict";
  32112. const inherits = (__nccwpck_require__(7261).inherits)
  32113. const ReadableStream = (__nccwpck_require__(4492).Readable)
  32114. function PartStream (opts) {
  32115. ReadableStream.call(this, opts)
  32116. }
  32117. inherits(PartStream, ReadableStream)
  32118. PartStream.prototype._read = function (n) {}
  32119. module.exports = PartStream
  32120. /***/ }),
  32121. /***/ 1142:
  32122. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32123. "use strict";
  32124. /**
  32125. * Copyright Brian White. All rights reserved.
  32126. *
  32127. * @see https://github.com/mscdex/streamsearch
  32128. *
  32129. * Permission is hereby granted, free of charge, to any person obtaining a copy
  32130. * of this software and associated documentation files (the "Software"), to
  32131. * deal in the Software without restriction, including without limitation the
  32132. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  32133. * sell copies of the Software, and to permit persons to whom the Software is
  32134. * furnished to do so, subject to the following conditions:
  32135. *
  32136. * The above copyright notice and this permission notice shall be included in
  32137. * all copies or substantial portions of the Software.
  32138. *
  32139. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  32140. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  32141. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  32142. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  32143. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  32144. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  32145. * IN THE SOFTWARE.
  32146. *
  32147. * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation
  32148. * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool
  32149. */
  32150. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  32151. const inherits = (__nccwpck_require__(7261).inherits)
  32152. function SBMH (needle) {
  32153. if (typeof needle === 'string') {
  32154. needle = Buffer.from(needle)
  32155. }
  32156. if (!Buffer.isBuffer(needle)) {
  32157. throw new TypeError('The needle has to be a String or a Buffer.')
  32158. }
  32159. const needleLength = needle.length
  32160. if (needleLength === 0) {
  32161. throw new Error('The needle cannot be an empty String/Buffer.')
  32162. }
  32163. if (needleLength > 256) {
  32164. throw new Error('The needle cannot have a length bigger than 256.')
  32165. }
  32166. this.maxMatches = Infinity
  32167. this.matches = 0
  32168. this._occ = new Array(256)
  32169. .fill(needleLength) // Initialize occurrence table.
  32170. this._lookbehind_size = 0
  32171. this._needle = needle
  32172. this._bufpos = 0
  32173. this._lookbehind = Buffer.alloc(needleLength)
  32174. // Populate occurrence table with analysis of the needle,
  32175. // ignoring last letter.
  32176. for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var
  32177. this._occ[needle[i]] = needleLength - 1 - i
  32178. }
  32179. }
  32180. inherits(SBMH, EventEmitter)
  32181. SBMH.prototype.reset = function () {
  32182. this._lookbehind_size = 0
  32183. this.matches = 0
  32184. this._bufpos = 0
  32185. }
  32186. SBMH.prototype.push = function (chunk, pos) {
  32187. if (!Buffer.isBuffer(chunk)) {
  32188. chunk = Buffer.from(chunk, 'binary')
  32189. }
  32190. const chlen = chunk.length
  32191. this._bufpos = pos || 0
  32192. let r
  32193. while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) }
  32194. return r
  32195. }
  32196. SBMH.prototype._sbmh_feed = function (data) {
  32197. const len = data.length
  32198. const needle = this._needle
  32199. const needleLength = needle.length
  32200. const lastNeedleChar = needle[needleLength - 1]
  32201. // Positive: points to a position in `data`
  32202. // pos == 3 points to data[3]
  32203. // Negative: points to a position in the lookbehind buffer
  32204. // pos == -2 points to lookbehind[lookbehind_size - 2]
  32205. let pos = -this._lookbehind_size
  32206. let ch
  32207. if (pos < 0) {
  32208. // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool
  32209. // search with character lookup code that considers both the
  32210. // lookbehind buffer and the current round's haystack data.
  32211. //
  32212. // Loop until
  32213. // there is a match.
  32214. // or until
  32215. // we've moved past the position that requires the
  32216. // lookbehind buffer. In this case we switch to the
  32217. // optimized loop.
  32218. // or until
  32219. // the character to look at lies outside the haystack.
  32220. while (pos < 0 && pos <= len - needleLength) {
  32221. ch = this._sbmh_lookup_char(data, pos + needleLength - 1)
  32222. if (
  32223. ch === lastNeedleChar &&
  32224. this._sbmh_memcmp(data, pos, needleLength - 1)
  32225. ) {
  32226. this._lookbehind_size = 0
  32227. ++this.matches
  32228. this.emit('info', true)
  32229. return (this._bufpos = pos + needleLength)
  32230. }
  32231. pos += this._occ[ch]
  32232. }
  32233. // No match.
  32234. if (pos < 0) {
  32235. // There's too few data for Boyer-Moore-Horspool to run,
  32236. // so let's use a different algorithm to skip as much as
  32237. // we can.
  32238. // Forward pos until
  32239. // the trailing part of lookbehind + data
  32240. // looks like the beginning of the needle
  32241. // or until
  32242. // pos == 0
  32243. while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos }
  32244. }
  32245. if (pos >= 0) {
  32246. // Discard lookbehind buffer.
  32247. this.emit('info', false, this._lookbehind, 0, this._lookbehind_size)
  32248. this._lookbehind_size = 0
  32249. } else {
  32250. // Cut off part of the lookbehind buffer that has
  32251. // been processed and append the entire haystack
  32252. // into it.
  32253. const bytesToCutOff = this._lookbehind_size + pos
  32254. if (bytesToCutOff > 0) {
  32255. // The cut off data is guaranteed not to contain the needle.
  32256. this.emit('info', false, this._lookbehind, 0, bytesToCutOff)
  32257. }
  32258. this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,
  32259. this._lookbehind_size - bytesToCutOff)
  32260. this._lookbehind_size -= bytesToCutOff
  32261. data.copy(this._lookbehind, this._lookbehind_size)
  32262. this._lookbehind_size += len
  32263. this._bufpos = len
  32264. return len
  32265. }
  32266. }
  32267. pos += (pos >= 0) * this._bufpos
  32268. // Lookbehind buffer is now empty. We only need to check if the
  32269. // needle is in the haystack.
  32270. if (data.indexOf(needle, pos) !== -1) {
  32271. pos = data.indexOf(needle, pos)
  32272. ++this.matches
  32273. if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) }
  32274. return (this._bufpos = pos + needleLength)
  32275. } else {
  32276. pos = len - needleLength
  32277. }
  32278. // There was no match. If there's trailing haystack data that we cannot
  32279. // match yet using the Boyer-Moore-Horspool algorithm (because the trailing
  32280. // data is less than the needle size) then match using a modified
  32281. // algorithm that starts matching from the beginning instead of the end.
  32282. // Whatever trailing data is left after running this algorithm is added to
  32283. // the lookbehind buffer.
  32284. while (
  32285. pos < len &&
  32286. (
  32287. data[pos] !== needle[0] ||
  32288. (
  32289. (Buffer.compare(
  32290. data.subarray(pos, pos + len - pos),
  32291. needle.subarray(0, len - pos)
  32292. ) !== 0)
  32293. )
  32294. )
  32295. ) {
  32296. ++pos
  32297. }
  32298. if (pos < len) {
  32299. data.copy(this._lookbehind, 0, pos, pos + (len - pos))
  32300. this._lookbehind_size = len - pos
  32301. }
  32302. // Everything until pos is guaranteed not to contain needle data.
  32303. if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) }
  32304. this._bufpos = len
  32305. return len
  32306. }
  32307. SBMH.prototype._sbmh_lookup_char = function (data, pos) {
  32308. return (pos < 0)
  32309. ? this._lookbehind[this._lookbehind_size + pos]
  32310. : data[pos]
  32311. }
  32312. SBMH.prototype._sbmh_memcmp = function (data, pos, len) {
  32313. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32314. if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false }
  32315. }
  32316. return true
  32317. }
  32318. module.exports = SBMH
  32319. /***/ }),
  32320. /***/ 727:
  32321. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32322. "use strict";
  32323. const WritableStream = (__nccwpck_require__(4492).Writable)
  32324. const { inherits } = __nccwpck_require__(7261)
  32325. const Dicer = __nccwpck_require__(2960)
  32326. const MultipartParser = __nccwpck_require__(2183)
  32327. const UrlencodedParser = __nccwpck_require__(8306)
  32328. const parseParams = __nccwpck_require__(1854)
  32329. function Busboy (opts) {
  32330. if (!(this instanceof Busboy)) { return new Busboy(opts) }
  32331. if (typeof opts !== 'object') {
  32332. throw new TypeError('Busboy expected an options-Object.')
  32333. }
  32334. if (typeof opts.headers !== 'object') {
  32335. throw new TypeError('Busboy expected an options-Object with headers-attribute.')
  32336. }
  32337. if (typeof opts.headers['content-type'] !== 'string') {
  32338. throw new TypeError('Missing Content-Type-header.')
  32339. }
  32340. const {
  32341. headers,
  32342. ...streamOptions
  32343. } = opts
  32344. this.opts = {
  32345. autoDestroy: false,
  32346. ...streamOptions
  32347. }
  32348. WritableStream.call(this, this.opts)
  32349. this._done = false
  32350. this._parser = this.getParserByHeaders(headers)
  32351. this._finished = false
  32352. }
  32353. inherits(Busboy, WritableStream)
  32354. Busboy.prototype.emit = function (ev) {
  32355. if (ev === 'finish') {
  32356. if (!this._done) {
  32357. this._parser?.end()
  32358. return
  32359. } else if (this._finished) {
  32360. return
  32361. }
  32362. this._finished = true
  32363. }
  32364. WritableStream.prototype.emit.apply(this, arguments)
  32365. }
  32366. Busboy.prototype.getParserByHeaders = function (headers) {
  32367. const parsed = parseParams(headers['content-type'])
  32368. const cfg = {
  32369. defCharset: this.opts.defCharset,
  32370. fileHwm: this.opts.fileHwm,
  32371. headers,
  32372. highWaterMark: this.opts.highWaterMark,
  32373. isPartAFile: this.opts.isPartAFile,
  32374. limits: this.opts.limits,
  32375. parsedConType: parsed,
  32376. preservePath: this.opts.preservePath
  32377. }
  32378. if (MultipartParser.detect.test(parsed[0])) {
  32379. return new MultipartParser(this, cfg)
  32380. }
  32381. if (UrlencodedParser.detect.test(parsed[0])) {
  32382. return new UrlencodedParser(this, cfg)
  32383. }
  32384. throw new Error('Unsupported Content-Type.')
  32385. }
  32386. Busboy.prototype._write = function (chunk, encoding, cb) {
  32387. this._parser.write(chunk, cb)
  32388. }
  32389. module.exports = Busboy
  32390. module.exports["default"] = Busboy
  32391. module.exports.Busboy = Busboy
  32392. module.exports.Dicer = Dicer
  32393. /***/ }),
  32394. /***/ 2183:
  32395. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32396. "use strict";
  32397. // TODO:
  32398. // * support 1 nested multipart level
  32399. // (see second multipart example here:
  32400. // http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)
  32401. // * support limits.fieldNameSize
  32402. // -- this will require modifications to utils.parseParams
  32403. const { Readable } = __nccwpck_require__(4492)
  32404. const { inherits } = __nccwpck_require__(7261)
  32405. const Dicer = __nccwpck_require__(2960)
  32406. const parseParams = __nccwpck_require__(1854)
  32407. const decodeText = __nccwpck_require__(4619)
  32408. const basename = __nccwpck_require__(8647)
  32409. const getLimit = __nccwpck_require__(1467)
  32410. const RE_BOUNDARY = /^boundary$/i
  32411. const RE_FIELD = /^form-data$/i
  32412. const RE_CHARSET = /^charset$/i
  32413. const RE_FILENAME = /^filename$/i
  32414. const RE_NAME = /^name$/i
  32415. Multipart.detect = /^multipart\/form-data/i
  32416. function Multipart (boy, cfg) {
  32417. let i
  32418. let len
  32419. const self = this
  32420. let boundary
  32421. const limits = cfg.limits
  32422. const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined))
  32423. const parsedConType = cfg.parsedConType || []
  32424. const defCharset = cfg.defCharset || 'utf8'
  32425. const preservePath = cfg.preservePath
  32426. const fileOpts = { highWaterMark: cfg.fileHwm }
  32427. for (i = 0, len = parsedConType.length; i < len; ++i) {
  32428. if (Array.isArray(parsedConType[i]) &&
  32429. RE_BOUNDARY.test(parsedConType[i][0])) {
  32430. boundary = parsedConType[i][1]
  32431. break
  32432. }
  32433. }
  32434. function checkFinished () {
  32435. if (nends === 0 && finished && !boy._done) {
  32436. finished = false
  32437. self.end()
  32438. }
  32439. }
  32440. if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') }
  32441. const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32442. const fileSizeLimit = getLimit(limits, 'fileSize', Infinity)
  32443. const filesLimit = getLimit(limits, 'files', Infinity)
  32444. const fieldsLimit = getLimit(limits, 'fields', Infinity)
  32445. const partsLimit = getLimit(limits, 'parts', Infinity)
  32446. const headerPairsLimit = getLimit(limits, 'headerPairs', 2000)
  32447. const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024)
  32448. let nfiles = 0
  32449. let nfields = 0
  32450. let nends = 0
  32451. let curFile
  32452. let curField
  32453. let finished = false
  32454. this._needDrain = false
  32455. this._pause = false
  32456. this._cb = undefined
  32457. this._nparts = 0
  32458. this._boy = boy
  32459. const parserCfg = {
  32460. boundary,
  32461. maxHeaderPairs: headerPairsLimit,
  32462. maxHeaderSize: headerSizeLimit,
  32463. partHwm: fileOpts.highWaterMark,
  32464. highWaterMark: cfg.highWaterMark
  32465. }
  32466. this.parser = new Dicer(parserCfg)
  32467. this.parser.on('drain', function () {
  32468. self._needDrain = false
  32469. if (self._cb && !self._pause) {
  32470. const cb = self._cb
  32471. self._cb = undefined
  32472. cb()
  32473. }
  32474. }).on('part', function onPart (part) {
  32475. if (++self._nparts > partsLimit) {
  32476. self.parser.removeListener('part', onPart)
  32477. self.parser.on('part', skipPart)
  32478. boy.hitPartsLimit = true
  32479. boy.emit('partsLimit')
  32480. return skipPart(part)
  32481. }
  32482. // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let
  32483. // us emit 'end' early since we know the part has ended if we are already
  32484. // seeing the next part
  32485. if (curField) {
  32486. const field = curField
  32487. field.emit('end')
  32488. field.removeAllListeners('end')
  32489. }
  32490. part.on('header', function (header) {
  32491. let contype
  32492. let fieldname
  32493. let parsed
  32494. let charset
  32495. let encoding
  32496. let filename
  32497. let nsize = 0
  32498. if (header['content-type']) {
  32499. parsed = parseParams(header['content-type'][0])
  32500. if (parsed[0]) {
  32501. contype = parsed[0].toLowerCase()
  32502. for (i = 0, len = parsed.length; i < len; ++i) {
  32503. if (RE_CHARSET.test(parsed[i][0])) {
  32504. charset = parsed[i][1].toLowerCase()
  32505. break
  32506. }
  32507. }
  32508. }
  32509. }
  32510. if (contype === undefined) { contype = 'text/plain' }
  32511. if (charset === undefined) { charset = defCharset }
  32512. if (header['content-disposition']) {
  32513. parsed = parseParams(header['content-disposition'][0])
  32514. if (!RE_FIELD.test(parsed[0])) { return skipPart(part) }
  32515. for (i = 0, len = parsed.length; i < len; ++i) {
  32516. if (RE_NAME.test(parsed[i][0])) {
  32517. fieldname = parsed[i][1]
  32518. } else if (RE_FILENAME.test(parsed[i][0])) {
  32519. filename = parsed[i][1]
  32520. if (!preservePath) { filename = basename(filename) }
  32521. }
  32522. }
  32523. } else { return skipPart(part) }
  32524. if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' }
  32525. let onData,
  32526. onEnd
  32527. if (isPartAFile(fieldname, contype, filename)) {
  32528. // file/binary field
  32529. if (nfiles === filesLimit) {
  32530. if (!boy.hitFilesLimit) {
  32531. boy.hitFilesLimit = true
  32532. boy.emit('filesLimit')
  32533. }
  32534. return skipPart(part)
  32535. }
  32536. ++nfiles
  32537. if (boy.listenerCount('file') === 0) {
  32538. self.parser._ignore()
  32539. return
  32540. }
  32541. ++nends
  32542. const file = new FileStream(fileOpts)
  32543. curFile = file
  32544. file.on('end', function () {
  32545. --nends
  32546. self._pause = false
  32547. checkFinished()
  32548. if (self._cb && !self._needDrain) {
  32549. const cb = self._cb
  32550. self._cb = undefined
  32551. cb()
  32552. }
  32553. })
  32554. file._read = function (n) {
  32555. if (!self._pause) { return }
  32556. self._pause = false
  32557. if (self._cb && !self._needDrain) {
  32558. const cb = self._cb
  32559. self._cb = undefined
  32560. cb()
  32561. }
  32562. }
  32563. boy.emit('file', fieldname, file, filename, encoding, contype)
  32564. onData = function (data) {
  32565. if ((nsize += data.length) > fileSizeLimit) {
  32566. const extralen = fileSizeLimit - nsize + data.length
  32567. if (extralen > 0) { file.push(data.slice(0, extralen)) }
  32568. file.truncated = true
  32569. file.bytesRead = fileSizeLimit
  32570. part.removeAllListeners('data')
  32571. file.emit('limit')
  32572. return
  32573. } else if (!file.push(data)) { self._pause = true }
  32574. file.bytesRead = nsize
  32575. }
  32576. onEnd = function () {
  32577. curFile = undefined
  32578. file.push(null)
  32579. }
  32580. } else {
  32581. // non-file field
  32582. if (nfields === fieldsLimit) {
  32583. if (!boy.hitFieldsLimit) {
  32584. boy.hitFieldsLimit = true
  32585. boy.emit('fieldsLimit')
  32586. }
  32587. return skipPart(part)
  32588. }
  32589. ++nfields
  32590. ++nends
  32591. let buffer = ''
  32592. let truncated = false
  32593. curField = part
  32594. onData = function (data) {
  32595. if ((nsize += data.length) > fieldSizeLimit) {
  32596. const extralen = (fieldSizeLimit - (nsize - data.length))
  32597. buffer += data.toString('binary', 0, extralen)
  32598. truncated = true
  32599. part.removeAllListeners('data')
  32600. } else { buffer += data.toString('binary') }
  32601. }
  32602. onEnd = function () {
  32603. curField = undefined
  32604. if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) }
  32605. boy.emit('field', fieldname, buffer, false, truncated, encoding, contype)
  32606. --nends
  32607. checkFinished()
  32608. }
  32609. }
  32610. /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become
  32611. broken. Streams2/streams3 is a huge black box of confusion, but
  32612. somehow overriding the sync state seems to fix things again (and still
  32613. seems to work for previous node versions).
  32614. */
  32615. part._readableState.sync = false
  32616. part.on('data', onData)
  32617. part.on('end', onEnd)
  32618. }).on('error', function (err) {
  32619. if (curFile) { curFile.emit('error', err) }
  32620. })
  32621. }).on('error', function (err) {
  32622. boy.emit('error', err)
  32623. }).on('finish', function () {
  32624. finished = true
  32625. checkFinished()
  32626. })
  32627. }
  32628. Multipart.prototype.write = function (chunk, cb) {
  32629. const r = this.parser.write(chunk)
  32630. if (r && !this._pause) {
  32631. cb()
  32632. } else {
  32633. this._needDrain = !r
  32634. this._cb = cb
  32635. }
  32636. }
  32637. Multipart.prototype.end = function () {
  32638. const self = this
  32639. if (self.parser.writable) {
  32640. self.parser.end()
  32641. } else if (!self._boy._done) {
  32642. process.nextTick(function () {
  32643. self._boy._done = true
  32644. self._boy.emit('finish')
  32645. })
  32646. }
  32647. }
  32648. function skipPart (part) {
  32649. part.resume()
  32650. }
  32651. function FileStream (opts) {
  32652. Readable.call(this, opts)
  32653. this.bytesRead = 0
  32654. this.truncated = false
  32655. }
  32656. inherits(FileStream, Readable)
  32657. FileStream.prototype._read = function (n) {}
  32658. module.exports = Multipart
  32659. /***/ }),
  32660. /***/ 8306:
  32661. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32662. "use strict";
  32663. const Decoder = __nccwpck_require__(7100)
  32664. const decodeText = __nccwpck_require__(4619)
  32665. const getLimit = __nccwpck_require__(1467)
  32666. const RE_CHARSET = /^charset$/i
  32667. UrlEncoded.detect = /^application\/x-www-form-urlencoded/i
  32668. function UrlEncoded (boy, cfg) {
  32669. const limits = cfg.limits
  32670. const parsedConType = cfg.parsedConType
  32671. this.boy = boy
  32672. this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32673. this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100)
  32674. this.fieldsLimit = getLimit(limits, 'fields', Infinity)
  32675. let charset
  32676. for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var
  32677. if (Array.isArray(parsedConType[i]) &&
  32678. RE_CHARSET.test(parsedConType[i][0])) {
  32679. charset = parsedConType[i][1].toLowerCase()
  32680. break
  32681. }
  32682. }
  32683. if (charset === undefined) { charset = cfg.defCharset || 'utf8' }
  32684. this.decoder = new Decoder()
  32685. this.charset = charset
  32686. this._fields = 0
  32687. this._state = 'key'
  32688. this._checkingBytes = true
  32689. this._bytesKey = 0
  32690. this._bytesVal = 0
  32691. this._key = ''
  32692. this._val = ''
  32693. this._keyTrunc = false
  32694. this._valTrunc = false
  32695. this._hitLimit = false
  32696. }
  32697. UrlEncoded.prototype.write = function (data, cb) {
  32698. if (this._fields === this.fieldsLimit) {
  32699. if (!this.boy.hitFieldsLimit) {
  32700. this.boy.hitFieldsLimit = true
  32701. this.boy.emit('fieldsLimit')
  32702. }
  32703. return cb()
  32704. }
  32705. let idxeq; let idxamp; let i; let p = 0; const len = data.length
  32706. while (p < len) {
  32707. if (this._state === 'key') {
  32708. idxeq = idxamp = undefined
  32709. for (i = p; i < len; ++i) {
  32710. if (!this._checkingBytes) { ++p }
  32711. if (data[i] === 0x3D/* = */) {
  32712. idxeq = i
  32713. break
  32714. } else if (data[i] === 0x26/* & */) {
  32715. idxamp = i
  32716. break
  32717. }
  32718. if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {
  32719. this._hitLimit = true
  32720. break
  32721. } else if (this._checkingBytes) { ++this._bytesKey }
  32722. }
  32723. if (idxeq !== undefined) {
  32724. // key with assignment
  32725. if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) }
  32726. this._state = 'val'
  32727. this._hitLimit = false
  32728. this._checkingBytes = true
  32729. this._val = ''
  32730. this._bytesVal = 0
  32731. this._valTrunc = false
  32732. this.decoder.reset()
  32733. p = idxeq + 1
  32734. } else if (idxamp !== undefined) {
  32735. // key with no assignment
  32736. ++this._fields
  32737. let key; const keyTrunc = this._keyTrunc
  32738. if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key }
  32739. this._hitLimit = false
  32740. this._checkingBytes = true
  32741. this._key = ''
  32742. this._bytesKey = 0
  32743. this._keyTrunc = false
  32744. this.decoder.reset()
  32745. if (key.length) {
  32746. this.boy.emit('field', decodeText(key, 'binary', this.charset),
  32747. '',
  32748. keyTrunc,
  32749. false)
  32750. }
  32751. p = idxamp + 1
  32752. if (this._fields === this.fieldsLimit) { return cb() }
  32753. } else if (this._hitLimit) {
  32754. // we may not have hit the actual limit if there are encoded bytes...
  32755. if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) }
  32756. p = i
  32757. if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {
  32758. // yep, we actually did hit the limit
  32759. this._checkingBytes = false
  32760. this._keyTrunc = true
  32761. }
  32762. } else {
  32763. if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) }
  32764. p = len
  32765. }
  32766. } else {
  32767. idxamp = undefined
  32768. for (i = p; i < len; ++i) {
  32769. if (!this._checkingBytes) { ++p }
  32770. if (data[i] === 0x26/* & */) {
  32771. idxamp = i
  32772. break
  32773. }
  32774. if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {
  32775. this._hitLimit = true
  32776. break
  32777. } else if (this._checkingBytes) { ++this._bytesVal }
  32778. }
  32779. if (idxamp !== undefined) {
  32780. ++this._fields
  32781. if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) }
  32782. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32783. decodeText(this._val, 'binary', this.charset),
  32784. this._keyTrunc,
  32785. this._valTrunc)
  32786. this._state = 'key'
  32787. this._hitLimit = false
  32788. this._checkingBytes = true
  32789. this._key = ''
  32790. this._bytesKey = 0
  32791. this._keyTrunc = false
  32792. this.decoder.reset()
  32793. p = idxamp + 1
  32794. if (this._fields === this.fieldsLimit) { return cb() }
  32795. } else if (this._hitLimit) {
  32796. // we may not have hit the actual limit if there are encoded bytes...
  32797. if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) }
  32798. p = i
  32799. if ((this._val === '' && this.fieldSizeLimit === 0) ||
  32800. (this._bytesVal = this._val.length) === this.fieldSizeLimit) {
  32801. // yep, we actually did hit the limit
  32802. this._checkingBytes = false
  32803. this._valTrunc = true
  32804. }
  32805. } else {
  32806. if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) }
  32807. p = len
  32808. }
  32809. }
  32810. }
  32811. cb()
  32812. }
  32813. UrlEncoded.prototype.end = function () {
  32814. if (this.boy._done) { return }
  32815. if (this._state === 'key' && this._key.length > 0) {
  32816. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32817. '',
  32818. this._keyTrunc,
  32819. false)
  32820. } else if (this._state === 'val') {
  32821. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32822. decodeText(this._val, 'binary', this.charset),
  32823. this._keyTrunc,
  32824. this._valTrunc)
  32825. }
  32826. this.boy._done = true
  32827. this.boy.emit('finish')
  32828. }
  32829. module.exports = UrlEncoded
  32830. /***/ }),
  32831. /***/ 7100:
  32832. /***/ ((module) => {
  32833. "use strict";
  32834. const RE_PLUS = /\+/g
  32835. const HEX = [
  32836. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32837. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32838. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32839. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
  32840. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32841. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32842. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32843. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  32844. ]
  32845. function Decoder () {
  32846. this.buffer = undefined
  32847. }
  32848. Decoder.prototype.write = function (str) {
  32849. // Replace '+' with ' ' before decoding
  32850. str = str.replace(RE_PLUS, ' ')
  32851. let res = ''
  32852. let i = 0; let p = 0; const len = str.length
  32853. for (; i < len; ++i) {
  32854. if (this.buffer !== undefined) {
  32855. if (!HEX[str.charCodeAt(i)]) {
  32856. res += '%' + this.buffer
  32857. this.buffer = undefined
  32858. --i // retry character
  32859. } else {
  32860. this.buffer += str[i]
  32861. ++p
  32862. if (this.buffer.length === 2) {
  32863. res += String.fromCharCode(parseInt(this.buffer, 16))
  32864. this.buffer = undefined
  32865. }
  32866. }
  32867. } else if (str[i] === '%') {
  32868. if (i > p) {
  32869. res += str.substring(p, i)
  32870. p = i
  32871. }
  32872. this.buffer = ''
  32873. ++p
  32874. }
  32875. }
  32876. if (p < len && this.buffer === undefined) { res += str.substring(p) }
  32877. return res
  32878. }
  32879. Decoder.prototype.reset = function () {
  32880. this.buffer = undefined
  32881. }
  32882. module.exports = Decoder
  32883. /***/ }),
  32884. /***/ 8647:
  32885. /***/ ((module) => {
  32886. "use strict";
  32887. module.exports = function basename (path) {
  32888. if (typeof path !== 'string') { return '' }
  32889. for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var
  32890. switch (path.charCodeAt(i)) {
  32891. case 0x2F: // '/'
  32892. case 0x5C: // '\'
  32893. path = path.slice(i + 1)
  32894. return (path === '..' || path === '.' ? '' : path)
  32895. }
  32896. }
  32897. return (path === '..' || path === '.' ? '' : path)
  32898. }
  32899. /***/ }),
  32900. /***/ 4619:
  32901. /***/ (function(module) {
  32902. "use strict";
  32903. // Node has always utf-8
  32904. const utf8Decoder = new TextDecoder('utf-8')
  32905. const textDecoders = new Map([
  32906. ['utf-8', utf8Decoder],
  32907. ['utf8', utf8Decoder]
  32908. ])
  32909. function getDecoder (charset) {
  32910. let lc
  32911. while (true) {
  32912. switch (charset) {
  32913. case 'utf-8':
  32914. case 'utf8':
  32915. return decoders.utf8
  32916. case 'latin1':
  32917. case 'ascii': // TODO: Make these a separate, strict decoder?
  32918. case 'us-ascii':
  32919. case 'iso-8859-1':
  32920. case 'iso8859-1':
  32921. case 'iso88591':
  32922. case 'iso_8859-1':
  32923. case 'windows-1252':
  32924. case 'iso_8859-1:1987':
  32925. case 'cp1252':
  32926. case 'x-cp1252':
  32927. return decoders.latin1
  32928. case 'utf16le':
  32929. case 'utf-16le':
  32930. case 'ucs2':
  32931. case 'ucs-2':
  32932. return decoders.utf16le
  32933. case 'base64':
  32934. return decoders.base64
  32935. default:
  32936. if (lc === undefined) {
  32937. lc = true
  32938. charset = charset.toLowerCase()
  32939. continue
  32940. }
  32941. return decoders.other.bind(charset)
  32942. }
  32943. }
  32944. }
  32945. const decoders = {
  32946. utf8: (data, sourceEncoding) => {
  32947. if (data.length === 0) {
  32948. return ''
  32949. }
  32950. if (typeof data === 'string') {
  32951. data = Buffer.from(data, sourceEncoding)
  32952. }
  32953. return data.utf8Slice(0, data.length)
  32954. },
  32955. latin1: (data, sourceEncoding) => {
  32956. if (data.length === 0) {
  32957. return ''
  32958. }
  32959. if (typeof data === 'string') {
  32960. return data
  32961. }
  32962. return data.latin1Slice(0, data.length)
  32963. },
  32964. utf16le: (data, sourceEncoding) => {
  32965. if (data.length === 0) {
  32966. return ''
  32967. }
  32968. if (typeof data === 'string') {
  32969. data = Buffer.from(data, sourceEncoding)
  32970. }
  32971. return data.ucs2Slice(0, data.length)
  32972. },
  32973. base64: (data, sourceEncoding) => {
  32974. if (data.length === 0) {
  32975. return ''
  32976. }
  32977. if (typeof data === 'string') {
  32978. data = Buffer.from(data, sourceEncoding)
  32979. }
  32980. return data.base64Slice(0, data.length)
  32981. },
  32982. other: (data, sourceEncoding) => {
  32983. if (data.length === 0) {
  32984. return ''
  32985. }
  32986. if (typeof data === 'string') {
  32987. data = Buffer.from(data, sourceEncoding)
  32988. }
  32989. if (textDecoders.has(this.toString())) {
  32990. try {
  32991. return textDecoders.get(this).decode(data)
  32992. } catch {}
  32993. }
  32994. return typeof data === 'string'
  32995. ? data
  32996. : data.toString()
  32997. }
  32998. }
  32999. function decodeText (text, sourceEncoding, destEncoding) {
  33000. if (text) {
  33001. return getDecoder(destEncoding)(text, sourceEncoding)
  33002. }
  33003. return text
  33004. }
  33005. module.exports = decodeText
  33006. /***/ }),
  33007. /***/ 1467:
  33008. /***/ ((module) => {
  33009. "use strict";
  33010. module.exports = function getLimit (limits, name, defaultLimit) {
  33011. if (
  33012. !limits ||
  33013. limits[name] === undefined ||
  33014. limits[name] === null
  33015. ) { return defaultLimit }
  33016. if (
  33017. typeof limits[name] !== 'number' ||
  33018. isNaN(limits[name])
  33019. ) { throw new TypeError('Limit ' + name + ' is not a valid number') }
  33020. return limits[name]
  33021. }
  33022. /***/ }),
  33023. /***/ 1854:
  33024. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  33025. "use strict";
  33026. /* eslint-disable object-property-newline */
  33027. const decodeText = __nccwpck_require__(4619)
  33028. const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g
  33029. const EncodedLookup = {
  33030. '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04',
  33031. '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09',
  33032. '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c',
  33033. '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e',
  33034. '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12',
  33035. '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17',
  33036. '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b',
  33037. '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d',
  33038. '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20',
  33039. '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25',
  33040. '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a',
  33041. '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c',
  33042. '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f',
  33043. '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33',
  33044. '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38',
  33045. '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b',
  33046. '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e',
  33047. '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41',
  33048. '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46',
  33049. '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a',
  33050. '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d',
  33051. '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f',
  33052. '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54',
  33053. '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59',
  33054. '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c',
  33055. '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e',
  33056. '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62',
  33057. '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67',
  33058. '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b',
  33059. '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d',
  33060. '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70',
  33061. '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75',
  33062. '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a',
  33063. '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c',
  33064. '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f',
  33065. '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83',
  33066. '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88',
  33067. '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b',
  33068. '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e',
  33069. '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91',
  33070. '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96',
  33071. '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a',
  33072. '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d',
  33073. '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f',
  33074. '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2',
  33075. '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4',
  33076. '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7',
  33077. '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9',
  33078. '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab',
  33079. '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac',
  33080. '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad',
  33081. '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae',
  33082. '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0',
  33083. '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2',
  33084. '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5',
  33085. '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7',
  33086. '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba',
  33087. '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb',
  33088. '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc',
  33089. '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd',
  33090. '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf',
  33091. '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0',
  33092. '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3',
  33093. '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5',
  33094. '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8',
  33095. '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca',
  33096. '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb',
  33097. '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc',
  33098. '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce',
  33099. '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf',
  33100. '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1',
  33101. '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3',
  33102. '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6',
  33103. '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8',
  33104. '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda',
  33105. '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb',
  33106. '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd',
  33107. '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde',
  33108. '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf',
  33109. '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1',
  33110. '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4',
  33111. '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6',
  33112. '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9',
  33113. '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea',
  33114. '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec',
  33115. '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed',
  33116. '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee',
  33117. '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef',
  33118. '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2',
  33119. '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4',
  33120. '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7',
  33121. '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9',
  33122. '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb',
  33123. '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc',
  33124. '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd',
  33125. '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe',
  33126. '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff'
  33127. }
  33128. function encodedReplacer (match) {
  33129. return EncodedLookup[match]
  33130. }
  33131. const STATE_KEY = 0
  33132. const STATE_VALUE = 1
  33133. const STATE_CHARSET = 2
  33134. const STATE_LANG = 3
  33135. function parseParams (str) {
  33136. const res = []
  33137. let state = STATE_KEY
  33138. let charset = ''
  33139. let inquote = false
  33140. let escaping = false
  33141. let p = 0
  33142. let tmp = ''
  33143. const len = str.length
  33144. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  33145. const char = str[i]
  33146. if (char === '\\' && inquote) {
  33147. if (escaping) { escaping = false } else {
  33148. escaping = true
  33149. continue
  33150. }
  33151. } else if (char === '"') {
  33152. if (!escaping) {
  33153. if (inquote) {
  33154. inquote = false
  33155. state = STATE_KEY
  33156. } else { inquote = true }
  33157. continue
  33158. } else { escaping = false }
  33159. } else {
  33160. if (escaping && inquote) { tmp += '\\' }
  33161. escaping = false
  33162. if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") {
  33163. if (state === STATE_CHARSET) {
  33164. state = STATE_LANG
  33165. charset = tmp.substring(1)
  33166. } else { state = STATE_VALUE }
  33167. tmp = ''
  33168. continue
  33169. } else if (state === STATE_KEY &&
  33170. (char === '*' || char === '=') &&
  33171. res.length) {
  33172. state = char === '*'
  33173. ? STATE_CHARSET
  33174. : STATE_VALUE
  33175. res[p] = [tmp, undefined]
  33176. tmp = ''
  33177. continue
  33178. } else if (!inquote && char === ';') {
  33179. state = STATE_KEY
  33180. if (charset) {
  33181. if (tmp.length) {
  33182. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  33183. 'binary',
  33184. charset)
  33185. }
  33186. charset = ''
  33187. } else if (tmp.length) {
  33188. tmp = decodeText(tmp, 'binary', 'utf8')
  33189. }
  33190. if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp }
  33191. tmp = ''
  33192. ++p
  33193. continue
  33194. } else if (!inquote && (char === ' ' || char === '\t')) { continue }
  33195. }
  33196. tmp += char
  33197. }
  33198. if (charset && tmp.length) {
  33199. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  33200. 'binary',
  33201. charset)
  33202. } else if (tmp) {
  33203. tmp = decodeText(tmp, 'binary', 'utf8')
  33204. }
  33205. if (res[p] === undefined) {
  33206. if (tmp) { res[p] = tmp }
  33207. } else { res[p][1] = tmp }
  33208. return res
  33209. }
  33210. module.exports = parseParams
  33211. /***/ })
  33212. /******/ });
  33213. /************************************************************************/
  33214. /******/ // The module cache
  33215. /******/ var __webpack_module_cache__ = {};
  33216. /******/
  33217. /******/ // The require function
  33218. /******/ function __nccwpck_require__(moduleId) {
  33219. /******/ // Check if module is in cache
  33220. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  33221. /******/ if (cachedModule !== undefined) {
  33222. /******/ return cachedModule.exports;
  33223. /******/ }
  33224. /******/ // Create a new module (and put it into the cache)
  33225. /******/ var module = __webpack_module_cache__[moduleId] = {
  33226. /******/ // no module.id needed
  33227. /******/ // no module.loaded needed
  33228. /******/ exports: {}
  33229. /******/ };
  33230. /******/
  33231. /******/ // Execute the module function
  33232. /******/ var threw = true;
  33233. /******/ try {
  33234. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
  33235. /******/ threw = false;
  33236. /******/ } finally {
  33237. /******/ if(threw) delete __webpack_module_cache__[moduleId];
  33238. /******/ }
  33239. /******/
  33240. /******/ // Return the exports of the module
  33241. /******/ return module.exports;
  33242. /******/ }
  33243. /******/
  33244. /************************************************************************/
  33245. /******/ /* webpack/runtime/compat */
  33246. /******/
  33247. /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
  33248. /******/
  33249. /************************************************************************/
  33250. /******/
  33251. /******/ // startup
  33252. /******/ // Load entry module and return exports
  33253. /******/ // This entry module is referenced by other modules so it can't be inlined
  33254. /******/ var __webpack_exports__ = __nccwpck_require__(3109);
  33255. /******/ module.exports = __webpack_exports__;
  33256. /******/
  33257. /******/ })()
  33258. ;